/* =====================================================================
   BREAKTHROUGH EDUCATION  —  Afrikaans Eerste Addisionele Taal (EAT)
   Studieprogram vir Graad 8–12  (CAPS-belyn)
   Design system & full stylesheet
   ---------------------------------------------------------------------
   Bilingual study tool: Afrikaans content, English scaffolding.
   No build step — pure CSS. Works under file:// and over http.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* 1. DESIGN TOKENS                                                    */
/* ------------------------------------------------------------------ */
:root {
  /* ===== Active theme = BreakThrough (default — mirrors the logo) ===== */
  /* Brand identity (re-themed by [data-theme] / body.dark blocks below) */
  --brand:    #1fa84c;  --brand-d: #16803a;  --brand-l: #dcf7e6;
  /* Brand gradients */
  --grad-brand: linear-gradient(135deg, #15803d 0%, #22c55e 55%, #4ade80 100%);
  --grad-sky:   linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --grad-sun:   linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-mint:  linear-gradient(135deg, #10b981 0%, #06b6d4 100%);

  /* Skill colours — each learning area has its own identity */
  --c-leesbegrip:      #0ea5e9;  --c-leesbegrip-d:      #0369a1;  --c-leesbegrip-l:      #e0f2fe;
  --c-spelling:        #8b5cf6;  --c-spelling-d:        #6d28d9;  --c-spelling-l:        #ede9fe;
  --c-leesvaardigheid: #10b981;  --c-leesvaardigheid-d: #047857;  --c-leesvaardigheid-l: #d1fae5;
  --c-woordeskat:      #f59e0b;  --c-woordeskat-d:      #b45309;  --c-woordeskat-l:      #fef3c7;
  --c-skryf:           #ec4899;  --c-skryf-d:           #be185d;  --c-skryf-l:           #fce7f3;
  --c-luisterpraat:    #06b6d4;  --c-luisterpraat-d:    #0e7490;  --c-luisterpraat-l:    #cffafe;
  --c-take:            #6366f1;  --c-take-d:            #4338ca;  --c-take-l:            #e0e7ff;
  --c-verslag:         #14b8a6;  --c-verslag-d:         #0f766e;  --c-verslag-l:         #ccfbf1;

  /* Neutrals */
  --bg:        #f4f7f8;
  --bg-2:      #e8eef0;
  --surface:   #ffffff;
  --surface-2: #f7faf9;
  --ink:       #16202e;
  --ink-soft:  #3c4858;
  --ink-mute:  #6b7a8c;
  --line:      #e2e8ec;
  --line-soft: #eef2f4;
  /* Background glows (themeable) */
  --glow-1: rgba(34,197,94,.12);
  --glow-2: rgba(22,32,46,.05);

  /* Semantic */
  --ok:    #16a34a;  --ok-l:    #dcfce7;
  --warn:  #d97706;  --warn-l:  #fef3c7;
  --bad:   #dc2626;  --bad-l:   #fee2e2;
  --info:  #2563eb;  --info-l:  #dbeafe;
  --gold:  #f5b50a;

  /* Type */
  --font: "Baloo 2", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-read: "Quicksand", "Segoe UI", system-ui, sans-serif;

  /* Geometry & motion */
  --r-sm: 8px; --r: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(20,24,40,.06), 0 2px 8px rgba(20,24,40,.05);
  --sh-2: 0 6px 18px rgba(20,24,40,.10);
  --sh-3: 0 16px 40px rgba(20,24,40,.16);
  --sh-pop: 0 10px 30px rgba(109,40,217,.28);
  --ease: cubic-bezier(.22,.61,.36,1);
  --container: 1180px;
}

/* ===== Theme: Dark (BreakThrough night) ===== */
body.dark {
  --brand:    #34d058;  --brand-d: #22c55e;  --brand-l: #14532d;
  --grad-brand: linear-gradient(135deg, #15803d 0%, #22c55e 60%, #4ade80 100%);
  --glow-1: rgba(34,197,94,.12);
  --glow-2: rgba(34,211,238,.07);
  --bg:        #0f1220;
  --bg-2:      #151a2e;
  --surface:   #181d31;
  --surface-2: #1d2238;
  --ink:       #eef1fb;
  --ink-soft:  #c2c8de;
  --ink-mute:  #8a93ad;
  --line:      #2a3150;
  --line-soft: #232943;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 8px 22px rgba(0,0,0,.5);
  --sh-3: 0 18px 46px rgba(0,0,0,.6);
}

/* ===== Theme: Ocean (light, blue) ===== */
body[data-theme="ocean"] {
  --brand:#0ea5e9; --brand-d:#0369a1; --brand-l:#e0f2fe;
  --grad-brand: linear-gradient(135deg,#0369a1 0%,#0ea5e9 55%,#22d3ee 100%);
  --bg:#f1f6fb; --bg-2:#e2edf5; --surface:#ffffff; --surface-2:#f5fafd;
  --ink:#0f2436; --ink-soft:#395165; --ink-mute:#6a8197;
  --line:#d8e6f0; --line-soft:#e9f1f7;
  --glow-1: rgba(14,165,233,.14); --glow-2: rgba(6,182,212,.08);
}
/* ===== Theme: Sunset (light, warm) ===== */
body[data-theme="sunset"] {
  --brand:#f97316; --brand-d:#c2410c; --brand-l:#ffedd5;
  --grad-brand: linear-gradient(135deg,#db2777 0%,#f97316 55%,#f59e0b 100%);
  --bg:#fdf6f1; --bg-2:#f7e7dd; --surface:#fffaf6; --surface-2:#fdf3ec;
  --ink:#3a2218; --ink-soft:#6b4636; --ink-mute:#9a7565;
  --line:#f1ddd0; --line-soft:#f8ebe2;
  --glow-1: rgba(249,115,22,.16); --glow-2: rgba(236,72,153,.10);
}
/* ===== Theme: Grape (light, purple) ===== */
body[data-theme="grape"] {
  --brand:#8b5cf6; --brand-d:#6d28d9; --brand-l:#ede9fe;
  --grad-brand: linear-gradient(135deg,#6d28d9 0%,#8b5cf6 55%,#d946ef 100%);
  --bg:#f7f5fd; --bg-2:#ece6f8; --surface:#ffffff; --surface-2:#faf8fe;
  --ink:#241a38; --ink-soft:#483d5e; --ink-mute:#776a90;
  --line:#e7e0f3; --line-soft:#f1ecf9;
  --glow-1: rgba(139,92,246,.15); --glow-2: rgba(217,70,239,.09);
}
/* ===== Theme: Midnight (dark, indigo) — pairs with body.dark ===== */
body[data-theme="midnight"] {
  --brand:#818cf8; --brand-d:#a5b4fc; --brand-l:#312e81;
  --grad-brand: linear-gradient(135deg,#4338ca 0%,#6366f1 55%,#22d3ee 100%);
  --bg:#0a0f1f; --bg-2:#121a31; --surface:#121831; --surface-2:#172040;
  --ink:#e8ecfb; --ink-soft:#c0c7e2; --ink-mute:#8590b0;
  --line:#26304f; --line-soft:#1d2742;
  --glow-1: rgba(99,102,241,.18); --glow-2: rgba(34,211,238,.10);
}

/* ===== Theme: Arcade (dark + neon, gamified) — the default look ===== */
body[data-theme="arcade"] {
  --brand:#34d058; --brand-d:#7df59b; --brand-l:#0f3d1f;
  --grad-brand: linear-gradient(135deg,#15803d 0%,#22c55e 55%,#34d058 100%);
  --bg:#070b16; --bg-2:#121a31; --surface:#0e1530; --surface-2:#141d3a;
  --ink:#e8ecfb; --ink-soft:#aab4d6; --ink-mute:#6f7ca0;
  --line:#1d2742; --line-soft:#161f38;
  --glow-1: rgba(52,208,88,.13); --glow-2: rgba(34,211,238,.11);
  --sh-1: 0 1px 2px rgba(0,0,0,.5); --sh-2: 0 8px 22px rgba(0,0,0,.55); --sh-3: 0 18px 46px rgba(0,0,0,.65);
}
/* glassy translucent surfaces */
body[data-theme="arcade"] .card,
body[data-theme="arcade"] .stat,
body[data-theme="arcade"] .accordion,
body[data-theme="arcade"] .qa,
body[data-theme="arcade"] .spell-item,
body[data-theme="arcade"] .lb-row { background: rgba(255,255,255,.035); border-color: #1d2742; }
body[data-theme="arcade"] .sidebar { background: #0a1020; border-color: #1d2742; }
body[data-theme="arcade"] .topbar { background: color-mix(in srgb, #0a1020 82%, transparent); border-color: #1d2742; }
/* neon brand wordmark */
body[data-theme="arcade"] .brand-name .th { color: #34d058; text-shadow: 0 0 12px rgba(52,208,88,.6); }
/* glowing active nav + chips */
body[data-theme="arcade"] .nav-item.active { box-shadow: 0 0 16px rgba(52,208,88,.25), var(--sh-2); }
body[data-theme="arcade"] .grade-switch { background: #121a31; }
body[data-theme="arcade"] .lang-btn,
body[data-theme="arcade"] .theme-btn,
body[data-theme="arcade"] .acct-btn { background: #121a31; border-color: #243056; color: #aab4d6; }
body[data-theme="arcade"] .grade-switch button.active { background: #0e1530; }
/* neon progress, rings, meters, buttons */
body[data-theme="arcade"] .meter > span { box-shadow: 0 0 10px rgba(34,211,238,.55); }
body[data-theme="arcade"] .ring { box-shadow: 0 0 18px rgba(52,208,88,.30); }
body[data-theme="arcade"] .btn.primary,
body[data-theme="arcade"] .btn.brand { box-shadow: 0 0 16px rgba(52,208,88,.40); }
body[data-theme="arcade"] .card.hover:hover { box-shadow: 0 0 26px rgba(34,211,238,.18), var(--sh-3); }
/* avatar + leaderboard pop */
body[data-theme="arcade"] .side-ava .bt-avatar { box-shadow: 0 0 0 1px #2a356b, 0 0 14px rgba(34,211,238,.25); }
body[data-theme="arcade"] .lb-row.me { box-shadow: 0 0 0 1px #34d058, 0 0 16px rgba(52,208,88,.30); }
body[data-theme="arcade"] .badge-coin { box-shadow: 0 0 16px rgba(245,181,10,.45); }
/* subtle grid glow on the body backdrop already via --glow-1/2 */

/* ------------------------------------------------------------------ */
/* 2. RESET & BASE                                                     */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 110% -10%, var(--glow-1), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, var(--glow-2), transparent 55%),
    var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  transition: background .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: .35em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); background-clip: content-box; }

/* ------------------------------------------------------------------ */
/* 3. LAYOUT SHELL                                                     */
/* ------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand-logo { width: 46px; height: 46px; flex: none; display: block; }
.brand-name { font-size: 1.12rem; font-weight: 900; letter-spacing: -.02em; }
.brand-name .bk { color: var(--ink); }
.brand-name .th { color: var(--brand); }
.brand-sub  { font-size: .66rem; color: var(--ink-mute); font-weight: 700; text-transform: uppercase; letter-spacing: .2em; }

.nav-label { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); padding: 14px 12px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r);
  color: var(--ink-soft); font-weight: 700; font-size: .94rem;
  border: none; background: transparent; width: 100%; text-align: left;
  transition: background .15s, color .15s, transform .15s var(--ease);
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); transform: translateX(2px); }
.nav-item .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: none; background: var(--bg-2); }
.nav-item.active { color: #fff; }
.nav-item.active .ico { background: rgba(255,255,255,.22); }
.nav-item[data-accent="dash"].active { background: var(--grad-sky); box-shadow: var(--sh-2); }
.nav-item[data-accent="leesbegrip"].active      { background: var(--c-leesbegrip); }
.nav-item[data-accent="spelling"].active         { background: var(--c-spelling); }
.nav-item[data-accent="leesvaardigheid"].active  { background: var(--c-leesvaardigheid); }
.nav-item[data-accent="woordeskat"].active       { background: var(--c-woordeskat); }
.nav-item[data-accent="skryf"].active            { background: var(--c-skryf); }
.nav-item[data-accent="luisterpraat"].active     { background: var(--c-luisterpraat); }
.nav-item[data-accent="verslag"].active          { background: var(--c-verslag); }
.nav-item[data-accent="take"].active             { background: var(--c-take); }
.nav-badge { margin-left: auto; font-size: .68rem; font-weight: 800; background: var(--bg-2); color: var(--ink-mute); padding: 2px 8px; border-radius: var(--r-pill); }
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line); }

/* Main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.crumbs { font-weight: 800; font-size: 1.05rem; }
.crumbs small { display: block; font-weight: 700; font-size: .72rem; color: var(--ink-mute); letter-spacing: .04em; }

.grade-switch { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: var(--r-pill); margin-left: auto; }
.grade-switch button {
  border: none; background: transparent; padding: 7px 13px; border-radius: var(--r-pill);
  font-weight: 800; font-size: .85rem; color: var(--ink-soft); transition: all .15s var(--ease);
}
.grade-switch button.active { background: var(--surface); color: var(--brand-d); box-shadow: var(--sh-1); }

/* Topbar right cluster + language selector */
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-right .grade-switch { margin-left: 0; }
.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: .85rem; color: var(--ink-soft);
  transition: all .15s var(--ease); max-width: 190px;
}
.lang-btn:hover { background: var(--bg-2); transform: translateY(-1px); }
.lang-btn .globe { font-size: 16px; }
.lang-btn .cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-btn .caret { font-size: .6rem; opacity: .6; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 248px; max-height: min(72vh, 440px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3);
  padding: 6px; z-index: 60; display: none;
}
.lang-menu.open { display: block; animation: fade-up .18s var(--ease); }
.lang-menu .lang-head { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); padding: 8px 10px 6px; }
.lang-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; border: none; background: transparent;
  padding: 9px 11px; border-radius: var(--r-sm); text-align: left; font-weight: 700; color: var(--ink); transition: background .12s;
}
.lang-opt:hover { background: var(--bg-2); }
.lang-opt.active { background: var(--c-verslag-l); color: var(--c-verslag-d); }
.lang-opt .nm { display: flex; flex-direction: column; line-height: 1.25; }
.lang-opt .nm small { font-weight: 700; font-size: .7rem; color: var(--ink-mute); }
.lang-opt.active .nm small { color: var(--c-verslag-d); opacity: .8; }
.lang-opt .code { margin-left: auto; font-size: .62rem; font-weight: 800; text-transform: uppercase; color: var(--ink-mute); background: var(--bg-2); padding: 2px 7px; border-radius: var(--r-pill); }
.lang-opt .tick { margin-left: auto; color: var(--c-verslag-d); font-weight: 900; }
@media (max-width: 560px) { .lang-btn .cur { display: none; } .lang-btn { padding: 8px 10px; } }

/* Theme selector */
.theme-switch { position: relative; }
.theme-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: .85rem; color: var(--ink-soft);
  transition: all .15s var(--ease);
}
.theme-btn:hover { background: var(--bg-2); transform: translateY(-1px); }
.theme-btn .sw-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--grad-brand); box-shadow: 0 0 0 1px var(--line); flex: none; }
.theme-btn .caret { font-size: .6rem; opacity: .6; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 228px; max-height: min(72vh, 440px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3);
  padding: 6px; z-index: 60; display: none;
}
.theme-menu.open { display: block; animation: fade-up .18s var(--ease); }
.theme-menu .theme-head { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); padding: 8px 10px 6px; }
.theme-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; border: none; background: transparent;
  padding: 9px 11px; border-radius: var(--r-sm); text-align: left; font-weight: 700; color: var(--ink); transition: background .12s;
}
.theme-opt:hover { background: var(--bg-2); }
.theme-opt.active { background: var(--brand-l); color: var(--brand-d); }
.theme-opt .swatch { display: inline-flex; flex: none; border-radius: 7px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.theme-opt .swatch i { width: 13px; height: 24px; display: block; }
.theme-opt .nm { flex: 1; }
.theme-opt .tick { color: var(--brand-d); font-weight: 900; }
@media (max-width: 560px) { .theme-btn .lbl { display: none; } .theme-btn { padding: 8px 10px; } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 18px; display: grid; place-items: center;
  color: var(--ink-soft); transition: all .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-2); transform: translateY(-1px); }

.view { padding: 28px; max-width: var(--container); width: 100%; margin: 0 auto; animation: fade-up .4s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ */
/* 4. HERO / PAGE HEADERS                                              */
/* ------------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: 30px 34px; color: #fff;
  margin-bottom: 26px; box-shadow: var(--sh-2);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.14); filter: blur(4px);
}
.hero::before {
  content: ""; position: absolute; right: 90px; bottom: -90px;
  width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.10);
}
.hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .15em; position: relative; }
.hero p { font-size: 1.02rem; opacity: .95; max-width: 60ch; position: relative; margin: 0; }
.hero .hero-emoji { font-size: 2.6rem; position: relative; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; position: relative; flex-wrap: wrap; }
.hero-stat b { font-size: 1.5rem; display: block; }
.hero-stat span { font-size: .78rem; opacity: .9; font-weight: 700; }

.hero.dash { background: var(--grad-brand); }
.hero.leesbegrip      { background: linear-gradient(135deg, var(--c-leesbegrip) 0%, var(--c-leesbegrip-d) 100%); }
.hero.spelling        { background: linear-gradient(135deg, var(--c-spelling) 0%, var(--c-spelling-d) 100%); }
.hero.leesvaardigheid { background: linear-gradient(135deg, var(--c-leesvaardigheid) 0%, var(--c-leesvaardigheid-d) 100%); }
.hero.woordeskat      { background: linear-gradient(135deg, var(--c-woordeskat) 0%, var(--c-woordeskat-d) 100%); }
.hero.skryf           { background: linear-gradient(135deg, var(--c-skryf) 0%, var(--c-skryf-d) 100%); }
.hero.luisterpraat    { background: linear-gradient(135deg, var(--c-luisterpraat) 0%, var(--c-luisterpraat-d) 100%); }
.hero.verslag         { background: linear-gradient(135deg, var(--c-verslag) 0%, var(--c-verslag-d) 100%); }
.hero.take            { background: linear-gradient(135deg, var(--c-take) 0%, var(--c-take-d) 100%); }

.page-head { display: flex; align-items: flex-start; gap: 16px; }
.page-head .grow { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ */
/* 5. CARDS & GRIDS                                                    */
/* ------------------------------------------------------------------ */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.auto   { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.card.pad-sm { padding: 16px; }
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.card h3 { font-size: 1.15rem; }
.card .card-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; color: #fff; margin-bottom: 14px; box-shadow: var(--sh-1); }

/* Skill launcher tiles */
.skill-tile { cursor: pointer; position: relative; overflow: hidden; }
.skill-tile .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.skill-tile .meta { display: flex; gap: 14px; align-items: center; font-size: .8rem; color: var(--ink-mute); font-weight: 700; margin-top: 12px; }
.skill-tile .go { position: absolute; right: 18px; bottom: 18px; opacity: 0; transform: translateX(-6px); transition: all .2s var(--ease); font-weight: 800; }
.skill-tile.hover:hover .go { opacity: 1; transform: none; }

.bg-leesbegrip{background:var(--c-leesbegrip)} .bg-spelling{background:var(--c-spelling)}
.bg-leesvaardigheid{background:var(--c-leesvaardigheid)} .bg-woordeskat{background:var(--c-woordeskat)}
.bg-skryf{background:var(--c-skryf)} .bg-take{background:var(--c-take)}
.bg-luisterpraat{background:var(--c-luisterpraat)} .bg-verslag{background:var(--c-verslag)}
.text-leesbegrip{color:var(--c-leesbegrip-d)} .text-spelling{color:var(--c-spelling-d)}
.text-leesvaardigheid{color:var(--c-leesvaardigheid-d)} .text-woordeskat{color:var(--c-woordeskat-d)}
.text-skryf{color:var(--c-skryf-d)} .text-take{color:var(--c-take-d)}
.text-luisterpraat{color:var(--c-luisterpraat-d)} .text-verslag{color:var(--c-verslag-d)}

/* ------------------------------------------------------------------ */
/* 6. BUTTONS, PILLS, BADGES                                           */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 18px; border-radius: var(--r-pill); font-weight: 800; font-size: .9rem;
  transition: all .15s var(--ease); box-shadow: var(--sh-1);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad-brand); color: #fff; border-color: transparent; }
.btn.brand   { background: var(--grad-brand); color: #fff; border-color: transparent; }
.btn.ghost   { background: transparent; box-shadow: none; }
.btn.ok      { background: var(--ok); color: #fff; border-color: transparent; }
.btn.sm      { padding: 7px 13px; font-size: .82rem; }
.btn.block   { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill); font-size: .74rem; font-weight: 800; background: var(--bg-2); color: var(--ink-soft); }
.pill.ok   { background: var(--ok-l);   color: var(--ok); }
.pill.warn { background: var(--warn-l); color: var(--warn); }
.pill.bad  { background: var(--bad-l);  color: var(--bad); }
.pill.info { background: var(--info-l); color: var(--info); }
.tag { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: .72rem; font-weight: 800; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* CAPS-level badge colours (cognitive levels) */
.lvl { font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.lvl-1 { background: #dcfce7; color: #15803d; }   /* letterlik   */
.lvl-2 { background: #dbeafe; color: #1d4ed8; }   /* herorganiseer */
.lvl-3 { background: #fef3c7; color: #b45309; }   /* afleiding   */
.lvl-4 { background: #fae8ff; color: #a21caf; }   /* evaluering  */
.lvl-5 { background: #ffe4e6; color: #be123c; }   /* waardering  */
body.dark .lvl-1{background:#14532d;color:#bbf7d0}body.dark .lvl-2{background:#1e3a8a;color:#bfdbfe}
body.dark .lvl-3{background:#78350f;color:#fde68a}body.dark .lvl-4{background:#701a75;color:#f5d0fe}
body.dark .lvl-5{background:#881337;color:#fecdd3}

/* ------------------------------------------------------------------ */
/* 7. PROGRESS, METERS, STATS                                          */
/* ------------------------------------------------------------------ */
.meter { height: 12px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--grad-mint); transition: width .6s var(--ease); }
.meter.thin { height: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1); }
.stat .n { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; }
.stat .l { font-size: .76rem; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; }
.stat .ico { float: right; font-size: 22px; opacity: .85; }

.ring { --p: 0; --size: 116px; --c: var(--brand); width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p)*1%), var(--bg-2) 0); }
.ring::before { content: ""; position: absolute; width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 1.5rem; font-weight: 900; }
.ring small { position: relative; display: block; text-align: center; font-size: .66rem; color: var(--ink-mute); font-weight: 800; text-transform: uppercase; }
.ring-wrap { position: relative; display: grid; place-items: center; }

/* Streak / badges */
.badge-coin { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 35% 30%, #fff6d6, #f5b50a); box-shadow: 0 6px 16px rgba(245,181,10,.4); border: 3px solid #fff; }
.badge-coin.locked { background: var(--bg-2); filter: grayscale(1); opacity: .5; box-shadow: none; }

/* ------------------------------------------------------------------ */
/* 8. READING / TEXT BLOCKS                                            */
/* ------------------------------------------------------------------ */
.reading {
  font-family: var(--font-read); font-size: 1.06rem; line-height: 1.85; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-left: 6px solid var(--c-leesbegrip);
  border-radius: var(--r); padding: 24px 28px;
}
.reading.lined { background-image: linear-gradient(transparent 0, transparent calc(1.85em - 1px), var(--line-soft) calc(1.85em - 1px), var(--line-soft) 1.85em, transparent 1.85em); background-size: 100% 1.85em; }
.reading p:last-child { margin-bottom: 0; }
.reading .num { color: var(--ink-mute); font-size: .8rem; user-select: none; }
.reading.big { font-size: 1.22rem; }
.reading mark { background: #fff3a8; padding: 0 2px; border-radius: 3px; }

.glossary { display: grid; gap: 8px; }
.glossary .g-item { display: flex; gap: 10px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.glossary .g-word { font-weight: 800; color: var(--c-woordeskat-d); flex: none; min-width: 120px; }

/* Q&A comprehension */
.qa { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.qa + .qa { margin-top: 12px; }
.qa-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; }
.qa-num { width: 30px; height: 30px; border-radius: 9px; background: var(--c-leesbegrip-l); color: var(--c-leesbegrip-d); display: grid; place-items: center; font-weight: 900; flex: none; }
.qa-q { flex: 1; font-weight: 700; }
.qa-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.qa-ans { padding: 0 18px 18px 60px; }
.qa-ans .memo { background: var(--ok-l); border: 1px dashed var(--ok); border-radius: var(--r-sm); padding: 12px 14px; color: var(--ink); font-weight: 600; }
.qa-ans .memo b { color: var(--ok); }
.qa textarea { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-family: var(--font-read); font-size: .98rem; resize: vertical; background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------------------------ */
/* 9. FLASHCARDS (woordeskat)                                          */
/* ------------------------------------------------------------------ */
.flash-deck { display: grid; place-items: center; gap: 18px; }
.flash {
  width: min(440px, 100%); height: 250px; perspective: 1400px; cursor: pointer; user-select: none;
}
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-lg);
  display: grid; place-items: center; text-align: center; padding: 26px; box-shadow: var(--sh-2);
}
.flash-front { background: linear-gradient(135deg, var(--c-woordeskat) 0%, var(--c-woordeskat-d) 100%); color: #fff; }
.flash-back  { background: var(--surface); border: 2px solid var(--c-woordeskat); transform: rotateY(180deg); }
.flash-front .w { font-size: 2.1rem; font-weight: 900; }
.flash-front .hint { margin-top: 10px; font-size: .82rem; opacity: .85; font-weight: 700; }
.flash-back .t { font-size: 1.6rem; font-weight: 900; color: var(--c-woordeskat-d); }
.flash-back .s { margin-top: 12px; font-style: italic; color: var(--ink-soft); font-family: var(--font-read); }
.flash-controls { display: flex; gap: 10px; align-items: center; }
.flash-progress { font-weight: 800; color: var(--ink-mute); min-width: 70px; text-align: center; }

/* Match game */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-item { padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 700; text-align: center; transition: all .15s var(--ease); }
.match-item:hover { border-color: var(--c-woordeskat); }
.match-item.sel { border-color: var(--c-woordeskat); background: var(--c-woordeskat-l); }
.match-item.done { border-color: var(--ok); background: var(--ok-l); color: var(--ok); cursor: default; opacity: .8; }
.match-item.wrong { animation: shake .4s; border-color: var(--bad); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* ------------------------------------------------------------------ */
/* 10. SPELLING EXERCISES                                              */
/* ------------------------------------------------------------------ */
.rule-card { border-left: 5px solid var(--c-spelling); }
.rule-card .ex { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rule-card .ex span { background: var(--c-spelling-l); color: var(--c-spelling-d); padding: 4px 11px; border-radius: var(--r-pill); font-weight: 800; font-size: .85rem; }

.spell-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.spell-item + .spell-item { margin-top: 10px; }
.spell-item .prompt { font-size: 1.1rem; font-weight: 700; font-family: var(--font-read); flex: 1; min-width: 180px; }
.spell-blank { color: var(--c-spelling); font-weight: 800; letter-spacing: 1px; }
.spell-item input[type=text] { padding: 9px 13px; border: 2px solid var(--line); border-radius: var(--r-sm); font-family: var(--font); font-size: 1rem; font-weight: 700; width: 190px; background: var(--surface-2); color: var(--ink); text-align: center; }
.spell-item input.right { border-color: var(--ok); background: var(--ok-l); }
.spell-item input.wrong { border-color: var(--bad); background: var(--bad-l); }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 9px 16px; border: 2px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font-weight: 800; transition: all .12s var(--ease); }
.opt:hover { border-color: var(--c-spelling); }
.opt.right { border-color: var(--ok); background: var(--ok-l); color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-l); color: var(--bad); }

/* ------------------------------------------------------------------ */
/* 11. WRITING (skryfvermoë)                                           */
/* ------------------------------------------------------------------ */
.struct-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.struct-step:last-child { border-bottom: none; }
.struct-step .n { width: 32px; height: 32px; border-radius: 50%; background: var(--c-skryf); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.rubric { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rubric th, .rubric td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rubric th { background: var(--c-skryf-l); color: var(--c-skryf-d); font-weight: 800; }
.rubric td:last-child, .rubric th:last-child { text-align: center; width: 80px; }
.writer textarea { width: 100%; min-height: 280px; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; font-family: var(--font-read); font-size: 1.05rem; line-height: 1.8; resize: vertical; background: var(--surface-2); color: var(--ink); }
.writer-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.wordcount { font-weight: 800; }
.wordcount.under { color: var(--warn); } .wordcount.good { color: var(--ok); } .wordcount.over { color: var(--bad); }
.example-text { font-family: var(--font-read); background: var(--c-skryf-l); border-radius: var(--r); padding: 18px 22px; line-height: 1.8; }

/* ------------------------------------------------------------------ */
/* 12. WEEKLY TASKS                                                    */
/* ------------------------------------------------------------------ */
.term-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.term-tab { padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: .85rem; color: var(--ink-soft); }
.term-tab.active { background: var(--c-take); color: #fff; border-color: transparent; box-shadow: var(--sh-2); }

.week-card { border-left: 5px solid var(--c-take); }
.week-card .wk-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.week-no { background: var(--c-take); color: #fff; font-weight: 900; padding: 4px 12px; border-radius: var(--r-pill); font-size: .82rem; }

.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; font-size: 15px; color: transparent; background: var(--surface);
  transition: all .15s var(--ease); cursor: pointer;
}
.task-check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-row.done .task-txt { text-decoration: line-through; color: var(--ink-mute); }
.task-skill { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: var(--r-pill); flex: none; }
.task-time { margin-left: auto; font-size: .74rem; color: var(--ink-mute); font-weight: 700; flex: none; }

/* ------------------------------------------------------------------ */
/* 13. UTIL / MISC                                                     */
/* ------------------------------------------------------------------ */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--ink-mute); }
.soft  { color: var(--ink-soft); }
.center { text-align: center; }
.mt { margin-top: 18px; } .mt-sm { margin-top: 10px; } .mt-lg { margin-top: 28px; }
.mb { margin-bottom: 18px; } .nowrap { white-space: nowrap; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 900; margin: 30px 0 14px; }
.section-title .dot { width: 12px; height: 12px; border-radius: 4px; }
.hr { height: 1px; background: var(--line); border: none; margin: 22px 0; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--info-l); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.callout .ci { font-size: 22px; flex: none; }
.callout.tip { background: var(--c-leesvaardigheid-l); border-color: color-mix(in srgb, var(--c-leesvaardigheid) 35%, transparent); }
.callout.warn { background: var(--warn-l); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

.accordion { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.accordion + .accordion { margin-top: 10px; }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; font-weight: 800; cursor: pointer; }
.acc-head .caret { margin-left: auto; transition: transform .2s var(--ease); }
.accordion.open .caret { transform: rotate(90deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.accordion.open .acc-body { max-height: 4000px; }
.acc-body-inner { padding: 0 18px 18px; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-mute); }
.empty .e-emoji { font-size: 3rem; margin-bottom: 8px; }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-pill); font-weight: 800; box-shadow: var(--sh-3); animation: toast-in .3s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); } .toast.gold { background: linear-gradient(135deg,#f5b50a,#ef4444); }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1000; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; opacity: .9; animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(105vh) rotate(720deg); opacity: 1; } }

/* ------------------------------------------------------------------ */
/* 12b. LUISTER & PRAAT                                                */
/* ------------------------------------------------------------------ */
.lp-script {
  font-family: var(--font-read); font-size: 1.05rem; line-height: 1.85;
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 6px solid var(--c-luisterpraat); border-radius: var(--r); padding: 22px 26px;
}
.lp-script p:last-child { margin-bottom: 0; }
.tts-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.tts-btn { background: var(--c-luisterpraat); color: #fff; border: none; }
.tts-btn.speaking { background: var(--c-luisterpraat-d); }
.speak-card { border-left: 5px solid var(--c-luisterpraat); }
.pron-card { display: flex; gap: 14px; align-items: flex-start; }
.pron-key { width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--c-luisterpraat-l); color: var(--c-luisterpraat-d); display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; }
.phrase { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.phrase:last-child { border-bottom: none; }
.phrase .af { font-weight: 800; }
.phrase .en { color: var(--ink-mute); font-style: italic; text-align: right; }

/* ------------------------------------------------------------------ */
/* 12c. VERSLAG / REPORTING                                            */
/* ------------------------------------------------------------------ */
.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 800; font-size: .8rem; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: inherit; font-size: .96rem; background: var(--surface-2); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--c-verslag); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.rep-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rep-row:last-child { border-bottom: none; }
.rep-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; flex: none; color: #fff; }
.rep-ico.done { background: var(--ok); }
.rep-ico.miss { background: var(--bad-l); color: var(--bad); }
.rep-skill { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; padding: 2px 9px; border-radius: var(--r-pill); flex: none; }
.rep-txt { flex: 1; min-width: 0; }

.skillbar-row { display: flex; align-items: center; gap: 14px; margin: 9px 0; }
.skillbar-row .nm { width: 150px; font-weight: 700; font-size: .88rem; flex: none; }
.skillbar-row .meter { flex: 1; }
.skillbar-row .pc { width: 46px; text-align: right; font-weight: 800; font-size: .84rem; }

.email-box {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; font-family: var(--font-read); font-size: .9rem; white-space: pre-wrap;
  line-height: 1.7; max-height: 360px; overflow: auto;
}
.srv-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .82rem; }
.srv-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-mute); transition: all .2s var(--ease); }
.srv-dot.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-l); }
.srv-dot.off { background: var(--ink-mute); }
.week-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.week-pick .wp {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 800; font-size: .82rem; color: var(--ink-soft); display: grid; place-items: center; position: relative;
}
.week-pick .wp.active { background: var(--c-verslag); color: #fff; border-color: transparent; }
.week-pick .wp.complete::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.week-pick .wp.active.complete::after { background: #fff; }

/* ------------------------------------------------------------------ */
/* 12d. EXERCISE TABS (Normaal / Speel) + GAME ENGINE UI               */
/* ------------------------------------------------------------------ */
.ex-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--bg-2); padding: 5px; border-radius: 14px; }
.ex-tab { flex: 1; border: none; background: transparent; font-family: inherit; font-weight: 800; font-size: .95rem; padding: 11px; border-radius: 10px; color: var(--ink-soft); cursor: pointer; transition: all .15s var(--ease); display: flex; align-items: center; justify-content: center; gap: 7px; }
.ex-tab:hover { color: var(--ink); }
.ex-tab.active { color: #fff; box-shadow: var(--sh-1); }
.ex-tab.normaal.active { background: var(--c-leesbegrip); }
.ex-tab.speel.active { background: linear-gradient(135deg, var(--c-spelling), var(--c-skryf)); }
.ex-pane.hidden { display: none; }

.game-host { min-height: 60px; }
.g-empty { text-align: center; color: var(--ink-mute); padding: 30px; font-weight: 700; }

.g-chooser-title { font-weight: 900; font-size: 1.05rem; margin-bottom: 14px; text-align: center; }
.g-chooser-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.g-pick { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all .15s var(--ease); font-family: inherit; }
.g-pick:hover { transform: translateY(-3px); border-color: var(--c-spelling); box-shadow: var(--sh-2); }
.g-pick-emoji { font-size: 2.2rem; }
.g-pick-name { font-weight: 900; font-size: 1.05rem; color: var(--ink); }
.g-pick-desc { font-size: .8rem; color: var(--ink-mute); font-weight: 700; text-align: center; }

.g-hud { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.g-q { flex: 1; min-width: 180px; font-weight: 800; font-size: 1rem; }
.g-q b { color: var(--c-spelling-d); }
.g-lives { font-size: 1.05rem; letter-spacing: 2px; }
.g-score { font-weight: 900; color: var(--c-woordeskat-d); }

.g-stage { position: relative; border-radius: 16px; overflow: hidden; background: #0b1020; line-height: 0; box-shadow: var(--sh-2); }
.g-stage canvas { width: 100%; height: auto; display: block; touch-action: none; }
.g-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; background: rgba(7,11,28,.8); gap: 14px; padding: 22px; }
.g-overlay h2 { margin: 0; font-size: 1.6rem; font-weight: 900; color: #fff; }
.g-overlay p { margin: 0; opacity: .92; max-width: 42ch; font-size: .95rem; }
.g-btn { border: none; font-family: inherit; font-weight: 800; font-size: 1rem; color: #fff; padding: 12px 24px; border-radius: var(--r-pill); cursor: pointer; background: linear-gradient(135deg, var(--c-spelling), var(--c-skryf)); box-shadow: 0 8px 22px rgba(139,92,246,.4); transition: transform .15s var(--ease); }
.g-btn:hover { transform: translateY(-2px); }
.g-btn.ghost { background: rgba(255,255,255,.16); box-shadow: none; }
.g-ovbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.g-hint { text-align: center; color: var(--ink-mute); font-weight: 700; font-size: .8rem; margin-top: 10px; }

/* ------------------------------------------------------------------ */
/* 14. RESPONSIVE                                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .grid.cols-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--sh-3);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .menu-btn { display: grid; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .skillbar-row .nm { width: 110px; }
  .view { padding: 18px; }
  .topbar { padding: 12px 16px; }
  .grade-switch button { padding: 6px 10px; }
}
@media (max-width: 560px) {
  .hero { padding: 22px; }
  .match-grid { grid-template-columns: 1fr; }
  .grade-switch { gap: 2px; }
}

@media print {
  .sidebar, .topbar, .btn, .flash-controls { display: none !important; }
  .app { display: block; }
  .card { break-inside: avoid; box-shadow: none; }
}

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

/* ------------------------------------------------------------------ */
/* 15. ACCOUNTS — login gate, pupil picker, account menu              */
/* ------------------------------------------------------------------ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; overflow: auto;
  background:
    radial-gradient(1000px 500px at 110% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 480px at -10% 10%, var(--glow-2), transparent 55%),
    var(--bg);
}
.auth-box { width: 100%; max-width: 420px; }
.auth-box .auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.auth-box .auth-brand img { width: 46px; height: 46px; }
.auth-box .auth-brand .nm { font-size: 1.25rem; font-weight: 900; letter-spacing: -.02em; }
.auth-box .auth-brand .nm .th { color: var(--brand); }

.pupil-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.pupil-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; font-family: inherit; transition: all .15s var(--ease); }
.pupil-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--sh-2); }
.acct-ava { font-size: 1.05rem; } .acct-ava.big { font-size: 2.4rem; }

.acct-switch { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: .85rem; color: var(--ink-soft); transition: all .15s var(--ease); }
.acct-btn:hover { background: var(--bg-2); transform: translateY(-1px); }
.acct-btn .caret { font-size: .6rem; opacity: .6; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 232px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3); padding: 6px; z-index: 60; display: none; }
.acct-menu.open { display: block; animation: fade-up .18s var(--ease); }
.acct-head { font-size: .72rem; font-weight: 800; color: var(--ink-mute); padding: 8px 10px 4px; word-break: break-all; }
.acct-sub { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); padding: 10px 10px 4px; }
.acct-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: transparent; padding: 9px 11px; border-radius: var(--r-sm); text-align: left; font-weight: 700; color: var(--ink); transition: background .12s; }
.acct-opt:hover { background: var(--bg-2); }

.grade-locked { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); color: var(--brand-d); font-weight: 800; font-size: .85rem; padding: 7px 14px; border-radius: var(--r-pill); }
.week-card.locked-week { opacity: .6; }

/* ------------------------------------------------------------------ */
/* 16. AVATAR — builder + cosmetics                                   */
/* ------------------------------------------------------------------ */
.bt-avatar { display: block; }
.side-ava { width: 100%; border: none; background: transparent; cursor: pointer; padding: 4px 0 10px; display: flex; justify-content: center; }
.side-ava .bt-avatar { width: 60px; height: 60px; border-radius: 14px; box-shadow: var(--sh-1); border: 2px solid var(--surface); transition: transform .15s var(--ease); }
.side-ava:hover .bt-avatar { transform: translateY(-2px) scale(1.04); }

.avatar-build { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.avatar-preview { display: grid; place-items: center; position: sticky; top: 84px; }
.avatar-preview .bt-avatar { width: 200px; height: 200px; border-radius: 20px; }
.avatar-layers { display: grid; gap: 14px; min-width: 0; }
.layer-block h3 { font-size: 1.02rem; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.ava-opt { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 8px 6px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: inherit; transition: all .15s var(--ease); }
.ava-opt:hover { border-color: var(--brand); transform: translateY(-2px); }
.ava-opt.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.ava-opt .bt-avatar { width: 54px; height: 54px; border-radius: 10px; }
.ava-opt-nm { font-size: .72rem; font-weight: 800; color: var(--ink-soft); }
.ava-opt.locked { cursor: not-allowed; }
.ava-opt.locked .bt-avatar { filter: grayscale(.85) opacity(.5); }
.ava-lock { font-size: .6rem; font-weight: 800; color: var(--ink-mute); text-align: center; line-height: 1.15; }
@media (max-width: 720px) { .avatar-build { grid-template-columns: 1fr; } .avatar-preview { position: static; } }

/* ------------------------------------------------------------------ */
/* 17. LEADERBOARD                                                    */
/* ------------------------------------------------------------------ */
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--sh-1); }
.lb-row.me { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-l); }
.lb-rank { width: 38px; text-align: center; font-weight: 900; font-size: 1.02rem; flex: none; color: var(--ink-soft); }
.lb-rank.top { font-size: 1.4rem; }
.lb-ava { width: 40px; height: 40px; flex: none; }
.lb-ava .bt-avatar { width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--sh-1); }
.lb-nm { flex: 1; min-width: 0; font-size: .96rem; }
.lb-nm b { font-weight: 800; }
.lb-score { text-align: right; flex: none; }
.lb-score b { color: var(--brand-d); font-size: 1.02rem; }
.lb-score span { display: block; font-size: .72rem; }
