/* ==========================================================================
   NPTEL QUIZ PORTAL - MODERN PREMIUM DESIGN SYSTEM
   Supports Default Light Theme & Day/Night Mode Switch
   ========================================================================== */

:root, [data-theme="light"] {
  /* Crisp Modern Light Theme (Default) */
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.16);
  --border-bright: rgba(79, 70, 229, 0.4);

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.2);
  
  --secondary: #7c3aed;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  
  --success: #059669;
  --success-glow: rgba(5, 150, 105, 0.2);
  --success-bg: rgba(5, 150, 105, 0.09);
  --success-border: rgba(5, 150, 105, 0.4);

  --danger: #e11d48;
  --danger-glow: rgba(225, 29, 72, 0.2);
  --danger-bg: rgba(225, 29, 72, 0.08);
  --danger-border: rgba(225, 29, 72, 0.4);

  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.09);
  --warning-border: rgba(217, 119, 6, 0.4);

  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.09);

  /* Advanced Typography Ecosystem */
  --font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 14px 34px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 22px var(--primary-glow);

  /* Atmospheric Wallpaper Gradient */
  --bg-wallpaper: linear-gradient(rgba(248, 250, 252, 0.88), rgba(241, 245, 249, 0.94)), url("https://images.unsplash.com/photo-1552910996-e666ad64695c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80");

  /* Ambient Glow opacity */
  --ambient-opacity: 0.18;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 260ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  /* Sleek Modern Obsidian Dark Theme */
  --bg-dark: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.82);
  --bg-card-hover: rgba(26, 34, 53, 0.95);
  --bg-surface: #121826;
  --bg-surface-elevated: #1a2336;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-bright: rgba(99, 102, 241, 0.35);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --secondary: #8b5cf6;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --success-bg: rgba(16, 185, 129, 0.14);
  --success-border: rgba(16, 185, 129, 0.4);

  --danger: #f43f5e;
  --danger-glow: rgba(244, 63, 94, 0.3);
  --danger-bg: rgba(244, 63, 94, 0.14);
  --danger-border: rgba(244, 63, 94, 0.4);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.14);
  --warning-border: rgba(245, 158, 11, 0.4);

  --info: #0ea5e9;
  --info-bg: rgba(14, 165, 233, 0.14);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--primary-glow);

  /* Dark Atmospheric Wallpaper Gradient */
  --bg-wallpaper: linear-gradient(rgba(10, 14, 23, 0.86), rgba(18, 24, 38, 0.94)), url("https://images.unsplash.com/photo-1552910996-e666ad64695c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80");

  --ambient-opacity: 0.45;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.62;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-main);
  letter-spacing: -0.025em;
  font-weight: 800;
}

/* GPU-accelerated fixed wallpaper layer (eliminates full-page repaint freezes) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--bg-wallpaper);
  background-size: cover;
  background-position: center bottom;
  z-index: -2;
  pointer-events: none;
  transform: translateZ(0);
  will-change: opacity;
  transition: opacity var(--transition-fast);
}

/* Background Particles Canvas Engine */
.background-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.88;
  transform: translateZ(0);
}

/* Ambient dynamic background glow (optimized blur for 60fps smoothness) */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: var(--ambient-opacity);
  animation: floatOrb 18s ease-in-out infinite alternate;
  transform: translateZ(0);
  will-change: transform;
  transition: opacity var(--transition-fast);
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0) 70%);
  top: -150px;
  left: -100px;
}

.glow-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(14, 165, 233, 0) 70%);
  bottom: -200px;
  right: -150px;
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-30px, 70px) scale(0.95); }
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   GLOBAL HEADER / FLOATING GLASSMORPHIC NAVBAR
   ========================================================================== */

.app-header {
  position: sticky;
  top: 1.25rem;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.6rem;
  min-height: 72px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-full);
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  margin-bottom: 1.25rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

[data-theme="dark"] .app-header {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.25) inset;
}

.nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.brand-logo-wrapper {
  position: relative;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  border: 2px solid #d4af37;
  position: relative;
  z-index: 2;
  transition: transform var(--transition-bounce);
}

.brand:hover .brand-logo-img {
  transform: scale(1.08) rotate(4deg);
}

.brand-logo-halo {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.45) 0%, rgba(99, 102, 241, 0.3) 60%, transparent 100%);
  z-index: 1;
  filter: blur(5px);
  animation: haloPulse 3.5s ease-in-out infinite alternate;
}

@keyframes haloPulse {
  0% { transform: scale(0.9); opacity: 0.55; }
  100% { transform: scale(1.18); opacity: 0.95; }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
}

