/* Bovenbalk, bedieningspaneel en lont (scripts/hud-paneel-lont.md). Laatste stijlbestand.
   Maatstaf: alleen transform en opacity bewegen, alles kort en onderbreekbaar, reduced motion
   direct. Kleuren uit tokens.css; contrast gemeten in scripts/palet-meting.mjs. */

/* ───────── Geen balken: de grot vult het hele scherm ─────────
   Bovenin zweven losse eilandjes (merk, kamer, blokjes, Diepte, Stand, geluid, Verlaten), onderin
   zweeft het bedieningspaneel of de knop. Waar niets staat, gaat een klik gewoon door. Elk
   eilandje is licht doorschijnend steen (--color-paper) met een zachte schaduw: leesbaar boven
   de lichte lucht bij de ingang én in de donkere grot (gemeten). */
.shell { grid-template-rows: minmax(0, 1fr); }
.shell > .main { grid-row: 1; grid-column: 1; }
.topbar, .dock { position: absolute; left: 0; right: 0; z-index: 8; background: none; border: 0; pointer-events: none; }
.topbar { top: 0; min-height: 0; padding: 8px 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; column-gap: 12px; }
.topbar > * > *, .topbar-actions > * { pointer-events: auto; }
.dock { bottom: 0; padding: 0 16px 10px; }
.dock > * { pointer-events: auto; }
.dock::before { display: none; }
.keyboard-open .dock { padding-bottom: 6px; }
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-mid { justify-self: center; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .wordmark, .topbar .room-chip, .hud-rounds, .topbar .icon-btn {
  box-sizing: border-box; height: 42px; border-radius: 10px; background: var(--color-paper);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35), inset 0 0 0 1px var(--color-rule-soft);
}
.topbar .wordmark { margin-right: 0; padding: 0 14px 0 11px; font-size: 22px; }
.topbar .wordmark svg { width: 22px; height: 22px; }
.topbar .room-chip { display: inline-flex; align-items: center; gap: 0.3em; padding: 0 12px; }
.topbar .icon-btn { min-height: 42px; padding: 0 12px; }
@media (hover: hover) and (pointer: fine) { .topbar .icon-btn:hover { background: var(--color-paper-3); } }
/* Startscherm en lobby: de inhoud blijft vrij van de zwevende rand. */
body[data-phase="home"] .main, body[data-phase="lobby"] .main, .start-ghost > .main.start-ghost-main { padding-top: 64px; padding-bottom: calc(var(--dock-h, 72px) + 14px); }
body[data-phase="home"] .dock-inner, body[data-phase="lobby"] .dock-inner, .start-ghost > .start-ghost-dock .dock-inner { margin-inline: 14px; }

/* Interface boven de grot schuift onder de zwevende bovenrand uit; de liniaal laat die strook vrij. */
.question-card { top: 62px; }
.info-card { top: 62px; max-height: calc(100% - 62px - 112px); }
.minimap { top: 62px; }
.finale-caption { top: 62px; }
.cave-ruler-marks { -webkit-mask-image: linear-gradient(to bottom, transparent 54px, #000 70px); mask-image: linear-gradient(to bottom, transparent 54px, #000 70px); }

/* ───────── Rondeblokjes ─────────
   Vaste ruimte tussen de blokjes (gap); de huidige ronde is echt breder en duwt de rest opzij,
   dus nooit overlap, ook niet bij 10 vragen. Ring en gloed liggen binnen de eigen maat (de gloed
   blijft kleiner dan de tussenruimte). Vulling en gloed: alleen opacity en schaal. */
.hud-rounds { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0 14px; }
.hud-blocks { display: flex; align-items: center; gap: 7px; }
.hud-block { position: relative; flex: none; width: 16px; height: 8px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--color-rule-strong); transition: width 220ms var(--ease-out); }
.hud-block.is-current { width: 26px; height: 10px; }
.hud-block::before, .hud-block::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.hud-block::before { background: var(--color-ink-2); opacity: 0; scale: 0.4; transition: opacity 220ms var(--ease-out), scale 220ms var(--ease-out); }
.hud-block::after { box-shadow: inset 0 0 0 1.5px var(--color-accent), 0 0 4px rgb(105 234 248 / 0.6); background: rgb(105 234 248 / 0.18); opacity: 0; transition: opacity 260ms var(--ease-out); }
.hud-block.is-done::before { opacity: 1; scale: 1; }
.hud-block.is-current::after { opacity: 1; }
.hud-block.is-current.is-done::before { background: var(--color-accent); }
.hud-rounds-label { font-size: 11px; line-height: 1; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--color-ink-2); white-space: nowrap; }

