/* ==========================================================================
   BODYCAM SPECTATOR BROADCAST - STYLESHEET
   Design System: Tactical Dark Glassmorphism & Cyber-Military E-sports
   ========================================================================== */

:root {
  --bg-dark: #0a0c10;
  --bg-card: rgba(18, 22, 31, 0.75);
  --bg-card-hover: rgba(26, 32, 45, 0.9);
  
  --alpha-color: #00d2ff;
  --alpha-glow: rgba(0, 210, 255, 0.4);
  --bravo-color: #ff3e3e;
  --bravo-glow: rgba(255, 62, 62, 0.4);

  --text-main: #f0f4f8;
  --text-muted: #8a99ad;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-gold: #ffb703;
  --success-color: #00e676;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-tactical: 'Rajdhani', sans-serif;
}

.team-name-editable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.team-name-editable:hover {
  opacity: 0.8;
  text-decoration: underline;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Background Grid Overlay */
.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Screens Visibility */
.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.screen:not(.active) {
  display: none !important;
}

.screen.active {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 100 !important;
  background-color: #0a0c10 !important;
}

.hidden {
  display: none !important;
}

/* ==================== 1. LOBBY SCREEN ==================== */

#lobby-screen {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: radial-gradient(circle at center, #161c28 0%, #0a0c10 100%);
}

.lobby-container {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

#lobby-screen {
  background: radial-gradient(circle at 50% 12%, rgba(255, 42, 95, 0.14) 0%, rgba(10, 14, 22, 0.98) 60%), #070a10 !important;
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 2rem;
}

.lobby-logo-img {
  max-width: 330px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(255, 42, 95, 0.55)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: logoFloat 4s infinite ease-in-out;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 22px rgba(255, 42, 95, 0.5));
  }
  50% {
    transform: translateY(-4px) scale(1.02);
    filter: drop-shadow(0 0 36px rgba(255, 42, 95, 0.8)) drop-shadow(0 0 14px rgba(255, 255, 255, 0.4));
  }
}

.lobby-logo-subtitle {
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: #f1f5f9;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 8px;
  text-shadow: 0 0 16px rgba(255, 42, 95, 0.75), 0 0 25px rgba(255, 255, 255, 0.4);
}

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
}

.role-card {
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.85) 0%, rgba(10, 14, 22, 0.95) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.role-card:hover {
  border-color: rgba(255, 42, 95, 0.45);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 42, 95, 0.25);
  transform: translateY(-4px);
}

.role-icon {
  font-size: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto 12px auto;
  width: 100%;
  filter: drop-shadow(0 0 14px rgba(0, 210, 255, 0.4));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-card:hover .role-icon {
  transform: scale(1.12);
}

.role-card h2 {
  font-family: var(--font-tactical);
  font-size: 1.8rem;
  letter-spacing: 1px;
  text-align: center;
}

.role-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input, .form-group select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--alpha-color);
}

.team-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-team {
  padding: 0.7rem;
  border: 1px solid var(--border-color);
  background: rgba(0,0,0,0.3);
  color: var(--text-muted);
  font-weight: 700;
  font-family: var(--font-tactical);
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-team.btn-alpha.active {
  background: var(--alpha-glow);
  border-color: var(--alpha-color);
  color: #fff;
  box-shadow: 0 0 15px var(--alpha-glow);
}

.btn-team.btn-bravo.active {
  background: var(--bravo-glow);
  border-color: var(--bravo-color);
  color: #fff;
  box-shadow: 0 0 15px var(--bravo-glow);
}

/* ==================== ANIMATIONS NÉON CYBER & ESPACE JOUEUR ==================== */
@keyframes neonBorderPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4), inset 0 0 8px rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
  }
  50% {
    box-shadow: 0 0 28px rgba(0, 255, 136, 0.75), inset 0 0 14px rgba(0, 255, 136, 0.35);
    border-color: #5affb0;
  }
}

@keyframes neonBluePulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.45), inset 0 0 6px rgba(0, 210, 255, 0.2);
    border-color: #00d2ff;
  }
  50% {
    box-shadow: 0 0 26px rgba(0, 210, 255, 0.85), inset 0 0 12px rgba(0, 210, 255, 0.35);
    border-color: #70ecff;
  }
}

