/*
 * File: cmp-winner-board.css
 * Munich Musicians DB - Competition (CMP_) Slam-Manager: Winner Board (v45)
 *
 * Portierung von frontend-winner-board.css (Slam Manager): feste 1920x1080-Buehne, per
 * transform skaliert (Seitenbreite bzw. Vollbild - cmp-winner-board.js setzt den Faktor).
 * Farben AUSSCHLIESSLICH ueber Tokens (--mmdb-wb-* in theme.css); Weiss/Schwarz-Alphas
 * sind fuer Overlays/Schatten erlaubt.
 */

/* ---------- Seite (Zugangsweiche / Terminwahl) ---------- */
.cmp-wb-gate {
  max-width: 720px; margin: 22px auto 32px; padding: 28px 30px;
  background: var(--mmdb-card); color: var(--mmdb-ink-soft);
  border-radius: var(--mmdb-r-card); box-shadow: var(--mmdb-shadow-card);
}
.cmp-wb-gate .notice { margin: 0; }
.cmp-wb-gate-title {
  margin: 0 0 6px; font-family: var(--mmdb-font-head) !important; font-weight: 500;
  font-size: 24px; text-transform: uppercase; letter-spacing: .04em; color: var(--mmdb-accent-deep);
}
.cmp-wb-target-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cmp-wb-target-list .button { display: inline-block; text-decoration: none; }

/* ---------- Buehne: Wrapper skaliert die 1920x1080-Flaeche auf die Seitenbreite ---------- */
.cmp-wb-stage-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--mmdb-bg-deep); border-radius: var(--mmdb-r-card); margin: 16px 0 24px;
}
.cmp-winner-board {
  position: absolute; top: 0; left: 0;
  width: 1920px; height: 1080px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  background-color: var(--mmdb-bg-deep);
  overflow: hidden;
  font-family: var(--mmdb-font-head), Impact, 'Arial Black', sans-serif;
  transform-origin: top left;
  color: #fff;
  user-select: none;
}
.cmp-winner-board::before {
  /* Textur abdunkeln, damit Balken und Namen tragen */
  content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 0;
}
.cmp-winner-board > * { position: relative; z-index: 1; }

/* Vollbild-Overlay (Board wird per JS hinein verschoben) */
#cmp-wb-overlay {
  position: fixed; inset: 0; z-index: 2147483647; background: var(--mmdb-bg-deep); overflow: hidden;
}
#cmp-wb-overlay .cmp-winner-board { position: absolute; will-change: transform, left, top; }

/* ---------- Loading / Fehler / Hinweis ---------- */
.cmp-wb-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 5;
}
.cmp-wb-loading p { margin-top: 20px; font-size: 24px; }
.cmp-wb-spinner {
  width: 60px; height: 60px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: cmp-wb-spin 1s linear infinite;
}
@keyframes cmp-wb-spin { to { transform: rotate(360deg); } }
.cmp-wb-error { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; padding: 40px; z-index: 6; }
.cmp-wb-error.is-visible { display: flex; }
.cmp-wb-error-msg {
  background: var(--mmdb-danger); color: #fff; padding: 30px; border-radius: 10px;
  font-size: 28px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.cmp-wb-rotate { display: none; }
@media (max-width: 768px) {
  .cmp-wb-rotate {
    display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,.8); color: #fff; padding: 30px; border-radius: 10px;
    text-align: center; font-size: 34px; z-index: 50; max-width: 80%;
  }
}

/* ---------- Splash ---------- */
.cmp-wb-splash {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: var(--mmdb-bg-deep); transition: opacity 800ms ease-out;
}
.cmp-wb-splash.is-hidden { opacity: 0; pointer-events: none; }
.cmp-wb-splash-image {
  position: absolute; inset: 0; background-size: contain; background-position: center; background-repeat: no-repeat;
}
.cmp-wb-splash-text { background: transparent; }
.cmp-wb-splash-title { text-align: center; padding: 40px; }
.cmp-wb-splash-title h1 { font-size: 110px; margin: 0; line-height: 1.05; text-transform: uppercase; letter-spacing: .04em; text-shadow: 3px 3px 12px rgba(0,0,0,.6); }
.cmp-wb-splash-title p { font-size: 48px; margin: 20px 0 0; opacity: .85; font-family: var(--mmdb-font-body); }
.cmp-wb-splash-logo { max-height: 220px; margin-bottom: 30px; }

