/* ==========================================================================
   CosmoLab Space Academy — Brand Design System
   Theme: Tactile Glassmorphism & Cosmic Playfulness
   Guidelines: stitch_cosmolab_interactive_space_academy (DESIGN.md)
   ========================================================================== */

/* --- Google Fonts: Quicksand Rounded Terminals --- */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=swap');

/* --- Brand Design Tokens (DESIGN.md) --- */
:root {
  --font-family: 'Quicksand', sans-serif;

  /* Colors Palettes */
  --bg-infinity: #140d30;                   /* Deep Space Neutral */
  --color-primary: #cdbdff;                 /* Soft Lavender */
  --color-on-primary: #370096;
  --color-primary-container: #7c4dff;       /* Nebula Purple Accent */
  --color-on-primary-container: #fcf6ff;
  
  --color-secondary: #bdf4ff;               /* Light Cosmic Blue */
  --color-on-secondary: #00363d;
  --color-secondary-container: #00e3fd;     /* Glowing Cyan */
  --color-on-secondary-container: #00616d;
  
  --color-tertiary: #eac400;                /* Star Yellow Achievement */
  --color-on-tertiary: #3a3000;
  --color-tertiary-container: #caa900;
  
  --bg-surface: #1d1639;                    /* Surface Container Low */
  --bg-surface-high: #2b2548;               /* Surface Container High */
  
  --text-primary: #ffffff;
  --text-secondary: #cac3d8;
  --text-muted: #948ea1;
  --color-error: #ffb4ab;
  --color-success: #4ade80;

  /* Elevation & Tactile Depth */
  --glass-bg: rgba(29, 22, 57, 0.65);
  --glass-border: rgba(255, 255, 255, 0.15); /* 20% White Border Inner Glow */
  --glass-border-active: rgba(0, 227, 253, 0.4);
  --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  
  --transition-tactile: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-fast: all 0.15s ease;

  /* Responsive Design Tokens */
  --avatar-size: 200px;
  --avatar-font-size: 25px;
  --card-padding: 24px;
}

/* --- Base & Scrollbar Overrides --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-weight: 500; /* Medium for high legibility against glass effect */
  background-color: var(--bg-infinity);
  background-image: radial-gradient(circle at 50% 50%, #211a3d 0%, #140d30 100%);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Scrollbar Customization for Spaceship Hull feeling */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
::-webkit-scrollbar-track {
  background: var(--bg-infinity);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary-container);
  border-radius: 99px;
}

h1, h2, h3, h4 {
  font-weight: 700; /* Always Bold for strong visual hierarchy */
  letter-spacing: -0.01em;
}

p {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Interactive Cosmic Starfield Background --- */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: transparent;
  opacity: 0.35;
}

.stars-bg::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(1.5px 1.5px at 40px 60px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 200px 150px, #bdf4ff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 100px 300px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
    radial-gradient(2.5px 2.5px at 380px 220px, #cdbdff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 480px 400px, #fff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 500px 500px;
  animation: zeroGravityFloatStars 180s linear infinite;
}

@keyframes zeroGravityFloatStars {
  from { transform: translateY(0); }
  to { transform: translateY(-500px); }
}

/* --- Grade Bento Card (Premium Cosmic Glassmorphism & Adaptive Layout) --- */
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes orbitSpinReverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
@keyframes bentoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes bentoFloatDelay {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* Top Illustration Image (aligns bento elements towards the bottom) */
.grade-top-illustration {
  width: 100%;
  height: clamp(220px, 35vh, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0; /* Edge-to-edge full width display */
  flex-shrink: 0;
  animation: zeroGFloat 6s ease-in-out infinite;
}

.grade-top-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover the entire illustration block area */
  filter: drop-shadow(0 8px 30px rgba(124, 77, 255, 0.5));
}

.grade-bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px 16px 112px 16px;
  margin-top: -44px;
  flex: 1;
  align-content: start; /* Keep the grade cards lifted into the hero image area */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 3;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.grade-bento-grid::-webkit-scrollbar {
  width: 0;
}

.grade-bottom-spacer {
  height: 18px;
  flex-shrink: 0;
}

.grade-bento-card {
  background: linear-gradient(135deg, rgba(29, 22, 57, 0.7) 0%, rgba(15, 8, 43, 0.8) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  padding: clamp(14px, 4vw, 22px) clamp(8px, 2vw, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: bentoFloat 4s ease-in-out infinite;
  position: relative;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.grade-bento-card:nth-child(2),
.grade-bento-card:nth-child(4) {
  animation: bentoFloatDelay 5s ease-in-out 1s infinite;
}

.grade-bento-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent, var(--glass-border));
  box-shadow: 0 0 28px var(--glow, rgba(124,77,255,0.25));
}

.grade-bento-card:active {
  transform: scale(0.96);
  transition-duration: 0.1s;
}

.grade-bento-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15), 0 0 20px var(--glow);
}

/* Planet Emoji Container & Backdrop Glow */
.planet-emoji-container {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
}

.grade-bento-card:hover .planet-emoji-container {
  transform: scale(1.08) translateY(-2px);
}

.planet-glow-backdrop {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(22px);
  opacity: 0.18;
  z-index: 0;
  transition: all 0.4s ease;
}

.grade-bento-card:hover .planet-glow-backdrop {
  opacity: 0.45;
  filter: blur(26px);
  transform: scale(1.15);
}

.planet-emoji {
  font-size: 54px;
  z-index: 1;
  line-height: 1;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.grade-bento-card:hover .planet-emoji {
  transform: scale(1.1) rotate(6deg);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.4)) drop-shadow(0 0 8px var(--accent));
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  animation: orbitSpin 14s linear infinite;
  transition: all 0.4s ease;
}

.orbit-ring-reverse {
  animation-name: orbitSpinReverse;
}

.grade-bento-card:hover .orbit-ring {
  border-color: var(--accent);
  animation-duration: 6s;
  box-shadow: 0 0 10px var(--glow);
}

.grade-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent, #140d30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 0 10px var(--glow);
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.grade-bento-card:hover .grade-badge {
  transform: scale(1.1) translate(2px, -2px);
  box-shadow: 0 0 16px var(--accent);
}

/* Card Content Styling */
.grade-bento-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.grade-bento-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
  padding: 0 4px;
}

.grade-bento-btn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1.5px solid var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
  transition: all 0.25s ease;
  user-select: none;
  margin-top: auto; /* Aligns buttons uniformly to bottom */
}

.grade-bento-card:hover .grade-bento-btn {
  background: var(--accent);
  color: var(--on-accent, #140d30) !important;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transform: scale(1.05);
}

@media (max-height: 760px) {
  .grade-top-illustration {
    height: clamp(150px, 25vh, 190px);
  }

  .grade-bento-grid {
    gap: 12px;
    padding: 10px 14px 96px;
    margin-top: -34px;
  }

  .grade-bento-card {
    min-height: 166px;
    border-radius: 20px;
    padding: 12px 8px;
  }

  .planet-emoji-container {
    width: 72px;
    height: 72px;
    margin-bottom: 7px;
  }

  .planet-emoji {
    font-size: 39px;
  }

  .grade-bento-name {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .grade-bento-desc {
    font-size: 10.5px;
    margin-bottom: 8px;
  }

  .grade-bento-btn {
    max-width: 100%;
    font-size: 8px;
    padding: 6px 10px;
    white-space: nowrap;
  }
}

@media (max-height: 640px) {
  .grade-top-illustration {
    height: clamp(118px, 20vh, 145px) !important;
  }

  .grade-bento-grid {
    gap: 8px !important;
    padding: 8px 10px 88px !important;
    margin-top: -26px !important;
  }

  .grade-bento-card {
    min-height: 138px;
    border-radius: 18px !important;
    padding: 8px 5px !important;
  }

  .planet-emoji-container {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 4px !important;
  }

  .planet-emoji {
    font-size: 31px !important;
  }

  .grade-badge {
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
  }

  .grade-bento-name {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }

  .grade-bento-desc {
    font-size: 9px !important;
    margin-bottom: 5px !important;
    line-height: 1.2;
  }

  .grade-bento-btn {
    font-size: 7px !important;
    padding: 5px 8px !important;
    letter-spacing: 0.03em;
  }
}

/* Extremely responsive viewport support for very narrow screens (iPhone SE, etc.) */
@media (max-width: 375px) {
  .grade-bento-card {
    padding: 12px 6px;
    border-radius: 20px;
  }
  .grade-hero {
    padding: 20px 10px 10px 10px;
  }
  .grade-hero h2 {
    font-size: 22px;
  }
  .grade-bento-name {
    font-size: 17px;
    margin-bottom: 4px;
  }
  .grade-bento-desc {
    font-size: 11px;
    margin-bottom: 10px;
  }
  .grade-bento-btn {
    font-size: 9px;
    padding: 6px 10px;
  }
  .planet-emoji-container {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 8px !important;
  }
  .planet-emoji {
    font-size: 42px !important;
  }
  .grade-badge {
    width: 24px !important;
    height: 24px !important;
    font-size: 13px !important;
  }
}


/* --- Main Layout Wrapper --- */
.app-container {
  max-width: 480px;
  height: 100vh;
  max-height: 100vh;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: rgba(20, 13, 48, 0.4);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.7);
  border-left: 2px solid var(--glass-border);
  border-right: 2px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Raketa parvoz qilganda tepada professional tarzda yashirinishi uchun */
}

/* --- Screen Transitions --- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  animation: screenFadeIn 0.4s ease-out;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* --- Frosted Tactile Glassmorphism Card --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--glass-border); /* Thick 2px stroke simulating cockpit windows */
  border-radius: 24px; /* rounded-xl (24px on mobile) */
  padding: 24px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-tactile);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* --- Space-Themed Dashboard Buttons --- */
.btn-primary {
  width: 100%;
  padding: 18px 32px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-on-primary-container);
  
  /* Pill-shaped with custom 3D extrusion gradient (Nebula Purple to Glowing Cyan Accent) */
  background: linear-gradient(135deg, var(--color-primary-container) 0%, #a67cff 50%, var(--color-secondary-container) 100%);
  border: none;
  border-radius: 9999px; /* Pill-shaped (fully rounded) */
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  
  /* Inner and Outer Glow */
  box-shadow: 
    0 4px 0px #5c27db, /* Extrusion 3D layer */
    0 10px 25px rgba(124, 77, 255, 0.45);
  transition: var(--transition-tactile);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 0px #5c27db,
    0 12px 30px rgba(124, 77, 255, 0.6);
}

/* Active pressed state: Sinks into dashboard console */
.btn-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 
    0 0px 0px #5c27db,
    0 4px 15px rgba(124, 77, 255, 0.3);
}

.btn-primary:disabled {
  background: var(--bg-surface-high);
  color: var(--text-muted);
  box-shadow: none;
  border: 2px solid var(--glass-border);
  cursor: not-allowed;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-text:hover {
  color: var(--text-primary);
  transform: translateX(-2px);
}

/* --- Zero-Gravity Float Animation (DESIGN.md) --- */
.float-zero-g {
  animation: zeroGFloat 5s ease-in-out infinite;
}

@keyframes zeroGFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

/* --- Splash Screen Elements --- */
.splash-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* Ekran ostiga yaqinlashtirish */
  flex: 1;
  padding-bottom: 64px; /* Sal yopishib qolmasligi uchun pastdan bo'shliq */
}

.rocket-container {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  z-index: 2;
  transition: transform 1.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* Progress bar bilan proporsional va silliq sinxron ko'tarilish */
}

.rocket-icon {
  font-size: 130px; /* Majozba o'lchamga kattalashtirildi */
  filter: drop-shadow(0 0 40px rgba(124, 77, 255, 0.6));
  transform: rotate(-45deg); /* To'g'ri TEPAGA qaratish */
  display: block;
  z-index: 2;
  user-select: none;
}

.rocket-container.float-zero-g {
  animation: zeroGFloatRocket 4s ease-in-out infinite;
}

@keyframes zeroGFloatRocket {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

/* Blast Off! parvoz xususiyatlari endi JS tomonidan sinxron va barqaror transform orqali boshqariladi */

/* Progress Fuel cells Gauges (DESIGN.md) */
.progress-bar-container {
  width: 100%;
  height: 20px; /* Cylindrical Fuel Cell Shape */
  background: rgba(29, 22, 57, 0.9);
  border: 2px solid var(--glass-border);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 36px;
  padding: 3px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  
  /* Glowing Cyan Liquid Gradient */
  background: linear-gradient(90deg, #009cb0 0%, var(--color-secondary-container) 100%);
  border-radius: 9999px;
  box-shadow: 0 0 15px var(--color-secondary-container);
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Language Cards --- */
#langScreen {
  justify-content: center;
  padding: clamp(18px, 4vh, 32px) 24px !important;
}

#langScreen .avatar-hero-container {
  width: clamp(138px, 32vh, var(--avatar-size));
  height: clamp(138px, 32vh, var(--avatar-size));
}

.lang-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: clamp(20px, 4vh, 32px);
  flex: 0;
  width: 100%;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  border-width: 2px;
  border-radius: 9999px !important; /* To'liq kapsula (pill) shakliga keltirildi */
}

.lang-card.selected {
  border-color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.08);
  box-shadow: 0 0 25px rgba(0, 227, 253, 0.2);
}

.lang-flag {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: var(--transition-fast);
}