.brand-title-accent {
  background: linear-gradient(135deg, #4f46e5 0%, #b45309 60%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

[data-theme="dark"] .brand-title-accent {
  background: linear-gradient(135deg, #818cf8 0%, #fbbf24 80%, #facc15 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-edition-badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(79, 70, 229, 0.12));
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #b45309;
  white-space: nowrap;
}

[data-theme="dark"] .nav-edition-badge {
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(99, 102, 241, 0.22));
}

.brand-subtitle {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.015em;
}

/* Nav Center: Telemetry Beacon & Course Pill */
.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.nav-course-pill {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(212, 175, 55, 0.12) 100%);
  border: 1px solid rgba(79, 70, 229, 0.3);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-course-pill i {
  color: var(--primary);
  font-size: 0.95rem;
}

[data-theme="dark"] .nav-course-pill {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(250, 204, 21, 0.16) 100%);
  border-color: rgba(129, 140, 248, 0.4);
}

[data-theme="dark"] .nav-course-pill i {
  color: #fbbf24;
}

.nav-course-pill:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.nav-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  font-size: 0.82rem;
  color: var(--text-muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) inset;
  transition: all var(--transition-fast);
}

.nav-status-pill:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseBeacon 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-status-text strong {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ==========================================================================
   LIVE USERS ONLINE COUNTER INDICATORS (HEADER, HERO BANNER & QUIZ HUD)
   ========================================================================== */

.nav-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.82rem;
  font-weight: 700;
  color: #047857;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

[data-theme="dark"] .nav-live-badge {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.2);
}

.nav-live-badge:hover {
  transform: translateY(-1px);
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.live-pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

.live-pulse-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.5);
  animation: livePing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes livePing {
  0% { transform: scale(0.9); opacity: 0.9; }
  75%, 100% { transform: scale(2.5); opacity: 0; }
}

.live-count-number {
  font-family: var(--font-mono);
  font-weight: 800;
  color: inherit;
  font-size: 0.88rem;
  min-width: 1.15rem;
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.live-count-number.count-updated,
#hero-live-count.count-updated,
#hud-live-count.count-updated {
  animation: countPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

@keyframes countPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); color: #10b981; }
  100% { transform: scale(1); }
}

.live-count-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  opacity: 0.85;
}

/* Meta Pill Live in Hero */
.meta-pill-live {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
  color: #047857 !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

[data-theme="dark"] .meta-pill-live {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
  color: #6ee7b7 !important;
}

/* HUD Live Pill in Quiz Screen */
.hud-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.76rem;
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
}

[data-theme="dark"] .hud-live-pill {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.38);
  color: #6ee7b7;
}

/* Nav Actions Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.25);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

[data-theme="dark"] .nav-feature-pill {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
}

.feature-pill-icon {
  font-size: 0.85rem;
}

/* ==========================================================================
   NEUMORPHIC NAVBAR THEME TOGGLE (PIXEL-PERFECT REFERENCE MATCH)
   Exact match for reference image: Light mode (left text, right sun thumb)
   and Dark mode (left moon+stars thumb, right text). Zero-lag & hardware-accelerated.
   ========================================================================== */

.neo-nav-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 118px;
  height: 42px;
  border-radius: 9999px;
  padding: 3px;
  box-sizing: border-box;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-family: inherit;
  flex-shrink: 0;
  outline: none;

  /* Default Light Mode capsule styling */
  background: #e2e5ea;
  border: 1.5px solid #bcc2cb;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.95),
    inset -1px -1px 3px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.05);
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.12s ease;
}

.neo-nav-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.95),
    inset -1px -1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

.neo-nav-toggle:active {
  transform: scale(0.96);
}

/* Dark Mode capsule styling */
[data-theme="dark"] .neo-nav-toggle {
  background: #525a68;
  border: 1.5px solid #373f4b;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.08),
    inset -1px -1px 3px rgba(0, 0, 0, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.3);
}

/* --- Sliding Raised Thumb Disc --- */
.neo-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  will-change: transform;
  pointer-events: none;

  /* Light mode: thumb sits on the RIGHT side */
  transform: translateX(74px);
  background: linear-gradient(145deg, #f4f6fa, #dfe3ea);
  box-shadow:
    2px 2px 5px rgba(155, 165, 178, 0.55),
    -2px -2px 5px rgba(255, 255, 255, 0.95),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.22s ease, box-shadow 0.22s ease;
}

