/* ---------- Fonts (selbst gehostet) ---------- */
@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Themes ----------
   Graphit (Standard): neutral dunkel, Akzent Smaragd
   Hell:               hell, schwarz/weiß
   Nacht:              Violett/Pink
   Wald:               Dunkelgrün/Sand
   Klassisch:          TV-Blau/Gold                                  */
:root,
[data-theme="graphit"] {
  --bg: #0e0f11;
  --glow-1: rgba(255, 255, 255, 0.035);
  --glow-2: rgba(52, 211, 153, 0.05);
  --text: #f4f4f5;
  --muted: #8e8e98;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --field: rgba(0, 0, 0, 0.3);
  --accent: #34d399;
  --accent-2: #10b981;
  --on-accent: #032217;
  --tile-top: #27282d;
  --tile-bot: #1d1e22;
  --tile-text: #fafafa;
  --tile-glow: transparent;
  --tile-hi: rgba(255, 255, 255, 0.07);
  --tile-shadow: rgba(0, 0, 0, 0.45);
  --cat: #151619;
  --cat-text: #d4d4d8;
  --stage-1: #2a2b30;
  --stage-2: #121316;
  --stage-text: #fafafa;
  --stage-chip: rgba(255, 255, 255, 0.06);
  --stage-line: rgba(255, 255, 255, 0.12);
  --green: #34d399;
  --red: #f87171;
  color-scheme: dark;
}
[data-theme="hell"] {
  --bg: #f3f2ee;
  --glow-1: rgba(255, 255, 255, 0.8);
  --glow-2: rgba(0, 0, 0, 0.02);
  --text: #18181b;
  --muted: #6b6b73;
  --surface: #ffffff;
  --surface-2: #f1f1f0;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.15);
  --field: #ffffff;
  --accent: #18181b;
  --accent-2: #27272a;
  --on-accent: #ffffff;
  --tile-top: #ffffff;
  --tile-bot: #f7f7f5;
  --tile-text: #18181b;
  --tile-glow: transparent;
  --tile-hi: rgba(255, 255, 255, 1);
  --tile-shadow: rgba(0, 0, 0, 0.08);
  --cat: #18181b;
  --cat-text: #ffffff;
  --stage-1: #ffffff;
  --stage-2: #eeede8;
  --stage-text: #18181b;
  --stage-chip: rgba(0, 0, 0, 0.05);
  --stage-line: rgba(0, 0, 0, 0.1);
  --green: #15803d;
  --red: #dc2626;
  color-scheme: light;
}
[data-theme="nacht"] {
  --bg: #100b1c;
  --glow-1: rgba(168, 85, 247, 0.2);
  --glow-2: rgba(236, 72, 153, 0.12);
  --text: #f5f3ff;
  --muted: #a198bd;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --field: rgba(0, 0, 0, 0.3);
  --accent: #f472b6;
  --accent-2: #e879f9;
  --on-accent: #2a0a1f;
  --tile-top: #5b21b6;
  --tile-bot: #3b1580;
  --tile-text: #ffffff;
  --tile-glow: rgba(244, 114, 182, 0.35);
  --tile-hi: rgba(255, 255, 255, 0.16);
  --tile-shadow: rgba(30, 0, 60, 0.5);
  --cat: #1c1430;
  --cat-text: #e9e3ff;
  --stage-1: #4c1d95;
  --stage-2: #1a0d38;
  --stage-text: #ffffff;
  --stage-chip: rgba(0, 0, 0, 0.25);
  --stage-line: rgba(255, 255, 255, 0.15);
  --green: #4ade80;
  --red: #fb7185;
  color-scheme: dark;
}
[data-theme="wald"] {
  --bg: #0a1310;
  --glow-1: rgba(52, 211, 153, 0.1);
  --glow-2: rgba(233, 216, 166, 0.06);
  --text: #f1ede0;
  --muted: #92a399;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --field: rgba(0, 0, 0, 0.3);
  --accent: #e9d8a6;
  --accent-2: #d6c085;
  --on-accent: #1d1a0e;
  --tile-top: #1b5e3b;
  --tile-bot: #134229;
  --tile-text: #f5ecd0;
  --tile-glow: rgba(233, 216, 166, 0.2);
  --tile-hi: rgba(255, 255, 255, 0.1);
  --tile-shadow: rgba(0, 0, 0, 0.45);
  --cat: #10201a;
  --cat-text: #dfe9e2;
  --stage-1: #1d6440;
  --stage-2: #0b2719;
  --stage-text: #f5ecd0;
  --stage-chip: rgba(0, 0, 0, 0.25);
  --stage-line: rgba(255, 255, 255, 0.14);
  --green: #6ee7b7;
  --red: #fca5a5;
  color-scheme: dark;
}
[data-theme="klassisch"] {
  --bg: #060a1c;
  --glow-1: rgba(59, 91, 255, 0.28);
  --glow-2: rgba(255, 176, 32, 0.1);
  --text: #eef1ff;
  --muted: #8f99c7;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --field: rgba(0, 0, 0, 0.25);
  --accent: #ffc940;
  --accent-2: #ffb020;
  --on-accent: #1a1200;
  --tile-top: #2f55f0;
  --tile-bot: #1934b8;
  --tile-text: #ffc940;
  --tile-glow: rgba(255, 201, 64, 0.35);
  --tile-hi: rgba(255, 255, 255, 0.22);
  --tile-shadow: rgba(10, 20, 80, 0.45);
  --cat: #111a45;
  --cat-text: #eef1ff;
  --stage-1: #2142d6;
  --stage-2: #0d1a6e;
  --stage-text: #ffffff;
  --stage-chip: rgba(0, 0, 0, 0.25);
  --stage-line: rgba(255, 255, 255, 0.15);
  --green: #22c55e;
  --red: #f05252;
  color-scheme: dark;
}