/* Play-Knopf: bewusst leise (unten rechts), wandert mit dem Board */
.cmp-wb-play {
  position: absolute; bottom: 20px; right: 20px; width: 56px; height: 56px;
  border: none; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  transition: all .3s ease; z-index: 30; box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.cmp-wb-play:hover { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); transform: scale(1.1); }
.cmp-wb-play-icon { font-size: 26px; line-height: 1; }
.cmp-winner-board > .cmp-wb-play { position: absolute; }

/* ---------- Board-Layout ---------- */
.cmp-wb-container {
  position: absolute; inset: 0; display: none; flex-direction: column;
  opacity: 0; transition: opacity 800ms ease-in;
}
.cmp-wb-container.is-ready { display: flex; }
.cmp-wb-container.is-visible { opacity: 1; }
.cmp-wb-header {
  /* FESTE Hoehe (Original): die Charthoehe darf sich zwischen Zufalls-, Grau- und
     Farbphase nicht aendern - ein wachsender Kopf (Titel wird erst mit .is-visible
     eingeblendet) liess die Zufallsbalken 16px ueber die graue Decke ragen. */
  height: 140px; display: flex; align-items: center; justify-content: center; gap: 30px;
  padding: 20px; background: rgba(0,0,0,.2); position: relative; overflow: visible;
}
/* Titel + Termindatum als Spalte, Datum zentriert UNTER der Hauptueberschrift (User 2026-09-02);
   Titel 60px/1.1 + 4px + Datum 22px/1.2 = 96px Inhaltshoehe des 140px-Kopfs (User 2026-09-02:
   mit line-height 1 stand das Datum in den Unterlaengen des Titels) */
.cmp-wb-head-text { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cmp-wb-head-text .cmp-wb-title { line-height: 1.1; }
.cmp-wb-date { color: #fff; font-family: var(--mmdb-font-body); font-size: 22px; opacity: .85; line-height: 1.2; margin-top: 4px; text-shadow: 2px 2px 4px rgba(0,0,0,.3); }
.cmp-wb-date:empty { display: none; }
.cmp-wb-logo { max-height: 80px; }
.cmp-wb-title {
  margin: 0; color: #fff; font-size: 60px; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,.3);
  cursor: pointer; position: relative; z-index: 100; white-space: nowrap; line-height: 1.05;
}
.cmp-wb-title::after { content: ''; position: absolute; top: -20px; left: -50px; right: -50px; bottom: -20px; }
.cmp-wb-container:not(.is-visible) .cmp-wb-title { display: none !important; }
.cmp-wb-preview-hint {
  position: absolute; right: 30px; bottom: 8px; font-family: var(--mmdb-font-body);
  font-size: 22px; opacity: .7; display: none;
}
.cmp-wb-preview-hint.is-visible { display: block; }

.cmp-wb-chart { flex: 1; position: relative; padding: 40px 40px 0; }
.cmp-wb-chart::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: 290px;
  background: rgba(0,0,0,.85); z-index: 0;
}
.cmp-wb-chart::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 290px;
  background: var(--mmdb-wb-stage-soft); z-index: 0;
}
.cmp-wb-chart-area { position: relative; height: 100%; width: 100%; z-index: 1; }

/* ---------- Teilnehmer-Leiste ---------- */
.cmp-wb-contestants {
  position: absolute; bottom: 140px; left: 0; right: 0; height: 130px;
  display: flex; justify-content: space-evenly; align-items: flex-start;
  padding: 0 40px; gap: 20px; z-index: 5;
}
.cmp-wb-contestant {
  text-align: center; width: 150px; height: 130px; flex-shrink: 0; position: relative;
  transition: transform .3s;
}
.cmp-wb-contestant-image {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  border: 4px solid #fff; box-shadow: 0 4px 8px rgba(0,0,0,.3);
  margin: 0 auto 5px; position: relative; transition: all .3s ease;
  background: var(--mmdb-fill-dark);
}
.cmp-wb-contestant-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-wb-contestant-name {
  color: #fff; font-size: 24px; font-weight: 700; text-shadow: 1px 1px 2px rgba(0,0,0,.5);
  width: 150px; line-height: 1.2; word-wrap: break-word; position: absolute; top: 130px; left: 0;
}