/* Dark mode: thumb slides to the LEFT side */
[data-theme="dark"] .neo-toggle-thumb {
  transform: translateX(0px);
  background: linear-gradient(145deg, #5c6677, #485160);
  box-shadow:
    2.5px 2.5px 6px rgba(16, 20, 28, 0.7),
    -1.5px -1.5px 4px rgba(255, 255, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

/* --- Thumb Icons (Sun & Moon + Stars) --- */
.neo-icon {
  position: absolute;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Sun Icon (Light Mode) */
.neo-icon-sun {
  color: #334155;
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Moon Icon (Dark Mode) */
.neo-icon-moon {
  color: #f8fafc;
  opacity: 0;
  transform: scale(0.6) rotate(-30deg);
}

[data-theme="dark"] .neo-icon-sun {
  opacity: 0;
  transform: scale(0.6) rotate(30deg);
}

[data-theme="dark"] .neo-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* --- Two-Line Text Labels (LIGHT MODE / DARK MODE) --- */
.neo-toggle-label {
  position: absolute;
  top: 50%;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Light Mode Label (on the LEFT) */
.neo-label-light {
  left: 12px;
  text-align: center;
  color: #1e293b;
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

/* Dark Mode Label (on the RIGHT) */
.neo-label-dark {
  right: 12px;
  text-align: center;
  color: #ffffff;
  transform: translateY(-50%) scale(0.85);
  opacity: 0;
}

/* When in Dark Mode: swap label visibility */
[data-theme="dark"] .neo-label-light {
  opacity: 0;
  transform: translateY(-50%) scale(0.85);
}

[data-theme="dark"] .neo-label-dark {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-outline-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-icon {
  padding: 0.65rem 0.95rem;
}

/* ==========================================================================
   SCREEN 1: ACCESS CODE ENTRY SCREEN
   ========================================================================== */

.screen {
  animation: fadeIn 300ms ease forwards;
}

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

.access-card {
  max-width: 820px;
  margin: 0.5rem auto 2.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

[data-theme="dark"] .access-card {
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Course Header Banner on Access Screen */
.course-header-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(212, 175, 55, 0.09) 50%, rgba(99, 102, 241, 0.05) 100%);
  border: 1.5px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem 1.1rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  position: relative;
  overflow: hidden;
  text-align: center;
}

[data-theme="dark"] .course-header-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(250, 204, 21, 0.1) 50%, rgba(18, 24, 38, 0.9) 100%);
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.course-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

[data-theme="dark"] .course-badge-pill {
  background: linear-gradient(135deg, #6366f1, #d97706);
}

.course-banner-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.course-banner-sub {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.85rem;
}

.course-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.meta-pill {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.meta-pill i {
  color: var(--primary);
  font-size: 0.8rem;
}

[data-theme="dark"] .meta-pill i {
  color: #fbbf24;
}

.meta-pill-soon {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.08);
}

.meta-pill-soon i {
  color: #d97706 !important;
}

[data-theme="dark"] .meta-pill-soon {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}

[data-theme="dark"] .meta-pill-soon i {
  color: #fbbf24 !important;
}

/* ==========================================================================
   MASTER TEST SPOTLIGHT CARD (MGMNPTEL3Y) - HERO ABOVE THE FOLD
   ========================================================================== */

.master-spotlight-card {
  position: relative;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(212, 175, 55, 0.16) 50%, rgba(99, 102, 241, 0.1) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.75rem;
  margin-bottom: 1.6rem;
  box-shadow: 0 12px 36px -6px var(--primary-glow), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
}

[data-theme="dark"] .master-spotlight-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(250, 204, 21, 0.15) 50%, rgba(18, 24, 38, 0.95) 100%);
  border-color: #818cf8;
  box-shadow: 0 16px 44px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.master-spotlight-card:hover {
  border-color: #d4af37;
  transform: translateY(-2px);
  box-shadow: 0 20px 48px -4px var(--primary-glow), 0 0 25px rgba(212, 175, 55, 0.2);
}

.master-spotlight-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.25) 35%,
    transparent 45%
  );
  transform: rotate(25deg);
  animation: shimmerSweep 5s ease-in-out infinite;
  pointer-events: none;
}

.spotlight-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  color: #1a1505;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
}

[data-theme="dark"] .spotlight-badge {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
}

.spotlight-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--primary);
  font-size: 0.82rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.spotlight-code-badge .code-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

.spotlight-code-badge .code-text {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--primary);
  letter-spacing: 0.04em;
}

[data-theme="dark"] .spotlight-code-badge .code-text {
  color: #a5b4fc;
}

.spotlight-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.spotlight-text-col {
  flex: 1;
  min-width: 0;
}

.spotlight-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.spotlight-subtitle {
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.62;
  margin-bottom: 0.95rem;
}

.spotlight-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.perk-pill {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
}

.perk-pill i {
  color: var(--primary);
  font-size: 0.75rem;
}

/* Dedicated Action Column with Big Button */
.spotlight-action-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-spotlight-launch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.95rem 1.75rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #4338ca 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -2px var(--primary-glow), 0 0 0 2px rgba(255, 255, 255, 0.4) inset;
  transition: all var(--transition-bounce);
  white-space: nowrap;
}

.btn-spotlight-launch:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #4f46e5 100%);
  box-shadow: 0 12px 32px var(--primary-glow), 0 0 20px rgba(99, 102, 241, 0.5);
}

.btn-spotlight-launch:active {
  transform: scale(0.98);
}

.btn-spotlight-launch i {
  font-size: 1.15rem;
  transition: transform var(--transition-fast);
}

.btn-spotlight-launch:hover i:last-child {
  transform: translateX(4px);
}

.spotlight-direct-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.spotlight-direct-hint i {
  color: #f59e0b;
}

/* Compact Divider */
.access-divider-compact {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0 1.5rem;
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.access-divider-compact::before,
.access-divider-compact::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-medium);
}

.access-divider-compact span {
  padding: 0 1rem;
}

