/* ==========================================================================
   Life in the UK Test - Quiz and Practice
   Mobile-First, Gamified 9:16 Layout & Design System
   ========================================================================== */

:root {
  --bg-space: #070b19;
  --bg-frame: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #27354f;
  --bg-glass: rgba(30, 41, 59, 0.75);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;

  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --royal-gold: #f59e0b;
  --royal-gold-glow: rgba(245, 158, 11, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);
  --warning: #f59e0b;
  --accent-purple: #8b5cf6;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);

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

  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-bn: 'Noto Sans Bengali', -apple-system, sans-serif;
  --font-family: var(--font-en);

  --shadow-phone: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 8px 20px -4px rgba(0, 0, 0, 0.35);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-space);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  user-select: none;
}

/* Background Atmospheric Gradient */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 20%, #1e1e38 0%, #080c18 70%, #03060d 100%);
  background-attachment: fixed;
}

/* ==========================================================================
   Mobile-First & 9:16 Centered Chassis
   ========================================================================== */

#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 440px;
  max-height: min(94vh, calc(440px * 16 / 9));
  aspect-ratio: 9 / 16;
  background-color: var(--bg-frame);
  border-radius: 36px;
  box-shadow: var(--shadow-phone);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Real Mobile Edge-to-Edge Experience */
@media (max-width: 480px), (max-height: 680px) {
  #app-container {
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* Phone Top Decorative Notch/Pill on Desktop */
.notch-indicator {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  z-index: 100;
  pointer-events: none;
}

@media (max-width: 480px) {
  .notch-indicator {
    display: none;
  }
}

/* ==========================================================================
   App Top Bar / Header
   ========================================================================== */

.app-header {
  flex-shrink: 0;
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-crest {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}

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

.brand-main {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--royal-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Sound Button */
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.muted {
  opacity: 0.5;
}

/* ==========================================================================
   Screen Containers & Transitions
   ========================================================================== */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.screen::-webkit-scrollbar {
  width: 5px;
}

.screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Topic Selection Screen
   ========================================================================== */

.overall-stats-banner {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.stat-pill {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.stat-icon {
  font-size: 1.15rem;
}

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

.stat-num {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Passing Requirement Notice Card */
.rule-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(59, 130, 246, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-banner-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.rule-banner-text {
  font-size: 0.8rem;
  color: #fef3c7;
  line-height: 1.35;
}

.rule-banner-text strong {
  color: #fbbf24;
}

/* Search Bar */
.search-wrapper {
  margin-bottom: 14px;
  position: relative;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 10px 18px 10px 40px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.topic-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.count-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* Topic Cards List */
.topic-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}

.topic-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.topic-card:active {
  transform: scale(0.98);
}

.topic-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.topic-content {
  flex: 1;
  min-width: 0;
}

.topic-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

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

.topic-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

.topic-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.topic-card:hover .topic-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-practice {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Notice Modal: Mandatory 18/24 Requirement Alert
   ========================================================================== */

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 25, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  animation: fadeIn 0.25s ease;
}

.modal-card {
  width: 100%;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.5));
}

.modal-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--royal-gold);
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-topic-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 14px;
}

.modal-requirement {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: inset 0 0 15px rgba(245, 158, 11, 0.08);
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 20px;
}

.modal-timer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #e2e8f0;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-btn {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
}

.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

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

/* ==========================================================================
   Quiz Screen
   ========================================================================== */

.quiz-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.quiz-info-col {
  flex: 1;
  min-width: 0;
}

.quiz-topic-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-batch-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.quiz-stats-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Stepped / Batch Progress Bar */
.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Question Header with Timer */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.q-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--royal-gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Prominent Urgent Countdown Timer (6 seconds) */
.timer-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.7) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(255, 255, 255, 0.05);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.timer-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 7;
}

.timer-circle-progress {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s linear, stroke 0.25s ease;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5));
}

.timer-number {
  position: absolute;
  font-size: 1.18rem;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  transition: color 0.2s ease, transform 0.2s ease;
}

/* 4s - Warning state */
.timer-pill.warning .timer-circle-progress {
  stroke: var(--warning);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
}

.timer-pill.warning .timer-number {
  color: #fde047;
}

