/* DOAG Jump&Run — Design-Tokens & Layout (Regeln: STYLE.md) */

/* Pixel-Font vendored (Press Start 2P, SIL OFL 1.1) — offlinefähig */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../vendor/press-start-2p.woff2') format('woff2');
  font-display: swap;
}

:root {
  /* Flächen */
  --bg0: #0b0f1e;
  --bg1: #131a33;
  /* Text */
  --ink: #e8ecf8;
  --muted: #9aa6c8;
  /* Akt-Akzente */
  --act1: #ff5d73; /* Akt I  — Blind  */
  --act2: #8b6cff; /* Akt II — Wach   */
  --act3: #ffb703; /* Akt III — Seht  */
  /* Semantik */
  --ok: #3ce07a;
  --warn: #ff5d73;
  --dim: #3a466b;
  /* Typo — Press Start 2P ist ~40% breiter als Monospace: Skala angepasst */
  --font-pixel: 'Press Start 2P', 'Departure Mono', ui-monospace, 'Cascadia Mono', monospace;
  --fs-kicker: 8px;
  --fs-title: 15px;
  --fs-bullet: 9px;
  --fs-hud: 7px;
  --fs-stat: 11px;
  --fs-lh: 1.9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; background: #000; }

body {
  font-family: var(--font-pixel);
  color: var(--ink);
  overflow: hidden;
}

/* ---------- Stage: 960x540 logisch, skaliert, letterboxed ---------- */
#stage-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
#stage {
  position: relative;
  width: 960px; height: 540px;
  transform-origin: center center;
  background: var(--bg0);
  image-rendering: pixelated;
  overflow: hidden;
}
#scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- HUD ---------- */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 16px;
  font-size: var(--fs-hud); letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  pointer-events: none;
}
.hud-top .lives { color: var(--warn); letter-spacing: 2px; }
.hud-top .score { color: var(--ink); }

/* Akt-Fortschritt: genau 3 Segmente (AKT I/II/III, aus dem Kicker geparst) */
.act-bar { display: flex; gap: 14px; align-items: center; pointer-events: none; }
.act-bar .seg { width: 64px; height: 4px; background: var(--dim); position: relative; overflow: visible; }
.act-bar .seg i {
  display: block; position: absolute; inset: 0;
  background: var(--seg-accent, var(--ink)); transform-origin: left;
  transform: scaleX(var(--fill, 0)); transition: transform 220ms steps(6);
}
.act-bar .seg b {
  position: absolute; top: 6px; left: 0; right: 0; text-align: center;
  font-weight: normal; font-size: 7px; letter-spacing: 1px; color: var(--seg-accent, var(--muted));
  opacity: .8;
}

.hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  font-size: var(--fs-hud); color: var(--muted);
  pointer-events: none;
}
.dots { display: flex; gap: 9px; pointer-events: auto; flex-wrap: nowrap; max-width: 660px; }
.dot-group {
  display: flex; gap: 2px; align-items: flex-end;
  border-bottom: 2px solid var(--gaccent, var(--dim)); padding-bottom: 3px;
}
.dots .dot {
  appearance: none; -webkit-appearance: none;
  width: 10px; height: 10px; padding: 2px; /* 6px sichtbar + Klickfläche */
  background: transparent; border: 0; cursor: pointer;
  transition: transform 120ms steps(2);
}
.dots .dot::before { content: ''; display: block; width: 6px; height: 6px; background: var(--dim); }
.dots .dot:hover { transform: scale(2); }
.dots .dot.on::before { background: var(--ink); }
.dots .dot.cur::before { background: var(--accent, var(--ink)); }
.dots .dot.cur { transform: scale(1.6); }

