/* ═══════════════════════════════════════════════════════════
   TV SPECTATEUR OVERLAY
   Plein écran paysage, 100vw × 100vh
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay racine ──────────────────────────────────────── */
#tv-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: url('../assets/images/bg_tv.webp') center center / cover no-repeat;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  z-index: 9999;
  overflow: hidden;
  flex-direction: column;
}
#tv-overlay.active { display: flex; }

/* ── Boutons haut droite (cercles rouges style jeu) ─────── */
#tv-top-controls {
  position: absolute;
  top: 1.5vh;
  right: 1.8vw;
  display: flex;
  gap: 1vw;
  z-index: 10001;
}

.tv-game-btn {
  background: #c0182a;
  border: 0.5vh solid #8b0f1e;
  color: #fff;
  width: 6.5vh;
  height: 6.5vh;
  border-radius: 50%;
  font-size: 2.4vh;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.6vh 0 #6e0a17, 0 1vh 2vh rgba(0,0,0,0.5);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.tv-game-btn:active {
  transform: translateY(0.4vh);
  box-shadow: 0 0.2vh 0 #6e0a17;
}
.tv-game-btn.tv-btn-off {
  background: #475569;
  border-color: #1e293b;
  box-shadow: 0 0.6vh 0 #0f172a, 0 1vh 2vh rgba(0,0,0,0.5);
}

/* ── Layout principal (colonnes) ─────────────────────────── */
#tv-main {
  display: flex;
  flex-direction: row;
  gap: 1.4vw;
  padding: 1.5vh 2vw 1vh;
  flex: 0 0 auto;
  height: 62vh;
  align-items: stretch;
}

/* Panneau droit décalé pour laisser place aux boutons */
#tv-col-stats {
  padding-top: 9vh;
}

/* ── Panneaux gauche/droite ──────────────────────────────── */
.tv-panel {
  width: 22vw;
  flex-shrink: 0;
  background: rgba(4, 22, 12, 0.82);
  border: 2px solid rgba(80, 200, 100, 0.35);
  border-radius: 18px;
  padding: 1.6vh 1.4vw;
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4), 0 4px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.tv-panel-title {
  font-size: 1.8vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5vw;
  padding-bottom: 0.8vh;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 0.4vh;
}
.tv-star { color: #ffde00; font-size: 1.4vh; }
.tv-panel-icon { font-size: 1.8vh; }

/* ── Colonne centrale ────────────────────────────────────── */
#tv-col-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.2vh 0 0.8vh;
  gap: 1vh;
}

#tv-logo-img {
  width: 100%;
  max-height: 18vh;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6));
}

#tv-manche-label {
  font-size: 2vh;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-top: -0.5vh;
}

/* Timer pill ─────────────── */
#tv-timer-wrap {
  background: linear-gradient(160deg, #7c3aed 0%, #4f46e5 60%, #3730a3 100%);
  border: 4px solid rgba(196,167,255,0.55);
  border-radius: 80px;
  padding: 1.8vh 5vw;
  display: flex;
  align-items: center;
  gap: 1.5vw;
  box-shadow:
    0 0 40px rgba(124,58,237,0.7),
    0 6px 0 rgba(30,20,80,0.6),
    inset 0 3px 0 rgba(255,255,255,0.2);
}
.tv-timer-icon {
  font-size: 10vh;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 20px rgba(196,167,255,0.8), 0 2px 4px rgba(0,0,0,0.5);
  animation: tv-icon-pulse 2s ease-in-out infinite;
}
@keyframes tv-icon-pulse {
  0%,100% { transform: scale(1);    opacity: 0.9; }
  50%     { transform: scale(1.08); opacity: 1; }
}
#tv-timer {
  font-size: 10vh;
  font-weight: 700;
  color: #fff;
  letter-spacing: 6px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(255,255,255,0.5), 0 3px 6px rgba(0,0,0,0.4);
  line-height: 1;
}
#tv-timer.tv-timer--urgent {
  color: #ef4444;
  animation: tv-timer-flash 0.5s ease-in-out infinite alternate;
}
@keyframes tv-timer-flash {
  from { text-shadow: 0 0 10px rgba(239,68,68,0.4); }
  to   { text-shadow: 0 0 30px rgba(239,68,68,0.9); }
}

