:root {
  --achtergrond: #000;
  --tekst: #e9e6dd;
  --zacht: #9a9a92;
  --accent: #d24a2f;
  --kaart: #e8e4d8;
  --kaart-tekst: #1b1b1b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--achtergrond); color: var(--tekst); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
canvas { display: block; width: 100vw; height: 100vh; }

.laag { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .82); z-index: 10; padding: 16px; }
.verborgen { display: none !important; }

.kaartje { max-width: 560px; width: 100%; background: #0d0f11; border: 1px solid #2a2d30; padding: 28px; border-radius: 6px; }
.kaartje h1 { font-size: 2.4rem; margin: .2em 0 .4em; letter-spacing: .02em; }
.kaartje h2 { margin-top: 0; }
.kaartje ul { padding-left: 1.2em; line-height: 1.7; }
.klein { font-size: .82rem; color: var(--zacht); }
.knoppen { display: flex; gap: 12px; align-items: center; margin: 14px 0; flex-wrap: wrap; }

button { background: #1d2124; color: var(--tekst); border: 1px solid #3a3f44; padding: 9px 14px; border-radius: 4px;
  font: inherit; cursor: pointer; }
button:hover { border-color: #6a7076; }
button.hoofd { display: block; width: 100%; margin: 18px 0 10px; background: var(--accent); border-color: var(--accent);
  font-weight: 600; font-size: 1.05rem; }

.noodkaart { max-width: 620px; width: 100%; background: var(--kaart); color: var(--kaart-tekst); padding: 24px 28px;
  border: 3px solid #1b1b1b; font-family: "Courier New", ui-monospace, monospace; }
.noodkaart h2 { font-size: 1.05rem; margin: 0 0 8px; }
.noodkaart .klein { color: #444; }
.noodkaart .onder { margin-top: 18px; border-top: 1px solid #999; padding-top: 10px; }
#tikStap h3 { font-size: .95rem; margin: 16px 0 8px; }
#tikStap ol { list-style: none; padding: 0; margin: 0; columns: 2; }
#tikStap li { padding: 3px 0; }
#tikStap b { display: inline-block; min-width: 1.6em; }
#tikStap .gekozen { color: #555; font-size: .85rem; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); color: var(--zacht); font-size: .9rem;
  text-shadow: 0 0 4px #000; }
#voortgang { position: absolute; left: 50%; top: 62%; width: 160px; height: 4px; transform: translateX(-50%);
  background: #222; display: none; }
#voortgang > div { height: 100%; width: 0; background: var(--tekst); }
#zaklamp { position: absolute; right: 18px; bottom: 16px; font-size: .72rem; color: #555; display: flex; gap: 8px; align-items: center; }
#zaklamp > div { width: 90px; height: 4px; background: #1a1a1a; }
#zaklampBalk { height: 100%; width: 100%; background: #8d8a7c; }

#ondertitel { position: fixed; left: 50%; bottom: 9%; transform: translateX(-50%); max-width: min(760px, 92vw);
  text-align: center; font-size: 1.15rem; line-height: 1.45; text-shadow: 0 0 6px #000, 0 0 2px #000; z-index: 6; }
#ondertitel em { color: #c9c4b4; }
#melding { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); max-width: min(680px, 92vw); text-align: center;
  font-size: .98rem; color: #d8d4c8; background: rgba(0, 0, 0, .6); padding: 8px 14px; border-radius: 4px; opacity: 0;
  transition: opacity .4s; z-index: 6; }
#melding.zichtbaar { opacity: 1; }

/* ---------- Panelen ---------- */
.paneel { max-width: 640px; width: 100%; background: #14171a; border: 2px solid #3a3f44; border-radius: 6px; padding: 22px 24px;
  max-height: 92vh; overflow: auto; }
.paneel h2 { margin: 0 0 12px; font-size: 1.1rem; letter-spacing: .04em; }
.paneel h3 { margin: 12px 0 6px; }
.paneel pre { white-space: pre-wrap; font-size: .9rem; color: #7dff9c; background: #031006; padding: 12px; border: 1px solid #0f3a1a; }
.paneel ul { line-height: 1.6; padding-left: 1.2em; }
.paneel .meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; font-size: .92rem; }
.paneel .balk { height: 6px; background: #222; margin-top: 4px; }
.paneel .balk > div { height: 100%; background: #c9b45a; }
.paneel .schakels { display: grid; gap: 6px; }
.paneel .schakel { display: grid; grid-template-columns: 2em 1.6fr 1.4fr 4.5em; align-items: center; gap: 8px; text-align: left; }
.paneel .schakel.aan { border-color: #6fbf73; background: #1c2a1d; }
.paneel .schakel .stand { text-align: right; font-weight: 600; }
.paneel .schakel.ingedrukt { transform: translateY(1px); border-color: #e0a040; background: #2a2214; }
.paneel .gloei { margin-top: 10px; font-size: .9rem; }
.paneel .gloei .balk > div { background: #e0a040; transition: width .25s linear; }
.paneel .hendel { margin-top: 14px; width: 100%; background: #3a2a14; border-color: #8a6a2a; font-weight: 600; }
.paneel .lampjes { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: .9rem; }
.lamp { color: #333; }
.lamp.groen, .groen { color: #5fe07a; }
.lamp.oranje { color: #ffaa33; }
.lamp.rood, .rood { color: #ff4a3a; }
.picto { font-size: 1.25rem; display: inline-block; min-width: 1.4em; text-align: center; }
.kaart-scheur { margin: 14px 0 6px; padding: 10px 12px; background: var(--kaart); color: var(--kaart-tekst);
  clip-path: polygon(0 0, 100% 0, 97% 100%, 70% 88%, 40% 100%, 12% 90%, 0 100%); font-family: "Courier New", monospace; font-size: .85rem; }
.hand { font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; }
.paneel.boek { background: #e9e3d2; color: #222; border-color: #b9ad8c; }
.paneel.boek .klein { color: #555; }
.boektekst { font-size: 1.1rem; line-height: 1.6; }
.schets { font-size: 1.2rem; }
.knoppenrij { display: flex; gap: 10px; margin-top: 14px; }
.kaartje.code { text-align: center; }
.grootcode { font-size: 2.2rem; letter-spacing: .12em; font-weight: 700; color: #9fe3ff; margin: 10px 0; }
button:disabled { opacity: .4; cursor: default; }

/* ---------- Itembalk ---------- */
#itembalk { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
#itembalk .vak { position: relative; width: 64px; height: 64px; background: rgba(20, 22, 25, .82); border: 2px solid #3a3f44;
  border-radius: 4px; display: grid; place-items: center; }
#itembalk .vak.gekozen { border-color: #f2efe6; box-shadow: 0 0 0 2px rgba(242, 239, 230, .25); }
#itembalk .vak.brandt .icoon { filter: drop-shadow(0 0 6px #ffe7a8); }
#itembalk .nr { position: absolute; left: 4px; top: 2px; font-size: .7rem; color: #9a9a92; }
#itembalk .icoon { font-size: 1.7rem; line-height: 1; }
#itembalk .naam { position: absolute; bottom: 2px; font-size: .58rem; color: #b8b4a8; }
#itembalk .batterij { position: absolute; left: 6px; right: 6px; bottom: -7px; height: 3px; background: #222; }
#itembalk .batterij > div { height: 100%; background: #e8d48a; }
.bediening { width: 100%; border-collapse: collapse; margin: 10px 0 6px; font-size: .92rem; }
.bediening td { padding: 4px 6px; vertical-align: top; border-bottom: 1px solid #22262a; }
.bediening td:first-child { white-space: nowrap; width: 34%; }
#opnieuwPauze { width: 100%; }

.veld { display: block; margin: 16px 0 4px; font-size: .95rem; }
.veld input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-size: 1.1rem;
  letter-spacing: .08em; text-transform: uppercase; background: #0a0c0e; color: var(--tekst); border: 1px solid #3a3f44; border-radius: 4px; }
.fout { color: #ff7a6a; min-height: 1.2em; margin: 6px 0; font-size: .9rem; }

/* ---------- Gesprekken ---------- */
.paneel.gesprek .regel { font-size: 1.1rem; line-height: 1.55; margin: 8px 0 16px; padding: 12px 14px; background: #0c0e10;
  border-left: 3px solid #c9b45a; }
.paneel.gesprek .keuzes { display: grid; gap: 6px; }
.paneel.gesprek .keuze { text-align: left; }
.paneel.gesprek .keuze b { display: inline-block; min-width: 1.5em; color: #c9b45a; }
.paneel.gesprek .keuze.gesteld { color: #9a9a92; }

a.knop { display: block; text-align: center; text-decoration: none; color: var(--tekst); background: var(--accent);
  border: 1px solid var(--accent); padding: 10px 14px; border-radius: 4px; margin: 14px 0 10px; font-weight: 600; }
#opnieuw { width: 100%; }
