:root {
  --bg: #1d1442;
  --bg2: #3a2486;
  --card: rgba(255, 255, 255, 0.12);
  --fg: #fff;
  --muted: #cdc6f2;
  --red: #e21b3c;
  --blue: #1368ce;
  --yellow: #c78f00;
  --green: #26890c;
  --pink: #b8307f;
  --accent: #ffd23f;
  --ink: #1d1442;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: radial-gradient(circle at 20% 0%, var(--bg2), var(--bg) 70%) fixed;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }

.red { background: var(--red); }
.blue { background: var(--blue); }
.yellow { background: var(--yellow); }
.green { background: var(--green); }
.pink { background: var(--pink); }

/* ---------- Timer ---------- */
.timer-wrap { display: flex; align-items: center; gap: 0.8em; }
.timer { flex: 1; height: 0.7em; background: rgba(255, 255, 255, 0.2); border-radius: 99px; overflow: hidden; }
.timer > i { display: block; height: 100%; width: 100%; background: var(--accent); }
.timer-label { min-width: 2ch; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Startseite ---------- */
.landing { max-width: 28rem; margin: 0 auto; padding: 3rem 1.25rem; display: grid; gap: 1rem; text-align: center; }
.landing h1 { font-size: 2.2rem; margin-bottom: 1rem; }
.landing a {
  display: block; padding: 1.1rem; border-radius: var(--radius); background: var(--card);
  color: var(--fg); text-decoration: none; font-weight: 700; font-size: 1.2rem;
}

/* ================= Fernseher ================= */
body.host { font-size: calc(10px + 0.95vw); overflow: hidden; height: 100vh; }
.host-stage { height: 100vh; padding: 2.2vh 3vw; display: flex; flex-direction: column; gap: 2vh; }

.host .top { display: flex; align-items: center; gap: 1.5em; font-weight: 700; color: var(--muted); }
.host .top .timer-wrap { flex: 1; }
.host .top .timer-label { font-size: 1.8em; color: var(--fg); }

.host .qtext { font-size: 2.1em; font-weight: 800; line-height: 1.2; text-align: center; text-wrap: balance; }
/* Bildfläche: Das Bild füllt die Fläche absolut positioniert und wird mit object-fit eingepasst. Das hängt nicht davon ab,
   wie ein Browser Prozent-Höhen in Flex-Layouts auflöst (Safari kann das Bild sonst winzig darstellen). */
.host .media { position: relative; flex: 1 1 0; min-height: 0; }
.host .media img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; border-radius: var(--radius); }
.host .spacer { flex: 1; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9vh 0.9vw; }
.host .tiles { flex: 0 0 auto; }
.tile {
  display: flex; align-items: center; gap: 0.6em; padding: 0.45em 0.8em; border-radius: 0.4em;
  font-weight: 700; font-size: 1.25em; position: relative; color: #fff; overflow-wrap: anywhere;
}
.tile .sym { font-size: 1.1em; opacity: 0.85; }
.tile .count { margin-left: auto; font-size: 1em; background: rgba(0, 0, 0, 0.3); padding: 0.05em 0.5em; border-radius: 99px; }
.tile.dim { opacity: 0.3; }
.tile.correct { outline: 0.07em solid #fff; box-shadow: 0 0 0 0.16em rgba(255, 255, 255, 0.14); }
.tile.correct::after { content: "✓"; margin-left: 0.4em; font-size: 1.15em; }

.estimate-box { text-align: center; font-size: 2.2em; font-weight: 800; padding: 0.8em; background: var(--card); border-radius: var(--radius); }
.big-number { font-size: 5em; font-weight: 900; color: var(--accent); text-align: center; line-height: 1; }
.big-number small { font-size: 0.4em; color: var(--muted); font-weight: 700; }

.answered { text-align: center; color: var(--muted); font-size: 1.2em; font-weight: 700; }
.explanation { text-align: center; color: var(--muted); font-size: 1.3em; text-wrap: balance; }

.guesses { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: 0.6em; }

/* Lobby */
.lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: center; }
.lobby .join { text-align: center; display: grid; gap: 0.8em; }
.lobby .join h2 { font-size: 1.6em; }
.qr { background: #fff; padding: 0.6em; border-radius: var(--radius); width: 17em; max-width: 36vh; aspect-ratio: 1; margin: 0 auto; }
.qr img { width: 100%; height: 100%; display: block; }
.lobby .join .url { font-size: 1.2em; color: var(--accent); font-weight: 800; word-break: break-all; }
.lobby h1 { font-size: 3em; line-height: 1.1; margin-bottom: 0.4em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5em; align-content: flex-start; }
.chip { background: var(--card); padding: 0.35em 0.9em; border-radius: 99px; font-weight: 700; font-size: 1.2em; animation: pop 0.3s ease-out; }
.hint { color: var(--muted); font-size: 1.2em; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

.center { flex: 1; display: grid; place-content: center; text-align: center; gap: 0.6em; }
.center h1 { font-size: 3.4em; }

/* Rangliste */
.board { display: grid; gap: 0.6em; flex: 1; align-content: start; }
.board h1 { font-size: 2.2em; text-align: center; margin-bottom: 0.3em; }
.board .board-round { text-align: center; font-size: 1.3em; color: var(--muted); font-weight: 700; margin-top: -0.5em; }
.row { display: grid; grid-template-columns: 3.6em 2.6em 10em 5em 1fr 5.5em 4.5em; gap: 0.8em; align-items: center; font-size: 1.25em; font-weight: 700; }
.row .rank { color: var(--muted); display: flex; justify-content: flex-end; align-items: center; gap: 0.25em; }
.row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .bar { height: 1.2em; background: rgba(255, 255, 255, 0.12); border-radius: 99px; overflow: hidden; }
.row .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7eb3, var(--accent)); border-radius: 99px; transition: width 0.8s ease-out; }
.row .score { text-align: right; font-variant-numeric: tabular-nums; }
.row .gain { color: #8cf08c; font-size: 0.85em; }
.row.first .name { color: var(--accent); }

/* Podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 2vw; flex: 1; min-height: 0; }
.podium .place { width: 22%; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; animation: rise 1s ease-out both; }
.podium .who { font-size: 1.6em; font-weight: 800; padding: 0.3em; overflow-wrap: anywhere; }
.podium .pts { color: var(--muted); font-weight: 700; margin-bottom: 0.3em; }
.podium .block { border-radius: 0.5em 0.5em 0 0; background: linear-gradient(var(--accent), #ff9f1c); color: var(--ink); font-size: 3em; font-weight: 900; padding: 0.2em 0; }
.podium .p1 .block { height: 28vh; }
.podium .p2 .block { height: 20vh; background: linear-gradient(#e6e9ef, #aeb6c4); }
.podium .p3 .block { height: 14vh; background: linear-gradient(#e6a56a, #b8743a); }
.rest { text-align: center; color: var(--muted); font-size: 1.2em; font-weight: 700; }

/* ================= Handy (Spieler) ================= */
body.play { min-height: 100dvh; }
.play-stage { min-height: 100dvh; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; max-width: 34rem; margin: 0 auto; }
.play .top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.play .top b { color: var(--fg); }
.play .center { gap: 1rem; }
.play .center h1 { font-size: 1.9rem; }
.play .center p { color: var(--muted); font-size: 1.1rem; }
.play form { display: grid; gap: 0.8rem; }
.play input[type="text"], .play input[type="number"], .play input:not([type]) {
  font: inherit; font-size: 1.3rem; padding: 0.9rem 1rem; border-radius: 12px; border: 0; width: 100%; text-align: center;
}
.play .send {
  font-weight: 800; font-size: 1.3rem; padding: 1rem; border: 0; border-radius: 12px; background: var(--accent); color: var(--ink);
}
.play .send:disabled { opacity: 0.5; }
.err { color: #ffb3bd; font-weight: 700; min-height: 1.4em; }

.p-tiles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; grid-auto-rows: 1fr; }
.p-tiles.two { grid-template-columns: 1fr; }
.p-tile {
  border: 0; border-radius: 14px; color: #fff; font-weight: 800; font-size: 1.25rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.4rem; padding: 0.8rem; min-height: 8rem; overflow-wrap: anywhere;
}
.p-tile .sym { font-size: 2.6rem; line-height: 1; }
.p-tile:active { transform: scale(0.97); }
.p-tile.chosen { outline: 4px solid #fff; }
.p-tiles.locked .p-tile:not(.chosen) { opacity: 0.35; }

.p-qtext { text-align: center; font-weight: 700; font-size: 1.15rem; }

.result { border-radius: 18px; padding: 1.6rem 1rem; text-align: center; display: grid; gap: 0.5rem; }
.result.good { background: var(--green); }
.result.bad { background: var(--red); }
.result.none { background: #5a4b99; }
.result h1 { font-size: 2.2rem; }
.result .gain { font-size: 2rem; font-weight: 900; }
.card-lite { background: var(--card); border-radius: 14px; padding: 1rem; text-align: center; display: grid; gap: 0.3rem; }
.card-lite .big { font-size: 2.4rem; font-weight: 900; color: var(--accent); }
.explain { color: var(--muted); text-align: center; }
.mini-podium { display: grid; gap: 0.4rem; text-align: left; }
.mini-podium div { background: var(--card); border-radius: 12px; padding: 0.7rem 1rem; display: flex; justify-content: space-between; font-weight: 700; }

/* ================= Admin ================= */
body.light {
  --card: #fff;
  --fg: #1d1442;
  --muted: #6b6490;
  background: #f1eefb;
  color: var(--fg);
}
.admin-stage { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 7rem; display: grid; gap: 1rem; }
.admin h1 { font-size: 1.5rem; }
.admin h2 { font-size: 1.15rem; }
.admin .card { background: #fff; border-radius: 14px; padding: 1rem; display: grid; gap: 0.8rem; box-shadow: 0 1px 3px rgba(29, 20, 66, 0.12); }
.admin .row-flex { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.admin .grow { flex: 1; }
.admin .muted { color: var(--muted); font-size: 0.9rem; }
.admin .tabs { display: flex; gap: 0.4rem; background: #e2dcf6; padding: 0.3rem; border-radius: 12px; }
.admin .tabs button { flex: 1; border: 0; background: transparent; padding: 0.6rem; border-radius: 9px; font-weight: 700; color: var(--muted); }
.admin .tabs button.on { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }

.btn { border: 0; border-radius: 10px; padding: 0.65rem 1rem; font-weight: 700; background: #e2dcf6; color: var(--fg); }
.btn.primary { background: #5b3fd1; color: #fff; }
.btn.danger { background: #fde4e8; color: #b0102b; }
.btn.small { padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; }

.admin .field { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.9rem; }
.admin .field small { font-weight: 400; color: var(--muted); }
.admin input, .admin textarea, .admin select {
  font: inherit; padding: 0.6rem 0.7rem; border: 1.5px solid #d5cdee; border-radius: 10px; background: #fff; color: var(--fg); width: 100%;
}
.admin input[type="checkbox"], .admin input[type="radio"] { width: 1.4rem; height: 1.4rem; padding: 0; accent-color: #5b3fd1; }
.admin textarea { min-height: 4.5rem; resize: vertical; }
.admin .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.admin .check { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }

.admin .q-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(29, 20, 66, 0.12); overflow: hidden; }
.admin .q-head { display: flex; gap: 0.7rem; align-items: center; padding: 0.8rem 1rem; cursor: pointer; }
.admin .q-head .num { background: #5b3fd1; color: #fff; border-radius: 99px; min-width: 1.8rem; height: 1.8rem; display: grid; place-content: center; font-weight: 800; font-size: 0.9rem; }
.admin .q-head .txt { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin .q-head .txt.empty { color: var(--muted); font-weight: 400; }
.admin .q-body { padding: 0 1rem 1rem; display: grid; gap: 0.8rem; border-top: 1px solid #eee9fa; padding-top: 1rem; }
.admin .answer-row { display: flex; gap: 0.5rem; align-items: center; }
.admin .answer-row .swatch { width: 1.9rem; height: 1.9rem; border-radius: 8px; display: grid; place-content: center; color: #fff; font-size: 0.9rem; flex: none; }
.admin .img-preview { max-height: 9rem; border-radius: 10px; justify-self: start; }

.admin .sticky { position: fixed; left: 0; right: 0; bottom: 0; padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom)); background: rgba(241, 238, 251, 0.95); backdrop-filter: blur(6px); border-top: 1px solid #ddd5f3; }
.admin .sticky .inner { max-width: 40rem; margin: 0 auto; display: flex; gap: 0.6rem; }
.admin .sticky .btn { flex: 1; padding: 1rem; font-size: 1.1rem; }

.admin .badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 99px; background: #e2dcf6; font-weight: 700; font-size: 0.8rem; }
.admin .badge.live { background: #d6f5d6; color: #17690f; }
.admin .player { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid #f0ecfa; }
.admin .player:last-child { border: 0; }
.admin .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #c3bbe0; flex: none; }
.admin .dot.on { background: #2cb52c; }
.admin .answer-big { background: #f6f3ff; border-radius: 12px; padding: 0.8rem 1rem; }
.admin .answer-big b { display: block; font-size: 1.25rem; }
.admin .login { max-width: 22rem; margin: 20vh auto 0; padding: 0 1rem; display: grid; gap: 1rem; }
.admin .toast { position: fixed; top: 0.8rem; left: 50%; transform: translateX(-50%); background: #1d1442; color: #fff; padding: 0.6rem 1.1rem; border-radius: 99px; font-weight: 700; z-index: 10; }

@media (max-width: 480px) {
  .admin .grid2 { grid-template-columns: 1fr; }
}

.admin .timer { background: #e2dcf6; }
.admin .timer > i { background: #5b3fd1; }
.admin .timer-label { color: var(--fg); }

.host .tile { font-size: 1.35em; }
.admin a { color: #5b3fd1; }

/* Richtige Antworten nach Zeit */
.winners { display: grid; grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); gap: 0.4em 0.8em; font-size: 0.95em; }
.winner { display: grid; grid-template-columns: 2em minmax(0, 1fr) 5.5em 6em; gap: 0.6em; align-items: center; background: var(--card); border-radius: 0.5em; padding: 0.3em 0.8em; font-weight: 700; }
.winner .pos { color: var(--muted); }
.winner .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner .time { color: var(--muted); font-variant-numeric: tabular-nums; }
.winner .pts { text-align: right; color: #8cf08c; font-variant-numeric: tabular-nums; }
.winner.fastest { background: var(--accent); color: var(--ink); }
.winner.fastest .time, .winner.fastest .pos { color: var(--ink); }
.winner.fastest .pts { color: var(--ink); }
.winner.more { display: block; text-align: center; background: none; color: var(--muted); }

.host .winners { font-size: 1.15em; grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); align-content: start; }

.tiles.single { grid-template-columns: minmax(0, 26em); justify-content: center; }
.host .stat { text-align: center; font-size: 1.5em; color: var(--muted); }
.host .stat b { color: var(--accent); font-size: 1.15em; }

.podium .avg { color: var(--muted); font-weight: 700; margin-bottom: 0.3em; font-size: 0.9em; }
.rest.small { font-size: 0.8em; opacity: 0.8; }

.row .avg { color: var(--muted); font-size: 0.75em; font-weight: 600; white-space: nowrap; }
.card-lite .muted-line { color: var(--muted); font-size: 0.95rem; }

/* Auswertung: bei weniger als 10 Einträgen untereinander */
.host .winners.single { grid-template-columns: minmax(0, 38em); justify-content: center; }

/* Platzveränderung */
.trend { font-size: 0.9em; text-align: center; font-weight: 800; white-space: nowrap; }
.trend.up { color: #4cd964; }
.trend.down { color: #ff5a5f; }
.trend.same { color: #8c86ad; }
.admin .trend { font-size: 0.75rem; min-width: 1.8rem; }
.admin .trend.up { color: #1e9e3a; }
.admin .trend.down { color: #d6283a; }
.admin .trend.same { color: #a9a3c4; }

.admin .mark { display: inline-grid; place-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; color: #fff; font-size: 0.8rem; font-weight: 800; vertical-align: middle; }
.admin .mark.ok { background: #1e9e3a; }
.admin .mark.no { background: #d6283a; }

.admin .time-col { min-width: 3.2rem; }

/* Pokale für Platz 1 bis 3 */
.trophy { display: inline-block; line-height: 0; }
.trophy svg { width: 1.15em; height: 1.15em; vertical-align: middle; }
.podium .trophy-big { line-height: 0; }
.podium .trophy-big svg { width: 2.6em; height: 2.6em; }

/* Handy-Kopfzeile: Platz mit Pokal vor den Punkten */
.play .standing { display: inline-flex; align-items: center; gap: 0.8rem; }
.play .place-tag { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--fg); font-weight: 800; }
.play .place-tag .trophy svg { width: 1.25em; height: 1.25em; }

/* Bestätigungsfenster im Admin */
.modal-backdrop { position: fixed; inset: 0; background: rgba(29, 20, 66, 0.55); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.modal { background: #fff; color: #1d1442; border-radius: 16px; padding: 1.2rem; width: min(22rem, 100%); display: grid; gap: 1rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.modal p { font-weight: 700; font-size: 1.05rem; }
.modal .btn { padding: 0.8rem 1rem; }

/* Endergebnis: Plätze ab 4 */
.rest-list { display: grid; gap: 0.3em 3vw; width: min(100%, 44em); margin: 0 auto; font-weight: 700; font-size: 1.05em; }
.rest-list.two { grid-template-columns: 1fr 1fr; grid-auto-flow: column; width: 100%; font-size: 0.95em; }
.rest-row { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto 5em 3em; gap: 0.7em; align-items: center; background: var(--card); border-radius: 0.5em; padding: 0.25em 0.8em; }
.rest-row .pos { color: var(--muted); text-align: right; }
.rest-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-row .pts { font-variant-numeric: tabular-nums; }
.rest-row .avg { color: var(--muted); font-size: 0.85em; text-align: right; }
.rest-row .wins { font-size: 0.9em; }

/* Auswertung als festes Raster: Werte, Zeiten und Punkte stehen in allen Zeilen untereinander */
.winner.est { grid-template-columns: 2em minmax(0, 1fr) 9em 5.5em 6em; }
.winner .val, .winner .time, .winner .pts { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.winner .pts.none { color: var(--muted); }
.winner.fastest .pts.none { color: var(--ink); }
.host .winners.est-list { grid-template-columns: repeat(auto-fit, minmax(30em, 1fr)); }
.host .winners.est-list.single { grid-template-columns: minmax(0, 44em); justify-content: center; }

/* Untertitel auf Start- und Warteseite */
.subtitle { font-weight: 700; color: var(--accent); margin-top: 0.2em; }
.host .center .subtitle { font-size: 2.2em; }
.play .center .subtitle { font-size: 1.4rem; }
.landing .subtitle { font-size: 1.3rem; }

/* Endergebnis: Quizname groß */
.host .final-head { text-align: center; animation: rise 0.8s ease-out both; }
.host .final-title { font-size: 3em; font-weight: 900; line-height: 1.05; text-wrap: balance; }
.host .final-sub { font-size: 1.3em; color: var(--muted); font-weight: 700; margin-top: 0.1em; }

/* Kompakte Quizliste im Admin */
.admin .quiz-list { padding: 0.2rem 0.8rem; gap: 0; }
.admin .quiz-item { border-bottom: 1px solid #eee9fa; padding: 0.5rem 0; }
.admin .quiz-item:last-child { border: 0; }
.admin .quiz-row { display: flex; align-items: center; gap: 0.35rem; }
.admin .quiz-name { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.admin .quiz-name b { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.admin .quiz-name .muted { font-size: 0.8rem; }
.admin .icon-btn { border: 0; border-radius: 9px; width: 2.4rem; height: 2.4rem; display: grid; place-content: center; background: #e2dcf6; color: var(--fg); font-size: 1rem; flex: none; padding: 0; }
.admin .icon-btn.primary { background: #5b3fd1; color: #fff; }
.admin .icon-btn.on { background: #cfc5f0; }
.admin .quiz-menu { display: flex; gap: 0.5rem; justify-content: flex-end; padding-top: 0.5rem; }
.admin .demo-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-weight: 700; font-size: 0.9rem; }
.admin .demo-select { width: auto; padding: 0.35rem 0.6rem; }

/* Überblendung Fragebild -> Auflösungsbild */
.host .crossfade { position: absolute; inset: 0; }
.host .crossfade img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; border-radius: var(--radius); }
.crossfade .fade-in { opacity: 0; transition-property: opacity; transition-timing-function: linear; }
.crossfade .fade-in.go { opacity: 1; }
.host .big-number { font-size: 3.2em; }

.modal .btn.danger-solid { background: #c4172e; color: #fff; }

/* Anmeldung per GitHub */
.admin .gh-btn { display: block; text-align: center; text-decoration: none; padding: 0.85rem 1rem; font-size: 1.05rem; color: #fff; }
.admin .or-line { text-align: center; margin-top: 0.2rem; }

/* Logo (Aufkleber): abgerundet, damit die hellen Ecken des Zuschnitts verschwinden */
.logo { display: block; margin: 0 auto; border-radius: 5.5%; box-shadow: 0 0.4em 1.4em rgba(0, 0, 0, 0.35); }
.logo-tv { height: 52vh; width: auto; max-width: 90vw; }
.logo-phone { width: min(70vw, 15rem); height: auto; }
.logo-landing { width: min(80vw, 16rem); height: auto; margin-bottom: 0.6rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fragenkatalog */
.admin .cq-browser { display: grid; gap: 0.7rem; }
.admin .filter-row { display: grid; gap: 0.25rem; }
.admin .filter-label { font-weight: 700; font-size: 0.8rem; color: var(--muted); }
.admin .tagbar { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.admin .tagbtn { border: 1.5px solid #d5cdee; background: #fff; color: var(--fg); border-radius: 99px; padding: 0.25rem 0.7rem; font-weight: 700; font-size: 0.85rem; }
.admin .tagbtn.mode { justify-self: start; border-style: dashed; font-size: 0.78rem; padding: 0.15rem 0.6rem; }
.admin .tagbtn.on { background: #5b3fd1; border-color: #5b3fd1; color: #fff; }
.admin .cq-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.1rem; border-bottom: 1px solid #f0ecfa; cursor: pointer; }
.admin .cq-row input[type=checkbox] { width: 1.2rem; height: 1.2rem; flex: none; }
.admin .cq-main { min-width: 0; display: grid; gap: 0.2rem; flex: 1; }
.admin .cq-text { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin .cq-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.admin .cq-meta .badge { font-size: 0.7rem; padding: 0.05rem 0.5rem; }
.admin .tag { font-size: 0.75rem; color: #5b3fd1; font-weight: 700; }
.modal.wide { width: min(40rem, 100%); max-height: 92vh; grid-template-rows: auto minmax(0, 1fr) auto; }
.modal.wide h2 { font-size: 1.15rem; }
.modal .modal-scroll { overflow-y: auto; display: grid; gap: 0.8rem; align-content: start; padding-right: 0.2rem; }
.modal .btn.grow, .modal .grow { flex: 1; }
.admin .filters { display: grid; }
.admin .filters > summary { font-weight: 700; cursor: pointer; padding: 0.3rem 0; color: #5b3fd1; }
.admin .filters[open] { gap: 0.6rem; }
.admin .filters[open] > summary { margin-bottom: 0.5rem; }
.modal .info-line { font-weight: 700; color: #1d1442; }

/* Startseite mit den Spielregeln */
.host .rules-page { display: grid; gap: 1.2em; align-content: center; height: 100%; }
.host .rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(19em, 1fr)); gap: 0.8em; font-size: 1.1em; }
.rule { display: flex; gap: 0.7em; align-items: flex-start; background: var(--card); border-radius: var(--radius); padding: 0.7em 0.9em; }
.rule .ico { font-size: 1.8em; line-height: 1.1; }
.rule b { color: var(--accent); font-size: 1.15em; }
.rule p { color: var(--muted); font-size: 0.9em; margin-top: 0.2em; }
.host .rule b { font-size: 1.3em; }
.host .rule p { font-size: 1em; }
.play .rules-phone { display: grid; gap: 0.7rem; align-content: start; padding: 0.5rem 0; }
.play .rules-phone h1 { text-align: center; font-size: 1.5rem; }
.play .rules-phone .hint { text-align: center; font-size: 1rem; }

/* Endergebnis wird nacheinander eingeblendet: Plätze ab 4, dann 3, 2 und zuletzt der Sieger */
@keyframes rise { from { opacity: 0; transform: translateY(5vh); } to { opacity: 1; transform: none; } }
@keyframes winner { from { opacity: 0; transform: translateY(5vh) scale(0.85); } to { opacity: 1; transform: none; } }
.host .rest-list, .host .rest.small { animation: rise 0.9s ease-out 0.8s both; }
.podium .p3 { animation-delay: 2.2s; }
.podium .p2 { animation-delay: 4s; }
.podium .p1 { animation-name: winner; animation-delay: 6.2s; animation-duration: 1.3s; }
@media (prefers-reduced-motion: reduce) {
  .host .final-head, .host .rest-list, .host .rest.small, .podium .place { animation: none; }
}

/* Katalog: Thumbnail und Datum */
.admin .cq-thumb { width: 3.2rem; height: 3.2rem; object-fit: cover; border-radius: 8px; flex: none; background: #e2dcf6; }
.admin .cq-date { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.admin .filter-box { display: grid; gap: 0.7rem; }
.admin .filter-box.off { opacity: 0.45; }
.admin .tagbtn:disabled { cursor: default; }

/* Eigene Logos: kein Aufkleber-Rahmen, keine Schatten */
.logo.custom { border-radius: 0; box-shadow: none; object-fit: contain; }

/* Logo-Verwaltung im Admin */
.admin .logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: 0.6rem; }
.admin .logo-tile { position: relative; border: 2px solid #d5cdee; border-radius: 12px; padding: 0.4rem; background: #fff; display: grid; gap: 0.25rem; text-align: center; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.admin .logo-tile img { width: 100%; height: 4.6rem; object-fit: contain; background: #f1eefb; border-radius: 8px; }
.admin .logo-tile.on { border-color: #5b3fd1; box-shadow: 0 0 0 2px #5b3fd1; cursor: default; }
.admin .logo-del { position: absolute; top: -0.4rem; right: -0.4rem; width: 1.6rem; height: 1.6rem; border: 0; border-radius: 50%; background: #c4172e; color: #fff; font-size: 0.8rem; line-height: 1; padding: 0; }

/* Frage-ID und Bilder-Import */
.admin .q-id, .modal .q-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.admin .import-check { display: grid; gap: 0.3rem; }
.admin .import-line { font-size: 0.85rem; font-weight: 700; overflow-wrap: anywhere; }
.admin .import-line.ok { color: #1e7a34; }
.admin .import-line.warn { color: #9a5b00; }
.admin .import-line.bad { color: #b0102b; }
.admin .import-line.muted { color: var(--muted); font-weight: 400; }
.admin .import-pair { font-size: 0.78rem; font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; padding: 0.1rem 0; }
.admin .import-check summary { font-size: 0.85rem; cursor: pointer; color: #5b3fd1; font-weight: 700; }

/* Vorschau einer Frage im Admin */
.modal.preview-modal { width: min(52rem, 100%); }
.admin .preview-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
.admin .preview-stage iframe { border: 0; background: var(--bg); }
.admin .preview-stage.tv { aspect-ratio: 16 / 9; }
.admin .preview-stage.tv iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; transform-origin: top left; }
.admin .preview-stage.phone { width: min(100%, 24rem); height: 40rem; max-height: 60vh; margin: 0 auto; border: 0.5rem solid #1d1442; border-radius: 1.8rem; }
.admin .preview-stage.phone iframe { width: 100%; height: 100%; }

/* Auflösung mit Überblendung: die Lösung erscheint erst nach der Blende */
.host .tile { transition: opacity 0.6s; }
.host .tiles:not(.solved) .count { visibility: hidden; }
.host .pending { visibility: hidden; }

/* Frage bearbeiten: auf breiten Bildschirmen mehr Platz, Felder in zwei Spalten */
.admin .q-fields, .admin .q-col { display: grid; gap: 0.8rem; align-content: start; }
.admin .q-toolbar { padding-bottom: 0.2rem; }
@media (min-width: 880px) {
  .admin-stage.wide { max-width: 64rem; }
  .admin-stage.wide .sticky .inner { max-width: 64rem; }
  .admin .q-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
  .admin-stage.wide .grid2:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin .q-body textarea { min-height: 6rem; }
}

/* Gemeinsame Werte für angehakte Katalogfragen */
.admin .selection-bar { display: flex; align-items: center; gap: 0.6rem; background: #e7e0fa; border-radius: 12px; padding: 0.6rem 0.8rem; font-weight: 700; }
.admin .selection-bar[hidden] { display: none; }
.admin .batch-row { display: grid; gap: 0.4rem; }
.admin .batch-inputs { display: grid; gap: 0.5rem; }
.admin .batch-row .check { font-size: 0.95rem; }
.admin .batch-row.off .batch-inputs { opacity: 0.45; pointer-events: none; }

/* Tastenkürzel in Schaltflächen und Blätter-Leiste im Katalog-Editor */
.admin .kbd { margin-left: 0.5rem; font-size: 0.72rem; font-weight: 600; opacity: 0.75; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.admin .nav-row { justify-content: space-between; }
.admin .nav-pos { text-align: center; font-weight: 700; font-size: 0.9rem; }
@media (max-width: 879px) { .admin .kbd { display: none; } }

.admin .backup-list { display: grid; gap: 0.25rem; font-size: 0.9rem; }

/* Bildangaben im Frage-Editor */
.admin .img-info { font-size: 0.78rem; font-weight: 400; color: var(--muted); display: grid; gap: 0.1rem; overflow-wrap: anywhere; }
.admin .img-info b { color: var(--fg); }
.admin .img-warn { font-size: 0.82rem; font-weight: 700; color: #9a5b00; }
.admin .img-warn:empty { display: none; }
.admin .img-info-item { display: grid; }
.admin .img-info-dims { padding-left: 0.9rem; }

/* Antworten verschieben */
.admin .drag-handle { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 0.3rem 0.2rem; cursor: grab; touch-action: none; flex: none; border-radius: 8px; }
.admin .drag-handle:hover, .admin .drag-handle:focus-visible { background: #e2dcf6; color: var(--fg); }
.admin .answer-row { transition: transform 0.15s ease; background: transparent; border-radius: 12px; }
.admin .answer-row.dragging { transition: none; position: relative; z-index: 5; background: #fff; box-shadow: 0 6px 18px rgba(29, 20, 66, 0.28); }
.admin .answer-row.dragging .drag-handle { cursor: grabbing; }

.admin .backup-list { max-height: 22rem; overflow-y: auto; gap: 0.5rem; }
.admin .backup-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid #eee9fa; }
.admin .backup-row:last-child { border: 0; }
.admin .backup-row .muted { font-size: 0.8rem; }

/* Richtige Antworten verteilen */
.admin .balance-table { display: grid; gap: 0.35rem; }
.admin .balance-row { display: grid; grid-template-columns: 2.5rem 1fr 1fr; gap: 0.6rem; align-items: center; }
.admin .balance-row.head { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.admin .balance-bar { display: flex; align-items: center; gap: 0.4rem; height: 1.4rem; }
.admin .balance-bar i { display: block; height: 100%; background: #5b3fd1; border-radius: 6px; min-width: 2px; transition: width 0.3s; }
.admin .balance-bar b { font-size: 0.85rem; min-width: 1.5rem; }
/* Auswahlleiste: Text in eigener Zeile, die Knöpfe darunter dürfen umbrechen */
.admin .selection-bar { flex-wrap: wrap; }
.admin .selection-bar .grow { flex: 1 1 100%; }
.admin .selection-bar .btn { white-space: nowrap; }

/* Fernseher: Ton-Schaltfläche für die Countdown-Musik */
.sound-btn { position: fixed; right: 1.2vw; bottom: 1.2vh; z-index: 5; border: 0; border-radius: 99px; padding: 0.3em 0.8em; font-size: 0.75em; font-weight: 700; color: #fff; background: rgba(255, 255, 255, 0.14); cursor: pointer; }
.sound-btn[hidden] { display: none; }
.sound-btn.need { background: var(--accent); color: var(--ink); animation: soundpulse 1.6s ease-in-out infinite; }
@keyframes soundpulse { 50% { transform: scale(1.06); } }

/* Countdown-Musik im Admin */
.admin .music-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid #eee9fa; }
.admin .music-pick { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; cursor: pointer; font-weight: 700; }
.admin .music-pick > span { min-width: 0; overflow-wrap: anywhere; }
.admin .music-pick input[type=radio] { width: 1.1rem; height: 1.1rem; flex: none; }
.admin input[type=range] { padding: 0; flex: 1; accent-color: #5b3fd1; }

/* Zwei Musik-Rollen: je Zeile zwei Auswahlknöpfe */
.admin .music-row { flex-wrap: wrap; }
.admin .music-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.admin .music-picks { flex: 1 1 100%; display: flex; gap: 1.2rem; padding-left: 0.1rem; }
.admin .music-picks .music-pick { flex: none; font-weight: 600; font-size: 0.9rem; }
.admin .music-vol-name { min-width: 11rem; font-size: 0.9rem; }

/* Reihenfolge bringen */
.tiles.order { grid-template-columns: 1fr; }
.order-dir { text-align: center; font-size: 1.5em; font-weight: 800; color: var(--accent); margin: 0.2em 0; }
.winners.places .winner { grid-template-columns: 2em minmax(0, 1fr) 9em 6em; }
.p-tiles.order { grid-auto-rows: auto; }
.p-tiles.order .p-tile { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 3.6rem; font-size: 1.15rem; }
.p-tile .place {
  min-width: 2.2rem; height: 2.2rem; border-radius: 99px; background: rgba(0, 0, 0, 0.28); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem;
}
.order-actions { display: flex; gap: 0.6rem; }
.order-actions .send { flex: 1; }
.btn-ghost { border: 2px solid rgba(255, 255, 255, 0.4); background: transparent; color: #fff; border-radius: 12px; padding: 0.8rem 1rem; font-weight: 700; font-size: 1rem; }
.btn-ghost:disabled { opacity: 0.4; }
.admin .badge.warn { background: #ffe3a3; color: #7a4b00; }

/* Schätzfrage auf dem Handy: deutliche Bestätigung nach dem Senden */
.sent-banner { display: flex; align-items: center; justify-content: center; gap: 0.6rem; background: var(--green); color: #fff; border-radius: 12px; padding: 0.8rem 1rem; font-size: 1.2rem; }
.sent-check { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #fff; color: var(--green); font-weight: 900; }
.play input:disabled { opacity: 0.6; }
.play form .btn-ghost { padding: 1rem; font-size: 1.3rem; }