.access-form {
  margin-bottom: 2.25rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.5rem 0.4rem 1.15rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow), inset 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.input-icon {
  color: var(--text-faint);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.input-wrapper input::placeholder {
  color: var(--text-faint);
  font-family: var(--font-sans);
  text-transform: none;
  font-weight: 400;
  font-size: 0.95rem;
}

.error-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  animation: shake 300ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Preset Practice Chips Section */
.preset-codes {
  margin-bottom: 2.5rem;
  text-align: left;
}

.preset-header-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
  gap: 1rem;
}

.preset-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preset-sub-hint {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.preset-badge-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.preset-chip {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-bounce);
  display: flex;
  flex-direction: column;
  position: relative;
}

.preset-chip:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -4px var(--primary-glow);
}

/* Individual Week Card */
.preset-chip.week-card {
  min-height: 120px;
  justify-content: space-between;
}

.week-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.week-code {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.04em;
}

[data-theme="dark"] .week-code {
  color: #a5b4fc;
}

.week-qcount {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
}

.week-name {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0.85rem;
  line-height: 1.38;
}

/* Explicit Action Button inside Every Box */
.chip-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  box-sizing: border-box;
  transition: all var(--transition-fast);
  margin-top: auto;
}

[data-theme="dark"] .chip-cta-btn {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.chip-cta-btn i {
  font-size: 0.8rem;
  transition: transform var(--transition-fast);
}

.preset-chip:hover .chip-cta-btn {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.preset-chip:hover .chip-cta-btn i {
  transform: translateX(3px);
}

/* Featured Master Quiz Button in List */
.preset-chip.master-chip {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(212, 175, 55, 0.16) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  box-shadow: 0 8px 24px -4px var(--primary-glow);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-bounce);
}

[data-theme="dark"] .preset-chip.master-chip {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(250, 204, 21, 0.15) 100%);
  border-color: #818cf8;
}

.preset-chip.master-chip::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.15) 30%,
    rgba(255, 255, 255, 0.28) 35%,
    transparent 45%
  );
  transform: rotate(25deg);
  animation: shimmerSweep 4.5s ease-in-out infinite;
  pointer-events: none;
}

.preset-chip.master-chip:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18) 0%, rgba(212, 175, 55, 0.24) 100%);
  box-shadow: 0 16px 36px -4px var(--primary-glow);
  transform: translateY(-3px) scale(1.006);
  border-color: #d4af37;
}

.master-chip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.master-chip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  color: #1a1505;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
}

[data-theme="dark"] .master-chip-badge {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
}

.master-chip-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.preset-chip.master-chip .master-chip-code {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.preset-chip.master-chip small {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.chip-cta-btn.master-cta-btn {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.preset-chip.master-chip:hover .chip-cta-btn.master-cta-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.5);
}

/* Coming Soon Preset Chip */
.preset-chip.chip-coming-soon {
  position: relative;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.05) 0%, rgba(79, 70, 229, 0.03) 100%);
  border: 1.5px dashed rgba(217, 119, 6, 0.45);
}

.preset-chip.chip-coming-soon:hover {
  background: var(--bg-card);
  border-color: #f59e0b;
  box-shadow: 0 6px 18px -2px rgba(217, 119, 6, 0.22);
}

.preset-chip.chip-coming-soon .week-code {
  color: #d97706;
}

[data-theme="dark"] .preset-chip.chip-coming-soon .week-code {
  color: #fbbf24;
}

.chip-cta-btn.cta-btn-soon {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.3);
  color: #d97706;
}

.preset-chip.chip-coming-soon:hover .chip-cta-btn.cta-btn-soon {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  border-color: #d97706;
  box-shadow: none;
}

[data-theme="dark"] .chip-cta-btn.cta-btn-soon {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.18), rgba(245, 158, 11, 0.22));
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

[data-theme="dark"] .coming-soon-badge {
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.25), rgba(245, 158, 11, 0.28));
}

/* Features Highlights Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  text-align: left;
}

.feature-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.feature-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.feature-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   SCREEN 2: ACTIVE QUIZ PRACTICE HUD & PRESENTATION
   ========================================================================== */

.quiz-hud {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 0.85rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: background-color var(--transition-normal);
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.hud-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 250px;
}

.hud-course-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), rgba(79, 70, 229, 0.12));
  border: 1px solid rgba(212, 175, 55, 0.38);
  font-size: 0.76rem;
  font-weight: 700;
  color: #b45309;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme="dark"] .hud-course-badge {
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(99, 102, 241, 0.2));
}

.hud-course-badge i {
  font-size: 0.84rem;
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.hud-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timer-box {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.timer-box.timer-warning {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
  animation: pulse 1s infinite;
}

/* Real-Time Metrics Bar */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast);
}

.metric-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.metric-card-highlight {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(124, 58, 237, 0.12) 100%);
  border-color: var(--border-bright);
}

.text-info { color: var(--info); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Progress Track */
.progress-container {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: var(--radius-full);
  transition: width 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quiz Content Layout */
.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
  transition: grid-template-columns 250ms ease;
}

.quiz-layout.palette-closed {
  grid-template-columns: 1fr;
}

.quiz-layout.palette-closed .palette-drawer {
  display: none;
}

/* Question Stage Card */
.question-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-lg);
  transition: background-color var(--transition-normal);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.question-counter {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 70, 229, 0.25);
}