.lang-card.selected .lang-flag {
  border-color: var(--color-secondary-container);
  transform: scale(1.08);
}

/* --- Onboarding Slider --- */
.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 16px;
}

.onboarding-image-card {
  width: 290px;
  height: 290px;
  border-radius: 40px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.12);
  background: rgba(29, 22, 57, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(124, 77, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-tactile);
  animation: zeroGFloat 5s ease-in-out infinite;
}

.onboarding-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 36px;
}

.onboarding-skip {
  opacity: 0.7;
  transition: var(--transition-fast);
}

.onboarding-skip:hover {
  opacity: 1;
  color: #fff !important;
}

.onboarding-next-btn {
  background: linear-gradient(135deg, var(--color-primary-container) 0%, #a67cff 50%, var(--color-secondary-container) 100%);
  border: none;
  box-shadow: 
    0 4px 0px #5c27db,
    0 10px 25px rgba(124, 77, 255, 0.45);
}

.slider-dots {
  display: flex;
  gap: 10px;
  margin: 36px 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: var(--transition-tactile);
}

.dot.active {
  width: 32px;
  border-radius: 99px;
  background: var(--color-secondary-container);
  box-shadow: 0 0 12px var(--color-secondary-container);
}

/* --- Grade Space Cards (Saturn & Planet design) --- */
.grade-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 36px 0;
  flex: 1;
}

.grade-card {
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  padding: 18px 24px;
  border-width: 2px;
}

.grade-card.selected {
  border-color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.08);
}

.grade-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  position: relative;
  transition: var(--transition-tactile);
  box-shadow: inset -6px -6px 15px rgba(0,0,0,0.5);
}

.grade-card.selected .grade-circle {
  transform: scale(1.12);
  box-shadow: 
    inset -6px -6px 15px rgba(0,0,0,0.5),
    0 0 30px var(--color-secondary-container);
}

/* --- Authentication Tabs --- */
.auth-screen {
  padding: 24px !important;
  justify-content: center;
  align-items: stretch;
}

.auth-screen.register-mode {
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.auth-card {
  width: 100%;
  padding: 36px 28px 28px;
  border-radius: 36px;
  position: relative;
  margin: 0;
}

.auth-screen.register-mode .auth-card {
  padding: 34px 28px 22px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}

.auth-screen.register-mode #registerForm {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 0 4px 2px 0;
  scrollbar-width: none;
}

.auth-screen.register-mode #registerForm::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.auth-title-block {
  text-align: center;
  margin-top: 36px;
  margin-bottom: 26px;
}

.auth-title-block h2 {
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
  line-height: 1.05;
}

.auth-title-block h2 span {
  color: var(--color-secondary-container);
}

.auth-title-block p {
  max-width: 280px;
  margin: 10px auto 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

@media (max-height: 760px) {
  .auth-screen.register-mode {
    padding: 14px 22px !important;
  }

  .auth-screen.register-mode .auth-card {
    padding: 26px 24px 18px;
    border-radius: 30px;
    max-height: calc(100vh - 28px);
  }

  .auth-screen.register-mode .auth-title-block {
    margin-top: 24px;
    margin-bottom: 16px;
  }

  .auth-screen.register-mode .auth-title-block h2 {
    font-size: 29px;
  }

  .auth-screen.register-mode .auth-title-block p {
    font-size: 12px;
    margin-top: 6px;
  }

  .auth-screen.register-mode #registerForm > div {
    gap: 12px !important;
  }

  .auth-screen.register-mode .auth-input-capsule {
    min-height: 46px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .auth-screen.register-mode .auth-input-wrapper span[style*="font-size: 22px"] {
    font-size: 19px !important;
  }

  .auth-screen.register-mode .register-avatar-card {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .auth-screen.register-mode .register-avatar-card img {
    border-radius: 16px;
  }

  .auth-screen.register-mode #registerAvatarRow {
    gap: 8px !important;
  }

  .auth-screen.register-mode .auth-btn-solid {
    min-height: 52px;
    padding: 13px 22px;
    font-size: 15px;
  }
}

@media (max-height: 640px) {
  .auth-screen.register-mode {
    padding: 10px 18px !important;
  }

  .auth-screen.register-mode .auth-card {
    padding: 20px 18px 14px;
    border-radius: 26px;
    max-height: calc(100vh - 20px);
  }

  .auth-screen.register-mode .auth-card > div:first-child {
    display: none;
  }

  .auth-screen.register-mode .auth-title-block {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .auth-screen.register-mode .auth-title-block h2 {
    font-size: 24px;
  }

  .auth-screen.register-mode .auth-title-block p {
    font-size: 11px;
  }

  .auth-screen.register-mode #registerForm > div {
    gap: 9px !important;
  }

  .auth-screen.register-mode label,
  .auth-screen.register-mode [data-t="choose_avatar_title"] {
    font-size: 9px !important;
    margin-bottom: 4px !important;
  }

  .auth-screen.register-mode .auth-input-capsule {
    min-height: 42px;
    padding: 9px 16px 9px 46px;
    font-size: 13px;
  }

  .auth-screen.register-mode .register-avatar-card {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }

  .auth-screen.register-mode .register-avatar-card img {
    border-radius: 13px;
  }

  .auth-screen.register-mode .auth-btn-solid {
    min-height: 46px;
    padding: 11px 18px;
    font-size: 14px;
  }
}

.auth-tab-btn {
  background: transparent;
  color: var(--text-secondary);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, var(--color-primary-container) 0%, var(--color-secondary-container) 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

/* Auth Input with left icons (screenshot style) */
.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input {
  width: 100%;
  padding: 16px 20px 16px 54px;
  border-radius: 8px; /* Rectangular border style like screenshot */
  background: rgba(15, 8, 43, 0.6);
  border: 1.5px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  transition: var(--transition-fast);
}

.auth-input:focus {
  border-color: var(--color-secondary-container);
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.25);
}

/* Gradient Border action button (screenshot style) */
.auth-btn {
  width: 100%;
  padding: 16px 32px;
  border-radius: 9999px; /* Pill-shaped */
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-tactile);
  background: rgba(29, 22, 57, 0.6);
  border: 2px solid transparent;
  background-image: linear-gradient(rgba(29, 22, 57, 0.6), rgba(29, 22, 57, 0.6)), linear-gradient(135deg, #00e3fd, #7c4dff);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 10px 25px rgba(124, 77, 255, 0.25);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124, 77, 255, 0.4);
}

.auth-btn:active {
  transform: translateY(2px);
}

/* Capsule shaped input fields (screenshot style) */
.auth-input-capsule {
  width: 100%;
  padding: 14px 20px 14px 54px;
  border-radius: 9999px; /* Capsule shape like screenshot */
  background: rgba(15, 8, 43, 0.6);
  border: 1.5px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  outline: none;
  transition: var(--transition-fast);
}

.auth-input-capsule:focus {
  border-color: var(--color-secondary-container);
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.25);
}

/* JINS Segmented Switch (screenshot style) */
.gender-seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}

.gender-seg-btn.active {
  background: #7c4dff !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.4);
}

/* Custom dropdown option styles */
.grade-option {
  color: #fff;
  transition: var(--transition-fast);
}

.grade-option:hover {
  background: rgba(0, 227, 253, 0.12);
  color: var(--color-secondary-container);
}

/* Avatars circular selection with badging */
.register-avatar-card {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: rgba(29, 22, 57, 0.6);
  border: 2.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-tactile);
}

.register-avatar-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.register-avatar-card.active {
  border-color: #00e3fd;
  box-shadow: 0 0 20px rgba(0, 227, 253, 0.45);
}

.register-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #00e3fd;
  color: #140d30;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 0 5px #00e3fd;
}

/* Solid Purple action button (screenshot style) */
.auth-btn-solid {
  width: 100%;
  padding: 16px 32px;
  border-radius: 9999px; /* Pill-shaped */
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 17px;
  color: #370096; /* Dark purple text matching the screenshot */
  background: #a67cff; /* Solid light purple background */
  border: none;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: var(--transition-tactile);
  box-shadow: 0 10px 25px rgba(124, 77, 255, 0.4);
}

.auth-btn-solid:hover {
  transform: translateY(-2px);
  background: #b794ff;
  box-shadow: 0 12px 30px rgba(124, 77, 255, 0.55);
}

.auth-btn-solid:active {
  transform: translateY(2px);
}

/* --- Input Terminals (DESIGN.md) --- */
.name-input {
  width: 100%;
  padding: 18px 24px;
  border-radius: 20px;
  background: #0f082b; /* Container lowest */
  border: 2px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
  transition: var(--transition-fast);
  margin-top: 24px;
}

.name-input:focus {
  border-color: var(--color-secondary-container);
  box-shadow: 
    inset 0 2px 10px rgba(0,0,0,0.6),
    0 0 15px rgba(0, 227, 253, 0.25);
}

.gender-selector {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.gender-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  border-width: 2px;
}

.gender-btn.selected {
  border-color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.08);
}

.gender-icon {
  font-size: 36px;
  margin-bottom: 8px;
  transition: var(--transition-tactile);
}

.gender-btn.selected .gender-icon {
  transform: scale(1.15);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.avatar-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 10px;
  border-width: 2px;
}

.avatar-card.selected {
  border-color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.12);
  box-shadow: 0 0 20px rgba(0, 227, 253, 0.3);
}

.avatar-icon {
  font-size: 36px;
}

/* --- Speed Lines Warp Overlay --- */
.launch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 46%, rgba(0, 227, 253, 0.28), transparent 25%),
    radial-gradient(circle at 66% 18%, rgba(0, 151, 198, 0.24), transparent 34%),
    radial-gradient(circle at 14% 38%, rgba(91, 82, 205, 0.34), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(124, 77, 255, 0.16), transparent 36%),
    linear-gradient(165deg, #10082d 0%, #0b2746 42%, #20145a 100%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.launch-overlay::before,
.launch-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.launch-overlay::before {
  opacity: 0.62;
  background-image:
    radial-gradient(1.4px 1.4px at 24px 54px, rgba(255,255,255,0.78), transparent),
    radial-gradient(2.4px 2.4px at 96px 172px, rgba(189,244,255,0.68), transparent),
    radial-gradient(1px 1px at 218px 92px, rgba(205,189,255,0.74), transparent),
    radial-gradient(1.7px 1.7px at 322px 292px, rgba(255,255,255,0.65), transparent),
    radial-gradient(2px 2px at 390px 515px, rgba(0,227,253,0.58), transparent),
    radial-gradient(1px 1px at 150px 620px, rgba(255, 218, 77, 0.56), transparent);
  background-size: 420px 680px;
  animation: launchStarsDrift 18s linear infinite;
}

.launch-overlay::after {
  background:
    radial-gradient(circle at 50% 46%, rgba(0, 227, 253, 0.2), transparent 22%),
    linear-gradient(158deg, transparent 0 39%, rgba(0, 227, 253, 0.14) 40%, transparent 47%),
    linear-gradient(160deg, transparent 0 66%, rgba(205, 189, 255, 0.12) 67%, transparent 73%);
  filter: blur(0.4px);
  opacity: 0.62;
  animation: launchMeteorSlide 2.8s ease-in-out infinite;
}

.speed-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 46%, rgba(0, 227, 253, 0.34), transparent 15%),
    radial-gradient(circle at 50% 46%, rgba(54, 178, 255, 0.2), transparent 28%),
    radial-gradient(ellipse at 50% 72%, rgba(18, 132, 180, 0.18), transparent 44%);
  opacity: 0.9;
}

.speed-lines::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18%;
  width: 38px;
  height: 136%;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 227, 253, 0.28), rgba(189,244,255,0.18), rgba(0, 227, 253, 0.2), transparent);
  filter: blur(14px);
  animation: launchBeamPulse 1.8s ease-in-out infinite alternate;
}

.speed-lines::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 24%;
  width: 240px;
  height: 240px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 227, 253, 0.3), rgba(45, 80, 180, 0.2) 46%, transparent 68%);
  filter: blur(2px);
  opacity: 0.74;
  animation: launchHaloFloat 2.4s ease-in-out infinite alternate;
}

@keyframes launchStarsDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-160px); }
}

@keyframes launchMeteorSlide {
  0%, 100% { transform: translateY(0); opacity: 0.42; }
  50% { transform: translateY(-28px); opacity: 0.85; }
}

@keyframes launchBeamPulse {
  from { opacity: 0.28; transform: translateX(-50%) scaleX(0.78); }
  to { opacity: 0.82; transform: translateX(-50%) scaleX(1.18); }
}

@keyframes launchHaloFloat {
  from { opacity: 0.48; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 0.82; transform: translate(-50%, -50%) scale(1.06); }
}

.launch-rocket {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-primary);
  filter: drop-shadow(0 0 48px var(--color-secondary-container));
  animation: rocketLaunch 2s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.launch-rocket::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 227, 253, 0.22), transparent 64%),
    conic-gradient(from 120deg, transparent, rgba(124,77,255,0.24), transparent, rgba(0,227,253,0.2), transparent);
  animation: launchPulse 1s ease-in-out infinite alternate;
}

.launch-rocket-body {
  position: relative;
  z-index: 1;
  font-size: 92px;
  line-height: 1;
  transform: rotate(-42deg);
  filter: drop-shadow(0 0 22px rgba(255,255,255,0.5));
}

