@font-face { font-family: Fredoka; font-weight: 500 700; font-style: normal; font-display: swap; src: url(fonts/fredoka-latin.woff2) format('woff2'); }

:root {
  --inkt: #2a1e14; --creme: #fbf7ec; --creme-rand: #d8cdb0; --groen: #5ea543; --groen-rand: #3f7a2c;
  --zand: #ecd3a6; --zand-rand: #c9ab78; --bord: #2f5a3a; --hout: #b98a5a; --hout-donker: #9c6e42;
  --k: clamp(48px, 13.8vw, 56px); --g: 10px; --max: 100%; --rand: 14px;
}
* { box-sizing: border-box; }
html { background: #74b84f; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: Fredoka, system-ui, sans-serif; font-weight: 500; color: var(--inkt);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

#spel { position: relative; height: 100vh; height: 100dvh; min-height: 520px; overflow: hidden; background: linear-gradient(180deg,#6fc3ef 0%,#a9dcf2 48%,#fbe6c0 82%); }
#film { position: absolute; inset: 0; }
#film > svg { display: block; width: 100%; height: 100%; }

/* pillen en balk */
.kop, .tijdbalk, .rondepil { position: absolute; left: 0; right: 0; margin: 0 auto; max-width: var(--max); padding-left: var(--rand); padding-right: var(--rand); pointer-events: none; }
.kop { top: calc(env(safe-area-inset-top) + 12px); display: flex; justify-content: space-between; align-items: center; }
.pil { background: var(--creme); border-radius: 999px; padding: 8px 18px; font-weight: 700; font-size: 18px; line-height: 1.2;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 3px 0 var(--creme-rand), 0 6px 10px rgba(30,70,110,.25); }
.teller { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px; background: var(--groen); color: #fff; font-size: 17px; }
.teller.bump { animation: bump .35s cubic-bezier(.3,1.8,.5,1); }
.tijdbalk { top: calc(env(safe-area-inset-top) + 66px); height: 28px; padding-top: 0; }
.tijdbalk::before { content: ""; position: absolute; left: var(--rand); right: var(--rand); top: 0; bottom: 0; border-radius: 999px; background: var(--creme); box-shadow: 0 3px 0 var(--creme-rand), 0 6px 10px rgba(30,70,110,.2); }
.tijdbalk i { position: absolute; left: calc(var(--rand) + 5px); right: calc(var(--rand) + 5px); top: 5px; bottom: 5px; border-radius: 999px; background: var(--groen); transform-origin: left center; transform: scaleX(1); will-change: transform; }
.rondepil { top: calc(env(safe-area-inset-top) + 102px); display: flex; }
.rondepil > span:first-child, .rondepil .bolletjes { background: rgba(251,247,236,.9); }
.rondepil { font-size: 13px; font-weight: 700; gap: 6px; align-items: center; }
.rondepil > span:first-child { padding: 3px 11px; border-radius: 999px; }
.bolletjes { display: inline-flex; gap: 4px; padding: 6px 9px; border-radius: 999px; }
.bolletjes i { width: 8px; height: 8px; border-radius: 50%; background: #d3cbb6; transition: background .2s, transform .2s; }
.bolletjes i.aan { background: var(--groen); transform: scale(1.1); }

/* onderkant: bord en toetsen */
.onder { position: absolute; left: 0; right: 0; bottom: max(env(safe-area-inset-bottom), 14px); margin: 0 auto; max-width: var(--max);
  padding: 0 var(--rand); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: end; }
.toetsen { display: grid; grid-template-columns: repeat(3, var(--k)); grid-auto-rows: var(--k); gap: var(--g); }
.bord-wrap { position: relative; height: calc(4 * var(--k) + 3 * var(--g) + 30px); display: flex; flex-direction: column; }
.bord { height: calc(3 * var(--k) + 2 * var(--g) + 8px); border-radius: 22px; background: var(--bord); border: 10px solid var(--hout);
  box-shadow: inset 0 0 0 3px #244a2f, 0 6px 0 var(--hout-donker), 0 12px 14px rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; padding: 6px; position: relative; z-index: 1; }
.poot { position: absolute; bottom: 0; top: calc(3 * var(--k) + 2 * var(--g) + 8px - 6px); width: 14px; background: var(--hout-donker); border-radius: 0 0 8px 8px; }
.poot.l { left: 15%; } .poot.r { right: 15%; }
.som { color: #fff; font-weight: 700; font-size: clamp(28px, 8.4vw, 36px); letter-spacing: .02em; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.som b { font-size: .8em; margin: 0 .12em; }
.vakje { width: 100%; max-width: 200px; height: calc(var(--k) * 1.05); border-radius: 14px; background: var(--creme); box-shadow: inset 0 0 0 3px #fff, inset 0 -3px 0 3px #eadfc5; display: grid; place-items: center; font-weight: 700; font-size: clamp(30px, 9vw, 40px); position: relative; }
.vakje > span { grid-area: 1/1; display: flex; }
.vakje .vraag { opacity: .9; }
.vakje.heeft .vraag { display: none; }
.vakje .c { display: inline-block; }
.vakje.krijt { background: transparent; box-shadow: inset 0 0 0 3px rgba(255,255,255,.85); color: #fff; border-radius: 14px; }
.vakje.goed { background: var(--groen); color: #fff; box-shadow: inset 0 0 0 3px #8fd36f; }

.knop { width: var(--k); height: var(--k); border-radius: 50%; background: var(--creme); color: var(--inkt); font-weight: 700; font-size: calc(var(--k) * .56); line-height: 1;
  display: grid; place-items: center; box-shadow: 0 5px 0 var(--creme-rand), 0 9px 10px rgba(0,0,0,.2); outline: none; position: relative;
  transition: transform 160ms cubic-bezier(.34,1.56,.64,1), box-shadow 160ms cubic-bezier(.34,1.56,.64,1); }
.knop.in { transform: translateY(4px); box-shadow: 0 1px 0 #d8cdb0, 0 2px 4px rgba(0,0,0,.2); transition: transform 60ms cubic-bezier(.2,0,0,1), box-shadow 60ms cubic-bezier(.2,0,0,1); }
.knop.wis.in { box-shadow: 0 1px 0 #c9ab78, 0 2px 4px rgba(0,0,0,.2); }
.knop svg { width: 52%; height: auto; }
.knop.wis { background: var(--zand); box-shadow: 0 5px 0 var(--zand-rand), 0 9px 10px rgba(0,0,0,.2); }
.knop.nul { grid-column: 2; }
.knop:disabled { cursor: default; }
.uit .knop { filter: saturate(.7) brightness(.97); }

/* overlays */
.scherm { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(40,110,170,.62); transition: opacity .3s ease-out; text-align: center; padding: 20px; }
.scherm.weg { opacity: 0; pointer-events: none; }
.start-kaart { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.start-kaart h1, .start-kaart h2, .start-kaart .start-titel { margin: 0; color: #fff; font-weight: 700; font-size: clamp(34px, 10vw, 52px); text-shadow: 0 3px 0 rgba(30,70,110,.35); }
.start-kaart p:not(.start-titel) { margin: 0; color: #fff; font-size: 22px; font-weight: 700; text-shadow: 0 2px 0 rgba(30,70,110,.35); }
.logo { width: 96px; height: 96px; border-radius: 50%; background: var(--bord); border: 8px solid var(--hout); color: #fff; font-size: 64px; font-weight: 700; display: grid; place-items: center; line-height: 1; padding-bottom: 6px; box-shadow: 0 6px 0 var(--hout-donker); }
.groot { background: var(--groen); color: #fff; font-weight: 700; font-size: 24px; padding: 16px 30px; border-radius: 999px; box-shadow: 0 6px 0 var(--groen-rand), 0 12px 16px rgba(0,0,0,.2); }

#uitleg { background: var(--creme); padding: 48px 20px calc(48px + env(safe-area-inset-bottom)); -webkit-user-select: text; user-select: text; }
.uitleg-in { max-width: 640px; margin: 0 auto; }
.uitleg-in { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 400; font-size: 18px; line-height: 1.6; }
.uitleg-in h1, .uitleg-in h2, .uitleg-in h3, .uitleg-in summary { font-family: Fredoka, system-ui, sans-serif; font-weight: 700; line-height: 1.2; }
.uitleg-in h1 { margin: 0 0 16px; font-size: clamp(28px, 7vw, 40px); }
.uitleg-in h2 { margin: 36px 0 12px; font-size: clamp(22px, 5.5vw, 30px); }
.uitleg-in h3 { margin: 24px 0 8px; font-size: 20px; }
.uitleg-in h1:first-child, .uitleg-in h2:first-child { margin-top: 0; }
.uitleg-in p { margin: 0 0 1em; }
.uitleg-in ul, .uitleg-in ol { margin: 0 0 1em; padding-left: 1.3em; }
.uitleg-in li { margin-bottom: .3em; }
.uitleg-in a { color: var(--groen-rand); text-underline-offset: 3px; }
.uitleg-in details { background: #fff; border-radius: 16px; margin: 0 0 10px; box-shadow: 0 3px 0 var(--creme-rand); }
.uitleg-in summary { cursor: pointer; padding: 14px 18px; font-size: 19px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.uitleg-in summary::-webkit-details-marker { display: none; }
.uitleg-in summary::after { content: "+"; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--zand); display: grid; place-items: center; line-height: 1; }
.uitleg-in details[open] summary::after { content: "\2212"; }
.uitleg-in details > :not(summary) { padding: 0 18px; }
.uitleg-in details > :last-child { padding-bottom: 6px; margin-bottom: 12px; }


/* bovenbalk */
.kop-rechts { display: flex; align-items: center; gap: 10px; }
.ronde-knop::after { content: ""; position: absolute; inset: -8px; }
.ronde-knop { pointer-events: auto; width: 48px; height: 48px; border-radius: 50%; background: var(--creme); display: grid; place-items: center; overflow: hidden; position: relative;
  box-shadow: 0 3px 0 var(--creme-rand), 0 6px 10px rgba(30,70,110,.25); transition: opacity .2s, filter .2s; }
@media (min-width: 601px) { .ronde-knop { width: 56px; height: 56px; } }
@media (min-width: 1024px) { .kop-rechts { margin-right: 0; } }

@keyframes bump { 50% { transform: scale(1.35); } }

/* tablet */
@media (min-width: 601px) {
  :root { --k: 84px; --g: 14px; --max: 760px; --rand: 22px; }
  .pil { font-size: 24px; padding: 10px 24px; }
  .teller { min-width: 40px; height: 40px; font-size: 22px; }
  .tijdbalk { top: calc(env(safe-area-inset-top) + 82px); height: 34px; }
  .rondepil { top: calc(env(safe-area-inset-top) + 126px); font-size: 16px; }
  .bolletjes i { width: 10px; height: 10px; }
  .onder { gap: 24px; }
  .bord { border-width: 14px; }
  .som { font-size: 52px; } .vakje { font-size: 56px; max-width: 280px; }
  .groot { font-size: 30px; }
}

/* desktop: liggend */
@media (min-width: 1024px) {
  :root { --pw: clamp(420px, 34vw, 560px); --max: none; --rand: 28px; }
  .kop, .tijdbalk, .rondepil { right: var(--pw); margin: 0; }
  .onder { left: auto; right: 0; top: 0; bottom: 0; width: var(--pw); max-width: none; margin: 0; padding: 0 36px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 40px;
    background: linear-gradient(180deg,#74b84f 0%,#5ea543 55%,#4a8f36 100%); box-shadow: -10px 0 24px rgba(0,0,0,.15); }
  .bord-wrap { height: auto; width: 100%; padding-bottom: 48px; }
  .bord { height: 250px; }
  .poot { top: auto; height: 60px; z-index: 0; }
  .toetsen { gap: var(--g); }
  .scherm { right: 0; }
  #film { right: var(--pw); }
}
@media (min-width: 1024px) and (max-height: 780px) { :root { --k: 70px; } .bord { height: 210px; } .bord-wrap { padding-bottom: 40px; } .onder { gap: 24px; } }

@media (max-height: 640px) and (max-width: 600px) { :root { --k: 46px; --g: 8px; } .rondepil { display: none; } }

@media (prefers-reduced-motion: reduce) { .teller.bump { animation: none; } .scherm { transition: none; } .knop, .knop.in, .ronde-knop { transition: none; } .knop.in { filter: brightness(.88); } }

/* geluidknop: standaard uit */
.geluid-knop, .pauze-knop { color: var(--inkt); display: grid; place-items: center; }
.pauze-knop svg { width: 50%; height: 50%; }
.geluid-knop svg { width: 60%; height: 60%; }
.geluid-knop .golf { display: none; }
.geluid-knop[aria-pressed="true"] .golf { display: inline; }
.geluid-knop[aria-pressed="true"] .streep { display: none; }

/* smalle telefoons: bovenbalk moet passen met geluidknop */
@media (max-width: 430px) { .kop .pil { padding: 7px 12px; font-size: 16px; } .kop-rechts { gap: 6px; } .ronde-knop { width: 42px; height: 42px; } }
