/**
 * Hero Achievement Vault (خزينة وسُلّم المراتب — 20 رتبة)
 * Pixel-perfect implementation matching the approved visual luxury showcase.
 * Features: Warm Luxury Topcard, Night Cosmic Stepped Rampart, 3D Wooden Cabinet, Spotlights & 20 Levels.
 */

:root {
  --rank-top-bg: #fffbf5;
  --rank-top-border: #e8dbca;
  --rank-top-shadow: 0 16px 40px rgba(100, 75, 45, 0.12);
  --rank-ink: #1e293b;
  --rank-muted: #64748b;
  --rank-green: #15803d;
  --rank-navy: #1e3a8a;
  --rank-gold: #d97706;
  --rank-gold-light: #fef08a;
  --rank-diamond-blue: #0284c7;
  --rank-diamond-glow: 0 0 24px rgba(2, 132, 199, 0.6);
  --rank-wood-border: #78350f;
  --rank-wood-dark: #451a03;
  --rank-wood-bg: #2e1505;
  --rank-font: 'Cairo', 'Tajawal', sans-serif;
}

/* Page Root */
.ranks-vault-page {
  min-height: 100vh;
  background: #090e17;
  color: #fff;
  font-family: var(--rank-font);
  direction: rtl;
  padding: 16px;
  overflow-x: hidden;
}

.ranks-vault-container {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   1. TOP BANNER: WARM LUXURY BEIGE OVERVIEW & STATS CARD
   ============================================================ */
.ranks-top-card {
  background: linear-gradient(180deg, #fffcf8 0%, #fdf5ea 100%);
  border: 4px solid #ebd9c2;
  border-radius: 28px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  box-shadow: var(--rank-top-shadow), inset 0 2px 6px #ffffff;
  color: var(--rank-ink);
  position: relative;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

/* Student Profile Area */
.ranks-profile-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 2px solid #ecdcc8;
  padding-left: 18px;
  flex-shrink: 0;
}

.ranks-avatar-wrap {
  position: relative;
  width: auto;
  min-width: 80px;
  height: 135px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}
.ranks-avatar-img {
  height: 135px;
  width: auto;
  max-width: 115px;
  object-fit: contain;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
}
.ranks-avatar-wrap:hover .ranks-avatar-img {
  transform: scale(1.08) translateY(-4px);
}
.ranks-avatar-fallback {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  display: grid;
  place-items: center;
  font-size: 52px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}
.ranks-avatar-medal {
  display: none !important;
}

.ranks-student-info h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #1e293b;
  line-height: 1.2;
  white-space: nowrap;
}
.ranks-student-info p {
  margin: 2px 0 5px 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.ranks-student-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* 4 Metrics Counters */
.ranks-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
  min-width: 0;
}

.ranks-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  min-width: 0;
}
.ranks-stat-icon {
  font-size: 22px;
  margin-bottom: 2px;
}
.ranks-stat-label {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}
.ranks-stat-num {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  margin: 2px 0;
}
.ranks-stat-num.num-green {
  color: #16a34a;
}
.ranks-stat-num.num-navy {
  color: #1e3a8a;
}
.ranks-stat-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

/* Current Rank Left Panel */
.ranks-current-panel {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #fed7aa;
  border-radius: 20px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 290px;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.08);
  flex-shrink: 0;
}

.ranks-current-emblem-wrap {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  background: #1a1a2e;
}
.ranks-current-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ranks-current-info {
  flex: 1;
  min-width: 0;
}
.ranks-current-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #c2410c;
  display: block;
  white-space: nowrap;
}
.ranks-current-title {
  font-size: 18px;
  font-weight: 900;
  color: #1e293b;
  margin: 1px 0;
  white-space: nowrap;
}
.ranks-current-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 3px;
  white-space: nowrap;
}
.ranks-current-stars {
  font-size: 12px;
  color: #d97706;
  margin-bottom: 3px;
}
.ranks-current-progressbar {
  height: 8px;
  border-radius: 999px;
  background: #fed7aa;
  overflow: hidden;
  direction: ltr;
  position: relative;
  min-width: 85px;
}
.ranks-current-progressfill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: inherit;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}
.ranks-current-progress-text {
  font-size: 10px;
  font-weight: 800;
  color: #0369a1;
  text-align: center;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
}

/* ============================================================
   2. MIDDLE SECTION: "سُلّم المراتب" (THE STEPPED PODIUM LADDER)
   ============================================================ */
