:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1a1d29;
  --muted: #5b6275;
  --primary: #1b6ef3;
  --eigen-auto: #1e88e5; /* eigen auto in de plaatjes; zelfde in licht en donker */
  --primary-text: #ffffff;
  --good: #1a8f4c;
  --bad: #d93a3a;
  --border: #dde1ec;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c;
    --surface: #1c2030;
    --text: #eef0f7;
    --muted: #9aa2b8;
    --primary: #5b9bff;
    --primary-text: #0b1020;
    --good: #43c47a;
    --bad: #ff6b6b;
    --border: #2d3350;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.4;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* ---------- Aanvullende tokens ---------- */
:root {
  --accent: #ffc21a;          /* geel van wegmarkering/borden */
  --road: #3b4050;            /* asfalt */
  --lane: #ffffff;
  --good-soft: #e3f6eb;
  --bad-soft: #fde8e8;
  --shadow: 0 2px 0 rgba(26, 29, 41, 0.12);
  --radius-lg: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ffcf4d;
    --road: #2a2f42;
    --lane: #cfd5e6;
    --good-soft: #163a27;
    --bad-soft: #43201f;
    --shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  }
}

body { -webkit-tap-highlight-color: transparent; }

.screen { display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--muted); margin: 8px 0 0; }

/* ---------- Knoppen ---------- */
.btn {
  font: inherit;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: default; }
.btn:focus-visible, .topic:focus-visible, .btn-icon:focus-visible, .num-input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:disabled { opacity: 0.45; }
.btn-outline { border-color: var(--border); background: transparent; }
.btn-outline:disabled { opacity: 0.45; }
.btn-icon {
  font: inherit; font-size: 1.2rem; font-weight: 700;
  width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}

/* Grote knop met een stippellijn als wegmarkering onderaan */
.btn-hero {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 84px;
  padding: 16px 20px 26px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: var(--primary-text);
  text-align: left;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 60%, #000);
  overflow: hidden;
}
.btn-hero::after {
  content: "";
  position: absolute; left: 20px; right: 20px; bottom: 10px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 22px, transparent 22px 36px);
  border-radius: 2px;
}
.hero-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.hero-sub { font-size: 0.95rem; font-weight: 500; opacity: 0.9; }

/* ---------- Home ---------- */
.stats { display: flex; justify-content: space-between; gap: 8px; }
.stat {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-streak:not(.is-on) { color: var(--muted); font-weight: 600; }
.stat-streak:not(.is-on) .stat-icon { filter: grayscale(1); opacity: 0.5; }

.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.topic {
  font: inherit; color: inherit; text-align: left;
  width: 100%; min-height: 60px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
}
.topic:active { transform: scale(0.98); }
.topic-emoji { font-size: 1.5rem; width: 32px; text-align: center; flex: none; }
.topic-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.topic-name { font-weight: 600; }
.topic-pct { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--good); border-radius: 4px; }
.btn-fouten { width: 100%; }

/* ---------- Vraag ---------- */
.q-head { display: flex; align-items: center; gap: 8px; margin: -8px -8px 0; }
.q-count { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3em; text-align: right; }
/* Voortgang als weg: asfalt met middenstreep, gereden stuk in blauw */
.road {
  position: relative; flex: 1; height: 14px;
  border-radius: 7px;
  background:
    repeating-linear-gradient(90deg, var(--lane) 0 10px, transparent 10px 20px) center / 100% 2px no-repeat,
    var(--road);
  overflow: hidden;
}
.road-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--primary);
  border-radius: 7px;
  transition: width 0.35s ease;
}

.q-body { display: flex; flex-direction: column; gap: 14px; }
.q-img {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  display: flex; justify-content: center;
}
.q-img svg { display: block; width: 100%; height: auto; max-height: 42vh; }
.q-img-bord svg { max-width: 200px; max-height: 28vh; }
.hint {
  margin: -6px 0 0; display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--muted); font-weight: 600;
}
.hint-car { width: 18px; height: 10px; border-radius: 3px; background: var(--eigen-auto); flex: none; }
.q-text { font-size: 1.25rem; line-height: 1.35; margin: 0; font-weight: 700; }

