/* Das Große Du-Musst-Quiz – Stil: Quizshow der 80er
   Studio-Dunkelblau mit Scheinwerfer und Strahlen, Chrom-Schriftzug,
   Pink (A), Cyan (B), Gelb (Mehrheit, Glühbirnen), dicke weiße Rahmen, harte Schatten. */

@font-face { font-family: 'Bungee'; font-weight: 400; font-display: swap; src: url(/fonts/bungee-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: italic; font-display: swap; src: url(/fonts/barlow-condensed-latin-800-italic.woff2) format('woff2'); }

:root {
  --bg: #140a33;
  --ray: #1b0e47;
  --panel: #23135e;
  --panel-2: #2f1b7c;
  --ink: #090418;
  --text: #ffffff;
  --muted: #b8a8ff;
  --a: #ff3d8b;
  --b: #19c6ff;
  --gold: #ffd23a;
  --hot: #ff5a2e;
  --radius: 16px;
  --display: 'Bungee', 'Arial Black', sans-serif;
  --body: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
/* Studio: Scheinwerfer oben, Strahlen von unten */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 50% -8%, rgba(255, 61, 139, 0.32), transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 110%, rgba(25, 198, 255, 0.18), transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 118%, var(--ray) 0 6deg, var(--bg) 6deg 12deg);
}
[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.95rem; }
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Chrom-Schriftzug */
.chrome {
  font-family: var(--display); font-weight: 400; line-height: 0.95;
  background: linear-gradient(180deg, #ffffff 0%, #e4f6ff 38%, #8a7dff 52%, #ffd9ec 68%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0.06em 0.06em 0 var(--a)) drop-shadow(0.05em 0.05em 0 var(--ink));
}
.chrome .light {
  display: block; font-family: var(--body); font-weight: 800; font-style: italic;
  font-size: 0.34em; letter-spacing: 0.32em; text-transform: uppercase; margin-bottom: 0.25em;
  background: none; -webkit-text-fill-color: var(--gold); color: var(--gold);
}

.btn {
  background: var(--gold); color: var(--ink);
  padding: 0.85em 1.5em; border-radius: 999px;
  font-family: var(--display); font-size: 1rem; letter-spacing: 0.03em;
  box-shadow: 0 0.3em 0 var(--ink);
}
.btn:active { transform: translateY(0.15em); box-shadow: 0 0.15em 0 var(--ink); }
.btn.ghost { background: var(--panel-2); color: var(--text); }

input[type=text], input[type=password] {
  width: 100%; padding: 0.8em 1em; border-radius: 12px;
  border: 3px solid var(--panel-2); background: var(--ink);
  font-size: 1.2rem; font-weight: 600; outline: none;
}
input:focus { border-color: var(--gold); }
input::placeholder { color: #6f63a8; }

.error { color: var(--gold); min-height: 1.4em; margin: 0.3em 0; font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45em; justify-content: center; }
.chip {
  background: var(--panel-2); border: 2px solid rgba(255, 255, 255, 0.22);
  padding: 0.3em 0.8em; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.4em; font-weight: 800;
}
.chip.offline { opacity: 0.45; }
.chip .x { background: none; color: var(--muted); padding: 0 0.1em; font-size: 1.1em; line-height: 1; }
.chip .x:hover { color: var(--hot); }

/* ---------- Profilbilder ---------- */

.av {
  border-radius: 50%; object-fit: cover; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 400; color: #fff; line-height: 1;
  border: 2px solid #fff;
}
.chip .av { width: 1.7em; height: 1.7em; margin: -0.2em 0 -0.2em -0.5em; }
.chip .av.ini { font-size: 0.7em; width: 2.4em; height: 2.4em; }
.av.xl { width: 116px; height: 116px; border-width: 4px; box-shadow: 6px 6px 0 var(--ink); }
.av.xl.ini { font-size: 40px; }
.av.xl.empty { background: var(--panel); border: 4px dashed var(--gold); color: var(--gold); font-size: 18px; box-shadow: none; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.rank .av { width: 1.6em; height: 1.6em; vertical-align: middle; margin-right: 0.5em; }
.rank .av.ini { font-size: 0.65em; width: 2.46em; height: 2.46em; }

/* ---------- Teilnehmer (Handy) ---------- */

.player {
  min-height: 100dvh; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 16px; max-width: 520px; margin: 0 auto;
}
.player h1 { font-size: 2.1rem; margin: 0; }
.player form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.player .counter { color: var(--muted); font-size: 0.95rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; }
.player .wyr { font-family: var(--display); font-size: 1.25rem; color: var(--gold); margin: 0; text-shadow: 3px 3px 0 var(--ink); }

.choices { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.choice {
  width: 100%; min-height: 124px; padding: 16px 18px; border-radius: 20px;
  font-family: var(--body); font-weight: 800; font-size: 1.55rem; line-height: 1.05;
  text-transform: uppercase; color: #fff; text-shadow: 2px 2px 0 rgba(9, 4, 24, 0.45);
  border: 4px solid #fff; box-shadow: 0 7px 0 var(--ink);
  transition: transform 0.1s, opacity 0.2s, box-shadow 0.1s;
}
.choice.a { background: var(--a); }
.choice.b { background: var(--b); }
.choice:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--ink); }
.choices.has-vote .choice:not(.selected) { opacity: 0.35; }
.choice.selected { transform: translateY(4px); box-shadow: 0 3px 0 var(--ink); outline: 4px dotted var(--gold); outline-offset: -12px; }
.choice .tag {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; background: #fff; font-family: var(--display); font-size: 0.95rem;
  text-shadow: none; margin: 0 auto 8px;
}
.choice.a .tag { color: var(--a); }
.choice.b .tag { color: var(--b); }

.verdict { width: 100%; padding: 26px 16px; border-radius: 22px; border: 4px solid #fff; box-shadow: 0 8px 0 var(--ink); }
.verdict.lost { background: var(--hot); }
.verdict.won { background: var(--gold); color: var(--ink); }
.verdict h2 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1; margin: 0 0 10px; }
.verdict div { font-size: 1.2rem; }
.score { font-family: var(--display); font-size: 1.4rem; margin: 0; }

.rank { width: 100%; list-style: none; padding: 0; margin: 0; text-align: left; }
.rank li {
  display: flex; justify-content: space-between; align-items: center; padding: 0.55em 0.9em;
  border-radius: 12px; background: var(--panel); margin-bottom: 6px; font-weight: 800; font-size: 1.1rem;
}
.rank li b { font-family: var(--display); font-weight: 400; }
.rank li:first-child { background: var(--gold); color: var(--ink); }
.rank li.me { outline: 3px solid var(--b); outline-offset: -3px; }

.player.has-bar { padding-top: 76px; }
.me-bar {
  position: fixed; top: 12px; left: 12px; z-index: 5; cursor: pointer;
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: var(--panel); border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 4px 14px 4px 4px; border-radius: 999px;
}
.me-bar span { font-weight: 800; font-size: 1.05rem; line-height: 1.05; }
.me-bar small { display: block; font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.av.sm { width: 38px; height: 38px; }
.av.sm.ini { font-size: 14px; }

/* ---------- Präsentation (Beamer) ---------- */

.host { height: 100vh; padding: 3vh 4vw; display: flex; flex-direction: column; }
.host .slide { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3vh; min-height: 0; }
.host .top {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 1.3vw; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
}
.host .wyr { font-family: var(--display); font-size: 2.6vw; color: var(--gold); text-align: center; margin: 0; text-shadow: 0.2vw 0.2vw 0 var(--ink); }
.host .title { font-size: 6vw; text-align: center; margin: 0; }

.lobby { display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: center; }
.lobby .qr { background: #fff; padding: 1vw; border-radius: 18px; box-shadow: 0 0 0 0.5vw var(--gold), 0.8vw 0.8vw 0 0.5vw var(--ink); }
.lobby .qr img { display: block; width: 24vw; max-width: 44vh; height: auto; }
.lobby .label { font-size: 1.5vw; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.lobby .url { font-weight: 800; font-size: 2.6vw; color: var(--b); word-break: break-all; text-shadow: 0.15vw 0.15vw 0 var(--ink); }
.lobby .chips { justify-content: flex-start; font-size: 1.5vw; }
.lobby h2 { font-family: var(--display); font-weight: 400; font-size: 1.8vw; margin: 2.5vh 0 1.2vh; color: var(--gold); }
.lobby .hint { font-size: 1.3vw; color: var(--muted); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; }
.card {
  border-radius: 24px; padding: 3vh 2vw; color: #fff; min-height: 34vh;
  display: flex; flex-direction: column; justify-content: center; gap: 2vh; position: relative;
  border: 0.4vw solid #fff; box-shadow: 0.7vw 0.7vw 0 var(--ink);
}
.card.a { background: var(--a); }
.card.b { background: var(--b); }
.card .label {
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-start;
  width: 3.4vw; height: 3.4vw; border-radius: 50%; background: #fff;
  font-family: var(--display); font-size: 1.6vw;
}
.card.a .label { color: var(--a); }
.card.b .label { color: var(--b); }
.card .text { font-size: 3.6vw; font-weight: 800; line-height: 1.02; text-transform: uppercase; text-shadow: 0.15vw 0.15vw 0 rgba(9, 4, 24, 0.4); }

.status { text-align: center; font-size: 1.8vw; font-weight: 800; }
.status b { font-family: var(--display); font-weight: 400; }
.status .done { font-family: var(--display); font-weight: 400; color: var(--gold); }
.status .chips { margin-top: 1.2vh; font-size: 1.4vw; }

/* Auflösung: Säulendiagramm */
.reveal { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2.5vh; }
.chart { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; }
.col { display: flex; flex-direction: column; gap: 1.8vh; min-height: 0; }
.col.a { --c: var(--a); } .col.b { --c: var(--b); }
.col .area { flex: 1; min-height: 0; display: grid; grid-template-columns: 9vw 1fr; gap: 1.5vw; }
.track { position: relative; background: rgba(255, 255, 255, 0.06); border-radius: 16px 16px 0 0; border-bottom: 0.3vw solid #fff; }
.bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc((100% - 8vh) * var(--p, 0));
  background: var(--c); border: 0.3vw solid #fff; border-bottom: 0; border-radius: 14px 14px 0 0;
  outline: 0.3vw dotted rgba(255, 255, 255, 0.75); outline-offset: -1vw;
  transition: box-shadow 0.4s;
}
.num {
  position: absolute; left: 0; right: 0; text-align: center;
  bottom: calc((100% - 8vh) * var(--p, 0));
  font-family: var(--display); font-size: 4.2vw; line-height: 8vh; text-shadow: 0.25vw 0.25vw 0 var(--ink);
}
.voters { display: flex; flex-wrap: wrap-reverse; gap: 1vh 0.6vw; align-content: flex-start; min-height: 0; overflow: hidden; }
.voter {
  width: 5vw; text-align: center; font-size: 1vw; font-weight: 800;
  opacity: 0; transform: scale(0.4); transition: opacity 0.25s, transform 0.25s;
}
.voter.in { opacity: 1; transform: none; }
.voter .av { width: 4vw; height: 4vw; display: flex; margin: 0 auto 0.4vh; border-width: 0.22vw; }
.voter .av.ini { font-size: 1.4vw; }
.voter span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer {
  position: relative; background: var(--panel); border-radius: 18px;
  padding: 1.6vh 7vw 1.6vh 1.2vw; font-size: 2.1vw; font-weight: 800; line-height: 1.05; text-transform: uppercase;
  border: 0.3vw solid rgba(255, 255, 255, 0.25); transition: border-color 0.4s, box-shadow 0.4s;
}
.answer .label {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 0.15em;
  width: 2.4vw; height: 2.4vw; border-radius: 50%; background: var(--c); color: #fff;
  font-family: var(--display); font-size: 1.1vw; margin-right: 0.8vw;
}
.badge {
  position: absolute; right: -1.2vw; top: 50%; width: 7.5vw; height: 7.5vw; margin-top: -3.75vw;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--gold); color: var(--ink); font-family: var(--display); font-size: 0.95vw; line-height: 1.05;
  transform: rotate(12deg);
  clip-path: polygon(50% 0%, 61% 18%, 82% 10%, 80% 32%, 100% 40%, 85% 55%, 96% 76%, 74% 78%, 68% 100%, 50% 87%, 32% 100%, 26% 78%, 4% 76%, 15% 55%, 0% 40%, 20% 32%, 18% 10%, 39% 18%);
}
.reveal .late { opacity: 0; transition: opacity 0.5s; }
.reveal.done .late { opacity: 1; }
.reveal.done .col.winner .answer { border-color: var(--gold); box-shadow: 0 0 0 0.25vw var(--gold); }
.reveal.done .col.winner .bar { box-shadow: 0 0 0 0.35vw var(--gold), 0 0 4vw rgba(255, 210, 58, 0.55); }

/* Trinkliste: Leuchtschild mit Glühbirnen-Rand */
.drink {
  background: var(--gold); color: var(--ink); border-radius: 2.2vw; padding: 1.8vh 2.5vw; text-align: center;
  outline: 0.35vw dotted #fff; outline-offset: -1vw; box-shadow: 0.6vw 0.6vw 0 var(--ink);
}
.drink h3 { margin: 0 0 1vh; font-family: var(--display); font-weight: 400; font-size: 2vw; }
.drink .chips { font-size: 1.5vw; }
.drink .chip { background: var(--ink); color: #fff; border-color: var(--ink); }
.drink .note { margin-top: 1vh; font-size: 1.2vw; font-weight: 800; }

.end { display: grid; grid-template-columns: 1fr 1.3fr; gap: 3vw; min-height: 0; flex: 1; }
.end h2 { font-family: var(--display); font-weight: 400; font-size: 1.7vw; color: var(--gold); margin: 0 0 1.5vh; }
.end .rank {
  font-size: 1.4vw; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start;
}
.end .rank li { margin: 0; padding: 0.45em 0.8em; }
.end .overview { overflow: auto; font-size: 1.25vw; }
.end .overview div { background: var(--panel); border-radius: 12px; padding: 0.6em 0.9em; margin-bottom: 6px; }
.end .overview .w { color: var(--gold); font-weight: 800; }

.controls {
  position: fixed; bottom: 12px; right: 12px; display: flex; gap: 8px;
  opacity: 0.25; transition: opacity 0.2s; font-size: 12px;
}
.controls:hover { opacity: 1; }
.controls .btn { padding: 0.6em 1.1em; font-size: 12px; }

.edit-btn {
  background: none; color: var(--muted); margin-left: 1.2em; font: inherit; letter-spacing: 0.1em;
  opacity: 0.5; transition: opacity 0.2s;
}
.edit-btn:hover { opacity: 1; }

.editor { position: fixed; inset: 0; background: var(--bg); overflow: auto; z-index: 10; }
.editor-inner { max-width: 900px; margin: 0 auto; padding: 24px 16px 0; }
.editor h2 { margin: 0 0 12px; font-family: var(--display); font-weight: 400; color: var(--gold); }
.editor input[type=text] { font-size: 1.05rem; padding: 0.55em 0.8em; }
.ed-row { display: grid; grid-template-columns: 2em 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.ed-row .ed-a { border-left: 6px solid var(--a); }
.ed-row .ed-b { border-left: 6px solid var(--b); }
.ed-row .x { background: none; color: var(--muted); font-size: 1.4rem; padding: 0 0.3em; }
.ed-row .x:hover { color: var(--hot); }
.editor-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 18px; background: var(--bg); }
.editor-bar label.btn { cursor: pointer; }
@media (max-width: 600px) {
  .ed-row { grid-template-columns: 1.5em 1fr auto; }
  .ed-row .ed-b { grid-column: 2; }
}

.login { max-width: 360px; margin: 20vh auto; display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 0 16px; }
.login h1 { font-size: 2rem; }
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--hot); padding: 0.7em 1.2em; border-radius: 12px; font-weight: 800;
}

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

/* ---------- Reaktionen & Kommentare ---------- */

/* Handy: Leiste unten */
.player.has-react { padding-bottom: 150px; }
.react-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(9, 4, 24, 0.88); border-top: 2px solid rgba(255, 255, 255, 0.12);
  display: flex; flex-direction: column; gap: 8px;
}
.react-row, .comment-form { width: 100%; max-width: 520px; margin: 0 auto; display: flex; gap: 8px; }
.react-row { justify-content: space-between; }
.react-row button {
  width: 48px; height: 48px; border-radius: 50%; font-size: 24px; line-height: 1;
  background: var(--panel); border: 2px solid rgba(255, 255, 255, 0.18);
}
.react-row button.pop { animation: pop 0.3s; }
@keyframes pop { 50% { transform: scale(1.4); } }
.comment-form input { font-size: 1rem; padding: 0.55em 1em; border-radius: 999px; border-width: 2px; }
.comment-form .btn { padding: 0.5em 1.1em; font-size: 0.85rem; box-shadow: none; flex: none; }

/* Beamer: Overlay über allem, klickt nicht mit */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.fx-emoji {
  position: absolute; bottom: -6vw; font-size: 3.6vw; line-height: 1;
  animation: float-up 3.4s ease-out forwards;
}
@keyframes float-up {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  10%  { opacity: 1; transform: translate(0, -6vh) scale(1.1); }
  35%  { transform: translate(var(--w1), -30vh) scale(1); }
  65%  { transform: translate(var(--w2), -55vh) scale(1); opacity: 1; }
  100% { transform: translate(var(--w1), -82vh) scale(0.9); opacity: 0; }
}
.fx-comments {
  position: absolute; left: 2vw; bottom: 9vh; width: 34vw;
  display: flex; flex-direction: column; gap: 0.8vh; align-items: flex-start;
}
.fx-comment {
  display: flex; align-items: center; gap: 0.7vw; max-width: 100%;
  background: rgba(9, 4, 24, 0.82); border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 0.5vw 1.1vw 0.5vw 0.5vw; border-radius: 2vw; font-size: 1.25vw; line-height: 1.15;
  animation: comment-in 0.3s ease-out;
  transition: opacity 0.6s, transform 0.6s;
}
.fx-comment.out { opacity: 0; transform: translateY(-1vh); }
.fx-comment .av { width: 2.6vw; height: 2.6vw; border-width: 0.15vw; }
.fx-comment .av.ini { font-size: 1vw; }
.fx-comment b { color: var(--gold); margin-right: 0.4em; }
@keyframes comment-in { from { opacity: 0; transform: translateX(-2vw); } }