.ranks-ladder-section {
  background: linear-gradient(180deg, #0c1527 0%, #080d1a 100%);
  border: 3px solid #1e293b;
  border-radius: 26px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.ranks-ladder-section:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.08), transparent 70%),
                    radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px;
  pointer-events: none;
}

.ranks-ladder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

.ranks-ladder-title-wrap {
  text-align: center;
  flex: 1;
}
.ranks-ladder-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fde68a;
  font-size: 22px;
  font-weight: 900;
  margin: 0;
  text-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.ranks-ladder-sub {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 700;
}

.btn-ladder-info {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #93c5fd;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-ladder-info:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ============================================================
   2. MIDDLE SECTION: "سُلّم المراتب" (THE STEPPED PODIUM LADDER)
   ============================================================ */
.ranks-ladder-section {
  background: linear-gradient(180deg, #0c1527 0%, #060a14 100%);
  border: 4px solid #1e293b;
  border-radius: 30px;
  padding: 28px 32px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.08);
}
.ranks-ladder-section:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.12), transparent 70%),
                    radial-gradient(rgba(255, 255, 255, 0.2) 1.5px, transparent 1.5px);
  background-size: 100% 100%, 40px 40px;
  pointer-events: none;
}

.ranks-ladder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.ranks-ladder-title-wrap {
  text-align: center;
  flex: 1;
}
.ranks-ladder-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fde68a;
  font-size: 32px;
  font-weight: 900;
  margin: 0;
  text-shadow: 0 4px 18px rgba(245, 158, 11, 0.45);
  letter-spacing: 0.5px;
}
.ranks-ladder-sub {
  margin: 6px 0 0 0;
  font-size: 16px;
  color: #cbd5e1;
  font-weight: 700;
}

.btn-ladder-info {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(147, 197, 253, 0.35);
  color: #bfdbfe;
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.btn-ladder-info:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* Stepped Podium Rail */
.ranks-podium-rail {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  align-items: flex-end;
  min-height: 380px;
  position: relative;
  z-index: 2;
  padding: 10px 0 6px;
}

/* Single Step Column */
.podium-step-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  padding-top: 10px;
}
.podium-step-col:hover {
  transform: translateY(-10px);
}

.podium-step-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 22px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.3px;
  position: relative;
  z-index: 10;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.podium-step-col:hover .podium-step-title {
  transform: translateY(-20px) scale(1.18);
  text-shadow: 0 0 18px currentColor, 0 4px 14px rgba(0,0,0,0.95);
}