.answers { display: flex; flex-direction: column; gap: 10px; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-choice {
  width: 100%;
  border-color: var(--border);
  text-align: left;
  box-shadow: var(--shadow);
}
.btn-yesno, .btn-gevaar { text-align: center; font-size: 1.2rem; min-height: 60px; }
.btn-choice.is-correct, .num-input.is-correct {
  background: var(--good-soft); border-color: var(--good); color: var(--text);
}
.btn-choice.is-wrong, .num-input.is-wrong {
  background: var(--bad-soft); border-color: var(--bad); color: var(--text);
}
.btn-choice.is-correct::before { content: "✓ "; color: var(--good); }
.btn-choice.is-wrong::before { content: "✗ "; color: var(--bad); }
.btn-choice:disabled:not(.is-correct):not(.is-wrong) { opacity: 0.55; }

.num-form { display: flex; gap: 10px; align-items: stretch; }
.num-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.num-input {
  font: inherit; font-size: 1.4rem; font-weight: 800;
  width: 100%; min-width: 0; min-height: 56px;
  padding: 8px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.num-unit { font-weight: 700; color: var(--muted); white-space: nowrap; }

.timer { display: flex; align-items: center; gap: 10px; }
.timer-track { flex: 1; height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.timer-fill { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 5px; }
.timer-secs { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }

.order-help { margin: 0; color: var(--muted); font-size: 0.95rem; }
.btn-order { display: flex; align-items: center; gap: 12px; }
.order-badge {
  width: 32px; height: 32px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px dashed var(--border);
  font-weight: 800;
}
.btn-order.is-picked .order-badge { border: 0; background: var(--primary); color: var(--primary-text); }
.btn-order.is-correct::before, .btn-order.is-wrong::before { content: none; }
.btn-order.is-correct .order-badge { background: var(--good); color: #fff; }
.btn-order.is-wrong .order-badge { background: var(--bad); color: #fff; }

/* Feedback */
.feedback:empty { display: none; }
.feedback {
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 8px;
  animation: pop-in 0.22s ease-out;
}
.feedback.is-good { background: var(--good-soft); border-color: var(--good); }
.feedback.is-bad { background: var(--bad-soft); border-color: var(--bad); }
.feedback p { margin: 0; }
.fb-title { font-size: 1.4rem; font-weight: 800; }
.is-good .fb-title { color: var(--good); }
.is-bad .fb-title { color: var(--bad); }
.fb-report { font-size: 0.85rem; color: var(--muted); }
.fb-report summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; }
.fb-report p { padding-top: 4px; }
.btn-next { margin-top: 4px; width: 100%; }

@keyframes pop-in {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Resultaat ---------- */
.screen-result { text-align: center; padding-top: 16px; }
/* Score als blauw routebord met witte binnenrand */
.score-sign {
  align-self: center;
  display: inline-flex; align-items: baseline; justify-content: center;
  min-width: 200px;
  padding: 20px 28px;
  border-radius: 22px;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: inset 0 0 0 5px var(--primary), inset 0 0 0 9px var(--primary-text);
  font-variant-numeric: tabular-nums;
  animation: sign-up 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.score-sign.is-perfect {
  background: var(--good); color: #fff;
  box-shadow: inset 0 0 0 5px var(--good), inset 0 0 0 9px #fff;
}
.score-num { font-size: 5rem; font-weight: 900; line-height: 1; letter-spacing: -0.04em; }
.score-total { font-size: 2rem; font-weight: 800; opacity: 0.85; }
.cheer { font-size: 1.25rem; font-weight: 700; margin: 0; }
.result-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 6px 14px;
  border-radius: 999px; font-weight: 800;
  background: var(--surface); border: 1px solid var(--border);
}
.chip-xp { background: var(--accent); border-color: var(--accent); color: #1a1d29; }
.chip-streak:not(.is-on) { color: var(--muted); }
.result-actions { display: flex; flex-direction: column; gap: 10px; }
.result-actions .btn-hero { align-items: center; }
.missed { text-align: left; }
.missed-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.missed-list li {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--bad);
  border-radius: var(--radius); padding: 10px 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.missed-img { width: 64px; flex: none; }
.missed-img svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.missed-text { min-width: 0; }
.missed-list p { margin: 0; }
.missed-q { font-weight: 600; }
.missed-list .missed-a { color: var(--muted); margin-top: 4px; }
.missed-a strong { color: var(--good); }

@keyframes sign-up {
  from { transform: translateY(16px) scale(0.85); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Opfrisbeurt: levendiger kleuren, level-kaart, profielen, animaties
   ===================================================================== */
:root {
  --primary: #2563eb;
  --primary-2: #7c3aed;           /* tweede kleur voor verlopen */
  --hero-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --card-grad: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
  --pink: #e11d68;
  --shadow-card: 0 6px 20px -8px rgba(30, 41, 90, 0.25), 0 2px 0 rgba(26, 29, 41, 0.06);
  --font: "Segoe UI Rounded", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #6d9bff;
    --primary-2: #a78bfa;
    --hero-grad: linear-gradient(135deg, #3b6cf0 0%, #8b5cf6 100%);
    --card-grad: linear-gradient(135deg, #1e2a5e 0%, #3b1f6e 100%);
    --primary-text: #ffffff;
    --pink: #ff6b9d;
    --shadow-card: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
  }
}

body {
  background:
    radial-gradient(1200px 500px at 50% -200px, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
.muted { color: var(--muted); margin: 0; }
.btn-primary { background: var(--hero-grad); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary-2) 55%, #000); }
.btn-primary:disabled { box-shadow: none; }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }

/* ---------- Home: kop ---------- */
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-chip {
  font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 4px 14px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-card);
  touch-action: manipulation; min-width: 0;
}
.profile-chip:active { transform: scale(0.97); }
.profile-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: color-mix(in srgb, var(--accent) 35%, var(--surface));
}
.profile-hi { font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-caret { color: var(--muted); font-size: 0.8rem; }
.sound-toggle { background: var(--surface); border: 1px solid var(--border); }

/* ---------- Home: level-kaart ---------- */
.level-card {
  position: relative; overflow: hidden;
  background: var(--card-grad); color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 10px;
}
.level-card::before { /* zachte glans */
  content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08);
}
.level-row { display: flex; align-items: center; gap: 12px; position: relative; }
.level-emoji {
  width: 56px; height: 56px; flex: none; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; background: rgba(255, 255, 255, 0.14);
  animation: float 3s ease-in-out infinite;
}
.level-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.level-kicker { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; }
.level-name { font-size: 1.35rem; font-weight: 900; line-height: 1.1; }
.level-xp { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.level-next { margin: 0; font-size: 0.9rem; font-weight: 600; opacity: 0.9; }
.level-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); font-weight: 800; font-size: 0.9rem;
}
.pill-streak:not(.is-on) { opacity: 0.75; }
.pill-streak:not(.is-on) .pill-icon { filter: grayscale(1); }
.pill-streak.is-on .pill-icon { animation: flicker 1.6s ease-in-out infinite; display: inline-block; }
.pill-today.is-done { background: rgba(67, 196, 122, 0.35); }

.xpbar { display: block; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.xpbar-fill {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #ff9f1a);
  box-shadow: 0 0 12px rgba(255, 194, 26, 0.6);
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Home: hero en onderwerpen ---------- */
.btn-hero { background: var(--hero-grad); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--primary-2) 50%, #000); }
.btn-hero:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--primary-2) 50%, #000); }
.screen-home .btn-hero .hero-title::after { content: " 🚗"; display: inline-block; animation: drive 2.4s ease-in-out infinite; }

.btn-fouten {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: color-mix(in srgb, var(--pink) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--pink) 45%, transparent);
}
.badge {
  min-width: 26px; height: 26px; padding: 0 8px; margin-left: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px; background: var(--pink); color: #fff; font-size: 0.85rem; font-weight: 900;
}

.topics { gap: 10px; }
.topic { box-shadow: var(--shadow-card); transition: transform 0.1s ease; }
.topic-emoji {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--tint, 210) 90% 92%);
}
.meter-fill { background: hsl(var(--tint, 150) 70% 42%); transition: width 0.6s ease; }
.topic.is-done { border-color: color-mix(in srgb, var(--accent) 80%, transparent); }
.topic.is-done .topic-pct { font-size: 1.3rem; }
@media (prefers-color-scheme: dark) {
  .topic-emoji { background: hsl(var(--tint, 210) 45% 24%); }
  .meter-fill { background: hsl(var(--tint, 150) 70% 58%); }
}

/* ---------- Vraag ---------- */
.q-combo {
  font-weight: 900; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, #ff8a1f 18%, var(--surface)); color: #c2410c;
  animation: pop-in 0.3s ease-out;
}
@media (prefers-color-scheme: dark) { .q-combo { color: #ffb067; } }
.road-fill { background: var(--hero-grad); }
.q-img { box-shadow: var(--shadow-card); }
.btn-choice.is-correct { animation: correct-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.fx-shake { animation: shake 0.4s ease; }
.fb-combo { font-weight: 900; font-size: 1.1rem; color: #c2410c; animation: pop-in 0.35s ease-out; }
@media (prefers-color-scheme: dark) { .fb-combo { color: #ffb067; } }
.feedback.is-good .fb-title { animation: correct-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); align-self: flex-start; }

/* ---------- Resultaat ---------- */
.score-sign { background: var(--hero-grad); color: #fff; box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 9px rgba(255, 255, 255, 0.9), var(--shadow-card); }
.score-sign.is-perfect { background: linear-gradient(135deg, #16a34a, #0d9488); box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 9px #fff, var(--shadow-card); }
.result-level {
  background: var(--card-grad); color: #fff;
  border-radius: var(--radius-lg); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  box-shadow: var(--shadow-card);
}
.result-level .muted { color: rgba(255, 255, 255, 0.8); }
.result-level-row { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.levelup {
  margin: 0; display: flex; align-items: center; gap: 12px;
  font-size: 1.05rem; animation: sign-up 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.levelup strong { display: block; font-size: 1.3rem; color: var(--accent); }
.levelup-emoji { font-size: 2.6rem; animation: float 2s ease-in-out infinite; }

/* ---------- Profielen ---------- */
.sub-head { display: flex; align-items: center; gap: 8px; margin: -8px -8px 0; }
.sub-title { font-size: 1.4rem; margin: 0; font-weight: 900; }
.prof-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.prof-row { display: flex; align-items: center; gap: 6px; }
.prof-pick {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  flex: 1; min-width: 0; min-height: 68px;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); touch-action: manipulation;
}
.prof-pick:active { transform: scale(0.98); }
.prof-pick.is-active { border-color: var(--primary); }
.prof-avatar {
  font-size: 2rem; width: 48px; height: 48px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, var(--surface));
}
.prof-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.prof-naam { font-weight: 800; font-size: 1.1rem; }
.prof-sub { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.prof-check { color: var(--primary); font-weight: 900; font-size: 1.3rem; }
.prof-form { display: flex; flex-direction: column; gap: 14px; }
.field-label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; margin: 0; }
.text-input {
  font: inherit; font-size: 1.2rem; font-weight: 700;
  min-height: 52px; padding: 8px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.text-input:focus-visible, .avatar-pick:focus-visible, .profile-chip:focus-visible, .prof-pick:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avatar-pick {
  font-size: 1.8rem; aspect-ratio: 1; min-height: 52px; cursor: pointer;
  border: 2px solid var(--border); border-radius: 16px; background: var(--surface);
  touch-action: manipulation; transition: transform 0.1s ease;
}
.avatar-pick.is-picked { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, var(--surface)); transform: scale(1.06); }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -20px; display: block;
  animation: confetti-fall 2.4s cubic-bezier(0.3, 0.6, 0.6, 1) forwards;
}

/* ---------- Keyframes ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(-6deg); } }
@keyframes drive { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@keyframes correct-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* ---------- Proefexamen ---------- */
.btn-exam {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  border-color: var(--border); box-shadow: var(--shadow-card);
}
.exam-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px; font-size: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary-2) 15%, var(--surface));
}
.exam-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exam-name { font-weight: 800; }
.exam-sub { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.exam-best { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--primary); }
.q-clock {
  font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.q-clock.is-low { color: var(--bad); border-color: var(--bad); }
.btn-choice.is-picked:not(.btn-order) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.score-sign.is-zakt { background: linear-gradient(135deg, #64748b, #475569); }
.exam-verdict {
  border-radius: var(--radius-lg); padding: 14px 16px; border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 6px; text-align: left;
}
.exam-verdict p { margin: 0; }
.exam-verdict.is-pass { background: var(--good-soft); border-color: var(--good); }
.exam-verdict.is-fail { background: var(--bad-soft); border-color: var(--bad); }
.exam-title { font-size: 1.4rem; font-weight: 900; }
.is-pass .exam-title { color: var(--good); }
.is-fail .exam-title { color: var(--bad); }

/* ---------- Badges ---------- */
.badges { display: flex; flex-direction: column; gap: 8px; }
.badge-strip {
  list-style: none; margin: 0 -16px; padding: 4px 16px 8px;
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.badge-strip::-webkit-scrollbar { display: none; }
.badge-mini {
  font: inherit; color: inherit; cursor: pointer; touch-action: manipulation;
  width: 84px; min-height: 92px; flex: none; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 4px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.badge-mini:not(.is-on) { opacity: 0.55; }
.badge-mini.is-on { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: var(--shadow-card); }
.badge-mini:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.badge-mini .badge-emoji { font-size: 1.8rem; }
.badge-label { font-size: 0.72rem; font-weight: 800; text-align: center; line-height: 1.15; }
.badge-info { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--muted); min-height: 1.3em; }
.new-badges { text-align: left; }
.badge-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.badge-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-lg); background: var(--surface);
  border: 2px solid var(--accent); box-shadow: var(--shadow-card);
  animation: sign-up 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.badge-card .badge-emoji { font-size: 2.2rem; }
.badge-text { display: flex; flex-direction: column; }
.badge-text span { color: var(--muted); font-size: 0.9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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