/* games.chang.nu — stijl. Kinderdeel: donkere arcade-look met neon. Ouderpagina: licht en rustig. */
@font-face { font-family: "Bungee"; src: url("fonts/Bungee-Regular.ttf") format("truetype"); font-display: swap; }
:root {
  --achter: #fff7ec; --kaart: #ffffff; --inkt: #3b2f2a; --zacht: #8a7a70; --lijn: #f0e2d0;
  /* neonkleuren per soort */
  --tekenen: #ff7a2f; --muziek: #c84bff; --puzzelen: #00c8ff; --rekenen: #2fe86a;
  --letters: #ffd000; --ontdekken: #00f0c0; --arcade: #ff2e88; --vormen: #6c8cff;
  --rond: 20px;
  --stoer: "Bungee", "Arial Black", Impact, system-ui, sans-serif;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--inkt); background: var(--achter);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; }
button, a { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- app: kinderdeel (één scherm, niets verschuift of zoomt) ---------- */
html:has(body.app) { height: 100%; overflow: hidden; background: #0b1026; }
body.app {
  --kaart: #161c48; --inkt: #f4f6ff; --zacht: #9aa3d6; --lijn: #262e66;
  position: fixed; top: 0; left: 0; width: var(--breedte, 100%); height: var(--hoogte, 100%); overflow: hidden; overscroll-behavior: none; color: var(--inkt);
  background:
    radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.6px) 0 0 / 170px 170px,
    radial-gradient(circle, rgba(160,220,255,.55) 0 1.2px, transparent 2px) 60px 90px / 230px 230px,
    radial-gradient(circle, rgba(255,255,255,.4) 0 1px, transparent 1.6px) 120px 30px / 290px 290px,
    radial-gradient(ellipse 90% 60% at 50% -10%, #3b2a96 0%, transparent 70%),
    radial-gradient(ellipse 70% 50% at 100% 110%, #0f4a7a 0%, transparent 70%),
    linear-gradient(180deg, #0b1026 0%, #121848 100%);
}
.scherm { position: absolute; inset: 0; display: flex; flex-direction: column; }
.schuif {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.stoer { font-family: var(--stoer); font-weight: 400; text-transform: uppercase; letter-spacing: .5px; }
.neontekst {
  font-family: var(--stoer); font-weight: 400; text-transform: uppercase; margin: 0; line-height: 1;
  background: linear-gradient(180deg, #ffffff 15%, #8fe9ff 60%, #c84bff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2a1470) drop-shadow(0 0 14px rgba(0, 200, 255, .45));
}

.kop {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: max(12px, var(--boven, env(safe-area-inset-top))) max(18px, env(safe-area-inset-right)) 4px max(18px, env(safe-area-inset-left));
}
.kop h1 { font-size: clamp(30px, 6vw, 48px); }
.logo { width: clamp(48px, 8vw, 68px); height: auto; filter: drop-shadow(0 0 10px rgba(0, 200, 255, .5)); animation: zweef 3.5s ease-in-out infinite; }
@keyframes zweef { 50% { transform: translateY(-4px) rotate(-6deg); } }
.offlinemerk {
  margin-left: auto; font-size: 28px; line-height: 1; padding: 6px 10px; border-radius: 14px;
  background: #161c48; border: 2px solid rgba(255, 255, 255, .25);
}
.offlinemerk[hidden] { display: none; }
.offlinemerk:not([hidden]) + .mijnleeftijd { margin-left: 0; }
.mijnleeftijd {
  margin-left: auto; border: 3px solid #ffd000; border-radius: 16px; min-height: 54px; padding: 4px 16px; cursor: pointer;
  background: #161c48; color: #fff; font-family: var(--stoer); font-size: 26px;
  box-shadow: 0 5px 0 #8a6a00, 0 0 16px rgba(255, 208, 0, .35);
}
.mijnleeftijd:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a6a00; }

/* leeftijd kiezen */
.leeftijdscherm { align-items: center; justify-content: center; gap: clamp(18px, 4.5vh, 44px); padding: max(20px, var(--boven, env(safe-area-inset-top))) 20px max(20px, env(safe-area-inset-bottom)); }
.welkom { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.welkom .logo { width: clamp(96px, 20vmin, 160px); }
.welkom h1 { font-size: clamp(30px, 7vmin, 60px); }
.leeftijden { display: grid; grid-template-columns: repeat(3, auto); gap: clamp(16px, 3.4vmin, 30px); }
@media (orientation: landscape) { .leeftijden { grid-template-columns: repeat(6, auto); } }
.leeftijdknop {
  --rand: color-mix(in srgb, var(--kleur) 55%, #000);
  width: clamp(92px, 21vmin, 150px); aspect-ratio: 1; border: 4px solid rgba(255,255,255,.85); border-radius: 30px; cursor: pointer;
  background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--kleur) 55%, #fff) 0%, var(--kleur) 45%, var(--rand) 100%);
  color: #fff; box-shadow: 0 9px 0 var(--rand), 0 0 26px color-mix(in srgb, var(--kleur) 60%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: transform .08s ease;
}
.leeftijdknop:active { transform: translateY(7px); box-shadow: 0 2px 0 var(--rand), 0 0 14px color-mix(in srgb, var(--kleur) 60%, transparent); }
.leeftijdknop .getal { font-family: var(--stoer); font-size: clamp(46px, 11vmin, 80px); line-height: .9; text-shadow: 0 4px 0 rgba(0,0,0,.35); }
.leeftijdknop .stippen { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.leeftijdknop .stippen i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }

/* soorten */
.soorten {
  flex: none; display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior: contain;
  padding: 12px max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left));
}
.soorten::-webkit-scrollbar { display: none; }
.soortknop {
  flex: none; display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 56px;
  border: 3px solid var(--kleur, #ffd000); border-radius: 16px; padding: 8px 16px 8px 10px;
  background: #161c48; color: #fff; font-family: var(--stoer); font-size: 17px; text-transform: uppercase;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--kleur, #ffd000) 45%, #000);
}
.soortknop .e { font-size: 28px; line-height: 1; }
.soortknop[aria-pressed="true"] { background: var(--kleur, #ffd000); color: #0b1026; box-shadow: 0 5px 0 color-mix(in srgb, var(--kleur, #ffd000) 45%, #000), 0 0 20px color-mix(in srgb, var(--kleur, #ffd000) 60%, transparent); }
.soortknop:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--kleur, #ffd000) 45%, #000); }

/* tegels */
.groep { padding: 2px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left)); }
.groep h2 { display: flex; align-items: center; gap: 10px; margin: 14px 0 14px; font-family: var(--stoer); font-weight: 400; font-size: 24px; text-transform: uppercase; color: var(--kleur); text-shadow: 0 0 14px color-mix(in srgb, var(--kleur) 60%, transparent); }
.groep h2 .e { font-size: 32px; }
.raster { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 700px) { .raster { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 22px; } }
.tegel {
  display: flex; flex-direction: column; padding: 0; width: 100%; cursor: pointer; text-align: center; overflow: hidden;
  border: 3px solid var(--kleur); border-radius: var(--rond); background: #161c48; color: #fff;
  box-shadow: 0 7px 0 color-mix(in srgb, var(--kleur) 40%, #000), 0 0 18px color-mix(in srgb, var(--kleur) 30%, transparent);
  transition: transform .08s ease;
}
.tegel:active { transform: translateY(5px) scale(.98); box-shadow: 0 2px 0 color-mix(in srgb, var(--kleur) 40%, #000); }
.tegel .beeld { position: relative; aspect-ratio: 1; width: 100%; background: color-mix(in srgb, var(--kleur) 25%, #0b1026); display: grid; place-items: center; overflow: hidden; }
.tegel .soortje { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 20px; border-radius: 10px; background: rgba(11,16,38,.75); border: 2px solid var(--kleur); }
.tegel .beeld img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tegel .beeld .e { font-size: 64px; }
.tegel .naam {
  padding: 9px 8px 11px; font-size: 17px; font-weight: 900; line-height: 1.15; min-height: 3.1em; display: grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--kleur) 30%, #161c48), #161c48); border-top: 3px solid var(--kleur);
}
.leeg { padding: 40px 24px; text-align: center; color: var(--zacht); font-size: 20px; font-weight: 700; }

/* ---------- spel ---------- */
.spelscherm { position: fixed; top: 0; left: 0; width: var(--breedte, 100%); height: var(--hoogte, 100%); background: #000; overflow: hidden; }
.draai { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; transform-origin: 0 0; }
.balk {
  flex: none; display: flex; align-items: center; gap: 12px; color: #fff;
  padding: max(6px, var(--boven, env(safe-area-inset-top))) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #161c48, #0b1026); border-bottom: 3px solid #00c8ff;
}
.thuis {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; flex: none; cursor: pointer;
  border: 3px solid #fff; background: radial-gradient(circle at 35% 25%, #7fe6ff, #00a8e0 55%, #005f8a);
  box-shadow: 0 5px 0 #004466, 0 0 14px rgba(0, 200, 255, .5);
}
.thuis img { width: 32px; height: 32px; pointer-events: none; }
.thuis:active { transform: translateY(4px); box-shadow: 0 1px 0 #004466; }
.balk .titel { font-family: var(--stoer); font-size: 18px; text-transform: uppercase; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.spelvak { flex: 1; min-height: 0; position: relative; }
.spelvak iframe { position: absolute; top: 0; left: env(safe-area-inset-left); width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)); height: 100%; border: 0; background: #fff; }
/* Spel een kwartslag gedraaid: spel-boven = scherm-rechts, spel-links = scherm-boven (statusbalk),
   spel-rechts = scherm-onder (thuisbalk), spel-onder = scherm-links. De veilige randen draaien dus mee. */
.draai.gedraaid .balk { padding: max(6px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) 6px max(10px, var(--boven, env(safe-area-inset-top))); }
.draai.gedraaid .spelvak iframe { left: var(--boven, env(safe-area-inset-top)); width: calc(100% - var(--boven, env(safe-area-inset-top)) - env(safe-area-inset-bottom)); }
.draai.gedraaid .schermknoppen { padding: 0 max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) max(14px, var(--boven, env(safe-area-inset-top))); }

/* schermknoppen voor toetsenbordspellen */
.schermknoppen {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.sk {
  pointer-events: auto; touch-action: none; display: grid; place-items: center; padding: 0; cursor: pointer;
  width: clamp(62px, 11vmin, 84px); aspect-ratio: 1; border-radius: 22px; border: 3px solid rgba(255,255,255,.85);
  background: rgba(11,16,38,.42); color: #fff; font-size: clamp(24px, 4.5vmin, 34px); line-height: 1;
  box-shadow: 0 0 14px rgba(0,200,255,.4); opacity: .78; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sk.aan { background: rgba(0,200,255,.65); transform: scale(.93); opacity: 1; }
.pijlen.rij { display: flex; gap: 14px; }
.pijlen.kruis { display: grid; grid-template-areas: ". o ." "l . r" ". d ."; gap: 4px; }
.sk-omhoog { grid-area: o; } .sk-links { grid-area: l; } .sk-rechts { grid-area: r; } .sk-omlaag { grid-area: d; }
.acties { display: flex; gap: 14px; align-items: flex-end; }
.sk-spatie { width: clamp(80px, 15vmin, 110px); border-radius: 50%; background: rgba(255,46,136,.5); box-shadow: 0 0 18px rgba(255,46,136,.5); }
.sk-z, .sk-x, .sk-enter { font-family: var(--stoer); border-radius: 50%; }

/* computer + staand spel: als een telefoon in het midden in plaats van gedraaid */
.spelvak.smal { background: radial-gradient(ellipse at 50% 30%, #1b2360, #0b1026); }
.spelvak.smal iframe { left: 50%; right: auto; width: min(100%, calc((100dvh - 70px) * 9 / 16)); transform: translateX(-50%); border-left: 3px solid #00c8ff; border-right: 3px solid #00c8ff; }

.joystick {
  pointer-events: auto; touch-action: none; position: relative; display: grid; place-items: center;
  width: clamp(130px, 24vmin, 180px); aspect-ratio: 1; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.7); background: radial-gradient(circle, rgba(11,16,38,.25), rgba(11,16,38,.55));
  box-shadow: 0 0 16px rgba(0,200,255,.35); opacity: .8;
}
.joystick.aan { opacity: 1; }
.js-knop {
  width: 46%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; border: 3px solid #fff;
  background: radial-gradient(circle at 35% 30%, #7fe6ff, #00a8e0 60%, #005f8a); box-shadow: 0 0 14px rgba(0,200,255,.6);
}

/* ---------- ouderpagina ---------- */
.ouder { max-width: 1100px; margin: 0 auto; padding: 18px 18px 140px; }
.ouder h1 { margin: 6px 0 4px; font-size: 30px; }
.ouder .intro { color: var(--zacht); margin: 0 0 14px; line-height: 1.45; max-width: 760px; }
.ouder .intro b { color: var(--inkt); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.chip { border: 1px solid var(--lijn); background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--inkt); color: #fff; border-color: var(--inkt); }
.filters .tel { margin-left: auto; color: var(--zacht); font-size: 15px; }
.zoek { border: 1px solid var(--lijn); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 15px; min-width: 180px; background: #fff; }

.lijst { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .lijst { grid-template-columns: 1fr 1fr; } }
.kaart {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start;
  background: #fff; border-radius: 18px; padding: 12px; border: 2px solid transparent;
  box-shadow: 0 2px 0 var(--lijn);
}
.kaart.aan { border-color: color-mix(in srgb, var(--kleur) 70%, #fff); }
.kaart .mini { width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--kleur) 25%, #fff); display: grid; place-items: center; font-size: 40px; }
.kaart .mini img { width: 100%; height: 100%; object-fit: cover; }
.kaart h3 { margin: 0 0 3px; font-size: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kaart p { margin: 3px 0; line-height: 1.4; font-size: 15px; }
.kaart .klein { color: var(--zacht); font-size: 13px; }
.kaart .klein a { color: inherit; }
.label { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f3ebe1; color: var(--inkt); white-space: nowrap; }
.label.advies { background: #fff0c2; }
.label.nieuw { background: #d9f3ff; }
.label.let { background: #ffe1e1; }
.kaart .acties { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.probeer { font-size: 14px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--lijn); background: #fff; text-decoration: none; }
.schakel { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: 15px; user-select: none; }
.schakel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schakel .baan { width: 50px; height: 30px; border-radius: 999px; background: #d9cfc4; position: relative; transition: background .15s; }
.schakel .baan::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.schakel input:checked + .baan { background: var(--rekenen); }
.schakel input:checked + .baan::after { left: 23px; }
.schakel input:focus-visible + .baan { outline: 3px solid #3fb0e8; outline-offset: 2px; }

.bewaarbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: #fffdf9; border-top: 1px solid var(--lijn);
  box-shadow: 0 -4px 14px rgba(0,0,0,.05);
}
.bewaarbalk input { font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--lijn); width: 150px; letter-spacing: 3px; }
.knop { font: inherit; font-weight: 800; border: 0; border-radius: 12px; padding: 11px 18px; background: var(--inkt); color: #fff; cursor: pointer; }
.knop.licht { background: #fff; color: var(--inkt); border: 1px solid var(--lijn); }
.knop:disabled { opacity: .5; cursor: default; }
.melding { font-size: 15px; min-width: 200px; }
.melding.goed { color: #2e7d32; }
.melding.fout { color: #c62828; }

/* ouderpagina: offline spelen */
.offlinevak { background: #fff; border: 1px solid var(--lijn); border-radius: 16px; padding: 12px 16px 14px; margin: 0 0 16px; max-width: 760px; }
.offlinevak h2 { margin: 0 0 6px; font-size: 20px; }
.offlinevak p { margin: 0 0 8px; line-height: 1.45; }
.offlinevak .acties { flex-wrap: wrap; align-items: center; gap: 10px; }
.bezigvak { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.balkje { flex: 1 1 200px; height: 12px; border-radius: 999px; background: #f3ebe1; overflow: hidden; }
.balkje i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #00c8ff, #2fe86a); transition: width .3s; }
.offlineknop { cursor: pointer; font: inherit; font-size: 14px; }
.offlineknop.klaar { background: #e3f7e6; border-color: #9ad5a3; }
.offlineknop.oud { background: #fff0c2; }
.offlineknop.bezig, .offlineknop.wacht { background: #d9f3ff; }