.podium-emblem-box {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 14px;
  z-index: 2;
  border-radius: 24px;
  background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.podium-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.podium-step-col:hover .podium-emblem-img {
  transform: scale(1.1) rotate(1.5deg);
  filter: drop-shadow(0 14px 28px rgba(56, 189, 248, 0.6));
}

.podium-locked-icon {
  position: absolute;
  font-size: 34px;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 3px solid #64748b;
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
  transition: all 0.25s ease;
}
.podium-step-col:hover .podium-locked-icon {
  transform: scale(1.15);
  border-color: #f59e0b;
}

/* Stone Step Base */
.podium-stone-step {
  width: 100%;
  background: linear-gradient(180deg, #1e293b 0%, #0a1120 100%);
  border: 3px solid #334155;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 16px 12px 14px;
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  transition: all 0.3s ease;
}
.podium-step-col:hover .podium-stone-step {
  border-color: #64748b;
  background: linear-gradient(180deg, #283548 0%, #0f172a 100%);
  box-shadow: inset 0 4px 12px rgba(255, 255, 255, 0.15), 0 16px 32px rgba(0,0,0,0.8);
}

/* Height Step progression */
.podium-step-col[data-step="1"] .podium-stone-step { min-height: 145px; }
.podium-step-col[data-step="2"] .podium-stone-step { min-height: 170px; }
.podium-step-col[data-step="3"] .podium-stone-step { min-height: 200px; }
.podium-step-col[data-step="4"] .podium-stone-step { min-height: 230px; }
.podium-step-col[data-step="5"] .podium-stone-step { min-height: 260px; }
.podium-step-col[data-step="6"] .podium-stone-step { min-height: 290px; }

/* Active Current Step Glowing */
.podium-step-col.is-current .podium-stone-step {
  background: linear-gradient(180deg, #0c4a6e 0%, #032541 100%);
  border: 3.5px solid #38bdf8;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.6), inset 0 2px 16px rgba(56, 189, 248, 0.4);
}
.podium-step-col.is-current .podium-emblem-img {
  filter: drop-shadow(0 0 28px rgba(56, 189, 248, 0.85));
  animation: float 2.5s ease-in-out infinite;
}

.podium-step-val {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}
.podium-num-arabic {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}
.podium-word-arabic {
  font-size: 15px;
  font-weight: 800;
  color: #e2e8f0;
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}
.podium-status-pill {
  font-size: 13px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 14px;
  white-space: nowrap;
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
}
.podium-status-pill.done {
  background: rgba(22, 163, 74, 0.35);
  color: #4ade80;
  border: 1.5px solid #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}
.podium-status-pill.current {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 16px #38bdf8;
  font-size: 14px;
}
.podium-status-pill.locked {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Crystal-Clear Progress Wrap */
.podium-progress-wrap {
  width: 95%;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.podium-progress-track {
  width: 100%;
  height: 8px;
  background: #082f49;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #38bdf8;
}
.podium-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: inherit;
}
.podium-progress-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  font-family: 'Cairo', 'Tajawal', sans-serif !important;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
  direction: rtl;
}
.podium-prog-current {
  color: #38bdf8;
  font-size: 17px;
  font-weight: 900;
}
.podium-prog-of {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}
.podium-prog-target {
  color: #fde047;
  font-size: 17px;
  font-weight: 900;
}
.podium-prog-unit {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
}

/* ============================================================
   3. BOTTOM SECTION: "خزانة المراتب" (THE WOODEN 20-RANKS CABINET)
   ============================================================ */
.ranks-cabinet-section {
  background: linear-gradient(180deg, #3d1b06 0%, #200d02 100%);
  border: 8px solid #78350f;
  border-radius: 28px;
  padding: 24px;
  box-shadow: inset 0 0 0 4px #451a03, 0 24px 60px rgba(0, 0, 0, 0.7);
  position: relative;
}

/* Carved Wood Header Plaque */
.ranks-cabinet-header {
  text-align: center;
  position: relative;
  margin-top: -38px;
  margin-bottom: 24px;
}
.ranks-cabinet-plaque {
  display: inline-block;
  background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
  border: 4px solid #f59e0b;
  border-radius: 18px;
  padding: 8px 36px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 2px 4px #fde68a;
}
.ranks-cabinet-plaque h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #fef3c7;
}
.ranks-cabinet-plaque p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #fde68a;
  font-weight: 700;
}

/* 20 Levels Grid: Generous 4 columns on desktop, 3 on tablet, 2 on mobile */
.ranks-niches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-height: 640px;
  overflow-y: auto;
  padding: 14px 8px;
  scrollbar-width: thin;
}

/* Individual Large Niche Cubby */
.ranks-niche-box {
  background: linear-gradient(180deg, #1c0c03 0%, #120701 100%);
  border: 4px solid #5c2c06;
  border-radius: 22px;
  min-height: 295px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 14px;
  position: relative;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, 0.85), 0 8px 18px rgba(0, 0, 0, 0.5);
}
.ranks-niche-box:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #f59e0b;
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, 0.9), 0 16px 32px rgba(245, 158, 11, 0.35);
}

/* Overhead Niche Spotlight */
.niche-spotlight {
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 70px;
  background: radial-gradient(ellipse at top, rgba(255, 237, 213, 0.6) 0%, transparent 80%);
  pointer-events: none;
}

/* Completed & Current states */
.ranks-niche-box.is-completed {
  border-color: #b45309;
}
.ranks-niche-box.is-current {
  border-color: #38bdf8;
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.5), inset 0 0 18px rgba(56, 189, 248, 0.25);
}
.ranks-niche-box.is-current .niche-spotlight {
  background: radial-gradient(ellipse at top, rgba(56, 189, 248, 0.9) 0%, transparent 80%);
}

.niche-emblem-wrap {
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  position: relative;
  margin-top: 4px;
}
.niche-emblem-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.75));
  transition: transform 0.28s ease;
}
.ranks-niche-box:hover .niche-emblem-img {
  transform: scale(1.14);
}

.niche-lock-overlay {
  position: absolute;
  font-size: 32px;
  color: #cbd5e1;
  background: rgba(18, 7, 1, 0.75);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 3px solid #78350f;
  box-shadow: 0 6px 14px rgba(0,0,0,0.6);
}

