/* De Klankburcht — thema. De vaste onderdelen (balk, knoppen, feedback, afronding) komen uit ../gedeeld/stijl-v1.css. */
:root {
  --mlp-vak: var(--mlp-spelling);
  --kb-ink: #123b43; --kb-teal: #177f7b; --kb-glow: #58ead4; --kb-gold: #d8ae65; --kb-goud-donker: #8a5e22;
  --kb-cream: #fff8e8; --kb-hout: #8a5a2e; --kb-nacht: #0d2833;
  --kb-balk: 66px;
}
body.mlp.kb { background: var(--kb-nacht); }
.kb .mlp-balk { background: #fff8e8f2; }
.kb-onderdelen { display: flex; gap: 4px; }
.kb-onderdelen img { width: 30px; height: 30px; border-radius: 8px; background: #123b4314; padding: 3px; opacity: .28; filter: grayscale(1); }
.kb-onderdelen img.heb { opacity: 1; filter: none; background: #58ead433; }
@media (max-width: 430px) { .kb-onderdelen img { width: 22px; height: 22px; padding: 2px; } .kb .mlp-balk .mlp-titel { font-size: 16px; } }

/* ---------- scène ---------- */
.kb-scene { position: relative; min-height: calc(100dvh - var(--kb-balk)); background: var(--kb-nacht) center / cover no-repeat; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 14px 24px; }
.kb-scene::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#05182033, #05182066); pointer-events: none; }
.kb-scene > * { position: relative; }
.kb-laden { color: #fff; }

/* opdrachtzone */
.kb-zone { width: min(980px, 100%); background: #fff9ebf5; color: var(--kb-ink); border: 3px solid var(--kb-gold); border-radius: 22px; box-shadow: 0 14px 44px #0006; padding: 16px 20px 18px; }
.kb-zone h1 { margin: 2px 0 6px; }
.kb-zone h2 { margin: 0 0 6px; font-size: 24px; }
.kb-kop { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.kb-kop .mlp-voortgang { flex: 1; }
.kb-kop .kb-kamernaam { font-weight: 700; color: var(--kb-goud-donker); font-size: 16px; white-space: nowrap; }
.kb-grid { display: grid; grid-template-columns: 1fr 190px; gap: 18px; align-items: start; }
@media (max-width: 760px) { .kb-grid { grid-template-columns: 1fr; } }
.kb-opdracht { font-size: 21px; margin: 4px 0 10px; }
.kb-zin { font-size: 22px; line-height: 1.45; margin: 6px 0; }
.kb-zin b { color: var(--kb-teal); }
.kb-gat { display: inline-block; min-width: 4.5em; border-bottom: 3px dashed var(--kb-gold); }
.kb-enkel { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; padding: 4px 12px; border-radius: 12px; background: var(--mlp-warm-zacht); margin: 2px 0 8px; }
.kb-plaatje { width: 92px; height: 92px; object-fit: contain; background: #fff; border-radius: 14px; border: 2px solid var(--mlp-rand); flex: none; }
.kb-rij { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kb-rij.mid { justify-content: center; }
.kb-melding { font-size: 15px; color: var(--mlp-zacht); }
.kb-stappen { margin: 6px 0 10px; padding: 10px 14px 10px 34px; background: #e9f7f3; border-radius: 14px; font-size: 17px; }
.kb-stappen li { margin: 2px 0; }
.kb-stappen-d { margin: 4px 0; }
.kb-stappen-d summary { cursor: pointer; font-weight: 700; color: var(--kb-teal); min-height: 36px; display: flex; align-items: center; }
.kb-stappen-d .kb-stappen { margin-top: 2px; }
.kb-label-modus { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #e3eef0; color: var(--kb-ink); }

/* luisterknop */
.kb-luister { display: inline-flex; align-items: center; gap: 8px; }
.kb .mlp-knop { white-space: nowrap; }
#klopt, #alles { display: inline-flex; align-items: center; gap: 6px; }
#klopt svg, #alles svg { width: 34px; height: 34px; }
.kb-luister svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- lettertegels ---------- */
.kb-tegels { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; min-height: 64px; }
.kb-tegel { display: inline-flex; justify-content: center; align-items: center; width: 50px; height: 62px; font-size: 38px; font-weight: 700; color: var(--kb-ink); background: linear-gradient(#fff, #f3e2bf); border: 2px solid #c49c5e; border-radius: 10px; box-shadow: 0 4px 0 #b98741; padding: 0; line-height: 1; }
button.kb-tegel { cursor: pointer; touch-action: manipulation; }
button.kb-tegel:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-tegel.en { background: linear-gradient(#f3fffb, #d4f4ea); border-color: #3aa894; box-shadow: 0 4px 0 #2a8a78; }
.kb-tegel.nieuw { background: #c6f5e7; border-color: #208f81; animation: kb-plof .6s ease-out; }
.kb-tegel.weg { animation: kb-weg .6s ease-in forwards; }
.kb-tegel.gekozen { outline: 4px solid var(--mlp-warm); }
.kb-tegel.fout { border-color: var(--mlp-fout); }
.kb-tegel.klein { width: 38px; height: 48px; font-size: 28px; }
.kb-scheid { width: 10px; align-self: center; height: 4px; border-radius: 2px; background: var(--kb-gold); }
@keyframes kb-plof { from { transform: translateY(-50px) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kb-weg { to { transform: translateY(-60px) scale(.4); opacity: 0; } }
@media (max-width: 520px) { .kb-tegel { width: 40px; height: 52px; font-size: 30px; } .kb-tegels { gap: 4px; } }

/* ---------- handelingsknoppen (vaste pictogrammen en namen) ---------- */
.kb-acties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
@media (max-width: 620px) { .kb-acties { grid-template-columns: 1fr; } }
.kb-actie { display: flex; align-items: center; gap: 10px; min-height: 64px; text-align: left; padding: 8px 12px; border: 3px solid var(--mlp-rand); border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--mlp-rand); cursor: pointer; font-weight: 700; font-size: 18px; line-height: 1.2; touch-action: manipulation; }
.kb-actie svg { flex: none; width: 44px; height: 44px; }
.kb-actie:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-actie[data-uitslag="goed"] { border-color: var(--mlp-goed); background: var(--mlp-goed-zacht); }
.kb-actie[data-uitslag="fout"] { border-color: var(--mlp-fout); }
.kb-actie.gekozen { border-color: var(--mlp-warm); }

/* ---------- deur: toont de GESCHREVEN eerste lettergreep ---------- */
.kb-deurvak { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kb-deur { position: relative; width: 132px; height: 172px; perspective: 600px; }
.kb-deur .kozijn { position: absolute; inset: 0; background: linear-gradient(#bc8b4d, #efcf8d); border: 6px solid #735133; border-radius: 66px 66px 6px 6px; padding: 6px; box-shadow: 0 8px 18px #0004; }
.kb-deur .gat { height: 100%; border-radius: 56px 56px 3px 3px; background: radial-gradient(circle, #51dcce, #143c45 72%); position: relative; }
.kb-deur .blad { position: absolute; inset: 0; border: 4px solid #b2834a; border-radius: 56px 56px 3px 3px; background: repeating-linear-gradient(90deg, #80502c 0, #9e6738 18px, #6b4023 20px, #a4713e 24px); transform-origin: left center; transition: transform 1s cubic-bezier(.2,.65,.2,1); }
.kb-deur .blad::after { content: ''; position: absolute; right: 12px; top: 74px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #f2ce86; background: #38cbb9; box-shadow: 0 0 12px #50ddce; }
.kb-deur.open .blad { transform: rotateY(-100deg); }
.kb-deur .bord { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; padding: 4px 12px; border-radius: 8px; background: #fff2d5; color: #173b43; font-size: 26px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 6px #0003; }
.kb-deur.leeg .bord { color: #a58c66; }
.kb-deurstatus { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; text-align: center; background: #123e43; color: #fff8e8; padding: 5px 10px; border-radius: 10px; max-width: 200px; }
.kb-deurstatus svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 760px) { .kb-deurvak { flex-direction: row; justify-content: center; } .kb-deur { width: 100px; height: 132px; } .kb-deur .blad::after { top: 54px; } .kb-deur .bord { font-size: 21px; } }

/* ---------- feedback ---------- */
.kb .mlp-feedback { margin: 10px 0 4px; font-size: 18px; }
.kb .mlp-feedback p { margin: 0; }
.kb-invoer { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.kb-invoer input { flex: 1 1 220px; min-width: 0; min-height: 56px; font: inherit; font-size: 28px; font-weight: 700; padding: 6px 14px; border: 3px solid var(--mlp-rand); border-radius: 14px; background: #fff; color: var(--kb-ink); letter-spacing: .04em; }
.kb-invoer input:focus { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 1px; border-color: var(--mlp-hoofd); }
.kb-invoer input[data-uitslag="goed"] { border-color: var(--mlp-goed); background: var(--mlp-goed-zacht); }
.kb-invoer input[data-uitslag="fout"] { border-color: var(--mlp-fout); }
.kb-acties-onder { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }

/* ---------- Klink, de deurwachter ---------- */
.kb-klink { position: fixed; left: 8px; bottom: 6px; z-index: 12; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; width: 150px; }
.kb-klink img { width: 100px; height: auto; filter: drop-shadow(0 6px 10px #0006); transform-origin: bottom center; }
.kb-klink .ballon { background: #fff8e8; color: var(--kb-ink); border: 2px solid var(--kb-gold); border-radius: 16px 16px 16px 4px; padding: 7px 10px; font-size: 15px; line-height: 1.3; box-shadow: 0 6px 16px #0004; }
.kb-klink.zwaai img { animation: kb-zwaai 1.2s ease-in-out 1; }
@keyframes kb-zwaai { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@media (max-width: 1279px), (max-height: 699px) { .kb-klink { display: none; } }

/* ---------- start ---------- */
.kb-start { width: min(720px, 100%); text-align: center; }
.kb-start .kb-zone { text-align: center; }
.kb-start h1 { font-size: clamp(34px, 7vw, 54px); color: var(--kb-ink); }
.kb-start .figuur { width: 120px; float: right; margin: -6px -4px 0 8px; }
.kb-instellingen { text-align: left; margin-top: 12px; }
.kb-instellingen .mlp-schakel { border-top: 1px solid var(--mlp-rand); }
@media (max-width: 520px) { .kb-start .figuur { width: 80px; } }

/* ---------- kaart van de burcht ---------- */
.kb-kaart { width: min(1060px, 100%); }
.kb-kaart .kb-zone { padding: 14px 16px; }
.kb-route { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 10px; }
@media (max-width: 1000px) { .kb-route { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 760px) { .kb-route { grid-template-columns: 1fr 1fr; } }
.kb-kamerknop { position: relative; display: flex; flex-direction: column; text-align: left; border: 3px solid var(--kb-gold); border-radius: 16px; overflow: hidden; background: #fff; cursor: pointer; padding: 0; box-shadow: 0 5px 0 #b98741; min-height: 160px; touch-action: manipulation; color: var(--kb-ink); }
.kb-kamerknop img.bg { width: 100%; height: 92px; object-fit: cover; display: block; }
.kb-kamerknop .tekst { padding: 6px 10px 8px; font-size: 16px; line-height: 1.25; }
.kb-kamerknop b { font-size: 18px; display: block; }
.kb-kamerknop .status { position: absolute; top: 6px; right: 6px; background: #fff8e8; border-radius: 999px; padding: 2px 10px; font-size: 14px; font-weight: 700; }
.kb-kamerknop .status.klaar { background: var(--mlp-goed); color: #fff; }
.kb-kamerknop:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.85); box-shadow: none; }
.kb-kamerknop:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-kamerknop .stuk { position: absolute; top: 56px; left: 8px; width: 40px; height: 40px; background: #fff8e8; border-radius: 50%; padding: 5px; box-shadow: 0 2px 6px #0004; }
.kb-kamerknop.poort { grid-column: 1 / -1; min-height: 0; flex-direction: row; }
.kb-kamerknop.poort img.bg { width: 34%; height: 112px; }
.kb-kist { display: flex; align-items: center; gap: 10px; }
.kb-kist img.kist { width: 70px; }

/* ---------- gang: bordjes ---------- */
.kb-bordjes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px; margin: 8px 0; }
.kb-bordje { text-align: left; border: 3px solid #a87b3f; background: linear-gradient(#fff3d8, #f3dcae); border-radius: 12px; padding: 10px 12px; font-size: 18px; cursor: pointer; box-shadow: 0 4px 0 #7a5527; color: var(--kb-ink); touch-action: manipulation; }
.kb-bordje b { font-size: 21px; background: #fff; padding: 0 6px; border-radius: 6px; border: 2px dashed #c49c5e; }
.kb-bordje.gekozen { outline: 4px solid var(--mlp-warm); }
.kb-bordje[data-uitslag="goed"] { border-color: var(--mlp-goed); background: var(--mlp-goed-zacht); }
.kb-bordje[data-uitslag="half"] { border-color: var(--mlp-half); background: var(--mlp-half-zacht); }
.kb-bordje[data-uitslag] b { border-style: solid; }
.kb-bordje:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-bordje .vink { float: right; font-weight: 700; color: var(--mlp-goed); }

/* ---------- lichtbrug ---------- */
.kb-kisten { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0; }
.kb-krat { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 118px; padding: 6px; border: 3px solid #a87b3f; border-radius: 12px; background: repeating-linear-gradient(90deg, #f3dcae 0, #f3dcae 18px, #e8cc95 19px, #f3dcae 22px); cursor: grab; font-weight: 700; font-size: 20px; box-shadow: 0 4px 0 #7a5527; touch-action: none; color: var(--kb-ink); }
.kb-krat img { width: 64px; height: 64px; object-fit: contain; pointer-events: none; }
.kb-krat .geen-beeld { width: 64px; height: 64px; display: grid; place-items: center; font-size: 15px; color: var(--kb-goud-donker); }
.kb-krat.gekozen { outline: 4px solid var(--mlp-warm); transform: translateY(-4px); }
.kb-krat.sleept { opacity: .5; }
.kb-krat.klaar { cursor: default; opacity: .45; box-shadow: none; }
.kb-krat:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-mechs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
@media (max-width: 620px) { .kb-mechs { grid-template-columns: 1fr; } }
.kb-mech { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border: 3px solid #6b4a24; border-radius: 16px; background: linear-gradient(#e7b27a, #b77a3c); color: #2a1a08; font-weight: 700; cursor: pointer; text-align: center; min-height: 104px; box-shadow: 0 4px 0 #6b4a24; touch-action: manipulation; }
.kb-mech svg { width: 44px; height: 44px; }
.kb-mech.doel { outline: 4px dashed var(--kb-glow); }
.kb-mech .geladen { font-size: 15px; font-weight: 400; }
.kb-mech:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-brug { display: flex; gap: 4px; height: 20px; margin: 6px 0; }
.kb-brug i { flex: 1; border-radius: 4px; background: #5b4a35; opacity: .4; }
.kb-brug i.aan { background: linear-gradient(#ffd68a, #c99553); opacity: 1; box-shadow: 0 0 10px var(--kb-glow); }

/* ---------- spiegelzaal ---------- */
.kb-spiegel { border: 6px solid #c79a4e; border-radius: 120px 120px 14px 14px; background: linear-gradient(160deg, #eafcff, #c9eef3 60%, #f6fdff); padding: 26px 18px 14px; margin: 6px 0; box-shadow: inset 0 0 30px #58ead455; }
.kb-spiegel .wie { font-size: 15px; font-weight: 700; color: var(--kb-teal); text-align: center; margin-bottom: 6px; }
.kb-stap { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 3px solid var(--mlp-rand); border-radius: 14px; background: #fff; padding: 8px 12px; margin: 6px 0; cursor: pointer; font-size: 19px; box-shadow: 0 3px 0 var(--mlp-rand); touch-action: manipulation; color: var(--kb-ink); }
.kb-stap .nr { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--kb-teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.kb-stap[data-uitslag="goed"] { border-color: var(--mlp-goed); background: var(--mlp-goed-zacht); }
.kb-stap[data-uitslag="fout"] { border-color: var(--mlp-fout); }
.kb-stap:focus-visible { outline: 4px solid var(--mlp-hoofd-licht); outline-offset: 2px; }
.kb-conclusie { text-align: center; font-size: 19px; margin-top: 4px; }
.kb-conclusie b { font-size: 24px; }

/* ---------- film ---------- */
.kb-film { position: fixed; inset: 0; z-index: 50; background: #041218; display: flex; align-items: center; justify-content: center; }
.kb-film video, .kb-film img { width: 100%; height: 100%; object-fit: contain; }
.kb-film img { object-fit: cover; filter: brightness(.8); }
.kb-film .onder { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(820px, calc(100% - 24px)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kb-film .ondertitel { background: #082a35e6; color: #fff8e8; border: 2px solid var(--kb-gold); border-radius: 14px; padding: 10px 18px; font-size: clamp(18px, 2.6vw, 24px); text-align: center; min-height: 1.5em; }
.kb-film .ondertitel:empty { display: none; }
.kb-film .overslaan { position: absolute; top: 14px; right: 14px; }

/* ---------- effecten ---------- */
.kb-deeltje { position: fixed; width: 9px; height: 9px; border-radius: 50%; background: #6bf1dc; z-index: 60; pointer-events: none; box-shadow: 0 0 8px #6bf1dc; }
.kb-vondst { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 10px 0; }
.kb-vondst img { width: 96px; height: 96px; animation: kb-draai 1.4s ease-out; }
@keyframes kb-draai { from { transform: scale(.2) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.kb-tandwiel { width: 54px; animation: kb-rond 6s linear infinite; }
@keyframes kb-rond { to { transform: rotate(360deg); } }

/* ---------- eind ---------- */
.kb-eind ul { text-align: left; }
.kb-eind .kolommen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
@media (max-width: 620px) { .kb-eind .kolommen { grid-template-columns: 1fr; } }
.kb-eind .vak { border: 2px solid var(--mlp-rand); border-radius: 14px; padding: 10px 14px; background: #fff; }
.kb-eind .vak h3 { margin: 0 0 4px; font-size: 19px; }
.kb-eind .vak.lukt { border-color: var(--mlp-goed); }
.kb-eind .vak.oefen { border-color: var(--mlp-half); }

.kb-verborgen { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.kb-alleen-mobiel { display: none; }
.kb-deurregel { align-items: center; gap: 8px; margin-top: 6px !important; padding: 4px 10px; border-radius: 10px; background: #123e43; color: #fff8e8; font-size: 16px; width: fit-content; }
.kb-deurregel svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 760px) { .kb-alleen-mobiel { display: flex; } .kb-grid > .kb-deurvak { display: none; } }
