:root { --bg:#070b16; --panel:#111827; --panel2:#172033; --text:#f8fafc; --muted:#aeb8cc; --gold:#f2c94c; --red:#ef4444; --green:#22c55e; --blue:#38bdf8; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, sans-serif; background:var(--bg); color:var(--text); }
a { color:var(--gold); text-decoration:none; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:14px 24px; background:#050816; border-bottom:1px solid #243047; }
.brand { font-weight:800; color:var(--gold); font-size:1.2rem; }
.topbar nav { display:flex; gap:16px; align-items:center; }
.inline-form { display:inline; }
button, .button { border:0; background:var(--panel2); color:var(--text); border-radius:12px; padding:10px 14px; cursor:pointer; display:inline-block; font-weight:700; }
button:hover, .button:hover { filter:brightness(1.15); }
.primary { background:var(--gold); color:#111827; }
.container { max-width:1200px; margin:0 auto; padding:28px; }
.card { background:linear-gradient(180deg,var(--panel),#0d1424); border:1px solid #263149; border-radius:18px; padding:22px; box-shadow:0 10px 30px rgba(0,0,0,.25); }
.grid { display:grid; gap:18px; }
.three { grid-template-columns: repeat(3, 1fr); }
.metric { font-size:3rem; color:var(--gold); font-weight:900; }
.actions { display:flex; gap:12px; flex-wrap:wrap; margin:20px 0; }
.compact { gap:8px; }
table { width:100%; border-collapse:collapse; background:var(--panel); border-radius:14px; overflow:hidden; }
th, td { padding:10px 12px; border-bottom:1px solid #25324b; vertical-align:top; }
th { color:var(--gold); text-align:left; background:#0c1220; }
input, select { width:100%; padding:10px 12px; border-radius:10px; border:1px solid #334155; background:#080d19; color:var(--text); }
label { display:block; color:var(--muted); margin:12px 0 6px; }
.filterbar { display:grid; grid-template-columns: 1fr 180px 140px 100px; gap:10px; margin-bottom:18px; }
.form-card { max-width:850px; }
.player-row { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.alert { background:#3b1111; color:#fecaca; border:1px solid var(--red); padding:12px; border-radius:12px; margin:12px 0; }
.app-footer { color:#7f8aa3; font-size:.85rem; text-align:center; padding:24px; }
.login-body { min-height:100vh; display:flex; align-items:center; justify-content:center; flex-direction:column; }
.login-card { width:min(420px, 92vw); background:var(--panel); border:1px solid #263149; border-radius:22px; padding:32px; }
.host-layout { display:grid; grid-template-columns: 1fr 1.2fr 1fr; gap:18px; align-items:start; }
.roll-buttons, .answer-buttons, .joker-buttons { display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; margin:14px 0; }
.roll-buttons button { font-size:1.5rem; background:var(--gold); color:#111; }
.state-question { font-size:1.25rem; font-weight:800; margin:12px 0; }
.state-answer { padding:10px; border-radius:10px; margin:8px 0; background:#0b1220; border:1px solid #263149; }
.state-answer.selected { border-color:var(--gold); }
.state-answer.correct { border-color:var(--green); }
.score-row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #263149; }
.stream-body { overflow:hidden; }
.stream-stage { width:100vw; height:100vh; padding:42px; display:grid; grid-template-rows:auto 1fr auto auto; gap:24px; background:radial-gradient(circle at top, #172554, #050816 60%); }
.stream-header { display:flex; justify-content:space-between; align-items:center; }
.stream-header h1 { margin:0; font-size:4rem; color:var(--gold); letter-spacing:.05em; }
#stream-round { font-size:2rem; color:var(--muted); }
.stream-question { display:flex; align-items:center; justify-content:center; text-align:center; font-size:3.2rem; font-weight:900; line-height:1.15; background:rgba(17,24,39,.82); border:2px solid #334155; border-radius:30px; padding:36px; }
.stream-answers { display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.stream-answer { min-height:110px; display:flex; align-items:center; justify-content:center; text-align:center; padding:20px; font-size:1.7rem; font-weight:800; border-radius:22px; background:rgba(15,23,42,.9); border:2px solid #334155; }
.stream-answer.hidden { opacity:.18; }
.stream-answer.selected { border-color:var(--gold); box-shadow:0 0 24px rgba(242,201,76,.25); }
.stream-answer.correct { border-color:var(--green); box-shadow:0 0 24px rgba(34,197,94,.25); }
.stream-score { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.stream-player { background:rgba(15,23,42,.9); border:1px solid #334155; border-radius:18px; padding:14px; text-align:center; }
.stream-player.active { border-color:var(--gold); }
.stream-player-name { font-size:1.15rem; font-weight:800; }
.stream-player-score { font-size:2rem; color:var(--gold); font-weight:900; }
.stream-footer { position:fixed; right:24px; bottom:14px; color:#8792aa; font-size:.8rem; }
@media (max-width: 900px) { .host-layout,.three,.filterbar,.player-row { grid-template-columns:1fr; } }

/* v0.1.1 - Stream Joker Status */
.stream-jokers {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.stream-joker {
  min-width: 34px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  border: 1px solid #334155;
  background: rgba(15,23,42,.92);
  color: var(--text);
  line-height: 1.1;
}

.stream-joker.available {
  border-color: rgba(242,201,76,.65);
  color: var(--gold);
  box-shadow: 0 0 10px rgba(242,201,76,.12);
}

.stream-joker.used {
  opacity: .32;
  text-decoration: line-through;
  filter: grayscale(1);
}

/* v0.1.2 - Host Joker Disabled State */
button.joker-used-button,
button.joker-used-button:hover,
button:disabled.joker-used-button {
  opacity: .35;
  filter: grayscale(1);
  cursor: not-allowed;
  text-decoration: line-through;
  box-shadow: none !important;
}

/* v0.1.2 - OBS Chroma Key Stream Background */
body.chroma-green-stream {
  background: #00ff00 !important;
}

body.chroma-green-stream::before,
body.chroma-green-stream::after {
  background: transparent !important;
}

body.chroma-green-stream .stream-stage,
body.chroma-green-stream .stream-shell,
body.chroma-green-stream main {
  background: transparent !important;
}

body.chroma-green-stream .stream-card,
body.chroma-green-stream .stream-player,
body.chroma-green-stream .answer,
body.chroma-green-stream .stream-question,
body.chroma-green-stream .stream-panel {
  background-color: rgba(15, 23, 42, 0.94);
}

/* v0.1.3 - Hostview Feinschliff */
.host-control-dashboard {
  display: grid;
  gap: 18px;
}

.host-main-status {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,41,59,.92));
  border: 1px solid rgba(242,201,76,.35);
  box-shadow: 0 18px 50px rgba(0,0,0,.32);
}

.host-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.host-main-status h2 {
  margin: 0;
  font-size: 2.1rem;
}

.host-main-status p {
  margin: 6px 0 0;
  color: var(--muted);
}

.host-score-big {
  min-width: 96px;
  height: 96px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 1000;
  color: #111827;
  background: var(--gold);
  box-shadow: 0 14px 35px rgba(242,201,76,.22);
}

.host-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.host-status-tile {
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,23,42,.88);
  border: 1px solid rgba(148,163,184,.20);
}

.host-status-tile span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 5px;
}

.host-status-tile b {
  font-size: 1.15rem;
}

.host-status-tile.special {
  border-color: rgba(242,201,76,.7);
  box-shadow: 0 0 18px rgba(242,201,76,.12);
}

.host-active-jokers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,23,42,.70);
  border: 1px solid rgba(148,163,184,.18);
}

.host-joker-chip {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 900;
  border: 1px solid rgba(242,201,76,.45);
}

.host-joker-chip.available {
  color: var(--gold);
  background: rgba(242,201,76,.08);
}

.host-joker-chip.used {
  color: var(--muted);
  border-color: rgba(148,163,184,.25);
  opacity: .45;
  text-decoration: line-through;
  filter: grayscale(1);
}

.host-question-box {
  padding: 22px;
  border-radius: 22px;
  background: rgba(15,23,42,.92);
  border: 1px solid rgba(148,163,184,.22);
}

.host-question-box.special {
  border-color: rgba(242,201,76,.65);
  box-shadow: 0 0 24px rgba(242,201,76,.10);
}

.host-question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  margin-bottom: 14px;
}

.host-question-text {
  font-size: 1.45rem;
  line-height: 1.35;
  font-weight: 850;
  margin-bottom: 16px;
}

.host-answer-grid {
  display: grid;
  gap: 10px;
}

.host-answer {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  background: rgba(2,6,23,.5);
  border: 1px solid rgba(148,163,184,.18);
}

.host-answer.selected {
  border-color: rgba(59,130,246,.9);
  box-shadow: 0 0 16px rgba(59,130,246,.18);
}

.host-answer.correct {
  border-color: rgba(34,197,94,.95);
  box-shadow: 0 0 16px rgba(34,197,94,.18);
}

.host-answer.wrong {
  border-color: rgba(239,68,68,.95);
  box-shadow: 0 0 16px rgba(239,68,68,.18);
}

.host-answer-letter {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  color: #111827;
  background: var(--gold);
  flex: 0 0 auto;
}

.host-answer-text {
  font-weight: 750;
}

.host-answer-status {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.host-scoreboard {
  padding: 18px;
  border-radius: 22px;
  background: rgba(15,23,42,.82);
  border: 1px solid rgba(148,163,184,.18);
}

.host-scoreboard h3 {
  margin-top: 0;
}

.host-score-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(2,6,23,.35);
  margin-top: 8px;
}

.host-score-row.active {
  outline: 2px solid rgba(242,201,76,.6);
  background: rgba(242,201,76,.08);
}

.host-score-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

@media (max-width: 900px) {
  .host-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .host-main-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v0.1.3b - Host Wide Layout */
.host-control-dashboard-wide {
  width: 100%;
  max-width: none;
  gap: 14px;
}

.host-topbar {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(520px, 1.75fr);
  gap: 14px;
  align-items: stretch;
}

.host-main-status-wide {
  min-height: 112px;
  padding: 16px 18px;
}

.host-main-status-wide h2 {
  font-size: clamp(1.6rem, 2vw, 2.35rem);
  line-height: 1.05;
}

.host-main-status-wide p {
  font-size: .92rem;
}

.host-main-status-wide .host-score-big {
  width: 86px;
  min-width: 86px;
  height: 86px;
  font-size: 2.25rem;
}

.host-status-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 100%;
}

.host-status-grid-wide .host-status-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
}

.host-status-grid-wide .host-status-tile b {
  font-size: clamp(1.15rem, 1.4vw, 1.55rem);
}

.host-wide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, .85fr);
  gap: 14px;
  align-items: start;
}

.host-wide-main {
  min-width: 0;
}

.host-wide-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.host-side-panel {
  padding: 14px;
  border-radius: 20px;
  background: rgba(15,23,42,.82);
  border: 1px solid rgba(148,163,184,.18);
}

.host-side-panel h3,
.host-scoreboard-wide h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.host-active-jokers-wide {
  padding: 0;
  background: transparent;
  border: 0;
}

.host-question-box {
  min-height: 430px;
}

.host-question-text {
  font-size: clamp(1.35rem, 1.8vw, 2.05rem);
}

.host-answer-grid {
  grid-template-columns: 1fr;
}

.host-answer {
  min-height: 74px;
  padding: 14px 16px;
}

.host-answer-letter {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.host-answer-text {
  font-size: clamp(1rem, 1.1vw, 1.22rem);
}

.host-scoreboard-wide {
  padding: 14px;
}

.host-score-row {
  padding: 10px 12px;
  margin-top: 7px;
}

.host-score-row strong {
  font-size: .98rem;
}

.host-score-row small {
  font-size: .78rem;
}

.host-score-row b {
  font-size: 1.35rem;
}

@media (min-width: 1200px) {
  main.container,
  .container {
    max-width: none;
    width: min(1880px, calc(100vw - 32px));
  }

  body:not(.login-body) main {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (min-width: 1500px) {
  .host-wide-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(380px, .8fr);
  }

  .host-question-box {
    min-height: 500px;
  }
}

@media (max-width: 1100px) {
  .host-topbar,
  .host-wide-grid {
    grid-template-columns: 1fr;
  }

  .host-question-box {
    min-height: auto;
  }
}

/* v0.1.4 - Flexible Stream Layouts for OBS */
body.chroma-green-stream {
  background: #00ff00 !important;
  overflow: hidden;
}

body.chroma-green-stream main,
body.chroma-green-stream .container,
body.chroma-green-stream .stream-stage,
body.chroma-green-stream .stream-shell {
  background: transparent !important;
}

body.chroma-green-stream .app-footer {
  opacity: .75;
}

/* Gemeinsame Stream-Basis */
body.chroma-green-stream #stream-stage {
  width: 100vw;
  min-height: 100vh;
  box-sizing: border-box;
}

body.chroma-green-stream #stream-round {
  font-weight: 1000;
  letter-spacing: .04em;
}

body.chroma-green-stream #stream-question {
  line-height: 1.18;
  font-weight: 950;
}

body.chroma-green-stream #stream-answers {
  display: grid;
  gap: clamp(8px, 1vw, 16px);
}

body.chroma-green-stream #stream-score {
  display: grid;
  gap: clamp(8px, .8vw, 14px);
}

body.chroma-green-stream .stream-player,
body.chroma-green-stream .stream-answer,
body.chroma-green-stream #stream-question,
body.chroma-green-stream #stream-round {
  background: rgba(15, 23, 42, .94);
  border: 1px solid rgba(242, 201, 76, .28);
  box-shadow: 0 14px 40px rgba(0,0,0,.30);
}

/* FULL: klassische Vollbildansicht */
body.stream-layout-full #stream-stage {
  padding: clamp(18px, 2vw, 34px);
}

body.stream-layout-full #stream-round {
  font-size: clamp(1.3rem, 2vw, 2.4rem);
  padding: clamp(14px, 1.4vw, 22px);
  border-radius: 24px;
  margin-bottom: clamp(16px, 1.6vw, 28px);
}

body.stream-layout-full #stream-question {
  font-size: clamp(2rem, 4vw, 5.2rem);
  padding: clamp(22px, 2.4vw, 42px);
  border-radius: 30px;
  margin-bottom: clamp(16px, 1.6vw, 26px);
}

body.stream-layout-full .stream-answer {
  font-size: clamp(1.3rem, 2.4vw, 3rem);
  padding: clamp(16px, 1.7vw, 28px);
  border-radius: 24px;
}

body.stream-layout-full #stream-score {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(16px, 1.8vw, 28px);
}

body.stream-layout-full .stream-player {
  padding: clamp(12px, 1vw, 20px);
  border-radius: 22px;
}

/* COMPACT: kleinere OBS-Quellen */
body.stream-layout-compact #stream-stage {
  padding: clamp(10px, 1.4vw, 22px);
}

body.stream-layout-compact #stream-round {
  font-size: clamp(1rem, 1.5vw, 1.65rem);
  padding: 10px 14px;
  border-radius: 18px;
  margin-bottom: 12px;
}

body.stream-layout-compact #stream-question {
  font-size: clamp(1.35rem, 2.6vw, 3rem);
  padding: clamp(14px, 1.7vw, 24px);
  border-radius: 22px;
  margin-bottom: 12px;
}

body.stream-layout-compact .stream-answer {
  font-size: clamp(1rem, 1.6vw, 1.8rem);
  padding: 10px 14px;
  border-radius: 18px;
}

body.stream-layout-compact #stream-score {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

body.stream-layout-compact .stream-player {
  padding: 10px;
  border-radius: 16px;
}

body.stream-layout-compact .stream-joker {
  font-size: .7rem;
  padding: 3px 6px;
}

/* OVERLAY: viel Chroma-Fläche, nur Inhalte kompakt */
body.stream-layout-overlay #stream-stage {
  padding: clamp(12px, 2vw, 30px);
  display: grid;
  align-content: end;
  min-height: 100vh;
}

body.stream-layout-overlay #stream-round {
  display: inline-block;
  width: fit-content;
  max-width: 90vw;
  font-size: clamp(1rem, 1.5vw, 1.8rem);
  padding: 10px 16px;
  border-radius: 999px;
  margin-bottom: 10px;
}

