/* ============================================================
   RoadReady — Virginia DMV practice
   Dark editorial theme · VA highway amber · Barlow/Cairo type
   ============================================================ */

:root {
  /* palette */
  --bg: #0a0d12;
  --bg-2: #0e131b;
  --panel: #121923;
  --panel-2: #172031;
  --line: rgba(244, 240, 228, 0.09);
  --line-strong: rgba(244, 240, 228, 0.18);
  --ink: #f4f0e4;
  --ink-dim: #cdc7b6;
  --muted: #8b93a3;
  --dim: #5a6271;

  --amber: #ffb703;
  --amber-2: #f0a500;
  --amber-deep: #b98606;
  --terracotta: #e4573b;
  --teal: #2ec4b6;
  --danger: #ef476f;
  --ok: #31c48d;

  --accent-soft: rgba(255, 183, 3, 0.12);
  --danger-soft: rgba(224, 82, 111, 0.12);
  --teal-soft: rgba(46, 196, 182, 0.12);

  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.35);

  --sans: "Barlow", "Segoe UI", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow", "Arial Narrow", sans-serif;
  --arabic: "Cairo", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 620px at 12% -10%, rgba(255, 183, 3, 0.10), transparent 60%),
    radial-gradient(1000px 500px at 92% 8%, rgba(228, 87, 62, 0.07), transparent 55%),
    radial-gradient(900px 700px at 50% 115%, rgba(46, 196, 182, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Arabic / RTL */
html[dir="rtl"] body,
html[dir="rtl"] .screen,
html[dir="rtl"] .topbar,
html[dir="rtl"] .foot p,
html[dir="rtl"] .disclaimer {
  font-family: var(--arabic);
}
html[dir="rtl"] .display,
html[dir="rtl"] .mode-title,
html[dir="rtl"] .gate-title,
html[dir="rtl"] .setup-title,
html[dir="rtl"] .weak-head .setup-title,
html[dir="rtl"] .stats-head .setup-title,
html[dir="rtl"] .brand-name {
  font-family: var(--arabic);
  font-weight: 800;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--amber); color: #000; }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #232c3d; border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* layout primitives */
.wrap { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.page { padding: 10px 0 64px; }
.screen { animation: rise 0.4s ease both; }
.screen[hidden] { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ============ TOP BAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #000;
  background: var(--amber);
  border-radius: 9px 9px 9px 2px;
  box-shadow: 0 6px 18px rgba(255, 183, 3, 0.30);
}
.brand-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.brand-name em {
  font-style: normal;
  color: var(--amber);
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.exam-status {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(255, 183, 3, 0.35);
  background: var(--accent-soft);
  padding: 6px 13px;
  border-radius: 999px;
}

.lang-btn {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  transition: 0.15s ease;
}
.lang-btn:hover { border-color: var(--amber); color: var(--amber); }

/* ============ HERO ============ */
.hero { padding: clamp(44px, 8vw, 92px) 0 24px; max-width: 800px; }

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
}
html[dir="rtl"] .eyebrow { letter-spacing: 0.05em; }

.display {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.display em { font-style: normal; color: var(--amber); }

.lede {
  margin: 24px 0 0;
  max-width: 600px;
  color: var(--ink-dim);
  font-size: 18px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn[hidden] { display: none; }
.btn-lg { padding: 16px 30px; font-size: 19px; }
.btn-sm { padding: 9px 15px; font-size: 14px; border-radius: 9px; }
html[dir="rtl"] .btn { letter-spacing: 0; }

.btn-primary {
  background: var(--amber);
  color: #0a0d12;
  box-shadow: 0 12px 30px rgba(255, 183, 3, 0.22);
}
.btn-primary:hover { background: var(--amber-2); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(255, 183, 3, 0.28); }
.btn-primary:disabled { background: var(--dim); color: #11151c; box-shadow: none; cursor: not-allowed; transform: none; }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-dim); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }

.btn-submit { background: var(--teal); color: #07151a; }
.btn-submit:hover { filter: brightness(1.08); transform: translateY(-2px); }

.btn-danger { background: var(--danger-soft); border-color: rgba(224, 82, 111, 0.4); color: #ff9aa9; }
.btn-danger:hover { background: rgba(224, 82, 111, 0.2); }

/* ============ HIGHWAY DIVIDER ============ */
.highway {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 30px 0 34px;
}
.wayline { height: 3px; flex: 1; background: var(--line-strong); border-radius: 2px; }
.dashes {
  height: 3px;
  flex: 2;
  background: repeating-linear-gradient(90deg, var(--amber) 0 14px, transparent 14px 30px);
  border-radius: 2px;
  animation: travel 1.6s linear infinite;
}
html[dir="rtl"] .dashes { background: repeating-linear-gradient(-90deg, var(--amber) 0 14px, transparent 14px 30px); }
@keyframes travel { to { background-position: 44px 0; } }

/* ============ STAT STRIP ============ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 42px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(23, 32, 49, 0.55), rgba(18, 25, 35, 0.55));
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-num {
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  line-height: 1;
  color: var(--amber);
}
.stat-label {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
html[dir="rtl"] .stat-label { letter-spacing: 0; }

/* ============ MODE GRID ============ */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.mode {
  display: flex;
  flex-direction: column;
  text-align: start;
  gap: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.mode:hover { transform: translateY(-4px); border-color: rgba(255, 183, 3, 0.5); box-shadow: var(--shadow-sm); }
.mode:active { transform: translateY(-1px); }
.mode--primary { border-color: rgba(255, 183, 3, 0.42); background: linear-gradient(180deg, rgba(255, 183, 3, 0.10), var(--panel)); }

.mode-step {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.mode-title { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.mode-title { text-transform: uppercase; }
.mode-desc { color: var(--muted); font-size: 14.5px; flex: 1; }
.mode-cta {
  margin-top: 16px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

.mode-actions { grid-column: 1 / -1; }

.disclaimer {
  margin: 40px 0 0;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
}

/* ============ EXAM HEADERS ============ */
.exam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(30px, 5vw, 54px) 0 14px;
  flex-wrap: wrap;
}
.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumb {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 12px;
  background: var(--panel);
  border-radius: 999px;
  border: 1px solid var(--line);
}
.crumb--now { color: var(--amber); border-color: rgba(255, 183, 3, 0.4); background: var(--accent-soft); }

.quota-chip {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid rgba(46, 196, 182, 0.4);
  background: var(--teal-soft);
  padding: 7px 14px;
  border-radius: 999px;
}
html[dir="rtl"] .quota-chip { letter-spacing: 0; }

.progress {
  height: 5px;
  background: var(--panel);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 26px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--terracotta));
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ============ QUESTION CARD ============ */
.qcard {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
}
.qcat {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
}
html[dir="rtl"] .qcat { letter-spacing: 0; }

.qtext {
  margin: 0;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink);
}

.qimg {
  margin: 22px 0 4px;
  display: grid;
  place-items: center;
}
.qimg[hidden] { display: none; }
.qimg img {
  max-height: 190px;
  width: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #faf7ee;
  padding: 10px;
}

.qopts { margin-top: 28px; display: grid; gap: 12px; }
.qopt {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  text-align: start;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.4;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.qopt:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); transform: translateX(3px); }
html[dir="rtl"] .qopt:hover { transform: translateX(-3px); }

.qopt-key {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--amber);
}

.qopt.is-right { border-color: rgba(49, 196, 141, 0.75); background: rgba(49, 196, 141, 0.13); }
.qopt.is-right .qopt-key { background: var(--ok); color: #06231a; border-color: var(--ok); }
.qopt.is-wrong { border-color: rgba(224, 82, 111, 0.75); background: rgba(224, 82, 111, 0.13); }
.qopt.is-wrong .qopt-key { background: var(--danger); color: #2b0712; border-color: var(--danger); }
.qopt.is-dim { opacity: 0.42; }

.exam-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ============ FEEDBACK / EXPLANATION ============ */
.qfb {
  margin-top: 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 183, 3, 0.06);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
}
.qfb-label {
  flex: 0 0 auto;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  padding-top: 2px;
}
html[dir="rtl"] .qfb-label { letter-spacing: 0; }
.qfb p { margin: 0; color: var(--ink-dim); font-size: 15.5px; line-height: 1.6; }
.qfb p strong { color: var(--ink); }

/* ============ GATE / RESULTS ============ */
.gate {
  max-width: 640px;
  margin: clamp(48px, 10vw, 110px) auto 0;
  text-align: center;
}
.gate-title {
  margin: 4px 0 12px;
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.gate-score { color: var(--ink-dim); font-size: 18px; margin: 0 0 26px; }
.gate-score strong { color: var(--amber); font-weight: 700; }
.gate-actions { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; }

.result-badge {
  width: 110px; height: 110px;
  margin: 0 auto 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 52px;
  font-weight: 800;
  color: #0a0d12;
  background: var(--teal);
  box-shadow: 0 0 0 10px var(--teal-soft), 0 20px 50px rgba(46, 196, 182, 0.3);
}
.result-badge.fail { background: var(--danger); box-shadow: 0 0 0 10px var(--danger-soft), 0 20px 50px rgba(224, 82, 111, 0.3); }

.res-score { font-family: var(--display); font-size: 34px; font-weight: 800; color: var(--ink); margin: 0 0 22px; }
.res-score em { color: var(--amber); font-style: normal; }

.res-bar {
  height: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 14px;
  max-width: 520px;
}
.res-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--terracotta), var(--amber)); transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); border-radius: 999px; }

.res-target { color: var(--muted); font-size: 14.5px; margin: 0 0 30px; }
.res-target strong { color: var(--amber); font-weight: 700; }

.result-actions { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; }

/* ============ SETUP (practice) ============ */
.setup {
  max-width: 620px;
  margin: clamp(44px, 8vw, 90px) auto 0;
}
.setup-title {
  margin: 0 0 28px;
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.02;
  text-transform: uppercase;
}
.setup-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
html[dir="rtl"] .field-label { letter-spacing: 0; }

.select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--amber) 50%) calc(100% - 20px) 50% / 8px 8px no-repeat,
    linear-gradient(135deg, var(--amber) 50%, transparent 50%) calc(100% - 14px) 50% / 8px 8px no-repeat,
    var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  padding: 13px 44px 13px 17px;
}
html[dir="rtl"] .select {
  background-position: calc(0% + 14px) 50%, calc(0% + 20px) 50%;
  padding: 13px 17px 13px 44px;
}
.select:focus { outline: none; border-color: var(--amber); }

/* question range — numeric From/To inputs (overrides the count when filled) */
.range-cols { display: inline-flex; gap: 10px; align-items: center; }
.range-input {
  width: 92px;
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  padding: 13px 14px;
  text-align: center;
  transition: border-color 0.12s ease;
}
.range-input:focus { outline: none; border-color: var(--amber); }
.range-input::-webkit-outer-spin-button,
.range-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.range-sep { color: var(--muted); font-weight: 700; }
.range-hint {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 240px;
}
.field.is-dim .select { opacity: 0.45; pointer-events: none; }
.field.is-dim .field-label { opacity: 0.55; }

/* segmented control */
.seg { display: inline-flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; flex-wrap: wrap; }
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 17px;
  border-radius: 8px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.12s ease, color 0.12s ease;
}
html[dir="rtl"] .seg-btn { letter-spacing: 0; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-on, .seg-btn.is-active { background: var(--amber); color: #0a0d12; }
.deck-head .deck-order { margin-top: 18px; }

/* ============ FLASHCARDS ============ */
.deck-head { padding: clamp(36px, 6vw, 70px) 0 22px; max-width: 700px; }
.deck-order { margin-top: 22px; }

.flash-board { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.fcard { perspective: 1200px; width: 100%; max-width: 620px; }
.fcard-face {
  min-height: 300px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(24px, 5vw, 44px);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.fcard.is-flipped .fcard-face { border-color: rgba(255, 183, 3, 0.5); background: linear-gradient(180deg, rgba(255, 183, 3, 0.06), var(--panel)); }
.fcat { margin: 0 0 14px; font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--terracotta); }
html[dir="rtl"] .fcat { letter-spacing: 0; }
.ftext { margin: 0; font-size: clamp(18px, 3vw, 24px); line-height: 1.5; color: var(--ink); flex: 1; }

.fcard-ans { margin-top: 20px; border-top: 1px dashed var(--line-strong); padding-top: 18px; color: var(--ink-dim); line-height: 1.6; }
.fcard-ans strong { color: var(--teal); font-family: var(--display); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
html[dir="rtl"] .fcard-ans strong { letter-spacing: 0; }

.fcard-controls { display: flex; align-items: center; gap: 18px; }
.fbtn {
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font-size: 22px;
  transition: transform 0.12s ease, border-color 0.12s ease;
  display: grid; place-items: center;
}
.fbtn:hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }
.fpos { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); min-width: 70px; text-align: center; }
.f-hint { color: var(--dim); font-size: 13.5px; }

/* ============ WEAK LIST ============ */
.weak-head, .stats-head { padding: clamp(36px, 6vw, 70px) 0 24px; max-width: 700px; }
.weak-grid { display: grid; gap: 14px; }
.weak-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: start;
  color: var(--ink);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.weak-card:hover { border-color: var(--terracotta); transform: translateX(3px); }
html[dir="rtl"] .weak-card:hover { transform: translateX(-3px); }
.weak-count {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--terracotta);
  min-width: 52px;
}
.weak-cat { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.weak-text { font-size: 15px; color: var(--ink-dim); }
.empty {
  padding: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

/* ============ STATS ============ */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
}
.stat-card h4 { margin: 0 0 6px; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
html[dir="rtl"] .stat-card h4 { letter-spacing: 0; }
.stat-card .num { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--amber); }
.bar-track { height: 9px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--terracotta), var(--amber)); transition: width 0.6s ease; }

/* ============ REVIEW LIST ============ */
.review-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: clamp(30px, 5vw, 54px) 0 22px; }
.review-list { display: grid; gap: 18px; }
.review-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.rev-foot {}
.rev-q { margin: 0 0 14px; font-size: 17.5px; line-height: 1.5; font-weight: 600; }
.rev-ans { display: grid; gap: 8px; }
.rev-opt { display: flex; gap: 10px; align-items: baseline; font-size: 15px; line-height: 1.45; }
.rev-opt .k { flex: 0 0 22px; font-family: var(--display); font-weight: 700; color: var(--muted); }
.rev-opt.is-correct { color: var(--ok); }
.rev-opt.is-picked-correct { color: var(--ink); }
.rev-opt.is-picked-wrong { color: var(--danger); text-decoration: line-through; }
.rev-mark {
  display: inline-block;
  font-size: 11.5px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 7px;
  margin-inline-start: 8px;
  vertical-align: 1px;
}
html[dir="rtl"] .rev-mark { letter-spacing: 0; }
.rev-mark.good { background: var(--teal-soft); color: var(--teal); }
.rev-mark.bad { background: var(--danger-soft); color: var(--danger); }
.rev-fb { margin-top: 14px; padding: 14px 16px; background: rgba(255, 183, 3, 0.06); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; }
.rev-fb b { color: var(--amber); }

/* ============ FOOTER ============ */
.foot { border-top: 1px solid var(--line); padding: 30px 0 40px; margin-top: 30px; }
.foot p { margin: 0; color: var(--dim); font-size: 13px; text-align: center; }
.foot-links { margin-top: 10px; }
.foot-link {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.12s ease;
}
html[dir="rtl"] .foot-link { letter-spacing: 0; }
.foot-link:hover { color: var(--amber); }

/* ---------- LOAD / ERROR ---------- */
.splash {
  max-width: 460px;
  margin: 16vh auto 0;
  text-align: center;
}
.splash .splash-mark {
  width: 72px; height: 72px;
  margin: 0 auto 22px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--amber);
  color: #0a0d12;
  font-size: 30px;
}
.spin {
  width: 34px; height: 34px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--amber);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 760px) {
  .mode-grid, .stat-strip, .stats-grid { grid-template-columns: 1fr; }
  .wrap { width: min(1080px, calc(100% - 28px)); }
  .exam-foot { justify-content: stretch; }
  .exam-foot .btn { flex: 1; }
  .highway { margin: 24px 0 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}