.status-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
}

.status-indicator-badge.locked {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

/* Question Origin Detail Banner (Above Question) */
.question-origin-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.09) 0%, rgba(124, 58, 237, 0.09) 100%);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.06);
}

[data-theme="dark"] .question-origin-banner {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.origin-icon {
  font-size: 0.9rem;
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.26rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.62;
  margin-bottom: 1.75rem;
  letter-spacing: -0.012em;
  white-space: pre-line;
}

/* ==========================================================================
   SHUFFLE ANSWERS & OPTIONS CONTROLS
   ========================================================================== */

.options-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.95rem;
  padding: 0 0.2rem;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.options-header-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.options-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.options-toggle-all-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.options-toggle-all-label:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
}

.options-toggle-all-label .pref-toggle-text {
  min-width: 82px;
  font-size: 0.76rem;
}

.btn-shuffle-answers {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-family: var(--font-sans);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-shuffle-answers:hover:not(:disabled) {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-shuffle-answers:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.btn-shuffle-answers:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-subtle);
  background: var(--bg-surface);
  transform: none;
  box-shadow: none;
}

.btn-shuffle-footer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1.1rem;
}

.btn-shuffle-footer:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shuffle-icon {
  font-size: 0.88rem;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spinning .shuffle-icon {
  transform: rotate(180deg);
}

/* Shuffle Micro-Animation on Option Cards */
.options-grid.shuffling .option-card {
  animation: shufflePop 280ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes shufflePop {
  0% {
    opacity: 0.25;
    transform: scale(0.96) translateY(5px);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.01) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Practice & Shuffle Preferences Card on Screen 1 */
.practice-preferences-card {
  margin: 1.25rem 0 1.75rem;
  padding: 1.15rem 1.4rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

[data-theme="dark"] .practice-preferences-card {
  background: rgba(26, 35, 54, 0.75);
  border-color: rgba(255, 255, 255, 0.12);
}

.preferences-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preferences-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.preferences-note {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(79, 70, 229, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

[data-theme="dark"] .preferences-note {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.35);
}

.preferences-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 768px) {
  .preferences-grid {
    grid-template-columns: 1fr;
  }
}

.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 0.85rem;
}

.preference-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pref-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.pref-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pref-status-pill {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.09);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  border: 1px solid rgba(79, 70, 229, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

[data-theme="dark"] .pref-status-pill {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.pref-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.pref-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pref-toggle-track {
  width: 40px;
  height: 22px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  border-radius: 9999px;
  position: relative;
  transition: all var(--transition-fast);
}

.pref-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.pref-checkbox:checked + .pref-toggle-track {
  background: var(--primary);
  border-color: var(--primary);
}

.pref-checkbox:checked + .pref-toggle-track .pref-toggle-thumb {
  transform: translateX(18px);
  background: #ffffff;
}

.pref-toggle-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 82px;
}

/* Floating Toast Notification */
.quiz-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .quiz-toast {
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.3);
}

.quiz-toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  color: #10b981;
  font-size: 0.95rem;
}

/* Options Grid */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-bottom: 2rem;
}

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  color: var(--text-main);
  outline: none;
  user-select: none;
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
  animation: optionCardIn 260ms ease-out backwards;
}

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

.option-card:hover:not(:disabled) {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.006);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.15);
}

.option-card:focus-visible:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.option-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.option-text {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.005em;
  color: var(--text-main);
  white-space: pre-line;
}