@keyframes launchPulse {
  from { transform: scale(0.85); opacity: 0.45; }
  to { transform: scale(1.12); opacity: 0.9; }
}

@keyframes rocketLaunch {
  0% { transform: translateY(360px) scale(0.45); opacity: 0; }
  36% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-560px) scale(1.65); opacity: 0; }
}

/* --- Cosmic Spaceship Cockpit Header --- */
.cosmic-header {
  padding: 18px 24px;
  background: rgba(29, 22, 57, 0.85); /* low container */
  border-bottom: 2px solid var(--glass-border);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.user-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0f082b;
  border: 2.5px solid var(--color-secondary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.3);
}

.header-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-tertiary); /* Star Yellow */
  font-weight: 700;
  font-size: 16px;
  filter: drop-shadow(0 0 5px rgba(234, 196, 0, 0.3));
}

/* --- Mission Map (Zero Gravity Path) --- */
.map-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px 120px 24px;
  position: relative;
}

.mission-node-container {
  display: flex;
  justify-content: center;
  position: relative;
}

.mission-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.node-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 3.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-tactile);
  position: relative;
}

.mission-node:hover .node-circle {
  transform: scale(1.1);
}

.mission-node.active .node-circle {
  border-color: var(--color-secondary-container);
  box-shadow: 
    0 0 25px rgba(0, 227, 253, 0.5),
    inset -4px -4px 12px rgba(0,0,0,0.5);
  background: radial-gradient(circle at 35% 35%, var(--color-secondary-container) 0%, var(--bg-infinity) 80%);
}

.mission-node.completed .node-circle {
  border-color: var(--color-success);
  box-shadow: 
    0 0 20px rgba(74, 222, 128, 0.4),
    inset -4px -4px 12px rgba(0,0,0,0.5);
  background: radial-gradient(circle at 35% 35%, var(--color-success) 0%, var(--bg-infinity) 80%);
}

.mission-node.locked {
  cursor: not-allowed;
  opacity: 0.5;
}

.node-label {
  margin-top: 12px;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  max-width: 140px;
  color: var(--text-primary);
}

/* Offset for zig-zag map layout */
.mission-node-container:nth-child(even) .mission-node {
  transform: translateX(-50px);
}

.mission-node-container:nth-child(odd) .mission-node {
  transform: translateX(50px);
}

/* --- Interactive Lesson Page --- */
.lesson-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(0, 227, 253, 0.08), transparent 34%),
    radial-gradient(circle at 28% 42%, rgba(124, 77, 255, 0.14), transparent 38%),
    var(--bg-infinity);
}

.lesson-topbar {
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(20, 13, 48, 0.92);
  border-bottom: 2px solid rgba(124, 77, 255, 0.26);
  box-shadow: 0 6px 24px rgba(124, 77, 255, 0.18);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.lesson-back-btn {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(205, 189, 255, 0.5);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  background: linear-gradient(145deg, rgba(205, 189, 255, 0.2), rgba(124, 77, 255, 0.14));
  box-shadow: inset 0 1px 10px rgba(255,255,255,0.12), 0 8px 18px rgba(124, 77, 255, 0.18);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-tactile);
}

.lesson-back-btn:active {
  transform: scale(0.94);
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.36);
}

.lesson-back-btn .material-symbols-outlined {
  font-size: 28px;
}

.lesson-brand {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 30px;
  line-height: 1;
  color: var(--color-primary);
  letter-spacing: 0;
}

.lesson-brand span {
  color: var(--color-secondary-container);
}

.lesson-stars-pill {
  min-width: 86px;
  height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-tertiary);
  background: rgba(15, 8, 43, 0.78);
  border: 1.5px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.5);
}

.lesson-stars-pill strong {
  color: var(--text-primary);
  font-size: 13px;
}

.lesson-stars-pill .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  font-size: 21px;
}

.lesson-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 20px 22px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lesson-scroll-area::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.lesson-topic-pill {
  width: max-content;
  max-width: 92%;
  margin: 0 auto 14px;
  min-height: 34px;
  padding: 6px 18px 6px 13px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--color-tertiary);
  background:
    linear-gradient(rgba(43, 37, 72, 0.9), rgba(43, 37, 72, 0.9)) padding-box,
    linear-gradient(135deg, var(--color-tertiary), var(--color-secondary-container), var(--color-primary-container)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 18px rgba(234, 196, 0, 0.16), inset 0 1px 10px rgba(255,255,255,0.08);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lesson-topic-pill::before {
  content: "auto_awesome";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-on-secondary);
  background: var(--color-secondary-container);
  font-family: 'Material Symbols Outlined';
  font-size: 15px;
  font-variation-settings: 'FILL' 1;
  box-shadow: 0 0 12px rgba(0, 227, 253, 0.45);
}

.lesson-topic-pill span {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.lesson-topic-pill b {
  color: var(--color-tertiary);
}

.lesson-main-title {
  margin: 0 0 34px;
  color: var(--color-primary);
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.15;
  letter-spacing: 0;
}

.lesson-audio-card {
  min-height: 96px;
  margin-bottom: 28px;
  border-radius: 48px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  gap: 22px;
  background: rgba(43, 37, 72, 0.72);
  border: 1.5px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 18px rgba(255,255,255,0.04);
}

.lesson-play-btn {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--color-primary-container);
  box-shadow: 0 10px 24px rgba(124, 77, 255, 0.35);
}

.lesson-play-btn .material-symbols-outlined {
  font-size: 34px;
  font-variation-settings: 'FILL' 1;
}

.lesson-audio-meta {
  flex: 1;
  min-width: 0;
}

.lesson-audio-meta > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.lesson-audio-meta b {
  color: var(--text-secondary);
}

.lesson-audio-track,
.lesson-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(202, 195, 216, 0.22);
  overflow: hidden;
}

.lesson-audio-track span,
.lesson-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary-container));
  box-shadow: 0 0 14px rgba(0, 227, 253, 0.42);
  transition: width 0.25s ease;
}

.lesson-visual-box {
  width: 100%;
  aspect-ratio: 1;
  min-height: 300px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.lesson-orbit-ring {
  position: absolute;
  width: 94%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.07);
}

.lesson-planet-glow {
  position: absolute;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234,196,0,0.34), rgba(234,196,0,0.16) 42%, transparent 72%);
  filter: blur(18px);
}

.lesson-visual-planet {
  position: relative;
  width: min(55vw, 210px);
  height: min(55vw, 210px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #ffe170, #eac400 58%, #c77700);
  box-shadow: 0 0 46px rgba(234, 196, 0, 0.55), inset -18px -18px 34px rgba(84, 70, 0, 0.32);
  animation: zeroGFloat 6s ease-in-out infinite;
}

.lesson-visual-planet::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image: radial-gradient(circle, rgba(255,255,255,0.7) 1px, transparent 1.4px);
  background-size: 16px 16px;
}

.lesson-visual-planet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.lesson-visual-fallback {
  position: relative;
  z-index: 1;
  font-size: 86px;
  color: #4c3f00;
  font-variation-settings: 'FILL' 1;
}

.lesson-visual-satellite {
  position: absolute;
  left: 31%;
  bottom: 25%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-tertiary);
  box-shadow: 0 0 12px rgba(234,196,0,0.8);
}

.lesson-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.lesson-resource-btn {
  min-height: 104px;
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 28px;
  padding: 14px 8px 12px;
  color: var(--text-primary);
  background: rgba(43, 37, 72, 0.68);
  box-shadow: inset 0 1px 16px rgba(255,255,255,0.04), 0 12px 24px rgba(0,0,0,0.24);
  font-family: var(--font-family);
  display: grid;
  place-items: center;
  gap: 7px;
  position: relative;
  cursor: pointer;
  transition: var(--transition-tactile);
}

.lesson-resource-btn:active {
  transform: scale(0.96);
}

.lesson-resource-btn .resource-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.1);
  font-size: 25px;
  box-shadow: 0 0 16px rgba(0, 227, 253, 0.16);
}

.lesson-resource-btn b {
  font-size: 13px;
  line-height: 1.1;
}

.lesson-resource-btn .resource-check {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--text-muted);
  font-size: 20px;
  opacity: 0.38;
}

.lesson-resource-btn.completed {
  border-color: rgba(74, 222, 128, 0.72);
  background: linear-gradient(145deg, rgba(22, 163, 74, 0.2), rgba(43, 37, 72, 0.72));
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.18), inset 0 1px 16px rgba(255,255,255,0.05);
}

.lesson-resource-btn.completed .resource-check {
  opacity: 1;
  color: #4ade80;
  font-variation-settings: 'FILL' 1;
}

.lesson-completion-card {
  min-height: 66px;
  border-radius: 28px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(43, 37, 72, 0.72);
  border: 1.5px solid rgba(255,255,255,0.12);
  margin-bottom: 28px;
}

.lesson-completion-card > .material-symbols-outlined {
  color: var(--color-tertiary);
  font-size: 28px;
}

.lesson-completion-card b {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}

.lesson-completion-card p {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.lesson-completion-card strong {
  color: var(--color-secondary-container);
  font-size: 15px;
}

.lesson-resource-sheet {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: flex-end;
}

.lesson-sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 8, 43, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lesson-sheet-panel {
  position: relative;
  width: 100%;
  max-height: min(78vh, 680px);
  border-radius: 36px 36px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 227, 253, 0.12), transparent 34%),
    rgba(29, 22, 57, 0.96);
  border: 2px solid rgba(124, 77, 255, 0.46);
  border-bottom: 0;
  box-shadow: 0 -18px 44px rgba(0,0,0,0.52), inset 0 1px 18px rgba(255,255,255,0.05);
  animation: lessonSheetUp 0.24s ease-out;
}

.lesson-sheet-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@keyframes lessonSheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.lesson-sheet-handle {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 14px;
  background: rgba(202, 195, 216, 0.38);
}

.lesson-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lesson-sheet-head span {
  display: block;
  color: var(--color-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lesson-sheet-head h3 {
  margin-top: 3px;
  color: var(--color-secondary-container);
  font-size: 26px;
}

.lesson-sheet-head button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

.lesson-sheet-body {
  margin-bottom: 18px;
}

.lesson-sheet-text {
  border-radius: 30px;
  border: 2px solid rgba(234, 196, 0, 0.72);
  background: rgba(33, 26, 61, 0.72);
  padding: 22px;
}

.lesson-sheet-text > p {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
}

.lesson-sheet-note {
  margin-top: 18px;
  border-radius: 24px;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--color-tertiary);
  background: rgba(234, 196, 0, 0.09);
}

.lesson-sheet-note .material-symbols-outlined {
  font-size: 26px;
}

.lesson-sheet-note p {
  color: var(--color-tertiary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.lesson-sheet-player {
  min-height: 118px;
  border-radius: 34px;
  padding: 22px;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 18px;
  background: rgba(43, 37, 72, 0.82);
  border: 1.5px solid rgba(255,255,255,0.12);
}

.lesson-sheet-play,
.lesson-sheet-video-play {
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--color-primary-container), var(--color-secondary-container));
  box-shadow: 0 10px 28px rgba(0, 227, 253, 0.28);
}

.lesson-sheet-play {
  width: 62px;
  height: 62px;
}

.lesson-sheet-play .material-symbols-outlined,
.lesson-sheet-video-play .material-symbols-outlined {
  font-size: 34px;
  font-variation-settings: 'FILL' 1;
}

.lesson-sheet-player b,
.lesson-sheet-player span {
  display: block;
}

.lesson-sheet-player b {
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 4px;
}

.lesson-sheet-player span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.lesson-sheet-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(202, 195, 216, 0.2);
}

.lesson-sheet-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary-container));
}

.lesson-sheet-video {
  position: relative;
  min-height: 290px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 48%, rgba(0, 227, 253, 0.12), transparent 36%), rgba(15, 8, 43, 0.72);
  border: 1.5px solid rgba(255,255,255,0.1);
}

.lesson-sheet-video-orbit {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 227, 253, 0.58);
  animation: rotateOrbital 18s linear infinite;
}

.lesson-sheet-video-planet {
  width: 172px;
  height: 172px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 44px rgba(0, 227, 253, 0.18);
}

.lesson-sheet-video-planet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-sheet-video-play {
  position: absolute;
  width: 78px;
  height: 78px;
}

.lesson-sheet-done {
  min-height: 62px;
}

.lesson-info-card {
  border: 2.5px solid var(--color-tertiary);
  border-radius: 44px;
  padding: 28px 26px 26px;
  margin-bottom: 24px;
  background: rgba(33, 26, 61, 0.7);
  box-shadow: 0 0 24px rgba(234, 196, 0, 0.08), inset 0 1px 18px rgba(255,255,255,0.04);
}

