/* =============================================================================
   MindMATHS Consolidated CSS
   Extracted from MindMATHS education platform - all grade/subject pages
   Consolidates 18 style blocks: base CSS + version patches v100 through v150
   ============================================================================= */

:root{--panel:#ffffff;--text:#0f172a;--muted:#475569;--line:#dbeafe;--shadow:0 16px 36px rgba(15,23,42,.10)}
*{box-sizing:border-box} html,body{margin:0;padding:0}
body.theme-early{
  font-family:Inter,Arial,Helvetica,sans-serif;
  color:#e5eefb;
  background:
    radial-gradient(circle at 10% 10%, rgba(59,130,246,.22), transparent 24%),
    radial-gradient(circle at 90% 12%, rgba(139,92,246,.18), transparent 22%),
    linear-gradient(180deg,#07111f 0%,#0b1220 100%);
}
body.theme-foundation{background:
 radial-gradient(circle at 10% 10%, rgba(249,115,22,.26), transparent 24%),
 radial-gradient(circle at 90% 12%, rgba(236,72,153,.18), transparent 22%),
 linear-gradient(180deg,#2a0f0a 0%,#3a1320 100%)}
body.theme-early{background:
 radial-gradient(circle at 10% 10%, rgba(34,197,94,.24), transparent 24%),
 radial-gradient(circle at 90% 12%, rgba(20,184,166,.18), transparent 22%),
 linear-gradient(180deg,#071a16 0%,#0a2320 100%)}
body.theme-senior{background:
 radial-gradient(circle at 10% 10%, rgba(14,165,233,.24), transparent 24%),
 radial-gradient(circle at 90% 12%, rgba(6,182,212,.18), transparent 22%),
 linear-gradient(180deg,#061520 0%,#08202b 100%)}
body.theme-fet{background:
 radial-gradient(circle at 10% 10%, rgba(124,58,237,.24), transparent 24%),
 radial-gradient(circle at 90% 12%, rgba(37,99,235,.18), transparent 22%),
 linear-gradient(180deg,#0d1124 0%,#121733 100%)}
#appShell{max-width:1180px;margin:0 auto;padding:6px 12px 18px}
.header{
  margin-top:0;border:1px solid rgba(255,255,255,.12);border-radius:22px;
  background:rgba(255,255,255,.08);backdrop-filter:blur(10px);box-shadow:0 18px 44px rgba(0,0,0,.14)
}
.header-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px 4px}
.brand{display:flex;align-items:center;gap:14px}
.mark{width:54px;height:42px;border-radius:14px;display:grid;place-items:center;color:#fff;font-size:19px;font-weight:800;overflow:hidden;padding:4px;align-items:center;justify-content:center}.mark-logo{width:100%;height:100%;display:block;object-fit:contain;object-position:center;max-width:100%;max-height:100%;image-rendering:auto;filter:drop-shadow(0 8px 12px rgba(0,0,0,.16))}

/* ── Theme-independent primary button colours (applied when no body.theme-* class) ── */
.btn.primary,button.btn.primary,a.btn.primary {
  background: linear-gradient(135deg,#2563eb,#7c3aed) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

body.theme-foundation .mark,body.theme-foundation .tab.active,body.theme-foundation .btn.primary{background:linear-gradient(135deg,#fb923c,#ec4899)}
body.theme-early .mark,body.theme-early .tab.active,body.theme-early .btn.primary{background:linear-gradient(135deg,#22c55e,#14b8a6)}
body.theme-intermediate .mark,body.theme-intermediate .tab.active,body.theme-intermediate .btn.primary{background:linear-gradient(135deg,#2563eb,#8b5cf6)}
body.theme-senior .mark,body.theme-senior .tab.active,body.theme-senior .btn.primary{background:linear-gradient(135deg,#0ea5e9,#06b6d4)}
body.theme-fet .mark,body.theme-fet .tab.active,body.theme-fet .btn.primary{background:linear-gradient(135deg,#7c3aed,#2563eb)}
.copy h1{margin:0 0 4px;font-size:28px;line-height:1.05;color:#fff;letter-spacing:-.02em}
.copy p{margin:0;color:#d9e5f5;font-size:14px;line-height:1.5;max-width:640px}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:38px;border-radius:12px;padding:0 12px;font-size:13px;font-weight:800;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#fff;text-decoration:none;cursor:pointer}
.tabs{display:flex;flex-wrap:nowrap;gap:8px;padding:0 14px 4px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;}.tabs::-webkit-scrollbar{display:none;}
.tab{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 14px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#eef4ff;font-size:13px;font-weight:800;cursor:pointer}
.tab.active{color:#fff;border-color:transparent}
.page{display:none;margin-top:4px;padding-top:0}
.page.active{display:block}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.card{background:linear-gradient(180deg,#fff,#f8fafc);border:1px solid #dbeafe;border-radius:18px;box-shadow:var(--shadow)}
.banner,.panel,.tile{padding:12px 14px}
.banner h3,.panel h4{margin:0 0 8px;color:var(--text)}
.banner p,.panel p,.muted{color:var(--muted);font-size:14px;line-height:1.6}
.tile strong{display:block;font-size:22px;color:var(--text);margin-bottom:6px}
.tile span{color:var(--muted);font-size:13px;line-height:1.5}
label{display:block;font-weight:800;color:var(--text);font-size:14px;margin:12px 0 6px}
input,select,textarea{width:100%;min-height:44px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;color:var(--text);padding:0 12px;font:inherit}
input[type=number]{padding-right:8px}
.action-strip{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.question-card{padding:16px 18px;margin-top:12px}
.question-card h4{margin:8px 0 10px;color:var(--text)}
.option-list{display:grid;gap:10px;margin-top:12px}
.option-row{display:flex;align-items:center;gap:10px;padding:12px;border-radius:14px;border:1px solid #e2e8f0;background:#fff}
.option-tag{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;font-weight:800;font-size:12px}
.visual-math{margin-top:10px;padding:14px;border-radius:14px;border:1px solid #dbeafe;background:#f8fbff}
.algebra-box{font-weight:800;color:var(--text)}
.bar-visual{display:flex;align-items:flex-end;gap:12px;min-height:190px}
.bar-col{flex:1;text-align:center;color:var(--muted);font-size:12px}
.bar{border-radius:10px 10px 0 0;background:#2563eb}
.choice-visual{font-size:22px;line-height:1.4}
.number-line{position:relative;height:80px}
.number-line .line{position:absolute;left:10%;right:10%;top:34px;height:2px;background:#94a3b8}
.number-line .tick{position:absolute;top:26px;width:2px;height:18px;background:#64748b}
.number-line .label{position:absolute;top:48px;transform:translateX(-50%);font-size:12px;color:#475569}
.number-line .point{position:absolute;top:8px;transform:translateX(-50%);font-weight:800;color:#0f172a}
.feedback{padding:12px 14px;border-radius:12px;font-weight:800}
.good{background:#ecfdf5;color:#047857;border:1px solid #86efac}
.warnf{background:#fffbeb;color:#b45309;border:1px solid #fcd34d}
.bad{background:#fef2f2;color:#b91c1c;border:1px solid #fca5a5}
.hidden{display:none!important}
@media (max-width:900px){.header-top{flex-direction:column;align-items:flex-start}.grid2,.grid3{grid-template-columns:1fr}}

body.theme-early .banner{background:linear-gradient(135deg,#f0fdf4,#ecfeff 58%,#f0fdfa)!important}
body.theme-early .tile.card, body.theme-early .panel.card{background:linear-gradient(180deg,#f0fdf4,#fff,#ecfeff)!important}
body.theme-early .mark, body.theme-early .btn.primary, body.theme-early .tab.active{box-shadow:0 12px 24px rgba(20,184,166,.22)}
body.theme-early .banner h3{font-size:28px!important}
body.theme-early .option-row{border-color:#86efac!important;background:#f7fffb!important}
body.theme-early .option-tag{background:#ecfdf5!important;border-color:#86efac!important;color:#047857!important}

body{color:#eef4ff !important}
.header{
  background:rgba(255,255,255,.06) !important;
  backdrop-filter:none !important;
  box-shadow:0 14px 34px rgba(0,0,0,.18) !important;
}
.copy p{color:#edf4ff !important}
.banner,.panel,.tile,.question-card{
  background:#ffffff !important;
  border:1px solid #d7e8ff !important;
  box-shadow:0 12px 24px rgba(15,23,42,.08) !important;
}
.banner p,.panel p,.muted,.tile span{color:#475569 !important}
.question-card{padding:18px 20px !important}
.question-card h4{font-size:18px !important; line-height:1.45 !important; color:#0f172a !important}
.option-list{display:grid; gap:10px; margin-top:14px !important}
.option-row{
  align-items:flex-start !important;
  gap:12px !important;
  padding:14px !important;
  border:1px solid #dbeafe !important;
  background:#fff !important;
}
.option-row input{margin-top:4px; min-height:auto !important; width:auto !important}
.option-row span:last-child{color:#0f172a !important; line-height:1.45 !important}
.option-tag{
  min-width:30px !important;
  height:30px !important;
  background:#eff6ff !important;
  color:#1d4ed8 !important;
}
.visual-math{
  margin-top:12px !important;
  padding:16px !important;
  border-radius:16px !important;
  border:1px solid #bfdbfe !important;
  background:linear-gradient(180deg,#f8fbff,#eff6ff) !important;
}
.algebra-box{font-size:22px !important; line-height:1.3 !important}
.bar-visual{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(90px,1fr));
  gap:14px !important;
  align-items:end !important;
  min-height:220px !important;
}
.bar-col{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  color:#334155 !important;
  font-size:13px !important;
  font-weight:600 !important;
}
.bar{
  width:100% !important;
  max-width:56px !important;
  border-radius:12px 12px 4px 4px !important;
  background:linear-gradient(180deg,#60a5fa,#2563eb) !important;
  box-shadow:inset 0 -2px 0 rgba(255,255,255,.18) !important;
}
.choice-visual{
  font-size:34px !important;
  line-height:1.35 !important;
  text-align:center !important;
}
.picto-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(72px,1fr));
  gap:10px;
  margin-top:4px;
}
.picto-card{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:64px;
  padding:8px;
  border-radius:14px;
  background:#ffffff;
  border:1px solid #dbeafe;
  font-size:32px;
}
.pattern-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
}
.pattern-chip{
  min-width:56px;
  min-height:56px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:#ffffff;
  border:1px solid #dbeafe;
  font-size:32px;
  box-shadow:0 6px 14px rgba(15,23,42,.05);
}
.group-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:12px;
}
.group-card{
  background:#ffffff;
  border:1px solid #dbeafe;
  border-radius:16px;
  padding:12px;
}
.group-card .group-icons{
  font-size:30px;
  line-height:1.35;
  text-align:center;
  min-height:44px;
}
.group-card .group-label{
  margin-top:6px;
  text-align:center;
  color:#334155;
  font-size:13px;
  font-weight:700;
}
.number-line{
  height:96px !important;
}
.number-line .line{top:42px !important; background:#64748b !important}
.number-line .tick{top:34px !important}
.number-line .label{top:58px !important; color:#334155 !important; font-weight:700 !important}
.number-line .point{top:8px !important; color:#0f172a !important}
.feedback{font-size:14px !important}

.visual-math.graph-frame{
  padding:18px !important;
}
.graph-shell{
  display:grid;
  grid-template-columns:42px 1fr;
  gap:10px;
  align-items:stretch;
}
.y-axis{
  display:grid;
  grid-template-rows:repeat(5,1fr);
  min-height:240px;
  align-items:space-between;
  color:#475569;
  font-size:12px;
  font-weight:700;
}
.y-axis div{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
.graph-plot{
  position:relative;
  min-height:240px;
  border-left:2px solid #64748b;
  border-bottom:2px solid #64748b;
  padding:10px 10px 26px 12px;
  background:
    repeating-linear-gradient(
      to top,
      rgba(148,163,184,.18) 0,
      rgba(148,163,184,.18) 1px,
      transparent 1px,
      transparent 20%
    );
}
.graph-bars{
  position:absolute;
  inset:10px 10px 26px 12px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(70px,1fr));
  gap:14px;
  align-items:end;
}
.graph-bar-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  height:100%;
}
.graph-bar-value{
  font-size:12px;
  font-weight:800;
  color:#0f172a;
}
.graph-bar{
  width:100%;
  max-width:48px;
  border-radius:10px 10px 4px 4px;
  background:linear-gradient(180deg,#60a5fa,#2563eb);
  box-shadow:inset 0 -2px 0 rgba(255,255,255,.18);
}
.graph-x-labels{
  position:absolute;
  left:12px;
  right:10px;
  bottom:2px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(70px,1fr));
  gap:14px;
}
.graph-x-label{
  text-align:center;
  color:#334155;
  font-size:12px;
  font-weight:700;
  line-height:1.25;
}
.graph-axis-title{
  margin-top:8px;
  color:#475569;
  font-size:12px;
  font-weight:700;
  text-align:center;
}

.visual-math.graph-frame{
  padding:16px !important;
}
.graph-svg-wrap{
  width:100%;
  overflow-x:auto;
}
.graph-svg{
  width:100%;
  min-width:420px;
  height:auto;
  display:block;
  background:linear-gradient(180deg,#f8fbff,#eff6ff);
  border:1px solid #bfdbfe;
  border-radius:16px;
}
.graph-axis-text{
  font-size:12px;
  font-weight:700;
  fill:#475569;
}
.graph-label-text{
  font-size:12px;
  font-weight:700;
  fill:#334155;
}
.graph-value-text{
  font-size:12px;
  font-weight:800;
  fill:#0f172a;
}
.graph-grid-line{
  stroke:rgba(148,163,184,.35);
  stroke-width:1;
}
.graph-axis-line{
  stroke:#64748b;
  stroke-width:2;
}
.graph-bar-rect{
  fill:url(#barGrad);
}

.coord-wrap{
  width:100%;
  overflow-x:auto;
}
.coord-svg{
  width:100%;
  min-width:420px;
  height:auto;
  display:block;
  background:linear-gradient(180deg,#f8fbff,#eff6ff);
  border:1px solid #bfdbfe;
  border-radius:16px;
}
.coord-grid{stroke:rgba(148,163,184,.25);stroke-width:1}
.coord-axis{stroke:#475569;stroke-width:2}
.coord-label{font-size:12px;font-weight:700;fill:#334155}
.coord-point-label{font-size:12px;font-weight:800;fill:#0f172a}
.coord-line{stroke:#2563eb;stroke-width:3;fill:none}
.coord-curve{stroke:#7c3aed;stroke-width:3;fill:none}
.coord-point{fill:#0f172a}

.avatar-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(92px,1fr));
  gap:12px;
  margin-top:12px;
}
.avatar-card{
  border:2px solid #dbeafe;
  border-radius:18px;
  background:#fff;
  padding:12px 8px;
  text-align:center;
  cursor:pointer;
  transition:all .15s ease;
}
.avatar-card:hover{transform:translateY(-2px); border-color:#93c5fd}
.avatar-card.active{border-color:#22c55e; box-shadow:0 10px 22px rgba(34,197,94,.16)}
.avatar-emoji{
  font-size:34px;
  line-height:1.2;
}
.avatar-name{
  margin-top:6px;
  font-size:12px;
  font-weight:800;
  color:#334155;
}
.reward-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
.reward-pill{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  background:#ecfdf5;
  border:1px solid #86efac;
  color:#047857;
  font-size:12px;
  font-weight:800;
}
.reward-card{
  background:linear-gradient(180deg,#fff7ed,#fefce8);
  border:1px solid #fdba74;
  border-radius:18px;
  padding:14px 16px;
}
.reward-card strong{
  display:block;
  color:#9a3412;
  margin-bottom:6px;
}
.reward-card span{
  color:#57534e;
  font-size:13px;
  line-height:1.5;
}
.celebration{
  margin-top:10px;
  padding:12px 14px;
  border-radius:14px;
  background:#eff6ff;
  border:1px solid #93c5fd;
  color:#1d4ed8;
  font-weight:800;
}
body.theme-foundation .mark, body.theme-foundation .btn.primary, body.theme-foundation .tab.active{
  background:linear-gradient(135deg,#fb923c,#ec4899) !important;
}
body.theme-early .mark, body.theme-early .btn.primary, body.theme-early .tab.active{
  background:linear-gradient(135deg,#22c55e,#14b8a6) !important;
}

.action-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.question-card .btn,
.panel .btn{
  color:#0f172a !important;
  background:#ffffff !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 4px 10px rgba(15,23,42,.04);
}
.question-card .btn.primary,
.panel .btn.primary{
  color:#ffffff !important;
  border-color:transparent !important;
}
.question-card .btn.check-btn{
  background:#eff6ff !important;
  border-color:#bfdbfe !important;
  color:#1d4ed8 !important;
}
.feedback-slot{
  margin-top:12px;
}
.option-row{
  cursor:pointer;
}
.option-row:hover{
  border-color:#93c5fd !important;
  background:#f8fbff !important;
}
.option-row input{
  accent-color:#2563eb;
}

.header{
  background:rgba(255,255,255,.10) !important;
  border:1px solid rgba(255,255,255,.16) !important;
}
.header-top{
  padding:18px 20px 12px !important;
}
.copy h1{
  color:#ffffff !important;
}
.copy p{
  color:#e6eefc !important;
}
.actions .btn{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #dbeafe !important;
}
.actions .btn.primary{
  color:#ffffff !important;
  border-color:transparent !important;
}
.tabs{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px !important;
  padding:0 20px 18px !important;
}
.tab{
  min-height:44px !important;
  padding:0 12px !important;
  border-radius:14px !important;
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #dbeafe !important;
  font-size:14px !important;
  font-weight:800 !important;
  box-shadow:0 4px 10px rgba(15,23,42,.05);
}
.tab:hover{
  border-color:#93c5fd !important;
  background:#f8fbff !important;
}
.tab.active{
  color:#ffffff !important;
  border-color:transparent !important;
}
body.theme-foundation .tab.active{background:linear-gradient(135deg,#fb923c,#ec4899) !important;}
body.theme-early .tab.active{background:linear-gradient(135deg,#22c55e,#14b8a6) !important;}
body.theme-intermediate .tab.active{background:linear-gradient(135deg,#2563eb,#8b5cf6) !important;}
body.theme-senior .tab.active{background:linear-gradient(135deg,#0ea5e9,#06b6d4) !important;}
body.theme-fet .tab.active{background:linear-gradient(135deg,#7c3aed,#2563eb) !important;}
@media (max-width:900px){
  .tabs{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width:520px){
  .tabs{
    grid-template-columns:1fr !important;
  }
}

.btn,
button.btn,
a.btn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:42px !important;
  padding:0 14px !important;
  border-radius:12px !important;
  font-size:13px !important;
  font-weight:800 !important;
  text-decoration:none !important;
  cursor:pointer !important;
  transition:all .15s ease !important;
  opacity:1 !important;
  visibility:visible !important;
}
.btn{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 4px 10px rgba(15,23,42,.04) !important;
}
.btn:hover{
  background:#f8fafc !important;
  border-color:#93c5fd !important;
}
.btn:disabled,
button.btn:disabled{
  opacity:.6 !important;
  cursor:not-allowed !important;
}
.btn.primary,
button.btn.primary,
a.btn.primary{
  color:#ffffff !important;
  border-color:transparent !important;
}
body.theme-foundation .btn.primary{background:linear-gradient(135deg,#fb923c,#ec4899) !important;}
body.theme-early .btn.primary{background:linear-gradient(135deg,#22c55e,#14b8a6) !important;}
body.theme-intermediate .btn.primary{background:linear-gradient(135deg,#2563eb,#8b5cf6) !important;}
body.theme-senior .btn.primary{background:linear-gradient(135deg,#0ea5e9,#06b6d4) !important;}
body.theme-fet .btn.primary{background:linear-gradient(135deg,#7c3aed,#2563eb) !important;}

.actions .btn,
.action-strip .btn,
.action-row .btn,
.question-card .btn,
.panel .btn,
.tabs .tab{
  opacity:1 !important;
  visibility:visible !important;
}
.question-card .btn.check-btn{
  background:#eff6ff !important;
  border-color:#bfdbfe !important;
  color:#1d4ed8 !important;
}
#generateQuiz,
#submitQuiz,
#generateWorksheet,
#showMemo,
#saveLearner,
#resetApp,
#jumpToLearner{
  opacity:1 !important;
  visibility:visible !important;
}

.feedback-slot{margin-top:14px !important;display:block !important;width:100% !important}
.feedback-slot *{text-shadow:none !important;filter:none !important;mix-blend-mode:normal !important}

.shape-board{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:12px;
}
.shape-card{
  background:#fff;
  border:1px solid #dbeafe;
  border-radius:16px;
  padding:12px;
  text-align:center;
}
.shape-label{
  margin-top:8px;
  font-weight:800;
  color:#0f172a;
  font-size:13px;
}
.shape-svg{
  width:90px;
  height:90px;
}

#downloadWorksheetPdf,
#generateMockExam{
  opacity:1 !important;
  visibility:visible !important;
}

#showMockMemo,#downloadMockExamPdf{opacity:1 !important; visibility:visible !important;}

body{
  background:
    radial-gradient(circle at 12% 10%, rgba(251,146,60,.18), transparent 18%),
    radial-gradient(circle at 88% 12%, rgba(236,72,153,.14), transparent 20%),
    radial-gradient(circle at 30% 85%, rgba(34,197,94,.12), transparent 18%),
    radial-gradient(circle at 78% 78%, rgba(59,130,246,.14), transparent 18%),
    linear-gradient(180deg,#f8fbff 0%, #eef6ff 100%) !important;
}
.header{
  background:linear-gradient(135deg,rgba(37,99,235,.88),rgba(124,58,237,.82)) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  box-shadow:0 18px 40px rgba(37,99,235,.18) !important;
}
.copy h1{color:#fff !important}
.copy p{color:#eef4ff !important}
.banner,.panel,.tile,.question-card{
  position:relative;
  overflow:hidden;
}
.banner::after,.panel::after,.tile::after,.question-card::after{
  content:'';
  position:absolute;
  right:-18px;
  top:-18px;
  width:92px;
  height:92px;
  border-radius:999px;
  background:radial-gradient(circle, rgba(59,130,246,.10), rgba(59,130,246,0));
  pointer-events:none;
}
body.theme-foundation .panel::before,
body.theme-foundation .question-card::before{
  content:'⭐';
  position:absolute;
  left:14px;
  top:12px;
  font-size:18px;
  opacity:.18;
}
body.theme-early .panel::before,
body.theme-early .question-card::before{
  content:'🚀';
  position:absolute;
  left:14px;
  top:12px;
  font-size:18px;
  opacity:.16;
}
body.theme-intermediate .panel::before,
body.theme-intermediate .question-card::before{
  content:'🧠';
  position:absolute;
  left:14px;
  top:12px;
  font-size:18px;
  opacity:.16;
}
body.theme-senior .panel::before,
body.theme-senior .question-card::before{
  content:'📘';
  position:absolute;
  left:14px;
  top:12px;
  font-size:18px;
  opacity:.15;
}
body.theme-fet .panel::before,
body.theme-fet .question-card::before{
  content:'🎯';
  position:absolute;
  left:14px;
  top:12px;
  font-size:18px;
  opacity:.15;
}
.panel, .question-card, .tile, .banner{
  border-radius:22px !important;
  box-shadow:0 16px 30px rgba(15,23,42,.07) !important;
}
.mark{
  box-shadow:0 10px 22px rgba(37,99,235,.18) !important;
}
.home-fun-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}
.home-fun-pill{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid #dbeafe;
  color:#1e3a8a;
  font-size:12px;
  font-weight:800;
  box-shadow:0 6px 14px rgba(15,23,42,.05);
}
.front-vibrant-card{
  background:linear-gradient(135deg,#fff7ed,#eff6ff) !important;
  border:1px solid #bfdbfe !important;
}
.front-vibrant-card h4{color:#0f172a !important}
.front-vibrant-card p{color:#475569 !important}

body{position:relative}
body::before{
  content:'';position:fixed;inset:0;pointer-events:none;
  background:
    radial-gradient(circle at 14% 12%, rgba(255,255,255,.06), transparent 18%),
    radial-gradient(circle at 86% 16%, rgba(255,255,255,.04), transparent 16%);
}
.header{
  border:1px solid rgba(255,255,255,.14) !important;
  background:linear-gradient(180deg, rgba(11,23,44,.52), rgba(10,21,36,.36)) !important;
  box-shadow:0 24px 54px rgba(0,0,0,.18) !important;
}
.header-top{padding:20px 22px 14px !important}
.mark{
  width:54px !important;height:54px !important;border-radius:18px !important;
  box-shadow:0 16px 36px rgba(15,23,42,.24); font-size:14px !important; letter-spacing:.08em !important;
}
.copy h1{font-size:30px !important; letter-spacing:-.03em}
.copy p{font-size:15px !important; color:#dbeafe !important; max-width:760px}
.tab{
  background:rgba(255,255,255,.08) !important; border:1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}
.tab.active{
  color:#0f172a !important; box-shadow:0 10px 24px rgba(255,255,255,.16);
}
.panel.card,.question-card{
  border-radius:24px !important;
  box-shadow:0 18px 42px rgba(15,23,42,.12) !important;
}
.btn{
  border-radius:14px !important;
}
.btn.primary{
  box-shadow:0 14px 30px rgba(37,99,235,.18);
}
.-banner{
  margin-top:14px;padding:12px 14px;border-radius:14px;background:#eff6ff;border:1px solid #93c5fd;color:#1d4ed8;font-size:13px;font-weight:800;
}

.notes-download-card,.topic-notes-card{
  margin-top:16px;background:linear-gradient(135deg,#eff6ff,#ffffff);
  border:1px solid #bfdbfe;border-radius:18px;padding:16px;box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.notes-download-card h4,.topic-notes-card h4{margin:0 0 8px;color:#0f172a}
.notes-download-card p,.topic-notes-card p{margin:0 0 12px;color:#475569;line-height:1.6}

.external-pack-card{
  margin-top:16px;background:linear-gradient(135deg,#eff6ff,#ffffff);
  border:1px solid #bfdbfe;border-radius:18px;padding:16px;box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.external-pack-card h4{margin:0 0 8px;color:#0f172a}
.external-pack-card p{margin:0 0 12px;color:#475569;line-height:1.6}

.page > :first-child{margin-top:0 !important}.page .card:first-child,.page .banner:first-child,.page .panel:first-child{margin-top:0 !important}body{scroll-behavior:auto}.header{margin-bottom:4px}

/* Grade R and Grade 1-2 primary button override (features.css also sets this) */
body.grade-r-fun .btn.primary,
body.grade-early-fun .btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #ec4899) !important;
  box-shadow: 0 6px 20px rgba(139,92,246,.35) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MINDMATHS GAME MODE — Gamification CSS
   ═══════════════════════════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes mmBounce {
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-10px)}
}
@keyframes mmSpin {
  0%{transform:rotate(0deg) scale(1)}
  50%{transform:rotate(180deg) scale(1.3)}
  100%{transform:rotate(360deg) scale(1)}
}
@keyframes mmShake {
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-8px)}
  40%{transform:translateX(8px)}
  60%{transform:translateX(-6px)}
  80%{transform:translateX(6px)}
}
@keyframes mmPulse {
  0%,100%{transform:scale(1)}
  50%{transform:scale(1.25)}
}
@keyframes mmTilt {
  0%,100%{transform:rotate(0deg)}
  50%{transform:rotate(12deg)}
}
@keyframes mmFallDown {
  0%{transform:translateY(-60px);opacity:1}
  100%{transform:translateY(110vh);opacity:0}
}
@keyframes mmGlowGreen {
  0%,100%{box-shadow:0 0 0 0 #16a34a33}
  50%{box-shadow:0 0 24px 8px #16a34a55}
}
@keyframes mmFadeSlideIn {
  0%{opacity:0;transform:translateY(-20px) scale(0.8)}
  100%{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes mmHeartPulse {
  0%,100%{transform:scale(1)}
  40%{transform:scale(1.4)}
  70%{transform:scale(0.9)}
}
@keyframes mmConfettiFall {
  0%{transform:translateY(0) rotate(0deg);opacity:1}
  100%{transform:translateY(120px) rotate(720deg);opacity:0}
}
@keyframes mmCheckBounce {
  0%{transform:scale(0) rotate(-20deg)}
  60%{transform:scale(1.3) rotate(5deg)}
  100%{transform:scale(1) rotate(0deg)}
}

/* ── Game Header ── */
.game-header {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  background:#1e293b;
  border-radius:16px;
  margin-bottom:16px;
}
.game-hearts { font-size:1.6rem; display:flex; gap:4px; }
.game-heart.full { display:inline-block; }
.game-heart.lost { filter:grayscale(1) brightness(0.7); }
.game-heart-pulse { animation:mmHeartPulse .4s ease; }
.game-xp-bar-wrap { flex:1; min-width:140px; }
.game-level-badge {
  font-size:12px;
  font-weight:800;
  color:#fbbf24;
  margin-bottom:4px;
}
.game-xp-bar {
  height:14px;
  background:#374151;
  border-radius:99px;
  overflow:hidden;
}
.game-xp-fill {
  height:100%;
  background:linear-gradient(90deg,#3b82f6,#8b5cf6,#ec4899);
  border-radius:99px;
  transition:width .5s ease;
}
.game-xp-text { font-size:11px; color:#94a3b8; margin-top:3px; }
.game-streak { font-size:1.4rem; }
.game-flame-label { display:flex; align-items:center; gap:2px; }

/* ── Topic Picker ── */
.game-topic-picker { margin-bottom:16px; }
.game-topic-picker h3 { margin:0 0 10px; color:#f9fafb; font-size:1.1rem; }
.game-topic-picker select {
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:2px solid #3b82f6;
  background:#1e293b;
  color:#f9fafb;
  font-size:15px;
  margin-bottom:12px;
}
.game-start-btn { width:100%; font-size:1.1rem; padding:14px; border-radius:14px; }

/* ── Play Area ── */
.game-question-counter {
  font-size:15px;
  font-weight:700;
  color:#fbbf24;
  margin-bottom:10px;
  text-align:center;
}
.game-question-card {
  background:#1e293b;
  border:2px solid #3b82f6;
  border-radius:18px;
  padding:18px 16px;
  margin-bottom:14px;
  min-height:80px;
  transition:box-shadow .3s;
}
.grade-r-fun .game-question-card {
  border-width:3px;
  padding:20px 18px;
}
.game-q-text {
  font-size:17px;
  font-weight:700;
  color:#f9fafb;
  line-height:1.5;
}
.grade-r-fun .game-q-text { font-size:22px; }

.game-card-glow-green {
  animation:mmGlowGreen .8s ease;
  border-color:#16a34a !important;
}
.game-card-shake { animation:mmShake .5s ease; }

/* ── Option Buttons ── */
.game-options { display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.game-opt-btn {
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  border:2px solid #3b82f6;
  border-radius:14px;
  background:#1e293b;
  color:#f9fafb;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  text-align:left;
  transition:background .15s, border-color .15s, transform .1s;
  min-height:52px;
}
.grade-r-fun .game-opt-btn {
  min-height:80px;
  font-size:18px;
  border-radius:20px;
  border-width:3px;
}
.game-opt-btn:hover:not(:disabled) {
  background:#2563eb;
  border-color:#60a5fa;
  transform:scale(1.02);
}
.game-opt-btn:disabled { opacity:.75; cursor:default; transform:none; }
.game-opt-correct { background:#15803d !important; border-color:#22c55e !important; }
.game-opt-wrong { background:#991b1b !important; border-color:#ef4444 !important; }
.game-opt-letter {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  background:#2563eb;
  border-radius:50%;
  font-size:13px;
  font-weight:900;
  flex-shrink:0;
}
.game-opt-animal { font-size:1.3rem; }
.game-opt-text { flex:1; }

/* ── Feedback ── */
.game-feedback { min-height:36px; margin-bottom:10px; text-align:center; }
.game-feedback-correct {
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#166534;
  color:#dcfce7;
  border-radius:12px;
  padding:10px 18px;
  font-size:16px;
  font-weight:800;
  animation:mmFadeSlideIn .3s ease;
}
.game-feedback-wrong {
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#7f1d1d;
  color:#fee2e2;
  border-radius:12px;
  padding:10px 18px;
  font-size:16px;
  font-weight:800;
  animation:mmShake .4s ease;
}
.game-check {
  font-size:1.4rem;
  color:#4ade80;
  animation:mmCheckBounce .4s ease;
  display:inline-block;
}
.game-cross { font-size:1.4rem; color:#f87171; }

/* ── Mascot ── */
.game-mascot {
  position:fixed;
  bottom:22px;
  right:18px;
  font-size:2.8rem;
  z-index:800;
  user-select:none;
  pointer-events:none;
  animation:mmBounce 2.2s ease-in-out infinite;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.5));
}
.game-mascot-idle   { animation:mmBounce 2.2s ease-in-out infinite; }
.game-mascot-happy  { animation:mmBounce 0.4s ease-in-out 3; }
.game-mascot-thinking { animation:mmTilt 1.4s ease-in-out infinite; }
.game-mascot-sad    { filter:grayscale(0.6) drop-shadow(0 4px 8px rgba(0,0,0,.5)); animation:none; }
.game-mascot-celebrate { animation:mmSpin 1s ease-in-out 2; }

.game-mascot-bubble {
  position:fixed;
  bottom:90px;
  right:20px;
  background:#1e293b;
  border:2px solid #3b82f6;
  border-radius:14px;
  padding:8px 14px;
  font-size:13px;
  font-weight:700;
  color:#f9fafb;
  max-width:160px;
  z-index:800;
  pointer-events:none;
  animation:mmFadeSlideIn .3s ease;
}

/* ── Overlays ── */
.game-overlay {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.75);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:900;
  animation:mmFadeSlideIn .3s ease;
}
.game-overlay-inner {
  background:#1e293b;
  border:3px solid #3b82f6;
  border-radius:24px;
  padding:32px 24px;
  text-align:center;
  max-width:420px;
  width:90%;
  position:relative;
  overflow:hidden;
}
.game-overlay-inner h2 { color:#fbbf24; font-size:2rem; margin:0 0 10px; }
.game-overlay-inner p { color:#cbd5e1; margin:8px 0 20px; }
.game-level-name { font-size:1.3rem; font-weight:900; color:#a78bfa; margin-bottom:10px; }
.game-mascot-big { font-size:4rem; margin-bottom:12px; }
.game-mascot-celebrate { animation:mmSpin 1s ease-in-out 2, mmBounce 2.2s ease-in-out infinite; }
.game-overlay-btn { margin-top:16px; font-size:1.1rem; padding:12px 28px; border-radius:14px; }
.game-overlay-btns { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top:16px; }
.game-round-stats { color:#94a3b8; font-size:15px; line-height:2; }

/* ── Level-up glow ── */
.game-levelup-overlay .game-overlay-inner {
  box-shadow:0 0 40px 12px #8b5cf699;
  animation:mmGlowGreen 1.5s ease infinite;
}

/* ── Confetti ── */
.game-confetti-wrap { position:relative; height:60px; overflow:visible; }
.mm-confetti-piece {
  position:absolute;
  animation:mmConfettiFall 1.5s ease-out forwards;
  pointer-events:none;
}

/* ── Emoji rain (Grade R) ── */
.game-emoji-rain {
  position:fixed;
  top:-40px;
  font-size:2rem;
  z-index:850;
  animation:mmFallDown 1.5s ease-in forwards;
  pointer-events:none;
}

/* ── Badge Grid ── */
.game-badges-section { margin-top:28px; }
.game-badges-section h3 { color:#fbbf24; margin-bottom:12px; }
.game-badges-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(90px,1fr));
  gap:10px;
}
.game-badge-card {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:12px 6px;
  border-radius:14px;
  border:2px solid #334155;
  background:#0f172a;
  text-align:center;
  transition:transform .15s;
}
.game-badge-card.earned { border-color:#fbbf24; background:#1c1917; }
.game-badge-card.earned:hover { transform:scale(1.08); }
.game-badge-card.locked { opacity:.5; }
.game-badge-emoji { font-size:1.8rem; }
.game-badge-name { font-size:10px; font-weight:700; color:#94a3b8; line-height:1.2; }
.game-badge-card.earned .game-badge-name { color:#fbbf24; }

/* ── Badge Toast ── */
.game-badge-toast {
  position:fixed;
  bottom:120px;
  right:20px;
  background:#1e293b;
  border:2px solid #fbbf24;
  border-radius:14px;
  padding:10px 16px;
  font-size:14px;
  font-weight:700;
  color:#fbbf24;
  z-index:950;
  transform:translateX(200%);
  transition:transform .3s ease;
  pointer-events:none;
}
.game-badge-toast-show { transform:translateX(0); }
.game-heart-heal-toast { border-color:#ef4444; color:#ef4444; }

/* ── Grade R Topic Cards on Home ── */
.gr-topic-grid {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  margin-top:10px;
}
.gr-topic-card {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:18px 12px;
  border-radius:18px;
  border:3px solid;
  cursor:pointer;
  font-weight:800;
  font-size:15px;
  color:#111827;
  transition:transform .15s, box-shadow .15s;
}
.gr-topic-card:hover { transform:scale(1.04); box-shadow:0 6px 18px rgba(0,0,0,.3); }
.gr-topic-emoji { font-size:2rem; }
.gr-topic-name { text-align:center; line-height:1.2; }

/* ── Game section ── */
#page-game { padding-bottom:80px; /* space for mascot */ }

/* ── Grade R body overrides ── */
.grade-r-fun #page-game .game-opt-btn {
  min-height:80px;
  font-size:18px;
  border-radius:20px;
  border-width:3px;
  padding:14px 18px;
}
