/* Sechs Riegel — Look "Stahl und Messing". Finale in Kino-Rot und Creme (finale.css). */
:root {
  --stahl: #15171a;
  --stahl-hell: #30353c;
  --panel: #2a2e33;
  --panel-tief: #1c1f23;
  --messing: #c9a04a;
  --messing-hell: #e8c877;
  --messing-dunkel: #8a6a24;
  --creme: #f1e9d6;
  --creme-60: rgba(241, 233, 214, 0.6);
  --warn: #c0392b;
  --samt: #7a0f1c;
  --samt-hell: #a3182a;
  --papier: #f3ead7;
  --tinte: #1a1a1a;
  --display: 'Bebas Neue', 'Oswald', Impact, 'Arial Narrow', sans-serif;
  --mono: 'Space Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --rand: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  color: var(--creme);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.45;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, var(--stahl-hell) 0%, var(--stahl) 55%),
    var(--stahl);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Gebürsteter Stahl und Vignette, liegen über allem, fangen keine Eingaben. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 0;
}

.display { font-family: var(--display); letter-spacing: 0.06em; font-weight: 400; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

.root {
  position: relative;
  z-index: 1;
  height: 100dvh;
  padding: var(--rand);
  display: grid;
  place-items: center;
}

.root > section {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: clamp(16px, 4vh, 40px) 20px 92px;
  gap: 16px;
  text-align: center;
}

/* Kopfzeile eines Riegels */
.kopf { display: grid; gap: 6px; justify-items: center; }
.kicker { color: var(--messing); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.titel { font-size: clamp(44px, 12vw, 64px); line-height: 0.95; margin: 0; color: var(--creme); }
.anleitung { margin: 0; max-width: 34ch; color: var(--creme-60); font-size: 14px; }
.anleitung strong { color: var(--creme); font-weight: 400; }
.status { min-height: 1.4em; color: var(--messing-hell); font-size: 13px; margin: 0; }

.hinweis { padding: 24px; text-align: center; color: var(--creme-60); }

/* ── Tresortür (Lobby) ─────────────────────────────────────────────────── */
.tuer {
  position: relative;
  width: min(78vw, 300px);
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), transparent 40%),
    linear-gradient(20deg, rgba(0, 0, 0, 0.35), transparent 50%),
    var(--panel);
  border: 3px solid var(--messing);
  box-shadow:
    inset 0 0 0 6px var(--panel-tief),
    inset 0 0 0 7px var(--messing-dunkel),
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.8);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 22px;
}

.riegel-leiste { display: flex; gap: 8px; justify-content: center; }
.riegel {
  width: 26px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(#3a4048, #22262b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: background 0.4s, box-shadow 0.4s;
}
.riegel.offen {
  background: linear-gradient(var(--messing-hell), var(--messing));
  box-shadow: 0 0 12px rgba(232, 200, 119, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tuer-mitte { display: grid; place-content: center; gap: 4px; }
.tuer-titel { font-size: 54px; line-height: 1; color: var(--messing-hell); text-shadow: 0 2px 0 var(--messing-dunkel), 0 8px 24px rgba(0, 0, 0, 0.6); }
.tuer-nr { font-size: 12px; letter-spacing: 0.3em; color: var(--creme-60); }

.niete {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--messing-hell), var(--messing-dunkel) 70%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.niete-lo { top: 12px; left: 12px; }
.niete-ro { top: 12px; right: 12px; }
.niete-lu { bottom: 12px; left: 12px; }
.niete-ru { bottom: 12px; right: 12px; }

.anwesenheit { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.anwesenheit .da { color: var(--creme); }
.anwesenheit .bereit { color: var(--messing-hell); }
.anwesenheit .weg { color: var(--creme-60); }

/* ── Knöpfe ────────────────────────────────────────────────────────────── */
.knopf {
  appearance: none;
  border: 0;
  cursor: pointer;
  color: var(--tinte);
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 22px;
  padding: 18px 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--messing-hell), var(--messing) 55%, var(--messing-dunkel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 0 var(--messing-dunkel),
    0 16px 30px rgba(0, 0, 0, 0.55);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
  touch-action: manipulation;
}
.knopf:active, .knopf.gedrueckt {
  transform: translateY(5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 0 var(--messing-dunkel), 0 6px 12px rgba(0, 0, 0, 0.5);
}
.knopf:disabled { filter: saturate(0.4) brightness(0.8); cursor: default; }
.knopf:focus-visible { outline: 3px solid var(--creme); outline-offset: 4px; }

.knopf-gross {
  width: min(62vw, 240px);
  height: min(62vw, 240px);
  padding: 0;
  border-radius: 50%;
  font-size: 34px;
  background: radial-gradient(circle at 35% 28%, #f5dc9a, var(--messing) 45%, var(--messing-dunkel) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -10px 24px rgba(0, 0, 0, 0.35),
    0 10px 0 var(--messing-dunkel),
    0 26px 50px rgba(0, 0, 0, 0.65),
    0 0 0 10px var(--panel-tief),
    0 0 0 12px var(--messing-dunkel);
}
.knopf-gross:active, .knopf-gross.gedrueckt {
  transform: translateY(8px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -6px 16px rgba(0, 0, 0, 0.35),
    0 2px 0 var(--messing-dunkel),
    0 8px 16px rgba(0, 0, 0, 0.6),
    0 0 0 10px var(--panel-tief),
    0 0 0 12px var(--messing-dunkel);
}

/* ── Countdown (Riegel 1) ──────────────────────────────────────────────── */
.countdown {
  font-size: clamp(64px, 22vw, 120px);
  line-height: 1;
  color: var(--messing-hell);
  text-shadow: 0 0 30px rgba(232, 200, 119, 0.45);
  min-height: 1em;
}

/* ── Nachrichtenzeile ──────────────────────────────────────────────────── */
.msgbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7) 40%);
  display: grid;
  gap: 6px;
  justify-items: center;
  pointer-events: none;
}
.msgbar p { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--messing-hell); text-align: center; max-width: 40ch; }
.badge { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--warn); }
.ton { font-size: 11px; letter-spacing: 0.12em; color: var(--creme-60); }

/* ── Bewegung ──────────────────────────────────────────────────────────── */
@keyframes ruetteln {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.ruettel { animation: ruetteln 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

@keyframes blitz { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  .ruettel { animation: none; }
}
