/* ============================================
   PONG ULTIMATE - Console Gaming Style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
  --neon-blue: #00f7ff;
  --neon-pink: #ff006e;
  --neon-purple: #8b5cf6;
  --neon-green: #00ff88;
  --dark-bg: #0a0e1a;
  --card-bg: rgba(15, 23, 42, 0.85);
  --card-border: rgba(0, 247, 255, 0.3);
  --text-primary: #e0e7ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--dark-bg);
  position: relative;
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */

.bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(0, 100, 200, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 247, 255, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #050810 0%, #0a0e1a 100%);
  animation: bgPulse 8s ease-in-out infinite;
}

.bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: 
    repeating-linear-gradient(0deg, rgba(0, 247, 255, 0.03) 0px, transparent 1px, transparent 2px, rgba(0, 247, 255, 0.03) 3px),
    repeating-linear-gradient(90deg, rgba(0, 247, 255, 0.03) 0px, transparent 1px, transparent 2px, rgba(0, 247, 255, 0.03) 3px);
  background-size: 40px 40px;
  opacity: 0.4;
  animation: gridMove 20s linear infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

/* ============================================
   UI CHROME
   ============================================ */

.uiChrome {
  position: fixed; top: 0; right: 0;
  z-index: 1000;
  display: flex; gap: 8px; padding: 12px;
}

.iconBtn {
  width: 45px; height: 45px;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  color: var(--neon-blue);
  font-size: 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.iconBtn:hover {
  background: rgba(0, 247, 255, 0.15);
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
  transform: translateY(-2px);
}

/* ============================================
   FLOATING HUD - Amélioré
   ============================================ */

.floatingHud {
  position: fixed; 
  top: 20px; 
  left: 20px;
  z-index: 999;
  display: flex; 
  flex-direction: column; 
  gap: 10px;
  min-width: 200px;
}

.fhRow { 
  display: flex; 
  gap: 10px; 
  align-items: center; 
  flex-wrap: wrap;
}

.pill {
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(10, 14, 26, 0.95));
  border: 2px solid var(--card-border);
  border-radius: 25px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  backdrop-filter: blur(15px);
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.8);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(0, 247, 255, 0.4);
}

.pill.online {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 200, 100, 0.25));
  border-color: var(--neon-green);
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
  animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseGreen {
  0%, 100% { 
    box-shadow: 
      0 4px 15px rgba(0, 0, 0, 0.6),
      0 0 15px rgba(0, 255, 136, 0.4);
  }
  50% { 
    box-shadow: 
      0 4px 15px rgba(0, 0, 0, 0.6),
      0 0 25px rgba(0, 255, 136, 0.7);
  }
}

/* Style pour les infos dans le HUD */
#room, #role, #mode {
  font-size: 12px;
  color: rgba(0, 247, 255, 0.8);
  font-weight: 600;
}

/* ============================================
   SCREENS & WRAP
   ============================================ */

.wrap {
  position: relative; z-index: 1;
  width: 100%; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.screen {
  width: 100%; max-width: 1200px;
  animation: screenFadeIn 0.5s ease-out;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.screen[hidden] { display: none; }

/* ============================================
   MENU PRINCIPAL
   ============================================ */

.menuShell {
  text-align: center;
  padding: 40px;
}

.titleBlock {
  margin-bottom: 50px;
}

.badge {
  display: inline-block;
  padding: 8px 24px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  border-radius: 25px;
  margin-bottom: 20px;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.6); }
  50% { box-shadow: 0 0 50px rgba(139, 92, 246, 0.9); }
}

.gameTitle {
  font-family: 'Orbitron', monospace;
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: 8px;
  text-transform: uppercase;
  filter: drop-shadow(0 0 30px rgba(0, 247, 255, 0.7));
  animation: titlePulse 4s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(0, 247, 255, 0.7)); }
  50% { filter: drop-shadow(0 0 50px rgba(0, 247, 255, 1)); }
}

.subTitle {
  font-size: 20px;
  font-weight: 500;
  color: var(--neon-blue);
  margin-top: 15px;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(0, 247, 255, 0.8);
}

/* ============================================
   MENU GRID - BOUTONS
   ============================================ */

.menuGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.gameBtn {
  position: relative;
  padding: 18px 28px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.gameBtn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 247, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.gameBtn:hover::before { left: 100%; }

.gameBtn:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--neon-blue);
  box-shadow: 0 0 30px rgba(0, 247, 255, 0.6);
  color: var(--neon-blue);
  text-shadow: 0 0 15px rgba(0, 247, 255, 0.8);
}

.gameBtn:focus {
  outline: none;
  transform: translateY(-5px) scale(1.05);
  border-color: var(--neon-pink);
  box-shadow: 0 0 40px rgba(255, 0, 110, 0.7), 0 0 20px rgba(255, 0, 110, 0.5);
  color: var(--neon-pink);
  text-shadow: 0 0 20px rgba(255, 0, 110, 0.9);
}

.gameBtn.primary {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.2), rgba(139, 92, 246, 0.2));
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
  animation: primaryPulse 3s ease-in-out infinite;
}

@keyframes primaryPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 247, 255, 0.4); }
  50% { box-shadow: 0 0 35px rgba(0, 247, 255, 0.7); }
}

.gameBtn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.gameBtn.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--neon-purple);
  color: var(--neon-purple);
}

/* Bouton "Se connecter" en rouge quand pas connecté */
.gameBtn.loginBtn {
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.2), rgba(220, 20, 60, 0.2));
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.4);
  animation: loginPulse 2s ease-in-out infinite;
}

.gameBtn.loginBtn:hover {
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.3), rgba(220, 20, 60, 0.3));
  border-color: var(--neon-pink);
  color: #ffffff;
  box-shadow: 0 0 35px rgba(255, 0, 110, 0.7);
  text-shadow: 0 0 15px rgba(255, 0, 110, 0.9);
}

@keyframes loginPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 110, 0.4); }
  50% { box-shadow: 0 0 35px rgba(255, 0, 110, 0.7); }
}

/* ============================================
   MENU HINT
   ============================================ */

.menuHint {
  margin-top: 40px;
  padding: 20px;
  background: rgba(0, 247, 255, 0.05);
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 12px;
  font-size: 14px;
  color: var(--neon-blue);
  line-height: 1.6;
}

.mono {
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--neon-green);
  font-weight: 600;
}

/* ============================================
   PANELS
   ============================================ */

.panelShell {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 247, 255, 0.2);
}

.panelShell h2 {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 25px;
  text-shadow: 0 0 15px rgba(0, 247, 255, 0.7);
}

.panelShell h3 {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  color: var(--neon-purple);
  margin-top: 30px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

/* ============================================
   FORMS
   ============================================ */

.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(0, 247, 255, 0.5);
}

input, select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(0, 247, 255, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
  background: rgba(0, 247, 255, 0.05);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  padding: 10px 20px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
  color: var(--neon-blue);
}

.btn:focus {
  outline: none;
  transform: translateY(-2px) scale(1.05);
  border-color: var(--neon-pink);
  box-shadow: 0 0 30px rgba(255, 0, 110, 0.6), 0 0 15px rgba(255, 0, 110, 0.4);
  color: var(--neon-pink);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.2), rgba(139, 92, 246, 0.2));
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.btn.small { padding: 8px 16px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================
   ROW & DIVIDER
   ============================================ */

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 15px 0;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 247, 255, 0.3), transparent);
  margin: 30px 0;
}