.option-status-icon {
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Locked / Answered States */
.option-card:disabled {
  cursor: default;
}

/* Correct Answer Locked State */
.option-card.option-correct {
  background: var(--success-bg) !important;
  border-color: var(--success-border) !important;
  color: var(--text-main) !important;
  box-shadow: 0 0 16px var(--success-glow);
}

.option-card.option-correct .option-badge {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.option-card.option-correct .option-status-icon {
  opacity: 1;
  color: var(--success);
}

/* Incorrect Choice Locked State */
.option-card.option-incorrect {
  background: var(--danger-bg) !important;
  border-color: var(--danger-border) !important;
  color: var(--text-main) !important;
  box-shadow: 0 0 16px var(--danger-glow);
}

.option-card.option-incorrect .option-badge {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.option-card.option-incorrect .option-status-icon {
  opacity: 1;
  color: var(--danger);
}

.option-card.option-dimmed {
  opacity: 0.6;
}

/* Feedback Explanation Panel */
.feedback-panel {
  background: var(--bg-surface-elevated);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  animation: slideDown 250ms ease-out forwards;
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-panel.feedback-correct {
  border-left-color: var(--success);
  background: var(--success-bg);
}

.feedback-panel.feedback-incorrect {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}

.feedback-badge {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.feedback-correct .feedback-badge {
  color: var(--success);
}

.feedback-incorrect .feedback-badge {
  color: var(--danger);
}

.feedback-explanation {
  font-family: var(--font-body);
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.68;
  white-space: pre-line;
}

/* Question Footer */
.question-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Palette Drawer */
.palette-drawer {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 1rem;
  transition: background-color var(--transition-normal);
}

.palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.palette-header-title {
  display: flex;
  flex-direction: column;
}

.palette-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.palette-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-palette-close {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  line-height: 1;
  transition: all var(--transition-fast);
}

.btn-palette-close:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--text-main);
}

.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 23, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 450;
  animation: fadeInBackdrop 200ms ease;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.review-origin-tag {
  color: var(--primary);
  font-size: 0.8rem;
  display: inline-block;
  white-space: nowrap;
  font-weight: 700;
}

.palette-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-correct { background-color: var(--success); }
.dot-incorrect { background-color: var(--danger); }
.dot-unanswered { background-color: #64748b; }
.dot-current { background-color: var(--primary); box-shadow: 0 0 6px var(--primary); }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.palette-btn {
  aspect-ratio: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.palette-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  transform: translateY(-1px);
}

.palette-btn.palette-active {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 10px var(--primary-glow);
}

.palette-btn.palette-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.palette-btn.palette-incorrect {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.palette-lock-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   SCREEN 3: RESULTS SCREEN & REVIEW LIST
   ========================================================================== */

.results-container {
  max-width: 900px;
  margin: 0 auto;
}

.results-hero {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  transition: background-color var(--transition-normal);
}

.results-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--success), var(--secondary));
}

.results-trophy {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: trophyFloat 3.5s ease-in-out infinite alternate;
}

.results-course-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.15rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(212, 175, 55, 0.12));
  border: 1px solid rgba(79, 70, 229, 0.3);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.95rem;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .results-course-tag {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(250, 204, 21, 0.15));
  border-color: rgba(129, 140, 248, 0.4);
  color: #818cf8;
}

.results-course-tag i {
  color: #d4af37;
}

@keyframes trophyFloat {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(-3deg) scale(1.05); }
  100% { transform: translateY(0) rotate(3deg); }
}

.results-title {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.results-subtitle {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 1.02rem;
  font-weight: 500;
  margin-bottom: 2rem;
}

.score-ring-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.score-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(79, 70, 229, 0.12) 0%, var(--bg-card) 75%);
  border: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--primary-glow);
  animation: ringPulse 3.5s ease-in-out infinite alternate;
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 25px var(--primary-glow); }
  100% { box-shadow: 0 0 45px var(--primary-glow), 0 0 15px rgba(16, 185, 129, 0.3); }
}

.score-percentage {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.score-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 600;
}

