/* Stijl: Vrolijk plat. Zie de stijlgids in het werkdocument. */
:root {
  --font: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --fw: 600;
  --ink: #22223a; --wool: #ffffff; --dark: #3a3350; --white: #ffffff;
  --ye: #ffc93c; --or: #ff7a45; --pk: #ff5d8f; --gr: #3cc76a; --br: #9a5b34; --ow: #7a5cff; --lt: #ece6ff;
  --surface: #ffffff; --text-k: #22223a; --btn: #ffc93c; --btn-text: #22223a; --ok: #3cc76a; --muted: #5d5b75;
  --sky-home: #8fdcff;
  --sky-farm: #8fdcff; --ground-farm: #6ed36a;
  --sky-space: #2b2f77; --ground-space: #4144a8;
  --sky-sea: #49c0f5; --ground-sea: #1f7fd1;
  --r: 26px; --r-btn: 999px; --bd: 4px solid var(--ink); --sh: 0 5px 0 var(--ink); --olw: 7;
  color-scheme: light;
}

html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); background: var(--sky-home); color: var(--text-k);
  overscroll-behavior: none; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
button, input, label { font-family: inherit; }

.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px))
           calc(18px + env(safe-area-inset-bottom, 0px)) calc(18px + env(safe-area-inset-left, 0px));
  background: linear-gradient(to bottom, var(--sky) 0 64%, var(--ground) 64% 100%);
}
.screen[data-world="home"], .screen[data-world="ouders"] { --sky: var(--sky-home); --ground: var(--sky-home); }
.screen[data-world="farm"] { --sky: var(--sky-farm); --ground: var(--ground-farm); }
.screen[data-world="space"] { --sky: var(--sky-space); --ground: var(--ground-space); }
.screen[data-world="sea"] { --sky: var(--sky-sea); --ground: var(--ground-sea); }
.screen[data-world="space"]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.8;
  background-image: radial-gradient(circle, #fff 1.2px, transparent 1.8px), radial-gradient(circle, #fff 1px, transparent 1.6px);
  background-size: 90px 70px, 53px 61px; background-position: 10px 12px, 37px 29px;
}

/* knoppen en vlakken */
.k-btn {
  font: var(--fw) 20px var(--font); color: var(--btn-text); background: var(--btn); border: var(--bd);
  border-radius: var(--r-btn); box-shadow: var(--sh); padding: 8px 18px; cursor: pointer; min-height: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.12s ease;
  position: relative; overflow: hidden; isolation: isolate;
}
.k-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.k-btn:focus-visible, .item:focus-visible, .card:focus-visible, .pic:focus-visible, .letter:focus-visible { outline: 4px solid var(--ow); outline-offset: 3px; }
.k-btn.ghost { background: var(--surface); color: var(--text-k); }
.k-btn.small { font-size: 17px; min-height: 44px; }
.k-btn svg { width: 24px; height: 24px; flex: none; }
.surface { background: var(--surface); border: var(--bd); border-radius: var(--r); box-shadow: var(--sh); }

/* bovenbalk */
.bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 52px; }
.bar .where { font-size: 24px; font-weight: var(--fw); background: var(--surface); padding: 4px 16px; border-radius: var(--r-btn); border: var(--bd); }
.bar .grow { flex: 1; }
.stickers { font-size: 22px; padding: 4px 16px 4px 8px; }
.stickers svg { width: 32px; height: 32px; }
.lock .fill { position: absolute; left: 0; bottom: 0; height: 100%; width: 0; background: var(--lt); z-index: -1; }
.lock.holding .fill { width: 100%; transition: width 2s linear; }