/* ============================================
   HUD & CANVAS - Responsive amélioré
   ============================================ */

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 15px 15px 0 0;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  max-width: 100%;
}

.hudGame {
  margin: 0 auto;
  max-width: 900px;
  width: 100%;
}

.hudBtns { 
  display: flex; 
  gap: 8px;
  flex-wrap: wrap;
}

#localCanvas, #game {
  display: block;
  margin: 0 auto;
  border: 3px solid var(--neon-blue);
  border-radius: 0 0 15px 15px;
  box-shadow: 
    0 0 40px rgba(0, 247, 255, 0.5), 
    0 20px 60px rgba(0, 0, 0, 0.8);
  background: #000;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  /* Responsive avec aspect-ratio */
  width: 100%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 900 / 520;
}
}

/* Container pour le canvas */
.screen {
  width: 100%;
  max-width: 1400px;
  padding: 0 20px;
}

#screen-local, #screen-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 10px;
  gap: 10px;
}

/* Container flex pour le canvas qui prend l'espace disponible */
#screen-local > canvas,
#screen-game > canvas {
  flex-shrink: 0;
}

.tips {
  text-align: center;
  margin-top: 15px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   OVERLAY
   ============================================ */

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay[hidden] { display: none; }

.card, .overlayCard {
  max-width: 500px;
  padding: 40px;
  background: var(--card-bg);
  border: 3px solid var(--neon-blue);
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(0, 247, 255, 0.7);
  animation: cardBounceIn 0.4s ease;
}

@keyframes cardBounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.overlayCard h2, .card h2 {
  font-family: 'Orbitron', monospace;
  font-size: 36px;
  color: var(--neon-blue);
  text-align: center;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.8);
}

/* ============================================
   UTILITIES
   ============================================ */

.muted { color: rgba(255, 255, 255, 0.5); }
.tiny { font-size: 12px; }
[hidden] { display: none !important; }

/* ============================================
   SETTINGS
   ============================================ */

.settingsGrid {
  display: grid;
  gap: 20px;
  margin: 20px 0;
}

/* ============================================
   RESPONSIVE - Amélioré
   ============================================ */

/* Tablettes et petits écrans */
@media (max-width: 1024px) {
  .wrap {
    padding: 15px;
  }
  
  .screen {
    max-width: 100%;
  }
  
  #localCanvas, #game {
    max-width: 100%;
    border-width: 2px;
  }
  
  .hudGame {
    max-width: 100%;
  }
}

/* Tablettes portrait */
@media (max-width: 768px) {
  .gameTitle { 
    font-size: 48px; 
    letter-spacing: 4px; 
  }
  
  .menuGrid { 
    grid-template-columns: 1fr; 
  }
  
  .gameBtn { 
    padding: 20px 25px; 
    font-size: 16px; 
  }
  
  .panelShell { 
    padding: 25px; 
  }
  
  .floatingHud {
    top: 10px;
    left: 10px;
    min-width: auto;
  }
  
  .pill {
    padding: 8px 14px;
    font-size: 11px;
  }
  
  .hud {
    padding: 12px;
    gap: 10px;
  }
  
  .btn.small {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  #localCanvas, #game {
    border-width: 2px;
  }
}

