/* ═══════════════════════════════════════════════
   Gate Valve MCQ Questionnaire — Premium Dark Theme
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --easy-color: #34d399;
  --easy-bg: rgba(52, 211, 153, 0.12);
  --medium-color: #fbbf24;
  --medium-bg: rgba(251, 191, 36, 0.12);
  --hard-color: #f87171;
  --hard-bg: rgba(248, 113, 113, 0.12);

  --correct-color: #34d399;
  --correct-bg: rgba(52, 211, 153, 0.15);
  --wrong-color: #f87171;
  --wrong-bg: rgba(248, 113, 113, 0.15);

  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated Background ── */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-decoration .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-decoration .orb:nth-child(1) {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.bg-decoration .orb:nth-child(2) {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent);
  bottom: -10%;
  left: -5%;
  animation-delay: -7s;
}

.bg-decoration .orb:nth-child(3) {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.08), transparent);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(10px, 30px) scale(1.02); }
}

/* ── Main Container ── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100vh;
}

/* ── Screens ── */
.screen {
  display: none;
  animation: fadeSlideIn 0.5s var(--transition-slow);
}

.screen.active {
  display: block;
}

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

/* ═══════════════════════════════════════════════
   WELCOME SCREEN
   ═══════════════════════════════════════════════ */

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  text-align: center;
}

.welcome-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}

.welcome-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.welcome-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-weight: 400;
}

.welcome-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.stat-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  transition: var(--transition-normal);
}

.stat-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-normal);
  outline: none;
}

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

.input-group input::placeholder {
  color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

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

.btn-full {
  width: 100%;
}

.btn-icon {
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════
   QUIZ SCREEN
   ═══════════════════════════════════════════════ */

/* ── Top Bar ── */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info .user-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.timer-display.warning {
  color: var(--medium-color);
  border-color: rgba(251, 191, 36, 0.3);
  animation: timerPulse 1s ease-in-out infinite;
}

.timer-display.danger {
  color: var(--hard-color);
  border-color: rgba(248, 113, 113, 0.3);
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.timer-icon {
  font-size: 1rem;
}

/* ── Progress ── */
.progress-section {
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.progress-percentage {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-glass);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  border-radius: 100px;
}

/* ── Question Card ── */
.question-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  animation: fadeSlideIn 0.4s ease;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.question-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty-badge.easy {
  background: var(--easy-bg);
  color: var(--easy-color);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.difficulty-badge.medium {
  background: var(--medium-bg);
  color: var(--medium-color);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.difficulty-badge.hard {
  background: var(--hard-bg);
  color: var(--hard-color);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.difficulty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* ── Options ── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  user-select: none;
}

.option-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.option-item.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.option-item.correct {
  background: var(--correct-bg);
  border-color: var(--correct-color);
  box-shadow: 0 0 0 1px var(--correct-color);
}

.option-item.wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong-color);
  box-shadow: 0 0 0 1px var(--wrong-color);
}

.option-item.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.option-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition-normal);
}

.option-item.selected .option-letter {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.option-item.correct .option-letter {
  background: var(--correct-color);
  border-color: var(--correct-color);
  color: #fff;
}

.option-item.wrong .option-letter {
  background: var(--wrong-color);
  border-color: var(--wrong-color);
  color: #fff;
}

.option-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 4px;
  transition: var(--transition-normal);
}

.option-item.selected .option-text,
.option-item:hover .option-text {
  color: var(--text-primary);
}

/* ── Navigation ── */
.quiz-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}

.nav-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Question Palette ── */
.palette-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-bottom: 16px;
}

.palette-toggle:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.palette-toggle .chevron {
  transition: transform var(--transition-normal);
  font-size: 0.7rem;
}

.palette-toggle.open .chevron {
  transform: rotate(180deg);
}

.question-palette {
  display: none;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  animation: fadeSlideIn 0.3s ease;
}

.question-palette.visible {
  display: block;
}

.palette-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.palette-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-dot.current { background: var(--accent-primary); }
.legend-dot.answered { background: var(--easy-color); }
.legend-dot.flagged { background: var(--medium-color); }
.legend-dot.unanswered { background: var(--bg-glass); border: 1px solid var(--border-color); }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}