@keyframes neonRedPulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(255, 62, 62, 0.45), inset 0 0 6px rgba(255, 62, 62, 0.2);
    border-color: #ff3e3e;
  }
  50% {
    box-shadow: 0 0 26px rgba(255, 62, 62, 0.85), inset 0 0 12px rgba(255, 62, 62, 0.35);
    border-color: #ff7575;
  }
}

@keyframes neonAlertGlow {
  0%, 100% {
    box-shadow: 0 0 14px rgba(255, 42, 95, 0.35);
    border-color: rgba(255, 42, 95, 0.6);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 42, 95, 0.65);
    border-color: rgba(255, 42, 95, 0.9);
  }
}

/* Carte Espace Joueur */
.player-hub-card {
  position: relative;
  background: linear-gradient(180deg, rgba(14, 20, 32, 0.85) 0%, rgba(8, 12, 20, 0.95) 100%);
  border: 1.5px solid rgba(0, 210, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 210, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  padding: 1.8rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-hub-card:hover {
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 28px rgba(0, 210, 255, 0.2);
}

/* Bannière Téléchargement OBS */
.obs-alert-card {
  background: linear-gradient(135deg, rgba(255, 42, 95, 0.16) 0%, rgba(16, 20, 30, 0.9) 100%);
  border: 1.5px solid rgba(255, 42, 95, 0.7);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  text-align: center;
  animation: neonAlertGlow 3s infinite ease-in-out;
}

.obs-alert-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: #ff4d79;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 0 10px rgba(255, 77, 121, 0.6);
}

.obs-alert-desc {
  margin: 5px 0 10px 0;
  font-size: 0.78rem;
  color: #cbd5e0;
}

.obs-alert-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ff2a5f 0%, #ff6b6b 100%);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 5px;
  box-shadow: 0 0 14px rgba(255, 42, 95, 0.6);
  transition: all 0.25s ease;
}

.obs-alert-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 22px rgba(255, 42, 95, 0.9);
  color: #ffffff;
}

.neon-title {
  font-family: var(--font-tactical);
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  margin-bottom: 4px;
  text-align: center;
}

.neon-subtitle {
  font-size: 0.85rem;
  color: #a0aec0;
  margin-bottom: 8px;
  text-align: center;
}

.neon-label {
  font-family: var(--font-tactical);
  font-size: 0.85rem;
  font-weight: 800;
  color: #64d2ff;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
  text-shadow: 0 0 6px rgba(0, 210, 255, 0.4);
}

/* Pseudo Input Gaming */
#player-name {
  width: 100%;
  background: rgba(10, 14, 22, 0.85);
  border: 1.5px solid rgba(0, 210, 255, 0.35);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#player-name:focus {
  border-color: #00d2ff;
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.5), inset 0 0 8px rgba(0, 210, 255, 0.2);
  outline: none;
  background: rgba(12, 18, 30, 0.95);
}

/* Conteneur et Boutons de Choix d'Équipe */
.team-picker-container {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-team-picker {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-tactical);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #a0aec0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-team-picker:hover {
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-team-picker.active-alpha {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 114, 255, 0.15) 100%) !important;
  border: 2px solid var(--alpha-color) !important;
  color: #ffffff !important;
  animation: neonBluePulse 2.5s infinite ease-in-out !important;
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.8) !important;
}

.btn-team-picker.active-bravo {
  background: linear-gradient(135deg, rgba(255, 62, 62, 0.25) 0%, rgba(180, 0, 0, 0.15) 100%) !important;
  border: 2px solid var(--bravo-color) !important;
  color: #ffffff !important;
  animation: neonRedPulse 2.5s infinite ease-in-out !important;
  text-shadow: 0 0 10px rgba(255, 62, 62, 0.8) !important;
}

/* Grille des Emplacements Slots */
.slot-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.slot-picker-btn {
  padding: 10px 4px;
  border-radius: 8px;
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 14, 22, 0.7);
}

.slot-picker-btn.free {
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.04);
}

.slot-picker-btn.free:hover {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.18);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.45);
  transform: translateY(-3px) scale(1.04);
}

.slot-picker-btn.selected-alpha {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.35) 0%, rgba(0, 114, 255, 0.2) 100%) !important;
  border: 2px solid var(--alpha-color) !important;
  color: #ffffff !important;
  animation: neonBluePulse 2.5s infinite ease-in-out !important;
  transform: translateY(-2px) scale(1.05);
}

