@font-face { font-family: "Fredoka"; src: url("fonts/Fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --geel: #ffd640;
  --rood: #f2545b;
  --blauw: #4a90e2;
  --groen: #3cc47c;
  --paars: #9b6bd6;
  --inkt: #2b2340;
  --lucht1: #bfe9ff;
  --lucht2: #fff6d8;
  --wit: #ffffff;
  --veilig-boven: env(safe-area-inset-top, 0px);
  --veilig-onder: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: var(--inkt);
  background: linear-gradient(180deg, var(--lucht1) 0%, var(--lucht2) 100%);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
svg { display: block; }

.scherm { position: fixed; inset: 0; display: none; flex-direction: column; padding: calc(var(--veilig-boven) + 12px) 16px calc(var(--veilig-onder) + 12px); }
.scherm.actief { display: flex; }

/* Beginscherm */
#s-home { align-items: center; justify-content: center; gap: 2vh; }
.groep { width: min(70vw, 52vh, 520px); height: auto; animation: zweef 4s ease-in-out infinite; }
.logo { margin: 0 0 1vh; line-height: 0; }
.logo img { width: min(60vw, 34vh, 340px); height: auto; }
.hoofdknoppen { display: flex; gap: min(4vw, 32px); }
.groot {
  width: min(27vw, 20vh, 190px); aspect-ratio: 1; border-radius: 28%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  color: var(--wit); font-weight: 600; font-size: min(4.6vw, 3.2vh, 30px);
  border: 4px solid var(--inkt); box-shadow: 0 8px 0 var(--inkt);
  transition: transform .1s, box-shadow .1s;
}
.groot:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--inkt); }
.groot svg { width: 58%; fill: var(--wit); stroke: var(--inkt); stroke-width: 4; stroke-linejoin: round; }
.groot svg .wit { fill: var(--inkt); stroke: none; }
.rood { background: var(--rood); } .blauw { background: var(--blauw); } .groen { background: var(--groen); }

/* Balk bovenaan */
.balk { display: flex; align-items: center; gap: 12px; min-height: 64px; flex: none; }
.balk h2 { margin: 0; font-size: clamp(22px, 4vw, 34px); font-weight: 600; }
.rond {
  width: 60px; height: 60px; flex: none; border-radius: 50%;
  background: var(--wit); border: 3px solid var(--inkt); box-shadow: 0 4px 0 var(--inkt);
  display: grid; place-items: center;
}
.rond:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--inkt); }
.rond svg { width: 62%; fill: none; stroke: var(--inkt); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.rond.aan { background: var(--geel); }
.gereedschap { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
#b-emmer svg, #b-kwast svg { stroke-width: 6; }
#b-emmer svg .vul, #b-kwast svg .vul { fill: var(--huidig, var(--rood)); }

/* Platenkeuze */
.platen {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 4px 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(40vw, 200px), 1fr)); grid-auto-rows: min(32vw, 160px); gap: 16px; align-content: start;
}
.plaat {
  background: var(--wit); border: 3px solid var(--inkt); border-radius: 20px; box-shadow: 0 5px 0 var(--inkt);
  height: 100%; display: grid; place-items: center; overflow: hidden; padding: 8px;
}
.plaat:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--inkt); }
.plaat img { width: 100%; height: 100%; object-fit: contain; }