.lesson-info-card > p {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.lesson-bullet {
  color: var(--text-secondary);
}

.lesson-safety-note {
  margin-top: 22px;
  min-height: 72px;
  border-radius: 30px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(234, 196, 0, 0.09);
  color: var(--color-tertiary);
}

.lesson-safety-note .material-symbols-outlined {
  font-size: 30px;
}

.lesson-safety-note p {
  color: var(--color-tertiary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.lesson-progress-card {
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 24px;
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  background: rgba(43, 37, 72, 0.72);
  border: 1.5px solid rgba(255,255,255,0.12);
}

.lesson-progress-card span,
.lesson-progress-card b {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.lesson-video-btn {
  width: 100%;
  min-height: 78px;
  margin-bottom: 24px;
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 40px;
  background: rgba(54, 48, 84, 0.82);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lesson-video-btn .material-symbols-outlined {
  color: var(--color-secondary);
  font-size: 28px;
}

.lesson-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: rgba(20,13,48,0.98);
  border-top: 1.5px solid rgba(255,255,255,0.08);
  box-shadow: 0 -14px 30px rgba(15, 8, 43, 0.72);
}

.lesson-footer .btn-primary {
  min-height: 76px;
  font-size: 17px;
  text-transform: none;
  letter-spacing: 0;
}

.lesson-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 227, 253, 0.14), transparent 35%),
    rgba(15, 8, 43, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lesson-video-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  padding: 22px 20px 28px;
  overflow-y: auto;
}

.lesson-video-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(1.5px 1.5px at 38px 70px, rgba(255,255,255,0.76), transparent),
    radial-gradient(1px 1px at 290px 116px, rgba(0,227,253,0.8), transparent),
    radial-gradient(1.5px 1.5px at 352px 330px, rgba(234,196,0,0.72), transparent),
    radial-gradient(1px 1px at 86px 458px, rgba(205,189,255,0.7), transparent);
  background-size: 390px 560px;
}

.lesson-video-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.lesson-video-close {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  background: rgba(205, 189, 255, 0.12);
  border: 2px solid rgba(205, 189, 255, 0.38);
  box-shadow: inset 0 1px 10px rgba(255,255,255,0.08);
}

.lesson-video-close .material-symbols-outlined {
  font-size: 30px;
}

.lesson-video-top span {
  display: block;
  color: var(--color-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-video-top h3 {
  margin: 3px 0 0;
  color: var(--color-secondary-container);
  font-size: 28px;
}

.lesson-video-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 330px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 40px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 227, 253, 0.14), transparent 36%),
    linear-gradient(155deg, rgba(33, 26, 61, 0.76), rgba(15, 8, 43, 0.8));
  border: 1.5px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 20px rgba(255,255,255,0.04), 0 18px 44px rgba(0,0,0,0.35);
}

.lesson-video-orbit {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 227, 253, 0.6);
  animation: rotateOrbital 20s linear infinite;
  filter: drop-shadow(0 0 10px rgba(0,227,253,0.45));
}

.lesson-video-planet {
  position: relative;
  z-index: 2;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 35% 28%, #ffe170, #eac400 58%, #8a5b00);
  box-shadow: 0 0 48px rgba(234,196,0,0.36), inset -16px -16px 28px rgba(0,0,0,0.22);
}

.lesson-video-planet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-video-planet .lesson-visual-fallback {
  color: var(--color-secondary-container);
  font-size: 74px;
}

.lesson-video-play {
  position: absolute;
  z-index: 4;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--color-primary-container), var(--color-secondary-container));
  box-shadow: 0 12px 32px rgba(0, 227, 253, 0.34), 0 0 0 10px rgba(255,255,255,0.08);
}

.lesson-video-play .material-symbols-outlined {
  font-size: 42px;
  font-variation-settings: 'FILL' 1;
}

.lesson-video-controls {
  position: relative;
  z-index: 2;
  border-radius: 28px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: rgba(43, 37, 72, 0.76);
  border: 1.5px solid rgba(255,255,255,0.12);
}

.lesson-video-controls > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.lesson-video-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(202, 195, 216, 0.2);
}

.lesson-video-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary-container));
  box-shadow: 0 0 14px rgba(0, 227, 253, 0.48);
  transition: width 0.25s ease;
}

.lesson-video-note {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 26px;
  padding: 16px;
  margin-bottom: 20px;
  background: rgba(234, 196, 0, 0.09);
  color: var(--color-tertiary);
}

.lesson-video-note .material-symbols-outlined {
  font-size: 28px;
}

.lesson-video-note p {
  color: var(--color-tertiary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.lesson-video-done {
  position: relative;
  z-index: 2;
}

@media (max-width: 390px) {
  .lesson-topbar {
    padding-inline: 16px;
  }

  .lesson-brand {
    font-size: 26px;
  }

  .lesson-scroll-area {
    padding-inline: 18px;
  }

  .lesson-audio-card {
    padding-inline: 20px;
  }

  .lesson-info-card {
    border-radius: 36px;
    padding-inline: 22px;
  }

  .lesson-info-card > p {
    font-size: 16px;
  }
}

/* --- Quiz Interactive Command Options (DESIGN.md) --- */
.quiz-shell {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quiz-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.quiz-stage-title {
  min-height: 20px;
  margin: 4px 0 10px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.quiz-progress-row {
  height: 26px;
  margin-bottom: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: rgba(202, 195, 216, 0.26);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.quiz-progress-row #quizProgressText {
  flex: 1;
  padding-right: 16px;
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.quiz-progress-rocket {
  width: 34px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--color-secondary-container);
  background: rgba(15, 8, 43, 0.72);
  font-size: 20px;
}

.quiz-question-card {
  min-height: 84px;
  padding: 24px 24px 24px 82px;
  margin-bottom: 32px;
  border-radius: 26px;
  border-width: 2.5px;
  border-color: rgba(124, 77, 255, 0.3);
  position: relative;
}

.quiz-question-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--color-primary);
  background: rgba(124, 77, 255, 0.34);
  border: 1.5px solid rgba(205, 189, 255, 0.26);
}

.quiz-options-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 12px;
}

.quiz-next-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 10px 24px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(20,13,48,0.16), rgba(20,13,48,0.98) 22%);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -14px 30px rgba(15, 8, 43, 0.62);
}

.quiz-next-footer .btn-primary {
  min-height: 58px;
  box-shadow: 0 4px 0 #5c27db, 0 10px 28px rgba(0, 227, 253, 0.24);
}

.cosmo-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  width: min(100% - 32px, 448px);
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  min-height: 58px;
  border-radius: 22px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-family: var(--font-family);
  font-weight: 700;
  line-height: 1.28;
  opacity: 0;
  animation: cosmoToastIn 0.22s ease-out forwards;
  box-shadow: 0 16px 34px rgba(0,0,0,0.52), inset 0 1px 12px rgba(255,255,255,0.08);
}

.cosmo-toast.correct {
  background: linear-gradient(145deg, rgba(20, 83, 45, 0.96), rgba(22, 163, 74, 0.9));
  border: 2px solid rgba(74, 222, 128, 0.92);
}

.cosmo-toast.incorrect {
  background: linear-gradient(145deg, rgba(127, 29, 29, 0.96), rgba(185, 28, 28, 0.88));
  border: 2px solid rgba(255, 180, 171, 0.92);
}

.cosmo-toast .material-symbols-outlined {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.12);
  font-size: 21px;
  font-variation-settings: 'FILL' 1;
}

@keyframes cosmoToastIn {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Planet Selectors Option Card */
.option-card {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 18px 24px;
  cursor: pointer;
  border-width: 2px;
  border-radius: 22px;
}

.option-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.17);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 15px;
  margin-right: 18px;
}

.option-text {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.option-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.08);
}

.option-card.correct {
  border-color: var(--color-success) !important;
  background: rgba(74, 222, 128, 0.15) !important;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.3) !important;
}

.option-card.incorrect {
  border-color: var(--color-error) !important;
  background: rgba(255, 180, 171, 0.15) !important;
  box-shadow: 0 0 20px rgba(255, 180, 171, 0.3) !important;
}

/* --- Bottom Sheet Modal (Tactile Glassmorphism) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 30%, rgba(124, 77, 255, 0.16), transparent 34%),
    rgba(15, 8, 43, 0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-content {
  width: 100%;
  max-width: 400px;
  min-height: 390px;
  border-radius: 36px;
  padding: 28px 26px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(124, 77, 255, 0.88) !important;
  background:
    linear-gradient(155deg, rgba(33, 26, 61, 0.9), rgba(15, 8, 43, 0.92)),
    var(--glass-bg);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 36px rgba(124, 77, 255, 0.38),
    0 28px 70px rgba(0,0,0,0.56);
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 230px;
  background: radial-gradient(circle, rgba(0, 227, 253, 0.2), transparent 62%);
  pointer-events: none;
}

.modal-starfield {
  position: absolute;
  inset: 0;
  opacity: 0.36;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 34px 42px, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 180px 90px, rgba(189,244,255,0.68), transparent),
    radial-gradient(1.5px 1.5px at 306px 58px, rgba(205,189,255,0.75), transparent),
    radial-gradient(1px 1px at 94px 260px, rgba(255,255,255,0.52), transparent),
    radial-gradient(1.5px 1.5px at 335px 300px, rgba(0,227,253,0.64), transparent);
  background-size: 390px 390px;
}

.modal-icon {
  font-size: 72px;
  color: var(--color-secondary-container);
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(0, 227, 253, 0.4));
  animation: zeroGFloat 4s ease-in-out infinite;
}

.modal-close-btn {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 4;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-planet-stage {
  position: relative;
  z-index: 2;
  width: 138px;
  height: 138px;
  margin: 4px auto 16px;
  display: grid;
  place-items: center;
}

.modal-orbit {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 227, 253, 0.72);
  filter: drop-shadow(0 0 8px rgba(0, 227, 253, 0.46));
  animation: rotateOrbital 16s linear infinite;
}

.modal-rocket-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  transform-origin: center;
  animation: modalRocketOrbit 9s linear infinite;
  pointer-events: none;
}

.modal-rocket {
  display: block;
  font-size: 30px;
  line-height: 1;
  transform: rotate(45deg);
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.42));
}

@keyframes modalRocketOrbit {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateY(-68px);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateY(-68px);
  }
}

.modal-planet-preview {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe170, #eac400 58%, #9b6b00);
  border: 3px solid rgba(255,255,255,0.16);
  box-shadow: 0 0 34px rgba(0, 227, 253, 0.28), 0 0 44px rgba(234, 196, 0, 0.2);
}

.modal-planet-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-planet-fallback,
.modal-planet-preview > .material-symbols-outlined {
  color: var(--color-secondary-container);
  font-size: 50px;
  filter: drop-shadow(0 0 14px rgba(0, 227, 253, 0.55));
}

.modal-kicker {
  position: relative;
  z-index: 2;
  width: max-content;
  margin: 0 auto 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-tertiary);
  background: rgba(76, 63, 0, 0.44);
  border: 1px solid rgba(255, 225, 112, 0.42);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-kicker .material-symbols-outlined {
  font-size: 16px;
}

.modal-content h2 {
  position: relative;
  z-index: 2;
  color: var(--color-secondary-container);
  font-size: 28px;
  line-height: 1.1;
  margin: 0 0 10px;
  text-shadow: 0 0 18px rgba(0, 227, 253, 0.35);
}

.modal-content > p {
  position: relative;
  z-index: 2;
  max-width: 310px;
  margin: 0 auto 18px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.modal-reward-row {
  position: relative;
  z-index: 2;
  min-height: 48px;
  margin: 0 0 20px;
  padding: 9px 12px;
  border-radius: 999px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
}

.modal-reward-row .material-symbols-outlined {
  color: var(--color-secondary-container);
  font-size: 23px;
}

.modal-reward-row b {
  text-align: left;
  font-size: 13px;
}

.modal-reward-row strong {
  color: var(--color-tertiary);
  font-size: 14px;
}

.modal-start-btn {
  position: relative;
  z-index: 2;
  min-height: 58px;
}

.final-test-modal .modal-content {
  border-color: rgba(234, 196, 0, 0.86) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 42px rgba(234, 196, 0, 0.22),
    0 28px 70px rgba(0,0,0,0.58);
}

.final-test-modal .modal-orbit {
  border-color: rgba(234, 196, 0, 0.72);
  filter: drop-shadow(0 0 10px rgba(234, 196, 0, 0.48));
}

.final-test-modal .modal-planet-preview {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 225, 112, 0.95), rgba(124, 77, 255, 0.72) 52%, rgba(15, 8, 43, 0.98));
  box-shadow: 0 0 36px rgba(234, 196, 0, 0.34), 0 0 48px rgba(124, 77, 255, 0.22);
}

.final-test-modal .final-test-icon {
  color: var(--color-tertiary);
  font-size: 56px;
  filter: drop-shadow(0 0 16px rgba(234, 196, 0, 0.62));
}

.final-test-modal .modal-kicker {
  color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.09);
  border-color: rgba(0, 227, 253, 0.36);
}

.final-test-modal .modal-content h2 {
  color: var(--color-tertiary);
  text-shadow: 0 0 18px rgba(234, 196, 0, 0.28);
}

.final-test-modal .modal-reward-row {
  background: rgba(234, 196, 0, 0.09);
  border-color: rgba(234, 196, 0, 0.24);
}

/* --- Settings Command Toggles --- */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-width: 2px;
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-icon {
  font-size: 26px;
  color: var(--color-secondary-container);
}

/* --- Selection Toggle Switch (DESIGN.md) --- */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-success);
  box-shadow: 0 0 12px var(--color-success);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* ==========================================================================
   Language Selection screen.png Brand Integration Styles
   ========================================================================== */
