/* ==========================================
   SAT PREP — GAMIFIED DARK THEME
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;0,900;1,700&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0C0F1A;
  --surface:     #141828;
  --surface2:    #1C2235;
  --border:      rgba(255,255,255,0.07);
  --border-gold: rgba(201,148,58,0.22);
  --rw-blue:     #4A7FD4;
  --rw-blue-dim: rgba(74,127,212,0.12);
  --math-purple: #7C5CBF;
  --math-dim:    rgba(124,92,191,0.12);
  --green:       #22A878;
  --green-dim:   rgba(34,168,120,0.12);
  --red:         #C4273E;
  --red-dim:     rgba(196,39,62,0.12);
  --gold:        #C9943A;
  --gold-bright: #D4AF5A;
  --gold-dim:    rgba(201,148,58,0.12);
  --orange:      #C2570B;
  --text:        #F2EDD7;
  --text-muted:  #8A9BB8;
  --text-dim:    #4E5D7A;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.35);
  --transition:  200ms ease;
  --card:        #141828;
  --accent:      #C9943A;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- UTILITY --- */
.hidden { display: none !important; }
.view { display: flex; flex-direction: column; min-height: 100vh; }

/* ==========================================
   HOME VIEW
   ========================================== */

#view-home {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
  width: 100%;
}

/* Top nav bar */
.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  gap: 16px;
}

.home-nav .logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.xp-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.xp-pill .xp-icon { font-size: 1rem; }
.xp-pill .xp-amount { font-weight: 700; color: var(--gold); }
.xp-pill .xp-level { color: var(--text-muted); font-size: 0.78rem; }

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 48px;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero h1 span {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Stats strip */
.stats-strip {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 18px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-chip strong { color: var(--gold); font-weight: 700; }

/* Section labels */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-label h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.topic-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--card-color, var(--rw-blue));
  opacity: 0.8;
}
.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border-color: var(--card-color, var(--rw-blue));
}
.topic-card.rw { --card-color: var(--rw-blue); }
.topic-card.math { --card-color: var(--math-purple); }

.topic-card .card-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  display: block;
}
.topic-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.topic-card .card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.topic-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.best-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-dim);
  border-radius: 99px;
  padding: 2px 8px;
}
.play-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--card-color, var(--rw-blue));
  display: flex;
  align-items: center;
  gap: 4px;
}
.play-btn::after { content: '→'; transition: transform var(--transition); }
.topic-card:hover .play-btn::after { transform: translateX(3px); }

/* Full test button */
.full-test-wrap {
  text-align: center;
  margin-top: 20px;
}
.btn-full-test {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  border: none;
  border-radius: 99px;
  padding: 16px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.btn-full-test:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201,148,58,0.40);
}

.home-footer {
  text-align: right;
  padding: 24px 0 32px;
  font-size: 0.78rem;
  color: var(--text-dim, #4a5568);
  opacity: 0.6;
}
.home-footer strong { font-weight: 600; }


/* ==========================================
   INTENSITY MODAL
   ========================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 150ms ease;
}
.modal-overlay.hidden { display: none !important; }

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

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 520px;
  width: 100%;
  animation: slideUp 200ms ease;
  position: relative;
}
.modal-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-box .modal-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-header { position: relative; }

.intensity-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intensity-card {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  font-family: inherit;
  text-align: left;
  color: var(--text);
  width: 100%;
}
.intensity-card:hover {
  transform: translateY(-2px);
  border-color: var(--ic-color, var(--rw-blue));
  background: var(--ic-bg, var(--rw-blue-dim));
}
.intensity-card .ic-emoji { font-size: 1.8rem; flex-shrink: 0; }
.intensity-card .ic-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.intensity-card .ic-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.intensity-card .ic-badge {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 4px 10px;
  background: var(--ic-bg, var(--rw-blue-dim));
  color: var(--ic-color, var(--rw-blue));
}

.intensity-card.warm  { --ic-color: #06d6a0; --ic-bg: rgba(6,214,160,0.12); }
.intensity-card.real  { --ic-color: #f77f00; --ic-bg: rgba(247,127,0,0.12); }
.intensity-card.beast { --ic-color: #ef233c; --ic-bg: rgba(239,35,60,0.12); }

/* Full SAT Modal */
.full-sat-modal-box { max-width: 480px; }

.sat-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.sat-section-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.sat-section-card.sat-rw  { border-color: rgba(74,127,212,0.4); background: rgba(74,127,212,0.08); }
.sat-section-card.sat-math { border-color: rgba(124,92,191,0.4); background: rgba(124,92,191,0.08); }

.sat-section-icon { font-size: 1.8rem; flex-shrink: 0; }

.sat-section-info { flex: 1; }
.sat-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.sat-section-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.sat-section-badge {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 5px 12px;
}
.sat-rw-badge   { background: rgba(74,127,212,0.18);  color: #7AABFF; }
.sat-math-badge { background: rgba(124,92,191,0.18); color: #B08AFF; }

.sat-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.sat-total-row strong { color: var(--text); }

.btn-start-sat {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-start-sat:hover { opacity: 0.9; transform: translateY(-1px); }


/* ==========================================
   EXAM VIEW
   ========================================== */

#view-exam {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Exam header */
.exam-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color var(--transition), color var(--transition);
}
.btn-back:hover { border-color: var(--text-muted); color: var(--text); }

.exam-topic-name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}
.mode-badge {
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.q-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  transition: color var(--transition), border-color var(--transition);
}
.timer-display.warn { color: var(--red); border-color: var(--red); animation: pulse-subtle 2s ease-in-out infinite; }
.timer-display.danger { color: var(--red); border-color: var(--red); animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse-subtle { 0%,100%{opacity:1;} 50%{opacity:0.65;} }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.45;} }

/* Progress bar */
.exam-progress-wrap {
  height: 4px;
  background: var(--surface2);
  margin: 0;
  overflow: hidden;
}
.exam-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 300ms ease;
  border-radius: 0 99px 99px 0;
}