.slot-picker-btn.selected-bravo {
  background: linear-gradient(135deg, rgba(255, 62, 62, 0.35) 0%, rgba(180, 0, 0, 0.2) 100%) !important;
  border: 2px solid var(--bravo-color) !important;
  color: #ffffff !important;
  animation: neonRedPulse 2.5s infinite ease-in-out !important;
  transform: translateY(-2px) scale(1.05);
}

/* Slot Verrouillé (Occupé) */
.slot-picker-btn.taken {
  background: rgba(20, 25, 35, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #666 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.slot-picker-btn.taken .slot-tag-label {
  color: #888 !important;
}

.slot-picker-btn.taken .slot-status-label {
  color: #ff3e3e !important;
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Bouton Principal de Connexion Cyber Néon Rouge BDCM CUP */
.btn-submit-cyber {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, #ff2a5f 0%, #c4002e 100%) !important;
  color: #ffffff !important;
  font-family: var(--font-tactical) !important;
  font-size: 1.1rem !important;
  font-weight: 900 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 8px !important;
  padding: 14px 20px !important;
  box-shadow: 0 0 22px rgba(255, 42, 95, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !important;
  animation: neonAlertGlow 3s infinite ease-in-out !important;
}

.btn-submit-cyber:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 0 35px rgba(255, 42, 95, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  filter: brightness(1.15) !important;
}

.btn-submit-cyber:active {
  transform: translateY(1px) scale(0.99) !important;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #00d2ff 0%, #0072ff 100%);
  color: #fff;
  font-family: var(--font-tactical);
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  padding: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: scale(1.01);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  font-family: var(--font-tactical);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

#btn-join-spectator {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 42, 95, 0.25) 100%);
  border: 1.5px solid rgba(255, 42, 95, 0.6);
  color: #ffffff;
  font-family: var(--font-tactical);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 0 18px rgba(255, 42, 95, 0.35);
  border-radius: 8px;
  padding: 13px 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 0 10px rgba(255, 42, 95, 0.6);
}

#btn-join-spectator:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 42, 95, 0.5) 100%);
  box-shadow: 0 0 28px rgba(255, 42, 95, 0.7);
  transform: translateY(-2px) scale(1.02);
}

.btn-danger {
  background: rgba(255, 62, 62, 0.2);
  border: 1px solid var(--bravo-color);
  color: var(--bravo-color);
}
.btn-danger:hover {
  background: var(--bravo-color);
  color: #fff;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-footer {
  font-size: 0.9rem;
  color: var(--text-muted);
}


/* ==================== 2. PLAYER SCREEN ==================== */

#player-screen {
  padding: 2rem;
  gap: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.player-info-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-tag {
  font-family: var(--font-tactical);
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 1rem;
}

.team-tag.alpha { background: var(--alpha-glow); color: var(--alpha-color); border: 1px solid var(--alpha-color); }
.team-tag.bravo { background: var(--bravo-glow); color: var(--bravo-color); border: 1px solid var(--bravo-color); }

.player-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.slot-badge {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.player-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  height: calc(100% - 100px);
}

.stream-controls-card, .preview-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preset-info {
  background: rgba(0, 210, 255, 0.1);
  border-left: 4px solid var(--alpha-color);
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.video-preview-wrapper {
  flex: 1;
  background: #000;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

#player-local-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.placeholder {
  position: absolute;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stream-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}


/* ==================== 3. SPECTATOR / CASTER BROADCAST SCREEN ==================== */

#spectator-screen {
  background-color: var(--bg-dark);
}

/* Caster Top HUD Bar */
.caster-hud {
  height: 60px;
  background: rgba(10, 12, 16, 0.95);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 10;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.35s ease;
}

.caster-hud.collapsed {
  transform: translateY(-100%);
  margin-top: -60px;
}

/* Bouton Réducteur de Header placé dans le header de la Team 1 à gauche de 0/5 */
.btn-toggle-hud {
  position: relative;
  background: rgba(15, 20, 28, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 7px;
  margin-left: auto;
  margin-right: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
  z-index: 100;
  pointer-events: auto;
}

.btn-toggle-hud:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rec-badge {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success-color);
  border: 1px solid var(--success-color);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-tactical);
  letter-spacing: 1px;
}

.match-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-tactical);
  font-size: 1.4rem;
  font-weight: 700;
}