/* Kleurscherm */
.doekvak { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 0; }
#doek {
  background: var(--wit); border: 3px solid var(--inkt); border-radius: 18px;
  max-width: 100%; max-height: 100%; touch-action: none; box-shadow: 0 6px 0 rgba(43,35,64,.25);
}
.palet {
  flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 12px 4px 6px;
}
.verf {
  flex: none; width: clamp(42px, calc((100vw - 32px) / 18 - 10px), 54px); aspect-ratio: 1; border-radius: 50%;
  border: 3px solid var(--inkt); transition: transform .12s;
}
.verf.aan { transform: scale(1.18) translateY(-4px); box-shadow: 0 0 0 4px var(--wit), 0 0 0 7px var(--inkt); }
.verf.gum { background: repeating-conic-gradient(#fff 0 25%, #e6e6e6 0 50%) 50% / 16px 16px; }

.vraag { position: absolute; inset: 0; background: rgba(43,35,64,.45); display: grid; place-items: center; z-index: 5; }
.vraag[hidden] { display: none; }
.vraagdoos { background: var(--wit); border: 4px solid var(--inkt); border-radius: 28px; padding: 24px 28px; text-align: center; }
.vraagdoos p { font-size: 30px; font-weight: 600; margin: 0 0 18px; }
.vraagdoos div { display: flex; gap: 16px; justify-content: center; }
.knop { color: var(--wit); font-size: 26px; font-weight: 600; padding: 10px 28px; border-radius: 20px; border: 3px solid var(--inkt); box-shadow: 0 4px 0 var(--inkt); }

/* Filmpjes */
.films { display: flex; flex-wrap: wrap; align-content: flex-start; }
.films .film { flex: none; width: calc((100% - 16px) / 2); }
@media (min-width: 700px) { .films .film { width: calc((100% - 32px) / 3); } }
@media (min-width: 1000px) { .films .film { width: calc((100% - 48px) / 4); } }
.film { background: var(--wit); border: 3px solid var(--inkt); border-radius: 20px; box-shadow: 0 5px 0 var(--inkt); overflow: hidden; display: flex; flex-direction: column; }
.film:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--inkt); }
.film img { flex: none; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--lucht1); }
.film span { padding: 6px 10px 8px; font-size: clamp(15px, 2.2vw, 20px); font-weight: 500; line-height: 1.2; }
.filmvak { flex: 1; min-height: 0; display: grid; place-items: center; padding-bottom: 8px; }
#speler { width: 100%; max-height: 100%; aspect-ratio: 16 / 9; background: #000; border: 3px solid var(--inkt); border-radius: 18px; }

