:root {
  --bg-0: #0b0d17;
  --bg-1: #141830;
  --bg-2: #1c2142;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --text-dim: #9aa3c7;
  --primary: #7c5cff;
  --primary-2: #b06bff;
  --accent: #23d5ab;
  --danger: #ff5c7c;
  --gold: #ffd35c;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, rgba(35, 213, 171, 0.20), transparent 55%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 55%, var(--bg-2));
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 3vw, 32px);
}

a { color: var(--primary-2); }

.app {
  width: 100%;
  max-width: 900px;
  animation: fade-in 0.4s ease;
}
.app.wide { max-width: 1100px; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------- Kopfzeile */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.3px;
}
.brand .logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.5);
  font-size: 1.3rem;
}
.brand small { display: block; font-size: 0.72rem; color: var(--text-dim); font-weight: 500; }

.room-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 2px;
}
.room-pill span:first-child { color: var(--text-dim); font-weight: 500; letter-spacing: 0; font-size: 0.8rem; }
.room-pill b { font-size: 1.15rem; color: var(--accent); }

/* ------------------------------------------------------------ Karten */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 34px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.card + .card { margin-top: 18px; }

h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-bottom: 6px; }
h2 { font-size: 1.25rem; margin-bottom: 14px; }
.subtitle { color: var(--text-dim); margin-bottom: 22px; line-height: 1.5; }

/* --------------------------------------------------------- Formulare */
label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 7px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* Kompaktere Zahlen-Eingaben in Panels */
input[type="number"] { padding: 9px 12px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.code-input { text-transform: uppercase; letter-spacing: 8px; text-align: center; font-weight: 800; font-size: 1.4rem; }

/* --------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.45);
}
.btn.primary:hover { box-shadow: 0 10px 30px rgba(124, 92, 255, 0.6); }
.btn.accent { background: linear-gradient(135deg, #17b898, var(--accent)); border: none; color: #04201a; }
.btn.danger { background: rgba(255, 92, 124, 0.15); border-color: rgba(255, 92, 124, 0.4); color: var(--danger); }
.btn.block { width: 100%; }
.btn.lg { padding: 16px 26px; font-size: 1.1rem; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* --------------------------------------------------------- Diverses */
.hint { color: var(--text-dim); font-size: 0.85rem; margin-top: 10px; line-height: 1.5; }
.error {
  background: rgba(255, 92, 124, 0.14);
  border: 1px solid rgba(255, 92, 124, 0.4);
  color: #ffbccb;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.divider { display: flex; align-items: center; gap: 14px; color: var(--text-dim); margin: 22px 0; font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.4px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.badge.ok { background: rgba(35, 213, 171, 0.16); border-color: rgba(35, 213, 171, 0.4); color: var(--accent); }
.badge.wait { background: rgba(255, 211, 92, 0.14); border-color: rgba(255, 211, 92, 0.4); color: var(--gold); }
.badge.off { opacity: 0.5; }

.question-box {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(35, 213, 171, 0.10));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 30px);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  margin-bottom: 22px;
}

/* --------------------------------------------------- Spieler-Liste */
.players {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chip.off .dot { background: var(--text-dim); }
.chip .x { cursor: pointer; color: var(--text-dim); font-weight: 800; margin-left: 2px; }
.chip .x:hover { color: var(--danger); }

/* ------------------------------------------------- Antwort-Karten */
.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.answer {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 96px;
}
.answer:hover { transform: translateY(-3px); background: var(--surface-hover); }
.answer .text { font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.answer.own { border-color: rgba(124, 92, 255, 0.55); cursor: not-allowed; opacity: 0.75; }
.answer.own:hover { transform: none; }
.answer.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.35); }
.answer.disabled { cursor: default; }
.answer.disabled:hover { transform: none; }
.answer.truth { border-color: rgba(35, 213, 171, 0.7); background: rgba(35, 213, 171, 0.12); }
.answer .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.answer .tag { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); color: var(--text-dim); }
.answer .tag.truth { background: rgba(35, 213, 171, 0.2); color: var(--accent); border-color: transparent; }
.answer .tag.author { background: rgba(124, 92, 255, 0.2); color: var(--primary-2); border-color: transparent; }
.answer .voters { display: flex; flex-wrap: wrap; gap: 6px; }
.answer .voter { font-size: 0.75rem; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.answer .corner { position: absolute; top: 12px; right: 14px; font-size: 1.1rem; }

/* --------------------------------------------------- Rangliste */
.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.score-row .rank { width: 30px; font-weight: 800; color: var(--text-dim); text-align: center; }
.score-row .name { flex: 1; font-weight: 600; }
.score-row .pts { font-weight: 800; color: var(--accent); font-size: 1.1rem; }
.score-row.top1 { background: linear-gradient(135deg, rgba(255,211,92,0.18), transparent); border-color: rgba(255,211,92,0.5); }
.score-row.top1 .rank, .score-row.top1 .pts { color: var(--gold); }

/* --------------------------------------------------- Status / Layout */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; text-align: center;
}
.stat .num { font-size: 1.6rem; font-weight: 800; }
.stat .lbl { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }

.center { text-align: center; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.hidden { display: none !important; }
.spinner {
  width: 42px; height: 42px; margin: 20px auto;
  border: 4px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 50;
  font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,92,124,0.5); color: #ffbccb; }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-wrap img { border-radius: 12px; background: #fff; padding: 10px; }
.join-link { word-break: break-all; font-size: 0.85rem; color: var(--text-dim); }

.footer-note { text-align: center; color: var(--text-dim); font-size: 0.8rem; margin-top: 26px; }

@media (max-width: 560px) {
  .answers-grid { grid-template-columns: 1fr; }
}

/* ======================================================= Admin-Layout */
.admin-app { max-width: 1440px; }

.card.compact { padding: 16px 18px; }
.section-label { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-label .hint { font-weight: 400; margin: 0; }

/* Einladungsleiste */
.invite-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px;
}
.invite-code { display: flex; align-items: center; gap: 10px; }
.invite-code .lbl { color: var(--text-dim); font-size: 0.8rem; }
.invite-code b { font-size: 1.5rem; letter-spacing: 4px; color: var(--accent); font-weight: 800; }
.invite-stats { display: flex; gap: 20px; margin-left: auto; }
.mini-stat { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.mini-stat > span { font-size: 1.25rem; font-weight: 800; }
.mini-stat small { font-size: 0.7rem; color: var(--text-dim); }
.mini-stat.inline { flex-direction: row; align-items: baseline; gap: 6px; }
.mini-stat.inline small { font-size: 0.8rem; }
.btn.sm { padding: 8px 14px; font-size: 0.9rem; }

/* 2-Spalten-Raster: großer Spielbereich + schmale Seitenleiste */
.admin-grid {
  display: grid;
  grid-template-columns: 4fr minmax(250px, 1fr);
  gap: 18px;
  align-items: start;
}
.admin-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-side { position: static; }
}

.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* Spielerliste als Spalte */
.players.col { flex-direction: column; align-items: stretch; gap: 8px; }
.players.col .chip {
  justify-content: flex-start; border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.chip .chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-status { font-size: 0.85rem; }
.chip-status.ok { filter: none; }

/* QC-Liste (editierbare Antworten) */
.qc-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.qc-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px 8px 14px;
}
.qc-author {
  flex-shrink: 0; min-width: 90px; font-weight: 700; font-size: 0.85rem;
  color: var(--primary-2);
}
.qc-input {
  flex: 1; padding: 9px 12px; font-size: 0.98rem;
  background: rgba(0,0,0,0.2);
}
.qc-saved {
  flex-shrink: 0; width: 20px; color: var(--accent); opacity: 0;
  transition: opacity 0.2s; font-weight: 800;
}
.qc-saved.show { opacity: 1; }

/* Reveal – klarere Darstellung */
.reveal-answer { gap: 12px; }
.reveal-meta { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.reveal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reveal-author { font-size: 0.92rem; color: var(--text-dim); }
.reveal-author b { color: var(--primary-2); }
.reveal-voters { display: flex; flex-direction: column; gap: 6px; }
.reveal-voters-label { font-size: 0.82rem; color: var(--text-dim); font-weight: 600; }
.reveal-voters-label.dim { opacity: 0.7; }

/* ===================================================== Avatare / Bilder */
.av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-weight: 800; color: #fff; letter-spacing: 0.5px;
  font-size: 0.9em; text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Kleiner runder Avatar (Autor/Wähler) */
.av-circle {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; border: 2px solid var(--border); background: var(--bg-2);
  display: grid; place-items: center; font-size: 1.1rem;
}
.av-circle.sm { width: 32px; height: 32px; font-size: 0.85rem; border-width: 1px; }
.av-circle.locked { color: var(--text-dim); font-weight: 800; }
.av-circle.truth-circle { border-color: var(--accent); background: rgba(35,213,171,0.18); }

/* Avatar-Auswahl auf der Beitritts-Seite */
.avatar-pick { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.join-avatar {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 2px dashed var(--border); background: rgba(0,0,0,0.2);
  display: grid; place-items: center; cursor: pointer; transition: border-color 0.2s;
}
.join-avatar:hover { border-color: var(--primary); }
.join-avatar-hint { font-size: 1.6rem; opacity: 0.6; }

/* ===================================================== Avatar-Leiste unten */
.avatar-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; align-items: flex-end; gap: 2px;
  padding: 4px 6px;
  background: linear-gradient(0deg, rgba(11,13,23,0.96), rgba(11,13,23,0.72));
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
body { padding-bottom: 200px; } /* Platz für die fixierte Leiste */
body.hearts-active { padding-bottom: 0; } /* "Der dümmste fliegt" nutzt keine Avatar-Leiste */

.av-tile {
  position: relative; flex: 1 1 0; max-width: 190px; min-width: 0;
  aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--border);
}
.av-tile.self { outline: 2px solid var(--primary); outline-offset: -2px; cursor: pointer; }
.av-tile.off { filter: grayscale(0.7) brightness(0.6); }
.av-media { position: absolute; inset: 0; }
.av-media .av-fallback { font-size: clamp(1rem, 4vw, 2.4rem); }

.av-score {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 0.85rem;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5); border: 1.5px solid rgba(255,255,255,0.25);
}
.av-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 6px 5px; font-size: 0.78rem; font-weight: 600; text-align: center;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(0deg, rgba(0,0,0,0.75), transparent);
}
.av-edit {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,0.55); font-size: 0.8rem;
}

@media (max-width: 640px) {
  body { padding-bottom: 150px; }
  .av-name { font-size: 0.68rem; padding-top: 10px; }
}

/* ===================================================== Reveal-Zeilen */
.reveal-list { display: flex; flex-direction: column; gap: 10px; }
.rev-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  transition: border-color 0.2s, background 0.2s;
}
.rev-row.truth { border-color: rgba(35,213,171,0.6); background: rgba(35,213,171,0.10); }
.rev-row.own { box-shadow: inset 3px 0 0 var(--primary); }
.rev-row.covered { opacity: 0.92; }
.rev-row.clickable { cursor: pointer; }
.rev-row.clickable:hover { background: var(--surface-hover); border-color: var(--primary); }
.rev-row.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.4); }
.rev-row.voting-row.own { cursor: not-allowed; }
.rev-left { flex-shrink: 0; }
.rev-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rev-text { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.rev-author-name { font-size: 0.82rem; color: var(--primary-2); font-weight: 600; }
.rev-author-name.dim { color: var(--text-dim); font-weight: 400; }
.rev-right {
  flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end;
  max-width: 45%;
}
.rev-novote { font-size: 0.8rem; color: var(--text-dim); }

/* =============================================== Spielauswahl (Login) */
.game-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-opt {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; gap: 4px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.game-opt:hover { background: var(--surface-hover); }
.game-opt.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,92,255,.4); }
.game-emoji { font-size: 1.7rem; }
.game-name { font-weight: 800; }
.game-desc { font-size: .76rem; color: var(--text-dim); line-height: 1.35; }
@media (max-width: 520px) { .game-choice { grid-template-columns: 1fr; } }

