/* ══ Crosstalk – Cyberpunk Command Center ════════════════════════════════════
   Designsprache: nahezu schwarzer Blau-Hintergrund, transparente dunkle Panels
   mit 1px-Neonrahmen und abgeschrägten Ecken (HUD-Optik). Neon (Cyan primär,
   Magenta/Violett sekundär, Grün sparsam) nur für Rahmen, Zustände, Buttons,
   Icons, Trennlinien und Status – nie vollflächig.

   Aufbau der Datei
     1 Tokens · 2 Basis · 3 Frame-Primitive (Panels/Buttons) · 4 Formulare
     5 Statuselemente (Verbindung, Sprache, Toasts) · 6 Menü · 7 Lobby · 8 Dialoge
     9 Spiel: HUD · 10 Board-Layout · 11 Szenario/Listen · 12 Eingabe/Phasen
     13 Chat & Log · 14 Spielerkarten · 15 Phaseninhalte · 16 Responsive · 17 Reduced Motion

   Spielerfarben (--pc/--pc-rgb) werden per Inline-Style gesetzt (js/playerColors.js)
   und bedeuten NICHTS Spielerisches. Rollenfarben (--role-*) stehen nur an
   Rollen-Chips/-Karten und im Ergebnis. */

/* ── 1 Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg-0: #050912;
  --bg-1: #08111c;
  --bg-2: #0c1828;
  --panel: rgba(9, 19, 34, 0.82);
  --panel-2: rgba(14, 28, 48, 0.9);

  --ink: #e8f1fb;
  --ink-dim: #a3b5cc;
  --muted: #7f93ad;

  --cyan: #22e6ff;
  --cyan-2: #7df3ff;
  --blue: #4f8bff;
  --magenta: #ff3fc0;
  --violet: #a878ff;
  --green: #39f0a0;
  --amber: #ffb454;
  --coral: #ff6b6b;

  --line: rgba(120, 200, 235, 0.16);
  --line-strong: rgba(34, 230, 255, 0.4);
  --edge: linear-gradient(135deg, rgba(34, 230, 255, 0.9) 0%, rgba(34, 230, 255, 0.3) 20%, rgba(34, 230, 255, 0.2) 62%, rgba(34, 230, 255, 0.8) 100%);
  --edge-magenta: linear-gradient(135deg, rgba(255, 63, 192, 0.9) 0%, rgba(255, 63, 192, 0.32) 20%, rgba(255, 63, 192, 0.22) 62%, rgba(255, 63, 192, 0.8) 100%);
  --edge-violet: linear-gradient(135deg, rgba(168, 120, 255, 0.9) 0%, rgba(168, 120, 255, 0.3) 20%, rgba(168, 120, 255, 0.2) 62%, rgba(168, 120, 255, 0.8) 100%);

  --font-display: 'Orbitron', 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --font: 'Exo 2', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --radius: 8px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Rollenfarben – nur Rollen-Chips/-Karten/Ergebnis */
  --role-receiver: var(--cyan);
  --role-interceptor: var(--violet);
  --role-static: var(--coral);

  /* Standard-Spielerfarbe (wird pro Spieler überschrieben) */
  --pc: #35e4ff;
  --pc-rgb: 53, 228, 255;
}