.team-alpha-text { color: var(--alpha-color); }
.team-bravo-text { color: var(--bravo-color); }

.score-number {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  font-size: 1.6rem;
}

.score-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
.score-btn:hover { background: rgba(255, 255, 255, 0.2); }

.active-player-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-tactical);
}

.hud-label { color: var(--text-muted); font-size: 0.9rem; }
.hud-player-name { font-size: 1.3rem; font-weight: 700; color: #fff; }

.hud-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hud-btn:hover { background: rgba(255, 255, 255, 0.15); }


/* Broadcast Workspace (Sidebars + Main Stage) */
.broadcast-workspace {
  display: flex;
  height: calc(100vh - 60px);
  width: 100vw;
  position: relative;
}

/* Sidebars (5v5 Layout) */
.team-sidebar {
  width: 240px;
  background: rgba(14, 17, 24, 0.85);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.sidebar-bravo {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.sidebar-header {
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-alpha .sidebar-header h2 { font-family: var(--font-tactical); color: var(--alpha-color); font-size: 1.2rem; }
.sidebar-bravo .sidebar-header h2 { font-family: var(--font-tactical); color: var(--bravo-color); font-size: 1.2rem; }

.team-count { font-size: 0.85rem; color: var(--text-muted); }

.thumbnails-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.6rem;
  overflow-y: auto;
}

/* Miniature Player Card */
.player-thumb-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.player-thumb-card:hover {
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Animated Rotating Neon Light Around Active Main Stage Thumbnail */
@keyframes spinNeonGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.player-thumb-card.selected-alpha,
.player-thumb-card.selected-bravo {
  padding: 3.5px !important;
  border: none !important;
  position: relative !important;
  overflow: hidden !important;
  z-index: 10 !important;
  transform: scale(1.03) !important;
  border-radius: 10px !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.player-thumb-card.selected-alpha > *,
.player-thumb-card.selected-bravo > * {
  position: relative;
  z-index: 2;
  border-radius: 6px;
  background: #060910;
}

/* Team 1 Alpha (Cyan Electric Rotating Neon Beam Ultra Visible) */
.player-thumb-card.selected-alpha {
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.9), 0 0 50px rgba(0, 210, 255, 0.45) !important;
}

.player-thumb-card.selected-alpha::before {
  content: '';
  position: absolute;
  top: -150%;
  left: -150%;
  width: 400%;
  height: 400%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 160deg,
    rgba(0, 210, 255, 0.3) 220deg,
    #00d2ff 290deg,
    #ffffff 350deg,
    #00d2ff 360deg
  );
  animation: spinNeonGlow 2s linear infinite;
  z-index: 1;
  pointer-events: none;
}

/* Team 2 Bravo (Crimson Red Electric Rotating Neon Beam Ultra Visible) */
.player-thumb-card.selected-bravo {
  box-shadow: 0 0 25px rgba(255, 42, 95, 0.9), 0 0 50px rgba(255, 42, 95, 0.45) !important;
}

.player-thumb-card.selected-bravo::before {
  content: '';
  position: absolute;
  top: -150%;
  left: -150%;
  width: 400%;
  height: 400%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 160deg,
    rgba(255, 42, 95, 0.3) 220deg,
    #ff2a5f 290deg,
    #ffffff 350deg,
    #ff2a5f 360deg
  );
  animation: spinNeonGlow 2s linear infinite;
  z-index: 1;
  pointer-events: none;
}

.thumb-video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
}

.thumb-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-no-signal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #666;
  background: #05070a;
}

/* En-tête Badge Nom Joueur sur la Miniature (Toujours Visible au-dessus de la Vidéo) */
.thumb-player-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: rgba(8, 10, 15, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  z-index: 15;
  pointer-events: none;
}