.palette-item {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.palette-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.palette-item.current {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.palette-item.answered {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--easy-color);
}

.palette-item.flagged {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--medium-color);
}

/* ═══════════════════════════════════════════════
   RESULTS SCREEN
   ═══════════════════════════════════════════════ */

.results-screen {
  padding-top: 40px;
}

.results-header {
  text-align: center;
  margin-bottom: 40px;
}

.results-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.results-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Score Circle */
.score-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.score-circle-container {
  margin-bottom: 24px;
}

.score-circle {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  position: relative;
}

.score-circle svg {
  transform: rotate(-90deg);
  width: 180px;
  height: 180px;
}

.score-circle .bg-ring {
  fill: none;
  stroke: var(--bg-glass);
  stroke-width: 10;
}

.score-circle .progress-ring {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.score-total {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.score-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.score-detail-item {
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.score-detail-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.score-detail-value.correct-val { color: var(--correct-color); }
.score-detail-value.wrong-val { color: var(--wrong-color); }
.score-detail-value.skip-val { color: var(--text-muted); }

.score-detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Difficulty Breakdown */
.breakdown-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
}

.breakdown-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.breakdown-item:last-child {
  margin-bottom: 0;
}

.breakdown-label {
  width: 72px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.breakdown-label.easy { color: var(--easy-color); }
.breakdown-label.medium { color: var(--medium-color); }
.breakdown-label.hard { color: var(--hard-color); }

.breakdown-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-glass);
  border-radius: 100px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.breakdown-bar.easy { background: var(--easy-color); }
.breakdown-bar.medium { background: var(--medium-color); }
.breakdown-bar.hard { background: var(--hard-color); }

.breakdown-score {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* Review Section */
.review-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
}

.review-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.review-item {
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: var(--transition-normal);
}

.review-item:last-child {
  margin-bottom: 0;
}

.review-item:hover {
  background: var(--bg-glass-hover);
}

.review-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.review-q-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.review-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-status.correct {
  background: var(--correct-bg);
  color: var(--correct-color);
}

.review-status.wrong {
  background: var(--wrong-bg);
  color: var(--wrong-color);
}

.review-status.skipped {
  background: var(--bg-glass);
  color: var(--text-muted);
}

.review-q-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 8px;
}

.review-answer {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.review-answer span {
  font-weight: 600;
}

.review-answer .correct-ans {
  color: var(--correct-color);
}

.review-answer .wrong-ans {
  color: var(--wrong-color);
}

/* Results Actions */
.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-bottom: 40px;
}

/* ── Submit Confirmation Modal ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.visible {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: fadeSlideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
}

.modal-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-stat-value.answered-count { color: var(--easy-color); }
.modal-stat-value.unanswered-count { color: var(--text-muted); }

.modal-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 640px) {
  .app-container {
    padding: 16px 12px;
  }

  .welcome-card {
    padding: 32px 24px;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .welcome-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-value {
    font-size: 1rem;
  }

  .quiz-topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .question-card {
    padding: 20px 16px;
  }

  .question-text {
    font-size: 1rem;
  }

  .option-item {
    padding: 12px 14px;
  }

  .quiz-navigation {
    flex-wrap: wrap;
  }

  .quiz-navigation .btn {
    flex: 1;
    min-width: 100px;
  }

  .score-details {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .score-circle {
    width: 150px;
    height: 150px;
  }

  .score-circle svg {
    width: 150px;
    height: 150px;
  }

  .results-actions {
    flex-direction: column;
  }

  .modal-stats {
    gap: 16px;
  }

  .modal-actions {
    flex-direction: column;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ── Selection ── */
::selection {
  background: var(--accent-primary);
  color: #fff;
}

/* Flag button */
.btn-flag {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 0.8rem;
}

.btn-flag:hover {
  border-color: var(--medium-color);
  color: var(--medium-color);
}

.btn-flag.flagged {
  background: var(--medium-bg);
  border-color: var(--medium-color);
  color: var(--medium-color);
}