/* Dernier mot trouvé ─────── */
#tv-last-word-box {
  background: rgba(4, 22, 12, 0.8);
  border: 2px solid rgba(74,222,128,0.4);
  border-radius: 16px;
  padding: 1.2vh 2.5vw;
  text-align: center;
  width: 100%;
  box-shadow: 0 0 24px rgba(74,222,128,0.15);
}
#tv-last-word-label {
  font-size: 1.6vh;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.6vh;
}
#tv-last-word-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5vw;
}
#tv-last-word-text {
  font-size: 5.5vh;
  font-weight: 700;
  color: #4ade80;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(74,222,128,0.5);
  letter-spacing: 4px;
  transition: none;
}
#tv-last-word-text.tv-word-flash {
  animation: tv-word-pop 0.5s cubic-bezier(.17,.67,.35,1.3);
}
@keyframes tv-word-pop {
  0%   { transform: scale(0.7); opacity: 0.4; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1);   opacity: 1; }
}
#tv-last-word-pts {
  font-size: 3.6vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  text-shadow: 0 0 12px rgba(255,222,0,0.5);
}

/* ── Classement live (colonne gauche) ────────────────────── */
#tv-ranking-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5vh;
  overflow: hidden;
}

.tv-rank-item {
  display: flex;
  align-items: center;
  gap: 0.8vw;
  padding: 0.5vh 0.5vw;
  border-radius: 10px;
  transition: background 0.3s ease;
}
.tv-rank-item.tv-rank-top3 {
  padding: 0.8vh 0.7vw;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.tv-rank-item.tv-rank-top3:first-child {
  background: rgba(255,215,0,0.1);
  border-color: rgba(255,215,0,0.25);
}

.tv-rank-medal {
  font-size: 2.4vh;
  width: 2.8vh;
  text-align: center;
  flex-shrink: 0;
}
.tv-rank-pos {
  font-size: 1.8vh;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  width: 2vh;
  text-align: center;
  flex-shrink: 0;
}

.tv-rank-avatar-wrap {
  width: 4.5vh;
  height: 4.5vh;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}
.tv-rank-avatar-wrap .avatar-sprite {
  width: 4.5vh !important;
  height: 4.5vh !important;
  border-radius: 50%;
}

.tv-rank-name {
  flex: 1;
  font-size: 1.9vh;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-rank-score {
  font-size: 2vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tv-rank-score-unit {
  font-size: 1.3vh;
  font-weight: 600;
  color: rgba(255,222,0,0.7);
}

/* Séparateur top3 / reste */
.tv-rank-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0.4vh 0;
}

/* Classement chargé (>8 joueurs) : top 4 normal, reste sur 2 colonnes
   et rapetissé progressivement pour afficher jusqu'à 16 joueurs. */
#tv-ranking-list.tv-ranking-many {
  gap: 0.3vh;
}
.tv-rank-rest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3vh 0.5vw;
  align-content: start;
}
.tv-rank-item.tv-rank-compact {
  --rank-scale: 1;
  padding: calc(0.25vh * var(--rank-scale)) calc(0.5vw * var(--rank-scale));
  gap: 0.4vw;
}
.tv-rank-item.tv-rank-compact .tv-rank-avatar-wrap,
.tv-rank-item.tv-rank-compact .tv-rank-avatar-wrap .avatar-sprite {
  width: calc(3.2vh * var(--rank-scale)) !important;
  height: calc(3.2vh * var(--rank-scale)) !important;
}
.tv-rank-item.tv-rank-compact .tv-rank-pos {
  font-size: calc(1.5vh * var(--rank-scale));
  width: auto;
  min-width: 1.6vh;
}
.tv-rank-item.tv-rank-compact .tv-rank-name {
  font-size: calc(1.5vh * var(--rank-scale));
}
.tv-rank-item.tv-rank-compact .tv-rank-score {
  font-size: calc(1.5vh * var(--rank-scale));
}
.tv-rank-item.tv-rank-compact .tv-rank-score-unit {
  font-size: calc(1vh * var(--rank-scale));
}

/* ── Statistiques (colonne droite) ───────────────────────── */
.tv-stat-block {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 0.8vh 0.9vw;
  border: 1px solid rgba(255,255,255,0.07);
}
.tv-stat-block--best {
  border-color: rgba(255,222,0,0.2);
  background: rgba(255,222,0,0.04);
}
.tv-stat-label {
  font-size: 1.3vh;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.3vh;
}
.tv-stat-value {
  font-size: 3.2vh;
  font-weight: 700;
  color: var(--accent-lime, #c7ea1b);
  font-variant-numeric: tabular-nums;
}
.tv-stat-best-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.8vw;
}
#tv-stat-best-word {
  font-size: 2.4vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  text-transform: uppercase;
  letter-spacing: 1px;
}
#tv-stat-best-pts {
  font-size: 1.8vh;
  font-weight: 700;
  color: rgba(255,222,0,0.7);
}