.thumb-slot-tag {
  font-family: var(--font-tactical);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.team-alpha .thumb-slot-tag {
  background: var(--alpha-glow);
  color: var(--alpha-color);
  border: 1px solid var(--alpha-color);
}

.team-bravo .thumb-slot-tag {
  background: var(--bravo-glow);
  color: var(--bravo-color);
  border: 1px solid var(--bravo-color);
}

.thumb-player-name-text {
  font-family: var(--font-tactical);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 1px 1px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.thumb-footer-bar {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 15;
  pointer-events: none;
}

.live-indicator {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: bold;
}

.live-indicator.on { background: var(--success-color); color: #000; box-shadow: 0 0 6px var(--success-color); }
.live-indicator.off { background: rgba(0, 0, 0, 0.7); color: #888; border: 1px solid #444; }


/* Main Stage (Center Video) */
.main-stage {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.main-stage-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#main-stage-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Banner Nom du Joueur (Police Impact En-dessous du Score) */
.main-stage-player-banner {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
  background: rgba(8, 11, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 2px solid var(--alpha-color);
  padding: 2px 16px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.main-stage-player-banner.team-alpha {
  border-bottom-color: var(--alpha-color);
  box-shadow: 0 2px 10px var(--alpha-glow);
}

.main-stage-player-banner.team-bravo {
  border-bottom-color: var(--bravo-color);
  box-shadow: 0 2px 10px var(--bravo-glow);
}

.main-stage-player-name {
  font-family: 'Orbitron', 'Impact', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #ffe600 35%, #d4af37 70%, #aa7c11 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: playerNameGoldLightGlow 2.5s infinite alternate ease-in-out;
}

@keyframes playerNameGoldLightGlow {
  0% {
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.8)) drop-shadow(0 0 8px rgba(255, 230, 0, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(255, 230, 0, 1)) drop-shadow(0 0 18px rgba(212, 175, 55, 0.85)) drop-shadow(0 0 30px rgba(212, 175, 55, 0.6));
    transform: scale(1.02);
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.8)) drop-shadow(0 0 10px rgba(255, 230, 0, 0.5));
    transform: scale(1);
  }
}

/* Affichage Haut de Gamme du Score et Équipes sur la Scène Principale (Tout en Haut) */
.main-stage-score-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  pointer-events: none;
  background: rgba(6, 9, 15, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Orbitron', 'Rajdhani', sans-serif;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(8px);
}

/* Équipe 1 (Bleu Cyan - Alpha) : Typographie Orbitron + Halo de Lumière Néon Pulsant */
.score-team-label.team-1 {
  font-family: 'Orbitron', 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #00f0ff 45%, #0088ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: teamAlphaLightGlow 2.5s infinite alternate ease-in-out;
}

@keyframes teamAlphaLightGlow {
  0% {
    filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.7)) drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(0, 240, 255, 1)) drop-shadow(0 0 16px rgba(0, 240, 255, 0.85)) drop-shadow(0 0 28px rgba(0, 240, 255, 0.6));
    transform: scale(1.02);
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.8)) drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
    transform: scale(1);
  }
}

/* Équipe 2 (Rouge Néon - Bravo) : Typographie Orbitron + Halo de Lumière Néon Pulsant */
.score-team-label.team-2 {
  font-family: 'Orbitron', 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #ff2a5f 45%, #ff0033 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: teamBravoLightGlow 2.5s infinite alternate ease-in-out;
}

@keyframes teamBravoLightGlow {
  0% {
    filter: drop-shadow(0 0 3px rgba(255, 42, 95, 0.7)) drop-shadow(0 0 8px rgba(255, 42, 95, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(255, 42, 95, 1)) drop-shadow(0 0 16px rgba(255, 42, 95, 0.85)) drop-shadow(0 0 28px rgba(255, 42, 95, 0.6));
    transform: scale(1.02);
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(255, 42, 95, 0.8)) drop-shadow(0 0 10px rgba(255, 42, 95, 0.5));
    transform: scale(1);
  }
}

