/* =========================================================
   Station 404 — Escape Orbit
   Design-System: alle Farben stecken in CSS-Variablen.
   JavaScript schaltet nur das Attribut data-theme am <html>,
   der Rest passiert automatisch.
   ========================================================= */

/* Schriften lokal einbinden — kein Aufruf an einen fremden Server.
   Beides sind "variable fonts": eine Datei deckt alle Schnitte ab. */
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:        #05070f;
  --bg-2:      #0a0f1e;
  --panel:     rgba(18, 26, 46, .72);
  --panel-brd: rgba(120, 180, 255, .18);
  --text:      #e8eefc;
  --text-dim:  #8ea0c4;
  --accent:    #4dd4ff;
  --accent-2:  #ffb347;
  --danger:    #ff5c7a;
  --ok:        #5cffb1;
  --glow:      0 0 24px rgba(77, 212, 255, .35);
  --radius:    14px;
  --mono:      "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans:      "Space Grotesk", system-ui, -apple-system, Segoe UI, sans-serif;
  --speed:     .35s;
}

/* Heller Modus - praktisch, wenn der Beamer im Klassenzimmer blass ist */
:root[data-theme="light"] {
  --bg:        #eef2fa;
  --bg-2:      #dde5f4;
  --panel:     rgba(255, 255, 255, .82);
  --panel-brd: rgba(30, 70, 130, .18);
  --text:      #0d1526;
  --text-dim:  #5a6a86;
  --accent:    #0a7ea8;
  --accent-2:  #b96a00;
  --danger:    #c62846;
  --ok:        #0a8f5a;
  --glow:      0 0 18px rgba(10, 126, 168, .22);
}

* { box-sizing: border-box; }

/* hidden soll immer gewinnen, auch bei display:grid */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background var(--speed), color var(--speed);
}

/* sanfter Farbverlauf ueber dem Sternenfeld */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(77, 212, 255, .16), transparent 60%),
    radial-gradient(800px 600px at 90% 110%, rgba(255, 179, 71, .12), transparent 60%),
    linear-gradient(180deg, transparent, var(--bg-2));
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--speed);
}

#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; margin: 0 0 .4em; }
p { line-height: 1.65; color: var(--text-dim); }
code, kbd, .mono { font-family: var(--mono); }

kbd {
  background: var(--panel); border: 1px solid var(--panel-brd);
  border-radius: 6px; padding: .1em .45em; font-size: .85em; color: var(--text);
}

/* ============ HUD ============ */

#hud {
  position: fixed; top: 0; left: 0; right: 0;
  height: 64px; z-index: 60;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-brd);
}

.hud-left  { display: flex; align-items: center; gap: 18px; min-width: 0; }
.hud-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

.logo {
  font-family: var(--mono); font-weight: 700; font-size: .82rem;
  letter-spacing: .22em; color: var(--accent);
  text-shadow: var(--glow); white-space: nowrap;
}

/* Fortschrittspunkte */
#progress { display: flex; gap: 7px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--panel-brd); background: transparent;
  padding: 0; cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.dot:hover { transform: scale(1.35); }
.dot[data-state="current"] { background: var(--accent); box-shadow: var(--glow); border-color: var(--accent); }
.dot[data-state="solved"]  { background: var(--ok); border-color: var(--ok); }

/* Sauerstoffanzeige */
.oxygen { position: relative; display: grid; place-items: center; width: 54px; height: 54px; }
.o2-ring { position: absolute; inset: 0; width: 54px; height: 54px; transform: rotate(-90deg); }
.o2-ring circle { fill: none; stroke-width: 2.5; }
.o2-track { stroke: var(--panel-brd); }
.o2-fill {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 97.4; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .4s;
}
#o2-time { font-family: var(--mono); font-size: .8rem; font-variant-numeric: tabular-nums; }
.oxygen.low .o2-fill { stroke: var(--danger); }
.oxygen.low #o2-time { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-brd);
  color: var(--text); font-family: var(--mono); font-size: .9rem;
  transition: border-color .2s, color .2s, transform .15s, background .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.icon-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