body.stream-layout-overlay #stream-question {
  max-width: min(1200px, 92vw);
  font-size: clamp(1.4rem, 2.8vw, 3.7rem);
  padding: clamp(14px, 1.8vw, 28px);
  border-radius: 24px;
  margin-bottom: 10px;
}

body.stream-layout-overlay #stream-answers {
  max-width: min(1200px, 92vw);
}

body.stream-layout-overlay .stream-answer {
  font-size: clamp(1rem, 1.7vw, 2rem);
  padding: 10px 16px;
  border-radius: 18px;
}

body.stream-layout-overlay #stream-score {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: min(1200px, 92vw);
  margin-top: 10px;
}

body.stream-layout-overlay .stream-player {
  padding: 8px 10px;
  border-radius: 14px;
}

body.stream-layout-overlay .stream-player small,
body.stream-layout-overlay .stream-jokers {
  display: none;
}

/* SCOREBOARD: nur Punkte/Joker, ideal als separate OBS-Quelle */
body.stream-layout-scoreboard #stream-stage {
  padding: clamp(12px, 2vw, 28px);
  display: grid;
  place-items: center;
  min-height: 100vh;
}

body.stream-layout-scoreboard #stream-round,
body.stream-layout-scoreboard #stream-question,
body.stream-layout-scoreboard #stream-answers {
  display: none !important;
}

