/* slapstick.be -- Intro-Seite (Doku: projectzomboid/INTRO.md)
   Nur das Video und ruhige Bedienelemente. Marke: Radius 0, VT323 lokal,
   Fokus 2px solid Orange, harter 2px-Schatten, Ziele ab 44 px.
   Kein Inline-Stil, kein style-Attribut: die CSP erlaubt nur diese Datei.
   Zustandsklassen setzt intro.js auf <html>: js / no-js, is-idle,
   is-leaving, is-fallback. */

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vt323-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  --bg-deepest: #0A0A0A;
  --bg-board: #111111;
  --bg-elevated: #1A1A1A;
  --accent-orange: #C9761B;
  --accent-gold: #CAAD4D;
  --terminal-green: #8FA85A;
  --border: #2B2D2C;
  --text: #e8e8e4;
  --text-muted: #9a9a94;
  --radius: 0;
  --focus-ring: 2px solid var(--accent-orange);
  --shadow-hard: 2px 2px 0 var(--bg-deepest);
  --font-mono: 'VT323', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --gutter: 16px;
  --fade: 350ms;
  --fade-ui: 200ms;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deepest);
}

body {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Buehne ---------- */

.stage {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deepest);
}

.intro {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--bg-deepest);
}

.js .intro { cursor: pointer; }

/* ---------- Schalter ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--bg-board);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { border-color: var(--accent-orange); }

.btn:focus-visible,
.legal a:focus-visible,
.noscript a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.btn[aria-pressed="true"] {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.btn--primary {
  color: var(--bg-deepest);
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

.btn--primary:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.btn--big {
  min-height: 56px;
  padding: 0 24px;
  font-size: 1.5rem;
}

.controls {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  z-index: 3;
  transition: opacity var(--fade-ui) linear;
}

/* Ohne JavaScript bedient der Browser das Video selbst (controls). */
.no-js .controls { display: none; }

.is-idle .controls {
  opacity: 0;
  pointer-events: none;
}

.is-idle,
.is-idle .intro { cursor: none; }

/* ---------- Rechtslinks: immer sichtbar, gedaempft ---------- */

.legal {
  position: fixed;
  left: max(var(--gutter), env(safe-area-inset-left));
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  z-index: 3;
}

.legal nav { display: flex; gap: 8px; }

.legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-deepest);
  border: 1px solid var(--border);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal a:hover { color: var(--text); }

/* Ohne JavaScript stehen die Rechtslinks im noscript-Kasten oben, damit sie
   die nativen Videoregler unten nicht verdecken. */
.no-js .legal { display: none; }

/* Sehr schmale Geraete: Rechtslinks eine Zeile hoeher als die Schalter. */
@media (max-width: 359px) {
  .legal { bottom: calc(max(var(--gutter), env(safe-area-inset-bottom)) + 52px); }
}

/* ---------- Pause, Ausfall, Ende ---------- */

.paused {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 4px 14px;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  background: var(--bg-board);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hard);
  pointer-events: none;
  z-index: 2;
}

.panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100vw - 2 * var(--gutter)), 30rem);
  padding: 24px;
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  background: var(--bg-board);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hard);
  z-index: 4;
}

.panel__text { margin: 0; font-size: 1.375rem; }

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.curtain {
  position: fixed;
  inset: 0;
  background: var(--bg-deepest);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fade) linear;
  z-index: 10;
}

.is-leaving .curtain { opacity: 1; }

/* ---------- Ohne JavaScript ---------- */

.noscript {
  flex: 0 0 auto;
  padding: 12px var(--gutter);
  background: var(--bg-board);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.125rem;
}

.noscript p { margin: 0 0 8px; }
.noscript p:last-child { margin-bottom: 0; }
.noscript a { color: var(--text); }
.noscript .btn { color: var(--bg-deepest); }

/* ---------- Hilfsklassen ---------- */

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  :root { --fade: 0ms; --fade-ui: 0ms; }
}

@media (prefers-contrast: more) {
  .btn, .legal a { border-width: 2px; }
  .legal a { color: var(--text); }
}

@media (forced-colors: active) {
  .btn, .legal a, .panel, .paused { border: 1px solid CanvasText; }
}
