:root {
  --bg: #14111f;
  --bg2: #1d1930;
  --flaeche: #262040;
  --linie: #3a3260;
  --text: #f4efff;
  --leise: #a79fc9;
  --akzent: #ffc145;
  --ok: #3ddc97;
  --falsch: #ff5d73;
  --radius: 16px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, #3b1f5e 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #10334a 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
h1, h2 { font-family: var(--display); margin: 0; }
h2 { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--leise); font-weight: 700; margin-bottom: 10px; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--team); flex: none; display: inline-block; }
.code { font-family: var(--display); letter-spacing: .12em; color: var(--akzent); }

/* ---------- Spielleiter ---------- */
.leiter #app {
  max-width: 560px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.kopf { text-align: center; padding: 18px 0 4px; }
.logo { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; padding-bottom: .08em;
  background: linear-gradient(90deg, #ff5d73, #ffc145 45%, #3ddc97); -webkit-background-clip: text; background-clip: text; color: transparent; }
.unter { color: var(--leise); margin: 8px 0 0; }
.block { background: color-mix(in srgb, var(--bg2) 85%, transparent); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.reihe { display: flex; gap: 16px; justify-content: space-between; }

.teamliste { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.teamliste li { display: flex; align-items: center; gap: 10px; background: var(--flaeche); border-radius: 12px; padding: 6px 6px 6px 14px; border-left: 4px solid var(--team); }
.teamliste input { flex: 1; min-width: 0; background: none; border: 0; padding: 8px 0; font-weight: 600; font-size: 17px; outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 999px; padding: 10px 14px; font-weight: 600; }
.chip.an { background: var(--akzent); color: #1a1405; border-color: var(--akzent); }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { font-family: var(--display); font-size: 26px; min-width: 2ch; text-align: center; }
.stepper button, .mini { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); font-size: 18px; flex: none; }
.mini { width: 34px; height: 34px; font-size: 15px; }

.schalter { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; user-select: none; }
.schalter input { position: absolute; opacity: 0; pointer-events: none; }
.schalter span { width: 48px; height: 28px; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--linie); position: relative; flex: none; transition: background .2s; }
.schalter span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--leise); transition: transform .2s, background .2s; }
.schalter input:checked + span { background: var(--ok); border-color: var(--ok); }
.schalter input:checked + span::after { transform: translateX(20px); background: #0d2a1d; }
.schalter input:focus-visible + span { outline: 2px solid var(--akzent); outline-offset: 2px; }

.haupt, .zweit { border-radius: 14px; padding: 12px 16px; font-weight: 700; border: 1px solid var(--linie); background: var(--flaeche); }
.haupt { background: var(--akzent); color: #1a1405; border-color: var(--akzent); }
.gross { padding: 18px; font-size: 19px; font-family: var(--display); border-radius: 18px; width: 100%; box-shadow: 0 8px 30px -10px color-mix(in srgb, var(--akzent) 70%, transparent); }
.klein { padding: 8px 14px; font-size: 14px; }
.link { background: none; border: 0; padding: 4px; color: var(--leise); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.gefahr { color: var(--falsch); }

.tv-box { display: flex; gap: 16px; align-items: center; }
.tv-box p { margin: 0 0 4px; color: var(--leise); }
.tv-url { color: var(--text) !important; font-weight: 600; }
.tv-url .code { font-size: 30px; }
#qr { width: 110px; flex: none; background: #fff; border-radius: 10px; padding: 4px; }
#qr svg { display: block; width: 100%; height: auto; }
.regeln { color: var(--leise); padding: 0 4px; }
.regeln summary { cursor: pointer; font-weight: 600; color: var(--text); }
.regeln li { margin: 6px 0; }

/* Spielkopf */
.spielkopf { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--team) 32%, var(--bg2)), var(--bg2)); border: 1px solid color-mix(in srgb, var(--team) 50%, var(--linie)); }
.wer { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wer b { font-family: var(--display); font-size: 24px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--leise); }
.stand { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; gap: 2px; }
.stand span:last-child { color: var(--akzent); }

.menue { background: var(--bg2); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.menue-tv { color: var(--leise); }
.menue-tv .code { font-size: 20px; }
.menue-zweifel { margin: 0; color: var(--leise); font-size: 14px; }
.token-edit { display: grid; gap: 6px; }
.token-edit div { display: flex; align-items: center; gap: 8px; }
.token-edit .punkt { margin-right: 2px; }
.token-edit div > .mini:first-of-type { margin-left: auto; }

/* Abspielen */
.spieler { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.play { --fortschritt: 0; position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 30% 25%, #ffd77a, var(--akzent) 55%, #e09a12);
  color: #1a1405; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 16px 50px -12px #ffc14599; transition: transform .1s; }
.play:active { transform: scale(.97); }
.play-ring { position: absolute; inset: -8px; border-radius: 50%;
  background: conic-gradient(var(--text) calc(var(--fortschritt) * 360deg), #ffffff1a 0);
  -webkit-mask: radial-gradient(circle, transparent 89px, #000 90px); mask: radial-gradient(circle, transparent 89px, #000 90px); }
.play-icon { width: 0; height: 0; border-left: 34px solid currentColor; border-top: 21px solid transparent; border-bottom: 21px solid transparent; margin-left: 10px; }
.play.laeuft .play-icon { width: 30px; height: 38px; border: 0; margin: 0; background: linear-gradient(90deg, currentColor 36%, transparent 36% 64%, currentColor 64%); }
.play-text { font-family: var(--display); font-weight: 800; font-size: 17px; }
.play.laeuft { animation: puls 1.6s ease-in-out infinite; }
@keyframes puls { 50% { box-shadow: 0 16px 70px -6px #ffc145cc; } }
.geheim { margin: 0; color: var(--leise); font-size: 14px; text-align: center; }
.strahl-hinweis { margin: -4px 0 10px; color: var(--leise); font-size: 14px; }
.audio-fehler { color: var(--falsch); margin: 0; text-align: center; }

/* Auflösung */
.aufloesung { text-align: center; padding: 18px; border-radius: var(--radius); background: var(--bg2); border: 2px solid var(--linie); animation: rein .4s ease-out; }
.aufloesung.ok { border-color: var(--ok); box-shadow: 0 0 40px -10px var(--ok); }
.aufloesung.falsch { border-color: var(--falsch); box-shadow: 0 0 40px -10px var(--falsch); }
.cover { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; box-shadow: 0 10px 30px #0008; }
.jahr-gross { font-family: var(--display); font-weight: 800; font-size: 72px; line-height: 1; margin-top: 8px; color: var(--deko); }
.songtitel { font-family: var(--display); font-size: 22px; font-weight: 700; margin-top: 6px; }
.interpret { color: var(--leise); }
.urteil { margin-top: 12px; font-weight: 800; font-size: 18px; }
.ok .urteil { color: var(--ok); }
.falsch .urteil { color: var(--falsch); }
.urteil-zweifel { margin-top: 6px; font-weight: 600; color: var(--team); }
.spotify { display: inline-block; margin-top: 10px; }
@keyframes rein { from { transform: scale(.94); opacity: 0; } }

/* Zeitstrahl */
.strahl-box h2 { color: var(--team); }
.zeitstrahl { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.karte { flex: none; width: 108px; min-height: 120px; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--deko) 30%, var(--flaeche)), var(--flaeche) 70%);
  border: 1px solid color-mix(in srgb, var(--deko) 60%, transparent); scroll-snap-align: center; }
.k-jahr { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--deko); line-height: 1.1; }
.k-titel { font-weight: 700; font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.k-artist { font-size: 12px; color: var(--leise); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot { flex: none; width: 44px; border-radius: 12px; border: 2px dashed var(--linie); background: transparent; color: var(--leise); font-size: 22px; font-weight: 700; scroll-snap-align: center; transition: all .15s; }
.slot.gewaehlt { width: 72px; border-style: solid; border-color: var(--team); background: color-mix(in srgb, var(--team) 25%, transparent); color: var(--text); font-family: var(--display); font-size: 32px; }
.slot.zweifel-slot { width: 72px; border-style: solid; border-color: var(--team); background: color-mix(in srgb, var(--team) 25%, transparent); color: var(--text); font-size: 32px; }
.slot.blockiert { opacity: .5; }
.slot.zweifel-marke { border-color: var(--team); color: var(--team); }
.zeitstrahl:not(:has(.slot)) { gap: 10px; }

.aktionen { display: flex; flex-direction: column; gap: 12px; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }
.knopfreihe > * { flex: 1 1 140px; }
.team-knopf { border-color: var(--team); color: var(--team); }
.hinweis { margin: 0; color: var(--leise); }
.zweifel-info { margin: 0; font-weight: 600; color: var(--team); }

.tabelle { display: grid; gap: 6px; padding-top: 4px; }
.zeile { display: grid; grid-template-columns: 12px minmax(0, 1fr) 80px 24px 40px; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg2); font-variant-numeric: tabular-nums; }
.zeile.aktiv { outline: 2px solid var(--team); }
.zeile .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.balken { height: 8px; border-radius: 4px; background: var(--flaeche); overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--team); border-radius: 4px; }
.tok { color: var(--akzent); text-align: right; }

/* Sieg */
.sieg { text-align: center; display: flex; flex-direction: column; gap: 16px; padding-top: 24px; position: relative; }
.sieg h1 { font-size: 54px; color: var(--team); line-height: 1; }
.rang { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rang li { display: flex; align-items: center; gap: 10px; background: var(--bg2); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.rang b { margin-left: auto; font-family: var(--display); font-size: 20px; }
.konfetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.konfetti i { position: absolute; top: -20px; left: calc(var(--i) * 4.2%); width: 10px; height: 16px; border-radius: 2px;
  background: hsl(calc(var(--i) * 47) 90% 62%); animation: fall calc(2.4s + var(--i) * .07s) linear calc(var(--i) * -.13s) infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- TV ---------- */
.tv { overflow: hidden; height: 100vh; }
.tv-wrap { height: 100vh; display: flex; flex-direction: column; padding: 2.2vh 2.5vw; gap: 1.6vh; }
.tv-kopf { display: flex; align-items: baseline; gap: 2vw; }
.tv-kopf .logo { font-size: 5vh; }
.tv-kopf .info { color: var(--leise); font-size: 2.4vh; }
.tv-kopf .code { margin-left: auto; font-size: 3vh; }
.tv-teams { flex: 1; display: flex; flex-direction: column; gap: 1.4vh; min-height: 0; }
.tv-team { flex: 1; min-height: 0; display: grid; grid-template-columns: 18vw 1fr; gap: 1.5vw; align-items: center; padding: 1vh 1.2vw; border-radius: 2vh;
  background: color-mix(in srgb, var(--bg2) 80%, transparent); border: 2px solid transparent; transition: border-color .3s, background .3s; }
.tv-team.aktiv { border-color: var(--team); background: linear-gradient(90deg, color-mix(in srgb, var(--team) 22%, var(--bg2)), var(--bg2) 60%); }
.tv-name { display: flex; flex-direction: column; gap: .6vh; min-width: 0; }
.tv-name b { font-family: var(--display); font-size: 3.4vh; color: var(--team); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-name span { color: var(--leise); font-size: 2.2vh; font-variant-numeric: tabular-nums; }
.tv-name .tok { color: var(--akzent); text-align: left; }
.tv-strahl { display: flex; gap: .6vw; align-items: stretch; height: 100%; max-height: 17vh; overflow: hidden; }
.tv-strahl .karte { width: auto; flex: 0 1 8.2vw; min-width: 0; min-height: 0; padding: .8vh .6vw; border-radius: 1.2vh; }
.tv-strahl .k-jahr { font-size: 3.2vh; }
.tv-strahl .k-titel { font-size: 1.6vh; }
.tv-strahl .k-artist { font-size: 1.4vh; }
.tv-luecke { flex: 0 0 5vw; border-radius: 1.2vh; border: .4vh solid var(--team); background: color-mix(in srgb, var(--team) 25%, transparent);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 5vh; animation: puls2 1.4s ease-in-out infinite; }
.tv-luecke.zweifler { border-style: dashed; }
@keyframes puls2 { 50% { opacity: .55; } }
.tv-fuss { display: flex; align-items: center; gap: 2vw; color: var(--leise); font-size: 2.4vh; min-height: 4vh; }
.tv-fuss .note { color: var(--akzent); font-weight: 700; }
.tv-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #0b0914eb; backdrop-filter: blur(6px); animation: rein .4s ease-out; z-index: 10; }
.tv-reveal { display: grid; grid-template-columns: auto auto; gap: 4vw; align-items: center; padding: 5vh 5vw; border-radius: 4vh; background: var(--bg2); border: .5vh solid var(--linie); }
.tv-reveal.ok { border-color: var(--ok); box-shadow: 0 0 12vh -4vh var(--ok); }
.tv-reveal.falsch { border-color: var(--falsch); box-shadow: 0 0 12vh -4vh var(--falsch); }
.tv-reveal img { width: 34vh; height: 34vh; border-radius: 3vh; object-fit: cover; }
.tv-reveal .jahr-gross { font-size: 18vh; margin: 0; }
.tv-reveal .songtitel { font-size: 5vh; max-width: 45vw; }
.tv-reveal .interpret { font-size: 3.4vh; }
.tv-reveal .urteil { font-size: 4vh; }
.tv-reveal .urteil-zweifel { font-size: 3vh; }
.tv-warte { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; text-align: center; }
.tv-warte .logo { font-size: 16vh; }
.tv-warte p { font-size: 3vh; color: var(--leise); margin: 0; }
.tv-eingabe { display: flex; gap: 2vw; }
.tv-eingabe input { font-family: var(--display); font-size: 6vh; width: 6.5ch; text-align: center; letter-spacing: .2em; text-transform: uppercase; background: var(--flaeche); border: .4vh solid var(--linie); border-radius: 2vh; padding: 1vh 2vh; }
.tv-eingabe button { font-size: 3.4vh; padding: 0 4vh; border-radius: 2vh; }
.tv-sieg h1 { font-size: 14vh; color: var(--team); }
.tv-sieg p { font-size: 4vh; color: var(--leise); margin: 0; }