/* Cheat Mode (Vorschau): Portraits klickbar = +1 */
.cmp-wb-contestant.is-votable { cursor: pointer; }
.cmp-wb-contestant.is-votable:hover .cmp-wb-contestant-image {
  transform: scale(1.1); border-color: var(--mmdb-wb-cheat); box-shadow: 0 0 20px var(--mmdb-wb-cheat-glow);
}
.cmp-wb-contestant.is-voting { pointer-events: none; opacity: .6; }
.cmp-wb-contestant.is-vote-success .cmp-wb-contestant-image { animation: cmp-wb-vote-pulse .6s ease; }
@keyframes cmp-wb-vote-pulse {
  0%, 100% { transform: scale(1); border-color: #fff; }
  50% { transform: scale(1.15); border-color: var(--mmdb-wb-cheat); box-shadow: 0 0 30px var(--mmdb-wb-cheat-glow); }
}

/* Bonus-Auswahl (Platz 1 & 2) und Battle-Auswahl */
.cmp-wb-contestant.is-bonus-selectable, .cmp-wb-contestant.is-battle-selectable { cursor: pointer; }
.cmp-wb-contestant.is-bonus-selectable .cmp-wb-contestant-image,
.cmp-wb-contestant.is-battle-selectable .cmp-wb-contestant-image { border-color: rgba(255,255,255,.5); }
.cmp-wb-contestant.is-bonus-selectable:hover .cmp-wb-contestant-image,
.cmp-wb-contestant.is-battle-selectable:hover .cmp-wb-contestant-image {
  border-color: var(--mmdb-wb-gold); box-shadow: 0 0 20px var(--mmdb-wb-gold-glow);
}
.cmp-wb-contestant.is-bonus-selected .cmp-wb-contestant-image,
.cmp-wb-contestant.is-battle-selected .cmp-wb-contestant-image {
  border-color: var(--mmdb-wb-gold); box-shadow: 0 0 25px var(--mmdb-wb-gold-glow);
}
.cmp-wb-bonus-overlay {
  position: absolute; inset: 0; background: var(--mmdb-wb-gold-soft); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 700; color: var(--mmdb-wb-gold-ink);
  text-shadow: 2px 2px 4px rgba(0,0,0,.3); animation: cmp-wb-bonus-pulse 1.5s ease-in-out infinite; z-index: 10;
}
.cmp-wb-battle-badge-sel {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  z-index: 15; pointer-events: none; opacity: .9;
}
.cmp-wb-battle-badge-sel .cmp-wb-battle-icon {
  font-size: 72px; font-weight: 700; line-height: 0; text-shadow: 3px 3px 8px rgba(0,0,0,.6);
  animation: cmp-wb-bonus-pulse 1.5s ease-in-out infinite;
}
@keyframes cmp-wb-bonus-pulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ---------- Balken ---------- */
.cmp-wb-bar { position: absolute; width: 150px; bottom: 290px; }
.cmp-wb-bar-color { z-index: 1; }
.cmp-wb-bar-grey { z-index: 2; }
.cmp-wb-bar-fill {
  width: 100%; height: 0; position: absolute; bottom: 0;
  border-radius: 8px 8px 0 0; box-shadow: 0 -4px 12px rgba(0,0,0,.2);
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  padding-top: 20px; overflow: visible;
}
.cmp-wb-bar-grey .cmp-wb-bar-fill { padding-top: 0; background: var(--mmdb-wb-grey); }
.cmp-wb-bar-content {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  text-align: center; color: #fff; z-index: 10; width: 100%; display: none;
}
.cmp-wb-bar-content.is-visible { display: block; }
.cmp-wb-bar-points { font-size: 44px; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,.3); }
.cmp-wb-bar-label { font-size: 24px; margin-top: 5px; text-shadow: 1px 1px 2px rgba(0,0,0,.3); }
.cmp-wb-bar-question {
  font-size: 48px; color: #fff; font-weight: 700; margin-top: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,.3); animation: cmp-wb-pulse 1.5s infinite;
}
@keyframes cmp-wb-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: .8; } }
.cmp-wb-bar.is-revealed .cmp-wb-bar-fill { animation: cmp-wb-glow 2s ease-in-out infinite; }
@keyframes cmp-wb-glow {
  0%, 100% { box-shadow: 0 -4px 12px rgba(0,0,0,.2), 0 0 20px rgba(255,255,255,.3); }
  50% { box-shadow: 0 -4px 12px rgba(0,0,0,.2), 0 0 30px rgba(255,255,255,.5); }
}
.cmp-wb-bar.is-exploding { animation: cmp-wb-explode .5s ease-out; }
@keyframes cmp-wb-explode { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.cmp-wb-bar.is-winner-pulse .cmp-wb-bar-fill { animation: cmp-wb-winner-pulse 1s ease-in-out infinite; }
@keyframes cmp-wb-winner-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.cmp-wb-fade { transition: opacity .4s ease; opacity: 0 !important; }

/* ---------- Battle-Modus ---------- */
.cmp-wb-tie-circle {
  width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin-top: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.cmp-wb-tie-mark {
  font-size: 52px; color: #fff; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,.5);
  animation: cmp-wb-blink .8s infinite;
}
@keyframes cmp-wb-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(1.1); } }
.cmp-wb-battle-badge {
  position: absolute; top: calc(50% - 145px); left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: linear-gradient(135deg, var(--mmdb-wb-battle) 0%, var(--mmdb-wb-battle-deep) 100%);
  color: #fff; padding: 50px 120px; border-radius: 30px;
  box-shadow: 0 12px 36px var(--mmdb-wb-battle-glow); z-index: 20;
  border: 8px solid var(--mmdb-wb-battle-line);
  animation: cmp-wb-badge-blink 1s ease-in-out infinite;
}
.cmp-wb-battle-badge.is-static { animation: none; }
@keyframes cmp-wb-badge-blink {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-15deg) scale(1); }
  50% { opacity: .7; transform: translate(-50%, -50%) rotate(-15deg) scale(1.08); }
}
.cmp-wb-battle-badge-text {
  font-size: 84px; font-weight: 900; text-transform: uppercase; letter-spacing: 6px;
  text-shadow: 4px 4px 8px rgba(0,0,0,.6); white-space: nowrap;
}