/* ═══════════════════════════════════════════════════════════
   BANDE BASSE — CARTES JOUEURS
   ═══════════════════════════════════════════════════════════ */

#tv-players-strip {
  flex: 1;
  display: grid;
  gap: 1.2vw;
  padding: 0.5vh 2vw 1.5vh;
  align-items: stretch;
  overflow: hidden;
  min-height: 0;
}

/* Colonnes auto selon le nombre de joueurs */
#tv-players-strip[data-cols="1"]  { grid-template-columns: repeat(1,  1fr); }
#tv-players-strip[data-cols="2"]  { grid-template-columns: repeat(2,  1fr); }
#tv-players-strip[data-cols="3"]  { grid-template-columns: repeat(3,  1fr); }
#tv-players-strip[data-cols="4"]  { grid-template-columns: repeat(4,  1fr); }
#tv-players-strip[data-cols="5"]  { grid-template-columns: repeat(5,  1fr); }
#tv-players-strip[data-cols="6"]  { grid-template-columns: repeat(6,  1fr); }
#tv-players-strip[data-cols="7"]  { grid-template-columns: repeat(7,  1fr); }
#tv-players-strip[data-cols="8"]  { grid-template-columns: repeat(8,  1fr); }

/* ── Animation avatar scoré ──────────────────────────────── */
@keyframes tv-avatar-pop {
  0%   { transform: scale(1);    filter: brightness(1); }
  30%  { transform: scale(1.9);  filter: brightness(1.5) drop-shadow(0 0 8px var(--glow-color, #ffde00)); z-index: 10; }
  60%  { transform: scale(1.5);  filter: brightness(1.3); }
  100% { transform: scale(1);    filter: brightness(1); }
}

.tv-card-avatar-wrap.tv-avatar-pop {
  animation: tv-avatar-pop 0.55s cubic-bezier(.17,.67,.35,1.3);
  position: relative;
  z-index: 10;
  overflow: visible;
}

/* +pts flottant */
.tv-float-pts {
  position: absolute;
  top: -1.5vh;
  right: -0.5vw;
  font-size: 2vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  text-shadow: 0 0 8px rgba(255,222,0,0.7);
  pointer-events: none;
  white-space: nowrap;
  animation: tv-float-up 1.1s ease-out forwards;
  z-index: 20;
}
@keyframes tv-float-up {
  0%   { opacity: 1;   transform: translateY(0)   scale(1); }
  40%  { opacity: 1;   transform: translateY(-3vh) scale(1.15); }
  100% { opacity: 0;   transform: translateY(-6vh) scale(0.9); }
}

/* ── Carte joueur ────────────────────────────────────────── */
.tv-card {
  background: rgba(4, 22, 12, 0.82);
  border: 2px solid rgba(80,180,100,0.3);
  border-radius: 14px;
  padding: 0.8vh 0.8vw;
  display: flex;
  flex-direction: column;
  gap: 0.5vh;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
  overflow: visible;
  position: relative;
}
.tv-card.tv-card--leader {
  border-color: rgba(255,222,0,0.7);
  background: rgba(20, 22, 4, 0.88);
  box-shadow: 0 0 20px rgba(255,222,0,0.25);
}
.tv-card.tv-card--trap {
  border-color: rgba(239,68,68,0.7);
  animation: tv-card-trap 0.8s ease-in-out 2;
}
@keyframes tv-card-trap {
  0%,100% { box-shadow: none; }
  50%     { box-shadow: 0 0 24px rgba(239,68,68,0.6); }
}

/* En-tête de carte */
.tv-card-header {
  display: flex;
  align-items: center;
  gap: 0.5vw;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.tv-card-avatar-wrap {
  width: 3.8vh;
  height: 3.8vh;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: visible;
  position: relative;
}
.tv-card-avatar-wrap .avatar-sprite {
  width: 3.8vh !important;
  height: 3.8vh !important;
  border-radius: 50%;
}
.tv-card-name {
  flex: 1;
  font-size: 1.6vh;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-card-score {
  font-size: 2vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: color 0.2s, text-shadow 0.2s;
}
.tv-card-score.tv-score-bump {
  color: #fff;
  text-shadow: 0 0 12px rgba(255,222,0,0.8);
}
.tv-card-score-unit {
  font-size: 1.1vh;
  color: rgba(255,222,0,0.6);
  font-weight: 600;
}

/* Corps de la carte : grille + mots */
.tv-card-body {
  flex: 1;
  display: flex;
  gap: 0.6vw;
  min-height: 0;
  overflow: hidden;
}

/* Mini-grille 4×4 */
.tv-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3vmin;
  flex-shrink: 0;
  align-self: start;
  aspect-ratio: 1;
  position: relative;
  /* Hauteur contrainte par le parent */
  width: auto;
  height: 100%;
  max-height: 13vh;
}
.tv-card[data-size="5"] .tv-mini-grid {
  grid-template-columns: repeat(5, 1fr);
}
.tv-card[data-size="5"] .tv-mini-cell {
  font-size: 1.05vh;
}
.tv-mini-cell {
  background: var(--tile-normal, #fdfbf0);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3vh;
  font-weight: 700;
  color: var(--tile-text, #123117);
  aspect-ratio: 1;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.tv-mini-cell.tv-cell--trapped {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 0 6px rgba(220,38,38,0.7);
}
.tv-mini-cell.tv-cell--used {
  background: var(--tile-active, #d1f416);
  color: var(--tile-text, #123117);
}
.tv-mini-cell.tv-cell--lit {
  background: #facc15;
  color: #1a1a1a;
  box-shadow: 0 0 8px rgba(250,204,21,0.9);
  transform: scale(1.08);
  z-index: 1;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* ── Badge action joueur (indice / mélanger / cible) ────── */
.tv-action-badge {
  position: absolute;
  top: -1vh;
  left: 50%;
  transform: translateX(-50%);
  background: var(--badge-color, #fff);
  color: #000;
  font-size: 1.5vh;
  font-weight: 700;
  padding: 0.4vh 1vw;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  animation: tv-badge-life 2.2s ease-out forwards;
}
@keyframes tv-badge-life {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0.5vh); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; transform: translateX(-50%) translateY(-0.5vh); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-1.5vh); }
}

/* Flash cellule lors du mélange */
.tv-mini-cell.tv-cell--shuffle {
  animation: tv-cell-shuffle 0.5s ease-out;
}
@keyframes tv-cell-shuffle {
  0%   { transform: scale(1);    background: #1eb0ff; color: #fff; }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1);    background: var(--tile-normal, #fdfbf0); color: var(--tile-text, #123117); }
}

/* Historique des mots */
.tv-word-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3vh;
  justify-content: flex-start;
  overflow: hidden;
}

/* Au-delà de 8 joueurs : masquer l'historique, la grille occupe la carte */
#tv-players-strip.tv-hide-words .tv-word-history {
  display: none;
}
#tv-players-strip.tv-hide-words .tv-mini-grid {
  max-height: none;
  margin: 0 auto;
}
.tv-word-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 0.3vh 0.4vw;
  border-left: 3px solid rgba(74,222,128,0.6);
  gap: 0.3vw;
  animation: tv-chip-in 0.25s ease-out;
  flex-shrink: 0;
}
.tv-word-chip--trap {
  border-left-color: rgba(239,68,68,0.8);
  background: rgba(239,68,68,0.1);
}
@keyframes tv-chip-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tv-word-chip-text {
  font-size: 1.3vh;
  font-weight: 700;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-word-chip--trap .tv-word-chip-text {
  color: #f87171;
}
.tv-word-chip-pts {
  font-size: 1.2vh;
  font-weight: 700;
  color: rgba(255,222,0,0.8);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   ÉCRAN D'ATTENTE
   ═══════════════════════════════════════════════════════════ */

#tv-waiting {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5vh;
  background: rgba(4,12,8,0.75);
  backdrop-filter: blur(6px);
}
#tv-overlay.tv-waiting-active #tv-waiting { display: flex; }

.tv-waiting-icon {
  font-size: 10vh;
  animation: tv-pulse 2.2s ease-in-out infinite;
}
.tv-waiting-text {
  font-size: 3.5vh;
  color: rgba(255,255,255,0.8);
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}
@keyframes tv-pulse {
  0%,100% { transform: scale(1);    opacity: 1; }
  50%     { transform: scale(1.1);  opacity: 0.65; }
}

.tv-waiting-count {
  font-size: 2.6vh;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 2px;
}
.tv-waiting-count:empty { display: none; }

.tv-waiting-players {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1.6vh 1.2vw;
  width: 88vw;
  max-width: 1700px;
  justify-items: center;
}
.tv-waiting-players:empty { display: none; }

.tv-wait-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8vh;
  animation: tv-wait-pop 0.3s ease both;
}
.tv-wait-player .avatar-sprite {
  width: 8vh;
  height: 8vh;
  border-radius: 50%;
}
.tv-wait-name {
  font-size: 2vh;
  font-weight: 700;
  color: #fff;
  max-width: 9vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
@keyframes tv-wait-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   SPLASH GAGNANT
   ═══════════════════════════════════════════════════════════ */

#tv-winner-splash {
  display: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #1a3a10 0%, #050d03 70%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5vh;
  z-index: 8;
  overflow: hidden;
  animation: tv-splash-in 0.5s ease-out;
}
#tv-winner-splash.active { display: flex; }

@keyframes tv-splash-in {
  from { opacity: 0; transform: scale(1.05); }
  to   { opacity: 1; transform: scale(1); }
}

/* Rayons lumineux tournants */
#tv-winner-rays {
  position: absolute;
  inset: -20%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg, rgba(199,234,27,0.07) 10deg, transparent 20deg,
    transparent 60deg, rgba(255,222,0,0.06) 70deg, transparent 80deg,
    transparent 120deg, rgba(199,234,27,0.07) 130deg, transparent 140deg,
    transparent 180deg, rgba(255,222,0,0.06) 190deg, transparent 200deg,
    transparent 240deg, rgba(199,234,27,0.07) 250deg, transparent 260deg,
    transparent 300deg, rgba(255,222,0,0.06) 310deg, transparent 320deg
  );
  animation: tv-rays-spin 8s linear infinite;
}
@keyframes tv-rays-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Avatar gagnant */
#tv-winner-avatar-wrap {
  width: 28vh;
  height: 28vh;
  border-radius: 50%;
  border: 6px solid var(--accent-yellow, #ffde00);
  box-shadow:
    0 0 60px rgba(255,222,0,0.5),
    0 0 120px rgba(255,222,0,0.2),
    inset 0 0 30px rgba(255,222,0,0.1);
  overflow: hidden;
  animation: tv-winner-bounce 0.8s cubic-bezier(.17,.67,.35,1.3) 0.3s both;
}
#tv-winner-avatar-wrap .avatar-sprite {
  width: 28vh !important;
  height: 28vh !important;
  border-radius: 50%;
}
@keyframes tv-winner-bounce {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#tv-winner-name {
  font-size: 8vh;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
  letter-spacing: 3px;
  animation: tv-winner-slidein 0.5s ease-out 0.6s both;
}
#tv-winner-label {
  font-size: 7vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  letter-spacing: 6px;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(255,222,0,0.7), 0 4px 12px rgba(0,0,0,0.5);
  animation: tv-winner-slidein 0.5s ease-out 0.8s both;
}
#tv-winner-score {
  font-size: 5vh;
  font-weight: 700;
  color: var(--accent-lime, #c7ea1b);
  text-shadow: 0 0 20px rgba(199,234,27,0.5);
  letter-spacing: 2px;
  animation: tv-winner-slidein 0.5s ease-out 1s both;
}
@keyframes tv-winner-slidein {
  from { opacity: 0; transform: translateY(3vh); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   ÉCRAN DE FIN
   ═══════════════════════════════════════════════════════════ */

#tv-finished {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(4,12,8,0.92);
  backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
  z-index: 5;
}

#tv-finished-title {
  font-size: 6vh;
  font-weight: 700;
  color: var(--accent-yellow, #ffde00);
  letter-spacing: 8px;
  text-shadow: 0 0 40px rgba(255,222,0,0.5);
}

#tv-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4vw;
}

.tv-podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5vh;
}
.tv-podium-avatar-wrap {
  width: 10vh;
  height: 10vh;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.3);
}
.tv-podium-avatar-wrap .avatar-sprite {
  width: 10vh !important;
  height: 10vh !important;
  border-radius: 50%;
}
.tv-podium-rank   { font-size: 5vh;  font-weight: 700; color: var(--accent-yellow, #ffde00); }
.tv-podium-name   { font-size: 2.8vh; font-weight: 700; color: #fff; }
.tv-podium-score  { font-size: 2.4vh; font-weight: 700; color: var(--accent-lime, #c7ea1b); }

.tv-podium-step--1 { margin-bottom: 5vh; }
.tv-podium-step--2 { margin-bottom: 2.5vh; }
.tv-podium-step--3 { margin-bottom: 0; }