/* Mobiles */
@media (max-width: 480px) {
  .gameTitle { 
    font-size: 32px;
    letter-spacing: 2px;
  }
  
  .badge { 
    font-size: 10px; 
    padding: 6px 16px; 
  }
  
  .subTitle { 
    font-size: 14px;
    letter-spacing: 1px;
  }
  
  .menuShell {
    padding: 20px;
  }
  
  .menuGrid {
    gap: 12px;
  }
  
  .gameBtn {
    padding: 18px 20px;
    font-size: 14px;
    letter-spacing: 1px;
  }
  
  .panelShell {
    padding: 20px;
  }
  
  .panelShell h2 {
    font-size: 24px;
  }
  
  .floatingHud {
    top: 8px;
    left: 8px;
  }
  
  .pill {
    padding: 6px 12px;
    font-size: 10px;
    letter-spacing: 1px;
  }
  
  .hud {
    padding: 10px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hudBtns {
    width: 100%;
    justify-content: space-between;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  .btn.small {
    padding: 6px 10px;
    font-size: 10px;
  }
  
  #localCanvas, #game {
    border-width: 2px;
    border-radius: 0 0 10px 10px;
  }
  
  .overlayCard {
    padding: 25px;
    max-width: 90%;
  }
  
  .overlayCard h2 {
    font-size: 28px;
  }
  
  input, select {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* Très petits écrans */
@media (max-width: 360px) {
  .gameTitle {
    font-size: 28px;
  }
  
  .badge {
    font-size: 9px;
    padding: 5px 12px;
  }
  
  .gameBtn {
    font-size: 13px;
    padding: 16px 18px;
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .menuShell {
    padding: 20px;
  }
  
  .titleBlock {
    margin-bottom: 20px;
  }
  
  .gameTitle {
    font-size: 36px;
  }
  
  .badge {
    margin-bottom: 10px;
  }
  
  .menuGrid {
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gameBtn {
    padding: 15px 20px;
  }
}

/* ============================================
   NOUVEAUX STYLES - WAITING ROOM & UI
   ============================================ */

/* Panel plus large pour waiting room */
.panelShell.wide {
  max-width: 800px;
}

/* Code highlight */
.highlight {
  color: var(--neon-green);
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

/* Liste des joueurs */
.playersList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 25px 0;
}

.playerCard {
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.playerCard.ready {
  border-color: var(--neon-green);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.playerCard.empty {
  border-style: dashed;
  opacity: 0.5;
}

.playerName {
  font-size: 16px;
  font-weight: 700;
  color: var(--neon-blue);
  margin-bottom: 8px;
}

.playerStatus {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.playerStatus.ready {
  color: var(--neon-green);
  font-weight: 700;
}

/* Team selection */
#teamSelection {
  margin: 25px 0;
}

.teamBtns {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.teamBtn {
  flex: 1;
  max-width: 250px;
}

/* Ready section */
.readySection {
  margin: 30px 0;
  text-align: center;
}

.btn.large {
  padding: 20px 50px;
  font-size: 20px;
  letter-spacing: 3px;
}

/* Countdown overlay */
.countdownDisplay {
  font-family: 'Orbitron', monospace;
  font-size: 120px;
  font-weight: 900;
  color: var(--neon-blue);
  text-shadow: 
    0 0 30px rgba(0, 247, 255, 0.8),
    0 0 60px rgba(0, 247, 255, 0.6),
    0 0 90px rgba(0, 247, 255, 0.4);
  animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Disconnect timer */
.disconnectTimer {
  font-family: 'Orbitron', monospace;
  font-size: 72px;
  font-weight: 900;
  color: var(--neon-pink);
  text-align: center;
  margin: 30px 0;
  text-shadow: 0 0 20px rgba(255, 0, 110, 0.8);
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Game container */
.gameContainer {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Amélioration boutons menu avec icônes */
.gameBtn {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
}

.btnIcon {
  font-size: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(0, 247, 255, 0.5));
}

.btnText {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.btnTitle {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neon-blue);
}

.btnSub {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
}

.gameBtn.ghost .btnTitle {
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive pour nouveaux éléments */
@media (max-width: 768px) {
  .playersList {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .countdownDisplay {
    font-size: 80px;
  }
  
  .disconnectTimer {
    font-size: 56px;
  }
  
  .btnIcon {
    font-size: 36px;
  }
  
  .btnTitle {
    font-size: 16px;
  }
  
  .btnSub {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .playersList {
    grid-template-columns: 1fr;
  }
  
  .teamBtns {
    flex-direction: column;
  }
  
  .teamBtn {
    max-width: 100%;
  }
  
  .countdownDisplay {
    font-size: 60px;
  }
  
  .btn.large {
    padding: 16px 40px;
    font-size: 18px;
  }
}

/* ============================================
   VERSION BADGE
   ============================================ */

.versionBadge {
  position: fixed;
  bottom: 10px;
  left: 10px;
  padding: 6px 12px;
  background: rgba(10, 14, 26, 0.9);
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 15px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(0, 247, 255, 0.6);
  backdrop-filter: blur(10px);
  z-index: 9999;
  letter-spacing: 1px;
}

/* ============================================
   COURT PREVIEW - TERRAIN VISUEL
   ============================================ */

.courtPreview {
  width: 100%;
  max-width: 900px;
  margin: 30px auto;
}

/* Terrain 1v1 */
.court1v1 {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 520;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.95), rgba(20, 25, 40, 0.95));
  border: 3px solid var(--neon-blue);
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 247, 255, 0.4);
  overflow: visible;
}

/* Terrain 2v2 */
.court2v2 {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 520;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.95), rgba(20, 25, 40, 0.95));
  border: 3px solid var(--neon-purple);
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
  overflow: visible;
}

/* Fond du terrain */
.courtBg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Ligne centrale */
.courtLine {
  position: absolute;
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
}

/* Cercle central */
.courtCircle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Slots de joueurs */
.playerSlot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.playerSlot:hover {
  transform: scale(1.05);
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
}

.playerSlot.occupied {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.1);
}

.playerSlot.ready {
  border-color: var(--neon-green);
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.5); }
  50% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.8); }
}

/* Position des slots - 1v1 */
.court1v1 .playerSlot.left {
  left: -180px;
  top: 50%;
  transform: translateY(-50%);
}

.court1v1 .playerSlot.right {
  right: -180px;
  top: 50%;
  transform: translateY(-50%);
}

.court1v1 .playerSlot:hover {
  transform: translateY(-50%) scale(1.05);
}

/* Position des slots - 2v2 */
.teamSide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 20px 0;
}

.teamSide.left {
  left: -220px;
}

.teamSide.right {
  right: -220px;
}

.teamLabel {
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-purple);
  letter-spacing: 2px;
}

.court2v2 .playerSlot {
  position: relative;
  left: 0;
  right: 0;
  transform: none;
}

.court2v2 .playerSlot:hover {
  transform: scale(1.05);
}

/* Paddles visuelles */
.paddle {
  width: 12px;
  height: 60px;
  border-radius: 6px;
  box-shadow: 0 0 15px;
  transition: all 0.3s ease;
}

/* Couleurs des paddles - 1v1 */
.paddle-p1 {
  background: linear-gradient(180deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.6);
}

.paddle-p2 {
  background: linear-gradient(180deg, #ff006e, #d4004d);
  box-shadow: 0 0 15px rgba(255, 0, 110, 0.6);
}

/* Couleurs des paddles - 2v2 */
.paddle-l1 {
  background: linear-gradient(180deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.8);
}

.paddle-l2 {
  background: linear-gradient(180deg, #00ff88, #00cc6a);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
}

.paddle-r1 {
  background: linear-gradient(180deg, #ff006e, #d4004d);
  box-shadow: 0 0 15px rgba(255, 0, 110, 0.8);
}

.paddle-r2 {
  background: linear-gradient(180deg, #ffd700, #ffb700);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

/* Info du slot */
.slotInfo {
  text-align: center;
}

.slotRole {
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-blue);
  letter-spacing: 1px;
  margin-bottom: 5px;
  text-align: center;
}

.slotName {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 5px;
}

.slotStatus {
  font-size: 20px;
}

/* Bouton de slot */
.slotBtn {
  padding: 8px 16px;
  background: rgba(0, 247, 255, 0.2);
  border: 1px solid var(--neon-blue);
  border-radius: 8px;
  color: var(--neon-blue);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.slotBtn:hover {
  background: rgba(0, 247, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 247, 255, 0.4);
}

.slotBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
  .court1v1 .playerSlot.left {
    left: -160px;
  }
  
  .court1v1 .playerSlot.right {
    right: -160px;
  }
  
  .teamSide.left {
    left: -180px;
  }
  
  .teamSide.right {
    right: -180px;
  }
}

@media (max-width: 768px) {
  .courtPreview {
    margin: 20px auto;
  }
  
  .court1v1 .playerSlot {
    position: static;
    transform: none !important;
    margin: 10px 0;
  }
  
  .court1v1 {
    display: flex;
    flex-direction: column;
    aspect-ratio: unset;
    padding: 20px;
  }
  
  .court2v2 {
    display: flex;
    flex-direction: column;
    aspect-ratio: unset;
    padding: 20px;
  }
  
  .teamSide {
    position: static;
    width: 100%;
    margin: 10px 0;
  }
  
  .teamLabel {
    position: static;
    margin-bottom: 10px;
  }
}

/* ============================================
   FIX LAYOUT v2.1.1 - MISE EN PAGE AMÉLIORÉE
   ============================================ */
.court1v1 {
  position: static !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 30px !important;
  width: 100% !important;
  aspect-ratio: unset !important;
}

.court2v2 {
  position: static !important;
  display: grid !important;
  grid-template-columns: 200px 1fr 200px !important;
  gap: 20px !important;
  align-items: center !important;
  width: 100% !important;
  aspect-ratio: unset !important;
}

.courtBg {
  position: relative !important;
  width: 100% !important;
  max-width: 500px !important;
  height: 290px !important;
}

.court2v2 .courtBg {
  grid-column: 2 !important;
}

.playerSlot {
  position: static !important;
  transform: none !important;
  width: 100% !important;
}

.teamSide {
  position: static !important;
  width: 100% !important;
}

.teamSide.left, .teamSide.right {
  left: unset !important;
  right: unset !important;
  top: unset !important;
  bottom: unset !important;
}

@media (max-width: 900px) {
  .court1v1, .court2v2 {
    flex-direction: column !important;
  }
  
  .court2v2 {
    display: flex !important;
  }
  
  .courtBg {
    order: 1;
  }
  
  .teamSide.left {
    order: 0;
  }
  
  .teamSide.right {
    order: 2;
  }
}
/* REMPLACER TOUTE LA SECTION COURT PREVIEW PAR CECI */

/* ============================================
   COURT PREVIEW - LAYOUT SIMPLE v2.1.2
   ============================================ */

.panelShell.wide {
  max-width: 950px;
}

.courtPreview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin: 30px 0;
}

/* Terrain */
.courtBg {
  width: 100%;
  max-width: 600px;
  height: 350px;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.95), rgba(20, 25, 40, 0.95));
  border: 3px solid var(--neon-blue);
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 247, 255, 0.4);
  position: relative;
}

.courtLine {
  position: absolute;
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%);
}

.courtCircle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70px;
  height: 70px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Rangée de slots */
.slotsRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

/* Slot joueur */
.playerSlot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 15px;
  min-width: 180px;
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  backdrop-filter: blur(15px);
  transition: all 0.3s ease;
}

.playerSlot:hover {
  transform: translateY(-5px);
  border-color: var(--neon-blue);
  box-shadow: 0 8px 25px rgba(0, 247, 255, 0.4);
}

.playerSlot.occupied {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.1);
}

