/* ==========================================================================
   Course du Cochon - Endless Runner
   Design System & Styles CSS Modernes (Zéro Dépendance, Conforme Grade A+)
   ========================================================================== */

:root {
  /* Palette Chaleureuse & Champêtre (Terroir, Bois de Chêne, Or & Pomme Rouge) */
  --bg-dark: #1a120c;
  --bg-card: rgba(36, 24, 16, 0.94);
  --bg-card-hover: rgba(48, 33, 23, 0.96);
  --bg-glass: rgba(30, 20, 13, 0.82);
  
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-glow: rgba(225, 29, 72, 0.25);
  
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
  --accent-green: #22c55e;
  --accent-blue: #0284c7;
  
  --text-main: #fffbeb;
  --text-muted: #d6d3d1;
  --text-subtle: #a8a29e;
  
  --border-subtle: rgba(245, 158, 11, 0.18);
  --border-bright: rgba(245, 158, 11, 0.38);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(34, 197, 94, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  overflow: hidden;
}

/* Conteneur Global */
.game-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

/* Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(244, 114, 182, 0.15);
  padding: 4px;
  border: 1px solid rgba(244, 114, 182, 0.3);
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fffbeb;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
}

/* ==========================================================================
   Zone de Jeu & Verrouillage Anti-Déformation
   ========================================================================== */

.game-viewport-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ratio 16:9 strict pour garantir une absence totale de déformation */
.game-viewport {
  position: relative;
  width: 100%;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Mode Plein Écran Dédié & Mobile */
.fullscreen-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
}

.fullscreen-game-root {
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.fullscreen-viewport {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.fullscreen-inner-footer {
  position: absolute;
  bottom: max(6px, env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

.fullscreen-caption {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   HUD Supérieur
   ========================================================================== */

.hud-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-badge {
  background: rgba(34, 23, 16, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-bright);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.hud-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.distance-badge .hud-value {
  color: #38bdf8;
}

.apples-badge {
  background: rgba(185, 28, 28, 0.28);
  border-color: rgba(248, 113, 113, 0.45);
}

.apples-badge .hud-value {
  color: #fca5a5;
}

.speed-badge .hud-value {
  color: #4ade80;
}

.record-badge .hud-value {
  color: #fbbf24;
}

.hud-btn {
  pointer-events: auto;
  background: rgba(34, 23, 16, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-bright);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.hud-btn:hover {
  background: rgba(54, 36, 25, 0.95);
  transform: translateY(-1px);
  border-color: #fbbf24;
}

.hud-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Overlays & Écrans (Start, Pause, GameOver)
   ========================================================================== */

.screen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 11, 7, 0.60);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(0.5rem, env(safe-area-inset-right, 0px)) max(0.5rem, env(safe-area-inset-bottom, 0px)) max(0.5rem, env(safe-area-inset-left, 0px));
  transition: opacity var(--transition-smooth);
}

.screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.screen-card {
  position: relative;
  background: rgba(36, 24, 16, 0.96);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  max-width: 520px;
  width: min(92%, 520px);
  max-height: 96%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin: auto;
  box-shadow: 
    0 24px 48px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(217, 119, 6, 0.2);
  animation: cardPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-sound-btn {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  width: 40px;
  height: 40px;
  background: rgba(48, 33, 23, 0.85);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.card-sound-btn svg,
.hud-btn svg {
  pointer-events: none;
}

.card-sound-btn:hover {
  background: rgba(64, 44, 30, 0.95);
  border-color: #fbbf24;
  transform: scale(1.06);
}

.card-sound-btn:active {
  transform: scale(0.95);
}

@keyframes cardPopIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.start-pig-mascot {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  animation: mascotHover 3s ease-in-out infinite alternate;
}

.pause-pig-mascot {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
  animation: pigFlyFloat 2.6s ease-in-out infinite alternate;
}

@keyframes mascotHover {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

@keyframes pigFlyFloat {
  0% { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(-10px) rotate(3deg); }
}

.screen-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fffbeb;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.01em;
}

.screen-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.instruction-box {
  background: rgba(26, 17, 12, 0.8);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.key-badge {
  background: #3b2518;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-bottom: 2px solid rgba(245, 158, 11, 0.55);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fef08a;
}

.primary-btn {
  background: #e11d48;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.35);
  transition: all var(--transition-fast);
}

.primary-btn:hover {
  background: #be123c;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(225, 29, 72, 0.5);
}

.primary-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  background: rgba(48, 33, 23, 0.9);
  color: var(--text-main);
  border: 1px solid var(--border-bright);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
}

.secondary-btn:hover {
  background: rgba(64, 44, 30, 0.95);
  border-color: #fbbf24;
  color: #ffffff;
  transform: translateY(-2px);
}

.secondary-btn:active {
  transform: translateY(1px);
}

/* Game Over Card */
.gameover-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gameover-emoji {
  font-size: 2.2rem;
}

.scores-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.score-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-card.highlight {
  background: rgba(244, 114, 182, 0.15);
  border-color: rgba(244, 114, 182, 0.4);
}

.score-label {
  font-size: 0.725rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.score-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.score-card.highlight .score-number {
  color: var(--primary);
}

.record-notification {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 1rem;
  animation: pulseGold 1.5s infinite;
}

@keyframes pulseGold {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

.modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   Section Instructions & Guide
   ========================================================================== */

.instructions-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all var(--transition-fast);
}

.info-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
}

.info-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.info-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.info-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.game-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Accessibilité & Ergonomie
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .game-layout {
    padding: 0.75rem 0.75rem 1.5rem;
    gap: 1.25rem;
  }
  
  .hud-overlay {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 4px;
  }

  .hud-group {
    gap: 4px;
  }

  .hud-badge {
    padding: 3px 7px;
    font-size: 0.75rem;
  }
  
  .hud-badge .hud-value {
    font-size: 0.8rem;
  }

  .hud-label {
    display: none;
  }

  .hud-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .screen-card {
    padding: 1.25rem 1rem;
    width: 92%;
    max-width: 380px;
  }
  
  .scores-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ==========================================================================
   Mode Plein Écran Total (index2.html)
   100vw x 100dvh Plein Écran Bord à Bord, Tout Intégré dans la Fenêtre de Jeu
   ========================================================================== */

body.fullscreen-body {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
  display: block;
}

.fullscreen-game-root {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.fullscreen-viewport {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #38bdf8;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.fullscreen-viewport #game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

.fullscreen-inner-footer {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 15;
}

.fullscreen-caption {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(15, 23, 42, 0.75);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Badge Top 1 Mondial dans le HUD
   ========================================================================== */

.hud-badge.world-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.45);
}

.hud-badge.world-badge .hud-label {
  color: #fbbf24;
}

.hud-badge.world-badge .hud-value {
  color: #fef08a;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   Champ de Saisie du Pseudo (8 caractères)
   ========================================================================== */

.pseudo-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.pseudo-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pseudo-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pseudo-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.pseudo-input {
  background: rgba(22, 14, 10, 0.88);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  color: #fffbeb;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 0.55rem 1rem 0.55rem 2.6rem;
  width: 200px;
  transition: all var(--transition-fast);
  outline: none;
}

.pseudo-input:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  background: rgba(28, 18, 13, 0.98);
}

/* ==========================================================================
   Boîte du Tableau Top 5 des Joueurs
   ========================================================================== */

.leaderboard-box {
  width: 100%;
  max-width: 440px;
  background: rgba(24, 16, 11, 0.82);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

.leaderboard-header {
  margin-bottom: 0.5rem;
  text-align: center;
}

.leaderboard-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: center;
}

.leaderboard-table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leaderboard-table td {
  padding: 6px 6px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(245, 158, 11, 0.08);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-table .rank-col {
  width: 32px;
  text-align: center;
}

.leaderboard-table .pseudo-col {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fffbeb;
}

.leaderboard-table .score-col {
  font-weight: 800;
  color: #38bdf8;
}

.leaderboard-table .dist-col {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.leaderboard-table .apples-col {
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 700;
}

.table-apple-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(185, 28, 28, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Badges de Rangs Vectoriels (Au lieu des Emojis) */
.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.rank-pill.rank-1 {
  background: #f59e0b;
  color: #1c130d;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  border: 2px solid #fef08a;
}

.rank-pill.rank-2 {
  background: #94a3b8;
  color: #0f172a;
  box-shadow: 0 0 6px rgba(148, 163, 184, 0.4);
  border: 2px solid #f1f5f9;
}

.rank-pill.rank-3 {
  background: #d97706;
  color: #fffbeb;
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.4);
  border: 2px solid #fed7aa;
}

.rank-pill.rank-4,
.rank-pill.rank-5 {
  background: rgba(255, 255, 255, 0.08);
  color: #d6d3d1;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.leaderboard-table tr.current-player {
  background: rgba(245, 158, 11, 0.15);
  border-radius: 4px;
}

.leaderboard-table tr.current-player .pseudo-col {
  color: #fef08a;
}

/* Notification d'entrée dans le Top 5 & Record */
.record-notification,
.top5-notification {
  font-size: 1rem;
  font-weight: 800;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  margin-top: -0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.top5-notification {
  animation: pulseTop5 1.5s ease-in-out infinite alternate;
}

@keyframes pulseTop5 {
  0% { transform: scale(0.98); box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
  100% { transform: scale(1.03); box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
}

/* Icônes Vectorielles SVG Intégrées */
.hud-icon svg,
.pseudo-icon svg,
.sound-icon svg,
#pause-icon svg,
.gameover-icon svg,
.leaderboard-title svg,
.record-notification svg,
.top5-notification svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive Mobile & Mode Paysage (Hauteur Compacte)
   ========================================================================== */

@media (max-height: 640px), (max-width: 640px) {
  .screen-overlay {
    padding: 0.35rem;
  }

  .screen-card {
    padding: 0.5rem 1rem 0.65rem;
    gap: 0.35rem;
    width: min(96%, 480px);
    max-height: 96%;
    border-radius: var(--radius-md);
  }

  .start-pig-mascot {
    display: none; /* Supprime l'image mascotte imposante pour dégager les contrôles */
  }

  .pause-pig-mascot {
    height: 48px;
    width: auto;
  }

  .screen-title {
    font-size: 1.1rem;
    margin-bottom: 0;
  }

  .screen-desc {
    display: none; /* Cache la description verbeuse pour garder le bouton visible */
  }

  .card-sound-btn {
    top: 0.4rem;
    right: 0.4rem;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .pseudo-input-group {
    gap: 0.15rem;
  }

  .pseudo-label {
    font-size: 0.72rem;
  }

  .pseudo-input {
    padding: 0.25rem 0.5rem 0.25rem 2rem;
    font-size: 0.95rem;
    width: 170px;
    height: 34px;
  }

  .pseudo-icon {
    font-size: 0.95rem;
    left: 8px;
  }

  .instruction-box {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    gap: 4px;
  }

  .instruction-box .key-badge {
    padding: 1px 4px;
    font-size: 0.68rem;
  }

  .leaderboard-box {
    padding: 0.3rem 0.5rem;
    max-height: 115px;
    overflow-y: auto;
  }

  .leaderboard-header {
    margin-bottom: 0.15rem;
  }

  .leaderboard-title {
    font-size: 0.72rem;
  }

  .leaderboard-table {
    font-size: 0.75rem;
  }

  .leaderboard-table th {
    padding: 2px 4px;
    font-size: 0.65rem;
  }

  .leaderboard-table td {
    padding: 2px 4px;
    font-size: 0.72rem;
  }

  .primary-btn {
    padding: 0.45rem 1.4rem;
    font-size: 0.88rem;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
  }

  .secondary-btn {
    padding: 0.45rem 1.4rem;
    font-size: 0.88rem;
  }

  /* HUD compact sur mobile */
  .hud-overlay {
    top: max(6px, env(safe-area-inset-top, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
  }

  .hud-badge {
    padding: 3px 8px;
    gap: 5px;
  }

  .hud-label {
    font-size: 0.65rem;
  }

  .hud-value {
    font-size: 0.85rem;
  }

  .hud-btn {
    width: 32px;
    height: 32px;
  }

  /* Game Over Card sur mobile */
  .gameover-header {
    gap: 6px;
  }

  .gameover-emoji {
    font-size: 1.3rem;
  }

  .scores-summary {
    gap: 6px;
  }

  .score-card {
    padding: 0.3rem 0.25rem;
    gap: 2px;
  }

  .score-label {
    font-size: 0.62rem;
  }

  .score-number {
    font-size: 0.9rem;
  }

  .record-notification,
  .top5-notification {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    margin-top: 0;
  }

  .fullscreen-inner-footer {
    display: none;
  }
}