:root {
  --radius: 14px;
  --display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ring: color-mix(in srgb, var(--accent) 30%, transparent);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color .3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons & Inputs ---------- */
button, .btn {
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, transform .08s, border-color .15s, box-shadow .15s, filter .15s;
}
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; transform: none; }
button.primary, .btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--on-accent);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.green { background: color-mix(in srgb, var(--green) 14%, transparent); border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--green); }
button.green:hover { background: color-mix(in srgb, var(--green) 26%, transparent); }
button.red { background: color-mix(in srgb, var(--red) 12%, transparent); border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }
button.red:hover { background: color-mix(in srgb, var(--red) 24%, transparent); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--surface); }
button.small, .btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

input, textarea, select {
  font: 500 14px/1.4 var(--sans);
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.hint { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 8px 0 0; }

.logo {
  font-family: var(--display);
  letter-spacing: 2px;
  color: var(--text);
}
.logo span { color: var(--accent); }

/* ---------- Startseite ---------- */
.home {
  max-width: 440px;
  margin: 0 auto;
  padding: 12vh 16px 48px;
}
.home h1 {
  font-size: clamp(64px, 16vw, 104px);
  line-height: .9;
  text-align: center;
  margin: 0 0 10px;
}
.home .tagline { text-align: center; color: var(--muted); margin: 0 0 40px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.card h2 { margin: 0 0 14px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.home .row { display: flex; gap: 8px; flex-wrap: wrap; }
.home .row .btn { flex: 1; }
.home #code {
  font: 700 22px/1 var(--sans);
  letter-spacing: 6px;
  text-transform: uppercase;
  text-align: center;
  flex: 1;
  min-width: 0;
}

/* ---------- Board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(4px, .8vw, 10px);
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 72px;
  padding: 8px;
  border-radius: clamp(6px, 1vw, 12px);
  user-select: none;
}
.cell.cat {
  background: var(--cat);
  color: var(--cat-text);
  border: 1px solid var(--line);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: clamp(10px, 1.1vw, 16px);
  line-height: 1.2;
  min-height: 84px;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.cell.val {
  position: relative;
  background: linear-gradient(180deg, var(--tile-top), var(--tile-bot));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--tile-hi), 0 6px 18px var(--tile-shadow);
  font-family: var(--display);
  font-size: clamp(22px, 3.6vw, 60px);
  letter-spacing: 1px;
  color: var(--tile-text);
  text-shadow: 0 0 22px var(--tile-glow);
  transition: transform .15s, box-shadow .15s, filter .15s, border-color .15s;
}
.cell.val.used {
  background: transparent;
  border: 1px dashed var(--line);
  box-shadow: none;
  color: transparent;
  text-shadow: none;
}
.cell.val.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 32px var(--ring);
  z-index: 1;
}
.host .cell.val { cursor: pointer; }
.host .cell.val:not(.used):hover { transform: translateY(-2px); border-color: var(--accent); }
.host .cell.val.used { color: color-mix(in srgb, var(--text) 15%, transparent); }
.host .cell.val.used:hover { border-color: var(--line-strong); color: color-mix(in srgb, var(--text) 40%, transparent); }

/* ---------- Punkte ---------- */
.scores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.score {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 120px;
  padding: 10px 18px 8px;
  text-align: center;
}
.score-name {
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.score-value {
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.score-value.neg { color: var(--red); }
.score-empty { color: var(--muted); padding: 12px; font-size: 14px; }

/* ---------- Spieleransicht ---------- */
.player-page {
  display: flex;
  flex-direction: column;
  /* genau eine Bildschirmhöhe: Board passt sich an, Punkte bleiben ohne Scrollen sichtbar.
     dvh = sichtbare Höhe ohne Browser-Adressleiste (Handy) */
  height: 100vh;
  height: 100dvh;
  padding: clamp(8px, 1.5vw, 24px);
  gap: clamp(10px, 1.5vw, 20px);
}
/* Kategorie-Zeile so hoch wie nötig, die 5 Punktereihen teilen sich den Rest */
.player-page .board { flex: 1 1 auto; min-height: 0; grid-template-rows: auto repeat(5, minmax(0, 1fr)); }
.player-page > .scores, .player-page > .turn-banner { flex: none; }
.player-page .cell.val { min-height: 0; }
.topright {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
}
.sound-btn {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.sound-btn.attention { border-color: var(--accent); color: var(--accent); animation: pulse 1.6s infinite; }
.status {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status.ok::before { background: var(--green); }
.status.bad::before { background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.waiting {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  font-size: 18px;
  color: var(--muted);
}
.waiting::before {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.clue-overlay {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 8vw 18vh;
  text-align: center;
  z-index: 10;
  color: var(--stage-text);
  background: radial-gradient(1000px 600px at 50% 30%, var(--stage-1), var(--stage-2) 75%);
}
.clue-overlay.show { display: flex; }
/* Einblenden ohne Zoom (z. B. beim Beitreten mitten in einer Frage) */
.clue-overlay.entering { animation: clueIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes clueIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.clue-meta {
  display: inline-flex;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--stage-chip);
  border: 1px solid var(--stage-line);
  color: var(--accent);
  font-weight: 700;
  font-size: clamp(13px, 1.4vw, 20px);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 5vh;
}
.clue-text {
  font-weight: 800;
  font-size: clamp(26px, 4.6vw, 72px);
  line-height: 1.15;
  letter-spacing: -0.5px;
  max-width: 1400px;
  text-wrap: balance;
  white-space: pre-wrap;
}
.clue-answer {
  margin-top: 6vh;
  padding: 16px 32px;
  border-radius: 16px;
  background: var(--stage-chip);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  font-size: clamp(22px, 3.4vw, 54px);
  white-space: pre-wrap;
  animation: clueIn .4s cubic-bezier(.2, .8, .2, 1);
}
.clue-answer:empty { display: none; }
.clue-overlay .scores { position: absolute; bottom: 20px; left: 20px; right: 20px; }
.clue-overlay .score { background: var(--stage-chip); border-color: var(--stage-line); min-width: 100px; padding: 6px 14px 4px; }
.clue-overlay .score-name { color: color-mix(in srgb, var(--stage-text) 60%, transparent); }
.clue-overlay .score-value { color: var(--stage-text); font-size: clamp(22px, 2.2vw, 34px); }
.clue-overlay .score-value.neg { color: var(--red); }

/* ---------- Live-Reaktionen ---------- */
.react-bar {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.react-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  touch-action: manipulation;
}
.react-btn:hover { background: var(--surface-2); }
.react-btn:active { transform: scale(.85); }
.react-bar.locked .react-btn:not(.react-toggle) { opacity: .35; filter: grayscale(1); pointer-events: none; }
.react-bar.locked::after {
  content: attr(data-wait); font-size: 12px; font-weight: 700; color: var(--muted);
  text-align: center; white-space: nowrap; padding: 2px 0;
}
body:has(#reactBar:not([hidden])) .player-page { padding-right: 66px; }
.react-layer { position: fixed; inset: 0; z-index: 27; pointer-events: none; overflow: hidden; }
.react-float {
  position: absolute;
  bottom: -60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: floatUp 2.8s cubic-bezier(.2, .6, .4, 1) forwards;
}
.react-emoji { font-size: clamp(34px, 5vw, 56px); line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3)); }
.react-name {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
@keyframes floatUp {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  12% { opacity: 1; transform: translate(calc(var(--sway) * .2), -12vh) scale(1.1); }
  70% { opacity: 1; }
  100% { transform: translate(var(--sway), -70vh) scale(1); opacity: 0; }
}

/* ---------- Auszeichnungen (Siegerehrung) ---------- */
.awards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 28px;
}
.award {
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--stage-chip);
  border: 1px solid var(--stage-line);
  animation: clueIn .5s var(--d, 1s) cubic-bezier(.2, .8, .2, 1) both;
}
.award-icon { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.award-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); }
.award-name { font-weight: 800; font-size: 17px; margin-top: 4px; overflow-wrap: anywhere; }
.award-value { font-size: 13px; color: color-mix(in srgb, var(--stage-text) 65%, transparent); margin-top: 2px; }

/* ---------- Runden-Intro ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--stage-text);
  /* halbtransparent, damit man das Board dahinter aufklappen sieht */
  background: color-mix(in srgb, var(--stage-2) 62%, transparent);
  backdrop-filter: blur(1.5px);
}
.intro.show { display: flex; }
.intro[data-step$=":0"] { background: radial-gradient(1000px 600px at 50% 40%, var(--stage-1), var(--stage-2) 75%); }
.intro-inner.anim { animation: introIn .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes introIn {
  from { opacity: 0; transform: translateY(24px) scale(.92); letter-spacing: 12px; }
  to { opacity: 1; transform: none; }
}
.intro-kicker {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: clamp(12px, 1.6vw, 20px);
  margin-bottom: 1vh;
}
.intro-title {
  font-family: var(--display);
  font-size: clamp(52px, 11vw, 170px);
  line-height: .95;
  letter-spacing: 2px;
  text-transform: uppercase;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.35);
}
.intro-sub { margin-top: 2vh; font-size: clamp(14px, 1.8vw, 22px); color: color-mix(in srgb, var(--stage-text) 65%, transparent); }
.intro-sub:empty { display: none; }
.intro-skip { position: absolute; right: 20px; bottom: 20px; }
.cell.cat.hidden-cat { color: transparent; background: transparent; border-style: dashed; }
.cell.cat.flip { animation: flipIn .7s .25s cubic-bezier(.2, .8, .2, 1) both; border-color: var(--accent); }
@keyframes flipIn { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.board.intro-active .cell.val { opacity: 0; transform: scale(.85); }
.board.deal .cell.val { animation: deal .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes deal { from { opacity: 0; transform: scale(.6) translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .intro-inner.anim, .cell.cat.flip, .board.deal .cell.val { animation: none; }
}

/* ---------- Am Zug ---------- */
.turn-banner {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 12px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent);
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 20px);
  width: fit-content;
}
.player-page .turn-banner { margin-bottom: 0; }
.turn-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}
.host-page main { display: flex; flex-direction: column; }
.score.turn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px var(--ring); }
.score.turn .score-name { color: var(--accent); }
.score.turn .score-name::before { content: "🎯 "; }
.turn-btn { filter: grayscale(1); opacity: .45; }
.turn-btn.on { filter: none; opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }

/* ---------- Bilder in Fragen ---------- */
.clue-img {
  display: block;
  max-width: min(100%, 900px);
  max-height: 38vh;
  object-fit: contain;
  border-radius: 14px;
  margin: 0 auto 4vh;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  background: var(--stage-chip);
}
.clue-img.host-img { max-height: 220px; margin: 14px 0 0; }
/* Verpixelt: winziges Bild hart hochskaliert */
.clue-img.pixel { image-rendering: pixelated; width: min(100%, 900px); height: 38vh; }
.clue-img.host-img.pixel { width: 100%; height: 220px; }
.clue-overlay { overflow-y: auto; }

/* ---------- Siegerehrung ---------- */
.finish {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden auto;
  color: var(--stage-text);
  background: radial-gradient(1000px 600px at 50% 20%, var(--stage-1), var(--stage-2) 75%);
}
.finish.show { display: flex; animation: clueIn .4s cubic-bezier(.2, .8, .2, 1); }
.finish-inner { position: relative; z-index: 1; width: 100%; max-width: 900px; text-align: center; }
.finish-inner > .primary { margin-top: 28px; }
.pod-title { color: var(--accent); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: clamp(12px, 1.4vw, 18px); }
.pod-winner { font-family: var(--display); font-size: clamp(44px, 9vw, 110px); line-height: 1; margin: 8px 0 5vh; letter-spacing: 1px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1.5vw, 16px); align-items: end; }
.pod-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pod-names { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.pod-name { font-weight: 800; font-size: clamp(14px, 2vw, 26px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-score { font-family: var(--display); font-size: clamp(22px, 3vw, 40px); color: var(--accent); line-height: 1; }
.pod-block {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, var(--tile-top), var(--tile-bot));
  border: 1px solid var(--stage-line);
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 80px);
  color: var(--tile-text);
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
.p1 .pod-block { height: clamp(150px, 26vh, 260px); border-color: var(--accent); box-shadow: 0 0 40px var(--ring); }
.p2 .pod-block { height: clamp(110px, 19vh, 190px); animation-delay: .15s; }
.p3 .pod-block { height: clamp(80px, 13vh, 130px); animation-delay: .3s; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
.pod-rest {
  margin: 24px auto 0;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.pod-rest div { display: flex; gap: 10px; padding: 8px 14px; border-radius: 10px; background: var(--stage-chip); }
.pod-rest span { color: color-mix(in srgb, var(--stage-text) 60%, transparent); min-width: 2ch; }
.pod-rest b { margin-left: auto; }
.confetti {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  opacity: .95;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); opacity: .9; }
}

/* ---------- Timer ---------- */
.timer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}
.timer-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--stage-chip);
  border: 1px solid var(--stage-line);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .1s linear, background .2s;
}
.timer-num {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.timer.urgent .timer-fill { background: var(--red); }
.timer.urgent .timer-num { color: var(--red); animation: pulse 1s infinite; }
.timer.big { max-width: 720px; margin: 0 0 4vh; }
.timer.big .timer-track { height: 12px; }
.timer.big .timer-num { font-size: clamp(36px, 5vw, 72px); }

/* ---------- Buzzer (Spieler) ---------- */
.buzz-area {
  margin-top: 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.buzzer {
  width: clamp(140px, 30vw, 220px);
  height: clamp(140px, 30vw, 220px);
  border-radius: 50%;
  border: 0;
  font-family: var(--display);
  font-size: clamp(30px, 6vw, 56px);
  letter-spacing: 2px;
  line-height: 1;
  color: #fff;
  touch-action: manipulation;
  transition: background .15s, box-shadow .15s, transform .08s;
}
/* scharf: rot und pulsierend */
.buzzer.live {
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #e11d48 55%, #9f1239);
  box-shadow: 0 10px 0 #7f1028, 0 18px 40px rgba(225, 29, 72, 0.45);
  animation: buzzPulse 1.2s ease-in-out infinite;
}
/* noch zu: grau, ohne Puls */
.buzzer.wait {
  background: radial-gradient(circle at 35% 30%, #9ca3af, #6b7280 55%, #4b5563);
  box-shadow: 0 10px 0 #374151;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(22px, 4.5vw, 40px);
}
/* nach Frühstart gesperrt */
.buzzer.locked {
  background: radial-gradient(circle at 35% 30%, #57534e, #292524 60%, #1c1917);
  box-shadow: 0 4px 0 #0c0a09;
  color: #fca5a5;
  font-size: clamp(22px, 4.5vw, 40px);
  transform: translateY(6px);
  animation: shake .3s;
}
@keyframes shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
.buzzer:hover { border-color: transparent; filter: brightness(1.08); }
.buzzer.live:active, .buzzer:disabled { transform: translateY(8px); box-shadow: 0 2px 0 #7f1028, 0 8px 20px rgba(225, 29, 72, 0.4); animation: none; }
.buzzer:disabled { opacity: .7; }
/* selbst gebuzzert und dran: grün, nicht mehr drückbar */
.buzzer.mine, .buzzer.mine:disabled {
  background: radial-gradient(circle at 35% 30%, #86efac, #16a34a 55%, #166534);
  box-shadow: 0 4px 0 #14532d, 0 12px 30px rgba(22, 163, 74, 0.4);
  transform: translateY(6px);
  opacity: 1;
  font-size: clamp(26px, 5vw, 48px);
  animation: none;
}
@keyframes buzzPulse { 50% { box-shadow: 0 10px 0 #7f1028, 0 18px 60px rgba(225, 29, 72, 0.75); } }
.buzz-info {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--stage-chip);
  border: 1px solid var(--stage-line);
  font-weight: 700;
  font-size: clamp(16px, 2vw, 26px);
}
.buzz-info.mine { border-color: var(--accent); color: var(--accent); animation: pulse 1.2s infinite; }

/* ---------- Namensauswahl & „Du bist…“ ---------- */
.topleft { position: fixed; top: 12px; left: 12px; z-index: 20; }
.me-btn { border-radius: 999px; padding: 6px 12px; font-size: 12px; background: var(--surface); backdrop-filter: blur(8px); }
.picker {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
}
.picker-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.picker-card h2 { margin: 0 0 16px; font-size: 22px; }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pick { padding: 16px 10px; font-size: 16px; }
.picker-empty { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.picker-list:empty { display: none; }
.pick.taken { opacity: .45; flex-direction: column; gap: 4px; }
.pick.taken::after { content: attr(data-reason); font-size: 11px; font-weight: 600; color: var(--muted); }
.pick { display: flex; flex-direction: column; gap: 4px; }
.pick-name { display: inline-flex; align-items: center; gap: 6px; }
.pick-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.picker-name { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.picker-name input { font-size: 16px; }
.picker-alt { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.picker-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
}
.pick:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Host ---------- */
.host-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px;
  min-height: 100vh;
  max-width: 1700px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .host-page { grid-template-columns: 1fr; padding: 12px; }
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.topbar .spacer { flex: 1; }
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.seg button { border: 0; background: transparent; color: var(--muted); }
.seg button.primary { color: var(--on-accent); background: var(--accent); }
.room {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}
.room .label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.room .code { font-family: var(--display); color: var(--text); font-size: 30px; letter-spacing: 4px; line-height: 1; }
.room .join-line { flex-basis: 100%; display: flex; align-items: center; gap: 12px; }
.room .link { font-size: 12px; color: var(--muted); word-break: break-all; min-width: 0; }
/* QR-Code im Host-Pult: klein, per Klick groß (immer schwarz auf weiß, damit er scannt) */
.qr { flex: none; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 6px; background: #fff; cursor: zoom-in; line-height: 0; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr.big { width: min(300px, 80vw); height: min(300px, 80vw); cursor: zoom-out; }
/* TV: großer QR-Code, solange das Spiel noch nicht läuft */
.invite-tv { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; background: var(--bg, #111); cursor: pointer; }
.invite-tv[hidden] { display: none; }
.invite-card { display: flex; flex-direction: column; align-items: center; gap: 2vmin; text-align: center; }
.invite-card h2 { margin: 0; font-size: 5vmin; }
.invite-qr { width: min(60vh, 70vw); height: min(60vh, 70vw); background: #fff; border-radius: 1.5vmin; overflow: hidden; line-height: 0; }
.invite-qr svg { width: 100%; height: 100%; display: block; }
.invite-code { font-size: 4vmin; }
.invite-code b { letter-spacing: .12em; }
.invite-link { font-size: 2vmin; color: var(--muted); word-break: break-all; max-width: 80vw; }
#qrBtn.on { background: var(--accent); color: var(--on-accent, #000); }
.status-inline { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.status-inline::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-inline.ok { color: var(--green); }
.status-inline.bad { color: var(--red); }
.pill { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }

.side { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.prow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.prow:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.prow .pname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.prow .pname:hover { color: var(--accent); }
.prow input.pscore { text-align: right; padding: 7px 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prow .pbtns { display: flex; gap: 4px; }
.prow .pbtns button { padding: 6px 8px; }
.add-player { display: flex; gap: 8px; margin-top: 4px; }
.add-player button { flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.theme-btn {
  flex-direction: column;
  gap: 6px;
  padding: 8px 4px;
  font-size: 11px;
  background: transparent;
}
.theme-btn .sw {
  width: 100%;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
}
.theme-btn.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }

.host-clue {
  display: none;
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 16px;
  color: var(--stage-text);
  border: 1px solid var(--stage-line);
  background: radial-gradient(700px 300px at 20% 0%, var(--stage-1), var(--stage-2));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.host-clue.show { display: block; animation: clueIn .3s cubic-bezier(.2, .8, .2, 1); }
.host-clue .meta {
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.host-clue .q { font-size: clamp(20px, 2vw, 28px); font-weight: 800; line-height: 1.25; white-space: pre-wrap; }
.host-clue .a {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--stage-chip);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  font-size: 20px;
  font-weight: 700;
  white-space: pre-wrap;
}
.host-clue .a::before {
  content: "Antwort · Spieler sehen sie erst nach dem Aufdecken";
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.judge { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 16px; }
.judge .jrow {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 8px 8px 14px;
  border-radius: 12px;
  background: var(--stage-chip);
}
.judge .jrow.buzzed { box-shadow: inset 0 0 0 2px var(--accent); }
.buzz-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--stage-chip);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
  font-weight: 700;
}
.device {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  vertical-align: middle;
  cursor: pointer;
  box-shadow: 0 0 0 3px transparent;
  transition: box-shadow .15s;
}
.device:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 35%, transparent); }
.judge .jrow.right { box-shadow: inset 0 0 0 1px var(--green); }
.judge .jrow.wrong { box-shadow: inset 0 0 0 1px var(--red); opacity: .75; }
.judge .verdict { font-weight: 700; font-size: 13px; padding: 6px 10px; }
.judge .jrow.right .verdict { color: var(--green); }
.judge .jrow.wrong .verdict { color: var(--red); }
.judge .jrow .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-clue .hint { color: color-mix(in srgb, var(--stage-text) 70%, transparent); }
.clue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--stage-line); }
.clue-actions button:not(.primary) { background: var(--stage-chip); border-color: var(--stage-line); color: var(--stage-text); }

.log { font-size: 13px; color: var(--muted); max-height: 200px; overflow: auto; }
.log div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.log div:first-child { color: var(--text); }
.log div:last-child { border-bottom: 0; }

/* ---------- Editor ---------- */
.editor { max-width: 1600px; margin: 0 auto; padding: 20px 20px 64px; }
.editor .title-field { max-width: 480px; font-size: 18px; font-weight: 700; }
.editor .tabs { margin-top: 16px; }
.ed-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.ed-cat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.ed-cat > input {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  background: var(--cat);
  color: var(--cat-text);
}
.ed-clue {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}
.ed-clue .pts { font-family: var(--display); color: var(--accent); font-size: 22px; line-height: 1; margin-bottom: 8px; letter-spacing: 1px; }
.ed-clue textarea { resize: vertical; min-height: 64px; margin-bottom: 6px; font-size: 13px; }
.ed-clue input { font-size: 13px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 6%, var(--field)); }
.saved { font-size: 13px; font-weight: 600; color: var(--green); }
.saved.error { color: var(--red); }
.ed-img { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; min-width: 0; }
.ed-img input { font-size: 12px; padding: 7px 10px; background: var(--field); border-color: var(--line-strong); }
.ed-img input.invalid { border-color: var(--red); }
.ed-img img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ed-img button { flex: none; }


/* ---------- Spielerseite: nichts markierbar, kein Doppeltipp-Zoom ---------- */
.player-body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.player-body input { -webkit-user-select: text; user-select: text; }

/* ---------- Team-Modus ---------- */
.team-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--team, var(--accent));
  margin-right: 6px;
  vertical-align: middle;
  flex: none;
}
.score[style*="--team"] { border-top: 3px solid var(--team); }
.pmembers {
  grid-column: 1 / -1;
  margin-top: -2px;
  padding-left: 10px;
  border-left: 3px solid var(--team, var(--line));
  font-size: 12px;
  color: var(--muted);
}
.mini-seg { padding: 2px; border-radius: 9px; }
.mini-seg button { padding: 5px 10px; font-size: 12px; border-radius: 7px; text-transform: none; letter-spacing: 0; }
.team-size { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.share-row select { padding: 6px 8px; }
.team-size input { width: 64px; padding: 6px 8px; text-align: center; font-weight: 700; }

/* ---------- TV-Ansicht ---------- */
body.tv .me-btn { opacity: .6; }
body.tv .buzz-area, body.tv .react-bar { display: none !important; }

/* ---------- Emoji-Leiste: am Desktop ausgeklappt, am Handy einklappbar ---------- */
.react-toggle { display: none; }

/* ---------- Handy ---------- */
@media (max-width: 640px) {
  body:has(#reactBar:not([hidden])) .player-page { padding-right: 6px; }
  .player-page { padding: 44px 6px 8px; gap: 6px; }
  .board { gap: 3px; }
  .cell { padding: 3px 2px; border-radius: 6px; }
  .cell.cat {
    min-height: 46px;
    font-size: clamp(8px, 2.5vw, 11px);
    letter-spacing: 0;
    line-height: 1.15;
  }
  .cell.val { font-size: clamp(17px, 5.6vw, 28px); letter-spacing: 0; }
  .player-page .board { grid-template-rows: auto repeat(5, minmax(0, 1fr)); }
  .turn-banner { font-size: 13px; padding: 5px 12px; gap: 6px; }
  .turn-label { font-size: 9px; padding: 2px 6px; }

  .scores { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .scores::-webkit-scrollbar { display: none; }
  .score { min-width: 76px; padding: 5px 10px 4px; flex: none; border-radius: 10px; }
  .score-name { font-size: 10px; letter-spacing: .6px; }
  .score-value { font-size: 22px; }
  .player-page > .scores { justify-content: center; }
  .player-page > .scores:has(.score:nth-child(5)) { justify-content: flex-start; }

  .topleft { top: 8px; left: 8px; }
  .topright { top: 8px; right: 8px; gap: 4px; }
  .me-btn, .sound-btn, .status { font-size: 11px; padding: 5px 9px; }

  /* Emoji-Leiste: ein 😀-Knopf unten rechts, klappt nach oben auf */
  /* oben rechts unter der Statuszeile, klappt nach unten auf */
  .react-bar {
    top: 42px;
    right: 6px;
    transform: none;
    flex-direction: column;
    padding: 2px;
    gap: 2px;
  }
  .react-toggle { display: inline-flex; }
  .react-bar:not(.open) .react-btn:not(.react-toggle) { display: none; }
  .react-btn { width: 36px; height: 36px; font-size: 19px; }
  .react-bar.open { padding: 4px; }
  .react-bar.open .react-btn { width: 42px; height: 42px; font-size: 22px; }

  /* Frage am Handy: Text oben, Buzzer im Daumenbereich */
  .clue-overlay { padding: 52px 16px 96px; justify-content: flex-start; }
  .clue-meta { margin: 0 0 2vh; font-size: 12px; padding: 6px 12px; }
  .clue-img { max-height: 26vh; margin-bottom: 2vh; }
  .clue-img.pixel { height: 26vh; }
  .clue-text { font-size: clamp(20px, 6.2vw, 30px); }
  .clue-answer { font-size: clamp(18px, 5.4vw, 26px); padding: 10px 16px; margin-top: 2vh; }
  .timer.big { margin-bottom: 2vh; }
  .timer.big .timer-num { font-size: 32px; }
  .buzz-area { margin-top: auto; padding-top: 3vh; }
  .buzzer { width: min(46vw, 190px); height: min(46vw, 190px); }
  .buzz-info { font-size: 15px; padding: 8px 14px; text-align: center; }
  .clue-overlay .scores { left: 8px; right: 8px; bottom: 8px; }
  .clue-overlay .score { min-width: 70px; padding: 4px 8px 3px; }
  .clue-overlay .score-value { font-size: 18px; }

  .intro-title { font-size: clamp(40px, 13vw, 64px); }
  .picker-card { padding: 18px; }

  /* Host-Pult am Handy */
  .host-page { padding: 10px; gap: 12px; }
  .room .code { font-size: 24px; }
  .host-clue { padding: 16px; }
  .judge { grid-template-columns: 1fr; }
  .judge .jrow button { padding: 10px 14px; font-size: 15px; }
  .clue-actions button { flex: 1 1 auto; }
  .prow { grid-template-columns: minmax(0, 1fr) 70px; }
  .prow .pbtns { grid-column: 1 / -1; justify-content: flex-end; }
  .prow .pbtns button { padding: 8px 10px; }
}

/* ---------- Host-Notiz ---------- */
.host-clue .note {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed var(--stage-line);
  font-size: 14px;
  color: color-mix(in srgb, var(--stage-text) 80%, transparent);
  white-space: pre-wrap;
}
.host-clue .note::before { content: "📝 Notiz · nur für dich: "; font-weight: 700; color: var(--accent); }
.ed-clue input.note-field { margin-top: 6px; font-size: 12px; background: var(--field); border-style: dashed; border-color: var(--line-strong); }

/* ---------- Punkte-Animation ---------- */
.score { position: relative; }
.delta {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 32px);
  pointer-events: none;
  animation: deltaUp 1.8s ease-out forwards;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.delta.pos { color: var(--green); }
.delta.neg { color: var(--red); }
@keyframes deltaUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  75% { opacity: 1; transform: translate(-50%, -2px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

@media (prefers-reduced-motion: reduce) { .delta { animation-duration: .01s; } }
.scores { padding-top: 30px; margin-top: -30px; }

/* ---------- Verbindungshilfe ---------- */
.turn-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.turn-box summary { cursor: pointer; font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.turn-box label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.turn-box textarea { font-size: 12px; font-family: ui-monospace, monospace; }
.turn-box .btn-row { margin-top: 10px; }
.turn-state { font-size: 12px; font-weight: 600; color: var(--muted); }
.turn-state.on { color: var(--green); }

/* Fragenset-Leiste im Editor */
.setbar { margin-bottom: 16px; padding: 12px 16px; }
.setbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.setbar-row + .setbar-row { margin-top: 10px; }
.setbar label { font-weight: 700; }
.setbar select { min-width: 200px; flex: 1 1 200px; max-width: 360px; }
.setbar #hostPw { max-width: 240px; }
.set-source { font-size: 13px; color: var(--muted); margin-left: auto; }
.set-source.error { color: var(--red); }
.ed-pixel, .ed-zoom { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ed-pixel input, .ed-zoom input { width: auto; margin: 0; padding: 0; }
.ed-img img.pixel-preview { filter: blur(3px); }

/* ---------- Animationen ---------- */
/* Frage wächst aus dem Feld: Inhalt erst nach dem Zoom einblenden */
.clue-overlay.zoom-in > * { animation: zoomContent .6s both; }
@keyframes zoomContent { 0%, 45% { opacity: 0; } 100% { opacity: 1; } }
/* Richtig / falsch */
@keyframes rightGlow { 0% { box-shadow: inset 0 0 0 0 rgba(52, 211, 153, 0); } 30% { box-shadow: inset 0 0 0 6px rgba(52, 211, 153, .9), inset 0 0 140px rgba(52, 211, 153, .35); } 100% { box-shadow: inset 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes wrongShake { 0%, 100% { translate: 0 0; } 15% { translate: -14px 0; } 30% { translate: 12px 0; } 45% { translate: -9px 0; } 60% { translate: 6px 0; } 75% { translate: -3px 0; } }
@keyframes wrongFlash { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(248, 113, 113, 0); } 25% { box-shadow: inset 0 0 0 6px rgba(248, 113, 113, .9), inset 0 0 140px rgba(248, 113, 113, .35); } }
.clue-overlay.fx-right { animation: rightGlow .9s ease-out; }
.clue-overlay.fx-wrong { animation: wrongShake .45s ease-out, wrongFlash .7s ease-out; }
/* Punktekachel bei Änderung */
@keyframes tileUp { 30% { border-color: var(--green); background: color-mix(in srgb, var(--green) 18%, transparent); transform: scale(1.08); } }
@keyframes tileDown { 30% { border-color: var(--red); background: color-mix(in srgb, var(--red) 18%, transparent); } 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
.score.fx-up { animation: tileUp .8s ease-out; }
.score.fx-down { animation: tileDown .6s ease-out; }
/* Buzz-Einblendung (TV-Ansicht) */
.buzz-show { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; visibility: hidden; }
.buzz-show::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 210, 80, .45), rgba(10, 10, 12, .88) 55%); opacity: 0; }
.buzz-show-name { position: relative; font-family: var(--display); font-size: clamp(54px, 11vw, 160px); letter-spacing: 3px; color: #fff; text-align: center; padding: 0 4vw;
  text-shadow: 0 0 30px rgba(255, 210, 80, .9), 0 6px 0 rgba(0, 0, 0, .4); opacity: 0; }
.buzz-show.go { visibility: visible; }
.buzz-show.go::before { animation: buzzFlash 1.6s ease-out; }
.buzz-show.go .buzz-show-name { animation: buzzName 1.6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes buzzFlash { 0% { opacity: 0; } 8% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes buzzName { 0% { opacity: 0; transform: scale(2.4) rotate(-6deg); } 18% { opacity: 1; transform: scale(1) rotate(-3deg); } 75% { opacity: 1; transform: scale(1.04) rotate(-3deg); } 100% { opacity: 0; transform: scale(.9) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) {
  .clue-overlay.fx-right, .clue-overlay.fx-wrong, .score.fx-up, .score.fx-down, .clue-overlay.zoom-in > * { animation: none; }
}

/* Anzeige-Texte (Board, Fragen, Intro, Punkte) nicht markierbar – Eingabefelder schon */
.player-body, .board, .intro, .clue-overlay, .finish, .scores, .host-clue .meta, .host-clue .q {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.player-body input, .player-body textarea { -webkit-user-select: text; user-select: text; }
.pod-score.neg { color: var(--red); }

/* ---------- Joker ---------- */
.joker-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.joker-bar[hidden] { display: none; }
.joker-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.joker {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 92px; padding: 8px 10px; border-radius: 14px;
  background: var(--stage-chip); border: 1px solid var(--stage-line); color: var(--stage-text);
  font-size: 12px; font-weight: 700; line-height: 1.15;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.joker .joker-icon { font-size: 22px; }
.joker.armed { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.joker:disabled { opacity: .35; }
.joker.used { opacity: .25; text-decoration: line-through; }
.joker-active, .joker-targets {
  padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--stage-chip); border: 1px solid var(--accent); color: var(--accent);
}
.joker-targets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; border-radius: 14px; }
.hint-box {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 2vh;
  padding: 10px 18px; border-radius: 14px; border: 1px dashed var(--accent); background: var(--stage-chip);
}
.hint-box[hidden] { display: none; }
.hint-label { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.hint-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(18px, 3vw, 28px); font-weight: 700; white-space: pre-wrap; }
.joker-status {
  margin-top: 10px; padding: 8px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: var(--stage-chip); border: 1px dashed var(--line-strong);
}
@media (max-width: 600px) {
  .joker { min-width: 78px; padding: 6px 8px; font-size: 11px; }
  .joker .joker-icon { font-size: 18px; }
  .joker-bar { margin-top: 8px; gap: 6px; }
}

/* ---------- Zoom-Bild ---------- */
.clue-img.zoomed { width: min(100%, 900px); height: 38vh; object-fit: cover; }
.clue-img.host-img.zoomed { width: 100%; height: 220px; }
@media (max-width: 600px) { .clue-img.zoomed { height: 26vh; } }

/* ---------- Schätzfrage / Reihenfolge ---------- */
.special-box { width: min(560px, 100%); margin-top: 2vh; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.special-box[hidden] { display: none; }
.special-status { text-align: center; font-weight: 700; color: var(--accent); }
.est-form { display: flex; gap: 8px; }
.est-form input { flex: 1; font-size: 20px; text-align: center; }
.est-form input.invalid { border-color: var(--red); }
.est-answer { text-align: center; font-size: clamp(18px, 2.4vw, 28px); }
.est-answer b { color: var(--accent); }
.est-list, .order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: n; }
.est-list li, .order-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
  background: var(--stage-chip); border: 1px solid var(--stage-line); text-align: left;
}
.order-list li { counter-increment: n; }
.order-list li::before { content: counter(n) "."; font-weight: 800; color: var(--accent); min-width: 22px; }
.order-list li span, .est-list li span { flex: 1; font-weight: 700; }
.est-list li small { color: color-mix(in srgb, var(--stage-text) 60%, transparent); }
.est-list li.won { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.order-list.solved li { border-color: var(--green); }
.order-winners, .est-none { text-align: center; font-weight: 700; }
#orderSend { align-self: center; }
.special .special-head { font-weight: 800; margin-bottom: 6px; }
.special .srow { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--stage-chip); margin-bottom: 4px; }
.special .srow.won { box-shadow: inset 0 0 0 2px var(--green); }
.special .srow .name { font-weight: 700; }
.special { margin-top: 12px; }
.ed-kind { font-size: 12px; padding: 6px 8px; margin-top: 6px; width: 100%; background: var(--field); }
.ed-hint select { font-size: 12px; padding: 6px 8px; margin-top: 6px; width: 100%; background: var(--field); }
.ed-hint input.ed-hint-text { margin-top: 6px; font-size: 12px; }
.ed-hint-preview { margin-top: 4px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.ed-hint-preview:empty { display: none; }

/* ---------- Multiple Choice ---------- */
.mc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mc-opt {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 14px;
  background: var(--stage-chip); border: 2px solid var(--stage-line); color: var(--stage-text); font-weight: 700;
  font-size: clamp(15px, 2vw, 22px); position: relative; flex-wrap: wrap;
}
.mc-opt:disabled { opacity: 1; }
.mc-letter { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--stage-line); font-family: var(--display); flex: none; }
.mc-text { flex: 1; }
.mc-opt.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.mc-opt.picked .mc-letter { background: var(--accent); color: var(--on-accent); }
.mc.revealed .mc-opt { opacity: .55; }
.mc.revealed .mc-opt.right { opacity: 1; border-color: var(--green); background: color-mix(in srgb, var(--green) 18%, transparent); }
.mc.revealed .mc-opt.wrong { opacity: 1; border-color: var(--red); }
.mc-who { width: 100%; font-size: 12px; font-weight: 600; opacity: .8; padding-left: 40px; }
@media (max-width: 600px) { .mc { grid-template-columns: 1fr; } .mc-opt { padding: 10px 12px; } }

/* Laptop/TV: Punkteleiste im Fluss statt fest unten, damit Joker, Tipp & Co. sie nie überdecken.
   Zwei automatische Ränder halten den Inhalt mittig und die Punkte unten. */
@media (min-width: 601px) {
  .clue-overlay { padding-bottom: 20px; }
  .clue-overlay > .clue-meta { margin-top: auto; }
  .clue-overlay .scores { position: static; margin-top: auto; padding-top: 3vh; }
}
.version-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 40; padding: 8px 14px; text-align: center; font-weight: 700; font-size: 14px; background: var(--red); color: #fff; }
.version-banner[hidden] { display: none; }
.special .srow.lost { box-shadow: inset 0 0 0 2px var(--red); }

/* Handy: alles muss ohne Scrollen passen – auch mit Bild, Buzzer, Info und Joker-Leiste.
   Punkte im Fluss (nicht mehr fest unten), Bild/Buzzer/Joker kompakter, oben Platz für die Knöpfe. */
@media (max-width: 600px) {
  .clue-overlay { padding: 64px 12px 8px; }
  .clue-overlay .scores { position: static; margin-top: 8px; flex-wrap: nowrap; overflow-x: auto; justify-content: center; }
  .clue-img { max-height: 24vh; margin-bottom: 1.5vh; }
  .clue-img.pixel, .clue-img.zoomed { height: 24vh; }
  .buzz-area { gap: 8px; padding-top: 1.5vh; }
  .buzzer { width: min(38vw, 160px); height: min(38vw, 160px); }
  .joker-bar { margin-top: 2px; gap: 4px; }
  .joker { min-width: 0; padding: 5px 9px; font-size: 11px; flex-direction: row; gap: 5px; }
  .joker .joker-icon { font-size: 15px; }
}
@media (max-width: 600px) and (max-height: 720px) {
  .clue-overlay { padding-top: 58px; }
  .clue-img { max-height: 20vh; }
  .clue-img.pixel, .clue-img.zoomed { height: 20vh; }
  .clue-text { font-size: clamp(18px, 5.6vw, 26px); }
  .buzzer { width: min(32vw, 130px); height: min(32vw, 130px); font-size: 26px; }
  .buzz-info { font-size: 13px; padding: 6px 12px; }
}

/* Laptop/Tablet: Bild, Buzzer und Joker nach der Fensterhöhe richten, damit nichts scrollt und
   die Kategorie nicht unter der oberen Leiste verschwindet (Laptop-Browser haben oft nur ~680 px). */
@media (min-width: 601px) {
  .clue-overlay { padding-top: 64px; }
  .clue-img { max-height: 30vh; margin-bottom: 2vh; }
  .clue-img.pixel, .clue-img.zoomed { height: 30vh; }
  .buzz-area { margin-top: 2vh; gap: 10px; }
  .buzzer { width: clamp(110px, 21vh, 220px); height: clamp(110px, 21vh, 220px); font-size: clamp(26px, 5vh, 56px); }
  .clue-text { font-size: clamp(22px, min(4.2vw, 5.2vh), 54px); }
}
@media (min-width: 601px) and (max-height: 820px) {
  .clue-img { max-height: 26vh; }
  .clue-img.pixel, .clue-img.zoomed { height: 26vh; }
  .clue-meta { margin-bottom: 1.5vh; }
  .joker { padding: 6px 10px; }
  .buzz-info { padding: 6px 16px; font-size: clamp(14px, 2.2vh, 22px); }
}
@media (min-width: 601px) and (max-height: 820px) {
  .clue-overlay { padding-bottom: 10px; }
  .clue-overlay .scores { padding-top: 1.5vh; }
  .clue-img { max-height: 24vh; margin-bottom: 1.5vh; }
  .clue-img.pixel, .clue-img.zoomed { height: 24vh; }
  .buzz-area { margin-top: 1.5vh; gap: 8px; }
}

/* ---------- Audio-/Video-Clips ---------- */
.media-box, .media-wrap { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.media-box[hidden], .media-wrap[hidden] { display: none; }
.host-media, .player-media { max-width: 100%; max-height: 38vh; border-radius: 10px; background: #000; }
.media-controls, .media-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.media-kind, .media-label { font-weight: 700; color: var(--muted); }
.media-wrap.audio .media-label::after { content: ' läuft'; }
.ed-media { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.ed-media input:not([type=file]) { flex: 1; min-width: 0; font-size: 12px; }
.ed-media audio, .ed-media video { width: 100%; max-height: 120px; }
.ed-media-info { font-size: 12px; color: var(--muted); }

/* Spielleiter-Passwort im Host-Pult */
.game-gate { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 10px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); }
.game-gate[hidden] { display: none; }
.game-gate input { flex: 1; min-width: 160px; }
.game-gate .hint { flex-basis: 100%; color: #f87171; }
.game-gate .hint:empty { display: none; }