.avatar-hero-container {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(124, 77, 255, 0.3) 0%, rgba(20, 13, 48, 0) 75%);
  border: 4px solid var(--color-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 45px rgba(124, 77, 255, 0.45),
    inset 0 0 35px rgba(124, 77, 255, 0.35);
  position: relative;
  overflow: visible; /* Orbital neon halqa to'liq ko'rinishi uchun */
  transition: var(--transition-tactile);
}

.avatar-hero {
  width: 92%; /* Aylana ichida aylana bo'lib radiuslari bilan chiroyli joylashishi uchun */
  height: 92%;
  object-fit: cover; /* Rasmni aylanaga to'liq moslaydi */
  border-radius: 50%; /* Mukammal aylana ko'rinishiga keltiradi */
  border: 3px solid var(--color-secondary-container); /* Ichki aylananing neon cyan hoshiyasi */
  box-shadow: 0 0 20px rgba(0, 227, 253, 0.4);
  display: block;
}

/* Spherical 3D Flags */
.spherical-flag {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset -6px -6px 12px rgba(0,0,0,0.6),
    0 0 15px rgba(255,255,255,0.15);
  border: 2.5px solid rgba(255,255,255,0.25);
  transition: var(--transition-tactile);
}

.spherical-flag::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45) 0%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.75) 100%);
  z-index: 2;
}

/* Uzbekistan Flag Sphere gradient */
.flag-uz {
  background: linear-gradient(to bottom, 
    #009cb0 0%, #009cb0 33%, 
    #ff3d00 33%, #ff3d00 36%, 
    #ffffff 36%, #ffffff 64%, 
    #ff3d00 64%, #ff3d00 67%, 
    #00b050 67%, #00b050 100%);
}

/* Qaraqalpaqstan Flag Sphere gradient */
.flag-kaa {
  background: linear-gradient(to bottom, 
    #009cb0 0%, #009cb0 32%, 
    #ffed00 32%, #ffed00 35%, 
    #ffed00 35%, #ffed00 45%,
    #ffffff 45%, #ffffff 55%,
    #ffed00 55%, #ffed00 65%,
    #00b050 65%, #00b050 68%, 
    #00b050 68%, #00b050 100%);
}

/* Russian Flag Sphere gradient */
.flag-ru {
  background: linear-gradient(to bottom, 
    #ffffff 0%, #ffffff 33%, 
    #0039a6 33%, #0039a6 66%, 
    #d52b1e 66%, #d52b1e 100%);
}

.lang-card:hover .spherical-flag {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 
    inset -4px -4px 10px rgba(0,0,0,0.5),
    0 0 20px rgba(255,255,255,0.25);
}

/* ==========================================================================
   Dynamic Space Background Elements (screen.png Cosmic Nebulas & Planets)
   ========================================================================== */
.cosmic-nebula {
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.14;
  z-index: 0;
  pointer-events: none;
}

.nebula-purple {
  background: radial-gradient(circle, var(--color-primary-container) 0%, transparent 70%);
  top: 10%;
  left: -120px;
  animation: nebulaPulse 14s ease-in-out infinite alternate;
}

.nebula-blue {
  background: radial-gradient(circle, var(--color-secondary-container) 0%, transparent 70%);
  bottom: 15%;
  right: -120px;
  animation: nebulaPulse 18s ease-in-out infinite alternate-reverse;
}

@keyframes nebulaPulse {
  0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
  50% { transform: scale(1.18) translate(30px, -20px); opacity: 0.18; }
  100% { transform: scale(0.92) translate(-15px, 15px); opacity: 0.12; }
}

/* Floating Planets in background */
.bg-planet {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  user-select: none;
}

.planet-left {
  top: 22%;
  left: -20px;
  font-size: 64px;
  animation: zeroGFloat 9s ease-in-out infinite, spinPlanet 75s linear infinite;
  filter: drop-shadow(0 0 25px rgba(124, 77, 255, 0.35));
}

.planet-right {
  top: 60%;
  right: -10px;
  font-size: 38px;
  animation: zeroGFloatReverse 12s ease-in-out infinite, spinPlanet 55s linear infinite-reverse;
  filter: drop-shadow(0 0 15px rgba(0, 227, 253, 0.3));
}

@keyframes zeroGFloatReverse {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(10px) rotate(-4deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

/* ==========================================================================
   Spaceship Orbital Ring Halo & Twinkling Space Particles Stillari
   ========================================================================== */
.orbital-ring {
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  border: 3px dashed var(--color-secondary-container); /* Dashed neon cyan ring */
  box-shadow: 0 0 20px rgba(0, 227, 253, 0.45);
  animation: rotateOrbital 24s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* 3D Sputnik Satellite orbiting around the boy astronaut */
.orbital-ring::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-secondary-container);
  box-shadow: 
    0 0 14px var(--color-secondary-container),
    0 0 25px rgba(0, 227, 253, 0.8);
  border: 2px solid #fff;
}

@keyframes rotateOrbital {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Twinkling 4-point neon stars */
.twinkle-star {
  position: fixed;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  font-family: serif;
  z-index: 0;
  pointer-events: none;
  animation: starTwinkle 3.5s ease-in-out infinite alternate;
  user-select: none;
}

@keyframes starTwinkle {
  0% { opacity: 0.15; transform: scale(0.7) rotate(0deg); filter: drop-shadow(0 0 2px #fff); }
  100% { opacity: 1; transform: scale(1.3) rotate(20deg); filter: drop-shadow(0 0 10px var(--color-secondary-container)); }
}

.star-pos-1 { top: 12%; left: 24%; animation-delay: 0.1s; color: var(--color-secondary-container); }
.star-pos-2 { top: 38%; left: 85%; animation-delay: 0.7s; color: var(--color-primary-container); }
.star-pos-3 { top: 72%; left: 12%; animation-delay: 1.3s; color: var(--color-tertiary); }
.star-pos-4 { top: 88%; left: 74%; animation-delay: 0.4s; color: #fff; }
.star-pos-5 { top: 22%; left: 78%; animation-delay: 1.9s; color: var(--color-secondary-container); }
.star-pos-6 { top: 55%; left: 5%; animation-delay: 2.2s; color: var(--color-primary-container); }
.star-pos-7 { top: 48%; left: 92%; animation-delay: 0.9s; color: var(--color-tertiary); }
.star-pos-8 { top: 15%; left: 45%; animation-delay: 1.5s; color: #fff; }

/* Shooting Stars Meteorites (DESIGN.md space look) */
.shooting-star {
  position: fixed;
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 227, 253, 0.95), transparent);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transform: rotate(-35deg);
  animation: meteorFly 9s linear infinite;
}

@keyframes meteorFly {
  0% { transform: translate(350px, -120px) rotate(-35deg); opacity: 0; }
  4% { opacity: 0.95; }
  9% { transform: translate(-150px, 220px) rotate(-35deg); opacity: 0; }
  100% { transform: translate(-150px, 220px) rotate(-35deg); opacity: 0; }
}

.star-1 { top: 6%; right: 12%; animation-delay: 1.2s; }
.star-2 { top: 24%; right: 28%; animation-delay: 5s; animation-duration: 7s; }
.star-3 { top: 52%; right: 8%; animation-delay: 8.2s; }

/* ==========================================================================
   Responsive & Fluid Layout Adaptability Styles (screen.png Responsiveness)
   ========================================================================== */

/* Spacing classes replacing inline styles */
.avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 0;
  position: relative;
  transition: var(--transition-tactile);
}

.lang-title-wrapper {
  text-align: center;
  margin-top: clamp(18px, 3vh, 24px);
  padding: 0 16px;
  transition: var(--transition-fast);
}

.lang-main-title {
  font-size: var(--avatar-font-size);
  color: var(--color-secondary-container);
  font-weight: 700;
  transition: var(--transition-fast);
}

.lang-sub-title {
  font-size: 14px;
  margin-top: 6px;
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition-fast);
}

/* Base style adjustments for responsiveness */
.lang-container {
  margin-top: 28px;
  gap: 16px;
  transition: var(--transition-tactile);
}

.lang-card {
  padding: var(--card-padding);
  transition: var(--transition-tactile);
}

/* ==========================================================================
   Responsive Screen Media Queries
   ========================================================================== */

/* Small Height Screen Media Query (iPhone SE, Small Androids) */
@media (max-height: 740px) {
  :root {
    --avatar-size: 140px;
    --avatar-font-size: 21px;
    --card-padding: 16px;
  }
  
  .avatar-wrapper {
    margin-top: 12px;
  }
  
  .lang-title-wrapper {
    margin-top: 14px;
  }
  
  .lang-sub-title {
    font-size: 13px;
  }
  
  .lang-container {
    margin-top: 16px;
    gap: 12px;
  }
  
  .lang-card {
    gap: 14px;
  }
  
  .spherical-flag {
    width: 38px;
    height: 38px;
  }
  
  /* Orbital ring sizing adjustment to match smaller avatar size */
  .orbital-ring {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-width: 2.5px;
  }
  
  .orbital-ring::after {
    width: 10px;
    height: 10px;
    top: 10px;
    left: 10px;
  }
  
  /* Grade Screen Bento Sizing Adjustments */
  .grade-top-illustration {
    height: clamp(160px, 24vh, 210px) !important;
    padding: 0 !important;
  }
  .grade-bento-grid {
    gap: 12px !important;
    padding: 10px 12px 96px 12px !important;
    margin-top: -36px !important;
  }
  .grade-bento-card {
    min-height: 166px !important;
    padding: 10px 6px !important;
    border-radius: 20px !important;
  }
  .planet-emoji-container {
    width: 70px !important;
    height: 70px !important;
    margin-bottom: 6px !important;
  }
  .planet-emoji {
    font-size: 40px !important;
  }
  .grade-badge {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }
  .grade-bento-name {
    font-size: 16px !important;
    margin-bottom: 4px !important;
  }
  .grade-bento-desc {
    font-size: 11px !important;
    margin-bottom: 10px !important;
  }
  .grade-bento-btn {
    font-size: 9px !important;
    padding: 6px 12px !important;
  }

  /* Onboarding Card Sizing for SE devices */
  .onboarding-image-card {
    width: 210px !important;
    height: 210px !important;
    border-radius: 28px !important;
  }
  .onboarding-img {
    border-radius: 24px !important;
  }
}

/* Extremely Small Height Screen Media Query (Very small devices) */
@media (max-height: 640px) {
  :root {
    --avatar-size: 110px;
    --avatar-font-size: 18px;
    --card-padding: 12px;
  }
  
  .avatar-wrapper {
    margin-top: 8px;
  }
  
  .lang-title-wrapper {
    margin-top: 8px;
  }
  
  .lang-sub-title {
    font-size: 12px;
    margin-top: 3px;
  }
  
  .lang-container {
    margin-top: 12px;
    gap: 10px;
  }
  
  .lang-card {
    gap: 10px;
  }
  
  .spherical-flag {
    width: 32px;
    height: 32px;
  }
  
  /* Orbital ring sizing adjustment to match extremely small avatar size */
  .orbital-ring {
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-width: 2px;
  }
  
  .orbital-ring::after {
    width: 8px;
    height: 8px;
    top: 8px;
    left: 8px;
  }
  
  /* Grade Screen Bento Sizing Adjustments */
  .grade-top-illustration {
    height: clamp(120px, 18vh, 160px) !important;
    padding: 0 !important;
  }
  .grade-bento-grid {
    gap: 8px !important;
    padding: 8px 10px 88px 10px !important;
    margin-top: -26px !important;
  }
  .grade-bento-card {
    min-height: 138px !important;
    padding: 8px 4px !important;
    border-radius: 16px !important;
  }
  .planet-emoji-container {
    width: 58px !important;
    height: 58px !important;
    margin-bottom: 4px !important;
  }
  .planet-emoji {
    font-size: 32px !important;
  }
  .grade-badge {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
    top: -2px !important;
    right: -2px !important;
  }
  .grade-bento-name {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }
  .grade-bento-desc {
    font-size: 9px !important;
    margin-bottom: 5px !important;
  }
  .grade-bento-btn {
    font-size: 7px !important;
    padding: 5px 8px !important;
    letter-spacing: 0.03em !important;
  }

  /* Onboarding Card Sizing for extremely small devices */
  .onboarding-image-card {
    width: 170px !important;
    height: 170px !important;
    border-radius: 24px !important;
  }
  .onboarding-img {
    border-radius: 20px !important;
  }
}

/* Narrow Width Screen Media Query (e.g. Galaxy Fold or very narrow mobile viewports) */
@media (max-width: 360px) {
  .screen {
    padding: 16px;
  }
  
  .lang-card {
    padding: 12px 16px;
  }
  
  .grade-card {
    padding: 12px;
  }

  .register-avatar-card {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }
}

/* Premium National Space Avatars Styling */
.register-avatar-card {
  width: 90px;
  height: 90px;
  border-radius: 22px;
  background: rgba(29, 22, 57, 0.65);
  border: 2px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}

.register-avatar-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

.register-avatar-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(29, 22, 57, 0.85);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.register-avatar-card.active {
  border-color: #00e3fd;
  box-shadow: 0 0 25px rgba(0, 227, 253, 0.45);
  background: rgba(0, 227, 253, 0.08);
}

.avatar-icon {
  font-size: 32px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.register-avatar-card:hover .avatar-icon {
  transform: scale(1.12) rotate(4deg);
}

.avatar-nation-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #140d30;
  border: 1.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 2;
  transition: all 0.3s ease;
}

.register-avatar-card.active .avatar-nation-badge {
  border-color: #00e3fd;
  box-shadow: 0 0 8px #00e3fd;
}

.avatar-nation-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  pointer-events: none;
  transition: color 0.3s ease;
}

.register-avatar-card.active .avatar-nation-label {
  color: #00e3fd;
}

/* ==========================================================================
   Global Header & Navigation Bar Styling System (Tactile Glassmorphism)
   ========================================================================== */

.global-header {
  width: 100%;
  height: 70px;
  background: rgba(20, 13, 48, 0.85);
  border-bottom: 2px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f082b;
  border: 2px solid #7c4dff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(124, 77, 255, 0.45);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.header-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(to right, #fff, #00e3fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-stars-capsule {
  background: rgba(15, 8, 43, 0.8);
  border: 1.5px solid var(--glass-border);
  border-radius: 9999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-tertiary);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.header-stars-capsule .star-icon {
  font-size: 18px;
  color: var(--color-tertiary);
  filter: drop-shadow(0 0 4px var(--color-tertiary));
}

.global-navbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  right: auto;
  width: min(100%, 480px);
  transform: translateX(-50%);
  height: 78px;
  background: rgba(20, 13, 48, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 2px solid var(--glass-border);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px 14px 12px;
  z-index: 100;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 6px 12px;
  border-radius: 18px;
  gap: 2px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  max-width: 80px;
}

.nav-tab .icon {
  font-size: 24px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-tab .label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Active Highlight Styling (Matches screenshot) */
.nav-tab.active {
  color: #fff !important;
  background: #7c4dff !important; /* Nebula Purple Solid Circle */
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.5);
  border-radius: 20px;
}

.nav-tab.active .icon {
  transform: scale(1.1);
}

/* Screen safe bottom spacing when bottom navbar is displayed */
#gradeScreen, #mapScreen, #quizScreen, #resultScreen, #settingsScreen, #badgesScreen {
  padding-bottom: 96px !important;
}

/* --- Profile dashboard: merged with profil_va_yutuqlar reference --- */
.profile-dashboard-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 14%, rgba(0, 227, 253, 0.16), transparent 32%),
    radial-gradient(circle at 13% 39%, rgba(124, 77, 255, 0.24), transparent 36%),
    radial-gradient(circle at 92% 55%, rgba(0, 151, 198, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(16, 8, 45, 0.78), rgba(11, 39, 70, 0.68) 48%, rgba(25, 14, 67, 0.82));
}

.profile-dashboard-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 18px 62px, rgba(255,255,255,0.58), transparent),
    radial-gradient(2px 2px at 112px 138px, rgba(0,227,253,0.36), transparent),
    radial-gradient(1.5px 1.5px at 260px 238px, rgba(205,189,255,0.42), transparent),
    radial-gradient(1px 1px at 380px 420px, rgba(234,196,0,0.36), transparent);
  background-size: 410px 560px;
  opacity: 0.62;
}