.badge.danger { background: rgba(255,92,124,.2); color: var(--danger); border-color: transparent; }

/* ===================================== "Der dümmste fliegt" – Board */
.hearts-view { position: fixed; inset: 0; z-index: 20; overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) 16px 14px; display: flex; flex-direction: column; background: var(--bg-0, #0b0d17); }
.hearts-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; flex: 0 0 auto; min-height: 44px; }
.hearts-top .brand { min-width: 0; }
.hearts-top .logo { width: 34px; height: 34px; font-size: 1.1rem; }
.hearts-top-info { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ht-my-hearts { font-size: 2rem; letter-spacing: 2px; }

/* Spieler-Board: Kacheln werden per JS (HeartsBoard.fit) an die Fläche angepasst. */
.hearts-board {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-template-columns: repeat(var(--ht-cols, 3), var(--ht-size, 180px));
  gap: 16px; align-content: center; justify-content: center; overflow: hidden;
}
.hearts-hint { flex: 0 0 auto; }
.hearts-board.admin { grid-template-columns: repeat(var(--ht-cols, 3), minmax(0, 185px));
  gap: 10px; align-content: start; justify-content: start; overflow: visible; min-height: 0; }

.ht-tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
  border: 2px solid var(--border); background: var(--bg-2); min-width: 0;
  transition: box-shadow .2s, border-color .2s, transform .12s;
}
.ht-media { position: absolute; inset: 0; }
.ht-media .av-img { width: 100%; height: 100%; object-fit: cover; }
.ht-media .av-fallback { width: 100%; height: 100%; font-size: clamp(1.4rem, 5vw, 3rem); }

.ht-tile.active { border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,211,92,.55), 0 0 24px rgba(255,211,92,.6); }
.ht-tile.votable { cursor: pointer; }
.ht-tile.votable:hover { transform: translateY(-2px); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,92,255,.45); }
/* Im Spieler-Voting ist die Wahl rot – auch der Hover */
#heartsBoard .ht-tile.votable:hover { border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,92,124,.55); }
/* Gewählter Spieler beim Voting: rot markiert (auch beim Hover) */
.ht-tile.voted,
.ht-tile.votable.voted:hover { border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,92,124,.9), 0 0 26px rgba(255,92,124,.6); }

/* Herzverlust-Animation: kurz größer + rot, dann zurück */
@keyframes ht-hurt {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,92,124,0); }
  35%  { transform: scale(1.14); border-color: var(--danger);
         box-shadow: 0 0 0 5px rgba(255,92,124,.9), 0 0 40px rgba(255,92,124,.95); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,92,124,0); }
}
.ht-tile.ht-hurt { animation: ht-hurt .75s ease; z-index: 8; }
.ht-tile.self { outline: 2px solid rgba(124,92,255,.5); outline-offset: -2px; }
.ht-tile.out { filter: grayscale(1) brightness(.45); }