/* ---------- Szenen-Panel (DOM-Text über Canvas, LINKS — Szene bleibt rechts sichtbar) ---------- */
.panel {
  position: absolute; left: 20px; top: 64px; bottom: 48px;
  width: 34%;
  background: rgba(11, 15, 30, .86);
  border: 2px solid var(--dim);
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
  z-index: 2;
}
.kicker {
  font-size: var(--fs-kicker); letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent, var(--muted));
}
h1.title { font-size: var(--fs-title); line-height: 1.5; text-transform: uppercase; }
ul.bullets { list-style: none; display: flex; flex-direction: column; gap: 10px; }
ul.bullets li {
  font-size: var(--fs-bullet); line-height: var(--fs-lh); color: var(--ink);
  padding-left: 18px; position: relative;
}
ul.bullets li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 8px; height: 8px; background: var(--accent, var(--dim));
}
/* Typewriter-Cursor */
.typing::after {
  content: '\2588';
  color: var(--accent, var(--ink));
  animation: blink 0.8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.chip.pop { animation: pop 180ms steps(3); }
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }

/* Stat-Chips */
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.chip {
  border: 2px solid var(--dim);
  padding: 8px 10px;
  font-size: 7px; color: var(--muted);
  display: flex; flex-direction: column; gap: 4px;
}
.chip b { font-size: var(--fs-stat); color: var(--ink); }

/* ---------- Titel-Layout (zentriert, kein Panel) ---------- */
.scene-title {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
  background: rgba(11, 15, 30, .35);
}
.scene-title h1 { font-size: 17px; line-height: 1.6; text-transform: uppercase; }
.scene-title .sub { font-size: 8px; color: var(--muted); letter-spacing: 2px; }

/* ---------- Presenter-Notizen ---------- */
#notes {
  position: fixed; left: 12px; bottom: 12px; z-index: 50;
  max-width: 420px;
  background: rgba(11, 15, 30, .95);
  border: 2px solid var(--dim);
  padding: 14px;
  font-size: 12px; line-height: 1.6; color: var(--muted);
  display: none;
}
#notes.on { display: block; }
#notes .k {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent, var(--muted)); margin-bottom: 8px;
}

/* ---------- Szenenwechsel ---------- */
#fader {
  position: absolute; inset: 0; background: #000; opacity: 0;
  pointer-events: none; z-index: 10;
  transition: opacity 220ms steps(5);
}
#fader.on { opacity: 1; }

/* ---------- Sprechblasen & Demo-Hinweis ---------- */
.demo-hint {
  margin-top: 10px; display: flex; flex-direction: column; gap: 6px;
  font-size: 10px; color: var(--muted);
}
.demo-hint b {
  display: inline-block; border: 2px solid var(--act3); color: var(--act3);
  padding: 2px 6px; margin-right: 6px;
}
#demo-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: none; align-items: center; justify-content: center;
  background: rgba(11, 15, 30, .82);
}
#demo-overlay.on { display: flex; }
#demo-overlay .box {
  border: 2px solid var(--act3);
  background: var(--bg1);
  padding: 26px 30px;
  display: flex; flex-direction: column; gap: 12px;
  text-align: center;
}
#demo-overlay .box h2 { font-size: 16px; color: var(--act3); }
#demo-overlay .open-btn {
  display: inline-block; margin: 6px auto; padding: 14px 22px;
  border: 2px solid var(--act3); color: var(--act3);
  background: var(--bg1); text-decoration: none;
  font-size: 13px; letter-spacing: 1px;
}
#demo-overlay .open-btn:hover, #demo-overlay .open-btn:focus {
  background: var(--act3); color: #10131f;
}
#demo-overlay .box p { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- QR-Badge (Titel/Finale): klickbar, über Titel-Overlay ---------- */
.qr-badge {
  position: absolute; right: 20px; bottom: 96px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none;
}
.qr-badge canvas {
  image-rendering: pixelated;
  border: 2px solid var(--act3);
  width: 148px; height: 148px;
}
.qr-badge:hover canvas, .qr-badge:focus-visible canvas { border-color: var(--ink); }
.qr-badge .qr-label {
  font-size: 7px; letter-spacing: 1px; color: var(--act3);
  text-transform: uppercase; text-align: center; line-height: 1.8;
  background: rgba(11, 15, 30, .86); padding: 4px 6px; border: 2px solid var(--dim);
}