/* Steenpanelen Diepte en Stand: donker metaal (dicht), met schaduw zodat ze los zweven. Waarden
   in tabelcijfers, zodat een tellende diepte niet heen en weer schuift. */
.hud-stats { display: flex; align-items: stretch; gap: 8px; }
.hud-panel {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 42px; box-sizing: border-box;
  padding: 3px 12px 4px; border-radius: 10px;
  background: linear-gradient(in oklch to bottom, var(--metal-top), var(--metal-bottom));
  box-shadow: inset 0 1px 0 rgb(230 239 241 / 0.07), inset 0 0 0 1px var(--color-rule-soft), 0 2px 10px rgb(0 0 0 / 0.35);
}
.hud-label { font-size: 10.5px; line-height: 1.1; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; }
.hud-value { font: 600 17px/1.15 var(--font-display); color: var(--color-ink); white-space: nowrap; }
.hud-depth .hud-value { display: inline-block; min-width: 4.6ch; transition: color 400ms ease-out; }
/* Eigen Goudklomp: de diepte licht goud op en springt mee met de melding (hud.js: bump). */
.hud-depth.is-gold .hud-value { color: var(--gold); transition: color 120ms ease-out; }
.hud-stand-row { display: flex; align-items: baseline; gap: 9px; }
.hud-place { display: inline-block; font-size: 13px; font-weight: 750; color: var(--color-accent); white-space: nowrap; }
.hud-place[hidden] { display: none; }
@media (max-width: 1100px) {
  .topbar.in-room .wordmark-text, .topbar.in-room .ib-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr; }
  .topbar-mid { display: none; }
  .hud-place { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hud-block, .hud-block::before, .hud-block::after { transition: none; }
}

/* ───────── Bedieningspaneel: zweeft gecentreerd boven de grot ─────────
   Donker metaal met klinknagels in de hoeken en een zachte meerglansrand; het invulveld is groot
   en goed leesbaar. Onderaan loopt de lont, rechts staat de hendel met de tijd op zijn voet.
   Alle toestanden (invullen, ingestuurd, meekijken, om de beurt) gebruiken hetzelfde paneel. */
/* Vaste buitenmaat in alle toestanden (leeg, typend, "Bedoelde je…", ingestuurd, tijd om,
   meekijken): de breedte hangt nooit van de inhoud af, dus de hendel staat altijd op dezelfde
   plek en de omklap blijft zichtbaar. 700 px is ~78 % van de vorige 900 px. */
