/* Slimmert — schriftpapier, inktranden, harde schaduwen. Mobiel eerst. */

:root {
  --paper: #f6f1e4;
  --ink: #1d2a4a;
  --mint: #2fb9a0;
  --coral: #ff6b4a;
  --sun: #ffd23f;
  --sky: #7cc6f2;
  --lilac: #b59df0;
  --white: #fffdf7;
  --mint-soft: #d5f3ec;
  --coral-soft: #ffe0d8;
  --line: rgba(29, 42, 74, 0.09);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --head: 'Bricolage Grotesque', 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  --body: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, var(--line) 27px 28px);
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.1; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); }
h2 { font-size: 1.35rem; margin-top: 1.6rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .6rem; }
a { color: inherit; }
img, svg { max-width: 100%; }

:focus-visible {
  outline: 4px solid var(--sun);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--ink);
  border-radius: 6px;
}

[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--sun); padding: 8px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .85rem; opacity: .85; }
.center { text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }

/* ---------- Kop ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.logo {
  font-family: var(--head); font-weight: 800; font-size: 1.6rem;
  text-decoration: none; margin-right: auto; letter-spacing: -.02em;
}
.logo-dot { color: var(--coral); }
.back { order: -1; }
.stats { display: flex; gap: 6px; }
.stat {
  border: 2px solid var(--ink); border-radius: 999px; background: var(--white);
  padding: 2px 10px; font-weight: 700; font-size: .9rem; white-space: nowrap;
}

main {
  max-width: 920px; margin: 0 auto; padding: 16px 16px 64px;
  outline: none;
}

/* ---------- Kaarten & knoppen ---------- */
.card {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px;
  font: 700 1rem var(--body); color: var(--ink); text-decoration: none;
  background: var(--white);
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
  touch-action: manipulation;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--mint); }
.btn-good { background: var(--mint); }
.btn-bad { background: var(--coral); }
.btn-small { min-height: 44px; padding: 6px 12px; font-size: .9rem; }

.btn-speak {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  background: var(--sun); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer; vertical-align: middle; margin-left: 6px;
}
.btn-speak svg { width: 24px; height: 24px; }

.pill {
  display: inline-block; margin-left: 8px; padding: 0 8px;
  background: var(--coral); border: 2px solid var(--ink); border-radius: 999px;
  font: 700 .8rem var(--body); vertical-align: middle;
}
.pill.good { background: var(--mint); }

/* ---------- Startscherm ---------- */
.hero { background: var(--sun); }
.lead { font-size: 1rem; max-width: 60ch; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.big-stat {
  background: var(--white); border: 2px solid var(--ink); border-radius: 12px;
  padding: 8px; text-align: center; display: flex; flex-direction: column;
}
.big-stat strong { font-family: var(--head); font-size: 1.8rem; line-height: 1; }
.big-stat span { font-size: .8rem; }

.theme-grid, .tile-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) {
  .theme-grid, .tile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 880px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
}

.theme-card {
  display: flex; gap: 14px; align-items: center; text-decoration: none; margin: 0;
  border-left: 12px solid var(--accent, var(--mint));
}
.theme-icon .pic, .tile-icon .pic { width: 56px; height: 56px; display: block; }
.theme-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.theme-body strong { font-family: var(--head); font-size: 1.2rem; }
.bar { display: block; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--mint); }

.tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; margin: 0; min-height: 120px; }
.tile-title { font-family: var(--head); font-size: 1.2rem; }
.tile:hover, .theme-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.tile, .theme-card { transition: transform .1s, box-shadow .1s; }
.c-mint { background: var(--mint-soft); }
.c-coral { background: var(--coral-soft); }
.c-sun { background: #fff3c4; }
.c-sky { background: #e1f2fc; }
.c-lilac { background: #ece5fc; }

.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge {
  border: 2px dashed var(--ink); border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 2px; opacity: .55; background: var(--white);
}
.badge.earned { opacity: 1; border-style: solid; background: #fff3c4; box-shadow: var(--shadow-sm); }
.badge-medal { font-size: 1.6rem; }

.reset { margin-top: 28px; }
.warn { background: #fff3c4; }

/* ---------- Pagina's & rondes ---------- */
.page-head { margin-bottom: 14px; }
.page-head h1 { outline: none; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  min-height: 44px; padding: 6px 14px; font: 700 .9rem var(--body); color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); border-radius: 999px; cursor: pointer;
}
.tab.active { background: var(--ink); color: var(--paper); }

.tips { background: var(--white); border: 2px solid var(--ink); border-radius: 12px; padding: 0 14px; margin-bottom: 16px; }
.tips summary { cursor: pointer; font-weight: 700; padding: 12px 0; min-height: 44px; }
.tips ul { margin: 0 0 12px; padding-left: 20px; }
.tips li { margin-bottom: 6px; }

.round-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.counter { margin: 0; font-weight: 700; font-size: .9rem; }
.progress { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--mint); transition: width .3s; }

.question { position: relative; }
.q-label {
  display: inline-block; margin: 0 0 10px; padding: 2px 10px;
  background: var(--sun); border: 2px solid var(--ink); border-radius: 999px;
  font-size: .8rem; font-weight: 700;
}
.q-prompt { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.q-pic .pic { width: 130px; height: 130px; }
.q-pic { display: flex; align-items: center; gap: 8px; }
.q-clock .clock { width: min(240px, 70vw); height: auto; }
.q-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; }
.q-text { font-size: 1.15rem; margin: 0; }
.q-hint { font-size: .9rem; opacity: .8; }
.big-number { font-family: var(--head); font-size: 4rem; line-height: 1; margin: 6px 0; }
.gap { display: inline-block; min-width: 4ch; border-bottom: 3px solid var(--coral); color: transparent; }

.answer-row { display: flex; gap: 8px; margin-top: 16px; }
.answer {
  flex: 1; min-width: 0; min-height: 52px; padding: 10px 14px;
  font: 400 18px var(--body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px;
}
.answer.is-good { background: var(--mint-soft); border-color: var(--mint); }
.answer.is-bad { background: var(--coral-soft); border-color: var(--coral); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.choice { min-height: 56px; font-size: 1.05rem; white-space: normal; text-align: center; }
.choice.is-good, .is-good > .line-btn { background: var(--mint); }
.choice.is-bad { background: var(--coral); }

.feedback {
  margin-top: 16px; padding: 14px; border: 2px solid var(--ink); border-radius: 12px;
  animation: pop .25s ease-out;
}
.feedback.good { background: var(--mint-soft); border-left: 10px solid var(--mint); }
.feedback.bad { background: var(--coral-soft); border-left: 10px solid var(--coral); }
.fb-title { font-family: var(--head); font-size: 1.4rem; margin-bottom: 6px; }
.fb-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 1.1rem; }
.fb-label { min-width: 4.5ch; font-weight: 700; }
.fb-tip { font-weight: 700; }
.fb-explain { font-size: .95rem; }
.diff { font-family: var(--body); letter-spacing: .04em; overflow-wrap: anywhere; }
.d-bad { color: #b3261e; text-decoration: line-through; text-decoration-thickness: 2px; background: #ffc9bd; }
.d-miss { background: var(--sun); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; }
.btn-next { margin-top: 12px; width: 100%; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* Flitskaart */
.flash { perspective: 900px; margin: 14px auto 0; max-width: 360px; cursor: pointer; }
.flash-inner { position: relative; min-height: 210px; transition: transform .5s; transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border: 2px solid var(--ink); border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--sun);
}
.flash-front .pic { width: 100px; height: 100px; }
.flash-back { background: var(--mint-soft); transform: rotateY(180deg); }
.flash-word { font-family: var(--head); font-size: 1.8rem; margin: 0; text-align: center; overflow-wrap: anywhere; }
.flash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.flash-actions .btn:only-child { grid-column: 1 / -1; }

/* Einde ronde */
.end { text-align: center; }
.end-score { font-family: var(--head); font-size: 3.6rem; line-height: 1; margin: 8px 0; }
.end-score.pass { color: #16806d; }
.end-score.fail { color: #c2412a; }
.end-msg { font-size: 1.15rem; font-weight: 700; }
.end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.mistake-list { text-align: left; padding-left: 20px; }
.mistake-list li { margin-bottom: 8px; overflow-wrap: anywhere; }

/* ---------- Outfit ---------- */
.outfit-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.outfit-layout > * { min-width: 0; }
@media (min-width: 760px) { .outfit-layout { grid-template-columns: 300px 1fr; align-items: start; } }
.doll-wrap { display: flex; justify-content: center; background: #e1f2fc; }
.doll { width: min(260px, 70vw); height: auto; }
@media (max-width: 759px) { .doll { width: min(200px, 55vw); } }
.closet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.closet-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 92px; padding: 6px; font: 700 .75rem var(--body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; cursor: pointer;
}
.closet-item .pic { width: 48px; height: 48px; }
.closet-item.on { background: var(--mint); }
.closet-item.locked { border-style: dashed; opacity: .5; justify-content: center; cursor: default; }
.lock { font-family: var(--head); font-size: 1.6rem; }

/* ---------- Klok ---------- */
.set-clock { display: flex; justify-content: center; }
.set-clock .clock { width: min(260px, 75vw); height: auto; touch-action: none; cursor: grab; }
.readout { text-align: center; font-weight: 700; margin-top: 8px; }
.clock-controls { display: grid; gap: 8px; max-width: 340px; margin: 0 auto; }
.ctrl-row { display: grid; grid-template-columns: 1fr 64px 64px; gap: 8px; align-items: center; }
.mini-clock { display: block; margin-top: 8px; }
.mini-clock .clock { width: 120px; height: 120px; }

/* ---------- Meervoud ---------- */
.chip-row { display: flex; justify-content: center; margin: 10px 0; }
.word-chip {
  font-family: var(--head); font-size: 1.8rem; padding: 6px 18px;
  background: var(--sun); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm); cursor: grab;
}
.bins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .bins { grid-template-columns: repeat(5, 1fr); } }
.bins .bin:last-child { grid-column: 1 / -1; }
@media (min-width: 600px) { .bins .bin:last-child { grid-column: auto; } }
.bin {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 96px; padding: 10px 6px; font: 400 .85rem var(--body); color: var(--ink);
  background: var(--paper); border: 2px dashed var(--ink); border-radius: 12px; cursor: pointer;
}
.bin strong { font-family: var(--head); font-size: 1.3rem; }
.bin.over { background: #fff3c4; }
.bin.is-good { background: var(--mint-soft); border-style: solid; }
.bin.is-bad { background: var(--coral-soft); border-style: solid; }
.bin:disabled { cursor: default; color: var(--ink); }
.bin-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.bin-word { background: var(--white); border: 1px solid var(--ink); border-radius: 6px; padding: 0 5px; font-size: .75rem; }
.bin-word.new { background: var(--sun); }

/* ---------- Blokjes (zinsbouwer, vertalen) ---------- */
.blocks { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 12px; min-height: 64px; }
.blocks.built { background: var(--paper); border: 2px dashed var(--ink); margin: 10px 0; }
.blocks.pool { justify-content: center; }
.block {
  min-height: 44px; padding: 6px 12px; font: 700 1rem var(--body); color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.block.suffix { background: var(--sun); }
.placeholder { opacity: .6; font-size: .9rem; align-self: center; }
.built-preview { font-family: var(--head); font-size: 1.2rem; min-height: 1.5em; text-align: center; }

.scene-wrap { width: 100%; }
.scene { width: 100%; height: auto; border: 2px solid var(--ink); border-radius: 12px; display: block; }

/* ---------- Uitdrukkingen ---------- */
.stack { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.stack.built { counter-reset: line; min-height: 56px; border: 2px dashed var(--ink); border-radius: 12px; padding: 8px; background: var(--paper); }
.stack.built li { counter-increment: line; display: flex; gap: 8px; align-items: center; border-radius: 10px; }
.stack.built li::before { content: counter(line); font-family: var(--head); min-width: 1.4em; text-align: center; }
.stack.built li.is-bad .line-btn { background: var(--coral); }
.line-btn {
  width: 100%; min-height: 48px; padding: 8px 12px; text-align: left;
  font: 400 .95rem var(--body); color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); border-radius: 10px; cursor: pointer;
}
.line-btn.placed { background: var(--mint-soft); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-btn {
  min-height: 56px; padding: 8px; font: 400 .85rem var(--body); color: var(--ink); text-align: left;
  background: var(--white); border: 2px solid var(--ink); border-radius: 10px; cursor: pointer; overflow-wrap: anywhere;
}
.match-btn.selected { background: var(--sun); box-shadow: var(--shadow-sm); }
.match-btn.is-good { background: var(--mint); }
.match-btn.is-bad { background: var(--coral); }

/* ---------- Schrijven ---------- */
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: .85rem; }
.chip.used { background: var(--mint); font-weight: 700; }
.writing {
  width: 100%; min-height: 160px; padding: 12px; font: 400 17px/1.6 var(--body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; resize: vertical;
}
.write-status { margin-top: 10px; }
.write-status p { margin: 2px 0; }
.write-status .ok { color: #16806d; font-weight: 700; }
.warn-line { background: #fff3c4; border-radius: 8px; padding: 4px 8px; }
.write-preview { font-size: 1.05rem; line-height: 1.7; }
.write-preview mark, .example mark { background: var(--mint); color: var(--ink); border-radius: 4px; padding: 0 2px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 150%);
  max-width: calc(100vw - 32px); padding: 12px 18px; z-index: 20;
  background: var(--ink); color: var(--paper); border-radius: 12px; font-weight: 700;
  transition: transform .25s; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); }

@media (max-width: 400px) {
  .card { padding: 14px; }
  .logo { font-size: 1.35rem; }
  .stat { padding: 2px 7px; font-size: .8rem; }
  .match { grid-template-columns: 1fr; }
}

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