body.stream-layout-scoreboard #stream-score {
  width: min(1200px, 92vw);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.stream-layout-scoreboard .stream-player {
  padding: clamp(18px, 2vw, 32px);
  border-radius: 28px;
}

body.stream-layout-scoreboard .stream-player-name {
  font-size: clamp(1.3rem, 2.6vw, 3rem);
}

body.stream-layout-scoreboard .stream-player-score {
  font-size: clamp(2.2rem, 5vw, 6rem);
}

body.stream-layout-scoreboard .stream-joker {
  font-size: clamp(.85rem, 1.2vw, 1.2rem);
  padding: 6px 10px;
}

/* Responsive Fallbacks */
@media (max-width: 900px) {
  body.stream-layout-full #stream-score,
  body.stream-layout-compact #stream-score,
  body.stream-layout-overlay #stream-score,
  body.stream-layout-scoreboard #stream-score {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body.stream-layout-full #stream-score,
  body.stream-layout-compact #stream-score,
  body.stream-layout-overlay #stream-score,
  body.stream-layout-scoreboard #stream-score {
    grid-template-columns: 1fr;
  }
}

/* v0.1.4 - Admin Stream Layout Links */
.stream-layout-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(15,23,42,.65);
  border: 1px solid rgba(148,163,184,.16);
}

.stream-layout-links small {
  color: var(--muted);
  font-weight: 800;
}

.stream-layout-links a {
  color: var(--gold);
  font-weight: 900;
  text-decoration: none;
}

/* v0.1.5a-2 - Betting Modal Preparation */
.betting-modal-root {
  position: relative;
  z-index: 10000;
}

.betting-modal-root[hidden] {
  display: none !important;
}

/* v0.1.5a-3 - Active Betting Modal */
#betting-modal-root {
  position: relative;
  z-index: 10000;
}

#betting-modal-root[hidden] {
  display: none !important;
}

.betting-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(8px);
}

.betting-modal-card {
  width: min(700px, calc(100vw - 48px));
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(15,23,42,.98), rgba(30,41,59,.96));
  border: 1px solid rgba(242,201,76,.45);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

.betting-modal-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 1000;
  font-size: .78rem;
  margin-bottom: 8px;
}

.betting-modal-card h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.betting-modal-card p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.betting-modal-scorebox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(148,163,184,.22);
  margin-bottom: 18px;
}

.betting-modal-scorebox span {
  color: var(--muted);
  font-weight: 800;
}

.betting-modal-scorebox b {
  font-size: 2.8rem;
  color: var(--gold);
}

.betting-modal-label {
  display: block;
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 8px;
}

.betting-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 18px 20px;
  border-radius: 18px;
  border: 2px solid rgba(242,201,76,.55);
  background: rgba(2,6,23,.92);
  color: var(--text);
  font-size: 2rem;
  font-weight: 1000;
  outline: none;
}

.betting-modal-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(242,201,76,.12);
}

.betting-modal-help {
  color: var(--muted);
  font-weight: 800;
  margin-top: 10px;
}

.betting-modal-error {
  min-height: 24px;
  margin-top: 10px;
  color: #fca5a5;
  font-weight: 900;
}

.betting-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.betting-modal-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.betting-modal-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(2,6,23,.5);
  border: 1px solid rgba(148,163,184,.18);
}

.betting-modal-summary-row small,
.betting-modal-summary-row span {
  display: block;
  color: var(--muted);
}

.betting-modal-summary-row b {
  color: var(--gold);
}

@media (max-width: 700px) {
  .betting-modal-actions,
  .betting-modal-summary-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* v0.1.5b-2 - Betting Questions Host Status Panel */
.betting-status-panel {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9998;
  width: min(980px, calc(100vw - 48px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(15, 23, 42, .96);
  border: 1px solid rgba(242, 201, 76, .42);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.betting-status-panel.ready {
  border-color: rgba(34,197,94,.65);
}

.betting-status-panel.live {
  border-color: rgba(59,130,246,.65);
}

.betting-status-panel.finalists {
  border-color: rgba(242,201,76,.85);
  box-shadow: 0 0 28px rgba(242,201,76,.16), 0 24px 70px rgba(0,0,0,.45);
}

.betting-status-panel strong {
  display: block;
  font-size: 1.2rem;
}

.betting-status-panel span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.betting-status-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 1000;
  margin-bottom: 4px;
}

@media (max-width: 800px) {
  .betting-status-panel {
    flex-direction: column;
    align-items: stretch;
    bottom: 12px;
  }
}

/* v0.1.5c-3 - Final Round Host Status Panel */
.betting-status-panel.final-ready {
  border-color: rgba(242,201,76,.85);
  box-shadow: 0 0 28px rgba(242,201,76,.16), 0 24px 70px rgba(0,0,0,.45);
}

.betting-status-panel.final-live {
  border-color: rgba(168,85,247,.72);
  box-shadow: 0 0 28px rgba(168,85,247,.12), 0 24px 70px rgba(0,0,0,.45);
}

.betting-status-panel.winner {
  border-color: rgba(34,197,94,.85);
  background: linear-gradient(135deg, rgba(20,83,45,.97), rgba(15,23,42,.96));
  box-shadow: 0 0 34px rgba(34,197,94,.22), 0 24px 70px rgba(0,0,0,.5);
}

.betting-status-panel.winner strong {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  color: var(--gold);
}

.betting-status-panel.tiebreaker {
  border-color: rgba(248,113,113,.85);
  background: linear-gradient(135deg, rgba(127,29,29,.92), rgba(15,23,42,.96));
  box-shadow: 0 0 34px rgba(248,113,113,.18), 0 24px 70px rgba(0,0,0,.5);
}

/* v0.1.5d-3 - Tiebreaker Host Panel */
.betting-status-panel.tiebreaker {
  align-items: stretch;
}

.betting-status-panel.tiebreaker .tiebreaker-panel-content {
  flex: 1;
  min-width: 0;
}

.tiebreaker-player-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tiebreaker-player-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 180px) minmax(80px, auto);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.tiebreaker-player-row label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tiebreaker-player-row label span,
.tiebreaker-player-row em {
  color: var(--muted);
  font-size: .86rem;
  font-style: normal;
}

.tiebreaker-player-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(15,23,42,.92);
  color: var(--text);
  font-weight: 800;
}

.tiebreaker-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
}