/* ============ Buttons ============ */

.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.7em; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  color: #04121a; background: var(--accent); border: none;
  box-shadow: var(--glow);
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn:active { transform: translateY(0); }

.ghost-btn {
  padding: .6em 1.2em; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--panel-brd);
  color: var(--text-dim); font-family: var(--sans); font-size: .88rem;
  transition: color .2s, border-color .2s;
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============ Buehne / Stationen ============ */

#stage { position: relative; z-index: 1; }

.station {
  min-height: 100vh;
  padding: 104px 24px 56px;
  max-width: 1120px; margin: 0 auto;
  display: flex; flex-direction: column;
  animation: stationIn .5s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes stationIn {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
}

.station-head { margin-bottom: 28px; }
.station-kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .2em;
  color: var(--accent-2); text-transform: uppercase; display: block; margin-bottom: .6em;
}
.station-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.station-head p { max-width: 62ch; margin: 0; }

.panel {
  background: var(--panel); border: 1px solid var(--panel-brd);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(10px);
}

/* ============ Intro mit Scroll-Effekten ============ */

.hero {
  min-height: 100vh; display: grid; place-items: center; text-align: center;
  padding: 0 24px; position: relative;
}
.hero-inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(2.6rem, 9vw, 6rem); line-height: .95; margin-bottom: .25em;
  background: linear-gradient(120deg, var(--text), var(--accent) 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub {
  font-family: var(--mono); letter-spacing: .3em; font-size: .78rem;
  color: var(--accent); text-transform: uppercase; margin-bottom: 2.4em;
}
.hero .lead { font-size: 1.12rem; max-width: 56ch; margin: 0 auto 2.6em; }

.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; translate: -50% 0;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .2em;
  color: var(--text-dim); animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(10px); opacity: .5; } }

/* Parallax-Ebene: JS schreibt --p (0..1) hinein */
.layer {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  transform: translateY(calc(var(--p, 0) * var(--depth, 100px)));
  opacity: calc(1 - var(--p, 0) * .9);
}
.planet {
  position: absolute; right: -14vw; bottom: -34vw;
  width: 62vw; height: 62vw; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(120, 220, 255, .55), rgba(20, 50, 90, .9) 58%, rgba(5, 10, 24, 1) 72%);
  box-shadow: inset -40px -30px 90px rgba(0, 0, 0, .7), 0 0 120px rgba(77, 212, 255, .18);
}

/* Story-Abschnitte, die beim Scrollen erscheinen */
.story { max-width: 720px; margin: 0 auto; padding: 10vh 24px; }
.beat {
  opacity: 0; transform: translateY(48px);
  transition: opacity .8s cubic-bezier(.2, .8, .3, 1), transform .8s cubic-bezier(.2, .8, .3, 1);
  margin-bottom: 18vh;
}
.beat.visible { opacity: 1; transform: none; }
.beat h3 { font-size: clamp(1.4rem, 3.4vw, 2.1rem); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--panel-brd);
  border-radius: 999px; padding: .35em .9em;
}
.beat .tag { margin-bottom: 1em; }
.beat.final { text-align: center; margin-bottom: 14vh; }

/* ============ Werkstatt: Drag & Drop ============ */

.workshop { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .workshop { grid-template-columns: 1fr; } }

.parts-tray { display: flex; flex-wrap: wrap; gap: 12px; min-height: 90px; }

.part {
  display: flex; align-items: center; gap: .6em;
  padding: .7em 1.05em; border-radius: 10px; cursor: grab;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  border: 1px solid var(--panel-brd); font-size: .9rem;
  user-select: none;
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.part:hover { transform: translateY(-3px); box-shadow: var(--glow); }
.part.dragging { opacity: .35; cursor: grabbing; }
.part .ico { font-size: 1.15rem; }

.slots { display: grid; gap: 12px; }
.slot {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 12px; min-height: 68px;
  border: 1.5px dashed var(--panel-brd);
  transition: border-color .2s, background .2s, transform .2s;
}
.slot .slot-label { font-family: var(--mono); font-size: .76rem; color: var(--text-dim); letter-spacing: .08em; }
.slot.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); transform: scale(1.015); }
.slot.filled { border-style: solid; border-color: var(--ok); }
.slot.wrong { animation: shake .4s; border-color: var(--danger); }
@keyframes shake {
  25% { transform: translateX(-8px); } 75% { transform: translateX(8px); }
}