.control-panel {
  position: relative; box-sizing: border-box; flex: none; width: min(700px, calc(100vw - 32px)); max-width: none; margin-inline: auto;
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 6px 12px 12px 16px; border-radius: 16px;
  background: linear-gradient(in oklch to bottom, var(--metal-top), var(--metal-bottom));
  box-shadow: inset 0 1px 0 rgb(230 239 241 / 0.08), inset 0 0 0 1px rgb(105 234 248 / 0.2), 0 0 22px -8px rgb(105 234 248 / 0.45), 0 8px 24px rgb(0 0 0 / 0.45);
}
body[data-phase] .dock-inner.control-panel { min-height: 84px; height: 84px; }
.control-panel:focus-within { box-shadow: inset 0 1px 0 rgb(230 239 241 / 0.08), inset 0 0 0 1px rgb(105 234 248 / 0.34), 0 0 24px -6px rgb(105 234 248 / 0.6), 0 8px 24px rgb(0 0 0 / 0.45); }
/* Klinknagels: vier kleine bolletjes, één laag. */
.control-panel::after {
  content: ''; position: absolute; inset: 5px; pointer-events: none;
  --rivet: radial-gradient(circle at 40% 35%, #C8D3D7 0 0.7px, #74848A 1.4px, #2A3337 2.4px, rgb(0 0 0 / 0) 2.9px);
  background: var(--rivet) left top / 6px 6px no-repeat, var(--rivet) right top / 6px 6px no-repeat, var(--rivet) left bottom / 6px 6px no-repeat, var(--rivet) right bottom / 6px 6px no-repeat;
}
/* Laatste 5 s: de onderbalk is weg, dus het paneel gloeit zelf rood. Een gloedlaag rondom (niet
   over de tekst); alleen de opacity beweegt, op de bestaande flitsen (ui-details.js: dockGlow). */
.control-panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 1.5px rgb(253 114 112 / 0.85), 0 0 26px 6px rgb(253 114 112 / 0.6), 0 0 60px 10px rgb(253 114 112 / 0.25);
}
.control-panel[data-urgency]::before { opacity: 0.45; }
.control-panel[data-urgency] { box-shadow: inset 0 1px 0 rgb(230 239 241 / 0.08), inset 0 0 0 1px rgb(253 114 112 / 0.5), 0 8px 24px rgb(0 0 0 / 0.45); }
@media (prefers-reduced-motion: reduce) { .control-panel[data-urgency]::before { opacity: 0.55; } }
.control-panel .composer { position: static; flex: 1; display: flex; align-items: center; gap: 14px; max-width: none; min-width: 0; }
.control-panel .composer .input {
  flex: 1; min-width: 0; height: 52px; font-size: 20px; font-weight: 600; letter-spacing: 0.005em;
  background: var(--metal-field); box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.45);
}
.control-panel .composer .input::placeholder { font-weight: 500; }
/* Het meldingenballonnetje zweeft boven het paneel (de positie hoort bij het paneel). */
.control-panel .composer .answer-feedback { left: 14px; }
/* Het vastgezette antwoord neemt de plek en de maat van het invulveld over (52 px hoog, zelfde
   breedte); een lang antwoord wordt ingekort met een beletselteken, de volle tekst staat in title. */
.control-panel > .sent {
  flex: 1; min-width: 0; box-sizing: border-box; height: 52px; min-height: 0; margin: 0; padding: 0 14px; gap: 10px;
  border-radius: 10px; background: var(--metal-field); box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.45), inset 0 0 0 2px var(--color-rule);
}
.control-panel > .sent > div { min-width: 0; flex: 1; }
.control-panel > .sent p { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.25; }
.control-panel > .sent .answer { overflow-wrap: normal; }
.control-panel .panel-hint { flex: 1; margin: 0; font-size: 14px; color: var(--color-ink-2); }
/* Het getal: op de voet van de hendel. Zonder hendel (meekijken, niet aan de beurt) klein rechts. */
.control-panel .timer { position: static; display: block; flex: none; }
.control-panel .timer-num { display: block; min-width: 3.6em; text-align: right; font-size: 15px; font-weight: 800; color: var(--color-ink-2); white-space: nowrap; }
.control-panel:has(.lever) .timer-num { display: none; }
.control-panel .timer[data-phase="warm"] .timer-num { color: var(--timer-warm); }
.control-panel .timer[data-phase="alarm"] .timer-num, .control-panel .timer[data-phase="pulse"] .timer-num { color: var(--timer-alarm-text); }

/* Knoppen die vroeger in de onderbalk stonden, zweven nu in het midden (uitslag, eindstand). */
/* Niet voor het paneel: dat blijft bij de wissel naar de uitslag nog even staan (de omklap). */
body[data-phase="reveal"] .dock-inner:not(.control-panel), body[data-phase="final"] .dock-inner:not(.control-panel) {
  width: fit-content; max-width: calc(100% - 32px); margin-inline: auto; min-height: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
body[data-phase="final"] .dock-inner:not(.control-panel) { flex-direction: row; flex-wrap: wrap; gap: 10px; }
body[data-phase="reveal"] .dock-inner > .btn--block, body[data-phase="final"] .dock-inner > .btn { width: auto; min-width: 240px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.45); }
.dock .btn--quiet { background: var(--color-paper); box-shadow: 0 8px 24px rgb(0 0 0 / 0.45), inset 0 0 0 2px var(--color-rule); }
body[data-phase="reveal"] .dock-inner > .hint { margin: 0; padding: 3px 10px; border-radius: 8px; background: var(--color-paper); font-size: 12px; color: var(--color-ink-2); box-shadow: 0 2px 8px rgb(0 0 0 / 0.3); }
body[data-phase="reveal"] .dock-inner > .hint:empty { display: none; }