.betting-status-panel.tiebreaker.resolved {
  border-color: rgba(34,197,94,.85);
  background: linear-gradient(135deg, rgba(20,83,45,.95), rgba(15,23,42,.96));
}

@media (max-width: 900px) {
  .tiebreaker-player-row {
    grid-template-columns: 1fr;
  }

  .tiebreaker-actions {
    min-width: 0;
  }
}

/* v0.1.5d-3b - Standalone Tiebreaker Modal */
.tiebreaker-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(8px);
}

.tiebreaker-modal-card {
  width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(248, 113, 113, .45);
  background: linear-gradient(135deg, rgba(127,29,29,.96), rgba(15,23,42,.98));
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.tiebreaker-modal-kicker {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .82rem;
  margin-bottom: 8px;
}

.tiebreaker-modal-card h2 {
  margin-top: 0;
  font-size: clamp(1.4rem, 3vw, 2.3rem);
}

.tiebreaker-modal-muted {
  color: var(--muted);
}

.tiebreaker-modal-solution {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.32);
}

.tiebreaker-modal-result {
  margin: 16px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(250,204,21,.16);
  border: 1px solid rgba(250,204,21,.35);
  font-size: 1.25rem;
  font-weight: 900;
}

.tiebreaker-modal-player-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.tiebreaker-modal-player {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 220px) minmax(90px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
}

.tiebreaker-modal-player div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tiebreaker-modal-player span,
.tiebreaker-modal-player em {
  color: var(--muted);
  font-style: normal;
  font-size: .9rem;
}

.tiebreaker-modal-player input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(15,23,42,.96);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
}

.tiebreaker-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 780px) {
  .tiebreaker-modal-player {
    grid-template-columns: 1fr;
  }

  .tiebreaker-modal-actions {
    flex-direction: column;
  }
}

/* v0.1.5e-1 - Host Rules Modal */
.rules-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(8px);
}

.rules-modal-card {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(250,204,21,.42);
  background: linear-gradient(135deg, rgba(30,41,59,.98), rgba(15,23,42,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.rules-modal-kicker {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .82rem;
  margin-bottom: 8px;
}

.rules-modal-card h2 {
  margin-top: 0;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.rules-modal-intro {
  color: var(--muted);
  font-size: 1.05rem;
}

.rules-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.rules-modal-section {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.rules-modal-section h3 {
  margin-top: 0;
  color: var(--gold);
}

.rules-modal-section ul {
  margin: 0;
  padding-left: 20px;
}

.rules-modal-section li {
  margin: 7px 0;
}

.rules-modal-hosthint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(59,130,246,.14);
  border: 1px solid rgba(59,130,246,.32);
}

.rules-modal-hosthint strong {
  color: var(--gold);
  white-space: nowrap;
}

.rules-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.rules-open-button {
  margin: 0 0 12px 0;
  width: auto;
}

@media (max-width: 760px) {
  .rules-modal-hosthint {
    flex-direction: column;
  }

  .rules-modal-actions {
    flex-direction: column;
  }
}

/* v0.1.5e-1 fix - Rules Modal must always be above gameplay modals */
.rules-modal-backdrop {
  z-index: 10050 !important;
}

/* v0.1.6b - Leaderboard Host Endstand */
.leaderboard-host-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(250,204,21,.38);
  background: linear-gradient(135deg, rgba(113,63,18,.94), rgba(15,23,42,.98));
  box-shadow: 0 18px 55px rgba(0,0,0,.35);
}

.leaderboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

.leaderboard-hero h2 {
  margin: 4px 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.leaderboard-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.leaderboard-trophy {
  font-size: clamp(3rem, 8vw, 6rem);
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.45));
}

.leaderboard-table {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 58px minmax(140px, 1fr) minmax(92px, auto) minmax(160px, 260px);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(255,255,255,.10);
}

.leaderboard-row.winner {
  background: linear-gradient(135deg, rgba(250,204,21,.20), rgba(15,23,42,.78));
  border-color: rgba(250,204,21,.42);
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: 1.25rem;
  font-weight: 950;
}

.leaderboard-row.winner .leaderboard-rank {
  background: rgba(250,204,21,.22);
  color: var(--gold);
}

.leaderboard-player {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.leaderboard-player strong {
  font-size: 1.15rem;
}

.leaderboard-player span,
.leaderboard-score span,
.leaderboard-breakdown span {
  color: var(--muted);
  font-size: .88rem;
}

.leaderboard-score {
  text-align: right;
}

.leaderboard-score b {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.leaderboard-breakdown {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}

@media (max-width: 860px) {
  .leaderboard-row {
    grid-template-columns: 48px 1fr;
  }

  .leaderboard-score,
  .leaderboard-breakdown {
    text-align: left;
    grid-column: 2;
  }

  .leaderboard-hero {
    align-items: flex-start;
  }
}

/* v0.1.6c - Leaderboard Admin View */
.leaderboard-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.leaderboard-admin-stats > div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.leaderboard-admin-stats strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  color: var(--gold);
}

.leaderboard-admin-stats span {
  color: var(--muted);
}

.leaderboard-admin-match-list {
  display: grid;
  gap: 18px;
}

.leaderboard-admin-match {
  padding: 16px;
  border-radius: 20px;
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(255,255,255,.10);
}

.leaderboard-admin-match header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.leaderboard-admin-match header > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.leaderboard-admin-match header span {
  color: var(--muted);
}

.leaderboard-admin-match .winner-row {
  background: rgba(250,204,21,.12);
}

.leaderboard-admin-winner-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(250,204,21,.18);
  border: 1px solid rgba(250,204,21,.32);
  color: var(--gold);
  font-size: .78rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .leaderboard-admin-match header {
    flex-direction: column;
  }
}

/* v0.1.7a - UX Polish: kompakter Host-Endstand */
.leaderboard-host-panel {
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
}

.leaderboard-hero {
  padding: 12px 14px;
  border-radius: 16px;
  min-height: auto;
}

.leaderboard-hero h2 {
  margin: 2px 0;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.05;
}

.leaderboard-hero p {
  font-size: .92rem;
}

.leaderboard-trophy {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.leaderboard-table {
  gap: 7px;
}

.leaderboard-row {
  grid-template-columns: 46px minmax(130px, 1fr) minmax(74px, auto) minmax(150px, 220px);
  gap: 10px;
  padding: 9px 11px;
  border-radius: 14px;
}

.leaderboard-rank {
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
}

.leaderboard-player strong {
  font-size: 1.02rem;
}

.leaderboard-player span,
.leaderboard-score span,
.leaderboard-breakdown span {
  font-size: .78rem;
}

.leaderboard-score b {
  font-size: 1.35rem;
}

.leaderboard-breakdown {
  gap: 1px;
}

@media (min-width: 1000px) {
  .leaderboard-host-panel {
    max-height: calc(100vh - 230px);
    overflow: auto;
  }
}

@media (max-width: 860px) {
  .leaderboard-row {
    grid-template-columns: 40px 1fr minmax(70px, auto);
  }

  .leaderboard-score {
    grid-column: 3;
    grid-row: 1;
  }

  .leaderboard-breakdown {
    grid-column: 2 / 4;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    text-align: left;
  }
}

/* v0.1.7a - Host Result Endscreen Modal */
#result-modal-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

#result-modal-root:empty {
  display: none;
}

#result-modal-root > * {
  pointer-events: auto;
}

.result-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(4px);
}

.result-modal-card {
  width: min(880px, 92vw);
  max-width: 880px;
  max-height: 88vh;
  overflow: auto;
  border-radius: 24px;
  padding: 28px;
  border: 2px solid rgba(250, 204, 21, 0.35);
  background: #111827;
  box-shadow: 0 30px 80px rgba(0,0,0,0.65);
  color: #f8fafc;
}

.result-modal-kicker {
  color: #facc15;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
  margin-bottom: 14px;
}