/* ============ Blackout ============ */

.blackout-room {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 440px; padding: 28px;
  border: 1px solid var(--panel-brd);
  background: var(--panel);
  transition: background .5s;
}
/* Bei Licht bleiben die UV-Hinweise unsichtbar ... */
.uv {
  position: absolute; font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.4rem, 3.6vw, 2.4rem); letter-spacing: .12em;
  color: transparent; opacity: 0;
  transition: opacity .6s, color .6s, text-shadow .6s;
  pointer-events: none;
}
/* ... und erst wenn JS das Licht ausschaltet, leuchten sie auf. */
.lights-off .uv {
  opacity: 1; color: #b388ff;
  text-shadow: 0 0 18px #9b6cff, 0 0 42px rgba(155, 108, 255, .6);
}
.lights-off .blackout-room { background: #03040a; }
.lights-off .room-furniture { opacity: .1; }
.room-furniture { transition: opacity .5s; }
.room-furniture .thing {
  position: absolute; border: 1px solid var(--panel-brd); border-radius: 10px;
  display: grid; place-items: center; font-size: .78rem;
  font-family: var(--mono); color: var(--text-dim);
}

.code-input {
  font-family: var(--mono); font-size: 1.6rem; letter-spacing: .5em;
  text-align: center; width: 100%; max-width: 320px;
  padding: .6em .4em .6em .9em; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--panel-brd); color: var(--text);
}
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }

/* ============ Navigation: Rechner ============ */

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 20px; }
.field label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .5em; }
.field label b { font-family: var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%; height: 5px; border-radius: 999px; appearance: none; -webkit-appearance: none;
  background: var(--panel-brd); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 19px; height: 19px; border-radius: 50%;
  background: var(--accent); box-shadow: var(--glow); border: none; cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 19px; height: 19px; border: none; border-radius: 50%;
  background: var(--accent); cursor: grab;
}

.readout { display: grid; gap: 4px; font-family: var(--mono); font-size: .9rem; }
.readout div { display: flex; justify-content: space-between; padding: .55em 0; border-bottom: 1px dashed var(--panel-brd); }
.readout b { font-variant-numeric: tabular-nums; }
.readout .good b { color: var(--ok); }
.readout .bad  b { color: var(--danger); }

.trajectory {
  width: 100%; height: 200px; border-radius: 12px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--panel-brd);
}

/* ============ Quiz ============ */

.quiz-wrap { max-width: 720px; margin: 0 auto; width: 100%; }
.quiz-bar { height: 4px; border-radius: 999px; background: var(--panel-brd); overflow: hidden; margin-bottom: 26px; }
.quiz-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 1s linear, background .3s; }
.quiz-bar.low span { background: var(--danger); }
.quiz-q { font-size: clamp(1.15rem, 2.6vw, 1.6rem); margin-bottom: 1.2em; }
.answers { display: grid; gap: 12px; }
.answer {
  text-align: left; padding: 1em 1.2em; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-brd);
  color: var(--text); font-family: var(--sans); font-size: .98rem;
  transition: transform .15s, border-color .2s, background .2s;
}
.answer:hover:not(:disabled) { transform: translateX(6px); border-color: var(--accent); }
.answer.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.answer.wrong   { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.answer:disabled { cursor: default; }

/* ============ Finale ============ */

.escape-wrap { display: grid; place-items: center; gap: 18px; }
#escape-canvas {
  width: 100%; max-width: 920px; aspect-ratio: 16 / 9;
  border-radius: var(--radius); border: 1px solid var(--panel-brd);
  background: #03040c; touch-action: none;
}
.escape-meta { display: flex; gap: 28px; font-family: var(--mono); font-size: .85rem; color: var(--text-dim); }
.escape-meta b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ============ Overlays ============ */