.profile-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 46px 24px 124px;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}

.profile-scroll::-webkit-scrollbar {
  width: 0;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 6px;
  margin-bottom: 18px;
}

.profile-avatar-stage {
  position: relative;
  width: 182px;
  height: 182px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.profile-avatar-glow {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 227, 253, 0.34), rgba(124, 77, 255, 0.2) 48%, transparent 72%),
    conic-gradient(from 90deg, rgba(0,227,253,0.28), transparent, rgba(205,189,255,0.24), transparent);
  filter: blur(22px);
  opacity: 0.95;
}

.profile-avatar-orbit {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px dashed rgba(205, 189, 255, 0.42);
  animation: rotateOrbital 18s linear infinite;
}

.profile-avatar-orbit::before {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  border: 2px solid rgba(205, 189, 255, 0.7);
  box-shadow: 0 0 28px rgba(124, 77, 255, 0.42);
}

.profile-avatar-orbit.orbit-secondary {
  inset: 28px;
  border-style: solid;
  border-color: rgba(0, 227, 253, 0.42);
  animation-duration: 10s;
  animation-direction: reverse;
  opacity: 0.72;
}

.profile-avatar-orbit.orbit-secondary::before {
  content: none;
}

.profile-avatar-big {
  position: relative;
  z-index: 2;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 4px;
  color: var(--text-primary);
  font-size: 58px;
  background:
    linear-gradient(var(--bg-infinity), var(--bg-infinity)) padding-box,
    linear-gradient(145deg, var(--color-primary), var(--color-secondary-container)) border-box;
  border: 4px solid transparent;
  box-shadow: 0 0 32px rgba(124, 77, 255, 0.48), inset 0 0 18px rgba(0,0,0,0.35);
  animation: zeroGFloat 5.5s ease-in-out infinite;
}

.profile-avatar-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-verify {
  position: absolute;
  z-index: 3;
  top: 29px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: var(--color-on-secondary-container);
  background: var(--color-secondary-container);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 227, 253, 0.35), inset 0 2px 6px rgba(255,255,255,0.38);
  cursor: pointer;
  transition: var(--transition-tactile);
}

.profile-verify:active {
  transform: scale(0.94);
}

.profile-verify .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 1;
}

.profile-hero h2 {
  margin: 0;
  color: var(--color-primary);
  font-size: clamp(34px, 8vw, 42px);
  line-height: 1.1;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(124, 77, 255, 0.34);
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 26px;
}

.profile-stat-card {
  min-height: 126px;
  border-radius: 26px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 227, 253, 0.08), transparent 48%),
    rgba(29, 22, 57, 0.54);
  box-shadow: inset 0 1px 16px rgba(255,255,255,0.05), 0 14px 30px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 7px;
  gap: 6px;
}

.profile-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  font-size: 30px;
  line-height: 1;
  margin-bottom: 3px;
  background: rgba(205, 189, 255, 0.1);
  box-shadow: inset 0 1px 8px rgba(255,255,255,0.06), 0 0 18px rgba(205,189,255,0.12);
}

.profile-stat-icon.star-stat {
  color: var(--color-tertiary);
  background: rgba(234, 196, 0, 0.1);
  box-shadow: inset 0 1px 8px rgba(255,255,255,0.06), 0 0 18px rgba(234,196,0,0.16);
  font-variation-settings: 'FILL' 0;
}

.profile-stat-icon.test-stat {
  color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.1);
  box-shadow: inset 0 1px 8px rgba(255,255,255,0.06), 0 0 18px rgba(0,227,253,0.16);
}

.profile-stat-card strong {
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
  margin: 0;
  text-shadow: 0 0 12px rgba(255,255,255,0.14);
}

.profile-stat-card p {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-badges-section {
  margin-bottom: 36px;
}

.profile-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 0 5px;
}

.profile-section-head h3 {
  margin: 0 0 4px;
  color: var(--color-primary);
  font-size: 22px;
  letter-spacing: 0;
}

.profile-section-head p {
  color: var(--text-secondary);
  font-size: 16px;
}

.profile-section-head button {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 6px 0;
}

.profile-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 26px;
}

.profile-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  min-width: 0;
}

.profile-badge > .material-symbols-outlined {
  width: clamp(76px, 22vw, 104px);
  height: clamp(76px, 22vw, 104px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--bg-infinity);
  font-size: 42px;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.04), 0 14px 24px rgba(0,0,0,0.36);
  transition: var(--transition-tactile);
}

.profile-badge.unlocked:active > .material-symbols-outlined {
  transform: scale(0.94);
}

.profile-badge.sun > .material-symbols-outlined {
  background: linear-gradient(145deg, #ffe170, #eac400);
  color: #3a3000;
}

.profile-badge.rocket > .material-symbols-outlined {
  background: linear-gradient(145deg, #b89bff, #7c4dff);
  color: #fcf6ff;
}

.profile-badge.sparkle > .material-symbols-outlined {
  background: linear-gradient(145deg, #78f5ff, #00e3fd);
  color: #00363d;
}

.profile-badge.locked {
  opacity: 0.44;
  filter: grayscale(1);
}

.profile-badge.locked > .material-symbols-outlined {
  position: relative;
  background: rgba(54, 48, 84, 0.72);
  color: var(--text-muted);
}

.profile-badge.locked > .material-symbols-outlined::after {
  content: "lock";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.72);
  font-family: 'Material Symbols Outlined';
  font-size: 25px;
  font-variation-settings: 'FILL' 1;
  background: rgba(15, 8, 43, 0.24);
  border-radius: 50%;
}

.profile-badge p {
  width: min-content;
  min-width: 86px;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.2;
}

.profile-badge.locked p {
  color: var(--text-muted);
}

.profile-level-card {
  border-radius: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(29, 22, 57, 0.56);
  box-shadow: inset 0 1px 18px rgba(255,255,255,0.04), 0 18px 42px rgba(0,0,0,0.22);
  padding: 28px 28px 30px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.profile-level-card-compact {
  border-radius: 30px;
  padding: 22px 24px 24px;
  margin: 0 0 22px;
  background:
    linear-gradient(135deg, rgba(0, 227, 253, 0.08), transparent 46%),
    rgba(29, 22, 57, 0.6);
}

.profile-level-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 120px;
  background: radial-gradient(ellipse, rgba(0,227,253,0.18), transparent 68%);
  pointer-events: none;
}

.profile-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-level-card h4 {
  color: var(--color-primary-container);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.profile-level-card span {
  color: var(--color-secondary);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-level-track {
  width: 100%;
  height: 24px;
  border-radius: 999px;
  padding: 4px;
  background: rgba(15, 8, 43, 0.92);
  border: 1.5px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.55);
}

.profile-level-track > span {
  display: block;
  width: 0%;
  min-width: 12px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8e6bff, #00e3fd);
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.36);
  transition: width 0.5s ease;
}

.profile-settings-strip {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.profile-command-panel {
  margin-bottom: 18px;
}

.profile-settings-strip button {
  width: 100%;
  min-height: 74px;
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(0, 227, 253, 0.06), transparent 40%),
    rgba(29, 22, 57, 0.5);
  color: var(--text-primary);
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 12px rgba(255,255,255,0.04);
  transition: var(--transition-tactile);
}

.profile-settings-strip button:active {
  transform: scale(0.98);
}

.profile-settings-strip .settings-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.1);
  box-shadow: inset 0 1px 8px rgba(255,255,255,0.08), 0 0 18px rgba(0,227,253,0.14);
  flex-shrink: 0;
}

.settings-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
  text-align: left;
}

.settings-copy b {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.2;
}

.settings-copy small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}

.settings-status {
  flex-shrink: 0;
  min-width: 38px;
  border-radius: 999px;
  border: 1px solid rgba(0, 227, 253, 0.26);
  background: rgba(0, 227, 253, 0.09);
  color: var(--color-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
  text-align: center;
}

.settings-status.active {
  border-color: rgba(74, 222, 128, 0.38);
  background: rgba(74, 222, 128, 0.12);
  color: #8af7b2;
}

.settings-arrow {
  color: rgba(255,255,255,0.48);
  font-size: 22px;
  flex-shrink: 0;
}

.profile-action-sheet {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-end;
}

body.profile-sheet-open .global-navbar {
  display: none !important;
}

.profile-sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 8, 43, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-sheet-panel {
  position: relative;
  width: 100%;
  max-height: calc(100% - 10px);
  border-radius: 34px 34px 0 0;
  padding: 12px 20px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 227, 253, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(29, 22, 57, 0.98), rgba(15, 8, 43, 0.98));
  border: 2px solid rgba(124, 77, 255, 0.48);
  border-bottom: 0;
  box-shadow: 0 -18px 44px rgba(0,0,0,0.52), inset 0 1px 18px rgba(255,255,255,0.05);
  animation: lessonSheetUp 0.24s ease-out;
}

.profile-sheet-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.profile-sheet-handle {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 14px;
  background: rgba(202, 195, 216, 0.38);
}

.profile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-sheet-head span {
  display: block;
  color: var(--color-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-sheet-head h3 {
  color: var(--color-secondary-container);
  font-size: 26px;
}

.profile-sheet-head button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

.profile-sheet-body {
  display: grid;
  gap: 16px;
}

.profile-edit-tab-body {
  display: grid;
  gap: 16px;
}

.profile-sheet-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border-radius: 20px;
  background: rgba(15, 8, 43, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
}

.profile-sheet-tab {
  min-height: 42px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.profile-sheet-tab.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.95), rgba(0, 227, 253, 0.66));
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.profile-sheet-field {
  display: grid;
  gap: 8px;
}

.profile-sheet-field label,
.profile-sheet-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-sheet-input {
  width: 100%;
  min-height: 56px;
  border-radius: 20px;
  border: 1.5px solid rgba(0, 227, 253, 0.22);
  background: rgba(15, 8, 43, 0.66);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 700;
  outline: none;
  padding: 0 18px;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.32);
}

.profile-sheet-input-wrap {
  position: relative;
}

.profile-sheet-input-wrap .profile-sheet-input {
  padding-right: 54px;
}

.profile-sheet-input-wrap.has-leading .profile-sheet-input {
  padding-left: 54px;
}

.profile-input-leading {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 21px;
  pointer-events: none;
}

.profile-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.profile-password-toggle .material-symbols-outlined {
  font-size: 20px;
}

.profile-sheet-gender {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  height: 52px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(15, 8, 43, 0.72);
  border: 1.5px solid rgba(255,255,255,0.1);
}

.profile-sheet-gender button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}