/* Olli */
.talk { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; }
.owl { width: 84px; flex: none; }
.bubble { margin: 0; font-size: 26px; line-height: 1.2; padding: 10px 18px; max-width: 34ch; text-wrap: balance; }
.stage { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* kaarten (werelden, spellen) */
.cards { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; align-content: center; }
.card { font: var(--fw) 28px var(--font); color: var(--text-k); cursor: pointer; display: grid; justify-items: center; gap: 4px; padding: 14px 10px 16px; }
.card .art { width: min(130px, 70%); }
.card .big { font-size: 58px; line-height: 1; letter-spacing: 0.06em; }
.card small { font-size: 17px; color: var(--muted); }
.card[data-world="farm"] { background: linear-gradient(var(--surface) 62%, #c9efc4 62%); }
.card[data-world="space"] { background: linear-gradient(var(--surface) 62%, #d3d4f3 62%); }
.card[data-world="sea"] { background: linear-gradient(var(--surface) 62%, #c4e3f8 62%); }
.levelstars { display: flex; gap: 4px; }
.levelstars svg { width: 26px; height: 26px; }
.levelstars .off { opacity: 0.25; }

/* tellen */
.field { position: relative; flex: 1; min-height: 200px; }
.item { position: absolute; width: clamp(56px, 14%, 116px); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; }
.item .art { width: 100%; height: 100%; display: block; }
.item.hop { animation: hop 0.4s ease; }
.item .num {
  position: absolute; top: -8px; right: -6px; min-width: 38px; height: 38px; display: grid; place-items: center;
  font: var(--fw) 24px var(--font); color: var(--text-k); background: var(--surface); border: var(--bd); border-radius: 50%; box-shadow: var(--sh);
}
.item .num:empty { display: none; }
@keyframes hop { 40% { transform: translateY(-14px) scale(1.06); } }
.answers { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.answers .num-btn { font-size: 40px; width: 84px; height: 84px; padding: 0; border-radius: 50%; }
.answers .wide { font-size: 26px; padding: 12px 28px; }
.k-btn.nope, .pic.nope { animation: nope 0.4s ease; opacity: 0.45; }
.k-btn.yes { background: var(--ok); }
@keyframes nope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* klanken */
.klank { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.letter { font: var(--fw) 100px/1 var(--font); width: 150px; height: 172px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--text-k); cursor: pointer; }
.letter span { font-size: 18px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.letter svg { width: 22px; height: 22px; }
.pics { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 210px)); justify-content: center; gap: 14px; }
.pic { font: var(--fw) 22px var(--font); color: var(--text-k); cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 10px 6px 12px; }
.pic .art { width: min(110px, 90%); }
.pic.yes { background: #c9f0d4; }

/* stickerboek */
.book { flex: 1; overflow: auto; padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; align-content: start; }
.book .slot { display: grid; justify-items: center; gap: 4px; font-size: 22px; }
.book .slot .art { width: 90px; }
.book .slot.empty { opacity: 0.25; }

/* ouderhoek: rustiger, kleiner lettertype */
.panel { flex: 1; overflow: auto; padding: 20px 22px; font-weight: 500; font-size: 17px; line-height: 1.45; user-select: text; -webkit-user-select: text; }
.panel h2 { margin: 0 0 4px; font-size: 28px; }
.panel h3 { margin: 22px 0 8px; font-size: 20px; }
.panel p { margin: 0 0 8px; max-width: 65ch; }
.panel .muted { color: var(--muted); }
.panel .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.panel th, .panel td { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e6e4f0; }
.panel th { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.panel .tablewrap { overflow-x: auto; }
.panel label.check { display: inline-flex; gap: 10px; align-items: center; font-size: 18px; cursor: pointer; }
.panel input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--ow); }
.panel .note { font-size: 15px; color: var(--muted); }
.panel .danger { background: #ffd6de; }

/* feestje */
.spark { position: fixed; z-index: 50; width: 18px; height: 18px; pointer-events: none; border-radius: 4px; animation: spark 0.9s ease-out forwards; }
@keyframes spark { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }

/* tekeningen: omlijning (ol) onder de kleur (fl) */
.art .fl .wo { fill: var(--wool); } .art .fl .dk { fill: var(--dark); } .art .fl .wh { fill: var(--white); }
.art .fl .ey { fill: var(--ink); } .art .fl .ye { fill: var(--ye); } .art .fl .or { fill: var(--or); }
.art .fl .pk { fill: var(--pk); } .art .fl .gr { fill: var(--gr); } .art .fl .br { fill: var(--br); }
.art .fl .ow { fill: var(--ow); } .art .fl .lt { fill: var(--lt); }
.art .fl .ln { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.art .ol * { fill: var(--ink); stroke: var(--ink); stroke-width: var(--olw); stroke-linejoin: round; }
.art .ol .ln { display: none; }

@media (max-width: 700px), (max-height: 520px) {
  .owl { width: 60px; } .bubble { font-size: 21px; padding: 8px 14px; } .bar .where { font-size: 19px; }
  .card { font-size: 22px; } .card .big { font-size: 42px; }
  .answers .num-btn { width: 68px; height: 68px; font-size: 32px; }
  .letter { width: 120px; height: 136px; font-size: 76px; }
}
@media (max-width: 700px) { .klank { grid-template-columns: 1fr; justify-items: center; } .pics { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .spark, .item.hop, .k-btn.nope, .pic.nope { animation: none; } .lock.holding .fill { transition: none; } }