.playerSlot.ready {
  border-color: var(--neon-green);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.6); }
  50% { box-shadow: 0 0 45px rgba(0, 255, 136, 0.9); }
}

/* Paddle */
.paddle {
  width: 18px;
  height: 90px;
  border-radius: 9px;
  transition: all 0.3s ease;
}

.playerSlot:hover .paddle {
  transform: scale(1.1);
}

.paddle-p1 {
  background: linear-gradient(180deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 25px rgba(0, 247, 255, 0.8);
}

.paddle-p2 {
  background: linear-gradient(180deg, #ff006e, #d4004d);
  box-shadow: 0 0 25px rgba(255, 0, 110, 0.8);
}

.paddle-l1 {
  background: linear-gradient(180deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 25px rgba(0, 247, 255, 0.9);
}

.paddle-l2 {
  background: linear-gradient(180deg, #00ff88, #00cc6a);
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.9);
}

.paddle-r1 {
  background: linear-gradient(180deg, #ff006e, #d4004d);
  box-shadow: 0 0 25px rgba(255, 0, 110, 0.9);
}

.paddle-r2 {
  background: linear-gradient(180deg, #ffd700, #ffb700);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
}

/* Info slot */
.slotInfo {
  text-align: center;
  width: 100%;
}

.slotRole {
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-blue);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-align: center;
}

.slotName {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
}

.slotStatus {
  font-size: 28px;
  margin: 5px 0;
}

/* Bouton slot */
.slotBtn {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.2), rgba(139, 92, 246, 0.2));
  border: 2px solid var(--neon-blue);
  border-radius: 10px;
  color: var(--neon-blue);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.slotBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.3), rgba(139, 92, 246, 0.3));
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 247, 255, 0.5);
}

.slotBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(100, 100, 100, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .courtBg {
    height: 250px;
  }
  
  .slotsRow {
    flex-direction: column;
    align-items: stretch;
  }
  
  .playerSlot {
    min-width: unset;
    width: 100%;
  }
  
  .paddle {
    width: 16px;
    height: 70px;
  }
}
/* ============================================
   LAYOUT FINAL ULTRA SIMPLE v2.1.3
   ============================================ */

.courtLayout {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 20px;
  align-items: center;
  margin: 30px 0;
  min-height: 400px;
}

.courtSide {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.courtCenter {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.95), rgba(20, 25, 40, 0.95));
  border: 3px solid var(--neon-blue);
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 247, 255, 0.4);
  position: relative;
}

.courtLine {
  position: absolute;
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%);
}

.courtCircle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.playerSlot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.playerSlot:hover {
  transform: scale(1.05);
  border-color: var(--neon-blue);
  box-shadow: 0 5px 20px rgba(0, 247, 255, 0.4);
}

.playerSlot.occupied {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.1);
}

.playerSlot.ready {
  border-color: var(--neon-green);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.6); }
  50% { box-shadow: 0 0 45px rgba(0, 255, 136, 0.9); }
}

.paddle {
  width: 16px;
  height: 80px;
  border-radius: 8px;
}

.paddle-p1 {
  background: linear-gradient(180deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.8);
}

.paddle-p2 {
  background: linear-gradient(180deg, #ff006e, #d4004d);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.8);
}

.paddle-l1 {
  background: linear-gradient(180deg, #00f7ff, #00b8d4);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.9);
}

.paddle-l2 {
  background: linear-gradient(180deg, #00ff88, #00cc6a);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.9);
}

.paddle-r1 {
  background: linear-gradient(180deg, #ff006e, #d4004d);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.9);
}

.paddle-r2 {
  background: linear-gradient(180deg, #ffd700, #ffb700);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
}

.slotInfo {
  text-align: center;
  width: 100%;
}

.slotRole {
  font-size: 11px;
  font-weight: 700;
  color: var(--neon-blue);
  letter-spacing: 1px;
  margin-bottom: 5px;
  text-align: center;
}

.slotName {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 5px;
}

.slotStatus {
  font-size: 24px;
}

.slotBtn {
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.2), rgba(139, 92, 246, 0.2));
  border: 2px solid var(--neon-blue);
  border-radius: 8px;
  color: var(--neon-blue);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.slotBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.3), rgba(139, 92, 246, 0.3));
  box-shadow: 0 3px 10px rgba(0, 247, 255, 0.4);
}

.slotBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(100, 100, 100, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 900px) {
  .courtLayout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  
  .courtCenter {
    height: 300px;
    grid-row: 2;
  }
  
  .courtSide.left {
    grid-row: 1;
  }
  
  .courtSide.right {
    grid-row: 3;
  }
}

/* ============================================
   LIGNE CENTRALE SIMPLE v2.1.4
   ============================================ */

.centerLine {
  width: 4px;
  height: 100%;
  min-height: 400px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--neon-blue) 10%,
    var(--neon-blue) 90%,
    transparent 100%
  );
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.6);
  border-radius: 2px;
  position: relative;
}

.centerLine::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px dashed rgba(0, 247, 255, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.4);
}

/* Override courtCenter si existe encore */
.courtCenter {
  display: none !important;
}

/* ============================================
   FIX LIGNE CENTRÉE v2.1.5
   ============================================ */

.courtLayout {
  display: grid;
  grid-template-columns: 200px 4px 200px !important;
  gap: 30px !important;
  align-items: center !important;
  justify-items: center !important;
  margin: 30px auto !important;
  min-height: 450px !important;
}

.courtSide {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-self: stretch !important;
  justify-content: center !important;
}

.centerLine {
  width: 4px !important;
  align-self: stretch !important;
  min-height: 100% !important;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--neon-blue) 5%,
    var(--neon-blue) 95%,
    transparent 100%
  ) !important;
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.6) !important;
  border-radius: 2px !important;
  position: relative !important;
}

.centerLine::before {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 30px !important;
  height: 30px !important;
  border: 2px dashed rgba(0, 247, 255, 0.5) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 12px rgba(0, 247, 255, 0.4) !important;
}

/* ============================================
   CENTRAGE TOTAL v2.1.6
   ============================================ */

.courtLayout {
  display: grid !important;
  grid-template-columns: 200px 4px 200px !important;
  gap: 30px !important;
  align-items: center !important;
  justify-items: center !important;
  justify-content: center !important;
  margin: 30px auto !important;
  min-height: 450px !important;
  width: fit-content !important;
}

.panelShell.wide {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.panelShell.wide > h2,
.panelShell.wide > p {
  text-align: center !important;
}

/* ============================================
   LOADING & COUNTDOWN v2.2.0
   ============================================ */

/* Écran de chargement */
.loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
}