.profile-sheet-gender button.active {
  background: linear-gradient(135deg, #7c4dff, #24c4ea);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124,77,255,0.32);
}

.profile-avatar-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-avatar-option {
  min-height: 66px;
  border-radius: 22px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(29, 22, 57, 0.58);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  font-size: 30px;
  cursor: pointer;
  overflow: hidden;
}

.profile-avatar-option.selected {
  border-color: var(--color-secondary-container);
  box-shadow: 0 0 18px rgba(0,227,253,0.28);
}

.profile-avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-lang-list,
.profile-sound-card {
  display: grid;
  gap: 10px;
}

.profile-choice-row {
  width: 100%;
  min-height: 64px;
  border-radius: 22px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(29, 22, 57, 0.52);
  color: var(--text-primary);
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
}

.profile-choice-row.active {
  border-color: rgba(0, 227, 253, 0.42);
  background: rgba(0, 227, 253, 0.1);
}

.profile-choice-row .material-symbols-outlined {
  color: var(--color-secondary-container);
}

.profile-choice-row b {
  display: block;
  font-size: 15px;
}

.profile-choice-row small {
  color: var(--text-muted);
  font-size: 11px;
}

.profile-choice-row .choice-check {
  margin-left: auto;
  color: var(--color-success);
  font-variation-settings: 'FILL' 1;
}

.profile-sound-toggle {
  min-height: 86px;
  border-radius: 26px;
  border: 1.5px solid rgba(0, 227, 253, 0.24);
  background:
    linear-gradient(135deg, rgba(0, 227, 253, 0.1), transparent 46%),
    rgba(29, 22, 57, 0.56);
  color: var(--text-primary);
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.profile-sound-switch {
  width: 64px;
  height: 36px;
  border-radius: 999px;
  padding: 4px;
  background: rgba(255,255,255,0.12);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.38);
}

.profile-sound-switch span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.profile-sound-toggle.active .profile-sound-switch span {
  transform: translateX(28px);
  background: var(--color-success);
  box-shadow: 0 0 16px rgba(74,222,128,0.45);
}

.profile-sheet-save {
  margin-top: 2px;
  min-height: 56px;
}

.profile-logout-link {
  width: 100%;
  min-height: 58px;
  border: 1.5px solid rgba(255, 180, 171, 0.22);
  border-radius: 22px;
  background: rgba(255, 180, 171, 0.07);
  color: var(--color-error);
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: inset 0 1px 12px rgba(255,255,255,0.03);
}

.profile-logout-link .material-symbols-outlined {
  font-size: 22px;
}

.profile-logout-confirm {
  display: grid;
  gap: 14px;
  text-align: center;
}

.profile-logout-confirm .logout-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: var(--color-error);
  background: rgba(255, 180, 171, 0.1);
  box-shadow: 0 0 26px rgba(255, 180, 171, 0.16);
}

.profile-logout-confirm h4 {
  color: var(--text-primary);
  font-size: 22px;
}

.profile-logout-confirm p {
  color: var(--text-secondary);
  font-size: 14px;
}

.profile-logout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.profile-logout-actions button {
  min-height: 54px;
  border-radius: 18px;
  font-family: var(--font-family);
  font-weight: 700;
  cursor: pointer;
}

@media (max-height: 760px) {
  .profile-sheet-panel {
    max-height: calc(100% - 8px);
    border-radius: 28px 28px 0 0;
    padding: 10px 20px calc(18px + env(safe-area-inset-bottom));
  }

  .profile-sheet-handle {
    margin-bottom: 10px;
  }

  .profile-sheet-head {
    margin-bottom: 14px;
  }

  .profile-sheet-head h3 {
    font-size: 23px;
  }

  .profile-sheet-head button {
    width: 38px;
    height: 38px;
  }

  .profile-sheet-body,
  .profile-edit-tab-body {
    gap: 12px;
  }

  .profile-sheet-tabs {
    border-radius: 18px;
  }

  .profile-sheet-tab {
    min-height: 38px;
    font-size: 12px;
  }

  .profile-sheet-input {
    min-height: 50px;
    border-radius: 18px;
    font-size: 15px;
  }

  .profile-sheet-gender {
    height: 48px;
  }

  .profile-avatar-picker {
    gap: 8px;
  }

  .profile-avatar-option {
    min-height: 58px;
    border-radius: 18px;
  }

  .profile-choice-row {
    min-height: 58px;
    border-radius: 19px;
    padding: 10px 12px;
  }

  .profile-sound-toggle {
    min-height: 76px;
    border-radius: 22px;
    padding: 14px;
  }

  .profile-sheet-save {
    min-height: 52px;
  }
}

@media (max-height: 640px) {
  .profile-sheet-panel {
    max-height: calc(100% - 4px);
    border-radius: 24px 24px 0 0;
    padding: 8px 18px calc(14px + env(safe-area-inset-bottom));
  }

  .profile-sheet-handle {
    width: 48px;
    height: 4px;
    margin-bottom: 8px;
  }

  .profile-sheet-head {
    margin-bottom: 10px;
  }

  .profile-sheet-head h3 {
    font-size: 20px;
  }

  .profile-sheet-head span {
    font-size: 9px;
  }

  .profile-sheet-head button {
    width: 34px;
    height: 34px;
  }

  .profile-sheet-body,
  .profile-edit-tab-body {
    gap: 9px;
  }

  .profile-sheet-tabs {
    gap: 5px;
    padding: 4px;
    border-radius: 16px;
  }

  .profile-sheet-tab {
    min-height: 34px;
    border-radius: 12px;
    font-size: 11px;
  }

  .profile-sheet-field {
    gap: 5px;
  }

  .profile-sheet-field label,
  .profile-sheet-label {
    font-size: 10px;
  }

  .profile-sheet-input {
    min-height: 44px;
    border-radius: 16px;
    font-size: 14px;
  }

  .profile-sheet-input-wrap.has-leading .profile-sheet-input {
    padding-left: 46px;
  }

  .profile-input-leading {
    left: 16px;
    font-size: 19px;
  }

  .profile-password-toggle {
    right: 10px;
    width: 30px;
    height: 30px;
  }

  .profile-sheet-gender {
    height: 42px;
    padding: 4px;
  }

  .profile-sheet-gender button {
    font-size: 12px;
  }

  .profile-avatar-option {
    min-height: 50px;
    border-radius: 15px;
  }

  .profile-choice-row {
    min-height: 52px;
    border-radius: 17px;
    padding: 9px 10px;
  }

  .profile-choice-row b {
    font-size: 13px;
  }

  .profile-choice-row small {
    font-size: 10px;
  }

  .profile-sound-toggle {
    min-height: 68px;
    border-radius: 20px;
    padding: 12px;
  }

  .profile-sound-switch {
    width: 56px;
    height: 32px;
  }

  .profile-sound-switch span {
    width: 24px;
    height: 24px;
  }

  .profile-sound-toggle.active .profile-sound-switch span {
    transform: translateX(24px);
  }

  .profile-sheet-save {
    min-height: 46px;
    font-size: 13px;
  }
}

@media (max-height: 760px) {
  .profile-scroll {
    padding: 26px 20px 104px;
  }

  .profile-hero {
    margin-bottom: 14px;
  }

  .profile-avatar-stage {
    width: 148px;
    height: 148px;
    margin-bottom: 12px;
  }

  .profile-avatar-big {
    width: 104px;
    height: 104px;
    font-size: 48px;
  }

  .profile-avatar-orbit::before {
    inset: 14px;
  }

  .profile-avatar-orbit.orbit-secondary {
    inset: 22px;
  }

  .profile-verify {
    top: 22px;
    right: 18px;
    width: 40px;
    height: 40px;
  }

  .profile-hero h2 {
    font-size: 30px;
  }

  .profile-level-card-compact {
    border-radius: 26px;
    padding: 18px 20px 20px;
    margin-bottom: 16px;
  }

  .profile-level-head {
    margin-bottom: 12px;
  }

  .profile-level-card h4 {
    font-size: 15px;
  }

  .profile-level-card span {
    font-size: 13px;
  }

  .profile-level-track {
    height: 20px;
  }

  .profile-stat-grid {
    gap: 8px;
    margin-bottom: 18px;
  }

  .profile-stat-card {
    min-height: 104px;
    border-radius: 22px;
    padding: 10px 6px;
  }

  .profile-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 15px;
    font-size: 25px;
  }

  .profile-stat-card strong {
    font-size: 20px;
  }

  .profile-stat-card p {
    font-size: 9.5px;
  }

  .profile-command-panel {
    margin-bottom: 14px;
  }

  .profile-settings-strip {
    gap: 10px;
  }

  .profile-settings-strip button {
    min-height: 64px;
    border-radius: 20px;
    padding: 10px 12px;
  }

  .profile-settings-strip .settings-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .settings-copy b {
    font-size: 13px;
  }

  .settings-copy small {
    font-size: 10px;
  }
}

@media (max-height: 640px) {
  .profile-scroll {
    padding: 16px 16px 96px;
  }

  .profile-hero {
    padding-top: 0;
    margin-bottom: 10px;
  }

  .profile-avatar-stage {
    width: 122px;
    height: 122px;
    margin-bottom: 8px;
  }

  .profile-avatar-glow {
    inset: 8px;
    filter: blur(16px);
  }

  .profile-avatar-orbit {
    inset: 4px;
  }

  .profile-avatar-orbit::before {
    inset: 10px;
  }

  .profile-avatar-orbit.orbit-secondary {
    inset: 18px;
  }

  .profile-avatar-big {
    width: 88px;
    height: 88px;
    border-width: 3px;
    font-size: 40px;
  }

  .profile-verify {
    top: 17px;
    right: 14px;
    width: 34px;
    height: 34px;
  }

  .profile-verify .material-symbols-outlined {
    font-size: 19px;
  }

  .profile-hero h2 {
    font-size: 26px;
  }

  .profile-level-card-compact {
    border-radius: 22px;
    padding: 14px 16px 16px;
    margin-bottom: 14px;
  }

  .profile-level-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  .profile-level-card h4 {
    font-size: 13px;
  }

  .profile-level-card span {
    font-size: 12px;
  }

  .profile-level-track {
    height: 18px;
    padding: 3px;
  }

  .profile-stat-grid {
    gap: 7px;
    margin-bottom: 14px;
  }

  .profile-stat-card {
    min-height: 88px;
    border-radius: 19px;
    padding: 8px 5px;
    gap: 4px;
  }

  .profile-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 22px;
    margin-bottom: 1px;
  }

  .profile-stat-card strong {
    font-size: 18px;
  }

  .profile-stat-card p {
    font-size: 8.5px;
    line-height: 1.15;
  }

  .profile-command-panel {
    margin-bottom: 12px;
  }

  .profile-settings-strip {
    gap: 8px;
  }

  .profile-settings-strip button {
    min-height: 56px;
    border-radius: 18px;
    gap: 9px;
    padding: 9px 10px;
  }

  .profile-settings-strip .settings-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .settings-copy {
    gap: 2px;
  }

  .settings-copy b {
    font-size: 12px;
  }

  .settings-copy small {
    font-size: 9px;
  }

  .settings-status {
    min-width: 34px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .settings-arrow {
    font-size: 19px;
  }
}

.profile-logout-cancel {
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.profile-logout-confirm-btn {
  border: 0;
  background: linear-gradient(135deg, #ff6b6b, #ffb4ab);
  color: #2b0505;
}

.app-notice-sheet {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.app-notice-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 8, 43, 0.66);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.app-notice-panel {
  position: relative;
  width: min(100%, 480px);
  border-radius: 32px 32px 0 0;
  border: 2px solid rgba(124, 77, 255, 0.48);
  border-bottom: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 227, 253, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(29, 22, 57, 0.98), rgba(15, 8, 43, 0.98));
  box-shadow: 0 -18px 44px rgba(0,0,0,0.52), inset 0 1px 18px rgba(255,255,255,0.05);
  padding: 12px 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  animation: lessonSheetUp 0.24s ease-out;
}

.app-notice-handle {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 18px;
  background: rgba(202, 195, 216, 0.38);
}

.app-notice-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--color-secondary-container);
  background: rgba(0, 227, 253, 0.1);
  box-shadow: 0 0 28px rgba(0, 227, 253, 0.2), inset 0 1px 12px rgba(255,255,255,0.08);
}

.app-notice-icon .material-symbols-outlined {
  font-size: 34px;
}