.result-modal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: 18px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 18px;
}

.result-modal-hero h2 {
  margin: 0 0 8px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
}

.result-modal-hero p {
  margin: 0;
  color: #cbd5e1;
  font-weight: 700;
}

.result-modal-trophy {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
}

.result-modal-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.result-modal-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,.08);
}

.result-modal-row.winner {
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, #3f2f05 0%, #0f172a 100%);
}

.result-modal-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-weight: 900;
  font-size: 1.05rem;
}

.result-modal-player {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-modal-player strong {
  font-size: 1.1rem;
}

.result-modal-player span,
.result-modal-points span {
  color: #cbd5e1;
  font-size: .84rem;
}

.result-modal-points {
  text-align: right;
}

.result-modal-points b {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.result-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.result-open-button {
  margin: 0 0 12px 0;
  width: auto;
}

@media (max-width: 700px) {
  .result-modal-backdrop {
    padding: 18px;
  }

  .result-modal-card {
    width: 100%;
    max-height: 90vh;
    padding: 20px;
  }

  .result-modal-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-modal-row {
    grid-template-columns: 42px 1fr;
  }

  .result-modal-points {
    grid-column: 2;
    text-align: left;
  }

  .result-modal-actions {
    flex-direction: column;
  }
}
/* v0.1.7a-2 - Result Modal integrated leaderboard */
.result-modal-hero.compact h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.result-history-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  max-height: min(54vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.result-history-card {
  padding: 14px;
  border-radius: 18px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,.10);
}

.result-history-card header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.result-history-card header > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-history-card header span {
  color: #cbd5e1;
  font-size: .82rem;
}

.result-history-rows {
  display: grid;
  gap: 6px;
}

.result-history-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}

.result-history-row.winner {
  background: rgba(250,204,21,.14);
  border: 1px solid rgba(250,204,21,.22);
}

.result-history-row span {
  color: #cbd5e1;
}

.result-history-row b {
  color: #f8fafc;
}

.result-modal-empty {
  padding: 18px;
  border-radius: 16px;
  background: #0f172a;
  color: #cbd5e1;
}

@media (max-width: 700px) {
  .result-history-card header {
    flex-direction: column;
  }
}

/* v0.1.7b - Final Panel Actions */
.final-actions-panel {
  align-items: stretch;
  gap: 16px;
}

.final-panel-main {
  flex: 1;
  min-width: 0;
}

.final-panel-answer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.final-panel-answer-buttons button {
  min-width: 120px;
}

.final-panel-side-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
}

.final-panel-side-actions button {
  width: 100%;
}

@media (max-width: 850px) {
  .final-actions-panel {
    flex-direction: column;
  }

  .final-panel-side-actions {
    min-width: 0;
    justify-content: stretch;
  }
}

/* v0.1.7c-1 - Host Phase UI Cleanup */
.host-phase-helper {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(250,204,21,.12);
  border: 1px solid rgba(250,204,21,.28);
}

.host-phase-helper strong {
  color: var(--gold);
}

.host-phase-helper span {
  color: var(--muted);
  font-size: .9rem;
}

/* Im Finale soll das Finalpanel die Hauptsteuerung sein. */
body.host-group-final #host-answer-card .answer-buttons,
body.host-group-final #host-answer-card .joker-buttons {
  opacity: .28;
  filter: grayscale(.45);
}

body.host-group-final #host-answer-card h2 {
  opacity: .45;
}

/* RP-Wurf im Finale komplett entschärfen, weil nicht mehr gewürfelt wird. */
body.host-group-final #host-control-card .roll-buttons {
  display: none;
}

body.host-group-final #host-control-card > p {
  display: none;
}

/* Die allgemeinen Matchbuttons bleiben als Fallback sichtbar, aber weniger dominant. */
body.host-group-final #host-control-card .actions.compact {
  opacity: .45;
}

/* In Tiebreaker und Finished sollen Standardantworten/Joker nicht im Fokus stehen. */
body.host-group-tiebreaker #host-answer-card .answer-buttons,
body.host-group-tiebreaker #host-answer-card .joker-buttons,
body.host-group-finished #host-answer-card .answer-buttons,
body.host-group-finished #host-answer-card .joker-buttons {
  display: none;
}

body.host-group-tiebreaker #host-control-card,
body.host-group-finished #host-control-card {
  opacity: .55;
}

/* Bei finished soll das Ergebnisfenster die Bühne bekommen. */
body.host-group-finished #host-state {
  border-color: rgba(250,204,21,.35);
}

/* Statuskarte etwas stärker machen, weil dort unsere geführten Panels laufen. */
body.host-group-final #host-state,
body.host-group-tiebreaker #host-state,
body.host-group-finished #host-state {
  box-shadow: 0 18px 60px rgba(0,0,0,.34);
}

/* Kleine optische Trennung der Hostkarten */
.host-control-card,
.host-state-card,
.host-answer-card {
  transition: opacity .2s ease, filter .2s ease, box-shadow .2s ease, border-color .2s ease;
}

/* v0.1.7c-2 - Host UI Cleanup */
.host-state-card {
  position: relative;
}

#rules-modal-open-button,
#result-modal-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0 8px 12px 0;
}

#rules-modal-open-button::before {
  content: "📘 ";
}

#result-modal-open-button::before {
  content: "🏆 ";
}

body.host-group-finished #result-modal-open-button {
  background: var(--gold);
  color: #111827;
  box-shadow: 0 10px 30px rgba(250,204,21,.20);
}

.compact-finished-panel {
  border-color: rgba(250,204,21,.38);
  background: linear-gradient(135deg, rgba(250,204,21,.13), rgba(15,23,42,.80));
}

.compact-finished-panel strong {
  font-size: 1.2rem;
}

.compact-finished-panel button {
  min-width: 190px;
}

/* Finished: Standardbereiche weiter entschärfen, Ergebnisfenster ist der Hauptabschluss */
body.host-group-finished #host-control-card {
  display: none;
}

body.host-group-finished #host-answer-card {
  opacity: .65;
}

/* Finale: Resultbutton nicht anzeigen, solange noch gespielt wird */
body.host-group-final #result-modal-open-button,
body.host-group-main #result-modal-open-button,
body.host-group-betting #result-modal-open-button,
body.host-group-tiebreaker #result-modal-open-button {
  display: none;
}

@media (max-width: 760px) {
  .compact-finished-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .compact-finished-panel button {
    width: 100%;
  }
}

/* v0.1.7c-3 - Host Layout Center Polish */
.host-layout {
  max-width: 1280px;
  margin: 0 auto;
  justify-content: center;
}

.host-state-card {
  max-width: 960px;
}

.host-control-card,
.host-answer-card {
  max-width: 520px;
}

/* Wenn der Match beendet ist, wirkt die Hostansicht ruhiger und mittiger. */
body.host-group-finished .host-layout {
  max-width: 980px;
  grid-template-columns: minmax(320px, 860px);
  justify-items: stretch;
}

body.host-group-finished .host-state-card,
body.host-group-finished .host-answer-card {
  max-width: 860px;
  width: 100%;
}

/* Im Finale etwas mehr Fokus auf das zentrale Status-/Finalpanel. */
body.host-group-final .host-layout {
  max-width: 1120px;
}

body.host-group-final .host-state-card {
  max-width: 880px;
}

