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

/* State restoration — banner + highlights on previously-attempted questions */
.state-banner { display:flex; align-items:center; gap:12px; padding:12px 16px; border-radius:12px; margin: 4px 0 16px; font-family:'Nunito', sans-serif; }
.state-banner.mastered { background:#dcfce7; border:2px solid #22c55e; color:#15803d; }
.state-banner.tried    { background:#fef3c7; border:2px solid #f59e0b; color:#854d0e; }
.state-banner .state-ico { font-size: 1.6rem; line-height: 1; }
.state-banner .state-body { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.state-banner .state-body strong { font-size: 0.98rem; }
.state-banner .state-body span { font-size: 0.85rem; opacity: 0.85; }
.state-banner .try-again-btn { background:#22c55e; color:white; border:none; padding:8px 14px; border-radius:8px; font-family:inherit; font-weight:700; font-size:0.85rem; cursor:pointer; white-space:nowrap; transition:transform 0.12s; }
.state-banner .try-again-btn:hover { transform: translateY(-1px); background:#16a34a; }
.choice-label.previously-correct { border-color: #22c55e !important; background: #dcfce7; position:relative; }
.choice-label.previously-correct::after { content: '✓'; position:absolute; right:12px; top:50%; transform:translateY(-50%); color:#15803d; font-weight:900; font-size:1.2rem; }
.choice-label.previously-wrong { border-color: #fca5a5 !important; background: #fef2f2; opacity:0.85; }


:root {
  --purple: #6c3fc4;
  --purple-light: #8b5cf6;
  --purple-dark: #4c1d95;
  --teal: #00b4d8;
  --yellow: #ffd166;
  --green: #06d6a0;
  --red: #ef233c;
  --bg: #f0f4ff;
  --card-bg: #ffffff;
  --text: #1e1b4b;
  --text-light: #6b7280;
  --radius: 20px;
  --shadow: 0 8px 32px rgba(108,63,196,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Navigation ── */
nav {
  background: var(--purple);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
nav a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.2s;
  white-space: nowrap;
}
nav a:hover { background: rgba(255,255,255,0.2); }
nav a.active { background: var(--yellow); color: var(--purple-dark); }
nav .nav-home { font-size: 1.05rem; margin-right: auto; }

/* ── Layout ── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 20px 70px;
}

/* ── Page header ── */
.page-header {
  text-align: center;
  margin-bottom: 36px;
  animation: bounceIn 0.6s ease;
}
.topic-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--purple-dark);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 18px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--purple);
  line-height: 1.25;
}
.page-header .emoji-row { font-size: 2.4rem; margin-top: 12px; }

/* ── Card ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  margin-bottom: 24px;
}
.card h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Question text ── */
.question-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.7;
  background: linear-gradient(135deg, #f0e7ff, #e0f0ff);
  border-radius: 14px;
  padding: 20px 24px;
  border-left: 6px solid var(--purple);
}

/* ── Visual area ── */
.visual-area {
  text-align: center;
  padding: 12px 0 4px;
}
.visual-area svg { max-width: 100%; }

/* ── Steps box ── */
.steps-box {
  background: linear-gradient(135deg, #fff9e6, #fff3cd);
  border-radius: 14px;
  padding: 20px 24px;
  border-left: 6px solid var(--yellow);
}
.steps-box h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #92610a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.steps-box ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps-box li { font-weight: 600; line-height: 1.5; color: #5c3d00; }

/* ── Hint section ── */
.hint-btn {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 26px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hint-btn:hover { background: #0096c7; transform: scale(1.04); }
.hint-btn:disabled { background: #b0bec5; cursor: not-allowed; transform: none; }

.hints-container { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.hint-item {
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  color: #006064;
  border-left: 4px solid var(--teal);
  animation: slideDown 0.35s ease;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.hint-num {
  background: var(--teal);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  min-width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

/* ── Answer section ── */
.answer-section label {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--purple);
}
.answer-input {
  font-family: 'Nunito', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 10px 18px;
  border: 3px solid #d1c4e9;
  border-radius: 12px;
  width: 100%;
  max-width: 280px;
  outline: none;
  transition: border-color 0.2s;
}
.answer-input:focus { border-color: var(--purple); }

/* Fraction entry (two-box numerator / denominator input) */
.frac-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 18px;
}
.frac-inputs {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.frac-box {
  font-family: 'Nunito', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  width: 80px;
  padding: 8px 6px;
  text-align: center;
  border: 2.5px solid var(--purple);
  border-radius: 10px;
  outline: none;
  color: var(--dark);
  background: #fff;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.frac-box::-webkit-outer-spin-button,
.frac-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.frac-box:focus { border-color: var(--teal); }
.frac-entry-line {
  width: 80px;
  height: 3px;
  background: var(--purple);
  border-radius: 2px;
  margin: 5px 0;
}
.frac-of-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray);
}

.submit-btn {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 34px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.submit-btn:hover { background: var(--purple-light); transform: scale(1.04); }

/* ── Multiple choice ── */
.choices { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.choice-label {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f5f0ff;
  border: 3px solid #d1c4e9;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  user-select: none;
  touch-action: manipulation;   /* prevent double-tap zoom, ensure tap fires */
  -webkit-tap-highlight-color: rgba(108,63,196,0.15);
}
.choice-label:hover { border-color: var(--purple); background: #ede8ff; transform: translateX(5px); }
.choice-label input[type="radio"] {
  accent-color: var(--purple);
  width: 20px; height: 20px;
  flex-shrink: 0;
  pointer-events: auto;   /* explicit — never inherited none from a parent */
  cursor: pointer;
}

/* ── Answer-letter references in question text (A: B: C: etc.) ── */
/* learning.js adds .q-option-ref to make them tappable shortcuts   */
strong.q-option-ref {
  display: inline-block;
  background: var(--purple);
  color: white;
  border-radius: 999px;
  padding: 1px 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
  touch-action: manipulation;
}
strong.q-option-ref:hover,
strong.q-option-ref:active {
  background: var(--purple-light);
  transform: scale(1.08);
}

/* ── Feedback ── */
.feedback {
  border-radius: 14px;
  padding: 16px 22px;
  font-size: 1.1rem;
  font-weight: 800;
  display: none;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.feedback.correct {
  display: flex;
  background: linear-gradient(135deg, #d4fce8, #a7f3d0);
  color: #065f46;
  border-left: 6px solid var(--green);
  animation: bounceIn 0.4s ease;
}
.feedback.incorrect {
  display: flex;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #7f1d1d;
  border-left: 6px solid var(--red);
  animation: shake 0.4s ease;
}
.feedback .feedback-icon { font-size: 2rem; }

/* ── Solution panel ── */
.solution-btn {
  background: linear-gradient(135deg, var(--yellow), #f59e0b);
  color: var(--purple-dark);
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.solution-btn:hover { transform: scale(1.04); }

.solution-panel {
  display: none;
  background: linear-gradient(135deg, #f9f5ff, #ede9fe);
  border-radius: 14px;
  padding: 24px 26px;
  border-left: 6px solid var(--purple);
  margin-top: 18px;
}
.solution-panel.visible { display: block; animation: slideDown 0.4s ease; }
.solution-panel h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--purple-dark);
  margin-bottom: 16px;
}
.solution-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.step-num {
  background: var(--purple);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.step-content { font-weight: 600; line-height: 1.6; color: var(--purple-dark); }
.step-content strong { color: var(--purple); }
.solution-answer {
  background: var(--purple);
  color: white;
  border-radius: 12px;
  padding: 16px 22px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  margin-top: 18px;
}

/* ── Index page card grid ── */
.hero {
  text-align: center;
  padding: 48px 20px 24px;
  animation: bounceIn 0.6s ease;
}
.hero h1 { font-size: 2.4rem; font-weight: 900; color: var(--purple); line-height: 1.2; }
.hero p { font-size: 1.1rem; color: var(--text-light); font-weight: 600; margin-top: 12px; }
.hero .stars { font-size: 2rem; margin-top: 10px; }

.q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
  padding: 0 20px 60px;
}
.q-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 6px solid var(--purple);
}
.q-card:nth-child(1) { border-top-color: var(--purple); animation: bounceIn 0.5s 0.1s ease both; }
.q-card:nth-child(2) { border-top-color: var(--teal); animation: bounceIn 0.5s 0.2s ease both; }
.q-card:nth-child(3) { border-top-color: #f59e0b; animation: bounceIn 0.5s 0.3s ease both; }
.q-card:nth-child(4) { border-top-color: var(--green); animation: bounceIn 0.5s 0.4s ease both; }
.q-card:hover { transform: translateY(-6px); box-shadow: 0 18px 50px rgba(108,63,196,0.2); }
.q-num-label { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.q-card:nth-child(1) .q-num-label { color: var(--purple); }
.q-card:nth-child(2) .q-num-label { color: var(--teal); }
.q-card:nth-child(3) .q-num-label { color: #d97706; }
.q-card:nth-child(4) .q-num-label { color: #059669; }
.q-icon { font-size: 2.6rem; margin: 4px 0; }
.q-card h2 { font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.q-card p { font-size: 0.92rem; color: var(--text-light); font-weight: 600; line-height: 1.5; }
.q-go { margin-top: 10px; font-size: 0.95rem; font-weight: 800; color: var(--purple-light); }

/* ── Confetti ── */
.confetti-wrap {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.cf {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: cffall linear forwards;
}

/* ── Animations ── */
@keyframes bounceIn {
  0%   { opacity: 0; transform: translateY(22px) scale(0.95); }
  60%  { opacity: 1; transform: translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
  0%   { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}
@keyframes cffall {
  0%   { top: -5%; opacity: 1; }
  100% { top: 105%; opacity: 0; transform: rotate(720deg) translateX(60px); }
}

/* ── Fractions (stacked, traditional style) ── */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 3px;
  font-size: 0.88em;
  line-height: 1.25;
}
.frac .num {
  border-bottom: 1.5px solid currentColor;
  padding: 0 3px 1px;
  text-align: center;
  min-width: 1em;
}
.frac .den {
  padding: 1px 3px 0;
  text-align: center;
  min-width: 1em;
}

/* ── Vocabulary tooltips ── */
/* learning.js wraps known terms in .vocab-tip; tooltip shown on hover/focus */
.vocab-tip {
  border-bottom: 2px dotted var(--purple);
  color: var(--purple);
  cursor: help;
  position: relative;
  display: inline;
  font-weight: inherit;
}
/* Tooltip bubble */
.vocab-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1b4b;
  color: #f0e7ff;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  text-align: left;
}
/* Tooltip arrow */
.vocab-tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e1b4b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 500;
}
.vocab-tip:hover::after,
.vocab-tip:hover::before,
.vocab-tip:focus::after,
.vocab-tip:focus::before { opacity: 1; }
/* Focus ring for keyboard users */
.vocab-tip:focus { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 3px; }

/* ── Disabled button state ── */
button:disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Gated "Picture It" card (hidden until first attempt) ── */
.gated-card {
  display: none;
}
.revealed-card {
  display: block;
  animation: revealSlide 0.5s ease both;
}
@keyframes revealSlide {
  0%   { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Solution lock message ── */
.solution-lock-msg {
  margin-top: 10px;
  font-size: 0.84rem;
  color: #9ca3af;
  font-style: italic;
  font-weight: 600;
}

/* ── "I'm Stuck" escape hatch button ── */
.stuck-btn {
  display: block;
  margin: 12px auto 0;
  padding: 9px 22px;
  background: none;
  border: 2.5px dashed #d1d5db;
  border-radius: 999px;
  color: #9ca3af;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.stuck-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* ── Problem Classifier ── */
.classifier-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.classifier-btn {
  background: #f5f0ff;
  border: 2.5px solid #d1c4e9;
  border-radius: 14px;
  padding: 13px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--purple-dark);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.classifier-btn:hover { border-color: var(--purple); background: #ede8ff; transform: translateX(5px); }
.classifier-btn.correct-type { background: #d4fce8; border-color: var(--green); color: #065f46; }
.classifier-btn.wrong-type   { background: #fee2e2; border-color: var(--red);   color: #7f1d1d; }
.classifier-feedback {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  display: none;
}
.classifier-feedback.show { display: block; }
.classifier-feedback.correct { background: #d4fce8; color: #065f46; }
.classifier-feedback.incorrect { background: #fef3c7; color: #92400e; }

/* ── Word Definitions card ── */
.word-defs-card { animation: revealSlide 0.5s ease both; }
.word-defs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.word-def-item {
  background: #f5f0ff;
  border-radius: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--purple);
}
.word-def-term {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--purple-dark);
  margin-bottom: 8px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.word-def-meaning {
  margin-bottom: 6px;
}
.word-def-pos {
  display: inline-block;
  background: var(--purple);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.word-def-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.45;
}
.word-def-example {
  font-size: 0.83rem;
  color: #9ca3af;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
}
.word-defs-loading {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 0;
}

/* ── "Now You Try" practice section ── */
.practice-question {
  background: #f3f0ff;
  border-left: 5px solid var(--purple);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--purple-dark);
  margin: 14px 0 18px;
  line-height: 1.6;
}
.practice-reveal {
  margin-top: 14px;
}
.reveal-answer-btn {
  background: none;
  border: 2px solid var(--teal);
  border-radius: 999px;
  color: var(--teal);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 7px 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.reveal-answer-btn:hover { background: var(--teal); color: white; }
.practice-answer-reveal {
  margin-top: 12px;
  background: var(--purple);
  color: white;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  display: none;
}
.practice-answer-reveal.show { display: block; animation: bounceIn 0.4s ease; }

/* ── Subject hub grid ── */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  padding: 0 24px 70px;
  max-width: 1080px;
  margin: 0 auto;
}
.subject-card {
  border-radius: 24px;
  padding: 44px 34px 36px;
  text-decoration: none;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.22s, box-shadow 0.22s;
  box-shadow: 0 14px 44px rgba(0,0,0,0.16);
}
.subject-card:hover { transform: translateY(-10px); box-shadow: 0 28px 64px rgba(0,0,0,0.22); }
.subject-icon { font-size: 3.8rem; }
.subject-card h2 { font-size: 1.9rem; font-weight: 900; line-height: 1.2; }
.subject-card .subject-desc { font-size: 0.97rem; font-weight: 600; opacity: 0.92; line-height: 1.55; }
.subject-card .subject-count { font-size: 0.88rem; font-weight: 800; opacity: 0.78; margin-top: 6px; }
.subject-card .subject-go { margin-top: 16px; font-size: 1.05rem; font-weight: 900; opacity: 0.95; }
.subject-card.maths   { background: linear-gradient(135deg, #6c3fc4 0%, #4c1d95 100%); animation: bounceIn 0.5s 0.10s ease both; }
.subject-card.vr      { background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%); animation: bounceIn 0.5s 0.20s ease both; }
.subject-card.nvr     { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); animation: bounceIn 0.5s 0.30s ease both; }
.subject-card.english { background: linear-gradient(135deg, #059669 0%, #06d6a0 100%); animation: bounceIn 0.5s 0.40s ease both; }

/* ── Nav: subject-tab active colour overrides ── */
nav a.nav-vr.active     { background: #00b4d8; color: white; }
nav a.nav-nvr.active    { background: #f59e0b; color: #1e1b4b; }
nav a.nav-eng.active    { background: #06d6a0; color: #1e1b4b; }

/* ── Next / Previous question navigation bar ── */
.next-q-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 840px;
  margin: 36px auto 64px;
  padding: 0 20px;
  gap: 12px;
}
.next-q-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple);
  color: white;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 6px 20px rgba(108,63,196,0.28);
}
.next-q-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(108,63,196,0.38);
  color: white;
}
.next-q-btn.prev-btn {
  background: #e9d5ff;
  color: var(--purple);
  box-shadow: none;
}
.next-q-btn.prev-btn:hover {
  background: #d8b4fe;
  box-shadow: none;
  color: var(--purple);
}
.next-q-pos {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: #9ca3af;
  white-space: nowrap;
}

/* ── Difficulty badges ─────────────────────────────────────── */
.diff-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.diff-1 { background: #dcfce7; color: #166534; }
.diff-2 { background: #fef9c3; color: #854d0e; }
.diff-3 { background: #fee2e2; color: #991b1b; }

/* ── Exam board filter bar ─────────────────────────────────── */
.board-filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 24px;
}
.board-btn {
  padding: 7px 18px;
  border: 2px solid #d8b4fe;
  border-radius: 999px;
  background: white;
  color: #6c3fc4;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.board-btn:hover { background: #ede8ff; }
.board-btn.active { background: #6c3fc4; color: white; border-color: #6c3fc4; }

@media (max-width: 600px) {
  .page-header h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .card { padding: 20px 18px; }
  .q-grid { grid-template-columns: 1fr; }
  nav a { font-size: 0.82rem; padding: 5px 10px; }
  .classifier-options { gap: 8px; }
  .subject-grid { grid-template-columns: 1fr; padding: 0 16px 50px; gap: 18px; }
  .subject-card { padding: 32px 24px 28px; }
  .subject-card h2 { font-size: 1.5rem; }
  .next-q-bar { margin: 24px auto 48px; padding: 0 14px; gap: 8px; }
  .next-q-btn { font-size: 0.88rem; padding: 11px 18px; }
  .next-q-pos { font-size: 0.8rem; }

  /* Hub footer: wrap links into a neat pill grid */
  .hub-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 16px 40px;
  }
  .hub-footer a {
    margin-left: 0 !important;
    background: var(--bg, #f0f4ff);
    border: 2px solid rgba(108,63,196,0.15);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}