/* ── 2 Basis ────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* Absicherung: Komponenten mit eigenem `display` würden `hidden` sonst per
   Cascade überstimmen (Autoren-Regel schlägt UA-Default). */
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 10% -8%, rgba(34, 230, 255, 0.1), transparent 62%),
    radial-gradient(900px 520px at 94% -6%, rgba(255, 63, 192, 0.1), transparent 62%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Technisches Raster (sehr dezent) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 230, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 230, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 28%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 28%, #000 0%, transparent 78%);
}
/* Skyline: stark zurückgenommen, hinter allen Panels */
body::after {
  content: "";
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 0; pointer-events: none;
  height: min(48vh, 440px);
  background: url(/img/skyline.svg) center bottom / cover no-repeat;
  opacity: 0.3;
  mask-image: linear-gradient(to top, #000 8%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 8%, transparent 100%);
}
#app { position: relative; z-index: 1; min-height: 100dvh; }

::selection { background: var(--cyan); color: #02131c; }
h1, h2, h3, h4 { font-weight: 600; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Scrollbars: dünn, im Neon-Stil */
.scroll { scrollbar-width: thin; scrollbar-color: rgba(34, 230, 255, 0.45) transparent; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(34, 230, 255, 0.55), rgba(255, 63, 192, 0.45)); border-radius: 4px; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.screen {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px) clamp(16px, 4vw, 32px) 64px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.screen[hidden] { display: none; }

/* ── 3 Frame-Primitive: 1px-Rahmen mit abgeschrägten Ecken ───────────────────
   Keine Zusatz-DOM nötig: ::before = Rahmenfarbe (Verlauf), ::after = Füllung,
   beide mit derselben abgeschrägten Kontur (oben links / unten rechts). */
/* --frame-fill ist immer ein Bild (Verlauf) und liegt über --frame-base (Volltonfarbe):
   so schimmert der Rahmen-Verlauf (::before) nie durch getönte Füllungen durch. */
.frame, .panel, .btn, .toast, .dialog, .player-card, .ballot-cand, .hud-chip, .phase-timer {
  --cut: 14px;
  --cut-in: calc(var(--cut) - 0.6px);
  --frame-edge: var(--edge);
  --frame-fill: linear-gradient(transparent, transparent);
  --frame-base: #06101d;
  position: relative;
  isolation: isolate;
}
:is(.frame, .panel, .btn, .toast, .dialog, .player-card, .ballot-cand, .hud-chip, .phase-timer)::before,
:is(.frame, .panel, .btn, .toast, .dialog, .player-card, .ballot-cand, .hud-chip, .phase-timer)::after {
  content: ""; position: absolute; pointer-events: none;
}
:is(.frame, .panel, .btn, .toast, .dialog, .player-card, .ballot-cand, .hud-chip, .phase-timer)::before {
  inset: 0; z-index: -2; background: var(--frame-edge);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
:is(.frame, .panel, .btn, .toast, .dialog, .player-card, .ballot-cand, .hud-chip, .phase-timer)::after {
  inset: 1px; z-index: -1; background: var(--frame-fill), var(--frame-base);
  box-shadow: inset 0 0 28px rgba(34, 230, 255, 0.05);
  clip-path: polygon(var(--cut-in) 0, 100% 0, 100% calc(100% - var(--cut-in)), calc(100% - var(--cut-in)) 100%, 0 100%, 0 var(--cut-in));
}

.panel {
  --frame-fill: linear-gradient(180deg, rgba(16, 34, 58, 0.5), rgba(9, 20, 36, 0.12));
  --frame-base: rgba(6, 14, 26, 0.93); /* leicht transparent: Raster/Skyline schimmern dezent durch */
  padding: 18px 20px;
}
.panel-glow { filter: drop-shadow(0 0 9px rgba(34, 230, 255, 0.24)); }

.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-head > .icon { width: 20px; height: 20px; color: var(--cyan); filter: drop-shadow(0 0 5px rgba(34, 230, 255, 0.55)); }
.panel-title {
  font-family: var(--font); font-size: 13.5px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--cyan);
}
.panel-meta { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim); }
.panel-subtitle { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  --cut: 10px;
  --frame-edge: rgba(34, 230, 255, 0.75);
  --frame-fill: linear-gradient(rgba(34, 230, 255, 0.1), rgba(34, 230, 255, 0.1));
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 10px 20px;
  font: 700 14px var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan-2);
  background: none; border: 0; cursor: pointer;
  transition: filter 0.16s var(--ease), transform 0.12s var(--ease);
}
.btn:not(:disabled):hover { filter: brightness(1.3) drop-shadow(0 0 9px rgba(34, 230, 255, 0.55)); }
.btn:not(:disabled):active { filter: brightness(1.55) drop-shadow(0 0 12px rgba(34, 230, 255, 0.75)); transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); }
.btn-big { width: 100%; min-height: 52px; font-size: 15px; }
.btn-primary { --frame-edge: linear-gradient(135deg, #22e6ff, #4f8bff); --frame-fill: linear-gradient(135deg, rgba(34, 230, 255, 0.22), rgba(79, 139, 255, 0.16)); color: #eafcff; }
.btn-secondary { --frame-edge: linear-gradient(135deg, #ff3fc0, #a878ff); --frame-fill: linear-gradient(135deg, rgba(255, 63, 192, 0.2), rgba(168, 120, 255, 0.16)); color: #ffe6f7; }
.btn-secondary:not(:disabled):hover { filter: brightness(1.3) drop-shadow(0 0 9px rgba(255, 63, 192, 0.55)); }
.btn-gold { --frame-edge: linear-gradient(135deg, #39f0a0, #22e6ff); --frame-fill: linear-gradient(135deg, rgba(57, 240, 160, 0.2), rgba(34, 230, 255, 0.12)); color: #e6fff4; }
.btn-gold:not(:disabled):hover { filter: brightness(1.3) drop-shadow(0 0 9px rgba(57, 240, 160, 0.55)); }
.btn-ghost { --frame-edge: rgba(120, 200, 235, 0.32); --frame-fill: linear-gradient(rgba(14, 30, 52, 0.7), rgba(14, 30, 52, 0.7)); color: var(--ink-dim); }
.btn-ghost:not(:disabled):hover { color: var(--ink); }
.btn-back, .btn-rules { min-height: 40px; padding: 8px 14px; font-size: 12.5px; }
.btn-icon { width: 48px; padding: 0; flex: none; }
.btn-icon .icon { width: 22px; height: 22px; }
.btn-send { min-width: 148px; font-size: 14px; white-space: nowrap; flex: none; }
.btn-send .icon { width: 20px; height: 20px; }

/* ── 4 Formulare ─────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.input {
  width: 100%; min-height: 48px;
  background: rgba(3, 8, 17, 0.78);
  border: 1px solid rgba(34, 230, 255, 0.45); border-radius: var(--radius);
  color: var(--ink); font: 500 16px var(--font); padding: 12px 16px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:hover:not(:disabled) { border-color: rgba(34, 230, 255, 0.7); }
.input:focus-visible {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 230, 255, 0.18), 0 0 20px rgba(34, 230, 255, 0.28);
}
.input:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--line); }

/* ── 5 Status: Verbindung, Sprache, Toasts ───────────────────────────────── */
.conn {
  position: fixed; bottom: 14px; left: 14px; z-index: 55;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink-dim);
  background: var(--bg-1); border: 1px solid rgba(255, 107, 107, 0.5);
}
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 8px var(--coral); }
.conn.ok { border-color: rgba(57, 240, 160, 0.5); }
.conn.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.lang-toggle {
  position: absolute; top: 14px; right: 16px; z-index: 50; /* scrollt mit – schwebt nicht über dem Inhalt */
  display: flex; align-items: center; gap: 6px; min-height: 36px;
  background: rgba(6, 13, 25, 0.85); border: 1px solid var(--line-strong); color: var(--ink-dim);
  padding: 6px 12px; font: 600 12px var(--font-mono); letter-spacing: 0.08em; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.lang-toggle:hover { color: var(--ink); background: rgba(34, 230, 255, 0.1); }
.lang-sep { opacity: 0.4; }
.lang-opt.active { color: var(--cyan); font-weight: 700; text-shadow: 0 0 8px rgba(34, 230, 255, 0.6); }

.toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: min(92vw, 520px);
}
.toast {
  --cut: 10px; --frame-edge: rgba(34, 230, 255, 0.6); --frame-base: #08111e;
  padding: 11px 20px 11px 22px; font-size: 14px; text-align: center; color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.error { --frame-edge: linear-gradient(135deg, #ff6b6b, rgba(255, 107, 107, 0.5)); color: #ffd0d0; }

/* ── 6 Menü ───────────────────────────────────────────────────────────────── */
.brand { text-align: center; margin-top: clamp(14px, 7vh, 64px); }
.brand-logo { display: block; width: min(640px, 92vw); height: auto; margin: 0 auto; overflow: visible; }
.brand-wave { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-wave-a { stroke: var(--cyan); opacity: 0.8; filter: drop-shadow(0 0 6px rgba(34, 230, 255, 0.75)); }
.brand-wave-b { stroke: var(--magenta); opacity: 0.5; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 78px; letter-spacing: 8px; }
.brand-text-a { fill: var(--magenta); opacity: 0.7; animation: driftA 5s ease-in-out infinite alternate; }
.brand-text-b { fill: var(--cyan); opacity: 0.7; animation: driftB 5s ease-in-out infinite alternate; }
.brand-text-main { fill: #f2fbff; }
@keyframes driftA { from { transform: translate(-3px, 0); } to { transform: translate(-1px, 1px); } }
@keyframes driftB { from { transform: translate(3px, 0); } to { transform: translate(1px, -1px); } }
/* `pre-line`: der Untertitel enthält einen gewollten Zeilenumbruch ("\n" in menu.subtitle). */
.brand-sub {
  color: var(--ink-dim); margin: 6px auto 0; max-width: 36em; white-space: pre-line; text-wrap: balance;
  letter-spacing: 0.04em; font-size: clamp(14px, 2.6vw, 17px);
}
.menu-card { --cut: 18px; width: min(460px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 26px; }
.menu-actions { display: flex; flex-direction: column; gap: 12px; }
.join-row { display: flex; gap: 10px; }
.join-row .input-code { flex: 1; text-align: center; letter-spacing: 0.35em; text-transform: uppercase; font-weight: 700; font-family: var(--font-mono); }

/* ── 7 Lobby ──────────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 12px; padding-right: 96px; }
.topbar-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.code-badge {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim);
  background: rgba(6, 13, 25, 0.8); border: 1px solid var(--line-strong);
}
.code-badge strong { font-family: var(--font-mono); font-size: 16px; color: var(--cyan-2); letter-spacing: 0.16em; text-shadow: 0 0 10px rgba(34, 230, 255, 0.5); }
.btn-copy { display: inline-grid; place-items: center; width: 34px; height: 34px; background: none; border: 0; color: var(--ink-dim); cursor: pointer; transition: color 0.16s var(--ease); }
.btn-copy:hover { color: var(--cyan); }

.lobby-list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.lobby-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: rgba(9, 19, 34, 0.8); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
}
.logo-badge { width: 42px; height: 42px; display: grid; place-items: center; flex: none; color: var(--cyan); background: rgba(34, 230, 255, 0.08); border: 1px solid var(--line-strong); }
.logo-badge .icon { width: 22px; height: 22px; }
.meta { flex: 1; min-width: 0; }
.r-title { font-weight: 700; }
.r-code { font-family: var(--font-mono); color: var(--cyan-2); letter-spacing: 0.14em; }
.r-sub { font-size: 12.5px; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font: 600 11px var(--font-mono); letter-spacing: 0.04em; padding: 3px 9px;
  background: rgba(9, 19, 34, 0.9); border: 1px solid var(--line); color: var(--ink-dim);
}
.pill .icon { width: 12px; height: 12px; }
.pill.lock { color: var(--amber); border-color: rgba(255, 180, 84, 0.4); }
.pill.live { color: var(--coral); border-color: rgba(255, 107, 107, 0.4); }

.lobby-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
/* Panel-Überschriften außerhalb von .panel-head (Lobby) */
.players-panel > .panel-title, .settings-panel > .panel-title { display: block; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.panel-title .muted { text-transform: none; letter-spacing: normal; font-family: var(--font-mono); }

.player-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.player-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; font-size: 15px;
  background: rgba(var(--pc-rgb), 0.06); border: 1px solid var(--line); border-left: 3px solid var(--pc);
}
.player-item.me { background: rgba(var(--pc-rgb), 0.12); }
.player-item.off { opacity: 0.5; }
.p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pc); font-weight: 600; }
.p-host { color: var(--amber); display: inline-grid; place-items: center; }
.p-kick { display: inline-grid; place-items: center; width: 32px; height: 32px; background: none; border: 0; color: var(--muted); cursor: pointer; transition: color 0.16s var(--ease); }
.p-kick:hover { color: var(--magenta); }
.ready-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: rgba(120, 200, 235, 0.16); border: 1px solid var(--line); }
.ready-dot.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 8px var(--green); }

/* Avatar: Ring + Leuchten in Spielerfarbe, Initialen als "Callsign" */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 12px var(--font-display); letter-spacing: 0.04em; color: var(--pc);
  background: radial-gradient(circle at 50% 30%, rgba(var(--pc-rgb), 0.3), rgba(4, 9, 18, 0.95) 72%);
  border: 2px solid var(--pc); box-shadow: 0 0 10px rgba(var(--pc-rgb), 0.45), inset 0 0 8px rgba(var(--pc-rgb), 0.25);
}

.game-hero { margin-bottom: 16px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.role-chip {
  display: inline-flex; align-items: center; padding: 4px 11px; border: 1px solid; font: 600 11.5px var(--font); letter-spacing: 0.12em; text-transform: uppercase;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.role-chip-receiver { color: var(--role-receiver); border-color: rgba(34, 230, 255, 0.5); background: rgba(34, 230, 255, 0.08); }
.role-chip-interceptor { color: var(--role-interceptor); border-color: rgba(168, 120, 255, 0.5); background: rgba(168, 120, 255, 0.1); }
.role-chip-static { color: var(--role-static); border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.08); }

.settings-body { display: flex; flex-direction: column; gap: 16px; }
.opt { display: flex; flex-direction: column; gap: 8px; }
.opt-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.opt-static { font-size: 15px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-btn {
  min-height: 40px; min-width: 54px; padding: 6px 14px; cursor: pointer;
  font: 600 13.5px var(--font-mono); color: var(--ink-dim);
  background: rgba(6, 13, 25, 0.8); border: 1px solid var(--line);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.seg-btn:not(:disabled):hover { color: var(--ink); border-color: var(--line-strong); background: rgba(34, 230, 255, 0.08); }
.seg-btn.active { color: var(--cyan-2); border-color: var(--cyan); background: rgba(34, 230, 255, 0.16); text-shadow: 0 0 8px rgba(34, 230, 255, 0.6); }
.seg.readonly .seg-btn { cursor: default; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-eye { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; background: none; border: 1px solid var(--line); color: var(--ink-dim); cursor: pointer; transition: color 0.16s var(--ease), border-color 0.16s var(--ease); }
.pw-eye:hover { color: var(--cyan); border-color: var(--line-strong); }
.readonly-note { font-size: 12.5px; color: var(--muted); font-style: italic; }
.opt-static .icon { vertical-align: -0.2em; margin-right: 6px; color: var(--amber); }

.lobby-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.start-hint { font-size: 13.5px; color: var(--ink-dim); text-align: center; }

/* ── 8 Dialoge ─────────────────────────────────────────────────────────────── */
.dialog {
  --cut: 16px; --frame-base: #08111c;
  margin: auto; border: 0; background: transparent; color: var(--ink); padding: 0;
  width: min(420px, 92vw); max-height: 86vh;
  filter: drop-shadow(0 0 22px rgba(34, 230, 255, 0.22));
}
.dialog::backdrop { background: rgba(3, 6, 12, 0.8); }
.dialog-form { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.dialog-form h3 { font-size: 14px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
#rules-dialog { width: min(600px, 94vw); }
.rules-form { padding: 0; gap: 0; }
.rules-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.rules-close { display: inline-grid; place-items: center; width: 40px; height: 40px; background: none; border: 0; color: var(--muted); cursor: pointer; transition: color 0.16s var(--ease); }
.rules-close:hover { color: var(--magenta); }
.rules-body { padding: 18px 24px 24px; max-height: 62vh; overflow-y: auto; font-size: 15px; line-height: 1.6; }
.rules-body h4 { color: var(--cyan); margin: 18px 0 8px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; }
.rules-body ul { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.rules-goal { color: var(--ink); font-style: italic; margin-bottom: 4px; }

/* ── 9 Spiel: HUD-Kopfleiste ────────────────────────────────────────────── */
.game-screen { max-width: none; width: 100%; padding: 14px 18px 18px; gap: 14px; }

.hud {
  --cut: 20px;
  --frame-edge: linear-gradient(120deg, rgba(34, 230, 255, 0.95), rgba(34, 230, 255, 0.3) 30%, rgba(255, 63, 192, 0.35) 70%, rgba(255, 63, 192, 0.9));
  --frame-base: #050a14;
  --frame-fill:
    linear-gradient(90deg, rgba(5, 9, 18, 0.97) 0%, rgba(6, 12, 24, 0.9) 42%, rgba(6, 12, 24, 0.55) 100%),
    url(/img/skyline.svg) right -30px top -60px / cover no-repeat;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px 30px;
  padding: 12px 24px; padding-right: 120px; /* Platz für den fixen Sprachumschalter */
  filter: drop-shadow(0 0 12px rgba(34, 230, 255, 0.18));
}
.hud-title {
  font: 700 clamp(22px, 2.3vw, 34px)/1 var(--font-display); letter-spacing: 0.34em; color: #eafcff; white-space: nowrap;
  text-shadow: -1.5px 0 rgba(255, 63, 192, 0.7), 1.5px 0 rgba(34, 230, 255, 0.7), 0 0 16px rgba(34, 230, 255, 0.35);
}
.hud-slogan { margin-top: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.34em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }

.hud-round { min-width: 0; }
.hud-round-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.round-badge { font: 700 15px var(--font-display); letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; color: var(--cyan-2); text-shadow: 0 0 10px rgba(34, 230, 255, 0.45); }
.scenario-badge { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.round-progress { display: flex; gap: 6px; margin-top: 8px; }
.round-progress .seg { flex: 0 1 34px; min-width: 8px; height: 6px; background: rgba(120, 200, 235, 0.18); transform: skewX(-24deg); }
.round-progress .seg.done { background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 8px rgba(34, 230, 255, 0.55); }
.round-progress .seg.now { background: var(--cyan-2); box-shadow: 0 0 12px var(--cyan); }

.hud-phase { display: flex; align-items: center; gap: 12px; }
.phase-badge {
  padding: 5px 12px; font: 700 11.5px var(--font); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-dim); border: 1px solid var(--line);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.phase-badge.phase-tip { color: var(--cyan-2); border-color: rgba(34, 230, 255, 0.55); background: rgba(34, 230, 255, 0.09); }
.phase-badge.phase-vote { color: var(--amber); border-color: rgba(255, 180, 84, 0.55); background: rgba(255, 180, 84, 0.08); }
.phase-badge.phase-roundEnd, .phase-badge.phase-gameEnd { color: var(--violet); border-color: rgba(168, 120, 255, 0.55); background: rgba(168, 120, 255, 0.09); }
.phase-timer {
  --cut: 8px; --frame-edge: var(--line-strong); --frame-base: #040a14;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 92px; padding: 6px 12px;
  font: 700 18px var(--font-display); letter-spacing: 0.06em; color: var(--ink);
}
.phase-timer .icon { width: 17px; height: 17px; color: var(--cyan); }

.hud-meta { display: flex; align-items: center; gap: 10px; }
.hud-chip {
  --cut: 8px; --frame-edge: var(--line-strong); --frame-base: #071120;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  font: 600 12px var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap;
}
.hud-chip .icon { width: 17px; height: 17px; color: var(--cyan); }
.hud-conn .icon { color: var(--green); filter: drop-shadow(0 0 5px rgba(57, 240, 160, 0.7)); }
.hud-conn.is-off { color: var(--coral); }
.hud-conn.is-off .icon { color: var(--coral); filter: drop-shadow(0 0 5px rgba(255, 107, 107, 0.7)); }

/* ── 10 Spiel: Board-Layout ─────────────────────────────────────────────────
   Desktop: links Szenario/Listen/Eingabe | Mitte Chat & Log | rechts Spieler.
   Alle Panels dauerhaft sichtbar (kein Tab-Verstecken). */
.game-board { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.board-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.board-secret {
  display: grid; gap: 14px; min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "narr narr" "white black";
}
.narrative-panel { grid-area: narr; }
.list-white { grid-area: white; }
.list-black { grid-area: black; }
.board-main { display: flex; flex-direction: column; min-height: 0; }
.board-chat, .board-players { display: flex; flex-direction: column; min-height: 0; }

@media (min-width: 1000px) {
  .game-screen { height: 100dvh; min-height: 0; padding-bottom: 16px; }
  .game-board { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr) minmax(0, 0.92fr); }
  .board-left { min-height: 0; }
  /* Bei sehr niedrigen Fenstern scrollt der obere Bereich, statt die Listen auf 0 zu quetschen. */
  .board-secret { flex: 3 1 0; min-height: 0; overflow-y: auto; grid-template-rows: auto minmax(170px, 1fr); }
  .board-main { flex: 0 1 auto; max-height: 48%; }
  /* Alle Phasen außer der Tipp-Phase: das Phasen-Panel (Rollenkarte, Abstimmung, Ergebnis)
     steht GANZ OBEN in der linken Spalte, Szenario und Listen folgen darunter; die Spalte scrollt. */
  .game-board:not([data-phase="tip"]) .board-left { overflow-y: auto; padding-right: 6px; }
  .game-board:not([data-phase="tip"]) .board-main { order: -1; flex: 0 0 auto; max-height: none; }
  .game-board:not([data-phase="tip"]) .board-secret { flex: 0 0 auto; overflow: visible; grid-template-rows: auto minmax(260px, auto); }
  .chat-log, .game-player-list { flex: 1; min-height: 0; overflow-y: auto; }
}
/* Außerhalb der Tipp-Phase scrollt das Panel nicht selbst (sonst könnte die klebende Aktionsleiste nicht haften). */
.game-board:not([data-phase="tip"]) .board-main .panel-body { overflow: visible; }

/* ── 11 Spiel: Szenario + Whitelist/Blacklist ─────────────────────────────── */
.narrative-panel {
  --cut: 18px; padding: 0; display: grid; grid-template-columns: minmax(96px, 190px) minmax(0, 1fr); min-height: 150px;
}
.narrative-art {
  margin: 1px 0 1px 1px; min-height: 100%;
  background: url(/img/scene.svg) center / cover no-repeat;
  filter: brightness(0.8) saturate(0.95);
  -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 62%, transparent 100%);
  clip-path: polygon(calc(var(--cut) - 1px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--cut) - 1px));
}
.narrative-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 22px 16px 8px; min-width: 0; }
.narrative-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.narrative-title { color: var(--magenta); text-shadow: 0 0 12px rgba(255, 63, 192, 0.5); }
.narrative-head .role-chip { margin-left: auto; cursor: help; }
.secret-narrative { font-size: clamp(17px, 1.5vw, 21px); font-weight: 500; line-height: 1.5; color: #f3f9ff; max-width: 62ch; }
.secret-unknown { font-size: 13.5px; font-style: italic; color: var(--muted); }
.secret-empty { color: var(--muted); font-style: italic; }
/* Verschlüsseltes Szenario (Infiltrator, bis das Leck alle Blacklist-Wörter aufgedeckt hat). */
.secret-narrative.locked { font-family: var(--font-mono); font-size: 15px; overflow-wrap: anywhere; }

.list-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.list-panel .panel-title { font-size: 12.5px; letter-spacing: 0.09em; }
.list-black { --frame-edge: var(--edge-magenta); }
.list-black .panel-head > .icon { color: var(--magenta); filter: drop-shadow(0 0 5px rgba(255, 63, 192, 0.6)); }
.list-black .panel-title { color: var(--magenta); }
.check-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; max-height: 320px; }
@media (min-width: 1000px) { .check-list { max-height: none; } }
.check-row { display: flex; align-items: center; gap: 12px; padding: 5px 8px; min-height: 34px; font-size: 16px; border-left: 2px solid transparent; }
.check-box {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 4px; color: transparent;
  border: 1.5px solid rgba(34, 230, 255, 0.45); background: rgba(3, 8, 17, 0.6);
  transition: background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.check-box .icon { width: 14px; height: 14px; stroke-width: 3; }
.check-text { min-width: 0; overflow-wrap: anywhere; }
.check-row .cipher-code { font-size: 14px; color: var(--muted); opacity: 1; }
.check-row.is-on { background: linear-gradient(90deg, rgba(34, 230, 255, 0.09), transparent 75%); border-left-color: rgba(34, 230, 255, 0.55); }
.check-row.is-on .check-box { background: var(--cyan); border-color: var(--cyan); color: #02131c; box-shadow: 0 0 10px rgba(34, 230, 255, 0.6); }
.check-row.is-claimed .cipher-code { color: var(--cyan); }
.check-row.is-special .check-text { color: var(--amber); font-weight: 600; }
.row-star { width: 15px; height: 15px; color: var(--amber); margin-left: auto; fill: rgba(255, 180, 84, 0.25); }
/* Blacklist: Magenta; unaufgedeckte Wörter durchgestrichen, aufgedeckte fett, markiert, leuchtend */
.list-black .check-box { border-color: rgba(255, 63, 192, 0.5); }
.list-black .check-text { color: #ff9ad9; text-decoration: line-through; text-decoration-color: rgba(255, 63, 192, 0.65); }
.list-black .check-row.is-on { background: linear-gradient(90deg, rgba(255, 63, 192, 0.14), transparent 80%); border-left-color: var(--magenta); box-shadow: 0 0 14px rgba(255, 63, 192, 0.16); }
.list-black .check-row.is-on .check-box { background: var(--magenta); border-color: var(--magenta); color: #1a0413; box-shadow: 0 0 10px rgba(255, 63, 192, 0.7); }
.list-black .check-row.is-on .check-text { color: #fff; font-weight: 700; text-decoration: none; }
.list-watermark { position: absolute; right: 14px; bottom: 12px; width: 84px; height: 84px; color: var(--magenta); opacity: 0.07; stroke-width: 1.2; pointer-events: none; }

/* ── 12 Spiel: Eingabe (Tipp-Phase) + Hinweise ────────────────────────────── */
.panel-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.role-note, .status-note {
  display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-dim);
}
.role-note > .icon, .status-note > .icon { margin-top: 3px; width: 17px; height: 17px; color: var(--cyan); }
.role-note { padding: 10px 8px 10px 14px; background: rgba(34, 230, 255, 0.05); border-left: 2px solid var(--cyan); }
.role-note-text { flex: 1; min-width: 0; }
/* Aufklapp-Schalter: erscheint nur bei niedrigen Fenstern (siehe Media Query unten). */
.role-note-toggle { display: none; flex: none; width: 32px; height: 32px; place-items: center; background: none; border: 0; color: var(--cyan); cursor: pointer; }
.role-note-toggle .icon { width: 18px; height: 18px; transform: rotate(90deg); transition: transform 0.16s var(--ease); }
.role-note.expanded .role-note-toggle .icon { transform: rotate(-90deg); }
.status-note.center { justify-content: center; }
.tip-locked-note { color: var(--green); }
.tip-locked-note .icon { color: var(--green); }
.tip-edits-note .icon { color: var(--violet); }
.tip-form { display: flex; gap: 12px; align-items: stretch; }
.tip-form .input { font-size: 18px; min-height: 56px; padding: 14px 18px; }
.tip-form .btn { min-height: 56px; }

/* ── 13 Spiel: Chat & Log ───────────────────────────────────────────────────── */
.chat-log { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; padding-right: 8px; max-height: 60vh; min-height: 220px; flex: 1; }
@media (min-width: 1000px) { .chat-log { max-height: none; } }
.chat-msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 9px 8px; }
.chat-msg.me { background: linear-gradient(90deg, rgba(var(--pc-rgb), 0.07), transparent 85%); }
.chat-head { display: flex; align-items: baseline; gap: 9px; }
.chat-name { font-weight: 700; color: var(--pc); text-shadow: 0 0 10px rgba(var(--pc-rgb), 0.35); }
.chat-time, .log-time { font: 400 12px var(--font-mono); color: var(--muted); }
.chat-text { color: var(--ink); overflow-wrap: anywhere; }
.log-empty { color: var(--muted); font-style: italic; padding: 8px; }
.chat-form { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-locked-note { margin-top: 12px; padding: 12px 8px 4px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13.5px; font-style: italic; }

/* Ereignisse als Logfile */
.log-line {
  display: flex; align-items: baseline; gap: 10px; margin: 3px 0; padding: 6px 10px;
  font-size: 13.5px; color: var(--ink-dim);
  background: rgba(34, 230, 255, 0.04); border-left: 2px solid rgba(34, 230, 255, 0.45);
}
.log-line.log-phase { border-left-color: var(--cyan); color: var(--cyan-2); }
.log-line.log-elim { border-left-color: var(--magenta); color: #ffc2eb; background: rgba(255, 63, 192, 0.07); }
.log-line.log-black { border-left-color: var(--magenta); color: #ff9ad9; }
.log-line.log-white { border-left-color: var(--green); color: #a8ffd6; background: rgba(57, 240, 160, 0.05); }
.log-text { min-width: 0; overflow-wrap: anywhere; }
.log-live-title { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 4px 2px; font: 600 11.5px var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.log-live { --pc: var(--cyan); align-items: center; border-left-color: rgba(var(--pc-rgb), 0.7); }
.log-live.me { background: rgba(var(--pc-rgb), 0.08); }
.log-name { font-weight: 700; color: var(--pc); flex: none; }
.log-arrow { width: 14px; height: 1.5px; background: var(--muted); flex: none; align-self: center; position: relative; }
.log-arrow::after { content: ""; position: absolute; right: 0; top: -3px; border-left: 5px solid var(--muted); border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }
.log-word { font-family: var(--font-mono); color: var(--ink); overflow-wrap: anywhere; }
.log-word.missing { color: var(--muted); font-style: italic; }
.cipher-code { font-family: var(--font-mono); color: var(--magenta); letter-spacing: 0.12em; opacity: 0.85; }

/* ── 14 Spiel: Spielerkarten (mit letzten Begriffen) ─────────────────────── */
.game-player-list { padding-right: 8px; gap: 10px; }
.player-card {
  --cut: 10px; --frame-edge: linear-gradient(135deg, rgba(var(--pc-rgb), 0.85), rgba(var(--pc-rgb), 0.22) 40%, rgba(var(--pc-rgb), 0.18) 100%);
  --frame-fill: linear-gradient(90deg, rgba(var(--pc-rgb), 0.14), rgba(var(--pc-rgb), 0) 60%);
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 12px 16px; cursor: pointer;
  transition: filter 0.16s var(--ease);
}
.player-card:hover { filter: brightness(1.18); }
.player-card.me { --frame-fill: linear-gradient(90deg, rgba(var(--pc-rgb), 0.24), rgba(var(--pc-rgb), 0.02) 70%); }
.player-card.out { opacity: 0.55; filter: grayscale(0.55); }
.player-card.off { opacity: 0.6; }
.pc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pc-head .avatar { width: 40px; height: 40px; font-size: 13px; }
.pc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 16px; color: var(--pc); text-shadow: 0 0 10px rgba(var(--pc-rgb), 0.35); }
.pc-name small { font-weight: 500; color: var(--ink-dim); margin-left: 4px; text-shadow: none; }
.pc-marks { display: flex; align-items: center; gap: 6px; flex: none; }
.pc-out { color: var(--magenta); }
.pc-chevron { width: 18px; height: 18px; color: var(--muted); transition: transform 0.16s var(--ease); }
.player-card.open .pc-chevron { transform: rotate(90deg); }
.pc-terms { display: flex; flex-direction: column; gap: 4px; padding-left: 52px; font-size: 14px; line-height: 1.45; }
.pc-terms-label { font-size: 12.5px; color: var(--muted); }
.pc-terms-list { color: var(--ink); overflow-wrap: anywhere; }
.pc-terms-list .term:not(:last-child)::after { content: ", "; color: var(--muted); }
.pc-terms-list .term.live { color: var(--cyan-2); text-shadow: 0 0 8px rgba(34, 230, 255, 0.45); }
.term-none { color: var(--muted); }
.pc-terms-all { display: flex; flex-direction: column; gap: 3px; }
.term-round { display: flex; gap: 10px; align-items: baseline; }
.term-round .tr-label { flex: none; min-width: 28px; font: 600 11.5px var(--font-mono); color: var(--muted); }
.vchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid currentColor; border-radius: 4px; font: 700 12px var(--font-mono); animation: pop 0.22s var(--ease); }
.vchip .icon { width: 11px; height: 11px; fill: currentColor; stroke-width: 1.2; }
.vchip-traitor { color: var(--violet); }
.vchip-fake { color: var(--magenta); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── 15 Spiel: Phaseninhalte ─────────────────────────────────────────────── */
.phase-block { display: flex; flex-direction: column; gap: 16px; }

.role-reveal { text-align: center; padding: 28px 18px; border: 1px solid var(--line); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.role-reveal-label { font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.role-reveal-name { font: 700 clamp(28px, 3vw, 40px)/1.15 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; margin: 10px 0 14px; }
.role-reveal-desc { color: var(--ink-dim); max-width: 520px; margin: 0 auto; line-height: 1.6; }
.role-reveal.role-receiver { border-color: rgba(34, 230, 255, 0.4); background: rgba(34, 230, 255, 0.06); }
.role-reveal.role-receiver .role-reveal-name { color: var(--role-receiver); text-shadow: 0 0 24px rgba(34, 230, 255, 0.55); }
.role-reveal.role-interceptor { border-color: rgba(168, 120, 255, 0.4); background: rgba(168, 120, 255, 0.07); }
.role-reveal.role-interceptor .role-reveal-name { color: var(--role-interceptor); text-shadow: 0 0 24px rgba(168, 120, 255, 0.55); }
.role-reveal.role-static { border-color: rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.06); }
.role-reveal.role-static .role-reveal-name { color: var(--role-static); text-shadow: 0 0 24px rgba(255, 107, 107, 0.55); }

.scoring-intro { font-size: 13.5px; color: var(--ink-dim); padding: 10px 16px; background: rgba(34, 230, 255, 0.04); border: 1px solid var(--line); border-left: 2px solid var(--cyan); }
.scoring-intro summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; min-height: 28px; }
.scoring-intro summary::-webkit-details-marker { display: none; }
.sum-chevron { width: 16px; height: 16px; color: var(--cyan); transition: transform 0.16s var(--ease); }
.scoring-intro[open] .sum-chevron { transform: rotate(90deg); }
.scoring-intro ul { margin: 8px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.vote-warning { font-size: 14px; color: #ffc9c9; padding: 10px 14px; background: rgba(255, 107, 107, 0.08); border: 1px solid rgba(255, 107, 107, 0.4); border-left: 3px solid var(--coral); }
.vote-hint { text-align: center; color: var(--ink-dim); font-size: 14px; }
.ballots { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; align-items: start; }
/* Aktionsleiste der Abstimmung: klebt unten, "Vote einloggen" bleibt immer erreichbar. */
.vote-actions {
  position: sticky; bottom: 0; z-index: 3; margin-top: auto; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 0 2px; background: rgba(7, 15, 28, 0.96); border-top: 1px solid var(--line);
}

.ballot-panel { display: flex; flex-direction: column; gap: 10px; }
.ballot-head { display: flex; align-items: center; gap: 9px; }
.ballot-mark { width: 16px; height: 16px; fill: currentColor; stroke-width: 1.2; }
.ballot-traitor .ballot-mark { color: var(--violet); }
.ballot-fake .ballot-mark { color: var(--magenta); }
.ballot-desc { font-size: 13.5px; color: var(--muted); margin-top: -4px; }
.ballot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ballot-cand {
  --cut: 10px; --frame-edge: var(--line-strong); --frame-base: #08131f;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; min-height: 78px;
  border: 0; background: none; cursor: pointer; color: var(--ink); font-family: inherit;
  transition: filter 0.16s var(--ease);
}
.ballot-cand:not(:disabled):hover { filter: brightness(1.25) drop-shadow(0 0 8px rgba(34, 230, 255, 0.4)); }
.ballot-cand:disabled { cursor: default; opacity: 0.85; }
.ballot-cand.active { --frame-edge: linear-gradient(135deg, var(--magenta), var(--violet)); --frame-fill: linear-gradient(rgba(255, 63, 192, 0.16), rgba(255, 63, 192, 0.16)); }
.ballot-traitor .ballot-cand.active { --frame-edge: linear-gradient(135deg, var(--violet), var(--blue)); --frame-fill: linear-gradient(rgba(168, 120, 255, 0.18), rgba(168, 120, 255, 0.18)); }
.ballot-cand .avatar { width: 32px; height: 32px; font-size: 11px; }
.vote-actions .btn-big { min-height: 46px; }
.vote-actions .muted { font-size: 12.5px; }
.cand-name { font-size: 12.5px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ballot-abstain { color: var(--ink-dim); }

/* Live-Stimmen: wer für wen (oder Enthaltung) stimmt – bewusst NICHT anonym. */
.voter-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 20px; }
.voter-chip {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font: 700 9px var(--font-display); color: var(--pc); border: 1.5px solid var(--pc);
  background: rgba(var(--pc-rgb), 0.16); animation: pop 0.2s var(--ease);
}

.roundend-banner { padding: 16px; text-align: center; font-size: 16px; border: 1px solid var(--line); background: rgba(9, 19, 34, 0.7); }
.roundend-banner.role-static { border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.08); color: #ffc9c9; }
.roundend-banner.role-interceptor { border-color: rgba(168, 120, 255, 0.5); background: rgba(168, 120, 255, 0.09); color: #e2d4ff; }
.roundend-banner.role-receiver { border-color: rgba(57, 240, 160, 0.45); background: rgba(57, 240, 160, 0.07); color: #b9ffe0; }
.penalty-note { margin-top: 6px; font-size: 13.5px; opacity: 0.85; }

.gameend-title { font: 700 26px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-2); text-shadow: 0 0 14px rgba(34, 230, 255, 0.5); }
.gameend-reason { color: var(--ink-dim); margin-top: -8px; }
.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(9, 19, 34, 0.85); border: 1px solid var(--line); border-left: 3px solid var(--pc); }
.score-row.me { background: rgba(var(--pc-rgb), 0.1); }
.score-rank { font-family: var(--font-mono); color: var(--muted); width: 28px; }
.score-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--pc); }
.score-points { font: 700 17px var(--font-mono); color: var(--cyan-2); }
.score-points.neg { color: var(--magenta); }
.score-toggle { align-self: flex-start; background: none; border: 0; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; margin: -2px 0 4px; min-height: 28px; }
.score-toggle:hover { color: var(--cyan); }
.score-breakdown { display: none; flex-direction: column; gap: 5px; padding: 10px 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); margin-top: -4px; }
.score-breakdown.open { display: flex; }
.score-detail { display: flex; justify-content: space-between; gap: 10px; font: 400 12.5px var(--font-mono); color: var(--ink-dim); }
.score-detail .pos { color: var(--cyan-2); }
.score-detail .neg { color: var(--magenta); }
.role-tag {
  font: 600 10.5px var(--font); padding: 2px 9px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; flex: none;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.role-tag-receiver { background: rgba(34, 230, 255, 0.14); color: var(--role-receiver); }
.role-tag-interceptor { background: rgba(168, 120, 255, 0.16); color: var(--role-interceptor); }
.role-tag-static { background: rgba(255, 107, 107, 0.14); color: var(--role-static); }

/* ── 16 Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1440px) and (min-width: 1181px) { /* HUD einzeilig halten, auch mit langer Phasen-Plakette */
  .hud { gap: 12px 18px; }
  .hud-title { letter-spacing: 0.26em; }
  .hud-slogan { letter-spacing: 0.24em; }
  .phase-badge { letter-spacing: 0.1em; padding-inline: 10px; }
  .hud-chip { letter-spacing: 0.08em; padding-inline: 10px; }
}
@media (max-width: 1180px) and (min-width: 1000px) {
  .hud { grid-template-columns: auto minmax(0, 1fr) auto; }
  .hud-meta { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 999px) {
  .game-screen { padding-top: 60px; } /* Kopfstreifen für Timer (links) und Sprachumschalter (rechts) */
  .hud { grid-template-columns: minmax(0, 1fr) auto; padding-right: 24px; }
  .hud-round { grid-column: 1 / -1; }
  .hud-phase { grid-column: 1; }
  .hud-meta { grid-column: 2; justify-self: end; }
  /* Die Seite scrollt hier: der Timer bleibt daher oben links stehen.
     (Ein filter am HUD würde position:fixed an das HUD binden – daher hier ohne.) */
  .hud { filter: none; z-index: 40; } /* HUD-Stapel über den Panels, sonst verdecken sie den Timer */
  .phase-timer {
    position: fixed; top: 12px; left: 12px; z-index: 50; min-width: 76px; padding: 4px 10px; font-size: 15px;
    filter: drop-shadow(0 0 10px rgba(34, 230, 255, 0.28));
  }
  .phase-timer .icon { width: 15px; height: 15px; }
  .lobby-grid { grid-template-columns: 1fr; }
  .board-players .game-player-list { max-height: none; }
  .board-chat .chat-log { min-height: 260px; }
}
@media (max-width: 640px) {
  .screen { padding-top: 60px; }
  .game-screen { padding: 60px 12px 16px; }
  .topbar { padding-right: 0; flex-wrap: wrap; }
  .topbar-title { order: 3; flex-basis: 100%; }
  .brand-text { font-size: 66px; }
  .hud { padding: 12px 14px; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
  .hud-brand, .hud-round { grid-column: 1 / -1; }
  .hud-phase { grid-column: 1; }
  .hud-meta { grid-column: 2; justify-self: end; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .hud-chip { padding: 5px 9px; font-size: 11px; letter-spacing: 0.1em; gap: 6px; }
  .hud-chip .icon { width: 15px; height: 15px; }
  .hud-title { letter-spacing: 0.22em; }
  .hud-slogan { letter-spacing: 0.2em; white-space: normal; }
  .board-secret { grid-template-columns: minmax(0, 1fr); grid-template-areas: "narr" "white" "black"; }
  .narrative-panel { grid-template-columns: minmax(0, 1fr); }
  .narrative-art { min-height: 84px; -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent); mask-image: linear-gradient(180deg, #000 50%, transparent); }
  .narrative-body { padding: 4px 18px 16px; }
  .tip-form { flex-direction: column; }
  .btn-send { width: 100%; }
  .role-reveal-name { font-size: 26px; }
  .pc-terms { padding-left: 0; }
  .rules-head, .rules-body { padding-left: 16px; padding-right: 16px; }
  .role-reveal { padding: 22px 12px; }
}

/* Niedrige Desktop-Fenster (Laptops): kompakter, damit Listen und Eingabe gleichzeitig Platz haben. */
@media (min-width: 1000px) and (max-height: 860px) {
  .panel:not(.narrative-panel) { padding: 13px 16px; }
  .panel-head { padding-bottom: 8px; margin-bottom: 8px; }
  .narrative-panel { min-height: 118px; }
  .narrative-body { padding-top: 12px; padding-bottom: 12px; gap: 6px; }
  .secret-narrative { font-size: 17px; }
  .panel-body { gap: 10px; }
  .tip-form .input, .tip-form .btn { min-height: 48px; }
  .role-note-toggle { display: inline-grid; }
  .role-note:not(.expanded) .role-note-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .game-board[data-phase="tip"] .board-main { max-height: 44%; }
}

/* ── 17 Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