.loadingContent {
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.loadingSpinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 30px;
  border: 4px solid rgba(0, 247, 255, 0.2);
  border-top: 4px solid var(--neon-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loadingText {
  font-size: 32px;
  color: var(--neon-blue);
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.6);
  margin-bottom: 15px;
  letter-spacing: 4px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Countdown */
.countdownOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent; /* Pas de fond opaque */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  pointer-events: none; /* Ne pas bloquer les clics */
}

.countdownNumber {
  font-family: 'Orbitron', monospace;
  font-size: 180px;
  font-weight: 900;
  color: var(--neon-blue);
  text-shadow: 
    0 0 40px rgba(0, 247, 255, 1),
    0 0 80px rgba(0, 247, 255, 0.8),
    0 0 120px rgba(0, 247, 255, 0.6);
  animation: countdownPop 1s ease;
}

@keyframes countdownPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.countdownNumber.go {
  color: var(--neon-green);
  text-shadow: 
    0 0 40px rgba(0, 255, 136, 1),
    0 0 80px rgba(0, 255, 136, 0.8),
    0 0 120px rgba(0, 255, 136, 0.6);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive countdown */
@media (max-width: 768px) {
  .countdownNumber {
    font-size: 120px;
  }
}

/* ============================================
   HOST SETTINGS v2.4.0
   ============================================ */

.hostSettings {
  background: rgba(0, 247, 255, 0.05);
  border: 2px solid rgba(0, 247, 255, 0.3);
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  max-width: 600px;
}

.hostBadge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  border: 2px solid var(--neon-gold, #ffd700);
  border-radius: 20px;
  color: #ffd700;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.hostSettings h3 {
  color: var(--neon-blue);
  font-size: 18px;
  margin-bottom: 15px;
}

.settingsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.settingsGrid > div {
  display: flex;
  flex-direction: column;
}

.settingsGrid select {
  width: 100%;
}

@media (max-width: 600px) {
  .settingsGrid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   HOST SETTINGS v2.6.0 - TOGGLE
   ============================================ */

.hostSettings {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 165, 0, 0.05));
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 15px;
  padding: 25px;
  margin: 20px auto;
  max-width: 650px;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.hostBadge {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.25));
  border: 2px solid #ffd700;
  border-radius: 25px;
  color: #ffd700;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 20px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  text-transform: uppercase;
}

/* Toggle Buttons */
.gameTypeToggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.toggleBtn {
  flex: 1;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toggleBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.toggleBtn.active {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.3), rgba(139, 92, 246, 0.2));
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
  transform: scale(1.02);
}

/* Game Settings */
.gameSettings {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
}

.bigSelect {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(0, 247, 255, 0.3);
  border-radius: 10px;
  color: var(--neon-blue);
  cursor: pointer;
  transition: all 0.3s ease;
}

.bigSelect:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
}

.bigSelect:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
}

.gameSettings .lbl {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 600px) {
  .gameTypeToggle {
    flex-direction: column;
  }
  
  .toggleBtn {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ============================================
   GAME INFO + MODALE v2.7.0
   ============================================ */

/* Info partie en haut (pour tous) */
.gameInfo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 247, 255, 0.1);
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 15px;
}

.gameInfoLabel {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.gameInfoValue {
  color: var(--neon-blue);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
}

/* Modale paramètres */
.settingsModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
}

.modalCard {
  background: linear-gradient(135deg, rgba(20, 30, 60, 0.95), rgba(10, 20, 40, 0.95));
  border: 2px solid rgba(0, 247, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 247, 255, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px;
  border-bottom: 2px solid rgba(0, 247, 255, 0.2);
}

.modalHeader h2 {
  margin: 0;
  color: #ffd700;
  font-size: 24px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.btnClose {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btnClose:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff0000;
  color: #ff0000;
  transform: rotate(90deg);
}

.modalBody {
  padding: 30px;
}

.modalFooter {
  padding: 20px 30px;
  border-top: 2px solid rgba(0, 247, 255, 0.2);
  display: flex;
  justify-content: flex-end;
}

/* Toggle Buttons dans la modale */
.gameTypeToggle {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.toggleBtn {
  flex: 1;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toggleBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.toggleBtn.active {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.3), rgba(139, 92, 246, 0.2));
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
  transform: scale(1.02);
}

.gameSettings {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 25px;
}

.bigSelect {
  width: 100%;
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(0, 247, 255, 0.3);
  border-radius: 10px;
  color: var(--neon-blue);
  cursor: pointer;
  transition: all 0.3s ease;
}

.bigSelect:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
}

.bigSelect:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
}

.gameSettings .lbl {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 600px) {
  .gameTypeToggle {
    flex-direction: column;
  }
  
  .toggleBtn {
    padding: 14px 16px;
    font-size: 14px;
  }
  
  .modalCard {
    width: 95%;
    max-height: 90vh;
  }
}

/* ============================================
   GAME END OVERLAY v2.8.0
   ============================================ */

.gameEndOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(15px);
  animation: fadeIn 0.5s ease;
}

.gameEndCard {
  text-align: center;
  padding: 50px;
  background: linear-gradient(135deg, rgba(20, 30, 60, 0.95), rgba(10, 20, 40, 0.95));
  border: 3px solid var(--neon-blue);
  border-radius: 25px;
  box-shadow: 0 0 50px rgba(0, 247, 255, 0.5);
  animation: gameEndSlideIn 0.6s ease;
}

@keyframes gameEndSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gameEndResult {
  font-family: 'Orbitron', monospace;
  font-size: 72px;
  font-weight: 900;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 6px;
  animation: gameEndPulse 2s ease-in-out infinite;
}

.gameEndResult.victory {
  color: var(--neon-green);
  text-shadow: 
    0 0 30px rgba(0, 255, 136, 1),
    0 0 60px rgba(0, 255, 136, 0.8),
    0 0 90px rgba(0, 255, 136, 0.6);
}

.gameEndResult.defeat {
  color: #ff006e;
  text-shadow: 
    0 0 30px rgba(255, 0, 110, 1),
    0 0 60px rgba(255, 0, 110, 0.8),
    0 0 90px rgba(255, 0, 110, 0.6);
}

@keyframes gameEndPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.gameEndScores {
  font-size: 48px;
  font-weight: 700;
  color: var(--neon-blue);
  margin-bottom: 40px;
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.6);
  letter-spacing: 8px;
}

.gameEndButtons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.gameEndButtons .btn {
  min-width: 180px;
}

@media (max-width: 768px) {
  .gameEndResult {
    font-size: 48px;
  }
  
  .gameEndScores {
    font-size: 36px;
  }
  
  .gameEndCard {
    padding: 30px;
  }
  
  .gameEndButtons {
    flex-direction: column;
    width: 100%;
  }
  
  .gameEndButtons .btn {
    width: 100%;
  }
}

/* ============================================
   SLOT RELEASE BUTTON v2.9.0
   ============================================ */

.playerSlot.mine {
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.slotBtn.btnRelease {
  background: linear-gradient(135deg, rgba(255, 100, 0, 0.2), rgba(200, 50, 0, 0.2));
  border-color: #ff6600;
  color: #ff6600;
}

.slotBtn.btnRelease:hover {
  background: linear-gradient(135deg, rgba(255, 100, 0, 0.3), rgba(200, 50, 0, 0.3));
  border-color: #ff8800;
  color: #ff8800;
  box-shadow: 0 0 15px rgba(255, 100, 0, 0.4);
}

.slotBtn.btnRelease:active {
  transform: scale(0.95);
}

/* ============================================
   CLICKABLE SLOTS v2.9.1
   ============================================ */

.playerSlot {
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.playerSlot:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 247, 255, 0.3);
}

.playerSlot.mine:hover {
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
  border-color: rgba(255, 215, 0, 0.8);
}

.playerSlot.occupied:not(.mine):hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 15px rgba(0, 247, 255, 0.2);
}

/* Boutons indicatifs (pas vraiment cliquables) */
.slotBtn {
  pointer-events: none; /* Le clic passe à travers vers le slot */
  font-size: 12px;
  padding: 8px 12px;
}

.slotBtn.btnMine {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  border-color: #ffd700;
  color: #ffd700;
  font-weight: 700;
}

.slotBtn.btnOccupied {
  background: rgba(100, 100, 100, 0.2);
  border-color: rgba(150, 150, 150, 0.4);
  color: rgba(200, 200, 200, 0.6);
}

