/* Anzeige (Beamer): immer dunkel, sehr große Schrift, Startnummern riesig.
   Baut auf app.css (Dark-Token) auf; Skalierung über die Viewport-Breite. */

:root {
  --d-accent: #ffd166;          /* Startnummern, Rundenname */
  --d-tile: #16202b;
  --d-line: #2b3a4a;
  --d-muted: #9fb0c3;
}

html { font-size: clamp(18px, 1.6vw, 30px); }
body.display {
  margin: 0; min-height: 100vh; background: #0b0f14; color: #f2f4f7;
  padding: 1.25rem 2.5rem 2rem; overflow-x: hidden;
}

/* Kopf */
.display-head {
  display: flex; align-items: baseline; gap: 2rem; flex-wrap: wrap;
  border-bottom: 3px solid var(--d-line); padding-bottom: .6rem; margin-bottom: 1.4rem;
}
.display-head h1 { margin: 0; font-size: 2.4rem; color: #fff; letter-spacing: -.01em; }
.display-head__meta { color: var(--d-muted); font-size: 1.2rem; margin-left: auto; }

/* Leerlauf */
.display-idle { text-align: center; padding: 5rem 0; }
.display-idle__title { font-size: 3.2rem; font-weight: 700; color: #fff; margin: 0 0 .5rem; }
.display-idle__sub { font-size: 1.6rem; color: var(--d-muted); margin: 0; }

/* Lineup der offenen Runde */
.display-stage, .display-result { margin-bottom: 2.5rem; }
.display-stage__head { display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.display-stage h2, .display-result h2 { margin: 0; font-size: 2.1rem; color: #fff; }
.display-stage__round {
  margin: 0; color: var(--d-accent); font-size: 1.35rem; font-weight: 600;
  padding: .15rem .8rem; border: 2px solid var(--d-accent); border-radius: 999px;
}
.display-lineup {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.display-lineup li {
  display: flex; align-items: center; gap: 1rem;
  background: var(--d-tile); border-radius: .9rem; padding: .8rem 1.1rem;
  border: 1px solid var(--d-line);
}
.display-lineup__num {
  font-size: 3.4rem; font-weight: 800; min-width: 4.2rem; text-align: center; line-height: 1;
  color: var(--d-accent); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.display-lineup__name { font-size: 1.5rem; line-height: 1.2; }

/* Freigegebenes Ergebnis */
.display-table { width: 100%; border-collapse: collapse; font-size: 1.45rem; margin: 0; }
.display-table th {
  text-align: left; color: var(--d-muted); font-weight: 600; padding: .4rem .75rem;
  border-bottom: 2px solid var(--d-line); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em;
  background: transparent;
}
.display-table td { padding: .55rem .75rem; border-bottom: 1px solid #1e2a36; background: transparent; color: inherit; }
.display-table__rank { font-weight: 800; font-size: 1.9rem; width: 5rem; font-variant-numeric: tabular-nums; }
.display-table__num { color: var(--d-accent); font-weight: 700; width: 5rem; font-variant-numeric: tabular-nums; }
.display-table__club { color: var(--d-muted); }
.display-table__podium td { background: var(--d-tile); }
.display-table__podium .display-table__rank { color: var(--d-accent); }
.display-table__podium .display-table__name { font-weight: 700; }
.display-table__podium--1 td { background: #1d2a38; box-shadow: inset 4px 0 0 #ffd166; }
.display-table__podium--2 td { box-shadow: inset 4px 0 0 #cbd5e1; }
.display-table__podium--3 td { box-shadow: inset 4px 0 0 #d97706; }

/* Sanfte Aktualisierung (View Transitions, wenn verfügbar) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* --- v3: Uhr, Ansage, Als Nächstes, Pause --------------------------------- */
.display-head { align-items: center; }
.display-head__meta { margin-left: auto; }
.display-clock {
  font-size: 2.2rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  padding-left: 1.5rem; border-left: 2px solid var(--d-line); line-height: 1;
}

/* Ansage als Banner über dem Inhalt */
.display-announce {
  display: flex; align-items: center; gap: 1.1rem;
  margin: 0 0 1.6rem; padding: .9rem 1.4rem;
  background: #2a2208; border: 2px solid var(--d-accent); border-radius: .9rem;
  animation: announce-in .5s ease-out;
}
.display-announce__icon {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--d-accent); color: #0b0f14; font-size: 1.7rem; font-weight: 900; line-height: 1;
}
.display-announce__text { margin: 0; font-size: 1.9rem; font-weight: 700; color: #fff; line-height: 1.25; }
@keyframes announce-in { from { transform: translateY(-.5rem); opacity: 0; } to { transform: none; opacity: 1; } }

/* Als Nächstes */
.display-next { margin: 2.5rem 0 0; font-size: 1.7rem; color: #fff; }
.display-next__label {
  display: inline-block; margin-right: .6rem; padding: .15rem .8rem; border-radius: 999px;
  border: 2px solid var(--d-accent); color: var(--d-accent); font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; vertical-align: middle;
}
.display-next--bar { margin: 0 0 1.8rem; padding: .7rem 1.1rem; background: var(--d-tile); border: 1px solid var(--d-line); border-radius: .9rem; font-size: 1.4rem; }

/* Pause: ganzer Bildschirm, riesiger Countdown */
.display-pause {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 6.5rem 3rem 2.5rem; background: radial-gradient(ellipse at center, #16202b 0%, #0b0f14 70%);
}
.display-pause p { margin: 0; }
.display-pause__top {
  position: absolute; top: 1.25rem; left: 2.5rem; right: 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: .6rem; border-bottom: 3px solid var(--d-line);
  font-size: 1.6rem; font-weight: 700; color: var(--d-muted);
}
.display-pause__top .display-clock { border-left: 0; padding-left: 0; }
.display-pause__label { font-size: 2.2rem; font-weight: 800; color: var(--d-accent);
  text-transform: uppercase; letter-spacing: .3em; padding-left: .3em;
}
.display-pause__time {
  font-size: 12rem; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; margin: .5rem 0 .8rem !important;
}
.display-pause__time.is-over { color: var(--d-accent); }
.display-pause__until { font-size: 2.1rem; color: var(--d-muted); }
.display-pause__until strong { color: #fff; }
.display-pause__announce {
  margin-top: 2.2rem !important; max-width: 60rem; padding: .9rem 1.6rem;
  font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.3;
  border: 2px solid var(--d-accent); border-radius: .9rem; background: #2a2208;
}
.display-next--pause { margin-top: 2rem; }
.display-next__sep { color: var(--d-accent); margin: 0 .2rem; }

/* Vergleich (Callout): Nummern riesig, übrige Starter treten zurück */
.display-callout {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; margin: 0 0 1.2rem;
  padding: 1rem 1.4rem; border-radius: 1rem; background: #2a1e05; border: 2px solid var(--d-accent);
}
.display-callout__label { color: var(--d-accent); font-weight: 800; font-size: 1.3rem; letter-spacing: .08em; text-transform: uppercase; }
.display-callout__nums { display: flex; flex-wrap: wrap; gap: .8rem; }
.display-callout__nums b {
  min-width: 5rem; padding: .2rem .8rem; border-radius: .8rem; text-align: center;
  background: var(--d-accent); color: #1b1200; font-size: 3.6rem; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.display-lineup.has-callout li:not(.is-called) { display: none; }
.display-lineup li.is-called { border-color: var(--d-accent); }

/* --- Show (Phase E): angesagte Pose ---------------------------------------- */
.display-pose {
  margin: 0; display: inline-flex; align-items: center; gap: .8rem;
  padding: .35rem 1.2rem .35rem .45rem; border-radius: 999px;
  background: var(--d-accent); color: #1b1200; animation: announce-in .45s ease-out;
}
.display-pose__label {
  padding: .15rem .7rem; border-radius: 999px; background: #1b1200; color: var(--d-accent);
  font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em;
}
.display-pose__name { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }

/* --- Show: Sponsoren-Folien ------------------------------------------------ */
.display-sponsors {
  position: fixed; inset: 0; z-index: 30; background: #05070a;
  opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s linear 1s;
}
.display-sponsors.is-on { opacity: 1; visibility: visible; transition: opacity 1s ease; }
.display-sponsor {
  position: absolute; inset: 0; margin: 0; overflow: hidden;
  display: grid; place-items: center; opacity: 0; transition: opacity 1.2s ease;
}
.display-sponsor::before {        /* unscharfer Hintergrund aus demselben Bild */
  content: ""; position: absolute; inset: -6%;
  background: var(--slide-bg) center / cover no-repeat; filter: blur(48px) brightness(.4) saturate(1.2);
}
.display-sponsor.is-current { opacity: 1; }
/* Logos mit Transparenz: ruhiger Hintergrund statt Unschärfe, Logo groß */
.display-sponsor--logo { background: radial-gradient(ellipse at 50% 45%, #1c2736 0%, #070a0e 70%); }
.display-sponsor--logo::before { display: none; }
.display-sponsor.display-sponsor--logo img { width: 62%; height: 62%; box-shadow: none; }
.display-sponsor img {
  position: relative; max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .45);
}
/* Während Folien laufen: Ansage und „Als Nächstes“ als Plaketten über den Folien */
body.sponsors-on .display-announce {
  position: fixed; left: 2rem; right: 2rem; bottom: 2rem; z-index: 40; margin: 0;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5);
}
body.sponsors-on .display-next--sponsor-badge {
  position: fixed; left: 2rem; top: 1.6rem; z-index: 40; margin: 0;
  padding: .6rem 1.2rem; font-size: 1.3rem; border-radius: .9rem;
  background: rgba(11, 15, 20, .82); border: 1px solid var(--d-line);
  backdrop-filter: blur(8px); box-shadow: 0 1rem 3rem rgba(0, 0, 0, .45);
}
/* Pause mit Folien: Countdown als Plakette unten rechts */
.display-pause--badge {
  inset: auto 2rem 2rem auto; z-index: 40; padding: 1rem 1.6rem 1.1rem; min-width: 17rem;
  border-radius: 1.2rem; background: rgba(11, 15, 20, .86); border: 2px solid var(--d-accent);
  backdrop-filter: blur(10px); box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, .55);
  justify-content: flex-start; gap: .1rem;
}
.display-pause--badge .display-pause__top,
.display-pause--badge .display-next--pause { display: none; }
.display-pause--badge .display-pause__label { font-size: 1rem; letter-spacing: .25em; }
.display-pause--badge .display-pause__time { font-size: 4.2rem; margin: .1rem 0 .2rem !important; }
.display-pause--badge .display-pause__until { font-size: 1.1rem; }
.display-pause--badge .display-pause__announce {
  position: fixed; left: 2rem; bottom: 2rem; right: 22rem; margin: 0 !important; max-width: none;
  font-size: 1.5rem; text-align: left; background: rgba(42, 34, 8, .92);
}

/* --- Show: Siegerehrung ---------------------------------------------------- */
.ceremony {
  --gold: #ffd166; --silver: #d7dee8; --bronze: #e08a3c;
  position: fixed; inset: 0; z-index: 50; overflow: hidden; margin: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 2.5rem 0; color: #fff;
  background:
    radial-gradient(ellipse 60% 55% at 50% 38%, rgba(255, 209, 102, .10), transparent 70%),
    radial-gradient(ellipse at 50% 120%, #1a2740 0%, #0b0f14 62%);
}
.ceremony__glow {
  position: absolute; inset: -20% -10% auto; height: 90%; pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0%, transparent 0deg, rgba(255, 209, 102, .07) 20deg,
    transparent 40deg, rgba(255, 255, 255, .05) 60deg, transparent 80deg, rgba(255, 209, 102, .07) 100deg,
    transparent 120deg, rgba(255, 255, 255, .05) 140deg, transparent 160deg,
    rgba(255, 209, 102, .07) 180deg, transparent 200deg);
  animation: ceremony-sweep 18s ease-in-out infinite alternate;
}
@keyframes ceremony-sweep { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.ceremony__top {
  position: relative; width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding-bottom: .6rem; border-bottom: 3px solid rgba(255, 255, 255, .12);
  font-size: 1.4rem; font-weight: 700; color: var(--d-muted);
}
.ceremony__tag {
  color: var(--gold); text-transform: uppercase; letter-spacing: .3em; font-size: 1.05rem; font-weight: 800;
}

/* Titelkarte */
.ceremony__card { position: relative; margin: auto 0; text-align: center; animation: ceremony-title 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.ceremony__kicker {
  margin: 0 0 1.2rem; color: var(--gold); font-size: 1.6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5em; padding-left: .5em;
}
.ceremony__class {
  margin: 0; font-size: 6.2rem; line-height: 1.02; font-weight: 900; letter-spacing: -.03em; color: #fff;
  text-wrap: balance; max-width: 30ch;
}
.ceremony__class::after {
  content: ""; display: block; width: 8rem; height: .35rem; margin: 2rem auto 0; border-radius: 1rem;
  background: linear-gradient(90deg, var(--bronze), var(--gold), var(--silver));
}
.ceremony__sub { margin: 1.5rem 0 0; font-size: 1.6rem; color: var(--d-muted); }
@keyframes ceremony-title {
  from { opacity: 0; transform: scale(.94); letter-spacing: .02em; }
  to { opacity: 1; transform: none; }
}

/* Podest */
.ceremony__heading {
  position: relative; margin: .9rem 0 0; font-size: 2.1rem; font-weight: 800; color: #fff; letter-spacing: -.01em;
}
.cer-podium {
  position: relative; flex: 1; width: 100%; max-width: 60rem; margin: 1.2rem 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 1.6rem;
}
.cer-podium__col { display: flex; flex-direction: column; align-items: center; min-width: 0; --c: var(--gold); }
.cer-podium__col--2 { --c: var(--silver); grid-column: 1; }
.cer-podium__col--1 { --c: var(--gold); grid-column: 2; }
.cer-podium__col--3 { --c: var(--bronze); grid-column: 3; }
.cer-podium__athlete { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; padding-bottom: 1rem; }
.cer-podium__photo {
  width: 7rem; height: 7rem; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(145deg, #1d2a3a, #0f1620);
  box-shadow: 0 0 0 .3rem var(--c), 0 0 0 .6rem rgba(0, 0, 0, .5), 0 1.2rem 3rem rgba(0, 0, 0, .55);
}
.cer-podium__col--1 .cer-podium__photo { width: 9rem; height: 9rem; box-shadow: 0 0 0 .35rem var(--c), 0 0 0 .7rem rgba(0, 0, 0, .5), 0 0 5rem rgba(255, 209, 102, .35); }
.cer-podium__photo img { width: 100%; height: 100%; object-fit: cover; }
.cer-podium__initials { font-size: 2.6rem; font-weight: 800; color: var(--c); letter-spacing: -.02em; }
.cer-podium__name {
  margin: .9rem 0 .2rem; font-size: 1.8rem; font-weight: 800; line-height: 1.1; color: #fff;
  text-wrap: balance; overflow-wrap: anywhere;
}
.cer-podium__col--1 .cer-podium__name { font-size: 2.1rem; }
.cer-podium__meta { margin: 0; display: flex; gap: .7rem; justify-content: center; align-items: baseline; flex-wrap: wrap; font-size: 1.25rem; color: var(--d-muted); }
.cer-podium__num {
  padding: .05rem .6rem; border-radius: .5rem; background: rgba(255, 255, 255, .08);
  color: var(--c); font-weight: 800; font-variant-numeric: tabular-nums;
}
.cer-podium__block {
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 1rem; border-radius: 1rem 1rem 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, #111a24) 0%, #0d131b 100%);
  border-top: .4rem solid var(--c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.cer-podium__col--1 .cer-podium__block { height: 10rem; }
.cer-podium__col--2 .cer-podium__block { height: 7.8rem; }
.cer-podium__col--3 .cer-podium__block { height: 6.2rem; }
.cer-podium__rank {
  font-size: 3.2rem; font-weight: 900; line-height: .95; color: var(--c); font-variant-numeric: tabular-nums;
  text-shadow: 0 .3rem 1.5rem rgba(0, 0, 0, .45);
}
.cer-podium__col--1 .cer-podium__rank { font-size: 5.2rem; }
.cer-podium__label { margin-top: .2rem; font-size: 1rem; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

/* Noch verdeckt: gedämpft, Fragezeichen */
.cer-podium__col:not(.is-shown) .cer-podium__block { filter: saturate(.2) brightness(.6); }
.cer-podium__athlete--hidden .cer-podium__photo { box-shadow: 0 0 0 .3rem rgba(255, 255, 255, .15); background: #121a24; }
.cer-podium__athlete--hidden .cer-podium__initials { color: rgba(255, 255, 255, .25); }

/* Gerade aufgedeckt */
.cer-podium__col.is-new .cer-podium__athlete { animation: podium-reveal 1.1s cubic-bezier(.2, .9, .25, 1.15) both; }
.cer-podium__col.is-new .cer-podium__block { animation: podium-block .9s ease-out both; }
.cer-podium__col.is-new .cer-podium__photo { animation: podium-halo 2.4s ease-out .5s both; }
@keyframes podium-reveal {
  0% { opacity: 0; transform: translateY(3rem) scale(.9); filter: blur(8px); }
  60% { opacity: 1; filter: none; }
  100% { opacity: 1; transform: none; }
}
@keyframes podium-block { from { filter: saturate(.2) brightness(.6); } to { filter: none; } }
@keyframes podium-halo {
  0% { box-shadow: 0 0 0 .3rem var(--c), 0 0 0 .6rem rgba(0, 0, 0, .5), 0 0 0 0 var(--c); }
  35% { box-shadow: 0 0 0 .3rem var(--c), 0 0 0 .6rem rgba(0, 0, 0, .5), 0 0 6rem 1.5rem color-mix(in srgb, var(--c) 55%, transparent); }
  100% { box-shadow: 0 0 0 .3rem var(--c), 0 0 0 .6rem rgba(0, 0, 0, .5), 0 1.2rem 3rem rgba(0, 0, 0, .55); }
}
/* Sieger aufgedeckt: goldener Lichtkegel */
.ceremony.is-finished .cer-podium__col--1::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: -10%; width: 34rem; height: 120%;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 30%, rgba(255, 209, 102, .22), transparent 70%);
  animation: ceremony-title 1.4s ease-out both;
}
.cer-podium__col--1 { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .ceremony__glow, .ceremony__card, .cer-podium__col.is-new .cer-podium__athlete,
  .cer-podium__col.is-new .cer-podium__block, .cer-podium__col.is-new .cer-podium__photo { animation: none; }
  .display-sponsors, .display-sponsor { transition: none; }
}

/* Publikumsliebling (Phase F): nach dem Ende der Abstimmung, im Stil der Siegerehrung */
.display-audience {
  --c: #ff5d8f;
  position: relative; margin: 0 0 2.2rem; padding: 1.6rem 2rem; border-radius: 1.4rem; overflow: hidden;
  background: radial-gradient(90% 140% at 0% 0%, rgba(255, 93, 143, .28), transparent 60%), linear-gradient(135deg, #14213d, #0f1620);
  border: 2px solid rgba(255, 93, 143, .55);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem 2rem;
  animation: podium-reveal 1.1s cubic-bezier(.2, .9, .25, 1.15) both;
}
.display-audience__kicker { grid-column: 1 / -1; margin: 0; color: var(--c); font-size: 1.1rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.display-audience__people { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
.display-audience__who { display: flex; align-items: center; gap: 1.4rem; }
.display-audience .display-audience__photo { width: 7.5rem; height: 7.5rem; flex: none; }
.display-audience__name { margin: 0; font-size: 2.6rem; font-weight: 800; line-height: 1.05; color: #fff; }
.display-audience__meta { margin: .4rem 0 0; color: var(--d-muted); font-size: 1.25rem; display: flex; align-items: center; gap: .7rem; }
.display-audience__num { color: #0b0f14; background: var(--d-accent); border-radius: .5rem; padding: 0 .5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.display-audience__votes { margin: 0; align-self: end; color: var(--d-muted); font-size: 1.2rem; text-align: right; }
@media (prefers-reduced-motion: reduce) { .display-audience { animation: none; } }