.app-notice-kicker {
  color: var(--color-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-notice-panel h3 {
  color: var(--color-secondary-container);
  font-size: 25px;
  margin-top: 5px;
}

.app-notice-panel p {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  margin: 8px auto 18px;
  max-width: 320px;
}

.app-notice-btn {
  min-height: 56px;
}

@media (max-width: 390px) {
  .profile-scroll {
    padding-inline: 18px;
  }

  .profile-stat-grid {
    gap: 9px;
  }

  .profile-stat-card {
    min-height: 126px;
    border-radius: 24px;
  }

  .profile-badge-grid {
    column-gap: 10px;
  }

  .profile-badge p {
    font-size: 14px;
  }

  .profile-level-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 390px) and (max-height: 760px) {
  .profile-scroll {
    padding-inline: 18px;
  }

  .profile-stat-grid {
    gap: 8px;
  }

  .profile-stat-card {
    min-height: 104px;
    border-radius: 22px;
  }

  .profile-level-head {
    align-items: center;
    flex-direction: row;
  }
}

@media (max-width: 390px) and (max-height: 640px) {
  .profile-scroll {
    padding-inline: 16px;
  }

  .profile-stat-grid {
    gap: 7px;
  }

  .profile-stat-card {
    min-height: 88px;
    border-radius: 19px;
  }
}

/* Achievements Badge item styles */
.badge-item-card {
  transition: all 0.3s ease;
}

.badge-item-card.earned {
  border-color: rgba(0, 227, 253, 0.4) !important;
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.15);
}

.badge-item-card.earned .badge-icon {
  filter: drop-shadow(0 0 8px rgba(0, 227, 253, 0.6));
}

.badge-item-card.locked {
  background: rgba(29, 22, 57, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Premium Map Star-Path and Micro-interactions */
.star-path {
  stroke-dasharray: 8 8;
  stroke: #7c4dff;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(124, 77, 255, 0.4));
}

.glow-primary {
  box-shadow: 0 0 25px var(--glow, rgba(124, 77, 255, 0.35));
}

.floating {
  animation: zeroGFloat 5s ease-in-out infinite;
}

/* Premium Map Node Layout & Responsiveness */
.map-path-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.map-node-wrapper {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 150px;
}

.map-node-circle-completed {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
  transition: var(--transition-tactile);
  cursor: pointer;
}

.map-node-circle-completed:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.6);
}

.map-node-circle-completed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.map-node-circle-active {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition-tactile);
  cursor: pointer;
}

.map-node-circle-active:hover {
  transform: scale(1.1);
}

.map-node-circle-active img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3.5px solid var(--color-secondary-container);
  box-shadow: 0 0 20px rgba(0, 227, 253, 0.55);
  position: relative;
  z-index: 2;
}

.map-node-circle-locked {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 13, 48, 0.6);
  color: var(--text-muted);
  opacity: 0.6;
}

.map-node-card {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  text-align: center;
  background: rgba(29, 22, 57, 0.85);
  border: 1.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  width: 100%;
  transition: var(--transition-tactile);
}

.map-node-card-active {
  border-color: var(--color-secondary-container);
  box-shadow: 0 0 15px rgba(0, 227, 253, 0.25);
  background: rgba(29, 22, 57, 0.95);
}

.map-node-card-completed {
  border-color: rgba(74, 222, 128, 0.3);
}

.map-node-card-locked {
  opacity: 0.6;
  background: rgba(20, 13, 48, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
}

/* --- Stitch-inspired topic map built without Tailwind utilities --- */
#mapScreen {
  overflow: hidden;
}

.map-scroll-area {
  min-height: 100%;
  overflow-y: auto;
  padding: 24px 18px 100px;
  position: relative;
  background:
    radial-gradient(circle at 78% 18%, rgba(0, 227, 253, 0.18), transparent 36%),
    radial-gradient(circle at 16% 44%, rgba(124, 77, 255, 0.24), transparent 42%),
    linear-gradient(160deg, rgba(20, 13, 48, 0.2), rgba(8, 39, 69, 0.78) 42%, rgba(36, 20, 91, 0.82));
  scrollbar-width: none;
}

.map-scroll-area::-webkit-scrollbar {
  width: 0;
}

.map-scroll-area::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 22px 40px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 120px 180px, rgba(189,244,255,0.55), transparent),
    radial-gradient(1px 1px at 260px 300px, rgba(205,189,255,0.65), transparent);
  background-size: 310px 360px;
  opacity: 0.38;
}

.map-route-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
}

.map-route-path {
  stroke-width: 4;
  stroke-dasharray: 9 10;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px rgba(124, 77, 255, 0.65));
  animation: mapPathDrift 9s linear infinite;
}

@keyframes mapPathDrift {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -38; }
}

.map-field-star {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 0 10px rgba(189,244,255,0.55);
  pointer-events: none;
  animation: mapStarPulse 4s ease-in-out infinite;
}

@keyframes mapStarPulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.55); }
}

.map-grade-banner {
  width: min(92%, 340px);
  margin: 0 auto 22px;
  position: relative;
  z-index: 3;
  min-height: 54px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 227, 253, 0.3);
  background: rgba(15, 8, 43, 0.68);
  box-shadow: inset 0 1px 12px rgba(255,255,255,0.08), 0 12px 32px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.map-grade-banner > .material-symbols-outlined {
  color: var(--color-secondary-container);
  font-size: 22px;
}

.map-grade-banner h3 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-grade-banner h3 span {
  color: var(--color-tertiary);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.map-node-row {
  width: 100%;
  min-height: 162px;
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.map-node-right {
  transform: translateX(64px);
}

.map-node-left {
  transform: translateX(-64px);
}

.map-node-soft-right {
  transform: translateX(30px);
}

.map-node-soft-left {
  transform: translateX(-30px);
}

.map-mission {
  width: 154px;
  min-height: 172px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-family);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease;
}

.map-mission:not(:disabled):active {
  transform: scale(0.96);
}

.map-mission:focus-visible .mission-planet-core {
  outline: 3px solid rgba(255,255,255,0.55);
  outline-offset: 5px;
}

.map-mission:disabled {
  cursor: not-allowed;
}

.mission-glow {
  position: absolute;
  top: 16px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.28;
  background: var(--color-primary-container);
  transition: opacity 0.25s ease;
}

.map-mission.active .mission-glow {
  background: var(--color-secondary-container);
  opacity: 0.42;
}

.map-mission.completed .mission-glow {
  background: var(--color-tertiary);
  opacity: 0.34;
}

.mission-planet {
  position: relative;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
}

.mission-planet-core {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(15, 8, 43, 0.9);
  border: 3px solid rgba(148, 142, 161, 0.6);
  box-shadow: inset 0 8px 18px rgba(0,0,0,0.42), 0 12px 26px rgba(0,0,0,0.36);
}

.mission-planet-core img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

.mission-fallback-icon {
  color: var(--color-secondary-container);
  font-size: 44px;
  filter: drop-shadow(0 0 14px rgba(0, 227, 253, 0.52));
  z-index: 1;
}

.map-mission.active .mission-planet-core {
  width: 100px;
  height: 100px;
  border-color: var(--color-secondary-container);
  box-shadow: 0 0 25px rgba(0, 227, 253, 0.48), inset 0 8px 18px rgba(0,0,0,0.38);
}

.map-mission.completed .mission-planet-core {
  border-color: var(--color-tertiary);
  box-shadow: 0 0 26px rgba(234, 196, 0, 0.38), inset 0 8px 18px rgba(0,0,0,0.38);
}

.map-mission.locked {
  opacity: 0.62;
}

.map-mission.locked .mission-planet-core {
  color: var(--text-muted);
}

.map-mission.locked .mission-planet-core .material-symbols-outlined {
  font-size: 38px;
}

.mission-orbit-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px dashed var(--color-secondary-container);
  filter: drop-shadow(0 0 8px rgba(0, 227, 253, 0.72));
  animation: rotateOrbital 14s linear infinite;
  overflow: visible;
}

.mission-check {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #4ade80, #16a34a);
  border: 2px solid rgba(220, 252, 231, 0.95);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.62), 0 8px 16px rgba(0,0,0,0.32);
}

.mission-check .material-symbols-outlined {
  color: #fff;
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.mission-rocket-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform-origin: center;
  animation: missionRocketOrbit 9s linear infinite;
  pointer-events: none;
}

.mission-rocket-sprite {
  display: block;
  font-size: 38px;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(124, 77, 255, 0.8)) drop-shadow(0 0 8px rgba(255,255,255,0.28));
  transform: rotate(45deg);
  transform-origin: center;
  user-select: none;
}

@keyframes missionRocketOrbit {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateY(-60px);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateY(-60px);
  }
}

.mission-card {
  width: max-content;
  max-width: 168px;
  min-width: 112px;
  margin-top: 10px;
  padding: 9px 15px 10px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(43, 37, 72, 0.72);
  border: 1.5px solid rgba(255,255,255,0.17);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mission-status {
  color: var(--color-secondary);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.completed .mission-status {
  color: var(--color-tertiary);
}

.locked .mission-status {
  color: var(--text-muted);
}

.mission-title {
  color: #fff;
  font-size: 16px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.map-node-final {
  min-height: 176px;
  margin-top: 0;
}

.map-mission.final-test .mission-planet-core {
  border-color: var(--color-tertiary);
}

.map-mission.final-test.active .mission-glow {
  background: var(--color-tertiary);
  opacity: 0.48;
}

.map-mission.final-test .mission-fallback-icon {
  color: var(--color-tertiary);
  font-size: 48px;
}

.mission-card.final-card {
  max-width: 212px;
}

.mission-desc {
  max-width: 180px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
}

/* --- Celebration result screen --- */
.result-screen {
  overflow-y: auto;
  padding: 26px 20px 112px !important;
  background:
    radial-gradient(circle at 50% 12%, rgba(124, 77, 255, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(36, 20, 91, 0.72), rgba(15, 8, 43, 0.96));
}

.result-screen > div:not(.fireworks-layer):not(.result-content):not(.result-actions),
.result-screen > button.btn-primary {
  display: none !important;
}

.fireworks-layer {
  position: absolute;
  inset: 0 0 auto;
  height: 190px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fireworks-layer span {
  position: absolute;
  top: 26px;
  left: var(--x, 50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c, var(--color-tertiary));
  box-shadow:
    0 -22px 0 var(--c, var(--color-tertiary)),
    18px -12px 0 var(--c, var(--color-tertiary)),
    22px 8px 0 var(--c, var(--color-tertiary)),
    0 24px 0 var(--c, var(--color-tertiary)),
    -20px 10px 0 var(--c, var(--color-tertiary)),
    -18px -14px 0 var(--c, var(--color-tertiary));
  animation: fireworkBurst 1.65s ease-out infinite;
  opacity: 0;
}

.fireworks-layer span:nth-child(1) { --x: 16%; --c: #00e3fd; animation-delay: 0s; }
.fireworks-layer span:nth-child(2) { --x: 34%; --c: #eac400; animation-delay: 0.28s; }
.fireworks-layer span:nth-child(3) { --x: 54%; --c: #cdbdff; animation-delay: 0.52s; }
.fireworks-layer span:nth-child(4) { --x: 74%; --c: #00e3fd; animation-delay: 0.78s; }
.fireworks-layer span:nth-child(5) { --x: 24%; --c: #eac400; animation-delay: 1.05s; }
.fireworks-layer span:nth-child(6) { --x: 86%; --c: #cdbdff; animation-delay: 1.28s; }

@keyframes fireworkBurst {
  0% { transform: translateY(42px) scale(0.2); opacity: 0; }
  24% { opacity: 1; }
  100% { transform: translateY(0) scale(1.45); opacity: 0; }
}

.result-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.result-hero-card {
  width: 210px;
  height: 210px;
  margin: 4px auto 4px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 34%, rgba(234, 196, 0, 0.28), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(124, 77, 255, 0.38), transparent 52%),
    #130d2b;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 44px rgba(0,0,0,0.36);
  overflow: hidden;
}

.result-trophy {
  color: var(--color-tertiary);
  font-size: 104px;
  filter: drop-shadow(0 0 22px rgba(234, 196, 0, 0.48));
  animation: zeroGFloat 5s ease-in-out infinite;
}

.result-orbit {
  position: absolute;
  width: 160px;
  height: 36px;
  border: 2px dashed rgba(0, 227, 253, 0.48);
  border-radius: 50%;
  transform: rotate(-18deg);
}

#resultTitleText {
  margin: 0;
  color: var(--color-secondary-container);
  font-size: 30px;
}

#resultSubtitleText {
  max-width: 270px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.result-stat-card,
.result-rank-card {
  width: 100%;
  border-radius: 30px;
  border: 1.5px solid rgba(255,255,255,0.16);
  background: rgba(29, 22, 57, 0.68);
  box-shadow: inset 0 1px 12px rgba(255,255,255,0.05), 0 16px 34px rgba(0,0,0,0.24);
  padding: 24px;
}

.result-stat-label,
.result-rank-card span {
  color: var(--color-secondary-container);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.result-stat-card strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: 38px;
}

.result-progress-track {
  height: 13px;
  margin-top: 22px;
  border-radius: 999px;
  background: rgba(15, 8, 43, 0.72);
  overflow: hidden;
}

.result-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-secondary-container), var(--color-primary));
  transition: width 0.8s ease;
}

.result-stars-card .result-stat-label {
  color: var(--color-tertiary);
}

.result-stars-card p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-weight: 700;
}

.result-rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.result-rank-card strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 22px;
}

.result-ring {
  --ring-progress: 75%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  background:
    radial-gradient(circle closest-side, rgba(43, 37, 72, 1) 76%, transparent 77%),
    conic-gradient(var(--color-primary) var(--ring-progress), rgba(255,255,255,0.12) 0);
}

.result-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.btn-secondary {
  width: 100%;
  min-height: 60px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.13);
  background: rgba(15, 8, 43, 0.38);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 390px) {
  .map-node-right {
    transform: translateX(48px);
  }

  .map-node-left {
    transform: translateX(-48px);
  }

  .map-node-soft-right {
    transform: translateX(20px);
  }

  .map-node-soft-left {
    transform: translateX(-20px);
  }

  .map-mission {
    width: 142px;
  }
}