.score-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.score-sep {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

/* ==================== 2D BROADCAST SLIDE TRANSITION : LOGO 1.0s PUIS GLISSÉ GAUCHE (translateX(-100%)) ==================== */
.main-stage-container {
  position: relative;
  overflow: hidden;
  background: #000000 !important;
}

.stage-deck {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-deck.background-deck {
  z-index: 10;
  transform: translateX(0);
}

.stage-deck.active-deck {
  z-index: 20;
  transform: translateX(0);
}

/* Étape 2 (à 1.0s) : Le flux vidéo 1 glisse de façon ultra-fluide vers la gauche */
.stage-deck.active-deck.video-sliding-left {
  will-change: transform;
  animation: videoSlideLeft 800ms cubic-bezier(0.25, 1, 0.3, 1) forwards;
}

@keyframes videoSlideLeft {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Container ZÉRO FOND BLEU, ZÉRO FLOU - 100% TRANSPARENT */
.transparent-flip-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  backdrop-filter: none !important;
  opacity: 0;
  overflow: hidden;
}

.transparent-flip-overlay.active {
  opacity: 1;
}

.flip-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.transparent-flip-overlay.active .flip-overlay-content {
  animation: transparentLogoPop 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes transparentLogoPop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  20% {
    transform: scale(1.05);
    opacity: 1;
  }
  55% {
    /* Affichage fixe du logo et pseudo pendant 1.0 seconde */
    transform: scale(1);
    opacity: 1;
  }
  100% {
    /* Déplacement fluide avec la sortie vers la gauche */
    transform: translateX(-80px) scale(0.9);
    opacity: 0;
  }
}

.transparent-flip-logo {
  width: 380px;
  max-width: 85vw;
  height: auto;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 12px 35px rgba(0, 0, 0, 0.95));
}

.transparent-flip-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', var(--font-tactical);
  background: rgba(10, 14, 22, 0.88);
  border: 2px solid var(--alpha-color);
  padding: 10px 36px;
  border-radius: 8px;
  box-shadow: 0 0 25px var(--alpha-glow);
  text-transform: uppercase;
  text-align: center;
}

.team-bravo .transparent-flip-tag {
  border-color: var(--bravo-color);
  box-shadow: 0 0 25px var(--bravo-glow);
}

/* BodyCam Tactical Overlay */
.bodycam-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  font-family: var(--font-tactical);
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.overlay-top, .overlay-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.cam-rec {
  color: var(--bravo-color);
  font-weight: 700;
  animation: blink 1.5s infinite alternate;
}

/* Radar Ping for Empty Stage */
.radar-ping {
  width: 60px;
  height: 60px;
  border: 2px solid var(--alpha-color);
  border-radius: 50%;
  animation: ping 2s infinite;
}

@keyframes ping {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* ==================== OBS CLEAN MODE ==================== */
#spectator-screen.clean-mode .caster-hud,
#spectator-screen.clean-mode .team-sidebar,
#spectator-screen.clean-mode .bodycam-overlay {
  display: none !important;
}

#spectator-screen.clean-mode .main-stage {
  width: 100vw !important;
  height: 100vh !important;
}

/* Mode 2nd Écran Activé : Masquer les sidebars sur l'écran principal pour garder la scène 1080p propre */
#spectator-screen.hide-sidebars .team-sidebar {
  display: none !important;
}

#spectator-screen.hide-sidebars .main-stage {
  width: 100vw !important;
}

.clean-mode-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 100;
  animation: fadeOut 4s forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

.hidden {
  display: none !important;
}

.mobile-team-tabs {
  display: none !important;
}