/* Auf großen Screens nicht zu weit links kleben. */
@media (min-width: 1300px) {
  .host-layout {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* Auf kleineren Screens bleibt alles natürlich einspaltig/responsive. */
@media (max-width: 900px) {
  .host-layout,
  body.host-group-finished .host-layout,
  body.host-group-final .host-layout {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .host-state-card,
  .host-control-card,
  .host-answer-card,
  body.host-group-finished .host-state-card,
  body.host-group-finished .host-answer-card {
    max-width: none;
  }
}

/* v0.1.7c-3b - Finished Layout Polish */

/* Nach Match-Ende braucht der Host keine leere Fragebox mehr. */
body.host-group-finished .host-question-box.empty {
  display: none;
}

/* Im Finished-State wird der Hauptbereich kompakter, Scoreboard bleibt sichtbar. */
body.host-group-finished .host-wide-grid {
  grid-template-columns: 1fr;
}

body.host-group-finished .host-wide-main {
  display: none;
}

body.host-group-finished .host-wide-side {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* Joker im Finished-State ausblenden, Scoreboard reicht als Abschlussübersicht. */
body.host-group-finished .host-side-panel {
  display: none;
}

body.host-group-finished .host-scoreboard {
  border-color: rgba(250,204,21,.28);
  background: rgba(15,23,42,.90);
}

/* Kompakteres Finished-Panel statt breitem Banner. */
body.host-group-finished .compact-finished-panel {
  max-width: 720px;
  margin: 18px auto 0;
  padding: 18px 20px;
  border-radius: 22px;
  align-items: center;
  gap: 18px;
}

body.host-group-finished .compact-finished-panel strong {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
}

body.host-group-finished .compact-finished-panel span {
  font-size: .95rem;
}

body.host-group-finished .compact-finished-panel button {
  min-width: 210px;
  white-space: nowrap;
}

/* Die Statuskarte darf im Finished-State etwas kompakter wirken. */
body.host-group-finished .host-control-dashboard {
  gap: 14px;
}

body.host-group-finished .host-topbar {
  margin-bottom: 0;
}

body.host-group-finished .host-main-status {
  padding: 16px 18px;
}

body.host-group-finished .host-score-big {
  width: 74px;
  height: 74px;
  font-size: 2.15rem;
}

body.host-group-finished .host-status-tile {
  min-height: 92px;
}

/* Auf 1080p und kleineren Höhen weniger vertikaler Verbrauch. */
@media (max-height: 900px) {
  body.host-group-finished .host-state-card {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  body.host-group-finished .compact-finished-panel {
    margin-top: 12px;
  }

  body.host-group-finished .host-score-row {
    padding: 8px 10px;
  }
}

@media (max-width: 760px) {
  body.host-group-finished .compact-finished-panel {
    max-width: none;
    align-items: stretch;
  }

  body.host-group-finished .compact-finished-panel button {
    width: 100%;
  }
}

/* v0.1.7c-4 - Finished UX Cleanup */

/* Das Result-Modal ist ab jetzt der eigentliche Abschluss. Kein grüner Bottom-Banner mehr. */
body.host-group-finished .compact-finished-panel,
body.host-group-finished .betting-status-panel.winner {
  display: none !important;
}

/* Im Finished-State sind aktive Spieler-/Runden-/Phaseninfos nicht mehr nötig. */
body.host-group-finished .host-topbar,
body.host-group-finished .host-main-status,
body.host-group-finished .host-status-grid,
body.host-group-finished .host-status-grid-wide {
  display: none !important;
}

/* Nur noch Scoreboard als ruhige Hintergrundübersicht. */
body.host-group-finished .host-control-dashboard {
  gap: 0;
}

body.host-group-finished .host-wide-grid {
  display: block;
}

body.host-group-finished .host-wide-main,
body.host-group-finished .host-question-box,
body.host-group-finished .host-side-panel {
  display: none !important;
}

body.host-group-finished .host-wide-side {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

body.host-group-finished .host-scoreboard {
  margin: 0 auto;
  padding: 18px;
  border-color: rgba(250,204,21,.35);
  background: rgba(15,23,42,.92);
}

body.host-group-finished .host-scoreboard h3 {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .95rem;
}

body.host-group-finished .host-score-row {
  padding: 12px 14px;
}

body.host-group-finished .host-score-row b {
  font-size: 1.5rem;
}

/* Hostkarte im Finished-State etwas kompakter und zentrierter. */
body.host-group-finished .host-state-card {
  max-width: 920px;
  margin: 0 auto;
}

body.host-group-finished #state-render {
  margin-top: 8px;
}

/* Der Ergebnisbutton oben bleibt als manuelle Wiederöffnung prominent. */
body.host-group-finished #result-modal-open-button {
  display: inline-flex;
}

/* v0.1.7d - Eigene Finaljoker */
.final-panel-jokers {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(250,204,21,.08);
  border: 1px solid rgba(250,204,21,.22);
}

.final-panel-jokers-label {
  color: var(--gold);
  font-size: .78rem;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.final-panel-joker-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.final-panel-joker-buttons button {
  min-width: 140px;
}

.final-panel-joker-buttons button.final-joker-used,
.final-panel-joker-buttons button:disabled {
  opacity: .42;
  filter: grayscale(1);
  cursor: not-allowed;
  text-decoration: line-through;
}

@media (max-width: 760px) {
  .final-panel-joker-buttons {
    flex-direction: column;
  }

  .final-panel-joker-buttons button {
    width: 100%;
  }
}

/* v0.1.7e - Dedicated Final Host View */

/* Sobald das Finale läuft, wird die normale Host-Oberfläche optisch verlassen. */
body.dedicated-final-view-active .host-layout {
  display: none !important;
}

body.dedicated-final-view-active #betting-modal-root {
  display: none !important;
}

#final-host-view-root[hidden] {
  display: none !important;
}

#final-host-view-root {
  width: min(1380px, calc(100vw - 48px));
  margin: 0 auto;
}

.final-host-shell {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(250,204,21,.13), transparent 36%),
    linear-gradient(135deg, rgba(15,23,42,.98), rgba(2,6,23,.96));
  border: 1px solid rgba(250,204,21,.34);
  box-shadow: 0 30px 90px rgba(0,0,0,.48);
}

.final-host-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(2,6,23,.42);
  border: 1px solid rgba(148,163,184,.16);
}

.final-host-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: .95;
  color: var(--gold);
}

.final-host-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.final-host-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 1000;
  margin-bottom: 6px;
}

.final-host-stage-badge {
  width: clamp(90px, 10vw, 140px);
  height: clamp(90px, 10vw, 140px);
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: var(--gold);
  color: #111827;
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 1000;
  box-shadow: 0 20px 48px rgba(250,204,21,.22);
}

.final-host-body {
  min-height: 480px;
}

.final-host-question-card {
  height: 100%;
  min-height: 480px;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 26px;
  border-radius: 28px;
  background: rgba(15,23,42,.90);
  border: 1px solid rgba(168,85,247,.58);
  box-shadow: 0 0 34px rgba(168,85,247,.12);
}

.final-host-question-card.empty {
  place-items: center;
  text-align: center;
  align-content: center;
  border-color: rgba(250,204,21,.48);
}

.final-host-question-card.empty h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
}

.final-host-question-card.empty p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 750;
}

.final-host-main-button {
  margin-top: 6px;
  min-width: 240px;
  font-size: 1.05rem;
}

.final-host-question-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.final-host-question-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2.1rem);
}

.final-host-points {
  min-width: 110px;
  padding: 14px;
  border-radius: 20px;
  text-align: center;
  background: rgba(250,204,21,.10);
  border: 1px solid rgba(250,204,21,.35);
}

.final-host-points span,
.final-host-points small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.final-host-points b {
  display: block;
  color: var(--gold);
  font-size: 2.4rem;
  line-height: 1;
  margin: 4px 0;
}

.final-host-question-text {
  padding: clamp(22px, 3vw, 38px);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 1.12;
  font-weight: 1000;
  border-radius: 26px;
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(148,163,184,.18);
}

.final-host-answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.final-host-answer {
  min-height: 120px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  text-align: left;
  border-radius: 22px;
  padding: 18px;
  background: rgba(2,6,23,.64);
  border: 1px solid rgba(148,163,184,.22);
}

.final-host-answer span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--gold);
  color: #111827;
  font-size: 1.4rem;
  font-weight: 1000;
}

.final-host-answer strong {
  font-size: clamp(1.05rem, 1.5vw, 1.55rem);
  line-height: 1.18;
}

.final-host-answer em {
  grid-column: 2;
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}

.final-host-answer.selected {
  border-color: rgba(59,130,246,.95);
  box-shadow: 0 0 24px rgba(59,130,246,.18);
}