/* Main exam content */
.exam-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  gap: 24px;
}

/* Passage box */
.passage-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  max-height: 220px;
  overflow-y: auto;
}
.passage-box::-webkit-scrollbar { width: 4px; }
.passage-box::-webkit-scrollbar-track { background: transparent; }
.passage-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.passage-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Question text */
.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--text);
}
.question-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Answer choices */
.choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.97rem;
  color: var(--text);
  text-align: left;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  line-height: 1.5;
  width: 100%;
}
.choice-btn:hover:not(.selected):not(:disabled) {
  transform: scale(1.005);
  border-color: rgba(255,255,255,0.2);
  background: var(--surface2);
}
.choice-btn .choice-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  color: var(--text-muted);
  margin-top: 1px;
}
.choice-btn.selected {
  border-color: var(--active-color, var(--gold));
  background: var(--active-bg, var(--gold-dim));
}
.choice-btn.selected .choice-letter {
  background: var(--active-color, var(--gold));
  border-color: var(--active-color, var(--gold));
  color: var(--bg);
}
.rw-active { --active-color: var(--rw-blue); --active-bg: var(--rw-blue-dim); }
.math-active { --active-color: var(--math-purple); --active-bg: var(--math-dim); }

/* Nav footer */
.exam-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 28px;
  gap: 16px;
  border-top: 1px solid var(--border);
}
.btn-nav {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-nav:hover:not(:disabled) { background: var(--surface); border-color: rgba(255,255,255,0.2); }
.btn-nav:disabled { opacity: 0.35; cursor: not-allowed; }

/* Question dots */
.q-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  flex: 1;
}
.q-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.q-dot.answered { background: var(--gold); border-color: var(--gold); }
.q-dot.answered.math-dot { background: var(--math-purple); border-color: var(--math-purple); }
.q-dot.current { transform: scale(1.4); }

/* Submit button */
.btn-submit {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  border: none;
  border-radius: 99px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: glow 2s ease-in-out infinite;
}
.btn-submit:hover { transform: scale(1.04); box-shadow: 0 0 28px rgba(201,148,58,0.5); }
@keyframes glow {
  0%,100% { box-shadow: 0 0 8px rgba(201,148,58,0.25); }
  50% { box-shadow: 0 0 22px rgba(201,148,58,0.45); }
}

/* Confirm modal */
.confirm-modal .modal-box {
  max-width: 400px;
  text-align: center;
}
.confirm-modal h2 { font-size: 1.3rem; margin-bottom: 12px; }
.confirm-modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; line-height: 1.7; }
.unanswered-warning { color: #f77f00; font-size: 0.88rem; font-weight: 700; }
.unanswered-note { color: var(--text-dim); font-size: 0.8rem; }
.confirm-buttons { display: flex; gap: 12px; justify-content: center; }
.btn-confirm-yes {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  border: none;
  border-radius: 99px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-confirm-no {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}


/* ==========================================
   RESULTS VIEW
   ========================================== */

#view-results {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 60px;
  width: 100%;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 28px;
}
.results-header h1 { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; }

/* Score ring */
.score-ring-wrap {
  text-align: center;
  margin-bottom: 32px;
}
.score-ring-wrap .ring-container {
  display: inline-block;
  position: relative;
  margin-bottom: 16px;
}
.score-ring {
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--surface2);
  stroke-width: 12;
}
.ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502.65; /* 2π × 80 */
  stroke-dashoffset: 502.65;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.25,0.46,0.45,0.94);
}
.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-score {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}
.ring-total {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stars-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.star { opacity: 0.2; transition: opacity 300ms, transform 300ms; }
.star.earned { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(212,175,90,0.65)); }