/* ---------- Abspann (Star-Wars-Crawl) ---------- */
.credits-crawl {
  position: absolute; inset: 0; z-index: 2;
  overflow: hidden;
  background: rgba(4, 6, 14, .88);
}
.credits-crawl .kicker {
  position: absolute; top: 18px; left: 0; right: 0; text-align: center;
  font-size: 11px; letter-spacing: 3px; color: var(--act3);
}
.credits-inner, .credits-crawl > .cr { /* noop, Struktur unten */ }
.credits-crawl .cr {
  position: relative; margin: 0 auto; max-width: 640px;
  animation: crawlUp 75s linear forwards;
  text-align: center; padding: 14px 0 22px;
}
.credits-crawl .cr .role {
  font-size: 10px; letter-spacing: 2px; color: var(--muted);
  text-transform: uppercase; margin-bottom: 4px;
}
.credits-crawl .cr .who {
  font-size: 15px; color: var(--ink); line-height: 1.4;
}
@keyframes crawlUp {
  from { transform: translateY(120px); }
  to   { transform: translateY(calc(-100% - 540px)); }
}
@media (prefers-reduced-motion: reduce) {
  .credits-crawl .cr { animation: none; transform: none; }
  .credits-crawl { overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
  #fader { transition: none; }
  .dots span, .chip b { transition: none; }
}

/* Zeitanker liegen im HUD, damit die Panel-Budgets erhalten bleiben. */
.hud-top { z-index: 4; }
.hud-label { max-width: 370px; line-height: 1.6; }
.station-date { display: block; margin-top: 6px; font-size: 7px; letter-spacing: 1px; color: var(--accent); }
.demo-hint button { appearance: none; background: transparent; color: var(--muted); border: 0; text-align: left; font: inherit; cursor: pointer; }
.demo-hint button:hover, .demo-hint button:focus-visible { color: var(--ink); outline: 1px solid var(--accent); }
/* Native Screens bleiben scharf und proportional, außerhalb des Textpanels. */
.phone-live { position: absolute; z-index: 8; left: 370px; right: 20px; top: 64px; bottom: 48px; border: 2px solid var(--act3); background: var(--bg0); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.phone-live header { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--act3); }
.phone-live button { font: 7px/1.7 var(--font-pixel); color: var(--ink); background: var(--bg1); border: 2px solid var(--dim); padding: 8px; cursor: pointer; }
.phone-live button:focus-visible { outline: 2px solid var(--act3); }
.phone-live .phone-close { font-size: 12px; padding: 2px 8px; }
.phone-screen { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
.phone-screen img, .phone-screen video { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.phone-screen p, .phone-status { font-size: 8px; line-height: 1.7; }
.phone-screen p { padding: 20px; text-align: center; color: var(--muted); }
.phone-status { min-height: 28px; color: var(--muted); }
.phone-actions { display: flex; justify-content: center; gap: 8px; }

/* Demos nutzen die gesamte Projektionsfläche statt der kleinen Folienbox. */
.phone-live { position: fixed; inset: 10px; z-index: 100; padding: 12px; gap: 6px; }
.phone-live header { font: 700 18px/1.4 system-ui,sans-serif; }
.phone-live button { font: 700 14px/1.4 system-ui,sans-serif; }
.phone-status { margin: 0; font: 14px/1.4 system-ui,sans-serif; }
.phone-actions { display: flex; gap: 10px; }
.web-live { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #04120f; color: #dff3ee; font: 16px/1.4 system-ui,sans-serif; }
.web-live header { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; gap: 12px; }
.web-close { padding: 10px 14px; color: #ffb9b9; background: #3a1d24; border: 1px solid #a33; border-radius: 8px; font-weight: 700; cursor: pointer; }
.web-screen { flex: 1; min-height: 0; background: #000; }
.web-screen img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.web-screen video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.web-status { margin: 0; padding: 5px 14px; font-size: 13px; }

.phone-screen p { font: 20px/1.5 system-ui,sans-serif; }

.web-live { inset: 12px; border: 2px solid var(--act3); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 100vmax rgba(0,0,0,.7); }