.results-tag {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.res-stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.res-stat-title {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.res-stat-number {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Question Review Section */
.review-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-lg);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.review-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.review-filters {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  padding: 0.3rem;
  border-radius: var(--radius-md);
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.review-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform var(--transition-fast);
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.review-item-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.review-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-res-correct {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-res-incorrect {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-res-unanswered {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.review-question-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.58;
  color: var(--text-main);
  margin-bottom: 1.1rem;
  white-space: pre-line;
}

.review-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.review-answer-box {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  color: var(--text-main);
}

.review-answer-box span {
  font-family: var(--font-body);
  font-size: 0.96rem;
  line-height: 1.5;
  white-space: pre-line;
}

.review-answer-box small {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.review-explanation-box {
  background: rgba(79, 70, 229, 0.08);
  border-left: 3px solid var(--primary);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--text-main);
  line-height: 1.62;
  white-space: pre-line;
}

/* Modal Confirmation Dialog */
.custom-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 600px;
  width: 90%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.custom-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.dialog-content {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: var(--text-main);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.dialog-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dialog-title-wrapper h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.dialog-body {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.dialog-sm {
  max-width: 440px;
}

/* Footer */
.app-footer {
  margin-top: auto;
  padding: 2.25rem 0 1.25rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  text-align: center;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

.footer-social-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.footer-dev-credit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.footer-social-links {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
  user-select: none;
}

.social-link i {
  font-size: 1rem;
  transition: transform var(--transition-fast);
}

.social-link:hover {
  transform: translateY(-2px);
  color: #ffffff !important;
}

.social-link:hover i {
  transform: scale(1.15);
}

/* Branded hover states */
.social-link.social-instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: #dc2743;
  box-shadow: 0 6px 18px -2px rgba(220, 39, 67, 0.45);
}

.social-link.social-linkedin:hover {
  background: #0a66c2;
  border-color: #0a66c2;
  box-shadow: 0 6px 18px -2px rgba(10, 102, 194, 0.45);
}

.social-link.social-github:hover {
  background: #24292f;
  border-color: #24292f;
  box-shadow: 0 6px 18px -2px rgba(36, 41, 47, 0.45);
}

[data-theme="dark"] .social-link.social-github:hover {
  background: #1f242c;
  border-color: #4b5262;
  box-shadow: 0 6px 18px -2px rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   RESPONSIVE DESIGN (ALL DEVICES)
   ========================================================================== */

@media (max-width: 900px) {
  .nav-center {
    display: none;
  }
  .hide-tablet {
    display: none;
  }
  .quiz-layout {
    grid-template-columns: 1fr;
  }
  
  /* Mobile / Tablet slide-up bottom sheet drawer */
  .btn-palette-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .palette-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 500;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
    border: 1px solid var(--border-medium);
    border-bottom: none;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    overflow-y: auto;
  }
  
  .palette-drawer.mobile-open {
    display: block !important;
    animation: slideUpPalette 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  .metrics-bar {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
  }
  .metric-card-highlight {
    grid-column: span 2;
  }
  
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes slideUpPalette {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 0.5rem 0.5rem 1.75rem;
  }
  
  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    min-height: 52px;
    box-sizing: border-box;
    top: 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .brand-logo-wrapper {
    width: 34px;
    height: 34px;
  }
  .brand-logo-img {
    width: 32px;
    height: 32px;
  }
  .brand-title {
    font-size: 1rem;
  }
  .brand-subtitle,
  .theme-mode-text {
    display: none;
  }
  .nav-edition-badge {
    font-size: 0.6rem;
    padding: 0.12rem 0.4rem;
  }
  
  .access-card {
    padding: 0.85rem 0.8rem 1.35rem;
    margin: 0.25rem auto 1.5rem;
    border-radius: var(--radius-md);
  }
  
  .course-header-banner {
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
  }
  .course-badge-pill {
    padding: 0.18rem 0.55rem;
    font-size: 0.66rem;
    margin-bottom: 0.35rem;
  }
  .course-banner-title {
    font-size: 1.25rem;
    line-height: 1.25;
    margin-bottom: 0.15rem;
  }
  .course-banner-sub {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
  }
  .course-meta-pills {
    gap: 0.3rem;
  }
  .meta-pill {
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
  }

  /* Master Spotlight Hero on Android */
  .master-spotlight-card {
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.85rem;
    border-radius: var(--radius-md);
  }
  .spotlight-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
  }
  .spotlight-badge {
    font-size: 0.66rem;
    padding: 0.18rem 0.55rem;
  }
  .spotlight-code-badge {
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
  }
  .spotlight-code-badge .code-text {
    font-size: 0.92rem;
    font-weight: 800;
  }
  .spotlight-body {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .spotlight-text-col {
    width: 100%;
  }
  .spotlight-title {
    font-size: 1.12rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }
  .spotlight-subtitle {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-bottom: 0.45rem;
  }
  .spotlight-perks {
    gap: 0.3rem;
    margin-bottom: 0.65rem;
  }
  .perk-pill {
    font-size: 0.68rem;
    padding: 0.18rem 0.45rem;
  }
  .spotlight-action-col {
    width: 100%;
  }
  .btn-spotlight-launch {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    min-height: 48px;
    justify-content: center;
    box-sizing: border-box;
  }
  .spotlight-direct-hint {
    font-size: 0.7rem;
    justify-content: center;
    text-align: center;
    margin-top: 0.25rem;
  }

  .access-divider-compact {
    margin: 0.85rem 0 1rem;
    font-size: 0.68rem;
  }

  .input-wrapper {
    flex-direction: column;
    padding: 0.6rem;
    gap: 0.6rem;
  }
  .input-wrapper input {
    width: 100%;
    text-align: center;
    font-size: 0.92rem;
    padding: 0.35rem;
  }
  .input-wrapper .btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }

  /* Preset Modules Grid on Android */
  .preset-codes {
    margin-bottom: 1.75rem;
  }
  .preset-header-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }
  .preset-label {
    font-size: 0.8rem;
  }
  .preset-sub-hint {
    font-size: 0.72rem;
  }
  .preset-badge-tag {
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
  }
  .preset-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .preset-chip {
    padding: 0.65rem 0.65rem;
  }
  .preset-chip.week-card {
    min-height: 105px;
    border-radius: var(--radius-sm);
  }
  .week-code {
    font-size: 0.92rem;
  }
  .week-qcount {
    font-size: 0.66rem;
    padding: 0.1rem 0.35rem;
  }
  .week-name {
    font-size: 0.74rem;
    margin-bottom: 0.55rem;
    line-height: 1.25;
  }
  .chip-cta-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.74rem;
    border-radius: 4px;
  }
  .preset-chip.master-chip {
    padding: 0.85rem 0.95rem;
  }
  .preset-chip.master-chip .master-chip-code {
    font-size: 1.15rem !important;
  }
  .preset-chip.master-chip small {
    font-size: 0.76rem;
    margin-bottom: 0.55rem;
  }
  .chip-cta-btn.master-cta-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }
  
  .hud-course-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
  
  .neo-nav-toggle {
    width: 102px;
    height: 38px;
    padding: 3px;
  }
  .neo-toggle-thumb {
    width: 30px;
    height: 30px;
    top: 2.5px;
    left: 2.5px;
    transform: translateX(64px);
  }
  [data-theme="dark"] .neo-toggle-thumb {
    transform: translateX(0px);
  }
  .neo-toggle-label {
    font-size: 0.60rem;
    line-height: 1.1;
  }
  .neo-label-light {
    left: 9px;
  }
  .neo-label-dark {
    right: 9px;
  }
  
  /* Quiz HUD */
  .quiz-hud {
    padding: 0.85rem 0.85rem 0.65rem;
  }
  .hud-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .hud-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    width: 100%;
  }
  .hud-title {
    max-width: 65%;
    font-size: 0.88rem;
  }
  .hud-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  /* 7-Card Metrics Bar: 2 rows of 3, with Accuracy spanning full width */
  .metrics-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
  }
  .metric-card {
    padding: 0.5rem 0.3rem;
  }
  .metric-label {
    font-size: 0.62rem;
  }
  .metric-val {
    font-size: 1.1rem;
  }
  .metric-card-highlight {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
  }
  .metric-card-highlight .metric-label {
    margin-bottom: 0;
  }
  
  /* Question Card */
  .question-card {
    padding: 1.25rem 0.95rem;
  }
  .question-header {
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
  }
  .question-origin-banner {
    font-size: 0.74rem;
    padding: 0.35rem 0.7rem;
    margin-bottom: 0.75rem;
  }
  .question-text {
    font-size: 1.15rem;
    line-height: 1.45;
    margin-bottom: 1.25rem;
  }
  .option-card {
    padding: 0.85rem 0.85rem;
    gap: 0.75rem;
  }
  .option-badge {
    width: 30px;
    height: 30px;
    font-size: 0.84rem;
  }
  .option-text {
    font-size: 0.92rem;
    line-height: 1.4;
  }
  
  /* Question Footer wizard buttons */
  .question-footer {
    flex-direction: column-reverse;
    gap: 0.65rem;
    margin-top: 1.5rem;
  }
  .footer-left,
  .footer-right {
    width: 100%;
    display: flex;
    gap: 0.55rem;
    margin-left: 0;
  }
  .footer-left .btn,
  .footer-right .btn {
    flex: 1;
    justify-content: center;
  }
  
  /* Results Hero */
  .results-hero {
    padding: 1.5rem 1rem 1.35rem;
  }
  .results-title {
    font-size: 1.55rem;
  }
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }
  .res-stat-card {
    padding: 0.85rem 0.55rem;
  }
  .res-stat-number {
    font-size: 1.35rem;
  }
  
  /* Results Actions */
  .results-actions {
    flex-direction: column;
    gap: 0.55rem;
  }
  .results-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Review section */
  .review-section {
    padding: 1.25rem 0.95rem;
  }
  .review-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .review-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    width: 100%;
  }
  .filter-btn {
    padding: 0.4rem 0.15rem;
    font-size: 0.68rem;
    text-align: center;
    white-space: nowrap;
  }
  .review-item {
    padding: 0.95rem;
  }
  .review-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .review-answer-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  
  /* Dialog modal */
  .custom-dialog {
    width: calc(100% - 1.25rem);
    max-width: calc(100% - 1.25rem);
    margin: auto;
  }
  .dialog-content {
    padding: 1.25rem 1rem;
  }
  .dialog-footer {
    flex-direction: column-reverse;
    gap: 0.55rem;
  }
  .dialog-footer .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hide-mobile {
    display: none;
  }
  
  .footer-social-wrapper {
    flex-direction: column;
    gap: 0.65rem;
  }
  .footer-social-links {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .app-container {
    padding: 0.35rem 0.35rem 1.25rem;
  }
  .app-header {
    padding: 0.4rem 0.65rem;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .access-card {
    padding: 0.75rem 0.6rem 1.15rem;
  }
  .course-banner-title {
    font-size: 1.15rem;
  }
  .course-meta-pills {
    gap: 0.25rem;
  }
  .meta-pill {
    font-size: 0.66rem;
    padding: 0.15rem 0.45rem;
  }
  .spotlight-title {
    font-size: 1.02rem;
  }
  .btn-spotlight-launch {
    font-size: 0.9rem;
    padding: 0.7rem 0.85rem;
  }
  .preset-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }
  .preset-chip.week-card {
    padding: 0.55rem 0.5rem;
    min-height: 95px;
  }
  .week-code {
    font-size: 0.86rem;
  }
  .week-name {
    font-size: 0.7rem;
  }
  .chip-cta-btn {
    padding: 0.3rem 0.4rem;
    font-size: 0.7rem;
  }
  .question-card {
    padding: 1rem 0.75rem;
  }
  .question-text {
    font-size: 1.05rem;
  }
  .option-card {
    padding: 0.75rem 0.75rem;
    gap: 0.55rem;
  }
  .option-text {
    font-size: 0.88rem;
  }
}

/* Enhanced Desktop Viewports (Large screens & Widescreen) */
@media (min-width: 1200px) {
  .app-container {
    max-width: 1240px;
  }
  .access-card {
    max-width: 860px;
    padding: 2rem 2.25rem;
  }
  .course-banner-title {
    font-size: 1.75rem;
  }
  .spotlight-title {
    font-size: 1.4rem;
  }
  .btn-spotlight-launch {
    padding: 1rem 2rem;
    font-size: 1.08rem;
  }
  .preset-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.95rem;
  }
  .quiz-layout {
    grid-template-columns: 1fr 320px;
    gap: 1.75rem;
  }
}