.final-host-answer.correct {
  border-color: rgba(34,197,94,.95);
  box-shadow: 0 0 24px rgba(34,197,94,.18);
}

.final-host-answer.wrong {
  border-color: rgba(239,68,68,.95);
  box-shadow: 0 0 24px rgba(239,68,68,.18);
}

.final-host-answer.hidden {
  opacity: .26;
  filter: grayscale(1);
  text-decoration: line-through;
}

.final-host-jokers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(250,204,21,.08);
  border: 1px solid rgba(250,204,21,.24);
}

.final-host-jokers span {
  display: block;
  color: var(--gold);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 1000;
}

.final-host-jokers strong {
  display: block;
  margin-top: 3px;
}

.final-host-joker-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.final-host-joker-buttons button {
  min-width: 150px;
}

.final-host-joker-buttons button.used,
.final-host-joker-buttons button:disabled {
  opacity: .42;
  filter: grayscale(1);
  cursor: not-allowed;
  text-decoration: line-through;
}

.final-host-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.final-host-actions button {
  min-width: 210px;
}

.final-host-scorebar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.final-host-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(15,23,42,.82);
  border: 1px solid rgba(148,163,184,.20);
}

.final-host-player.active {
  border-color: rgba(250,204,21,.68);
  background: rgba(250,204,21,.08);
  box-shadow: 0 0 24px rgba(250,204,21,.10);
}

.final-host-player span {
  display: block;
  color: var(--gold);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 1000;
}

.final-host-player strong {
  display: block;
  font-size: 1.55rem;
}

.final-host-player small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.final-host-player b {
  color: var(--gold);
  font-size: clamp(2rem, 4vw, 3.4rem);
}

@media (max-width: 900px) {
  #final-host-view-root {
    width: min(100%, calc(100vw - 24px));
  }

  .final-host-shell {
    padding: 16px;
  }

  .final-host-header,
  .final-host-question-head,
  .final-host-jokers {
    flex-direction: column;
    align-items: stretch;
  }

  .final-host-stage-badge {
    width: 100%;
    height: auto;
    min-height: 76px;
  }

  .final-host-answer-grid,
  .final-host-scorebar {
    grid-template-columns: 1fr;
  }

  .final-host-actions {
    flex-direction: column;
  }

  .final-host-actions button,
  .final-host-joker-buttons button {
    width: 100%;
  }
}

/* v0.1.7f-2a - Host Answer Click + Empty Question Text Polish */
.host-answer.clickable {
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 1px solid rgba(148,163,184,.22);
}

.host-answer.clickable:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(250,204,21,.55);
  box-shadow: 0 12px 32px rgba(250,204,21,.08);
}

.host-answer.clickable:disabled {
  cursor: default;
}

.host-answer.clickable.hidden {
  cursor: not-allowed;
}

.guided-empty-state {
  border-color: rgba(250,204,21,.30);
  background:
    radial-gradient(circle at top left, rgba(250,204,21,.10), transparent 34%),
    rgba(15,23,42,.86);
}

.guided-empty-state .host-question-text {
  font-size: clamp(2rem, 3.2vw, 3.6rem);
  color: var(--gold);
}

.guided-empty-state .host-answer-status {
  font-size: 1.05rem;
  color: var(--muted);
}

/* v0.1.7f-2a fix - Correct Answer Display */
.host-answer.clickable:disabled {
  opacity: 1;
}

.host-answer.clickable.correct {
  border-color: rgba(34,197,94,.95) !important;
  background: rgba(34,197,94,.16) !important;
  box-shadow: 0 0 28px rgba(34,197,94,.22);
}

.host-answer.clickable.correct .host-answer-letter {
  background: rgba(34,197,94,.95);
  color: #052e16;
}

.host-answer.clickable.wrong {
  border-color: rgba(239,68,68,.95) !important;
  background: rgba(239,68,68,.14) !important;
  box-shadow: 0 0 24px rgba(239,68,68,.18);
}

.host-answer.clickable.wrong .host-answer-letter {
  background: rgba(239,68,68,.95);
  color: #450a0a;
}

.host-answer.clickable.selected:not(.correct):not(.wrong) {
  border-color: rgba(59,130,246,.95);
  box-shadow: 0 0 24px rgba(59,130,246,.18);
}

.host-answer-status {
  font-weight: 900;
}

/* v0.1.7f-2b - Host Inline Joker */
.host-inline-jokers {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,23,42,.70);
  border: 1px solid rgba(250,204,21,.20);
}

.host-inline-jokers-label {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.host-inline-jokers-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.host-inline-joker {
  min-width: 130px;
}

.host-inline-joker.used,
.host-inline-joker:disabled {
  opacity: .42;
  filter: grayscale(1);
  cursor: not-allowed;
  text-decoration: line-through;
}

@media (max-width: 760px) {
  .host-inline-jokers-buttons {
    flex-direction: column;
  }

  .host-inline-joker {
    width: 100%;
  }
}

/* v0.1.7f-2d - Next Player locked until solution reveal */
button.host-action-locked,
button.host-action-locked:disabled {
  opacity: .42;
  filter: grayscale(1);
  cursor: not-allowed;
  border: 1px solid rgba(239,68,68,.35);
}

/* v0.1.8b-2 - QuizNight Branding / Favicon */
.brand-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-with-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(250,204,21,.18));
}

.brand-with-logo span {
  color: var(--gold);
}

@media (max-width: 640px) {
  .brand-with-logo img {
    width: 34px;
    height: 34px;
  }
}

/* v0.1.8e - Low Height Responsive Host Fix
   Für kleine sichtbare Browserhöhen, z. B. MacBook/Firefox mit geringer Fensterhöhe.
   Ziel: Hostansicht kompakter und besser bedienbar machen, ohne Spielmechanik zu ändern. */