.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; text-align: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(14px);
  animation: fade .4s both;
}
@keyframes fade { from { opacity: 0; } }
.overlay h2 { font-size: clamp(2rem, 6vw, 3.4rem); }
.overlay .big-time { font-family: var(--mono); font-size: 2.4rem; color: var(--accent); margin: .2em 0 .1em; }
.overlay .rank { font-family: var(--mono); letter-spacing: .25em; color: var(--accent-2); text-transform: uppercase; }
.overlay .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 2em; }

/* Technik-Uebersicht auf dem Siegbildschirm */
.tech-list {
  margin: 2.2em auto 0; max-width: 540px; text-align: left;
  background: var(--panel); border: 1px solid var(--panel-brd);
  border-radius: var(--radius); padding: 18px 20px;
}
.tech-list > div {
  display: flex; align-items: baseline; gap: 10px;
  padding: .5em 0; border-bottom: 1px dashed var(--panel-brd);
  font-size: .9rem;
}
.tech-list > div:last-child { border-bottom: none; }
.tech-list .num { font-family: var(--mono); font-size: .72rem; color: var(--text-dim); width: 1.2em; }
.tech-list b {
  margin-left: auto; font-family: var(--mono); font-size: .76rem;
  color: var(--accent); text-align: right;
}

/* ============ Code-Einblendung ============ */

#codepeek {
  position: fixed; top: 64px; right: 0; bottom: 0; width: min(540px, 94vw);
  z-index: 70; overflow: auto; padding: 22px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-left: 1px solid var(--panel-brd);
  backdrop-filter: blur(16px);
  animation: slideIn .32s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes slideIn { from { transform: translateX(100%); } }
#codepeek header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#codepeek-tech { font-family: var(--mono); font-size: .76rem; letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }
#codepeek p { font-size: .92rem; }
#codepeek pre {
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  border: 1px solid var(--panel-brd); border-radius: 12px;
  padding: 16px; overflow-x: auto; font-size: .78rem; line-height: 1.7;
}
#codepeek code { color: var(--text); white-space: pre; }

/* ============ Sprungmenue ============ */

.panel-pop {
  position: fixed; top: 72px; right: 20px; z-index: 75; width: 300px;
  background: var(--panel); border: 1px solid var(--panel-brd);
  border-radius: var(--radius); padding: 16px;
  backdrop-filter: blur(16px);
  animation: popIn .22s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.pop-title { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 12px; }
#station-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
#station-list button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: .6em .7em; border-radius: 9px; cursor: pointer;
  background: transparent; border: none; color: var(--text);
  font-family: var(--sans); font-size: .9rem; text-align: left;
  transition: background .18s;
}
#station-list button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
#station-list .num { font-family: var(--mono); font-size: .72rem; color: var(--text-dim); width: 1.4em; }
#station-list .state { margin-left: auto; font-size: .8rem; }

/* ============ Toasts ============ */

#toasts {
  position: fixed; bottom: 24px; left: 50%; translate: -50% 0; z-index: 90;
  display: grid; gap: 10px; justify-items: center; pointer-events: none;
}
.toast {
  padding: .8em 1.4em; border-radius: 999px; font-size: .9rem;
  background: var(--panel); border: 1px solid var(--panel-brd);
  backdrop-filter: blur(12px); box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
  animation: toastIn .3s cubic-bezier(.2, .8, .3, 1) both;
}
.toast.ok   { border-color: var(--ok); color: var(--ok); }
.toast.bad  { border-color: var(--danger); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }
.toast.out { animation: toastOut .3s both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ============ Minispiel: Memory ============ */

.memory-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  max-width: 560px; margin: 0 auto;
}
@media (max-width: 620px) { .memory-grid { grid-template-columns: repeat(3, 1fr); } }