/* ───────── De gashendel "Zakken" (lever.js) ─────────
   Een halfronde voet van donker ijzer met messing randen en klinknagels; daaruit steekt een
   gebogen stang schuin naar voren met een rood glanzend bolletje. De stang draait om de as onder
   in de voet (alleen transform) en ligt áchter de voet. De knop zelf is onzichtbaar; focus krijgt
   een ring om de hele hendel. Leeg veld of uitgeschakeld: stang en bolletje gedimd. */
.lever {
  position: relative; flex: none; display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  width: 92px; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; transition: transform 140ms var(--ease-out);
}
.lever:active:not(:disabled):not(.is-dragging) { transform: scale(0.97); transition-duration: 90ms; }
.lever:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.lever:disabled { cursor: default; }
.lever.is-dragging { cursor: grabbing; }
.lever-art { position: relative; display: block; width: 92px; height: 52px; }
.lever-arm { position: absolute; left: 46px; top: 47px; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.lever-rod { position: absolute; left: -2.5px; top: -24px; width: 5px; height: 26px; border-radius: 3px; background: linear-gradient(to right, #5B6266, #C3CBCE 45%, #6E767A); }
.lever-rod--top { top: -40px; height: 18px; transform-origin: 50% 100%; rotate: 24deg; translate: 0 2px; }
.lever-knob { position: absolute; left: 1px; top: -51px; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #FFD2CC 0 10%, #F0473B 34%, #A8160F 78%, #6E0B07); box-shadow: 0 1px 3px rgb(0 0 0 / 0.6); }
.lever-base {
  position: absolute; left: 20px; top: 22px; width: 52px; height: 26px; box-sizing: border-box;
  border-radius: 26px 26px 0 0; border: 2px solid var(--brass); border-bottom: 0;
  background: linear-gradient(in oklch to bottom, var(--iron-top), var(--iron-bottom));
  box-shadow: inset 0 2px 2px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.5);
}
/* Klinknagels op de voet. */
.lever-base::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  --rv: radial-gradient(circle at 40% 35%, #F3DDA8 0 0.6px, #B58B45 1.3px, #5A4220 2.2px, rgb(0 0 0 / 0) 2.6px);
  background: var(--rv) 3px calc(100% - 4px) / 5px 5px no-repeat, var(--rv) calc(100% - 3px) calc(100% - 4px) / 5px 5px no-repeat;
}
.lever-num { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-size: 12.5px; line-height: 1; font-weight: 800; color: var(--color-ink-2); white-space: nowrap; }
.lever-num[data-phase="warm"] { color: var(--timer-warm); }
.lever-num[data-phase="alarm"], .lever-num[data-phase="pulse"], .lever-num[data-phase="timeout"] { color: var(--timer-alarm-text); }
.lever-num:empty { display: none; }
.lever-num.is-long { top: 9.5px; font-size: 9.5px; letter-spacing: 0.01em; }
.lever-foot { position: absolute; left: 14px; top: 47px; width: 64px; height: 5px; border-radius: 2px; background: linear-gradient(to bottom, #E2C27F, var(--brass) 45%, #7D5E2C); box-shadow: 0 1px 2px rgb(0 0 0 / 0.5); }
.lever-text { font-size: 11px; line-height: 1.1; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-ink); white-space: nowrap; }
.lever:not(.is-ready):not(.is-down) .lever-arm, .lever:disabled:not(.is-down) .lever-arm { opacity: 0.45; }
.lever:not(.is-ready):not(.is-down) .lever-text, .lever:disabled:not(.is-down) .lever-text, .lever.is-locked .lever-text { color: var(--color-muted); }
@media (prefers-reduced-motion: reduce) {
  .lever { transition: none; }
  .lever:active:not(:disabled):not(.is-dragging) { transform: none; }
}

/* ───────── De lont (fuse.js) ─────────
   Geïllustreerd gedraaid touw met omlijning, zoals het logo (referentie: scripts/hud-paneel-lont.md).
   Het touw is één keer getekend als SVG-tegel van één streng (8 × 5 px, naadloos herhaald; scherp
   op elke pixeldichtheid): camel strengen met lichtere toppen, donkere naden, een smalle turquoise
   meerglans onderaan elke streng. Links van de vlam ligt hetzelfde touw verkoold (eigen tegel),
   met gloeiende scheurtjes die over ~1–2 touwdiktes naar zwart uitdoven. Alleen het brandpunt
   schuift (transform); het patroon zelf beweegt nooit en er draait geen filter per frame. */
.fuse {
  position: absolute; left: 18px; right: 18px; bottom: 4px; height: 5px; pointer-events: none;
--fuse-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='s0' gradientUnits='userSpaceOnUse' x1='-24' y1='9' x2='-6' y2='23'%3E%3Cstop offset='0' stop-color='%23D9A867'/%3E%3Cstop offset='0.18' stop-color='%23F6D69C'/%3E%3Cstop offset='0.5' stop-color='%23C8975A'/%3E%3Cstop offset='1' stop-color='%2376502A'/%3E%3C/linearGradient%3E%3ClinearGradient id='s1' gradientUnits='userSpaceOnUse' x1='8' y1='9' x2='26' y2='23'%3E%3Cstop offset='0' stop-color='%23D9A867'/%3E%3Cstop offset='0.18' stop-color='%23F6D69C'/%3E%3Cstop offset='0.5' stop-color='%23C8975A'/%3E%3Cstop offset='1' stop-color='%2376502A'/%3E%3C/linearGradient%3E%3ClinearGradient id='s2' gradientUnits='userSpaceOnUse' x1='40' y1='9' x2='58' y2='23'%3E%3Cstop offset='0' stop-color='%23D9A867'/%3E%3Cstop offset='0.18' stop-color='%23F6D69C'/%3E%3Cstop offset='0.5' stop-color='%23C8975A'/%3E%3Cstop offset='1' stop-color='%2376502A'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='32' height='20' fill='%231A1410'/%3E%3Cpath d='M-31 20C-25 15 -21 5 -15 0L14 0C8 5 4 15 -2 20Z' fill='url(%23s0)'/%3E%3Cpath d='M1 20C7 15 11 5 17 0L46 0C40 5 36 15 30 20Z' fill='url(%23s1)'/%3E%3Cpath d='M33 20C39 15 43 5 49 0L78 0C72 5 68 15 62 20Z' fill='url(%23s2)'/%3E%3Cpath d='M-23 18.4C-18 17.8 -12 17.8 -5 18.6' fill='none' stroke='%233FB8A8' stroke-width='2.6' stroke-linecap='round'/%3E%3Cpath d='M9 18.4C14 17.8 20 17.8 27 18.6' fill='none' stroke='%233FB8A8' stroke-width='2.6' stroke-linecap='round'/%3E%3Cpath d='M41 18.4C46 17.8 52 17.8 59 18.6' fill='none' stroke='%233FB8A8' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --fuse-tile-burnt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='s0' gradientUnits='userSpaceOnUse' x1='-24' y1='9' x2='-6' y2='23'%3E%3Cstop offset='0' stop-color='%233A312A'/%3E%3Cstop offset='0.18' stop-color='%2354473C'/%3E%3Cstop offset='0.5' stop-color='%232A2420'/%3E%3Cstop offset='1' stop-color='%23110D0A'/%3E%3C/linearGradient%3E%3ClinearGradient id='s1' gradientUnits='userSpaceOnUse' x1='8' y1='9' x2='26' y2='23'%3E%3Cstop offset='0' stop-color='%233A312A'/%3E%3Cstop offset='0.18' stop-color='%2354473C'/%3E%3Cstop offset='0.5' stop-color='%232A2420'/%3E%3Cstop offset='1' stop-color='%23110D0A'/%3E%3C/linearGradient%3E%3ClinearGradient id='s2' gradientUnits='userSpaceOnUse' x1='40' y1='9' x2='58' y2='23'%3E%3Cstop offset='0' stop-color='%233A312A'/%3E%3Cstop offset='0.18' stop-color='%2354473C'/%3E%3Cstop offset='0.5' stop-color='%232A2420'/%3E%3Cstop offset='1' stop-color='%23110D0A'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='32' height='20' fill='%230B0907'/%3E%3Cpath d='M-31 20C-25 15 -21 5 -15 0L14 0C8 5 4 15 -2 20Z' fill='url(%23s0)'/%3E%3Cpath d='M1 20C7 15 11 5 17 0L46 0C40 5 36 15 30 20Z' fill='url(%23s1)'/%3E%3Cpath d='M33 20C39 15 43 5 49 0L78 0C72 5 68 15 62 20Z' fill='url(%23s2)'/%3E%3C/svg%3E");
  --fuse-tile-cracks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20' preserveAspectRatio='none'%3E%3Cdefs%3E%3C/defs%3E%3Cpath d='M1 15L6 12.5L9 14L14 10.5' fill='none' stroke='%23FF6A1A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17 6L21 8.5L25 6.5L30 9' fill='none' stroke='%23FF6A1A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M8 4L11 6L10 8.5' fill='none' stroke='%23FF6A1A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 16L24 13.5L28 15' fill='none' stroke='%23FF6A1A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M1 15L6 12.5L9 14L14 10.5' fill='none' stroke='%23FFC46B' stroke-width='.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17 6L21 8.5L25 6.5L30 9' fill='none' stroke='%23FFC46B' stroke-width='.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M8 4L11 6L10 8.5' fill='none' stroke='%23FFC46B' stroke-width='.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 16L24 13.5L28 15' fill='none' stroke='%23FFC46B' stroke-width='.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Met hendel loopt de lont tot vlak voor zijn voet: de vlam komt nooit onder het woord Zakken. */
.control-panel:has(.lever) .fuse { right: 112px; }
/* Omlijning rond het hele touw (heel en verkoold), zoals het logo. Alleen een schaduw buiten de rand. */
.fuse::before { content: ''; position: absolute; inset: 0; border-radius: 3px; box-shadow: 0 0 0 0.8px var(--fuse-line), 0 1px 1.5px rgb(0 0 0 / 0.55); }
/* Verkoold touw over de hele lengte; het hele touw ligt erover en wijkt met het brandpunt. */
.fuse-ash { position: absolute; inset: 0; border-radius: 3px; background: var(--fuse-tile-burnt) 0 0 / 8px 5px repeat-x; }
.fuse-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 3px; }
.fuse-wrap { position: absolute; inset: 0; overflow: hidden; will-change: transform; }
.fuse-rope { position: absolute; inset: 0; border-radius: 3px; will-change: transform; transition: opacity 160ms var(--ease-out); background: var(--fuse-tile) 0 0 / 8px 5px repeat-x; }
.fuse-head { position: absolute; inset: 0; will-change: transform; }
/* Gloeiende scheurtjes vlak achter de vlam: een vaste tegel, naar links uitlopend naar zwart (masker),
   met warme gloed op het touw. Schuift mee met het brandpunt. */
.fuse-ember {
  position: absolute; right: 0; top: 0; width: 14px; height: 5px; border-radius: 3px 0 0 3px;
  background: var(--fuse-tile-cracks) 0 0 / 8px 5px repeat-x, linear-gradient(to right, rgb(255 106 26 / 0), rgb(255 106 26 / 0.3) 60%, rgb(255 150 60 / 0.75));
  -webkit-mask-image: linear-gradient(to right, transparent, #000 70%); mask-image: linear-gradient(to right, transparent, #000 70%);
}
/* Het vuur: oorsprong op het brandpunt (rechterkant van de kop). */
.fuse-spark { --speed: 1; position: absolute; right: 0; top: 50%; width: 0; height: 0; transition: opacity 120ms var(--ease-out), scale 300ms var(--ease-out); }
/* Kleine gloed op het touw rond het brandpunt. */
.fuse-glow { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, rgb(255 170 70 / 0.6), rgb(255 106 26 / 0.18) 45%, rgb(255 106 26 / 0) 70%); opacity: 0.75; animation: fuse-flicker calc(310ms * var(--speed)) ease-in-out infinite alternate; }
@keyframes fuse-flicker { 0% { opacity: 0.55; } 40% { opacity: 0.9; } 70% { opacity: 0.65; } 100% { opacity: 0.82; } }
/* Druppelvlam met wit-gele kern en oranje-rode rand: twee lagen, elk een vierkantje met één scherpe
   hoek dat 45° gedraaid is. Zacht flakkeren: zwaaien en rekken met verschillende periodes. */
.flame-sway { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; animation: flame-sway calc(530ms * var(--speed)) ease-in-out infinite alternate; }
.flame-flick { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; animation: flame-flick calc(370ms * var(--speed)) ease-in-out infinite alternate; }
.flame-outer, .flame-core { position: absolute; border-radius: 50% 0 50% 50%; rotate: -45deg; }
.flame-outer { left: -6px; top: -14.5px; width: 12px; height: 12px; background: radial-gradient(circle at 64% 36%, #FFE27A 0 18%, #FF9F2E 44%, #F2531C 70%, #C9301A 92%); box-shadow: 0 0 6px 1px rgb(255 120 40 / 0.55); }
.flame-core { left: -3px; top: -8.5px; width: 6px; height: 6px; background: radial-gradient(circle at 60% 40%, #FFFFFF 0 38%, #FFF0A0 85%); }
@keyframes flame-sway { 0% { transform: rotate(-6deg) translateX(-0.4px); } 35% { transform: rotate(4deg) translateX(0.3px); } 65% { transform: rotate(-3deg); } 100% { transform: rotate(5deg) translateX(0.4px); } }
@keyframes flame-flick { 0% { transform: scale(1.05, 0.9); } 30% { transform: scale(0.95, 1.08); } 55% { transform: scale(1.02, 0.96); } 80% { transform: scale(0.94, 1.12); } 100% { transform: scale(1, 1.02); } }
/* Vonkjes stijgen op en vervagen; elk zijn eigen richting, grootte en ritme (fuse.js: SPARKS). */
.fuse-bit {
  --k: 1; position: absolute; left: -1.25px; top: -6px; width: 2.5px; height: 2.5px; border-radius: 50%; background: radial-gradient(circle, #FFE7A0 0 35%, #FF8A2A 80%); opacity: 0;
  animation: fuse-bit calc(var(--d) * var(--speed)) cubic-bezier(.2,.7,.3,1) var(--delay) infinite;
}
@keyframes fuse-bit {
  0% { opacity: 0; transform: translate(0, 0) scale(var(--s)); }
  6% { opacity: 1; transform: translate(0, 0) scale(var(--s)); }
  60% { opacity: 0; transform: translate(calc(var(--x) * var(--k) * 0.6), calc((var(--y) - 4px) * var(--k))) scale(0.3); }
  100% { opacity: 0; transform: translate(calc(var(--x) * var(--k) * 0.6), calc((var(--y) - 4px) * var(--k))) scale(0.3); }
}
.fuse-bit--5, .fuse-bit--6, .fuse-bit--7, .fuse-bit--8, .fuse-bit--9, .fuse-bit--10 { display: none; }
/* Laatste 10 s: groter vuur, meer vonken. Laatste 5 s: sputterend (sneller, onrustiger) en fel. */
.timer[data-phase="warm"] .fuse-spark { scale: 1.2; --speed: 0.8; }
.timer[data-phase="warm"] .fuse-bit { --k: 1.3; }
.timer[data-phase="warm"] :is(.fuse-bit--5, .fuse-bit--6, .fuse-bit--7) { display: block; }
.timer:is([data-phase="alarm"], [data-phase="pulse"]) .fuse-spark { scale: 1.45; --speed: 0.55; }
.timer:is([data-phase="alarm"], [data-phase="pulse"]) .fuse-bit { --k: 1.6; display: block; }
.timer:is([data-phase="alarm"], [data-phase="pulse"]) .fuse-glow { background: radial-gradient(circle, rgb(255 175 95 / 0.78), rgb(255 90 40 / 0.22) 45%, rgb(255 90 60 / 0) 70%); animation-name: fuse-sputter; }
@keyframes fuse-sputter { 0% { opacity: 0.9; } 18% { opacity: 0.45; } 30% { opacity: 1; } 52% { opacity: 0.6; } 64% { opacity: 0.95; } 100% { opacity: 0.7; } }
/* Niet aangestoken (meekijken, al ingestuurd) of gedoofd: geen vuur en geen gloeiende scheurtjes, het touw dof. */
.fuse:not([data-state="lit"]) :is(.fuse-spark, .fuse-ember) { opacity: 0; }
.fuse:not([data-state="lit"]) :is(.fuse-bit, .fuse-glow, .flame-sway, .flame-flick) { animation: none; }
.fuse[data-state="idle"] .fuse-rope, .fuse[data-state="out"] .fuse-rope { opacity: 0.55; }
.fuse-ember { transition: opacity 160ms var(--ease-out); }
.fuse-puff { position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, rgb(170 180 184 / 0.75), rgb(120 130 134 / 0) 70%); opacity: 0; pointer-events: none; }

/* Ontploffing op 0: flits, vonken en rook vanaf de plek van de vonk (fuse.js: explode). */
.fuse-blast { position: absolute; width: 0; height: 0; z-index: 8; pointer-events: none; }
.blast-flash { position: absolute; left: 0; top: 0; width: 120px; height: 120px; border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; background: radial-gradient(circle, #FFFFFF 0 16%, #FFE9A6 36%, rgb(255 170 70 / 0.5) 56%, rgb(255 120 50 / 0) 72%); }
.blast-spark { position: absolute; left: 0; top: 0; width: 5px; height: 5px; border-radius: 50%; background: #FFE3A0; box-shadow: 0 0 6px 1px #FF9F43; opacity: 0; }
.blast-smoke { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; opacity: 0; background: radial-gradient(circle, rgb(165 174 178 / 0.85), rgb(120 130 134 / 0) 70%); }

/* Reduced motion: een rustige vlam zonder flakkeren en zonder vonkjes; het verkoolde deel groeit gewoon mee. */
@media (prefers-reduced-motion: reduce) {
  .fuse-bit { display: none; }
  .fuse-glow { animation: none; }
  .flame-sway, .flame-flick { animation: none; }
  .fuse-spark, .fuse-rope { transition: none; }
}

/* ───────── Rode schermrand in de laatste 5 s (fuse.js: vignetteGlow) ─────────
   Een vaste laag in de grot (app.js: placeVignette), boven de rotswanden en onder cabines,
   randlabels, liniaal en kaarten: het rood loopt van de rand van het speelveld naar binnen uit en
   ligt nooit over tekst; samen met het rood gloeiende paneel. Alleen de opacity verandert: rust
   0,6, per flits kort fel. Reduced motion: vaste tint. */
.vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  --v: rgb(253 114 112 / var(--vignette-edge)); --v0: rgb(253 114 112 / 0);
  background:
    linear-gradient(in oklch to right, var(--v), var(--v0) 72px) left / 72px 100% no-repeat,
    linear-gradient(in oklch to left, var(--v), var(--v0) 72px) right / 72px 100% no-repeat,
    linear-gradient(in oklch to bottom, var(--v), var(--v0) 56px) top / 100% 56px no-repeat,
    linear-gradient(in oklch to top, var(--v), var(--v0) 56px) bottom / 100% 56px no-repeat;
}
.shell > .vignette { display: none; }
.vignette[data-urgency] { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) {
  .vignette[data-urgency] { opacity: 0.7; }
}