/* Message d'aide visuel */
.playerSlot.mine::after {
  content: "Cliquez pour vous retirer";
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255, 215, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.playerSlot.mine:hover::after {
  opacity: 1;
}

.playerSlot:not(.occupied)::after {
  content: "Cliquez pour prendre";
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(0, 247, 255, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.playerSlot:not(.occupied):hover::after {
  opacity: 1;
}

/* ============================================
   BOUTON SE RETIRER v2.9.1
   ============================================ */

.slotBtn.btnRelease {
  background: linear-gradient(135deg, rgba(255, 80, 80, 0.2), rgba(200, 40, 40, 0.2));
  border-color: #ff5555;
  color: #ff5555;
  font-weight: 700;
}

.slotBtn.btnRelease:hover {
  background: linear-gradient(135deg, rgba(255, 80, 80, 0.35), rgba(200, 40, 40, 0.35));
  border-color: #ff7777;
  color: #ff7777;
  box-shadow: 0 0 20px rgba(255, 80, 80, 0.5);
  transform: translateY(-2px);
}

.slotBtn.btnRelease:active {
  transform: translateY(0) scale(0.98);
}

/* Égalité */
.gameEndResult.draw {
  color: #ffd700;
  text-shadow: 
    0 0 30px rgba(255, 215, 0, 1),
    0 0 60px rgba(255, 215, 0, 0.8),
    0 0 90px rgba(255, 215, 0, 0.6);
}

/* ============================================
   HUD CENTER INFO v3.1.0
   ============================================ */

.hudCenter {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hudMainInfo {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  color: var(--neon-blue);
  text-shadow: 
    0 0 20px rgba(0, 247, 255, 0.8),
    0 0 40px rgba(0, 247, 255, 0.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: hudPulse 2s ease-in-out infinite;
}

@keyframes hudPulse {
  0%, 100% {
    text-shadow: 
      0 0 20px rgba(0, 247, 255, 0.8),
      0 0 40px rgba(0, 247, 255, 0.5);
  }
  50% {
    text-shadow: 
      0 0 25px rgba(0, 247, 255, 1),
      0 0 50px rgba(0, 247, 255, 0.7);
  }
}

/* Timer en mode temps (rouge quand < 30s) */
.hudMainInfo.timerWarning {
  color: #ff0066;
  text-shadow: 
    0 0 20px rgba(255, 0, 102, 0.8),
    0 0 40px rgba(255, 0, 102, 0.5);
  animation: timerWarningPulse 1s ease-in-out infinite;
}

@keyframes timerWarningPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@media (max-width: 768px) {
  .hudMainInfo {
    font-size: 20px;
  }
}

/* Center menu button text */
.menuGrid .gameBtn { text-align:center; }

/* Profile button in menu */
.profileBtn{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
}
.profileBtn .profileAvatar{
  width:28px;height:28px;border-radius:50%;
  display:none;
}

/* Profile screen */
.profileHeader{display:flex;align-items:center;gap:14px;margin-bottom:14px;}
.profileAvatarBig{width:64px;height:64px;border-radius:50%;display:none;}
.profileStats{display:grid;gap:8px;margin:10px 0 18px;}
.statRow{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(255,255,255,0.16);border-radius:12px;background:rgba(0,0,0,0.25);}
.profileSub{margin:10px 0 8px;}
.profileTop10{display:grid;gap:6px;}
.lbRow{display:grid;grid-template-columns:64px 1fr 110px;gap:8px;align-items:center;padding:10px 12px;border:1px solid rgba(255,255,255,0.14);border-radius:12px;background:rgba(0,0,0,0.18);}
.lbRank{opacity:0.8;}
.lbScore{text-align:right;font-weight:800;}

/* ============================================
   LEADERBOARD SCREEN
   ============================================ */

.leaderboardList {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.leaderboardRow {
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(10, 15, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.leaderboardRow:hover {
  background: rgba(20, 30, 50, 0.6);
  border-color: var(--neon-blue);
  transform: translateX(4px);
}

.leaderboardRank {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  color: var(--text-primary);
  font-family: 'Orbitron', monospace;
}

.leaderboardPlayer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboardAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.leaderboardAvatarPlaceholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.leaderboardName {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.leaderboardScore {
  text-align: right;
  font-weight: 900;
  font-size: 20px;
  font-family: 'Orbitron', monospace;
  color: var(--neon-blue);
}

/* Top 3 special styles */
.leaderboardRow.rank-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.1));
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.leaderboardRow.rank-1 .leaderboardRank {
  font-size: 32px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.leaderboardRow.rank-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(169, 169, 169, 0.1));
  border-color: rgba(192, 192, 192, 0.5);
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.3);
}

.leaderboardRow.rank-2 .leaderboardRank {
  font-size: 28px;
  text-shadow: 0 0 12px rgba(192, 192, 192, 0.8);
}

.leaderboardRow.rank-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(184, 115, 51, 0.1));
  border-color: rgba(205, 127, 50, 0.5);
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.3);
}

.leaderboardRow.rank-3 .leaderboardRank {
  font-size: 28px;
  text-shadow: 0 0 12px rgba(205, 127, 50, 0.8);
}

/* Current user highlight */
.leaderboardRow.isCurrentUser {
  border: 2px solid var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.2), rgba(139, 92, 246, 0.15));
  box-shadow: 0 0 25px rgba(255, 0, 110, 0.4);
}

.leaderboardRow.isCurrentUser .leaderboardName {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 0, 110, 0.6);
}

/* Leaderboard footer */
.leaderboardFooter {
  margin-top: 20px;
  padding: 16px;
  background: rgba(0, 247, 255, 0.08);
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 12px;
  text-align: center;
}

.myRank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.myRank #myRankValue {
  color: var(--neon-blue);
  font-size: 24px;
  font-weight: 900;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.6);
}

/* Loading & Error states */
.loadingBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 247, 255, 0.2);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.errorBox {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 0, 110, 0.1);
  border: 1px solid rgba(255, 0, 110, 0.3);
  border-radius: 12px;
  margin: 20px 0;
}

.emptyState {
  text-align: center;
  padding: 60px 20px;
  opacity: 0.7;
}

.emptyState p:first-child {
  font-size: 48px;
  margin-bottom: 12px;
}