/* ---------- Gewinner ---------- */
.cmp-wb-winner-label {
  position: absolute; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 20px; z-index: 15;
  transform: translate(-50%, -50%);
}
.cmp-wb-winner-image {
  width: 240px; height: 240px; border-radius: 50%; object-fit: cover;
  border: 8px solid var(--mmdb-wb-gold);
  box-shadow: 0 0 40px var(--mmdb-wb-gold-halo), 0 6px 16px rgba(0,0,0,.4);
  animation: cmp-wb-winner-image 1s ease-in-out infinite;
}
@keyframes cmp-wb-winner-image { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.cmp-wb-winner-name {
  font-size: 52px; font-weight: 700; color: #fff; text-align: center; line-height: 1.2;
  text-shadow: 3px 3px 10px rgba(0,0,0,.9), 0 0 25px var(--mmdb-wb-gold-glow);
  background: var(--mmdb-wb-gold-tint); padding: 15px 40px; border-radius: 20px; min-width: 250px;
}
.cmp-wb-confetti { position: absolute; width: 10px; height: 10px; pointer-events: none; z-index: 1000; transition: top 1.4s ease-in, left 1.4s ease-out, opacity 1.4s linear; }

/* Box-Modell wie im Original-Umfeld: der Slam Manager lief unter einem Theme mit
   globalem border-box. Ohne das rendert .cmp-wb-bar-fill (padding-top 20px) 20px
   HOEHER als seine style.height - der farbige Gewinnerbalken stand ueber der grauen
   Decke (Harness-Messung 2026-09-02: 610px bei 590px Decke), und der Kopf war 160
   statt 120px hoch. */
#cmp-winner-board, #cmp-winner-board *, #cmp-winner-board *::before, #cmp-winner-board *::after { box-sizing: border-box; }

/* Statistik-Einblendung (Original .cwm-statistics-overlay, Taste B in der Vorschau) */
.cmp-wb-statistics-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.85); padding: 20px; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.cmp-wb-statistics-content { color: #fff; font-size: 56px; font-weight: 700; text-align: center; text-shadow: 2px 2px 4px rgba(0,0,0,.5); }

/* ---------- Steuerleiste unter der Buehne (Vollbild-Knopf + Tastenhilfe) ---------- */
.cmp-wb-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin: 0 0 24px; color: var(--mmdb-text-soft); font-family: var(--mmdb-font-body);
}
.cmp-wb-toolbar-hint { font-size: 0.85rem; color: var(--mmdb-text-muted); }
.cmp-wb-toolbar-title { margin-left: auto; font-size: 0.85rem; color: var(--mmdb-text-muted); }
/* Auf weissem Seitengrund (Theme ohne dunkle Shell) bleibt die Leiste lesbar */
.cmp-wb-toolbar { background: var(--mmdb-panel); padding: 10px 14px; border-radius: var(--mmdb-r-ctl); }