.timer-pill.warning {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
  transform: scale(1.04);
}

/* <= 3s - Critical Heartbeat state */
.timer-pill.critical .timer-circle-progress {
  stroke: #ef4444;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.9));
}

.timer-pill.critical .timer-number {
  color: #fca5a5;
}

.timer-pill.critical {
  animation: urgentHeartbeat 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5), inset 0 0 12px rgba(239, 68, 68, 0.3);
}

@keyframes urgentHeartbeat {
  0% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
  }
  30% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.95));
  }
  50% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(1.18);
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 1));
  }
  100% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
  }
}

/* 1s - Extreme Panic State */
.timer-pill.panic {
  animation: panicAlarm 0.18s ease-in-out infinite alternate !important;
}

@keyframes panicAlarm {
  0% {
    transform: scale(1.16) rotate(-3deg);
    filter: drop-shadow(0 0 24px #ef4444) brightness(1.2);
  }
  100% {
    transform: scale(1.24) rotate(3deg);
    filter: drop-shadow(0 0 32px #ff2222) brightness(1.4);
  }
}

/* Question Title Card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.question-prompt {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
}

/* 4 Options Grid */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.option-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 52px;
}

.option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.option-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.option-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #cbd5e1;
}

.option-text {
  flex: 1;
}

.option-indicator {
  font-size: 1.1rem;
  font-weight: 900;
  margin-left: auto;
  flex-shrink: 0;
}

/* Answer Selected States */
.option-btn.correct {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%) !important;
  border-color: var(--success) !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px var(--success-glow);
}

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

.option-btn.correct .option-indicator {
  color: var(--success);
}

.option-btn.incorrect {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.35) 100%) !important;
  border-color: var(--danger) !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px var(--danger-glow);
  animation: shake 0.4s ease;
}

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

.option-btn.incorrect .option-indicator {
  color: var(--danger);
}

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

.pulse-glow {
  animation: glowAnimation 1s infinite alternate;
}

@keyframes glowAnimation {
  from { box-shadow: 0 0 5px var(--success-glow); }
  to { box-shadow: 0 0 20px var(--success); }
}

/* Explanation Card */
.explanation-card {
  background: linear-gradient(145deg, #1e293b 0%, #152033 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.3s ease;
}

.explanation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.explanation-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #93c5fd;
  letter-spacing: 0.04em;
}

.explanation-content {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.auto-advance-notice {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--royal-gold);
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: pulse 1s infinite alternate;
}

/* Quiz Bottom Navigation (Back & Forward) */
.quiz-nav-bar {
  margin-top: auto;
  display: flex;
  gap: 10px;
  padding-top: 10px;
  flex-shrink: 0;
}

.nav-btn {
  flex: 1;
  padding: 13px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.nav-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.nav-btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.nav-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   Results Screen: 18/24 Pass/Fail Threshold
   ========================================================================== */

.results-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.results-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.results-badge.pass {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 20px var(--success-glow);
}

.results-badge.fail {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 0 20px var(--danger-glow);
}

.results-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.results-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

/* Score Display Grid */
.results-score-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.score-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  min-width: 110px;
}

.score-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.results-threshold-notice {
  font-size: 0.78rem;
  color: #cbd5e1;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  line-height: 1.4;
}

/* Question Review Section */
.review-section {
  margin-bottom: 16px;
}

.review-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.82rem;
}

.review-item.correct {
  border-left: 4px solid var(--success);
}

.review-item.incorrect {
  border-left: 4px solid var(--danger);
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.review-num {
  font-weight: 800;
  color: var(--royal-gold);
}

.review-q {
  flex: 1;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.review-status {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.review-status.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.review-status.fail {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.review-status.timeout {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.review-details {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-row {
  display: flex;
  gap: 6px;
}

.review-label {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 90px;
}

.review-val {
  font-weight: 600;
}

.text-green { color: #34d399; }
.text-red { color: #f87171; }

.review-explanation {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  line-height: 1.35;
}

/* Results Actions */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.btn-cta {
  width: 100%;
  padding: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-cta-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--success-glow);
}

.btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}

.btn-cta-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-cta-secondary:hover {
  background: var(--bg-card-hover);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}