/* ==================== NATIVE MOBILE APP SPECTATOR V3 (SMARTPHONE ONLY) ==================== */
@media (max-width: 900px) {
  html, body {
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    touch-action: manipulation;
    background: #080b10 !important;
  }

  .mobile-team-tabs {
    display: flex !important;
    width: calc(100% - 16px) !important;
    margin: 6px 8px 4px 8px !important;
    height: 36px !important;
    min-height: 36px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 2px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .mobile-team-tab {
    flex: 1 !important;
    height: 100% !important;
    font-family: var(--font-tactical) !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
    touch-action: manipulation !important;
  }

  .mobile-team-tab.active {
    background: rgba(0, 210, 255, 0.2) !important;
    color: #ffffff !important;
    border: 1px solid var(--alpha-color) !important;
    box-shadow: 0 0 10px var(--alpha-glow) !important;
  }

  #tab-mobile-bravo.active {
    background: rgba(255, 62, 62, 0.2) !important;
    color: #ffffff !important;
    border: 1px solid var(--bravo-color) !important;
    box-shadow: 0 0 10px var(--bravo-glow) !important;
  }

  .team-sidebar.mobile-tab-hidden {
    display: none !important;
  }

  .screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .screen:not(.active) {
    display: none !important;
  }

  .screen.active {
    display: flex !important;
    flex-direction: column !important;
  }

  /* 1. Écran Lobby Mobile */
  #lobby-screen {
    overflow-y: auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }

  .lobby-container {
    width: 100% !important;
    max-width: 420px !important;
    margin: auto !important;
    gap: 1.2rem !important;
  }

  .roles-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .role-card {
    padding: 1rem !important;
  }

  .brand-header h1 {
    font-size: 1.8rem !important;
  }

  .btn-primary, .btn-secondary, .btn-action {
    width: 100% !important;
    min-height: 46px !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
  }

  /* 2. Barre Caster HUD Mobile (Fixe 48px) */
  .caster-hud {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 10px !important;
    background: rgba(14, 18, 26, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    z-index: 50 !important;
  }

  .hud-brand {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
  }

  .hud-player-info {
    display: none !important;
  }

  .hud-center {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .hud-score-control {
    padding: 2px 6px !important;
    font-size: 0.8rem !important;
  }

  .hud-score-val {
    font-size: 0.95rem !important;
    min-width: 16px !important;
  }

  .btn-popout {
    padding: 4px 6px !important;
    font-size: 0.7rem !important;
  }

  /* 3. Régie Spectateur Native Application Smartphone */
  #spectator-screen:not(.active) {
    display: none !important;
  }

  #spectator-screen.active {
    height: 100dvh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0a0c10 !important;
  }

  .app-layout, .broadcast-workspace {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    height: calc(100dvh - 48px) !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* Scène Principale Vidéo 16:9 Grande Taille (~60vh) sur Mobile */
  .main-stage {
    flex: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 55vh !important;
    max-height: 62vh !important;
    background: #000 !important;
    position: relative !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid var(--border-glass) !important;
  }

  .main-stage-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #main-stage-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .main-stage-score-badge, .bodycam-overlay {
    display: none !important;
  }

  .main-stage-player-banner {
    top: 6px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 25 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 3px 12px !important;
    border-radius: 4px !important;
  }

  .main-stage-player-name {
    font-size: 0.9rem !important;
    letter-spacing: 1px !important;
  }

  /* Bandeau de Miniatures 5v5 Grandement Réduit (Hauteur 68px sur Mobile) */
  .team-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 75px !important;
    padding: 4px 8px 10px 8px !important;
    box-sizing: border-box !important;
    background: rgba(10, 14, 20, 0.95) !important;
    border: none !important;
    overflow: hidden !important;
  }

  .sidebar-header {
    display: none !important;
  }

  .thumbnails-list {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 2px 2px 6px 2px !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .thumbnails-list::-webkit-scrollbar {
    display: none !important;
  }

  .player-thumb-card {
    flex: 0 0 100px !important;
    min-width: 100px !important;
    width: 100px !important;
    height: 68px !important;
    min-height: 68px !important;
    scroll-snap-align: start !important;
    margin: 0 !important;
    border-radius: 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    background: rgba(14, 18, 26, 0.95) !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    position: relative !important;
  }

  .player-thumb-card:nth-child(5) {
    grid-column: auto !important;
  }

  .thumb-video-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
  }

  .thumb-player-header {
    height: 16px !important;
    padding: 1px 4px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 15 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }

  .thumb-slot-tag {
    font-size: 0.6rem !important;
    padding: 0 3px !important;
  }

  .thumb-player-name-text {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
  }

  .thumb-no-signal span {
    font-size: 0.65rem !important;
  }

  /* Tableau de bord Joueur Mobile */
  #player-screen {
    overflow-y: auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }

  .player-dashboard {
    padding: 1rem !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: auto !important;
    box-sizing: border-box !important;
  }

  .player-preview-video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
}

/* Animation Fil Lumineux Vainqueur Bracket */
@keyframes bracketDash {
  0% {
    stroke-dashoffset: 200;
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.15;
  }
}

@keyframes winnerPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(0,210,255,0); }
  50% { transform: scale(1.06); box-shadow: 0 0 25px rgba(0,210,255,0.9); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(0,210,255,0); }
}

.winner-slot-pulse {
  animation: winnerPulse 0.8s ease-in-out 2 !important;
}

/* Modal Pop-up Overlay (Pouf!) */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(5, 8, 15, 0.88) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: #0d131d;
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 210, 255, 0.15);
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Boutons d'Édition du Pseudo pour Casters (QOL) */
.btn-edit-thumb-name {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 4px;
  margin-left: auto;
  transition: transform 0.2s, color 0.2s;
  pointer-events: auto;
}