.perf-message {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Score stats row */
.score-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.score-stat {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  min-width: 120px;
}
.score-stat .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}
.score-stat .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* XP earned banner */
.xp-earned-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 28px;
  font-weight: 700;
  font-size: 1.05rem;
}
.xp-earned-banner .xp-count { color: var(--gold-bright); font-size: 1.3rem; }

/* Review list */
.review-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.review-item.correct { border-left: 3px solid var(--green); }
.review-item.wrong   { border-left: 3px solid var(--red); }

.review-item-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
}
.review-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.9rem;
  flex-shrink: 0;
  font-weight: 700;
  margin-top: 2px;
}
.review-badge.correct { background: var(--green-dim); color: var(--green); }
.review-badge.wrong   { background: var(--red-dim); color: var(--red); }

.review-q-text {
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
  color: var(--text);
}
.review-toggle {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform var(--transition);
}
.review-item.open .review-toggle { transform: rotate(180deg); }

.review-body {
  display: none;
  padding: 0 18px 18px;
}
.review-item.open .review-body { display: block; }

/* Passage in review */
.review-passage {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
  border-left: 2px solid var(--border);
}

/* Answer choices in review */
.review-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.review-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  border: 1px solid transparent;
}
.review-choice.correct-choice {
  background: var(--green-dim);
  border-color: rgba(6,214,160,0.3);
  color: var(--green);
}
.review-choice.wrong-choice {
  background: var(--red-dim);
  border-color: rgba(239,35,60,0.25);
  color: var(--red);
  opacity: 0.85;
}
.review-choice .rc-letter {
  font-weight: 800;
  font-size: 0.8rem;
  min-width: 18px;
  margin-top: 1px;
}
.review-choice .rc-text { color: inherit; }

/* Explanation */
.explanation-block {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text-muted);
  border-left: 3px solid var(--gold);
}
.explanation-block strong {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 6px;
}