.emptyState p:nth-child(2) {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.leaderboardList::-webkit-scrollbar {
  width: 8px;
}

.leaderboardList::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.leaderboardList::-webkit-scrollbar-thumb {
  background: var(--neon-blue);
  border-radius: 4px;
}

.leaderboardList::-webkit-scrollbar-thumb:hover {
  background: var(--neon-purple);
}

/* Leaderboard clickable rows */
.leaderboardRow.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.leaderboardRow.clickable:hover {
  transform: translateX(6px);
  box-shadow: 0 4px 20px rgba(0, 247, 255, 0.4);
}

/* ============================================
   PLAYER PROFILE MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modalOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2001;
}

.playerProfileCard {
  position: relative;
  z-index: 2002;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 247, 255, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.modalHeader h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--neon-blue);
  text-shadow: 0 0 15px rgba(0, 247, 255, 0.6);
  margin: 0;
}

.btnClose {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btnClose:hover {
  background: rgba(255, 0, 110, 0.2);
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  transform: rotate(90deg);
}

.modalBody {
  padding: 24px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.modalBody::-webkit-scrollbar {
  width: 8px;
}

.modalBody::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.modalBody::-webkit-scrollbar-thumb {
  background: var(--neon-blue);
  border-radius: 4px;
}

.modalBody::-webkit-scrollbar-thumb:hover {
  background: var(--neon-purple);
}

.playerProfileHeader {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(0, 247, 255, 0.05);
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 12px;
}

.playerProfileAvatarBig {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
}

.playerProfileHeader h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.playerProfileRank {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.playerProfileRank #playerProfileRankValue {
  color: var(--neon-blue);
  font-weight: 900;
  font-size: 20px;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.6);
}

.statsSection,
.historySection {
  margin-bottom: 24px;
}

.statsSection h4,
.historySection h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--neon-purple);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.infoMessage {
  padding: 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  margin-top: 12px;
  text-align: center;
}

.infoMessage p {
  margin: 0;
}


/* Disabled menu buttons when not logged in */
.disabledBtn{opacity:0.35; filter:grayscale(1); pointer-events:none;}

/* Waiting room avatars */
.slotNameWrap{display:flex;align-items:center;gap:10px;}
.slotAvatar{width:28px;height:28px;border-radius:50%;}

/* In-game player HUD */
.hudPlayers{display:flex;align-items:center;gap:24px;justify-content:center;}
.hudPlayer{display:flex;align-items:center;gap:10px;min-width:160px;justify-content:center;opacity:0.95;}
.hudPlayer img{width:28px;height:28px;border-radius:50%;display:none;}
.hudPlayer span{font-weight:700;letter-spacing:0.5px;font-size:15px;}

/* HUD Teams 2v2 */
.hudTeam {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

/* Équipe gauche alignée à droite */
#hudTeamLeft {
  align-items: flex-end;
}

#hudTeamLeft .hudPlayer {
  justify-content: flex-end;
}

/* Équipe droite alignée à gauche */
#hudTeamRight {
  align-items: flex-start;
}

#hudTeamRight .hudPlayer {
  justify-content: flex-start;
}

.hudTeam .hudPlayer {
  min-width: auto;
  font-size: 14px;
}

/* Couleurs INDIVIDUELLES par paddle (2v2) */
#hudL1Name {
  color: rgb(0, 247, 255); /* Cyan */
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.8);
}

#hudL2Name {
  color: rgb(0, 255, 136); /* Vert */
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

#hudR1Name {
  color: rgb(255, 0, 110); /* Rose */
  text-shadow: 0 0 10px rgba(255, 0, 110, 0.8);
}

#hudR2Name {
  color: rgb(255, 215, 0); /* Or */
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Couleurs 1v1 */
#hudLeftName {
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.8);
}

#hudRightName {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 0, 110, 0.8);
}


/* ===== Waiting room slots state colors ===== */
.slot{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.slot.occupied{
  background: rgba(200,40,40,0.35);
  border-color: rgba(255,80,80,0.8);
}
.slot.ready{
  background: rgba(40,180,90,0.35);
  border-color: rgba(80,255,140,0.9);
}

/* Center avatar + name in slot */
.slotNameWrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.slotAvatar{
  width:36px;
  height:36px;
  border-radius:50%;
}

/* Center text in settings button */
#btnSettings{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}


/* --- Waiting room slot colors (no emoji) --- */
.playerSlot.slotOccupied{
  border-color: rgba(255,255,255,0.18);
}
.playerSlot.slotNotReady{
  background: rgba(255, 0, 70, 0.18); /* red */
  border-color: rgba(255, 0, 70, 0.45);
}
.playerSlot.slotReady{
  background: rgba(0, 255, 120, 0.16); /* green */
  border-color: rgba(0, 255, 120, 0.45);
}

/* Center avatar + name inside slot */
.slotInfo{width:100%; text-align:center;}
.slotName{width:100%; display:flex; justify-content:center; align-items:center; text-align:center;}
.slotNameWrap{width:100%; display:flex; justify-content:center; align-items:center; gap:10px;}
.slotAvatar{flex:0 0 auto;}

/* Center text in ALL menu buttons (fix Paramètres) */
.menuGrid .gameBtn{
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:center;
}



/* Waiting room: color slots instead of emoji */
#screen-waiting .playerSlot.slotNotReady{
  background: rgba(255, 0, 70, 0.18);
  border-color: rgba(255, 0, 70, 0.45);
}
#screen-waiting .playerSlot.slotReady{
  background: rgba(0, 255, 120, 0.16);
  border-color: rgba(0, 255, 120, 0.45);
}

/* Center avatar + name in waiting slot */
#screen-waiting .slotInfo{width:100%; text-align:center;}
#screen-waiting .slotName{width:100%; display:flex; justify-content:center; align-items:center; text-align:center;}
#screen-waiting .slotNameWrap{width:100%; justify-content:center;}

/* Center text in waiting room bottom buttons (Paramètres, Pas prêt, Quitter) */
#screen-waiting .btnWide, #screen-waiting .btn, #screen-waiting button{
  text-align:center;
}
#screen-waiting .btnWide{
  display:flex;
  justify-content:center;
  align-items:center;
}



/* --- Fullscreen fit + anti-zoom --- */
html, body{
  margin:0;
  padding:0;
  height:100%;
  overflow:hidden; /* no scrollbars */
}
/* Avoid double-tap zoom but keep UI taps working */
body{ touch-action: manipulation; }
/* Block pinch/pan gestures on the canvas itself */
#game{ touch-action:none; }

/* force waiting paddle horizontal even on mobile */
#screen-waiting .paddle{
  width: 70px !important;
  height: 10px !important;
}


/* Profile button: avatar next to "Mon profil" */
#btnProfile img{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}

#btnProfile{display:flex;align-items:center;justify-content:center;gap:10px;}

/* ============================================
   SOLO MODE LOBBY v3.3.2
   ============================================ */

