/* =========================================================
   Familien-Quiz – Spielshow-Design
   ========================================================= */
:root {
  --bg: #080a24;
  --bg-2: #1c0f4d;
  --card: rgba(255, 255, 255, 0.065);
  --card-2: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f3ff;
  --muted: #aca8d8;
  --gold: #ffc83d;
  --gold-2: #ffe592;
  --gold-deep: #e09a00;
  --red: #ff3b4e;
  --red-deep: #b3132a;
  --green: #2fd27a;
  --blue: #4da3ff;
  --pink: #ff4fd8;
  --violet: #8b5cff;
  --radius: 18px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -12%, rgba(139, 92, 255, 0.5), transparent 70%),
    radial-gradient(ellipse 70% 45% at 100% 105%, rgba(255, 79, 216, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(77, 163, 255, 0.14), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.hidden { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--gold); }
button { font-family: inherit; }

.screen {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

/* ---------- Bühnen-Effekte im Hintergrund ---------- */
.fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx .beam {
  position: absolute; top: -12vh; width: 70vmax; height: 130vh;
  transform-origin: 50% 0;
  clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
  opacity: 0.55;
}
.fx .beam.l {
  left: calc(8% - 35vmax);
  background: linear-gradient(180deg, rgba(139, 92, 255, 0.42), rgba(139, 92, 255, 0) 72%);
  animation: swing-l 11s ease-in-out infinite alternate;
}
.fx .beam.r {
  right: calc(8% - 35vmax);
  background: linear-gradient(180deg, rgba(255, 79, 216, 0.32), rgba(255, 79, 216, 0) 72%);
  animation: swing-r 13s ease-in-out infinite alternate;
}
@keyframes swing-l { from { transform: rotate(-26deg); } to { transform: rotate(-4deg); } }
@keyframes swing-r { from { transform: rotate(24deg); } to { transform: rotate(3deg); } }
.fx .stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 28% 72%, #fff, transparent),
    radial-gradient(1.8px 1.8px at 47% 34%, #ffe592, transparent),
    radial-gradient(1.2px 1.2px at 63% 82%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 78% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 88% 58%, #ffd1f5, transparent),
    radial-gradient(1.4px 1.4px at 6% 54%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 38% 92%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 94% 88%, #ffe592, transparent),
    radial-gradient(1.2px 1.2px at 55% 8%, #fff, transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.9; } }

/* ---------- Logo mit Lichterkranz ---------- */
.logo { text-align: center; margin: 26px 0 26px; }
.mark {
  position: relative;
  display: inline-grid; place-items: center;
  width: 82px; height: 82px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ff9aa4, var(--red) 45%, var(--red-deep));
  box-shadow: 0 6px 0 #7d0b1c, 0 0 46px rgba(255, 59, 78, 0.55);
  font-size: 36px; margin-bottom: 16px;
}
.mark::after {
  content: ""; position: absolute; inset: -13px; border-radius: 50%;
  background: repeating-conic-gradient(var(--gold-2) 0 5deg, transparent 5deg 20deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  filter: drop-shadow(0 0 4px var(--gold));
  animation: spin 12s linear infinite;
}
.logo h1, .brand {
  font-weight: 900; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 15%, var(--gold-2) 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px rgba(255, 200, 61, 0.35));
}
.logo h1 { font-size: clamp(32px, 8vw, 52px); }
.logo p { color: var(--muted); margin: 10px 0 0; font-size: 16px; }

/* ---------- Karten & Formulare ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 12px; font-weight: 800;
}

.form { max-width: 440px; margin: 0 auto; display: grid; gap: 16px; }
label, .field-label { display: grid; gap: 7px; font-weight: 700; font-size: 14px; color: var(--muted); }
.field { display: grid; gap: 8px; }
input {
  font: inherit; font-size: 18px; color: var(--text);
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); border-radius: 13px;
  padding: 13px 14px; width: 100%; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 61, 0.25); }
input.code { text-transform: uppercase; letter-spacing: 0.4em; font-weight: 900; font-size: 26px; text-align: center; padding-left: calc(14px + 0.4em); }
input.num { width: 76px; text-align: center; padding: 8px; font-size: 16px; }

.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.av-opt {
  aspect-ratio: 1; border-radius: 13px; border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.28); font-size: 26px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  touch-action: manipulation;
}
.av-opt:hover { background: rgba(255, 255, 255, 0.1); }
.av-opt.sel {
  border-color: var(--gold); background: rgba(255, 200, 61, 0.2);
  transform: scale(1.08); box-shadow: 0 0 18px rgba(255, 200, 61, 0.35);
}
.av-opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.err { color: #ff9aa4; min-height: 1.2em; margin: 0; font-size: 14px; font-weight: 600; }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 22px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 800; font-size: 16px;
  border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 16px; cursor: pointer; color: var(--text);
  background: var(--card-2);
  transition: transform 0.07s, filter 0.15s, background 0.15s, box-shadow 0.07s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  touch-action: manipulation; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.38; cursor: default; filter: none; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #ffe08a, var(--gold) 45%, var(--gold-deep)); color: #2a1a00;
  border-color: transparent; box-shadow: 0 5px 0 #8a5d00, 0 10px 24px rgba(255, 200, 61, 0.25);
}
.btn.primary:active { box-shadow: 0 3px 0 #8a5d00; }
.btn.go {
  background: linear-gradient(180deg, #6ef0ac, #2fd27a 45%, #149a51); color: #03240f;
  border-color: transparent; box-shadow: 0 5px 0 #0c6b38, 0 10px 26px rgba(47, 210, 122, 0.28);
}
.btn.go:active { box-shadow: 0 3px 0 #0c6b38; }
.btn.big { font-size: 19px; padding: 16px 20px; border-radius: 15px; white-space: normal; text-align: center; }
.btn.small { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.icon { width: 38px; height: 38px; padding: 0; font-size: 20px; border-radius: 11px; }
.btn.ok { background: rgba(47, 210, 122, 0.18); border-color: rgba(47, 210, 122, 0.55); color: #a6f7cb; }
.btn.no { background: rgba(255, 59, 78, 0.16); border-color: rgba(255, 59, 78, 0.55); color: #ffb3bb; }

/* ---------- Avatare ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-weight: 900; color: #14102e; font-size: 16px; line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.12);
}
.avatar.emoji { font-size: 21px; }
.avatar.lg { width: 50px; height: 50px; font-size: 22px; }
.avatar.lg.emoji { font-size: 29px; }

/* ---------- Spieler: Kopfzeile ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .me { display: flex; align-items: center; gap: 12px; min-width: 0; }
.me-text { display: grid; min-width: 0; }
.me-name { font-weight: 900; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomtag { color: var(--muted); font-size: 13px; }
.roomtag b { color: var(--text); letter-spacing: 0.15em; }
.scorebox {
  position: relative;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); border-radius: 15px;
  padding: 6px 16px; text-align: center; flex: none; min-width: 76px;
}
.scorebox b { display: block; font-size: 28px; color: var(--gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.scorebox small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.scorebox.pop b { animation: pop 0.6s cubic-bezier(.2, 1.8, .4, 1); }
.float {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  font-weight: 900; font-size: 20px; pointer-events: none; white-space: nowrap;
  animation: float-up 1.4s ease-out forwards;
}
.float.plus { color: var(--green); text-shadow: 0 0 12px rgba(47, 210, 122, 0.6); }
.float.minus { color: #ff8d98; }
@keyframes float-up { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -46px); } }

/* ---------- Der Buzzer ---------- */
.status {
  text-align: center; font-size: 21px; font-weight: 900; min-height: 2.9em;
  margin: 16px 0 4px; display: grid; place-content: center;
}
.status.swap { animation: swap-in 0.35s ease-out; }
.status small { display: block; font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 4px; }
@keyframes swap-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stage { overflow-x: clip; }
.buzzer-wrap {
  --size: min(70vw, 46vh, 300px);
  position: relative; display: grid; place-items: center;
  padding: 34px 0;
}
/* Effekte liegen absolut hinter dem Knopf und beeinflussen das Layout nicht */
.buzzer-wrap .halo, .buzzer-wrap .rays, .buzzer-wrap .shock { position: absolute; inset: 0; margin: auto; }
.buzzer-wrap .halo {
  width: calc(var(--size) + 44px); height: calc(var(--size) + 44px); border-radius: 50%;
  background: conic-gradient(from var(--spin), var(--red), var(--gold), var(--pink), var(--violet), var(--blue), var(--red));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  filter: drop-shadow(0 0 10px rgba(255, 79, 216, 0.6));
  opacity: 0; transition: opacity 0.3s;
  animation: spin-var 3s linear infinite;
}
.buzzer-wrap .rays {
  width: calc(var(--size) * 1.9); height: calc(var(--size) * 1.9); border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 214, 102, 0.3) 0 7deg, transparent 7deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 25%, transparent 100%);
  mask: radial-gradient(closest-side, #000 25%, transparent 100%);
  opacity: 0; transition: opacity 0.4s;
  animation: spin 18s linear infinite;
}
.buzzer-wrap.ready .halo { opacity: 1; }
.buzzer-wrap.first .rays { opacity: 1; }

.buzzer {
  position: relative;
  width: var(--size); height: var(--size); border-radius: 50%;
  border: 10px solid #23264d; outline: none; cursor: pointer; padding: 0;
  font: 900 calc(var(--size) * 0.18)/1 var(--font); letter-spacing: 0.02em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform 0.07s, box-shadow 0.07s, background 0.2s, color 0.2s;
  background: radial-gradient(circle at 35% 28%, #6b6f99, #3a3d66 55%, #24264a);
  box-shadow: 0 14px 0 #14152e, 0 22px 44px rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.55);
}
.buzzer::before {
  content: ""; position: absolute; left: 22%; right: 22%; top: 6%; height: 30%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 95%);
  pointer-events: none;
}
.buzzer:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.buzzer:disabled { cursor: default; }
.buzzer > span { position: relative; }
.buzzer .sub { display: block; font-size: 15px; font-weight: 800; letter-spacing: 0.06em; margin-top: 8px; opacity: 0.9; text-transform: uppercase; }

.buzzer.ready {
  color: #fff;
  background: radial-gradient(circle at 35% 28%, #ffa3ac, var(--red) 45%, var(--red-deep));
  box-shadow: 0 14px 0 #6d0a19, 0 22px 44px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 59, 78, 0.45);
  animation: breathe 1.4s ease-in-out infinite;
}
.buzzer.ready:active, .buzzer.pressed {
  transform: translateY(10px) scale(0.99);
  box-shadow: 0 4px 0 #6d0a19, 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 80px rgba(255, 59, 78, 0.6);
  animation: none;
}
.buzzer.first {
  color: #3a2500;
  background: radial-gradient(circle at 35% 28%, #fff5c6, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 6px 0 #8a5d00, 0 0 70px rgba(255, 200, 61, 0.7);
  transform: translateY(8px);
  text-shadow: none;
  animation: celebrate 0.7s cubic-bezier(.2, 1.6, .4, 1);
}
.buzzer.later {
  color: #fff;
  background: radial-gradient(circle at 35% 28%, #b5d9ff, var(--blue) 50%, #1f5fb0);
  box-shadow: 0 6px 0 #133c70, 0 0 44px rgba(77, 163, 255, 0.45);
  transform: translateY(8px);
}
.buzzer.blocked {
  color: rgba(255, 255, 255, 0.6);
  background: radial-gradient(circle at 35% 28%, #5d3243, #3a1c28 60%, #261219);
  box-shadow: 0 14px 0 #1a0b10, 0 22px 44px rgba(0, 0, 0, 0.5);
}
.buzzer-wrap.shake .buzzer { animation: shake 0.5s; }
@keyframes breathe { 50% { transform: scale(1.025); } }
@keyframes celebrate { 0% { transform: translateY(8px) scale(0.9); } 60% { transform: translateY(8px) scale(1.06); } 100% { transform: translateY(8px) scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

.shock {
  width: var(--size); height: var(--size); border-radius: 50%;
  border: 6px solid var(--gold-2); pointer-events: none;
  animation: shock 0.7s ease-out forwards;
}
@keyframes shock { from { transform: scale(1); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }

/* ---------- Ranglisten ---------- */
.board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.board li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}
.board li.me { box-shadow: inset 0 0 0 2px var(--gold); background: rgba(255, 200, 61, 0.08); }
.board li.leader { background: linear-gradient(90deg, rgba(255, 200, 61, 0.16), rgba(0, 0, 0, 0.2) 70%); }
.board li.offline { opacity: 0.45; }
.board .pos { width: 24px; text-align: center; color: var(--muted); font-weight: 900; font-variant-numeric: tabular-nums; flex: none; }
.board .name { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .crown { margin-left: 4px; }
.board .pts { font-weight: 900; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--gold); flex: none; }
.board .pts.pop { animation: pop 0.6s cubic-bezier(.2, 1.8, .4, 1); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 8px var(--green); }
.offline .dot { background: #666; box-shadow: none; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); color: #fff; } 100% { transform: scale(1); } }

.player-board { width: 100%; max-width: 480px; margin: 0 auto; }
.leave-row { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

/* Spieler im Querformat (Handy gedreht): Buzzer links, Punkte rechts */
@media (orientation: landscape) and (max-height: 560px) {
  .game:not(.hidden) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 40%);
    grid-template-areas: "top top" "stage side"; gap: 0 20px; align-items: start;
  }
  .game .topbar { grid-area: top; }
  .game .stage { grid-area: stage; }
  .game .side { grid-area: side; padding-top: 14px; }
  .game.screen { padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .game .status { margin: 4px 0 0; min-height: 2.3em; font-size: 17px; }
  .game .status small { font-size: 13px; margin-top: 2px; }
  .game .buzzer-wrap { --size: min(calc(100vh - 190px), 36vw, 250px); padding: 18px 0 22px; }
  .game .buzzer { border-width: 7px; }
  .logo { margin: 10px 0 14px; }
}

/* ---------- Schätzrunde auf dem Spieler-Handy ---------- */
.game.mode-est .buzzer-wrap { display: none; }
.est { max-width: 480px; margin: 8px auto 26px; display: grid; gap: 14px; }
.est .card { text-align: center; }
.est-form { display: grid; gap: 12px; }
.est-label { display: block; font-size: 13px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); }
.est-input {
  font-size: 34px; font-weight: 900; text-align: center; letter-spacing: 0.02em;
  padding: 14px 12px; border-radius: 16px; border: 2px solid rgba(255, 200, 61, 0.45);
  background: rgba(0, 0, 0, 0.38); font-variant-numeric: tabular-nums;
}
.est-input::placeholder { color: rgba(255, 255, 255, 0.3); font-weight: 700; font-size: 22px; letter-spacing: 0; }
.est-note { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.est-enter, .est-confirm { display: grid; gap: 12px; }
.est-confirm { animation: swap-in 0.3s ease-out; }
.est-q { font-size: 18px; font-weight: 900; }
.est-confirm .est-mine { color: var(--gold); text-shadow: 0 0 22px rgba(255, 200, 61, 0.4); }
.est-locked { display: grid; gap: 4px; justify-items: center; padding: 22px 18px;
  background: linear-gradient(180deg, rgba(47, 210, 122, 0.16), rgba(47, 210, 122, 0.05)); border-color: rgba(47, 210, 122, 0.45); }
.est-mine, .est-target { font-size: clamp(34px, 11vw, 48px); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.est-lock { color: #9af3c2; font-weight: 800; font-size: 14px; }
.est-result { display: grid; gap: 4px; }
.est-target { color: var(--gold); text-shadow: 0 0 24px rgba(255, 200, 61, 0.45); margin-bottom: 10px; animation: pop-in 0.5s cubic-bezier(.2, 1.6, .4, 1); }
.est-board { text-align: left; }
.est-val { display: grid; justify-items: end; flex: none; font-variant-numeric: tabular-nums; }
.est-val b { font-size: 17px; }
.est-val small { color: var(--muted); font-size: 12px; font-weight: 700; }
.leader .est-val small { color: var(--gold-2); }

/* ---------- Konfetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i {
  position: absolute; top: -24px; border-radius: 2px;
  animation-name: fall; animation-timing-function: cubic-bezier(.25, .6, .5, 1); animation-fill-mode: forwards;
}
@keyframes fall { to { transform: translate(var(--dx), 112vh) rotate(var(--r)); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: fit-content;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(160%);
  background: #26215e; border: 1px solid var(--line); color: var(--text);
  padding: 14px 22px; border-radius: 15px; font-weight: 900; font-size: 17px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); z-index: 90;
  transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1), visibility 0.35s;
  max-width: calc(100% - 32px); text-align: center; visibility: hidden;
}
.toast.show { transform: none; visibility: visible; }
.toast:empty { display: none; }
.toast.good { background: linear-gradient(180deg, #17844b, #0f5a33); border-color: var(--green); }
.toast.bad { background: linear-gradient(180deg, #8d1a2e, #6a1222); border-color: var(--red); }

.conn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 95;
  background: #b3132a; color: #fff; text-align: center; font-weight: 800; font-size: 14px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px;
}

/* =========================================================
   Moderator
   ========================================================= */
.host { max-width: 1240px; }
.host-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.host-head .title { display: flex; align-items: center; gap: 14px; }
.host-head .mark { width: 48px; height: 48px; font-size: 22px; margin: 0; box-shadow: 0 4px 0 #7d0b1c, 0 0 26px rgba(255, 59, 78, 0.5); }
.host-head .mark::after { inset: -9px; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.host-head h1 { font-size: 26px; }
.host-head .subtitle { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

.roomcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 26px; padding: 16px 20px; }
.roomcode { display: flex; gap: 6px; margin-top: 6px; }
.roomcode .tile {
  display: grid; place-items: center;
  width: 50px; height: 60px; border-radius: 11px;
  font-size: 36px; font-weight: 900; color: #2a1a00;
  background: linear-gradient(180deg, #fff3c4, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 5px 0 #8a5d00, 0 0 22px rgba(255, 200, 61, 0.35);
  animation: tile-in 0.5s cubic-bezier(.2, 1.6, .4, 1) backwards;
}
.roomcode .tile:nth-child(2) { animation-delay: 0.07s; }
.roomcode .tile:nth-child(3) { animation-delay: 0.14s; }
.roomcode .tile:nth-child(4) { animation-delay: 0.21s; }
@keyframes tile-in { from { transform: rotateX(90deg); opacity: 0; } }
.roomcard .link { min-width: 0; }
.roomcard .link code {
  display: block; font-size: 14px; color: var(--text); background: rgba(0, 0, 0, 0.32);
  padding: 9px 11px; border-radius: 10px; word-break: break-all; margin: 6px 0 9px;
}
.roomcard .link .row { display: flex; gap: 8px; flex-wrap: wrap; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.13em; font-weight: 800; }

.qr { text-align: center; }
.qr .qrbox {
  display: block; width: 128px; height: 128px; padding: 7px; border-radius: 13px; background: #fff;
  border: 0; box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.55), 0 10px 26px rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
}
.qr .qrbox svg { display: block; width: 100%; height: 100%; }
.qr .label { display: block; margin-top: 9px; }

.qr-overlay {
  position: fixed; inset: 0; z-index: 85; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: rgba(5, 6, 24, 0.9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out; padding: 24px; text-align: center;
}
.qr-overlay .qrbig { width: min(70vmin, 520px); aspect-ratio: 1; padding: 18px; background: #fff; border-radius: 22px; box-shadow: 0 0 0 8px var(--gold), 0 0 80px rgba(255, 200, 61, 0.5); }
.qr-overlay .qrbig svg { display: block; width: 100%; height: 100%; }
.qr-overlay .bigcode { font-size: clamp(28px, 6vw, 56px); font-weight: 900; letter-spacing: 0.25em; color: var(--gold); padding-left: 0.25em; }
.qr-overlay p { margin: 0; color: var(--muted); font-weight: 700; }

.host-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
.host-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .host-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}
.stack { display: grid; gap: 18px; }

.control-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.control-row .btn.big { flex: 1 1 220px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 900; letter-spacing: 0.09em; font-size: 13px; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px;
}
.pill.open { background: rgba(47, 210, 122, 0.18); color: #9af3c2; border: 1px solid rgba(47, 210, 122, 0.6); box-shadow: 0 0 18px rgba(47, 210, 122, 0.25); }
.pill.closed { background: rgba(255, 255, 255, 0.08); color: var(--muted); border: 1px solid var(--line); }
.pill.open::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.round { color: var(--muted); font-weight: 800; }

.settings { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.settings label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

.buzzlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.buzzlist li {
  position: relative;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 15px; background: rgba(0, 0, 0, 0.24);
  animation: slide-in 0.3s ease-out;
}
.buzzlist li.first {
  background:
    radial-gradient(ellipse at 0% 50%, rgba(255, 200, 61, 0.35), transparent 60%),
    linear-gradient(90deg, rgba(255, 200, 61, 0.2), rgba(255, 200, 61, 0.05));
  padding: 16px; border-radius: 17px;
  animation: pop-in 0.45s cubic-bezier(.2, 1.6, .4, 1);
}
.buzzlist li.first::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: conic-gradient(from var(--spin), var(--gold), rgba(255, 200, 61, 0.1) 25%, var(--gold-2) 50%, rgba(255, 200, 61, 0.1) 75%, var(--gold));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-var 2.4s linear infinite; pointer-events: none;
}
.buzzlist li.first .who { font-size: 26px; }
.buzzlist .rank { font-weight: 900; font-size: 20px; width: 34px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.buzzlist li.first .rank { color: var(--gold); font-size: 30px; text-shadow: 0 0 16px rgba(255, 200, 61, 0.6); }
.buzzlist .who { flex: 1; min-width: 120px; font-weight: 900; font-size: 18px; overflow-wrap: anywhere; }
.buzzlist .time { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.buzzlist .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.buzzlist .badge { font-weight: 900; color: #9af3c2; }
.buzzlist li.empty, .board li.empty {
  display: block; color: var(--muted); text-align: center; padding: 26px 12px;
  background: transparent; border: 2px dashed var(--line); border-radius: 15px; font-weight: 600; animation: none;
}
@keyframes pop-in { from { transform: scale(0.9); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }
@keyframes slide-in { from { transform: translateY(-6px); opacity: 0; } }

.blockedline { margin-top: 10px; color: #ffb3bb; font-size: 14px; font-weight: 600; }

.players li { gap: 8px; }
.players .pts { cursor: pointer; min-width: 44px; text-align: right; border-radius: 8px; padding: 2px 6px; }
.players .pts:hover { background: rgba(255, 255, 255, 0.08); }
.players .btn.icon { width: 34px; height: 34px; font-size: 18px; }
.players .kick { opacity: 0.5; }
.players .kick:hover { opacity: 1; }
.players-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.players-head h2 { margin: 0; }

.joinlock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.joinlock-info { color: var(--muted); font-size: 13px; font-weight: 600; }
.joinlock.locked .joinlock-info { color: var(--gold); }

.keys { color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.9; }
kbd {
  font: 800 12px var(--font); background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--text);
}

.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }

/* ---------- Fragenkarte im Moderator-Pult ---------- */
.qbox { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.q-kat {
  font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase;
  color: #2a1a00; background: linear-gradient(180deg, var(--gold-2), var(--gold)); padding: 4px 11px; border-radius: 999px;
}
.q-nr { color: var(--muted); font-weight: 800; font-size: 13px; }
.q-est {
  font-size: 12px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: linear-gradient(180deg, #ff7ad9, var(--pink)); padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 79, 216, 0.35);
}
.q-badge { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 999px; }
.q-badge:empty { display: none; }
.q-badge.live { background: rgba(47, 210, 122, 0.18); color: #9af3c2; border: 1px solid rgba(47, 210, 122, 0.5); }
.q-badge.done { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.q-nav { margin-left: auto; display: flex; gap: 6px; }
.q-nav .btn.icon { width: 36px; height: 36px; font-size: 24px; line-height: 1; padding-bottom: 3px; }
.q-text { font-size: clamp(20px, 2.3vw, 27px); font-weight: 800; line-height: 1.3; margin: 0 0 14px; overflow-wrap: anywhere; }
.q-answer {
  position: relative; display: grid; gap: 3px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
  background: rgba(47, 210, 122, 0.1); border: 1px dashed rgba(47, 210, 122, 0.55); border-radius: 14px;
  padding: 11px 14px;
}
.q-answer:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.q-answer-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #9af3c2; font-weight: 900; }
.q-answer-text { font-size: 21px; font-weight: 900; overflow-wrap: anywhere; }
.q-info { font-size: 14px; color: var(--muted); font-weight: 600; }
.q-info:empty { display: none; }
.q-reveal { display: none; }
.q-answer.concealed .q-answer-text, .q-answer.concealed .q-info { filter: blur(10px); user-select: none; }
.q-answer.concealed .q-reveal {
  display: flex; align-items: center; justify-content: center; gap: 8px; position: absolute; inset: 0; border-radius: inherit;
  font-weight: 900; font-size: 15px; background: rgba(8, 10, 36, 0.3);
}
.q-hint { margin: 12px 0 0; font-size: 14px; color: var(--gold-2); font-weight: 700; }
.q-missing { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.q-progress { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }

select {
  font: inherit; font-size: 15px; color: var(--text); cursor: pointer;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  max-width: 100%;
}
select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 61, 0.25); }
select option { color: #111; background: #fff; }
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; margin: 0; accent-color: var(--gold); flex: none; cursor: pointer; }
.settings label.check { cursor: pointer; }

/* ---------- Schätzrunde im Moderator-Pult ---------- */
.q-answer.locked { cursor: not-allowed; border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.04); }
.q-answer.locked .q-reveal { color: var(--muted); }
.est-progress { display: grid; gap: 8px; margin-bottom: 12px; }
.est-progress b { font-size: 18px; }
.est-bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.est-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width 0.4s ease; }
.est-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.est-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.25); color: var(--muted); font-weight: 800; font-size: 14px;
}
.est-chip .avatar { width: 26px; height: 26px; font-size: 15px; }
.est-chip.done { background: rgba(47, 210, 122, 0.16); color: #b9f7d4; }
.est-steps { display: grid; gap: 10px; }
.est-results + .est-steps { margin-top: 14px; }
.est-wait { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.est-step { width: 100%; }
.est-target-host { display: grid; gap: 2px; margin-bottom: 12px; }
.est-target-host b { font-size: 34px; font-weight: 900; color: var(--gold); text-shadow: 0 0 24px rgba(255, 200, 61, 0.4); font-variant-numeric: tabular-nums; }
.est-results li.est-hidden { background: rgba(255, 255, 255, 0.04); border: 2px dashed rgba(255, 255, 255, 0.14); color: var(--muted); }
.est-board li.est-hidden { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); }
.est-board li.est-hidden .name { color: var(--muted); font-weight: 700; }
.est-results li.est-hidden .who { color: var(--muted); font-weight: 700; font-size: 15px; }
.est-q-avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, 0.08); font-weight: 900; color: var(--muted);
}
.est-results li.newest, .est-board li.newest { animation: reveal-in 0.55s cubic-bezier(.2, 1.5, .4, 1); box-shadow: 0 0 0 2px rgba(255, 200, 61, 0.55); }
@keyframes reveal-in { from { transform: rotateX(80deg) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }
.est-host-val { font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }
.est-results li.first .est-host-val { font-size: 26px; color: var(--gold-2); }

/* ---------- Animationen ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-var { to { --spin: 360deg; } }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 720px) {
  .roomcard { grid-template-columns: auto minmax(0, 1fr); }
  .roomcard .qr { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; text-align: left; }
  .roomcard .qr .label { margin: 0; }
  .qr .qrbox { width: 112px; height: 112px; flex: none; }
}
@media (max-width: 520px) {
  .roomcard { grid-template-columns: minmax(0, 1fr); }
  .roomcode .tile { width: 44px; height: 54px; font-size: 31px; }
  .buzzlist li.first .who { font-size: 21px; }
  .card { padding: 14px; }
  .host-head h1 { font-size: 22px; }
  .players .btn.icon { width: 32px; height: 32px; }
  .players li { gap: 6px; padding: 7px 8px; }
  .players .dot { display: none; }
  .players .pos { width: 18px; }
  .players .avatar { width: 30px; height: 30px; font-size: 17px; }
  .players .pts { min-width: 30px; padding: 2px 3px; text-align: center; }
  .players .kick { width: 26px; }
  .btn.big { font-size: 17px; padding: 14px 16px; }
  .control-row .btn.big { flex-basis: 100%; }
  .buzzlist li.first .acts { width: 100%; }
  .buzzlist li.first .acts .btn { flex: 1; }
}
@media (max-width: 360px) {
  .avatar-grid { gap: 5px; }
  .av-opt { font-size: 22px; border-radius: 10px; }
  .me-name { font-size: 19px; }
  .players .avatar { display: none; }
}

/* ---------- Großer Bildschirm / Beamer ---------- */
@media (min-width: 1700px) {
  .host { zoom: 1.2; }
}

/* ---------- Weniger Bewegung, wenn im System so eingestellt ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .fx .beam { display: none; }
}