/* Result action buttons */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-try-again {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 99px;
  padding: 14px 30px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-try-again:hover { background: var(--surface); }
.btn-home {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  border: none;
  border-radius: 99px;
  padding: 14px 30px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-home:hover { transform: scale(1.03); box-shadow: 0 6px 24px rgba(201,148,58,0.40); }


/* ==========================================
   SAT SCORE BANNER (full test only)
   ========================================== */
.sat-score-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}
.sat-score-composite {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.sat-score-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sat-score-band {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.sat-score-sections {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sat-section-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.sat-section-score strong { font-size: 0.95rem; }

/* ==========================================
   FOCUS AREAS (full test only)
   ========================================== */
.sat-focus-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
}
.sat-focus-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.sat-focus-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.sat-focus-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sat-focus-emoji { font-size: 1.3rem; flex-shrink: 0; }
.sat-focus-info { flex: 1; }
.sat-focus-name { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.sat-focus-bar-bg { height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.sat-focus-bar-fill { height: 5px; border-radius: 3px; transition: width 0.6s ease; }
.sat-focus-pct { font-size: 1rem; font-weight: 800; min-width: 40px; text-align: right; flex-shrink: 0; }

/* ==========================================
   CONFETTI
   ========================================== */
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}


/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .exam-header { flex-wrap: wrap; gap: 8px; }
  .q-dots { display: none; }
  .modal-box { padding: 24px 20px; }
  .score-stats { gap: 12px; }
  .score-stat { padding: 12px 16px; min-width: 90px; }
}
@media (max-width: 380px) {
  .topic-grid { grid-template-columns: 1fr; }
}


/* ==========================================
   AUTH OVERLAY
   ========================================== */
#auth-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
#auth-overlay.hidden { display: none; }

.auth-box {
  max-width: 420px; width: 100%;
  background: var(--card); border-radius: 20px;
  padding: 28px 24px; border: 1px solid var(--border);
}

.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo span { font-size: 3rem; display: block; margin-bottom: 8px; }
.auth-logo h1 { font-family: 'Playfair Display', serif; color: var(--text); font-size: 1.8rem; font-weight: 700; margin: 0 0 4px; }
.auth-logo p  { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.auth-tabs { display: flex; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 10px; color: var(--text-dim); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: var(--gold); color: var(--bg); }

.auth-banner { border-radius: 10px; padding: 12px; margin-bottom: 14px; font-size: 0.82rem; line-height: 1.4; }
.auth-error   { background: var(--red-dim); border: 1px solid rgba(196,39,62,0.4); color: var(--red); }
.auth-success { background: var(--green-dim); border: 1px solid rgba(34,168,120,0.4); color: var(--green); }

.auth-label { display: block; color: var(--text-dim); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin: 12px 0 6px; }
.auth-input { width: 100%; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; color: var(--text); font-size: 0.95rem; font-family: inherit; }
.auth-input:focus { outline: none; border-color: var(--gold); }

.auth-submit { width: 100%; margin-top: 22px; background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: var(--bg); border: none; border-radius: 14px; padding: 16px; font-size: 1rem; font-weight: 800; cursor: pointer; font-family: inherit; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-legal { color: var(--text-dim); font-size: 0.72rem; text-align: center; margin-top: 14px; line-height: 1.5; }

/* ==========================================
   HOME NAV UPDATES
   ========================================== */
.home-nav { display: flex; align-items: center; justify-content: space-between; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.nav-icon-btn:hover { background: var(--surface); }
.signout-btn { color: var(--red); background: rgba(196,39,62,0.08); border-color: rgba(196,39,62,0.4); }
.signout-btn:hover { background: rgba(196,39,62,0.16); }

.web-greeting { color: var(--text-dim); font-size: 0.82rem; margin: 0 24px 4px; }
.trial-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border-gold);
  background: var(--gold-dim);
  color: var(--gold-bright);
  white-space: nowrap;
  cursor: default;
}

.btn-reports {
  display: block; width: 100%; margin-top: 10px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 16px;
  padding: 14px; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.btn-reports:hover { background: var(--surface); }

.btn-reports-result {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 12px; padding: 12px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-reports-result:hover { background: var(--surface); }

/* ==========================================
   PAYWALL MODAL
   ========================================== */
.paywall-box { max-width: 460px; text-align: center; }
.paywall-header h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }

.paywall-plans {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}
.paywall-plan {
  flex: 1;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  position: relative;
}
.paywall-plan.featured {
  border-color: var(--border-gold);
  background: var(--gold-dim);
}
.paywall-plan-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.paywall-plan-name { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.paywall-plan-price { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.paywall-plan-price span { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.paywall-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition);
}
.paywall-btn:hover { opacity: 0.85; }

.paywall-promo {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.paywall-promo-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.paywall-promo-btn:hover { border-color: var(--border-gold); color: var(--gold-bright); }

/* ==========================================
   REPORTS VIEW
   ========================================== */
.report-card {
  background: var(--card); border-radius: 16px; padding: 16px;
  border: 1px solid var(--border); margin-bottom: 20px;
}
.report-overview-row { display: flex; justify-content: space-between; align-items: center; }
.report-stat { flex: 1; text-align: center; }
.report-stat-val { display: block; color: var(--text); font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.report-stat-lbl { display: block; color: var(--text-dim); font-size: 0.7rem; }
.report-divider { width: 1px; height: 40px; background: var(--border); }
.report-full-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); text-align: center; color: var(--text-dim); font-size: 0.82rem; }

.report-section-header { margin-bottom: 10px; margin-top: 8px; }
.report-section-header h3 { color: var(--text); font-size: 1rem; font-weight: 800; margin: 0 0 2px; }
.report-section-header p  { color: var(--text-dim); font-size: 0.78rem; margin: 0; }

.report-focus-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--red-dim); border: 1px solid rgba(196,39,62,0.3);
  border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
.report-focus-emoji { font-size: 1.4rem; }
.report-focus-info { flex: 1; font-size: 0.82rem; color: var(--text-dim); }
.report-focus-info strong { color: var(--text); font-size: 0.9rem; display: block; margin-bottom: 2px; }
.report-focus-acc { font-size: 1.3rem; font-weight: 800; }

.report-topic-row { display: flex; gap: 10px; margin-bottom: 14px; }
.report-topic-info { flex: 1; }
.report-topic-top { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text); font-size: 0.85rem; font-weight: 600; }
.report-bar-bg { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.report-bar-fill { height: 6px; border-radius: 3px; transition: width 0.6s ease; }
.report-topic-sub { color: var(--text-dim); font-size: 0.72rem; }

.report-history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.report-history-topic { color: var(--text); font-weight: 600; font-size: 0.88rem; margin-bottom: 3px; }
.report-history-meta  { color: var(--text-dim); font-size: 0.75rem; }

/* ==========================================
   SIGN OUT CONFIRM MODAL
   ========================================== */
.signout-box {
  max-width: 360px;
  text-align: center;
  padding: 40px 36px;
}

.signout-icon-wrap {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(196,39,62,0.10);
  border: 1px solid rgba(196,39,62,0.25);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.signout-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.signout-box .modal-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

.signout-buttons {
  display: flex;
  gap: 10px;
}

.btn-signout-cancel {
  flex: 1;
  padding: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-signout-cancel:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-signout-confirm {
  flex: 1;
  padding: 13px;
  background: rgba(196,39,62,0.12);
  border: 1px solid rgba(196,39,62,0.35);
  border-radius: var(--radius-md);
  color: var(--red);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-signout-confirm:hover {
  background: rgba(196,39,62,0.20);
  border-color: rgba(196,39,62,0.55);
}
