:root {
  --bg: #0b0a14;
  --card: #1a1730;
  --card2: #231f40;
  --line: #2f2a55;
  --text: #f5f3ff;
  --muted: #a49fc8;
  --pink: #ff3d7f;
  --violet: #7c5cff;
  --green: #22e39a;
  --gold: #ffc83d;
  --red: #ff4d5e;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 10% -10%, #ff3d7f2e, transparent 60%),
    radial-gradient(900px 700px at 110% 10%, #7c5cff33, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: 12px;
  padding: 10px 14px;
  transition: background .15s, transform .1s, border-color .15s;
}
button:hover:not(:disabled) { border-color: var(--violet); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.active { background: var(--violet); border-color: var(--violet); }
button.primary {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  border: 0;
  font-weight: 800;
  padding: 14px 20px;
}
button.danger { border-color: #ff4d5e66; color: #ffb3bb; background: transparent; }
input, select {
  background: #0f0d1f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--violet); }

.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin: 0; font-size: .95rem; }

.logo {
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: .95;
  font-size: clamp(2.6rem, 12vw, 4rem);
  text-transform: uppercase;
  text-align: center;
  margin: 0;
}
.logo span {
  background: linear-gradient(90deg, var(--pink), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo.small { font-size: 1.15rem; text-align: left; }

.view.center {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 24px 16px;
}

.offline {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-weight: 600;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 30px);
  background: #000d;
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 60;
  max-width: calc(100% - 32px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Equalizer-Animation */
.eq { display: flex; align-items: flex-end; height: 48px; }
.eq i + i { margin-left: 6px; }
.eq i { width: 10px; border-radius: 4px; background: linear-gradient(var(--pink), var(--violet)); animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
.eq i:nth-child(4) { animation-delay: -.15s; }
.eq i:nth-child(5) { animation-delay: -.45s; }
.eq.big { height: 120px; }
.eq.big i + i { margin-left: 14px; }
.eq.big i { width: 26px; border-radius: 8px; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }

.cover { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #000; display: block; }
.cover.sm { width: 44px; height: 44px; border-radius: 8px; }
.cover-ph {
  display: grid;
  place-items: center;
  font-size: 1.6em;
  color: #fff9;
  background: linear-gradient(135deg, hsl(var(--h) 70% 45%), hsl(calc(var(--h) + 60) 70% 30%));
}

/* ---------------- Gäste ---------------- */

.lang-pick { display: grid; gap: 12px; width: min(320px, 100%); }
.lang-pick button { font-size: 1.3rem; font-weight: 800; padding: 18px; border-radius: var(--radius); }

.name-form { display: grid; gap: 10px; width: min(360px, 100%); }
.name-form label { font-size: 1.4rem; font-weight: 800; }
.name-form input { font-size: 1.2rem; padding: 16px; }
.name-form small { color: var(--muted); }

#v-main { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; }
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.g-user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; min-width: 0; }
.g-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-user select { padding: 6px 8px; border-radius: 10px; }

.timer { margin-bottom: 10px; }
.timer-top { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-weight: 600; }
.timer-top b { font-size: 2.2rem; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.timer-bar { height: 8px; border-radius: 99px; background: #ffffff14; overflow: hidden; margin-top: 6px; }
.timer-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--violet), var(--pink)); border-radius: inherit; }
.timer.urgent b { color: var(--red); animation: pulse .5s ease-in-out infinite alternate; }
.timer.urgent .timer-bar i { background: var(--red); }
@keyframes pulse { to { transform: scale(1.12); } }

.hint { text-align: center; color: var(--muted); margin: 6px 0 14px; min-height: 1.4em; }
.hint.ok { color: var(--green); font-weight: 600; }
.hint b { color: var(--text); }

.cards { display: grid; gap: 16px; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px 12px 12px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 6px 0 #05040c, 0 12px 24px #0006;
  transition: transform .12s ease, box-shadow .12s ease, border-color .2s, background .2s, opacity .4s, filter .4s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.card:hover:not(:disabled) { border-color: var(--line); }
.card:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #05040c, 0 6px 12px #0006; }
.card > *:not(.fill) { position: relative; z-index: 1; }
.card .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(90deg, #7c5cff40, #ff3d7f30);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.card .cover { width: 72px; height: 72px; }
.cover-wrap { position: relative; }
.check {
  position: absolute;
  right: -6px; bottom: -6px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #04281a;
  font-weight: 900;
  transform: scale(0);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.meta { display: flex; flex-direction: column; min-width: 0; }
.meta .title, .meta b { font-weight: 800; font-size: 1.1rem; line-height: 1.2; overflow-wrap: anywhere; }
.meta .artist, .meta small { color: var(--muted); font-size: .92rem; }
.score { display: flex; flex-direction: column; align-items: flex-end; }
.score b { font-size: 1.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.score small { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.card > .crown {
  display: none;
  position: absolute;
  top: -1px; right: 14px;
  padding: 2px 10px 3px;
  border-radius: 0 0 10px 10px;
  background: var(--gold);
  color: #2b1d00;
  font-size: .75rem;
  font-weight: 800;
}

/* Gewählt: grün, leuchtend, eingedrückt */
.card.selected {
  border-color: var(--green);
  background: #10422f;
  transform: translateY(5px);
  box-shadow: 0 1px 0 #05040c, inset 0 4px 14px #0009, 0 0 28px #22e39a55;
}
.card.selected .fill { background: linear-gradient(90deg, #22e39a50, #22e39a20); }
.card.selected .check { transform: scale(1); }

.card.winner {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #ffc83d40, 0 0 40px #ffc83d40;
  animation: pop .5s cubic-bezier(.3, 1.5, .5, 1);
}
.card.winner > .crown { display: block; }
.card.winner .score { padding-top: 14px; }
.card:disabled { cursor: default; opacity: 1; }
.card.loser { opacity: .45; filter: grayscale(.7); }
@keyframes pop { from { transform: scale(.94); } }

.waiting { text-align: center; padding: 48px 8px; display: grid; justify-items: center; gap: 4px; }
.waiting h2 { margin: 18px 0 0; font-size: 1.6rem; }
.waiting p { color: var(--muted); margin: 0; }

/* ---------------- Beamer ----------------
   Muss auch in alten TV-Browsern laufen (LG webOS = Chrome 79). Deshalb hier und bei den Animationen:
   kein "inset", kein "gap" in Flexbox (nur in Grid), "translate" und "aspect-ratio" nur mit Ersatz. */

body.screen { height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto 1fr; padding: 2.5vh 3vw; gap: 2vh; }
.s-head { display: flex; justify-content: space-between; align-items: center; }
.s-head .logo { font-size: 4.5vh; text-align: left; }
.s-round { font-size: 3vh; color: var(--muted); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.s-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding-right: 15vw; }
.s-main > * + * { margin-top: 3vh; }

.s-timer { position: relative; width: 16vh; height: 16vh; }
.s-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.s-timer circle { fill: none; stroke-width: 7; }
.s-timer .bg { stroke: #ffffff14; }
.s-timer .fg { stroke: var(--pink); stroke-linecap: round; }
.s-timer b { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-size: 7vh; font-weight: 900; font-variant-numeric: tabular-nums; }
.s-timer b.long { font-size: 4.2vh; }
body.urgent .s-timer b { color: var(--red); animation: pulse .5s ease-in-out infinite alternate; }
body.urgent .s-timer .fg { stroke: var(--red); }

.s-cards { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2.5vw; width: 100%; max-width: 1400px; }
.s-card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 2.5vh;
  padding: 2vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.s-card > * + * { margin-top: 1vh; }
.s-card .cover { width: 100%; height: auto; aspect-ratio: 1; max-height: 34vh; object-fit: cover; border-radius: 1.6vh; font-size: 10vh; }
.s-cards.n4 .s-card .cover { max-height: 26vh; }
.s-title { font-size: 3.4vh; font-weight: 900; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-artist { font-size: 2.4vh; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-card .s-bar { height: 1.6vh; border-radius: 99px; background: #ffffff14; overflow: hidden; margin-top: 1.5vh; }
.s-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--pink)); border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.s-pct { display: flex; justify-content: space-between; align-items: baseline; }
.s-pct b { font-size: 6vh; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.s-pct small { font-size: 2.2vh; color: var(--muted); }
.s-card.leading { border-color: var(--pink); box-shadow: 0 0 4vh #ff3d7f40; transform: translateY(-.8vh); }

.s-winner { display: flex; align-items: center; animation: reveal .8s cubic-bezier(.2, 1.3, .4, 1); }
.s-winner > * + * { margin-left: 4vw; }
.s-w-cover .cover { width: 46vh; height: 46vh; border-radius: 3vh; box-shadow: 0 0 0 .6vh var(--gold), 0 0 10vh #ffc83d66; font-size: 16vh; }
.s-w-label { font-size: 4vh; font-weight: 900; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
.s-w-title { font-size: 9vh; font-weight: 900; line-height: 1; margin: 1vh 0; max-width: 50vw; }
.s-w-artist { font-size: 4.5vh; color: var(--muted); }
.s-w-pct { font-size: 3.5vh; margin-top: 2vh; font-weight: 600; }
.s-w-tie { font-size: 2.6vh; color: var(--muted); margin-top: 1vh; }
.s-losers { display: flex; opacity: .55; }
.s-losers > * + * { margin-left: 2vw; }
.s-loser { display: flex; align-items: center; font-size: 2.4vh; }
.s-loser > * + * { margin-left: 1vw; }
.s-loser .cover.sm { width: 6vh; height: 6vh; font-size: 3vh; }
.s-loser b { color: var(--muted); }
@keyframes reveal { from { opacity: 0; transform: scale(.85); } }

.s-idle { text-align: center; display: grid; justify-items: center; gap: 2vh; }
.s-idle h2 { font-size: 8vh; margin: 2vh 0 0; font-weight: 900; }
.s-idle p { font-size: 3vh; color: var(--muted); margin: 0; }

.s-qr {
  position: fixed;
  right: 3vw;
  bottom: 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2.5vh;
  padding: 2vh;
  width: 13vw;
  min-width: 170px;
  transition: width .5s, right .5s, bottom .5s;
}
.s-qr > * + * { margin-top: 1.2vh; }
.s-qr img { width: 100%; background: #fff; border-radius: 1.2vh; padding: .6vh; }
.s-qr-text { display: flex; flex-direction: column; align-items: center; text-align: center; }
.s-qr-text > * + * { margin-top: .3vh; }
.s-qr-text b { font-size: 2.2vh; }
.s-qr-text span { font-size: 1.7vh; color: var(--muted); word-break: break-all; }
body.screen[data-phase="idle"] .s-qr { width: 24vw; right: 50%; transform: translateX(50%); bottom: 6vh; }
body.screen[data-phase="idle"] .s-main { padding-right: 0; justify-content: flex-start; padding-top: 2vh; }
body.screen[data-phase="idle"] .s-idle { gap: 1vh; }
body.screen[data-phase="idle"] .eq.big { height: 8vh; }
body.screen[data-phase="idle"] .s-idle h2 { font-size: 6vh; }

/* Winners-Liste rechts oben, über dem QR-Code */
.s-winners {
  position: fixed;
  right: 3vw;
  top: 11vh;
  width: 13vw;
  min-width: 170px;
  max-height: 46vh;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2.5vh;
  padding: 1.6vh 1.4vh;
}
.s-winners > b { display: block; font-size: 2.2vh; color: var(--gold); margin-bottom: .8vh; }
.s-wl { display: flex; align-items: center; font-size: 1.9vh; line-height: 1.25; padding: .45vh 0; border-top: 1px solid var(--line); }
.s-wl .tag { flex: none; margin-right: .8vh; }
.s-wl-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: .75em; font-weight: 800; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 .4em; }

/* Finale */
.s-final-head { font-size: 5vh; font-weight: 900; color: var(--gold); text-align: center; text-shadow: 0 0 4vh #ffc83d66; }
body.screen.final .s-timer { width: 13vh; height: 13vh; }
.s-champ .s-w-cover .cover { width: 38vh; height: 38vh; }
.s-champ .s-w-title { font-size: 7.5vh; }
.s-hall { width: 100%; max-width: 1400px; }
.s-hall-head { font-size: 2.6vh; font-weight: 900; color: var(--gold); margin-bottom: 1.2vh; text-align: center; }
.hall { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; grid-gap: 2vw; gap: 2vw; }
.hall-col { min-width: 0; }
.hall-col > b { display: block; color: var(--muted); letter-spacing: .1em; margin-bottom: .6vh; }
.hall-row { display: flex; justify-content: space-between; align-items: baseline; padding: .4vh 0; border-top: 1px solid var(--line); }
.hall-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 1vw; }
.hall-row small { color: var(--muted); font-variant-numeric: tabular-nums; }
.hall-row.more { color: var(--muted); }
.s-hall .hall-col > b { font-size: 2vh; }
.s-hall .hall-row { font-size: 2.2vh; }

/* Handy: Ehrentafel nach dem Finale */
.g-hall { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.g-hall h3 { margin: 0 0 10px; color: var(--gold); font-size: 1.1rem; }
.g-hall .hall { grid-auto-flow: row; grid-gap: 14px; gap: 14px; }
.g-hall .hall-row { font-size: .95rem; }

/* ---------------- DJ ---------------- */

body.dj #app { padding: 12px 16px 40px; max-width: 1400px; margin: 0 auto; }

.status {
  position: sticky;
  top: 8px;
  z-index: 10;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 0 10px 30px #000a;
  display: grid;
  gap: 12px;
}
.st-label { font-size: 1.4rem; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.st-sub { color: var(--muted); }
.st-main { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.st-time { font-size: 3.4rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.status.voting { border-color: var(--violet); background: linear-gradient(135deg, #2a1f63, #1a1730); }
.status.voting .st-label { color: #c8b9ff; }
.status.urgent { border-color: var(--red); }
.status.urgent .st-time { color: var(--red); }
.status.closed { border-color: var(--green); background: linear-gradient(135deg, #0d4a33, #10261f); animation: pop .4s; }
.status.closed .st-label { color: var(--green); }
.st-winner { display: flex; align-items: center; gap: 16px; }
.st-winner .cover { width: 84px; height: 84px; }
.w-title { font-size: 2rem; font-weight: 900; line-height: 1.1; }
.w-artist { font-size: 1.2rem; color: #d6f5e8; }

.dj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.panel { background: #14122699; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.panel h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type="search"] { flex: 1; min-width: 160px; }
.field { margin-bottom: 14px; display: grid; gap: 8px; }
.field > label { font-weight: 600; }
#duration { width: 100px; }
.presets button { min-width: 56px; }

.lang-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.lang-row button { font-weight: 800; padding: 12px 6px; }
.lang-row small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.lang-row button.active small { color: #fff; }
button.big { width: 100%; margin-top: 12px; font-size: 1.15rem; }

.rows { display: grid; gap: 8px; }
.srow, .hrow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid transparent;
}
.srow:has(.slot) { grid-template-columns: auto auto 1fr auto; }
.srow.win { border-color: var(--green); background: #0e3326; }
.srow.played { opacity: .45; }
.srow .meta b { font-size: 1rem; }
.slot { width: 26px; height: 26px; border-radius: 50%; background: var(--violet); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.num { text-align: right; font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.num small { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
.mini-bar { height: 5px; background: #ffffff14; border-radius: 99px; margin-top: 5px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--pink)); transition: width .4s; }
.acts { display: flex; gap: 4px; }
.acts button { padding: 6px 9px; font-size: .85rem; }
.pool { max-height: 520px; overflow: auto; margin-top: 10px; padding-right: 4px; }
.warn { color: var(--gold); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #555; }
.chip.on::before { background: var(--green); }
.chip button { padding: 0 7px; border: 0; background: transparent; color: var(--muted); }

.dj-qr { width: 160px; background: #fff; border-radius: 12px; padding: 6px; }
.links { word-break: break-all; }
.links a { color: #c8b9ff; }

/* ---------------- Finisher-Animationen (fx.js) ---------------- */

.fx-stage {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  --emoji: 11vh;
}
/* Undurchsichtiger Hintergrund, wird langsam eingeblendet; ::after dunkelt für den Totenkopf ganz ab */
.fx-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 40%, #2a1f63, #0b0a14 70%);
}
.fx-backdrop::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #000; opacity: 0; transition: opacity .6s; }
.fx-dark .fx-backdrop::after { opacity: 1; }
.fx-flash .fx-backdrop { background: #fff; }
.fx-flash .fx-backdrop::after { opacity: 0; transition: none; }
.fx-banner, .fx-row { position: relative; z-index: 1; }
.fx-banner + .fx-row { margin-top: 4vh; }
.fx-banner {
  font-weight: 900;
  font-size: 8vh;
  letter-spacing: .04em;
  text-align: center;
  text-shadow: 0 .6vh 0 #000, 0 0 4vh #ff3d7f;
  padding: 0 4vw;
}
.fx-row { display: flex; justify-content: center; width: 100%; padding: 0 4vw; }
.fx-row > * + * { margin-left: 3vw; }
.fx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(26vw, 42vh);
  padding: 1.6vh;
  border: 3px solid var(--line);
  border-radius: 2vh;
  background: var(--card);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.fx-card > * + * { margin-top: 1vh; }
.fx-card .cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: 1.2vh; font-size: 10vh; }
.fx-meta { display: flex; flex-direction: column; min-width: 0; }
.fx-meta b { font-size: 3vh; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-meta small { font-size: 2vh; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pct { font-size: 5vh; font-weight: 900; font-variant-numeric: tabular-nums; }
.fx-card.fx-spot { border-color: var(--gold); box-shadow: 0 0 0 .5vh #ffc83d66, 0 0 6vh #ffc83d88; }
.fx-abs { position: absolute; z-index: 2; margin: 0; }
.fx-crown { position: absolute; z-index: 6; top: 3vh; left: 50%; translate: -50% 0; font-size: 7vh; font-weight: 900; color: var(--gold); opacity: 0; text-shadow: 0 0 4vh #ffc83d88; white-space: nowrap; }

.fx-sprite { position: absolute; translate: -50% -50%; z-index: 5; line-height: 1; pointer-events: none; white-space: nowrap; }
.fx-emoji { font-size: var(--emoji); }
.fx-small { font-size: calc(var(--emoji) * .6); }
.fx-big { font-size: calc(var(--emoji) * 1.5); }
.fx-huge { font-size: calc(var(--emoji) * 2.4); }
.fx-slash {
  height: 6px;
  translate: 0 -50%;
  transform-origin: left center;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #fff 15%, #fff 85%, transparent);
  box-shadow: 0 0 20px #fff, 0 0 40px #9cf;
}
.fx-hole {
  position: absolute;
  z-index: 2;
  width: 4.5vh;
  height: 4.5vh;
  margin: 0;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #000 0 32%, #333 38%, #0008 50%, transparent 70%);
}
.fx-crack {
  width: 6px;
  translate: -50% 0;
  transform-origin: top center;
  border-radius: 3px;
  background: linear-gradient(180deg, #fff, #fff 85%, transparent);
  box-shadow: 0 0 16px #fff, 0 0 30px #f66;
}
.fx-tomb {
  position: absolute;
  z-index: 4;
  translate: -50% -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #c9c9c9;
}
.fx-tomb span { font-size: calc(var(--emoji) * 2); line-height: 1; }
.fx-tomb b { font-size: 4vh; letter-spacing: .1em; }
.fx-tomb small { font-size: 2.2vh; max-width: 24vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-reaper { filter: drop-shadow(0 0 3vh #fff6); }

/* Ersatz für alte Browser ohne "translate" (Sprites und Grabsteine zentriert fx.js per Margin) */
@supports not (translate: 1px) {
  .fx-crown { left: 0; right: 0; text-align: center; }
  .fx-hole { margin: -2.25vh 0 0 -2.25vh; }
}
/* Ersatz für alte Browser ohne "aspect-ratio": Platzhalter-Cover ohne Bild bekommen eine feste Höhe */
@supports not (aspect-ratio: 1) {
  .s-card .cover-ph { height: 30vh; }
  .s-cards.n4 .s-card .cover-ph { height: 24vh; }
  .fx-card .cover-ph { height: 22vh; }
}

/* Handy hochkant: Karten untereinander, kleiner */
@media (max-width: 700px) {
  .fx-stage { --emoji: 46px; }
  .fx-banner + .fx-row { margin-top: 18px; }
  .fx-banner { font-size: 1.8rem; }
  .fx-row { flex-direction: column; align-items: center; }
  .fx-row > * + * { margin-left: 0; margin-top: 14px; }
  .fx-card { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; width: 88vw; padding: 10px; border-radius: 16px; }
  .fx-card > * + * { margin-top: 0; }
  .fx-card .cover { width: 64px; height: 64px; border-radius: 10px; font-size: 28px; }
  .fx-meta b { font-size: 1.05rem; }
  .fx-meta small { font-size: .85rem; }
  .fx-pct { font-size: 1.5rem; }
  .fx-crown { font-size: 2rem; top: 24px; }
  .fx-hole { width: 18px; height: 18px; }
  .fx-tomb b { font-size: 1.1rem; }
  .fx-tomb small { font-size: .8rem; max-width: 60vw; }
}

/* Modus: DJ oder Automatik */
body.dj[data-mode="auto"] .dj-only,
body.dj:not([data-mode="auto"]) .auto-only { display: none; }

.win-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.win-cols b { color: var(--muted); font-size: .85rem; letter-spacing: .08em; }
.win-row { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; padding: 3px 0; border-top: 1px solid var(--line); }
.win-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-row small { color: var(--muted); }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-row button { display: grid; gap: 4px; text-align: left; font-weight: 800; padding: 12px; }
.mode-row small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.mode-row button.active small { color: #fff; }
.small { font-size: .85rem; margin: 10px 0 0; }

.sp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 8px; }
.sp-label { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.sp-now .num small { font-size: .75rem; }
.sp-queue { padding: 8px 10px; border-radius: 12px; background: var(--card); min-height: 60px; }
.sp-setup { background: #ffc83d1a; border: 1px solid #ffc83d55; border-radius: 12px; padding: 12px; margin-bottom: 12px; line-height: 1.5; }
.sp-setup a { color: var(--gold); }
code { background: #0f0d1f; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
code.copy { display: block; margin-top: 6px; padding: 8px; user-select: all; word-break: break-all; }
.pl-row { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px; }
.pl-row input { min-width: 0; padding: 8px 10px; }
#sp-conn.ok { color: var(--green); }
#sp-conn.bad { color: var(--gold); }
.st-queue { font-weight: 600; margin-top: 4px; }
.st-queue.ok { color: var(--green); }
.st-queue.failed { color: var(--red); }
.st-queue.pending { color: var(--gold); }

@media (max-width: 600px) {
  .st-time { font-size: 2.4rem; }
  .w-title { font-size: 1.5rem; }
  .dj-grid { grid-template-columns: 1fr; }
}