.ht-hearts { position: absolute; top: 8px; right: 10px; display: flex; gap: 2px;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); z-index: 4; text-shadow: 0 2px 5px rgba(0,0,0,.8); }
.ht-heart { color: rgba(255,255,255,.35); }
.ht-heart.full { color: #ff5c7c; }

.ht-name { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  text-align: center; padding: 12px 6px 6px; font-size: .92rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(0deg, rgba(0,0,0,.82), transparent); }

/* Antworten als Buttons/Pills oben links */
.ht-answers { position: absolute; top: 48px; left: 8px; z-index: 3;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  max-width: calc(100% - 16px); max-height: 62%; overflow: auto; }
.ht-ans { display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  background: rgba(12,14,26,.85); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 13px; font-size: .98rem; font-weight: 600; backdrop-filter: blur(3px);
  box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.ht-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.ht-dot.ok { background: var(--accent); box-shadow: 0 0 8px rgba(35,213,171,.6); }
.ht-dot.no { background: var(--danger); box-shadow: 0 0 8px rgba(255,92,124,.6); }
.ht-ans-text { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Wer für wen gestimmt hat: unten links, größer */
.ht-voters { position: absolute; left: 8px; bottom: 36px; z-index: 5;
  display: flex; gap: 5px; flex-wrap: wrap; max-width: 82%; }
.av-circle.ht-voter { width: 46px; height: 46px; font-size: 1.1rem; border-width: 2px; }

/* Admin-Board etwas kompakter */
.hearts-board.admin .ht-hearts { font-size: 1.15rem; }
.hearts-board.admin .ht-ans { font-size: .8rem; padding: 4px 9px; gap: 5px; }
.hearts-board.admin .ht-dot { width: 11px; height: 11px; }
.hearts-board.admin .av-circle.ht-voter { width: 34px; height: 34px; font-size: .85rem; }
.hearts-board.admin .ht-name { font-size: .78rem; }
.hearts-board.admin .ht-answers { top: 34px; max-width: calc(100% - 12px); }

.ht-out-badge { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  font-weight: 800; letter-spacing: 1px; color: #fff; background: rgba(0,0,0,.35); font-size: .8rem; }

.hearts-hint { text-align: center; padding: 14px; font-size: 1.1rem; font-weight: 600; }

/* Frage-Popup */
.hearts-popup-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(0,0,0,.72); backdrop-filter: blur(5px); padding: 20px; }
.hearts-popup { background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--border); border-radius: 24px; padding: clamp(24px, 5vw, 46px);
  max-width: 640px; text-align: center; box-shadow: var(--shadow); animation: fade-in .3s ease; }
.hearts-popup-label { color: var(--gold); font-weight: 700; margin-bottom: 16px; }
.hearts-popup-text { font-size: clamp(1.4rem, 4vw, 2.3rem); font-weight: 800; line-height: 1.3; }
.hearts-popup-note { color: var(--text-dim); margin-top: 20px; }

/* ===================================== "Der dümmste fliegt" – Admin */
.hearts-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.ht-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 1000px) { .hearts-admin-grid { grid-template-columns: 1fr; } .ht-panel { position: static; max-height: none; } }

.ht-current-q { background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin: 6px 0 8px; font-weight: 600; }
.ht-current-a { font-size: .92rem; font-weight: 600; margin: 0 0 10px; color: var(--text-dim); }
.ht-current-a b { color: var(--accent); }
.ht-sep { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.ht-custom summary { cursor: pointer; }
.ht-toggle.on { outline: 2px solid var(--accent); outline-offset: -1px; }
.ht-correct-row { align-items: center; flex-wrap: wrap; }

.ht-answer-list { display: flex; flex-direction: column; gap: 6px; }
.ht-answer-row { display: flex; gap: 8px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.ht-a-name { font-weight: 700; font-size: .78rem; color: var(--primary-2); min-width: 56px; }
.ht-a-text { flex: 1; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-a-actions { display: flex; gap: 2px; }
.ht-mini { background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  font-size: .78rem; padding: 2px 5px; color: var(--text); }
.ht-mini.on-ok { background: rgba(35,213,171,.25); }
.ht-mini.on-no { background: rgba(255,92,124,.25); }

.ht-reveal-list { display: flex; flex-direction: column; gap: 6px; }
.ht-reveal-row { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.ht-rv-target { color: var(--accent); font-weight: 600; font-size: .85rem; }
.ht-tally { display: flex; flex-direction: column; gap: 4px; }
.ht-tally-row { display: flex; justify-content: space-between; padding: 5px 10px;
  background: var(--surface); border-radius: 6px; }
.ht-result { font-size: 1.2rem; font-weight: 600; }
.btn.block { width: 100%; }

/* Entscheidungs-Popup (Admin): weitere Fragerunde oder Voting */
.ht-decision-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  background: rgba(0,0,0,.72); backdrop-filter: blur(5px); padding: 20px; }
.ht-decision { background: linear-gradient(135deg, var(--bg-1), var(--bg-2)); border: 1px solid var(--border);
  border-radius: 22px; padding: clamp(24px, 4vw, 40px); max-width: 560px; text-align: center;
  box-shadow: var(--shadow); animation: fade-in .3s ease; }
.ht-decision-emoji { font-size: 2.6rem; margin-bottom: 8px; }
.ht-decision h2 { margin-bottom: 8px; }
.ht-decision p { color: var(--text-dim); margin-bottom: 22px; line-height: 1.5; }

/* Finale-Kennzeichnung */
@keyframes fin-pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.ht-finale-badge { display: inline-block; padding: 6px 14px; border-radius: 999px;
  font-weight: 800; letter-spacing: .5px; color: #241a00;
  background: linear-gradient(135deg, #ffe066, var(--gold, #f5b301));
  box-shadow: 0 4px 16px rgba(245,179,1,.45); animation: fin-pulse 1.4s ease-in-out infinite; }
.ht-finale-note { margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; line-height: 1.4;
  color: #fff4d1; background: rgba(245,179,1,.14); border: 1px solid rgba(245,179,1,.5); }
.ht-finale-note b { color: #ffd454; letter-spacing: .5px; }

/* Finalist-Kachel + Punkte-Badge auf dem Board */
.ht-tile.finalist { border-color: var(--gold, #f5b301);
  box-shadow: 0 0 0 2px rgba(245,179,1,.35), 0 8px 26px rgba(245,179,1,.22); }
.ht-finale-badge-tile { position: absolute; top: 6px; right: 6px; z-index: 6;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-weight: 800; font-size: .82rem;
  color: #241a00; background: linear-gradient(135deg, #ffe066, #f5b301);
  box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.ht-finale-badge-tile.active { animation: fin-pulse 1.2s ease-in-out infinite;
  outline: 2px solid #fff; outline-offset: 1px; }
.ht-finale-badge-tile.lead { background: linear-gradient(135deg, #b9f6ca, #00c853); color: #06301a; }
.ht-finale-badge-tile .hidden-pts { letter-spacing: 1px; }

/* Finale-Punktestand im Admin-Panel */
.ht-finale-scores { display: flex; flex-direction: column; gap: 6px; }
.ht-finale-score-row { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 10px; background: var(--bg-2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.12)); }
.ht-finale-score-row.big { font-size: 1.25rem; padding: 12px 16px; }
.ht-finale-score-row b { color: var(--gold, #f5b301); font-size: 1.1em; }
.ht-finale-score-row.lead { border-color: #00c853; background: rgba(0,200,83,.12); }
.ht-finale-score-row.lead b { color: #69f0ae; }

/* Leben-manuell-Panel */
.ht-life-panel { margin-top: 14px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,45,85,.08); border: 1px solid rgba(255,45,85,.3); }
.ht-life-panel summary { cursor: pointer; font-weight: 600; }

/* ===================================== "Wellenlänge" (Wavelength) */
.wave-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.wv-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 1000px) { .wave-admin-grid { grid-template-columns: 1fr; } .wv-panel { position: static; max-height: none; } }

/* Bühne (Kategorie + Skala) */
.wave-stage { background: rgba(0,0,0,.22); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; min-height: 200px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.wv-stage-empty { text-align: center; color: var(--text-dim); font-size: 1.1rem; line-height: 1.6; }
.wv-cat { text-align: center; }
.wv-cat-topic { font-size: 1.5rem; font-weight: 800; letter-spacing: .3px; }
.wv-clue { margin-top: 8px; font-size: 1.15rem; }
.wv-clue b { color: var(--primary-2); }

.wv-scale-labels { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--text-dim); }
.wv-lab { max-width: 45%; }
.wv-lab.high { text-align: right; }
.wv-lab b { color: var(--text); font-size: 1.05rem; }

.wv-cells { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.wv-cell { flex: 1 1 0; min-width: 40px; max-width: 72px; aspect-ratio: 1 / 1;
  display: grid; place-items: center; border-radius: 12px;
  border: 2px solid var(--border); background: var(--bg-2); color: var(--text);
  font-size: 1.2rem; font-weight: 700; cursor: default; transition: transform .1s, border-color .15s, box-shadow .15s; }
.wv-cell[disabled] { cursor: default; }
.wv-cell:not([disabled]) { cursor: pointer; }
.wv-cell:not([disabled]):hover { border-color: var(--primary); transform: translateY(-2px); }
.wv-cell.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,255,.4); background: rgba(124,92,255,.2); }
.wv-cell.is-target { border-color: var(--gold); background: rgba(255,211,92,.22);
  box-shadow: 0 0 0 3px rgba(255,211,92,.45), 0 0 18px rgba(255,211,92,.4); color: var(--gold); }
.wv-cell.is-guess { border-color: var(--accent); background: rgba(35,213,171,.18); }
.wv-cell.is-target.is-guess { box-shadow: 0 0 0 3px rgba(255,211,92,.5), inset 0 0 0 3px rgba(35,213,171,.6); }

.wv-legend { display: flex; gap: 16px; justify-content: center; font-size: .82rem; color: var(--text-dim); }
.wv-key::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.wv-key.target::before { background: var(--gold); }
.wv-key.guess::before { background: var(--accent); }

/* Admin-Panel */
.wv-team-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.wv-team { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: rgba(0,0,0,.15); }
.wv-team.full { border-color: rgba(35,213,171,.5); }
.wv-team-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wv-team-del { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .7; }
.wv-team-del:hover { opacity: 1; }
.wv-team-members { display: flex; flex-wrap: wrap; gap: 6px; }
.wv-member { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border); font-size: .9rem; }
.wv-x { background: none; border: none; color: var(--text-dim); font-weight: 800; cursor: pointer; padding: 0 0 0 2px; }
.wv-x:hover { color: var(--danger); }
.wv-slot { color: var(--text-dim); font-size: .82rem; font-style: italic; align-self: center; }
.wv-unassigned { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.wv-unassigned-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.wv-assign-opts { display: flex; flex-wrap: wrap; gap: 6px; }

.wv-secret { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; padding: 10px 12px;
  border-radius: 10px; background: rgba(255,211,92,.12); border: 1px solid rgba(255,211,92,.4); }
.wv-secret b { font-size: 1.6rem; color: var(--gold); }
.wv-secret small { color: var(--text-dim); }
.wv-reveal-text { padding: 10px 12px; border-radius: 10px; background: rgba(35,213,171,.12);
  border: 1px solid rgba(35,213,171,.4); text-align: center; }

.wv-standings { display: flex; flex-direction: column; gap: 6px; }
.wv-standing-row { display: flex; justify-content: space-between; padding: 7px 12px; border-radius: 9px;
  background: var(--bg-2); border: 1px solid var(--border); }
.wv-standing-row.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.wv-standing-row b { color: var(--gold); }

/* Spieler-Ansicht */
.wave-view { display: none; flex-direction: column; gap: 16px; padding: 16px; max-width: 820px; margin: 0 auto; width: 100%; }
body.wave-active .wave-view:not(.hidden) { display: flex; }
.wave-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wave-top-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wave-guess-bar { margin-top: 4px; }
.wave-clue-form { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.wv-clue-input-row { display: flex; gap: 8px; }
.wv-clue-input-row input { flex: 1; }
.wave-hint { text-align: center; font-size: 1.05rem; line-height: 1.6; color: var(--text-dim); }
.wave-hint b { color: var(--text); }
.wv-team-count { margin-left: auto; margin-right: 8px; font-size: .78rem; color: var(--text-dim); }

/* ===================================== "Quiz-Duell" (Jeopardy) */
.jp-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.jp-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 1050px) { .jp-admin-grid { grid-template-columns: 1fr; } .jp-panel { position: static; max-height: none; } }

/* Bühne: Spieler links/rechts + Board/Frage in der Mitte */
.jp-stage { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) minmax(120px, 200px);
  gap: 16px; align-items: start; }
@media (max-width: 820px) {
  .jp-stage { grid-template-columns: 1fr; }
  .jp-side { display: flex; flex-wrap: wrap; gap: 8px; }
  .jp-side .jp-team-col { flex: 1 1 140px; }
}
.jp-center { min-width: 0; }
.jp-board-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.jp-round { font-size: 1.3rem; font-weight: 800; }

/* Team-Spalten (Spieler mit Farbrahmen) */
.jp-side { display: flex; flex-direction: column; gap: 14px; }
.jp-team-col { border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.2); overflow: hidden;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 30%, transparent); }
.jp-team-col.is-current { box-shadow: 0 0 0 3px var(--tc), 0 0 20px color-mix(in srgb, var(--tc) 45%, transparent); }
.jp-team-col-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; color: #fff;
  font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.jp-team-col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-team-col-score { font-size: 1.1rem; }
.jp-team-col-badges { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px; }
.jp-team-col-badges:empty { display: none; }
.jp-badge { font-size: .68rem; padding: 2px 7px; border-radius: 999px; font-weight: 700; margin-top: 6px; }
.jp-badge.turn { background: var(--accent); color: #04201a; }
.jp-badge.coffee { background: #6b4b2f; color: #ffe; }
.jp-team-players { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.jp-player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.jp-player-ava { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 3px solid var(--tc);
  flex: 0 0 auto; background: var(--bg-2); }
.jp-player-ava .av-img { width: 100%; height: 100%; object-fit: cover; }
.jp-player-ava .av-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; }
.jp-player-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jp-empty { color: var(--text-dim); font-size: .8rem; }

/* Board */
.jp-board-inner { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; }
.jp-col { display: flex; flex-direction: column; gap: 8px; }
.jp-cat { text-align: center; font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .3px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; padding: 10px 6px;
  border-radius: 10px; min-height: 52px; display: flex; align-items: center; justify-content: center; }
.jp-tile { aspect-ratio: 16 / 10; border-radius: 10px; border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 0%, #232a52, #161a34); color: var(--gold);
  font-size: clamp(1rem, 2.4vw, 1.7rem); font-weight: 800; cursor: default; transition: transform .1s, box-shadow .15s;
  text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.jp-tile.pickable { cursor: pointer; }
.jp-tile.pickable:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 24px rgba(124,92,255,.4);
  border-color: var(--primary); }
.jp-tile.done { background: rgba(255,255,255,.03); color: transparent; border-style: dashed; cursor: default; }

/* Offene Frage */
.jp-qcard { background: linear-gradient(160deg, #1b2145, #12162e); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px; box-shadow: 0 12px 40px rgba(0,0,0,.4); animation: jp-pop .25s ease; }
@keyframes jp-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.jp-qcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.jp-qcat { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--primary-2); }
.jp-qval { font-size: 1.6rem; font-weight: 800; color: var(--gold); }
.jp-qtext { font-size: clamp(1.2rem, 3vw, 2rem); font-weight: 700; line-height: 1.4; text-align: center; margin: 10px 0 18px; }
.jp-answer { text-align: center; color: var(--accent); margin-bottom: 14px; font-size: 1.05rem; }
.jp-qmeta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jp-answering { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--tc) 20%, transparent); border: 1px solid var(--tc); }
.jp-answering-dot { width: 12px; height: 12px; border-radius: 50%; }
.jp-steal-tag { font-size: .72rem; background: var(--danger); color: #fff; padding: 2px 8px; border-radius: 999px; }
.jp-joker-tags { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.jp-joker-tag { font-size: .78rem; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.jp-joker-tag.aon { background: rgba(255,211,92,.2); color: var(--gold); border: 1px solid rgba(255,211,92,.5); }
.jp-joker-tag.norisk { background: rgba(35,213,171,.18); color: var(--accent); border: 1px solid rgba(35,213,171,.5); }
.jp-stage-note { text-align: center; margin-top: 14px; font-weight: 700; }
.jp-stage-note.buzz { color: var(--danger); animation: jp-flash 1s ease-in-out infinite; }
@keyframes jp-flash { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.jp-outcome { text-align: center; margin-top: 16px; font-size: 1.2rem; font-weight: 800; padding: 10px; border-radius: 12px; }
.jp-outcome.correct { background: rgba(35,213,171,.18); color: var(--accent); animation: jp-pop .3s ease; }
.jp-outcome.wrong { background: rgba(255,92,124,.16); color: var(--danger); animation: jp-shake .4s ease; }
@keyframes jp-shake { 0%,100%{transform:translateX(0);} 20%{transform:translateX(-8px);} 40%{transform:translateX(8px);} 60%{transform:translateX(-5px);} 80%{transform:translateX(5px);} }

/* Timer */
.jp-timer { display: inline-flex; align-items: baseline; gap: 3px; font-weight: 800; font-size: 1.8rem;
  padding: 6px 16px; border-radius: 12px; background: rgba(0,0,0,.3); border: 2px solid var(--border); min-width: 70px; justify-content: center; }
.jp-timer.running { border-color: var(--accent); }
.jp-timer.low { border-color: var(--gold); color: var(--gold); animation: jp-flash .6s ease-in-out infinite; }
.jp-timer.zero { border-color: var(--danger); color: var(--danger); }
.jp-timer small { font-size: .8rem; color: var(--text-dim); }

/* Scoreboard unter dem Board */
.jp-scoreboard { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.jp-score-chip { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border); font-weight: 700;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tc) 25%, transparent); }
.jp-score-chip.current { box-shadow: inset 0 0 0 2px var(--tc), 0 4px 14px color-mix(in srgb, var(--tc) 35%, transparent); }
.jp-score-rank { font-size: .72rem; color: var(--text-dim); }
.jp-score-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.jp-score-val { color: var(--gold); font-size: 1.15rem; }

/* Spieler-Ansicht */
.jeopardy-view { display: none; flex-direction: column; gap: 14px; padding: 14px clamp(14px, 3vw, 40px);
  max-width: 1800px; margin: 0 auto; width: 100%; min-height: 100dvh; box-sizing: border-box; }
body.jeopardy-active .jeopardy-view:not(.hidden) { display: flex; }

/* Spieler-Ansicht: Bühne + Board füllen den verfügbaren Platz. */
.jeopardy-view .jp-stage { flex: 1 1 auto; min-height: 0; align-items: stretch;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) minmax(150px, 240px); }
.jeopardy-view .jp-center { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.jeopardy-view .jp-board { flex: 1 1 auto; min-height: 0; display: flex; }
.jeopardy-view .jp-board .jp-board-inner { flex: 1 1 auto; height: 100%; gap: clamp(8px, 1vw, 16px); }
.jeopardy-view .jp-board .jp-col { height: 100%; }
.jeopardy-view .jp-board .jp-cat { flex: 0 0 auto; font-size: clamp(.8rem, 1.4vw, 1.1rem); min-height: 48px; }
.jeopardy-view .jp-board .jp-tile { aspect-ratio: auto; height: auto; flex: 1 1 0; min-height: 46px;
  font-size: clamp(1.2rem, 3.4vw, 2.6rem); }
.jeopardy-view .jp-board .jp-lobby-msg { flex: 1 1 auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
/* Größere Spieler-Kacheln an den Seiten */
.jeopardy-view .jp-player-ava { width: clamp(40px, 3.4vw, 60px); height: clamp(40px, 3.4vw, 60px); }
.jeopardy-view .jp-question { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 0; }
.jeopardy-view .jp-question .jp-qcard { width: 100%; padding: clamp(28px, 4vw, 60px); }
.jeopardy-view .jp-qtext { font-size: clamp(1.6rem, 3.6vw, 3rem); }
.jeopardy-view .jp-qcat { font-size: clamp(.9rem, 1.4vw, 1.2rem); }
.jeopardy-view .jp-qval { font-size: clamp(1.6rem, 2.6vw, 2.4rem); }

/* Auf schmalen Screens: stapeln statt füllen (sonst wird das Board zu klein). */
@media (max-width: 820px) {
  .jeopardy-view { min-height: 0; }
  .jeopardy-view .jp-stage { display: flex; flex-direction: column; grid-template-columns: none; flex: 0 0 auto; }
  .jeopardy-view .jp-board { display: block; }
  .jeopardy-view .jp-board .jp-col { height: auto; }
  .jeopardy-view .jp-board .jp-tile { aspect-ratio: 16 / 10; height: auto; flex: none; font-size: 1.4rem; }
  .jeopardy-view .jp-question { display: block; }
}
.jp-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jp-top-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jp-lobby-msg { text-align: center; padding: 40px 16px; font-size: 1.15rem; line-height: 1.7; color: var(--text-dim);
  background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 16px; }
.jp-winner-msg { font-size: 1.8rem; color: var(--gold); animation: jp-pop .4s ease; }
.jp-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.jp-actions .jp-buzz { animation: jp-pulse-buzz 1s ease-in-out infinite; font-size: 1.3rem; }
@keyframes jp-pulse-buzz { 0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255,92,124,.5);} 50%{transform:scale(1.05);box-shadow:0 0 0 12px rgba(255,92,124,0);} }
.jp-hint { text-align: center; font-size: 1.05rem; color: var(--text-dim); line-height: 1.6; }
.jp-hint b { color: var(--text); }

/* Admin-Panel */
.jp-config { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
  background: rgba(0,0,0,.18); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.jp-config label { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 600;
  color: var(--text-dim); margin: 0; }
.jp-config input { width: 100%; }
.jp-team-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.jp-team-row { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; background: rgba(0,0,0,.15);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tc) 25%, transparent); }
.jp-team-row-head { display: flex; align-items: center; gap: 8px; }
.jp-team-row-head b { flex: 1; }
.jp-color-dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }
.jp-team-row-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.jp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border); font-size: .85rem; }
.jp-unassigned { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.jp-pending { padding: 12px; border-radius: 12px; background: rgba(255,211,92,.12); border: 1px solid rgba(255,211,92,.4); margin-bottom: 12px; }
.jp-turn-info { padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.2); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; }
.jp-answer-box { padding: 10px 12px; border-radius: 10px; background: rgba(35,213,171,.12); border: 1px solid rgba(35,213,171,.4); }
.jp-joker-reqs:empty { display: none; }
.jp-joker-req { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 10px; background: rgba(124,92,255,.12); border: 1px solid rgba(124,92,255,.4); margin-bottom: 6px; }
.jp-jok-team { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.jp-jok-cells { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.jp-jok-adjust { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; }
.jp-jok-adjust .btn.sm { padding: 2px 8px; }
.jp-stats { display: flex; flex-direction: column; gap: 6px; }
.jp-stat-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tc) 30%, transparent); }
.jp-stat-row b { margin-left: auto; color: var(--gold); }
.jp-stat-row small { color: var(--text-dim); }

/* ===================================== "Der dümmste fliegt" – Verbesserungen */
/* Timer (Spieler-Header) */
.ht-timer { display: inline-flex; align-items: baseline; gap: 2px; font-weight: 800; font-size: 1.5rem;
  padding: 3px 12px; border-radius: 999px; background: rgba(0,0,0,.3); border: 2px solid var(--border); min-width: 56px; justify-content: center; }
.ht-timer small { font-size: .7rem; color: var(--text-dim); }
.ht-timer.running { border-color: var(--accent); color: var(--accent); }
.ht-timer.low { border-color: var(--gold); color: var(--gold); animation: jp-flash .6s ease-in-out infinite; }
.ht-timer.zero { border-color: var(--danger); color: var(--danger); }

/* Frage-Banner für alle */
.ht-question-banner { flex: 0 0 auto; border-radius: 14px; padding: 12px 18px; margin-bottom: 12px; text-align: center;
  border: 1px solid var(--border); transition: opacity .2s, box-shadow .2s; }
.ht-question-banner.dim { background: rgba(255,255,255,.04); opacity: .62; }
.ht-question-banner.mine { background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(176,107,255,.22));
  border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary), 0 8px 26px rgba(124,92,255,.35);
  animation: ht-mine-pulse 1.6s ease-in-out infinite; }
@keyframes ht-mine-pulse { 0%,100% { box-shadow: 0 0 0 2px var(--primary), 0 8px 26px rgba(124,92,255,.3); } 50% { box-shadow: 0 0 0 3px var(--primary-2), 0 10px 34px rgba(176,107,255,.55); } }
.ht-qb-who { font-size: .82rem; font-weight: 700; color: var(--primary-2); margin-bottom: 4px; }
.ht-question-banner.dim .ht-qb-who { color: var(--text-dim); }
.ht-qb-text { font-size: clamp(1.05rem, 2.6vw, 1.5rem); font-weight: 700; line-height: 1.35; }

/* Immun-Badge (perfekte Spieler) */
.ht-tile.immune { box-shadow: 0 0 0 2px rgba(35,213,171,.55) inset; }
.ht-immune-badge { position: absolute; top: 6px; left: 6px; z-index: 6; font-size: .72rem; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; background: rgba(35,213,171,.9); color: #04201a; box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* Schätzfrage (Spieler) */
.ht-estimate { flex: 0 0 auto; background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 12px; text-align: center; }
.ht-estimate-q { font-size: 1.15rem; margin-bottom: 12px; line-height: 1.4; }
.ht-estimate-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ht-estimate-form input { max-width: 200px; }
.ht-estimate-result { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.ht-est-answer { font-size: 1.1rem; margin-bottom: 6px; }
.ht-est-answer b, .ht-estimate-q b { color: var(--gold); }
.ht-est-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 6px 12px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); }
.ht-est-row small { color: var(--text-dim); }
.ht-est-row.loser { border-color: var(--danger); background: rgba(255,92,124,.14); }

/* Finale-Auflösung (Frage für Frage) */
.ht-finale-reveal { text-align: left; max-width: 620px; margin: 0 auto; }
.ht-fr-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 700; }
.ht-fr-head .ht-fr-name { color: var(--primary-2); }
.ht-fr-head .ht-fr-score b { color: var(--gold); font-size: 1.3rem; }
.ht-fr-head .ht-fr-name:last-child { text-align: right; }
.ht-fr-log { display: flex; flex-direction: column; gap: 5px; }
.ht-fr-row { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--border); animation: jp-pop .25s ease; }
.ht-fr-q { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-fr-mark { text-align: center; font-weight: 800; }
.ht-fr-mark.ok { color: var(--accent); }
.ht-fr-mark.no { color: var(--danger); }
.ht-fr-foot { text-align: center; margin-top: 10px; font-weight: 700; }
.ht-fr-foot.win { color: var(--gold); font-size: 1.2rem; animation: jp-pop .3s ease; }
.ht-fr-foot.tie { color: var(--gold); }

/* Admin: Timer-Panel */
.ht-timer-panel { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.2); border: 1px solid var(--border); }
.ht-timer-panel.running { border-color: var(--accent); }
.ht-timer-panel.low { border-color: var(--gold); }
.ht-timer-panel.zero { border-color: var(--danger); }
.ht-timer-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ht-timer-display { font-size: 1.8rem; font-weight: 800; }
.ht-timer-display small { font-size: .8rem; color: var(--text-dim); }
.ht-timer-config { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--text-dim); }
.ht-timer-config input[type=number] { width: 72px; }
.ht-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Admin: Finale-Reveal-Log + Schätzfrage */
.ht-fr-log-admin { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.ht-fr-log-admin .ht-fr-head { grid-template-columns: 1fr auto 1fr; }
.ht-est-admin { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.ht-est-live { line-height: 1.5; }
.ht-est-live b { color: var(--gold); }

/* ===================================== Quiz-Duell – UI-Feinschliff */
/* Ausgewählte, noch nicht bestätigte Kachel (für alle sichtbar) */
.jp-tile { position: relative; }
.jp-tile.pending { border-color: var(--tc, var(--primary)); color: #fff;
  box-shadow: 0 0 0 3px var(--tc, var(--primary)), 0 0 26px color-mix(in srgb, var(--tc, #7c5cff) 55%, transparent);
  animation: jp-pending-pulse 1.1s ease-in-out infinite; z-index: 2; }
@keyframes jp-pending-pulse {
  0%,100% { box-shadow: 0 0 0 3px var(--tc, #7c5cff), 0 0 18px color-mix(in srgb, var(--tc,#7c5cff) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px var(--tc, #7c5cff), 0 0 34px color-mix(in srgb, var(--tc,#7c5cff) 75%, transparent); }
}
.jp-tile-pick { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%);
  font-size: clamp(.6rem, 1vw, .82rem); font-weight: 800; color: #fff; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 8px rgba(0,0,0,.45); }

/* Buzzer-Tasten-Hinweis */
.jp-buzz-key { font-size: .7rem; font-weight: 700; opacity: .9; border: 1px solid rgba(255,255,255,.55);
  border-radius: 6px; padding: 1px 7px; margin-left: 8px; vertical-align: middle; }

/* Größere Spieler-Kacheln an den Seiten */
.jeopardy-view .jp-player-ava { width: clamp(54px, 4.4vw, 82px); height: clamp(54px, 4.4vw, 82px); border-width: 4px; }
.jeopardy-view .jp-player-name { font-size: clamp(.95rem, 1.3vw, 1.15rem); }
.jeopardy-view .jp-team-col-head { padding: 8px 12px; font-size: clamp(1rem, 1.3vw, 1.2rem); }
.jeopardy-view .jp-team-col-score { font-size: clamp(1.1rem, 1.5vw, 1.45rem); }
.jeopardy-view .jp-team-players { gap: 10px; padding: 12px; }

/* Größeres Scoreboard unten */
.jeopardy-view .jp-scoreboard { gap: 14px; }
.jeopardy-view .jp-score-chip { padding: 12px 22px; font-size: clamp(1rem, 1.4vw, 1.25rem); border-radius: 16px; gap: 12px; }
.jeopardy-view .jp-score-dot { width: 16px; height: 16px; }
.jeopardy-view .jp-score-rank { font-size: .9rem; }
.jeopardy-view .jp-score-val { font-size: clamp(1.4rem, 2vw, 1.9rem); }