.btn-edit-thumb-name:hover {
  color: #00f0ff;
  transform: scale(1.25);
}

.btn-edit-active-player {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.2s;
  pointer-events: auto;
}

.btn-edit-active-player:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  color: #00f0ff;
  transform: scale(1.08);
}

/* Drag & Drop Visual Indicators */
.player-thumb-card.draggable {
  cursor: grab;
}

.player-thumb-card.dragging {
  opacity: 0.4;
  border: 2px dashed #00f0ff !important;
  transform: scale(0.96);
}

.player-thumb-card.drag-over-slot {
  border: 2px solid #00f0ff !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.7) !important;
  transform: scale(1.05);
}

.team-sidebar.drag-over-sidebar {
  border: 2px dashed #00f0ff !important;
  box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.2) !important;
}

/* Logo Pop-Up Aléatoire BDCM CUP (Scène Principale Haut à Gauche - Clean Slide) */
.bdcm-logo-popup {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 28;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-120px);
  transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: none !important;
}

.bdcm-logo-popup.visible {
  opacity: 1;
  transform: translateX(0);
}

.bdcm-logo-popup img {
  height: 62px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ==================== ACTION REPLAY OVERLAY (F6) ==================== */
.replay-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  box-shadow: inset 0 0 35px rgba(255, 42, 95, 0.7), inset 0 0 60px rgba(0, 0, 0, 0.7);
  border: 3px solid rgba(255, 42, 95, 0.85);
  box-sizing: border-box;
}

.replay-overlay-layer.active {
  opacity: 1;
}

.replay-overlay-layer video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.replay-badge-overlay {
  position: absolute;
  top: 18px;
  left: 20px;
  background: rgba(12, 16, 24, 0.92);
  border: 1.5px solid #ff2a5f;
  box-shadow: 0 0 20px rgba(255, 42, 95, 0.6), inset 0 0 10px rgba(255, 42, 95, 0.3);
  border-radius: 6px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.replay-rec-dot {
  width: 12px;
  height: 12px;
  background-color: #ff2a5f;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff2a5f;
  animation: blink 0.8s infinite alternate;
}

.replay-title {
  font-family: var(--font-tactical);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 42, 95, 0.8);
}

.replay-timer {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 900;
  color: #ffb703;
  text-shadow: 0 0 8px rgba(255, 183, 3, 0.7);
  min-width: 45px;
}

.replay-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.replay-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2a5f 0%, #ff9900 100%);
  box-shadow: 0 0 10px #ff2a5f;
  transition: width 0.1s linear;
}

.bdcm-logo-img {
  width: 145px;
  height: auto;
  object-fit: contain;
  filter: none !important;
  box-shadow: none !important;
}

/* Bouton Manuel Discret Pop-Up BDCM CUP (Sous Slot 5 Team Red) */
.btn-bdcm-trigger {
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid rgba(255, 42, 95, 0.35);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  font-size: 0.68rem;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.25s ease;
  pointer-events: auto;
  letter-spacing: 0.5px;
}

.btn-bdcm-trigger:hover {
  background: rgba(255, 42, 95, 0.25);
  border-color: #ff2a5f;
  color: #ff2a5f;
  transform: scale(1.06);
  box-shadow: 0 0 10px rgba(255, 42, 95, 0.5);
}

/* ==================== MODE PAUSE BROADCAST (FONDU OPACITÉ FLUIDE 0.5s SANS CASSURE) ==================== */
.pause-video-deck {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 9999;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

.pause-video-deck.active {
  opacity: 1;
  pointer-events: auto;
}

.pause-video-deck.hidden {
  display: none !important;
}

/* En mode Pause (F7), fondu doux de disparition des côtés (sidebars) et du HUD */
#spectator-screen.pause-mode .team-sidebar,
#spectator-screen.pause-mode .caster-hud,
#spectator-screen.pause-mode #caster-hud,
#spectator-screen.pause-mode .mobile-team-tabs,
#spectator-screen.pause-mode .main-stage-score-badge,
#spectator-screen.pause-mode .main-stage-player-banner,
#spectator-screen.pause-mode .transparent-flip-overlay,
#spectator-screen.pause-mode .bdcm-logo-popup {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  pointer-events: none;
}