.btn.large {
  font-size: 17px;
  padding: 14px 32px;
  font-weight: 700;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

@media (max-width: 768px) {
  .btn.large {
    font-size: 15px;
    padding: 12px 24px;
  }
}

/* ============================================
   READY BUTTON STATES v3.3.3
   ============================================ */

.btn.disabledBtn {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   SLOT COLORS v3.3.5 (remplace emojis)
   ============================================ */

.slotRole {
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Couleurs pour identifier les slots */
#slot-l1 .slotRole::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #00f7ff; }
#slot-l2 .slotRole::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #00ff88; }
#slot-r1 .slotRole::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff0066; }
#slot-r2 .slotRole::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ffaa00; }

/* ============================================
   KEY INPUT v3.4.0
   ============================================ */

.keyInput {
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.keyInput:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.4);
}

/* ============================================
   NETWORK OPTIMIZATION v3.5.0
   ============================================ */

/* Smooth animations for better perceived performance */
.paddle {
  transition: transform 0.016s linear;
}

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ============================================
   PROFILE HISTORY v3.6.0
   ============================================ */

.profileHistory {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  max-height: 280px; /* ~3 rows × 90px */
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar custom */
.profileHistory::-webkit-scrollbar {
  width: 6px;
}

.profileHistory::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.profileHistory::-webkit-scrollbar-thumb {
  background: rgba(0, 247, 255, 0.3);
  border-radius: 3px;
}

.profileHistory::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 247, 255, 0.5);
}

.historyRow {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.historyRow:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.historyWin {
  border-left-color: #00ff88;
}

.historyLoss {
  border-left-color: #ff0066;
}

.historyDraw {
  border-left-color: #ffaa00;
}

.historyResult {
  font-size: 24px;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
}

.historyWin .historyResult {
  color: #00ff88;
}

.historyLoss .historyResult {
  color: #ff0066;
}

.historyDraw .historyResult {
  color: #ffaa00;
}

.historyDetails {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.historyOpponent {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.historyScore {
  font-size: 16px;
  font-weight: 700;
  color: var(--neon-blue);
  font-family: 'Courier New', monospace;
}

.historyMeta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.historyType {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.historyDate {
  font-size: 10px;
}

/* Mobile */
@media (max-width: 600px) {
  .historyRow {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .historyMeta {
    align-items: flex-start;
    width: 100%;
  }
}

/* ===== INTRO SCREEN ===== */
/* ============================================
   SPLASH & INTRO SCREENS
   ============================================ */

#screen-splash, #screen-intro {
  background: transparent;
}

.splash-content, .intro-content {
  text-align: center;
  animation: splash-appear 0.5s ease-out;
}

@keyframes splash-appear {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* Logo du splash (apparaît avec animation 3D) */
.splash-logo {
  max-width: 400px;
  width: 60%;
  height: auto;
  margin-bottom: 40px;
  filter: drop-shadow(0 0 20px var(--neon-blue));
  animation: logo-appear 1.5s ease-out forwards, logo-glow 2s ease-in-out infinite 1.5s;
  opacity: 0;
  transform: scale(0.5) rotateY(180deg);
}

@keyframes logo-appear {
  0% {
    opacity: 0;
    transform: scale(0.3) rotateY(180deg) translateY(-50px);
    filter: drop-shadow(0 0 40px var(--neon-blue)) blur(5px);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) rotateY(0deg) translateY(0);
    filter: drop-shadow(0 0 30px var(--neon-blue));
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg) translateY(0);
    filter: drop-shadow(0 0 20px var(--neon-blue));
  }
}

@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 20px var(--neon-blue)); }
  50% { filter: drop-shadow(0 0 35px var(--neon-blue)); }
}

/* Barre de chargement */
.loading-bar {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  overflow: hidden;
  margin: 20px auto;
  border-radius: 3px;
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 15px var(--neon-blue);
  animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* Logo de l'intro (statique, déjà visible) */
.intro-logo-container {
  margin-bottom: 40px;
}

.intro-logo {
  max-width: 400px;
  width: 60%;
  height: auto;
  filter: drop-shadow(0 0 20px var(--neon-blue));
}

/* Disclaimer */
.disclaimer {
  max-width: 600px;
  margin: 0 auto 30px;
  padding: 25px;
  background: transparent;
  border: none;
  border-radius: 12px;
}

.disclaimer-title {
  color: var(--neon-pink);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 15px;
}

.disclaimer-content {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.disclaimer-content p {
  margin: 10px 0;
}

.disclaimer-content strong {
  color: var(--neon-blue);
}

.disclaimer-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.disclaimer-content li {
  margin: 5px 0;
}

/* Bouton pulse */
.pulse-btn {
  animation: btn-pulse 2s ease-in-out infinite;
}

/* Bouton intro - plus compact */
#btnContinueToMenu {
  max-width: 350px;
  margin: 0 auto;
  padding: 18px 40px;
  font-size: 18px;
}

@keyframes btn-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 247, 255, 0.8);
  }
}

/* Texte "appuyez sur touche" */
.press-any-key {
  margin-top: 20px;
  color: var(--text-primary);
  opacity: 0.6;
  font-size: 13px;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.2; }
}

/* Responsive splash/intro */
@media (max-width: 768px) {
  .splash-logo, .intro-logo {
    width: 80%;
    max-width: 300px;
  }
  
  .disclaimer {
    max-width: 90%;
    padding: 20px;
  }
  
  .disclaimer-title {
    font-size: 18px;
  }
  
  .disclaimer-content {
    font-size: 13px;
  }
}

/* ============================================
   RESPONSIVE SYSTEM - FULL UI
   ============================================ */

/* Container principal avec scaling */
#app {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Scaling global basé sur la taille de l'écran */
@media (max-width: 1600px) {
  html {
    font-size: 15px; /* Réduction globale de 6% */
  }
}

@media (max-width: 1400px) {
  html {
    font-size: 14px; /* Réduction de 12% */
  }
  
  .panelShell {
    max-width: 600px;
  }
  
  #localCanvas, #game {
    max-width: 800px;
  }
}

@media (max-width: 1200px) {
  html {
    font-size: 13px; /* Réduction de 18% */
  }
  
  .panelShell {
    max-width: 550px;
  }
  
  #localCanvas, #game {
    max-width: 700px;
  }
  
  .menuGrid {
    max-width: 500px;
  }
}

@media (max-width: 1024px) {
  html {
    font-size: 12px; /* Réduction de 25% */
  }
  
  .panelShell {
    max-width: 500px;
    padding: 20px;
  }
  
  #localCanvas, #game {
    max-width: 600px;
    border-width: 2px;
  }
  
  .menuGrid {
    max-width: 450px;
  }
  
  .gameBtn {
    font-size: 1.1rem;
    padding: 14px 24px;
  }
  
  h1 {
    font-size: 3rem;
  }
}

@media (max-width: 900px) {
  html {
    font-size: 11px; /* Réduction de 31% */
  }
  
  .screen {
    padding: 10px;
  }
  
  .panelShell {
    max-width: 90%;
    padding: 18px;
  }
  
  #localCanvas, #game {
    max-width: 500px;
  }
  
  .menuGrid {
    max-width: 400px;
    gap: 10px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  .hud {
    padding: 8px 12px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 10px; /* Réduction de 37% */
  }
  
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .panelShell {
    max-width: 95%;
    padding: 15px;
  }
  
  #localCanvas, #game {
    max-width: 400px;
  }
  
  .menuGrid {
    max-width: 350px;
    gap: 8px;
  }
  
  .gameBtn {
    font-size: 1rem;
    padding: 12px 20px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .logo {
    width: 120px;
    height: 120px;
  }
  
  .hudGame {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 9px; /* Réduction de 43% */
  }
  
  .panelShell {
    padding: 12px;
  }
  
  #localCanvas, #game {
    max-width: 320px;
  }
  
  .menuGrid {
    max-width: 300px;
    gap: 6px;
  }
  
  .gameBtn {
    font-size: 0.95rem;
    padding: 10px 18px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .modal .modalCard {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 8px; /* Réduction de 50% */
  }
  
  .screen {
    padding: 5px;
  }
  
  .panelShell {
    padding: 10px;
  }
  
  #localCanvas, #game {
    max-width: 280px;
    border-width: 1px;
  }
  
  .menuGrid {
    max-width: 260px;
    gap: 5px;
  }
  
  .gameBtn {
    font-size: 0.9rem;
    padding: 8px 15px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .logo {
    width: 80px;
    height: 80px;
  }
  
  .versionBadge {
    font-size: 8px;
    padding: 3px 6px;
  }
}

/* Canvas - toujours centré avec aspect-ratio */
#localCanvas, #game {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 900px;
  max-height: 520px;
  aspect-ratio: 900 / 520;
}

/* Assurer que le canvas ne déborde jamais */
@media (max-height: 800px) {
  #localCanvas, #game {
    max-height: 400px;
  }
}

@media (max-height: 600px) {
  #localCanvas, #game {
    max-height: 300px;
  }
  
  .hud {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

/* Orientation paysage sur mobile */
@media (max-width: 900px) and (orientation: landscape) {
  #localCanvas, #game {
    max-height: 60vh;
  }
  
  .hud {
    padding: 4px 8px;
  }
  
  .tips {
    font-size: 0.7rem;
  }
}