@media (max-height: 620px) {
  .topbar {
    padding: 8px 16px;
  }

  .brand-with-logo img {
    width: 30px;
    height: 30px;
  }

  .topbar nav {
    gap: 10px;
    flex-wrap: wrap;
  }

  .topbar nav a,
  .topbar nav button {
    padding: 7px 10px;
    font-size: .88rem;
  }

  .container {
    padding: 14px;
  }

  h1 {
    margin: 8px 0 12px;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
  }

  .card {
    padding: 14px;
    border-radius: 16px;
  }

  .host-layout {
    gap: 12px;
  }

  .host-control-card h2,
  .host-state-card h2,
  .host-answer-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.05rem;
  }

  .host-control-card p {
    margin: 6px 0 10px;
    font-size: .9rem;
  }

  .roll-buttons,
  .answer-buttons,
  .joker-buttons {
    gap: 8px;
    margin: 8px 0;
  }

  .roll-buttons button {
    font-size: 1.05rem;
    padding: 8px 10px;
  }

  .actions.compact {
    gap: 8px;
  }

  .actions.compact button {
    padding: 8px 10px;
    font-size: .9rem;
  }

  .host-question-box {
    min-height: auto;
    padding: 14px;
    border-radius: 18px;
  }

  .host-question-text {
    font-size: clamp(1.05rem, 2vw, 1.55rem);
    line-height: 1.18;
  }

  .host-answer-grid {
    gap: 8px;
  }

  .host-answer {
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .host-answer-letter {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1rem;
  }

  .host-answer-text {
    font-size: .95rem;
    line-height: 1.16;
  }

  .host-inline-jokers {
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .host-inline-jokers-label {
    margin-bottom: 7px;
    font-size: .7rem;
  }

  .host-inline-joker {
    min-width: 112px;
    padding: 8px 10px;
    font-size: .88rem;
  }

  .host-scoreboard {
    margin-top: 10px;
  }

  .host-score-row {
    padding: 7px 9px;
  }

  .host-score-row b {
    font-size: 1.05rem;
  }

  .guided-empty-state {
    min-height: auto;
    padding: 18px;
  }

  .guided-empty-state strong {
    font-size: clamp(1.3rem, 2.8vw, 2rem);
  }

  .guided-empty-state p {
    font-size: .95rem;
  }
}

/* Noch kompakter für sehr niedrige Fensterhöhen */
@media (max-height: 480px) {
  .topbar {
    align-items: flex-start;
  }

  .brand-with-logo img {
    width: 26px;
    height: 26px;
  }

  .brand-with-logo span {
    font-size: 1rem;
  }

  .container {
    padding: 10px;
  }

  h1 {
    font-size: 1.25rem;
    margin: 6px 0 8px;
  }

  .card {
    padding: 10px;
  }

  .host-layout {
    gap: 10px;
  }

  .host-question-text {
    font-size: clamp(1rem, 1.8vw, 1.35rem);
  }

  .host-answer {
    min-height: 54px;
    padding: 8px 10px;
  }

  .host-answer-letter {
    width: 30px;
    height: 30px;
  }

  .host-answer-status {
    margin-top: 6px;
    font-size: .85rem;
  }

  .host-inline-jokers-buttons {
    gap: 7px;
  }

  .host-inline-joker {
    min-width: 100px;
    padding: 7px 9px;
  }
}

/* v0.1.8e - Host Responsive Width Fix
   Behebt horizontales Überlaufen bei kleineren effektiven Viewports,
   z. B. Firefox auf MacBook: 1440px Breite, aber Hostkarten ragten links/rechts heraus. */
@media (max-width: 1500px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .container {
    max-width: none;
    width: 100%;
    padding-left: clamp(10px, 1.2vw, 18px);
    padding-right: clamp(10px, 1.2vw, 18px);
  }

  .host-layout {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    gap: 12px;
    grid-template-columns:
      minmax(210px, .72fr)
      minmax(0, 2.15fr)
      minmax(260px, .88fr);
  }

  .host-control-card,
  .host-state-card,
  .host-answer-card {
    max-width: none;
    width: 100%;
    min-width: 0;
  }

  .host-wide-grid {
    grid-template-columns: minmax(0, 1fr) minmax(250px, .42fr);
    gap: 12px;
  }

  .host-wide-main,
  .host-wide-side,
  .host-question-box,
  .host-scoreboard {
    min-width: 0;
  }

  .host-question-box {
    padding-left: clamp(14px, 1.4vw, 22px);
    padding-right: clamp(14px, 1.4vw, 22px);
  }

  .host-answer {
    min-width: 0;
  }

  .host-answer-text {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 1180px) {
  .host-layout {
    grid-template-columns: 1fr;
  }

  .host-wide-grid {
    grid-template-columns: 1fr;
  }
}

/* v0.1.8e-2 - Host Responsive Width Fix 2
   Bei mittleren Viewports wird die alte rechte Antwort-/Joker-Fallbackkarte ausgeblendet.
   Antworten und Joker laufen inzwischen inline im Hauptbereich. */
@media (max-width: 1500px) {
  .host-layout {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
    gap: 12px;
    padding-left: 0;
    padding-right: 0;
  }

  .host-answer-card {
    display: none;
  }

  .host-control-card,
  .host-state-card {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .host-main-status,
  .host-status-grid,
  .host-status-grid-wide {
    min-width: 0;
  }

  .host-status-grid,
  .host-status-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .host-main-status {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .host-wide-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .42fr);
  }
}

@media (max-width: 980px) {
  .host-layout {
    grid-template-columns: 1fr;
  }

  .host-control-card {
    order: 1;
  }

  .host-state-card {
    order: 2;
  }

  .host-wide-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   v0.1.9-livefix-1ab - Streamview Mode: Chroma / Branded
   ========================================================================== */

html[data-stream-mode="chroma"],
html[data-stream-mode="chroma"] body {
  background: #00ff00 !important;
}

html[data-stream-mode="branded"],
html[data-stream-mode="branded"] body {
  background-color: #05060d !important;
  background-image:
    radial-gradient(circle at center, rgba(255,255,255,0.08) 0%, rgba(5,6,13,0.72) 44%, rgba(5,6,13,0.97) 100%),
    url("/static/img/quiznight_logo.png") !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center center, center center !important;
  background-size: cover, min(68vw, 68vh) !important;
  background-attachment: fixed, fixed !important;
}

html[data-stream-mode="branded"] .stream-page,
html[data-stream-mode="branded"] .stream-shell,
html[data-stream-mode="branded"] .stream-layout,
html[data-stream-mode="branded"] .stream-container,
html[data-stream-mode="branded"] .stream-stage,
html[data-stream-mode="branded"] .stream-main,
html[data-stream-mode="branded"] .stream-board {
  background: transparent !important;
}

/* ==========================================================================
   v0.1.9-livefix-1ab - Streamview Spezialkategorien-Pregame-Board
   ========================================================================== */

.qn-stream-category-board {
  position: fixed;
  inset: 5vh 6vw auto 6vw;
  z-index: 9999;
  min-height: 54vh;
  padding: clamp(1.2rem, 2.4vw, 2.4rem);
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(5, 8, 18, 0.78);
  box-shadow: 0 28px 80px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  color: #fff;
  text-align: center;
}

html[data-stream-mode="chroma"] .qn-stream-category-board {
  background: rgba(5, 8, 18, 0.86);
}

.qn-stream-category-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: clamp(0.75rem, 1.2vw, 1rem);
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.qn-stream-category-title {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 5.5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.qn-stream-category-subtitle {
  margin-top: 0.7rem;
  font-size: clamp(1rem, 2vw, 1.6rem);
  opacity: 0.82;
}

.qn-stream-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
  margin-top: clamp(1.4rem, 3vw, 2.5rem);
}

.qn-stream-category-card {
  padding: clamp(0.9rem, 2vw, 1.5rem);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.09);
}

.qn-stream-category-card.is-picked {
  border-color: rgba(255,255,255,0.32);
}

.qn-stream-category-card.is-open {
  opacity: 0.55;
  border-style: dashed;
}

.qn-stream-category-player {
  font-size: clamp(1.1rem, 2.2vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.qn-stream-category-name {
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  opacity: 0.88;
}

/* ==========================================================================
   v0.1.9-livefix-1ab - Match-Erstellung Kategorie-Auswahlboard
   ========================================================================== */

.qn-category-pick-board {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
}

.qn-category-board-head h2 {
  margin: 0 0 0.25rem 0;
}

.qn-category-board-head p {
  margin: 0 0 0.9rem 0;
  opacity: 0.76;
}

.qn-category-board-section {
  margin-top: 0.85rem;
}

.qn-category-board-section h3 {
  margin: 0 0 0.45rem 0;
  font-size: 0.95rem;
  opacity: 0.86;
}

.qn-category-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.qn-category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  font-size: 0.88rem;
}

.qn-category-chip.is-picked {
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.14);
  opacity: 0.68;
}

.qn-category-empty {
  opacity: 0.64;
  font-size: 0.9rem;
}

/* ==========================================================================
   v0.1.9-livefix-1ab - Streamview Quicklinks
   ========================================================================== */

.qn-stream-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.qn-stream-quicklinks-label {
  font-size: 0.82rem;
  opacity: 0.78;
  margin-right: 0.15rem;
}

.qn-stream-quicklink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: inherit;
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.1;
  white-space: nowrap;
}

.qn-stream-quicklink:hover {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

.qn-stream-quicklink-chroma {
  border-color: rgba(0,255,0,0.55);
}

.qn-stream-quicklink-branded {
  border-color: rgba(255,255,255,0.35);
}


/* ==========================================================================
   v0.1.9-livefix-1c2 - Spezialkategorie Duplicate Status
   ========================================================================== */

.qn-category-duplicate-status {
  margin: 0 0 1rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 700;
}

.qn-category-duplicate-status.is-ok {
  background: rgba(40, 180, 99, 0.12);
  border-color: rgba(40, 180, 99, 0.35);
}

.qn-category-duplicate-status.is-error {
  background: rgba(220, 53, 69, 0.18);
  border-color: rgba(220, 53, 69, 0.48);
}