/* Spelletjes kiezen */
.spellen { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; align-content: center; padding: 8px 0 20px; }
.spelkaart {
  width: min(40vw, 26vh, 210px); aspect-ratio: 1; border-radius: 26%; border: 4px solid var(--inkt); box-shadow: 0 7px 0 var(--inkt);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%;
  color: var(--wit); font-size: min(5vw, 3.2vh, 28px);
}
.spelkaart:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--inkt); }
.spelkaart b { font-weight: 600; text-shadow: 0 2px 0 rgba(43,35,64,.5); }
.spelkaart img, .spelkaart svg { width: 56%; height: 56%; object-fit: contain; }
.spelkaart svg { fill: var(--wit); stroke: var(--inkt); stroke-width: 4; stroke-linejoin: round; }
.spelkaart svg .touw { fill: none; }
.geel { background: var(--geel); } .oranje { background: #ff8a3d; }
.spelkaart.geel b { color: var(--inkt); text-shadow: none; } .paars { background: var(--paars); }
.mini-memory { width: 56%; height: 56%; display: grid; grid-template-columns: 1fr 1fr; gap: 8%; }
.mini-memory i { border-radius: 18%; border: 3px solid var(--inkt); background: var(--blauw) center / 80% no-repeat; }
.mini-memory i:nth-child(2), .mini-memory i:nth-child(3) { background-color: var(--wit); }
.mini-tel { height: 56%; display: grid; place-items: center; font-size: 1.9em; font-weight: 700; -webkit-text-stroke: 2px var(--inkt); paint-order: stroke fill; letter-spacing: .04em; }

/* Spelletje */
.sterren { margin-left: auto; display: flex; gap: min(6px, 1.2vw); min-width: 0; flex-shrink: 1; }
.sterren i { flex: none; width: min(34px, 7.6vw); height: min(34px, 7.6vw); background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 8l12 27 29 3-22 20 7 29-26-15-26 15 7-29-22-20 29-3z' fill='%23fff' stroke='%232b2340' stroke-width='6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.sterren i.aan { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 8l12 27 29 3-22 20 7 29-26-15-26 15 7-29-22-20 29-3z' fill='%23ffd640' stroke='%232b2340' stroke-width='6' stroke-linejoin='round'/%3E%3C/svg%3E"); animation: pop .4s; }
.speelveld { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; }

.feest { position: absolute; inset: 0; background: rgba(43,35,64,.35); display: grid; place-items: center; z-index: 10; overflow: hidden; }
.feest[hidden] { display: none; }
.feestdoos { background: var(--wit); border: 4px solid var(--inkt); border-radius: 32px; padding: 20px 36px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; animation: pop .5s; }
.feestdoos img { width: min(40vw, 26vh); }
.feestdoos p { font-size: clamp(32px, 7vw, 54px); font-weight: 700; margin: 4px 0 14px; color: var(--rood); -webkit-text-stroke: 2px var(--inkt); paint-order: stroke fill; }
.groot-rond { width: 84px; height: 84px; background: var(--groen); }
.groot-rond svg { stroke: var(--wit); }
.snipper { position: absolute; top: -20px; width: 14px; height: 20px; border-radius: 4px; animation: val linear forwards; }

/* Memory */
.memory { display: grid; gap: min(2vw, 14px); }
.kaart { position: relative; border-radius: 18px; }
.kaart > div { position: absolute; inset: 0; border-radius: 18px; border: 3px solid var(--inkt); box-shadow: 0 4px 0 var(--inkt); transition: transform .15s ease-in; }
.kaart .voor { background: var(--wit) center / 78% no-repeat; transform: scaleX(0); visibility: hidden; }
.kaart .achter { background: var(--blauw) center / 46% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 8l12 27 29 3-22 20 7 29-26-15-26 15 7-29-22-20 29-3z' fill='%23ffd640' stroke='%232b2340' stroke-width='6' stroke-linejoin='round'/%3E%3C/svg%3E"); transition-delay: .15s; }
.kaart.open .voor { transform: scaleX(1); visibility: visible; transition: transform .15s ease-out .15s, visibility 0s .15s; }
.kaart.open .achter { transform: scaleX(0); transition-delay: 0s; }
.kaart.gevonden .voor { background-color: #e7fbe9; border-color: var(--groen); }

/* Zoek en Tellen */
.doel { width: min(34vw, 26vh); aspect-ratio: 1; background: var(--wit) center / 80% no-repeat; border: 4px dashed var(--inkt); border-radius: 28px; }
.keuzes { display: flex; flex-wrap: wrap; justify-content: center; gap: min(3vw, 22px); }
.keuze { width: min(26vw, 20vh, 170px); aspect-ratio: 1; background: var(--wit) center / 80% no-repeat; border: 4px solid var(--inkt); border-radius: 26px; box-shadow: 0 6px 0 var(--inkt); }
.keuze:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--inkt); }
.keuze.fout { animation: schud .4s; }
.keuze.goed { background-color: #e7fbe9; border-color: var(--groen); animation: pop .4s; }
.telveld { display: flex; flex-wrap: wrap; justify-content: center; gap: min(2vw, 14px); max-width: min(92vw, 720px); background: rgba(255,255,255,.6); border: 3px solid var(--inkt); border-radius: 28px; padding: 18px; }
.telveld img { width: min(18vw, 15vh, 120px); animation: pop .4s backwards; }
.getal { font-size: min(14vw, 10vh, 84px); font-weight: 700; color: var(--wit); -webkit-text-stroke: 3px var(--inkt); paint-order: stroke fill; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.getal small { font-size: 20px; letter-spacing: 2px; -webkit-text-stroke: 0; color: var(--inkt); margin-top: 4px; }
.keuze.getal:nth-child(1) { background-color: var(--rood); }
.keuze.getal:nth-child(2) { background-color: var(--blauw); }
.keuze.getal:nth-child(3) { background-color: var(--groen); }
.keuze.getal.goed { background-color: var(--geel); }

/* Puzzel */
.puzzelbord { position: absolute; border: 3px solid var(--inkt); border-radius: 12px; background: rgba(255,255,255,.7); }
.puzzelbord .vak { position: absolute; border: 2px dashed rgba(43,35,64,.35); }
.puzzelbord .schaduw { position: absolute; inset: 0; background-size: 100% 100%; opacity: .14; border-radius: 10px; }
.stuk { position: absolute; border: 2px solid var(--inkt); border-radius: 8px; box-shadow: 0 4px 10px rgba(43,35,64,.35); touch-action: none; cursor: grab; }
.stuk.pakt { box-shadow: 0 12px 24px rgba(43,35,64,.45); z-index: 5; transform: scale(1.04); }
.stuk.vast { border-color: transparent; box-shadow: none; transition: left .15s, top .15s; z-index: 0; }

/* Ballonnen */
.lucht { position: absolute; inset: 0; overflow: hidden; touch-action: manipulation; }
.ballon { position: absolute; left: 0; top: 0; width: min(24vw, 150px); aspect-ratio: 5 / 7; will-change: transform; }
.ballon .bol { position: absolute; left: 0; right: 0; top: 0; height: 84%; border-radius: 50% 50% 48% 48%; border: 3px solid var(--inkt); display: grid; place-items: center; }
.ballon .bol img { width: 66%; }
.ballon .bol::after { content: ""; position: absolute; left: 18%; top: 14%; width: 16%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.55); }
.ballon .draad { position: absolute; left: 49%; top: 84%; width: 2px; height: 16%; background: var(--inkt); }
.knal { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 6px dotted var(--geel); animation: knal .4s forwards; pointer-events: none; }

/* Links of rechts */
.lr-podium { width: min(96vw, 900px); height: min(46vh, 75vw); flex: none; display: flex; align-items: flex-end; justify-content: center; gap: 2vw; }
.lr-vak { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.lr-struik { position: absolute; bottom: 0; left: 4%; right: 4%; height: 34%; background: #3cc47c; border: 4px solid var(--inkt); border-bottom: none; border-radius: 50% 50% 0 0 / 70% 70% 0 0; z-index: 2; }
.lr-vriend { position: absolute; bottom: 27%; width: 74%; max-height: 62%; object-fit: contain; object-position: bottom; transform: translateY(130%); z-index: 1; }
.lr-vriend.piep { animation: lr-piep .6s ease-out forwards; }
.lr-vriend.gevonden { animation: lr-hoera .5s ease-out forwards; }
.lr-dobbi { width: min(34vw, 30vh); flex: none; transition: transform .3s; }
.lr-dobbi.kijkt-links { transform: rotate(-10deg) translateX(-8%); }
.lr-dobbi.kijkt-rechts { transform: rotate(10deg) translateX(8%); }
.lr-vraag { font-size: min(7vw, 5vh, 44px); font-weight: 600; margin: 0; text-align: center; }
.lr-vraag b { color: var(--paars); -webkit-text-stroke: 2px var(--inkt); paint-order: stroke fill; }
.lr-knoppen { display: flex; gap: min(4vw, 40px); max-width: 100%; }
.lr-knop { display: flex; align-items: center; gap: min(2vw, 12px); padding: min(2.4vw, 14px) min(3.6vw, 26px); border-radius: 26px; border: 4px solid var(--inkt); box-shadow: 0 7px 0 var(--inkt); color: var(--wit); font-size: min(5.2vw, 4.4vh, 40px); font-weight: 700; -webkit-text-stroke: 2px var(--inkt); paint-order: stroke fill; }
.lr-knop.links { background: var(--blauw); } .lr-knop.rechts { background: var(--rood); }
.lr-knop svg { width: min(11vw, 11vh, 110px); fill: var(--wit); stroke: var(--inkt); stroke-width: 5; stroke-linejoin: round; }
.lr-knop:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--inkt); }
.lr-knop.fout { animation: schud .4s; }
.lr-knop.goed { animation: pop .4s; background: var(--groen); }
@keyframes lr-piep { from { transform: translateY(130%); } 70% { transform: translateY(-6%); } to { transform: translateY(0); } }
@keyframes lr-hoera { from { transform: translateY(0); } to { transform: translateY(-38%) rotate(-6deg); } }

@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes schud { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
@keyframes val { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes knal { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.springen { animation: springen .7s ease-in-out infinite alternate; }
@keyframes springen { from { transform: translateY(0); } to { transform: translateY(-14px); } }

@keyframes zweef { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 520px) {
  .rond { width: 50px; height: 50px; }
  .gereedschap { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { .groep, .springen { animation: none; } }

/* vier hoofdknoppen (Lezen erbij, 13-10-2026) */
.hoofdknoppen { gap: min(3vw, 28px); }
.groot { width: min(21vw, 19vh, 180px); font-size: min(3.9vw, 3vh, 28px); }
.roze { background: #f27ab6; }