.memo {
  position: relative; aspect-ratio: 3 / 4;
  background: none; border: none; padding: 0; cursor: pointer;
}
.memo-face {
  position: absolute; inset: 0;
  display: grid; place-items: center; gap: .3em;
  border-radius: 12px; border: 1px solid var(--panel-brd);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .45s cubic-bezier(.2, .8, .3, 1), border-color .3s;
}
.memo-back {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  color: var(--text-dim); font-family: var(--mono); font-size: 1.5rem;
  transform: rotateY(0deg);
}
.memo-front {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  transform: rotateY(180deg);
}
.memo.flipped .memo-back  { transform: rotateY(-180deg); }
.memo.flipped .memo-front { transform: rotateY(0deg); }
.memo:hover:not(.flipped) .memo-back { border-color: var(--accent); }
.memo.matched .memo-front { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }

.memo-icon  { font-size: clamp(1.4rem, 4vw, 2.1rem); }
.memo-label { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; color: var(--text-dim); }

/* ============ Funkraum ============ */

.search-input {
  flex: 1; min-width: 200px;
  padding: .75em 1.1em; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--panel-brd); color: var(--text);
  font-family: var(--sans); font-size: .95rem;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.search-input:disabled { opacity: .5; }

.log-list { max-height: 330px; overflow-y: auto; display: grid; gap: 2px; margin-top: 8px; }

.log-entry { padding: .7em .2em; border-bottom: 1px dashed var(--panel-brd); }
.log-entry:last-child { border-bottom: none; }
.log-entry p { margin: .2em 0 0; font-size: .92rem; color: var(--text); }
.log-meta { display: flex; gap: 12px; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; }
.log-time { color: var(--accent); }
.log-from { color: var(--text-dim); text-transform: uppercase; }
.log-entry mark {
  background: color-mix(in srgb, var(--accent-2) 35%, transparent);
  color: var(--text); border-radius: 3px; padding: 0 .15em;
}

.log-loading, .log-error { display: grid; place-items: center; gap: 12px; padding: 36px 0; color: var(--text-dim); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--panel-brd); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.log-error p { color: var(--danger); }

.code-input.wide { letter-spacing: .3em; max-width: 280px; }

/* ============ Crew-Ausweis ============ */

.text-input {
  width: 100%; padding: .7em .9em; border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--panel-brd); color: var(--text);
  font-family: var(--mono); font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.text-input.ok  { border-color: var(--ok); }
.text-input.bad { border-color: var(--danger); }

.field-hint { font-size: .78rem; margin: .5em 0 0; font-family: var(--mono); color: var(--text-dim); }
.field-hint.good { color: var(--ok); }

.strength { height: 4px; border-radius: 999px; background: var(--panel-brd); margin-top: 8px; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }
.strength[data-level="mid"]  span { background: var(--accent-2); }
.strength[data-level="high"] span { background: var(--ok); }

.check-row { display: flex; gap: .7em; align-items: center; font-size: .88rem; cursor: pointer; margin-bottom: 14px; }

.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { transform: none; filter: none; }

.badge-card {
  border: 1px solid var(--panel-brd); border-radius: var(--radius);
  padding: 22px; min-height: 240px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
}
.badge-card.empty { display: grid; place-items: center; background: none; border-style: dashed; }
.badge-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.badge-ok {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em;
  color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: .3em .8em;
}
.badge-name { font-size: 1.8rem; font-weight: 700; color: var(--text); margin: 0 0 .5em; }
.badge-rows { display: grid; gap: 2px; font-family: var(--mono); font-size: .85rem; }
.badge-rows > div { display: flex; justify-content: space-between; padding: .5em 0; border-bottom: 1px dashed var(--panel-brd); }
.badge-rows b { color: var(--accent); }

/* Kategorie-Marke im Quiz */
.quiz-wrap .tag { margin: 0 .7em 0 0; display: inline-block; }

/* ============ Kleinkram ============ */

.hint { font-size: .86rem; color: var(--text-dim); font-family: var(--mono); }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 24px; }
.center { text-align: center; }
.grow { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .beat { opacity: 1; transform: none; }
}

@media (max-width: 680px) {
  #hud { grid-template-columns: auto 1fr auto; padding: 0 12px; }
  .logo { display: none; }
  .station { padding: 92px 16px 48px; }
}