.niche-rank-title {
  font-size: 18px;
  font-weight: 900;
  color: #fef08a;
  margin: 6px 0 2px 0;
  text-align: center;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.niche-rank-sub {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

/* Niche Status Badge */
.niche-status-pill {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.niche-status-pill.done {
  background: rgba(22, 163, 74, 0.3);
  color: #4ade80;
  border: 1.5px solid #22c55e;
}
.niche-status-pill.current {
  background: #0284c7;
  color: #fff;
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
}
.niche-status-pill.locked {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Cabinet Tier Filter Bar */
.ranks-tier-filter-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.btn-tier-filter {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #78350f;
  border-radius: 14px;
  padding: 6px 14px;
  color: #fed7aa;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-tier-filter:hover, .btn-tier-filter.active {
  background: #b45309;
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

/* ============================================================
   4. BOTTOM INTERACTIVE BAR (INFO + COUNTDOWN + ACTION BUTTONS)
   ============================================================ */
.ranks-bottom-bar {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr auto;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}

/* How to level up tip card */
.ranks-info-card {
  background: #fdf5ea;
  border: 2px solid #ebd9c2;
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #451a03;
}
.ranks-info-card-icon {
  font-size: 26px;
}
.ranks-info-card-text b {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: #78350f;
}
.ranks-info-card-text p {
  margin: 2px 0 0 0;
  font-size: 11px;
  font-weight: 700;
  color: #8c6d53;
}

/* Next Level Motivation Banner */
.ranks-motivation-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 2px solid #6366f1;
  border-radius: 16px;
  padding: 12px 18px;
  text-align: center;
  color: #e0e7ff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.ranks-motivation-banner strong {
  color: #fde047;
  font-size: 15px;
}

/* Action Buttons */
.ranks-actions-row {
  display: flex;
  gap: 10px;
}

.btn-rank-action {
  border: 0;
  border-radius: 16px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-rank-action.share {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.btn-rank-action.share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
}
.btn-rank-action.card {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-rank-action.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

/* Multi-App Share Buttons inside Modal */
.vault-share-apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.btn-share-app {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: all 0.2s ease;
  color: #ffffff;
}
.btn-share-app:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.btn-share-app.whatsapp {
  background: #25D366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
.btn-share-app.telegram {
  background: #0088cc;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35);
}
.btn-share-app.native {
  background: #6366f1;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-share-app.copy {
  background: #475569;
  box-shadow: 0 4px 14px rgba(71, 85, 105, 0.35);
}
.btn-share-app.download {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  font-size: 16px;
  font-weight: 900;
  padding: 14px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* ============================================================
   5. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1060px) {
  .ranks-top-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "profile current"
      "stats stats";
    gap: 16px;
  }
  .ranks-profile-zone {
    grid-area: profile;
    border-left: none;
    padding-left: 0;
  }
  .ranks-current-panel {
    grid-area: current;
  }
  .ranks-stats-grid {
    grid-area: stats;
    border-top: 2px solid #ecdcc8;
    padding-top: 14px;
  }
  .ranks-niches-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .ranks-bottom-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ranks-top-card {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 14px;
  }
  .ranks-profile-zone,
  .ranks-current-panel,
  .ranks-stats-grid {
    grid-area: auto;
  }
  .ranks-profile-zone {
    border-left: none;
    padding-left: 0;
    border-bottom: 2px solid #ecdcc8;
    padding-bottom: 14px;
    justify-content: center;
    text-align: center;
  }
  .ranks-current-panel {
    max-width: 100%;
    justify-content: center;
  }
  .ranks-stats-grid {
    border-top: none;
    padding-top: 0;
    grid-template-columns: repeat(2, 1fr);
  }
  .ranks-podium-rail {
    grid-template-columns: repeat(3, 1fr);
    min-height: auto;
    gap: 10px;
  }
  .ranks-niches-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .ranks-niche-box {
    min-height: 260px;
    padding: 14px 10px 10px;
  }
  .niche-emblem-wrap {
    width: 100px;
    height: 100px;
  }
  .niche-emblem-img {
    width: 96px;
    height: 96px;
  }
  .niche-rank-title {
    font-size: 16px;
  }
}

/* ============================================================
   6. MODALS, POPUPS & TOAST SYSTEM
   ============================================================ */
.vault-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 25, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.vault-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.vault-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 92%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 4px solid #cbd5e1;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.5);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  font-family: var(--rank-font);
  color: var(--rank-ink);
}
.vault-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.vault-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
}
.vault-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: rotate(90deg);
}

/* Toast Message */
.vault-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 2px solid #38bdf8;
  border-radius: 20px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 800;
  font-family: var(--rank-font);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.4);
  z-index: 999999;
  direction: rtl;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.vault-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
