/* spel.css - gedeelde spelstijl (Typ-Avontuur, Ballonnen prikken): kaart, spelscherm, overlays, toetsenbord en handen. */

/* kaart */
.menu-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.speler h2 { font-size: 24px; margin: 0 0 10px; }
.speler h3, .speler .label { font-size: 17px; margin: 16px 0 8px; font-weight: 700; color: var(--muted); display: block; }
.naamveld input { width: 100%; font: 700 22px 'Baloo 2', sans-serif; padding: 6px 12px; border-radius: 10px; border: 3px solid var(--line); background: var(--cream); color: var(--ink); }
.naamveld small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.chars { display: flex; gap: 10px; }
.charbtn { flex: 1; background: var(--panel2); border: 3px solid var(--line); border-radius: 12px; padding: 8px 4px 4px; cursor: pointer; color: var(--cream); font-weight: 700; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.charbtn canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.charbtn[aria-pressed="true"] { background: #3d62a8; border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun) inset; }
.seg { display: flex; border: 3px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--panel2); color: var(--cream); font-weight: 700; font-size: 15px; padding: 7px 4px; cursor: pointer; }
.seg button + button { border-left: 3px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--sun); color: var(--ink); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sun); }
.kaart-kop { margin-bottom: 14px; }
.kaart-kop h1 { margin-bottom: 6px; }
.kaart-kop p { margin: 0; color: var(--muted); }
.world { margin-bottom: 16px; }
.world:last-child { margin-bottom: 0; }
.world-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.world-head h3 { margin: 0; color: var(--cream); font-size: 19px; }
.world-head small { color: var(--muted); font-size: 14px; }
.lvls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.lvl { position: relative; aspect-ratio: 1 / 1; border: 3px solid var(--line); border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); box-shadow: 0 4px 0 var(--line); padding: 2px; }
.lvl:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.w0 .lvl { background: #8fe08a; } .w1 .lvl { background: #ffb37a; } .w2 .lvl { background: #9fb4ff; } .w3 .lvl { background: #ffe08a; }
.lvl .n { font-family: var(--pixel); font-size: 10px; opacity: .7; }
.lvl .t { font-weight: 800; font-size: clamp(13px, 1.7vw, 19px); line-height: 1; text-align: center; }
.lvl .st { font-size: 13px; letter-spacing: 1px; line-height: 1; }
.lvl .st b { color: #c47f00; } .lvl .st i { font-style: normal; color: rgba(0,0,0,.22); }
.lvl.locked { background: #3a4f7c !important; color: #8495bb; }
.lvl.locked .t { font-size: 20px; }
.lvl.next { outline: 4px solid var(--sun); outline-offset: 3px; }
.start-hint { text-align: center; margin: 18px auto 6px; font-size: 18px; max-width: none; }
.start-hint .knop { margin-left: 8px; }
details.ouders { margin-top: 18px; background: rgba(0,0,0,.15); border: 2px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 16px; color: var(--muted); }
details.ouders summary { cursor: pointer; font-weight: 700; color: var(--cream); }
details.ouders ul { margin: 8px 0 10px; padding-left: 20px; max-width: 70ch; }
details.ouders li { margin: 3px 0; }

/* spel */
.hud { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 3px solid var(--line); border-radius: 14px 14px 0 0; padding: 8px 14px; flex-wrap: wrap; scroll-margin-top: 6px; }
.hud .lvname { font-weight: 800; font-size: 19px; white-space: nowrap; margin: 0; }
.progress { flex: 1; min-width: 120px; height: 18px; background: var(--line); border-radius: 6px; overflow: hidden; border: 2px solid var(--line); }
.progress div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #5fd068 0 12px, #4cbf57 12px 24px); transition: width .2s; }
.hud .acc { font-family: var(--pixel); font-size: 12px; white-space: nowrap; }
.stage { position: relative; border: 3px solid var(--line); border-top: 0; border-bottom: 0; line-height: 0; background: #5ec8ff; overflow: hidden; }
#cv { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(12,22,44,.6); line-height: 1.35; padding: 16px; z-index: 10; overflow: auto; }
.overlay.show { display: flex; }
.panel { background: var(--panel); border: 3px solid var(--line); border-radius: 14px; padding: 16px 24px 18px; max-width: 620px; width: 100%; text-align: center; box-shadow: 0 6px 0 var(--line); }
.panel h2 { font-family: var(--pixel); font-weight: 400; font-size: clamp(14px, 2.2vw, 19px); margin: 4px 0 12px; line-height: 1.5; }
.panel p { margin: 8px auto; max-width: 52ch; font-size: 17px; }
.panel .keys { display: flex; justify-content: center; gap: 16px; margin: 10px 0 8px; flex-wrap: wrap; }
.panel--klik { cursor: pointer; }
.bigkey-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.bigkey-row { display: flex; align-items: flex-start; gap: 6px; }
.bigkey-row .plus { margin-top: 16px; }
.bigkey { min-width: 62px; height: 62px; padding: 0 8px; border: 3px solid var(--line); border-bottom-width: 7px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--pixel); font-size: 22px; color: var(--ink); }
.bigkey--shift { background: var(--cream); font-size: 12px; min-width: 84px; }
.plus { font-weight: 800; font-size: 22px; color: var(--cream); }
.panel .row { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.stars { font-size: 54px; letter-spacing: 6px; line-height: 1; margin: 2px 0 6px; }
.stars span { display: inline-block; color: #4a5f8f; transform: scale(.4); opacity: 0; animation: pop .35s ease-out forwards; }
.stars span.on { color: var(--sun); text-shadow: 0 4px 0 #9a6d00; }
@keyframes pop { 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.stat { background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 6px 12px; min-width: 118px; }
.stat b { display: block; font-family: var(--pixel); font-weight: 400; font-size: 17px; margin-bottom: 2px; }
.stat span { font-size: 14px; color: var(--muted); }
.striprow { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 3px solid var(--line); padding: 6px 12px; }
.chip { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; width: 250px; line-height: 1.2; }
.chip i { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--line); display: inline-block; flex: 0 0 auto; }
.strip { flex: 1; overflow: hidden; position: relative; height: 50px; min-width: 0; }
.strip::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 40px; background: linear-gradient(90deg, transparent, var(--panel)); }
#stripInner { position: absolute; left: 0; top: 0; display: flex; gap: 1px; transition: transform .18s ease-out; font-weight: 800; font-size: 30px; white-space: nowrap; }
#stripInner span { display: inline-block; min-width: 26px; text-align: center; padding: 8px 3px 5px; color: var(--muted); border-bottom: 4px solid transparent; line-height: 1; }
#stripInner span.sp { color: rgba(179,195,230,.4); font-size: 16px; padding-top: 19px; padding-bottom: 6px; min-width: 22px; }
#stripInner span.ok { color: var(--groen); }
#stripInner span.err { color: var(--rood); }
#stripInner span.cur { color: #fff; background: rgba(255,255,255,.13); border-bottom-color: var(--sun); border-radius: 6px 6px 0 0; }
.kbarea { display: flex; justify-content: center; align-items: flex-end; gap: 14px; background: var(--panel); border: 3px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 10px 10px 12px; box-shadow: 0 5px 0 var(--line); }
.kbarea.nokb { display: none; }
.kb { flex: 0 0 auto; }
.krow { display: flex; gap: var(--gap); margin-bottom: var(--gap); }
.key { position: relative; flex: 0 0 auto; width: var(--u); height: var(--u); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: calc(var(--u) * .44); line-height: 1; color: #7f90b6; background: #33476f; border: 2px solid var(--line); box-shadow: inset 0 -4px 0 rgba(0,0,0,.22); transition: transform .08s; }
.key .k1 { font-size: .62em; opacity: .85; }
.key .k0 { font-size: .9em; }
.key.learned { background: var(--bg); color: var(--ink); }
.key.newk { box-shadow: inset 0 -4px 0 rgba(0,0,0,.22), 0 0 0 2px #fff; }
.key.bump::after { content: ""; position: absolute; bottom: calc(var(--u) * .14); left: 35%; right: 35%; height: 3px; border-radius: 2px; background: currentColor; opacity: .75; }
.key.target { background: var(--c); color: var(--ink); transform: translateY(-3px) scale(1.08); z-index: 2; box-shadow: 0 0 0 3px #fff, 0 0 18px 4px var(--c); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 4px 1px var(--c); } }
.key.hit-ok { background: var(--groen) !important; color: var(--ink); }
.key.hit-bad { background: #ff6b6b !important; color: #fff; animation: none; }
.key.space, .key.shiftkey { font-size: calc(var(--u) * .32); letter-spacing: 1px; }
.hand { width: calc(var(--u) * 3); height: auto; flex: 0 0 auto; overflow: visible; }
.hand .fing { stroke: var(--line); stroke-width: 3; opacity: .45; transition: opacity .15s; }
.hand .fing.on { opacity: 1; stroke: #fff; stroke-width: 4; }
.hand .palm { fill: #4a67a3; stroke: var(--line); stroke-width: 3; }

@media (max-width: 820px) {
  .menu-grid { grid-template-columns: 1fr; }
  .hand { display: none; }
  .chip { width: auto; }
  .chip span { display: none; }
}
@media (max-width: 520px) { .lvls { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { .stars span { opacity: 1; transform: none; } }
