:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.78);
  --border-subtle: rgba(148, 163, 184, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-emerald: #10b981;
  --accent-cyan: #22d3ee;
  --accent-amber: #fde047;
  --accent-rose: #f43f5e;
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* Gestion des Vues */
.view {
  display: none;
  min-height: 100vh;
  position: relative;
}

.view.active {
  display: block;
}

#view-game.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Lueurs d'ambiance */
.ambient-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
}

.glow-1 {
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, #10b981, transparent 70%);
}

.glow-2 {
  bottom: -150px;
  right: -100px;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.hero-logo {
  width: 24px;
  height: 24px;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #34d399 0%, #22d3ee 55%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 660px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-cta {
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  color: #04131a;
  box-shadow: 0 10px 28px -6px rgba(16, 185, 129, 0.45);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -6px rgba(34, 211, 238, 0.55);
}

.btn-primary {
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.35);
}

.btn-primary:hover {
  background: rgba(34, 211, 238, 0.25);
}

.btn-glass {
  background: rgba(30, 41, 59, 0.72);
  color: var(--text-main);
  border-color: var(--border-subtle);
  backdrop-filter: blur(12px);
}

.btn-glass:hover {
  background: rgba(51, 65, 85, 0.8);
}

.btn-full {
  width: 100%;
}

/* Barre de statistiques d'accueil */
.stats-bar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
}

.stat-label {
  color: var(--text-muted);
}

/* Grille des Niveaux */
.levels-section {
  margin-top: 1rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
  gap: 0.5rem;
}

.section-header h2 {
  font-size: 1.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  backdrop-filter: blur(14px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.level-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.45);
}

.level-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.level-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid;
}

.level-medal {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-amber);
}

.level-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.level-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  flex-grow: 1;
}

.level-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #cbd5e1;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* HUD En Jeu */
.game-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: rgba(9, 13, 22, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  z-index: 10;
  flex-wrap: wrap;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-level-info {
  display: flex;
  flex-direction: column;
}

.hud-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.hud-clue-pill {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(253, 224, 71, 0.35);
  color: #fef08a;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}

.hud-timer-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: 12px;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 64px;
}

.timer-digits.pulse-error {
  animation: errorFlash 0.55s ease;
}

@keyframes errorFlash {
  0%, 100% { color: var(--accent-cyan); transform: scale(1); }
  40% { color: var(--accent-rose); transform: scale(1.18); }
}

.miss-badge {
  font-size: 0.78rem;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.16);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}

.btn-icon-label, .btn-hint, .btn-icon {
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.btn-hint {
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

/* Outils secondaires HUD (Desktop) */
.hud-secondary-tools-wrap {
  position: relative;
  display: inline-flex;
}

.hud-tools-btn {
  display: none;
}

.hud-tools-drawer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-tool-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.85);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-tool-item:hover {
  border-color: var(--accent-cyan);
}

.hud-tool-item.active {
  background: rgba(253, 224, 71, 0.22);
  border-color: var(--accent-amber);
}

.hud-tool-label {
  display: none;
}

.badge-short {
  display: none;
}

.miss-short-text {
  display: none;
}

.btn-icon.active {
  background: rgba(253, 224, 71, 0.22);
  border-color: var(--accent-amber);
}

/* Zone Canvas */
.canvas-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  background: #050811;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-viewport:active {
  cursor: grabbing;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  image-rendering: auto;
}

.zoom-controls {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  z-index: 5;
}

.btn-zoom {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.btn-zoom:hover {
  border-color: var(--accent-cyan);
}

.controls-help-pill {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Modale de Victoire & Image de Récompense */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.82);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75);
}

.modal-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.record-pill {
  display: inline-block;
  background: rgba(253, 224, 71, 0.18);
  color: var(--accent-amber);
  border: 1px solid rgba(253, 224, 71, 0.45);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
}

.modal-header p {
  color: var(--text-muted);
}

.reward-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reward-stat-box {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reward-stat-box span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.reward-stat-box strong {
  font-size: 1.25rem;
  color: var(--accent-cyan);
}

.unlocked-banner {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Zone de l'image de récompense */
.reward-image-wrapper {
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid rgba(253, 224, 71, 0.35);
  border-radius: 18px;
  padding: 0.9rem;
  margin-bottom: 1.15rem;
}

.reward-image-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 0.65rem;
}

.reward-dl-btn {
  color: var(--accent-cyan);
  text-decoration: none;
}

.reward-dl-btn:hover {
  text-decoration: underline;
}

.reward-image-frame {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-image-frame img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.campaign-summary {
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.16), rgba(34, 211, 238, 0.16));
  border: 1px solid var(--accent-amber);
  padding: 0.85rem 1rem;
  border-radius: 14px;
  text-align: center;
  margin-bottom: 1.15rem;
  color: #fef08a;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Vue Pokédex / Galerie */
.pokedex-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pokedex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.pokedex-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pokedex-card.unlocked {
  border-color: rgba(16, 185, 129, 0.45);
}

.pokedex-preview {
  height: 190px;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}

.pokedex-reward-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pokedex-locked-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 2rem;
}

.pokedex-locked-placeholder span {
  font-size: 0.85rem;
}

.pokedex-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pokedex-tag {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.pokedex-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pokedex-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.site-footer {
  margin-top: 3.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .hud-center {
    order: 3;
    width: 100%;
    text-align: center;
  }
  .controls-help-pill {
    display: none;
  }
}

/* ==========================================================================
   MILESTONES 3 & 4 : TOP NAVBAR, PROFILES, LEADERBOARD & MULTIPLAYER CHALLENGES
   ========================================================================== */

/* --- 1. Top Navbar & Profile Chip --- */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent-cyan);
}

.navbar-logo {
  width: 28px;
  height: 28px;
}

.navbar-title {
  letter-spacing: -0.01em;
}

.navbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
  border-radius: 12px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-chip:hover {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.3);
}

.profile-chip-avatar {
  font-size: 1.3rem;
  line-height: 1;
}

.profile-chip-pseudo {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chip-edit {
  font-size: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.profile-chip:hover .profile-chip-edit {
  opacity: 1;
}

/* --- 2. Modal Sizing & Close Buttons --- */
.modal-card-sm {
  max-width: 480px;
}

.modal-card-md {
  max-width: 620px;
}

.modal-card-lg {
  max-width: 860px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.modal-header-text {
  flex: 1;
  text-align: left;
}

.modal-header-text h2 {
  font-size: 1.65rem;
  margin-bottom: 0.25rem;
}

.modal-close-btn {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose);
  color: #fff;
  transform: scale(1.06);
}

/* --- 3. Avatar Grid Picker --- */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.avatar-option {
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 1.65rem;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: scale(1.12);
}

.avatar-option.selected {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.22);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.45);
  transform: scale(1.1);
}

/* --- 4. Forms, Inputs & Modern Validation --- */
.modal-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.btn-text-action:hover {
  text-decoration: underline;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input.font-mono, .form-textarea.font-mono {
  font-family: var(--font-mono);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22);
}

/* Modern Validation Pseudo-classes */
.form-input:user-invalid, .form-textarea:user-invalid {
  border-color: var(--accent-rose);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.form-input:user-valid:not(:placeholder-shown) {
  border-color: var(--accent-emerald);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit .form-input {
  padding-right: 3.5rem;
}

.input-unit {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
}

.player-id-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.player-id-value {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

/* --- 5. Leaderboard Tabs --- */
.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
}

.tab-btn {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.15rem;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(51, 65, 85, 0.8);
}

.tab-btn.active {
  color: #04131a;
  background: linear-gradient(135deg, #10b981, #22d3ee);
  border-color: transparent;
  box-shadow: 0 4px 16px -2px rgba(34, 211, 238, 0.45);
}

/* --- 6. State Containers (Loading, Error, Empty) --- */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.state-icon {
  font-size: 2.2rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.state-error {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.08);
  border-radius: 16px;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* --- 7. Top 3 Visual Podium --- */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 0.5rem 0.5rem;
  margin-bottom: 1.5rem;
  min-height: 230px;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 175px;
  position: relative;
  text-align: center;
}

.podium-avatar-wrap {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.podium-avatar {
  font-size: 2.2rem;
  line-height: 1;
}

.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.podium-pseudo {
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.2rem;
}

.podium-time {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.podium-acc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.podium-pedestal {
  width: 100%;
  border-radius: 14px 14px 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.6rem;
}

/* Podium Gold (#1) */
.podium-gold {
  order: 2;
  transform: translateY(-8px);
}

.podium-gold .podium-avatar-wrap {
  background: radial-gradient(circle, rgba(253, 224, 71, 0.35), transparent 70%);
  border: 2px solid #fde047;
  box-shadow: 0 0 24px rgba(253, 224, 71, 0.45);
  width: 74px;
  height: 74px;
}

.podium-crown {
  position: absolute;
  top: -32px;
  font-size: 1.5rem;
  z-index: 3;
  pointer-events: none;
  animation: floatCrown 2.5s ease-in-out infinite;
}

.podium-step.podium-empty {
  opacity: 0.48;
}

@keyframes floatCrown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.podium-gold .podium-rank-badge {
  background: #fde047;
  color: #0f172a;
}

.podium-gold .podium-time {
  color: #fde047;
  font-size: 1.2rem;
}

.podium-gold .podium-pedestal {
  height: 105px;
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.38) 0%, rgba(253, 224, 71, 0.08) 100%);
  border: 1px solid rgba(253, 224, 71, 0.55);
  color: #fde047;
}

/* Podium Silver (#2) */
.podium-silver {
  order: 1;
}

.podium-silver .podium-avatar-wrap {
  background: radial-gradient(circle, rgba(203, 213, 225, 0.28), transparent 70%);
  border: 2px solid #cbd5e1;
  box-shadow: 0 0 16px rgba(203, 213, 225, 0.35);
}

.podium-silver .podium-rank-badge {
  background: #cbd5e1;
  color: #0f172a;
}

.podium-silver .podium-time {
  color: #e2e8f0;
}

.podium-silver .podium-pedestal {
  height: 80px;
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.3) 0%, rgba(203, 213, 225, 0.06) 100%);
  border: 1px solid rgba(203, 213, 225, 0.45);
  color: #cbd5e1;
}

/* Podium Bronze (#3) */
.podium-bronze {
  order: 3;
}

.podium-bronze .podium-avatar-wrap {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.28), transparent 70%);
  border: 2px solid #fb923c;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.35);
}

.podium-bronze .podium-rank-badge {
  background: #fb923c;
  color: #fff;
}

.podium-bronze .podium-time {
  color: #fdba74;
}

.podium-bronze .podium-pedestal {
  height: 60px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.3) 0%, rgba(249, 115, 22, 0.06) 100%);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #fb923c;
}

/* --- 8. Leaderboard Table --- */
.leaderboard-table-wrapper {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(9, 13, 22, 0.65);
  overscroll-behavior: contain;
}

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

.leaderboard-table thead {
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 2;
  border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-table th, .leaderboard-table td {
  padding: 0.75rem 1rem;
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.15s ease;
}

.leaderboard-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

.leaderboard-table tbody tr.row-current-player {
  background: rgba(34, 211, 238, 0.14);
  border-left: 3px solid var(--accent-cyan);
  font-weight: 700;
}

.th-rank, .td-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 52px;
  color: var(--text-muted);
}

.td-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.td-player-avatar {
  font-size: 1.25rem;
}

.td-player-pseudo {
  font-weight: 600;
}

.td-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.td-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- 9. Sticky Personal Rank Bar --- */
.personal-rank-sticky {
  position: sticky;
  bottom: -1.75rem;
  margin: 1.25rem -1.75rem -1.75rem -1.75rem;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(34, 211, 238, 0.45);
  padding: 0.85rem 1.75rem;
  border-radius: 0 0 24px 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 5;
}

.personal-rank-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.personal-rank-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-personal {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(34, 211, 238, 0.2);
  color: var(--accent-cyan);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.personal-rank-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.personal-rank-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.personal-avatar {
  font-size: 1.3rem;
}

.personal-rank-stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.personal-rank-stats strong {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* --- 10. Challenge Creation Modal --- */
.segmented-control {
  display: flex;
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.3rem;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.segment-option {
  flex: 1;
  text-align: center;
  cursor: pointer;
}

.segment-option input {
  display: none;
}

.segment-option span {
  display: block;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.16s ease;
}

.segment-option input:checked + span {
  background: rgba(34, 211, 238, 0.22);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.file-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: 14px;
  padding: 1.6rem 1rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
}

.dropzone-icon {
  font-size: 2.2rem;
}

.dropzone-text {
  font-weight: 700;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.dropzone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.reward-preview-box {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #050811;
  padding: 0.65rem;
  margin-top: 0.65rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.reward-preview-thumbnail {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.secret-group {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  margin-top: 1rem;
}

.secret-badge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fda4af;
  margin-bottom: 0.75rem;
}

.secret-shield {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.challenge-success-view {
  text-align: center;
  padding: 1rem 0;
}

.success-icon-wrap {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.share-url-box {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}

.copy-feedback {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 700;
}

/* --- 11. In-Game Challenge HUD Banner --- */
.challenge-hud-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.22), rgba(15, 23, 42, 0.95), rgba(34, 211, 238, 0.22));
  border-bottom: 1px solid rgba(244, 63, 94, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9;
  gap: 1rem;
  flex-wrap: wrap;
}

.challenge-hud-badge {
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}

.challenge-hud-creator {
  font-size: 0.88rem;
}

.creator-avatar {
  font-size: 1.15rem;
  margin: 0 0.2rem;
}

.challenge-hud-target-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.challenge-hud-target-time {
  font-family: var(--font-mono);
  color: var(--accent-amber);
  font-size: 1.15rem;
}

.status-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-running {
  background: rgba(34, 211, 238, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

/* --- 12. Victory Modal Challenge Additions --- */
.challenge-result-banner {
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 700;
}

.challenge-result-banner.beat-record {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(34, 211, 238, 0.25));
  border: 1px solid var(--accent-emerald);
  color: #6ee7b7;
}

.challenge-result-banner.missed-record {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(251, 146, 60, 0.2));
  border: 1px solid var(--accent-rose);
  color: #fda4af;
}

.result-badge {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.challenge-secret-box {
  background: rgba(253, 224, 71, 0.1);
  border: 1px solid rgba(253, 224, 71, 0.4);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.15rem;
  text-align: center;
}

.secret-box-header {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-amber);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.revealed-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 0.35rem;
}

.revealed-message {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #f8fafc;
}

.challenge-mini-board {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 1.15rem;
}

.mini-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
}

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

.mini-board-table-wrap {
  max-height: 160px;
  overflow-y: auto;
}

.mini-board-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
}

.mini-board-table th, .mini-board-table td {
  padding: 0.45rem 0.65rem;
  text-align: left;
}

.mini-board-table thead {
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.mini-board-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

/* --- 13. Responsive Breakpoints & Mobile Browser Optimizations --- */
@media (max-width: 768px) {
  /* --- 1. Top Navbar Mobile : Sticky Header Glassmorphism 1-ligne --- */
  .top-navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(9, 13, 22, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding: max(0.55rem, var(--sat)) 0.85rem 0.55rem;
    margin: 0 -0.85rem 1rem -0.85rem;
    gap: 0.45rem;
    flex-wrap: nowrap;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }

  .navbar-brand {
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .navbar-logo {
    width: 26px;
    height: 26px;
  }

  .navbar-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  .navbar-domain {
    display: none;
  }

  .btn-nav-text {
    display: none;
  }

  .navbar-actions {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .btn-sm {
    padding: 0.4rem 0.55rem;
    min-height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 1rem;
  }

  .profile-chip {
    padding: 0.3rem 0.6rem;
    gap: 0.4rem;
    min-height: 38px;
  }

  .profile-chip-avatar {
    font-size: 1.15rem;
  }

  .profile-chip-pseudo {
    max-width: 70px;
    font-size: 0.8rem;
    font-weight: 700;
  }

  /* --- 2. In-Game HUD Mobile : 1 rangée fluide & aérée --- */
  .game-hud-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(0.45rem, var(--sat)) 0.65rem 0.45rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
    background: rgba(9, 13, 22, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    min-height: 52px;
  }

  .hud-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .btn-icon-label {
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-weight: 700;
    font-size: 1.15rem;
  }

  .btn-action-label {
    display: none;
  }

  .hud-level-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .hud-badge {
    font-size: 0.68rem;
    padding: 0.2rem 0.48rem;
    border-radius: 6px;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
  }

  .badge-full {
    display: none !important;
  }

  .badge-short {
    display: inline !important;
  }

  /* Masquer complètement la bannière de défi en cours de jeu sur mobile */
  .challenge-hud-banner {
    display: none !important;
  }

  .hud-level-info strong {
    display: none;
  }

  .hud-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin: 0 auto;
  }

  .hud-clue-pill {
    display: none;
  }

  .hud-objectives-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .hud-counter-pill {
    padding: 0.26rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
  }

  .hud-counter-panda {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  }

  .hud-counter-shoot {
    background: rgba(253, 224, 71, 0.16);
    border: 1px solid rgba(253, 224, 71, 0.38);
    color: #fde047;
    box-shadow: 0 0 10px rgba(253, 224, 71, 0.12);
  }

  .hud-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .hud-timer-box {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.28);
    min-height: 38px;
  }

  .timer-icon {
    display: none;
  }

  .timer-digits {
    font-size: 0.96rem;
    font-weight: 800;
    min-width: 48px;
    text-align: center;
  }

  .miss-full-text {
    display: none;
  }

  .miss-short-text {
    display: inline-flex;
  }

  .miss-badge:not(.has-misses) {
    display: none;
  }

  .miss-badge.has-misses {
    display: inline-flex;
    padding: 0.15rem 0.38rem;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(244, 63, 94, 0.28);
    border: 1px solid rgba(244, 63, 94, 0.5);
    color: #fecdd3;
    border-radius: 6px;
    animation: errorFlash 0.4s ease;
  }

  .btn-icon, .btn-hint, .btn-glass.btn-sm {
    min-width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 1rem;
  }

  .btn-hint {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fde68a;
  }

  /* Tiroir d'outils secondaires (Son & Torche) sur Mobile */
  .hud-secondary-tools-wrap {
    position: relative;
    display: inline-flex;
  }

  .hud-tools-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 11px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--border-subtle);
    font-size: 1.05rem;
    cursor: pointer;
  }

  .hud-tools-drawer {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0.55rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    z-index: 35;
    min-width: 175px;
    flex-direction: column;
    gap: 0.45rem;
  }

  .hud-tools-drawer.open {
    display: flex;
    animation: drawerFadeIn 0.18s ease-out;
  }

  @keyframes drawerFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .hud-tool-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    min-height: 40px;
  }

  .hud-tool-label {
    display: inline;
  }

  .hud-tool-item.active {
    background: rgba(249, 115, 22, 0.22);
    border-color: rgba(249, 115, 22, 0.5);
    color: #fdba74;
  }

  /* Mobile Floating Controls */
  .zoom-controls {
    right: max(0.85rem, var(--sar));
    bottom: max(0.85rem, var(--sab));
    gap: 0.35rem;
  }

  .btn-zoom {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.3rem;
  }

  .controls-help-pill {
    left: max(0.85rem, var(--sal));
    bottom: max(0.85rem, var(--sab));
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }

  .help-desktop { display: none; }
  .help-mobile { display: inline; }

  /* Modals as bottom-sheet on mobile */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(92dvh - var(--sab));
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 1.25rem 1rem max(1.25rem, var(--sab));
    -webkit-overflow-scrolling: touch;
  }

  .modal-card-profile {
    max-width: 100%;
  }

  .modal-close-btn {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 0.55rem;
  }

  .modal-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .podium-container {
    gap: 0.65rem;
    padding: 1rem 0.25rem 0.25rem;
  }

  .podium-avatar-wrap {
    width: 52px;
    height: 52px;
  }

  .podium-avatar {
    font-size: 1.8rem;
  }

  .podium-gold .podium-avatar-wrap {
    width: 62px;
    height: 62px;
  }

  .podium-gold .podium-pedestal {
    height: 85px;
  }

  .podium-silver .podium-pedestal {
    height: 65px;
  }

  .podium-bronze .podium-pedestal {
    height: 50px;
  }

  .th-medal, .td-medal, .th-date, .td-date {
    display: none;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
  }

  .avatar-option {
    min-height: 48px;
    font-size: 1.6rem;
  }

  .challenge-hud-banner {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  .hero {
    padding: 1.5rem 0 2rem;
  }

  .hero-title {
    font-size: clamp(2.1rem, 9vw, 3.2rem);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }
}

@media (min-width: 769px) {
  .help-desktop { display: inline; }
  .help-mobile { display: none; }
}

@media (max-width: 480px) {
  .profile-chip-pseudo {
    max-width: 62px;
  }

  .hud-counter-pill {
    padding: 0.22rem 0.45rem;
    font-size: 0.75rem;
  }

  .timer-digits {
    font-size: 0.92rem;
    min-width: 44px;
  }

  .personal-rank-sticky {
    padding: 0.75rem 1rem;
    margin: 1rem -1rem -1.25rem -1rem;
  }

  .segmented-control {
    flex-direction: column;
  }

  .daily-challenge-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.15rem;
  }

  .daily-card-right {
    width: 100%;
    flex-direction: column;
  }

  .daily-meta-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

/* --- 14. v3 Additions: Daily Challenge, Community Gallery, Cloud Sync & Switch --- */
.daily-challenge-section {
  margin: 0 0 2.75rem;
}

.daily-challenge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  padding: 1.65rem 2rem;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(15, 23, 42, 0.88) 55%, rgba(34, 211, 238, 0.18) 100%);
  border: 1px solid rgba(34, 211, 238, 0.38);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.daily-card-left {
  flex: 1;
}

.daily-badge-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.daily-pill {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #04131a;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.daily-date-meta {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.daily-seed-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
}

.daily-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  color: #f8fafc;
}

.daily-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
  line-height: 1.5;
}

.daily-meta-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.daily-meta-stats strong {
  color: var(--accent-amber);
  font-family: var(--font-mono);
}

.daily-personal-pill {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.daily-card-right {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 215px;
}

/* Community Challenges Section */
.community-section {
  margin: 3rem 0 2rem;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.community-empty-box {
  padding: 2rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--border-subtle);
  border-radius: 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.15rem;
}

.community-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.community-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.community-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.community-creator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.community-creator-avatar {
  font-size: 1.35rem;
}

.community-reward-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.community-biome {
  font-size: 1.02rem;
  font-weight: 800;
  color: #f8fafc;
}

.community-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  color: var(--text-muted);
  background: rgba(9, 13, 22, 0.6);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
}

.community-stats-row strong {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Profile Cloud Sync & Restore */
.player-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.3rem;
}

.cloud-restore-group {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}

.restore-id-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

/* Accessible Switch Control (modern-web-guidance `switch`) */
.switch-group {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
}

.switch-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.switch-text-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

input[type="checkbox"][switch] {
  accent-color: var(--accent-cyan, #22d3ee);
  margin: 0;
  cursor: pointer;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}

input[type="checkbox"][switch]:focus-visible {
  outline: 3px solid var(--accent-amber, #fbbf24);
  outline-offset: 4px;
}

/* --- v4 HUD Multi-Target & Golden Bamboo Counters --- */
.hud-center {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hud-objectives-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hud-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hud-counter-panda {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.38);
}

.hud-counter-shoot {
  background: rgba(245, 158, 11, 0.16);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.shoots-bonus-banner {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(253, 224, 71, 0.35);
  color: #fef08a;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* --- v5 Infinite Campaign, Stage Transition Banner & 8-Universe Atlas --- */
.stage-transition-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 17, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 25;
  pointer-events: none;
  animation: fadeStageBanner 0.22s ease-out;
}

.stage-transition-banner[hidden] {
  display: none !important;
}

@keyframes fadeStageBanner {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stage-transition-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
  border: 2px solid rgba(16, 185, 129, 0.65);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(16, 185, 129, 0.25);
  padding: 1.5rem 2.4rem;
  border-radius: 22px;
  text-align: center;
}

.stage-transition-pill {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #04131a;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
  letter-spacing: 0.05em;
}

.stage-transition-card h3 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.3rem;
}

.stage-transition-card p {
  font-size: 0.98rem;
  color: #a7f3d0;
  margin: 0;
  font-weight: 600;
}

.timer-digits.timer-survival {
  color: #34d399;
}

.timer-digits.timer-low {
  color: #fb7185;
  animation: pulseLowTimer 0.6s infinite alternate;
}

@keyframes pulseLowTimer {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.72;
    transform: scale(1.06);
  }
}

.level-card.universe-locked {
  opacity: 0.78;
  border-style: dashed;
}

.universe-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.14);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.td-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde047;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  margin-right: 0.45rem;
}

.td-hints-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde047;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  margin-left: 0.45rem;
  vertical-align: middle;
}

.personal-rank-hints {
  color: #fde047;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.community-actions-row {
  display: flex;
  gap: 0.55rem;
  width: 100%;
}

.community-actions-row .btn-play-challenge {
  flex: 1.2;
}

.community-actions-row .btn-view-challenge-board {
  flex: 1;
  padding: 0.55rem 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.challenge-board-meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.challenge-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.challenge-meta-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.challenge-meta-item strong {
  font-size: 0.95rem;
  color: #f8fafc;
}

/* =====================================================================
   16. ÉVÉNEMENT SPÉCIAL HALLOWEEN ("La Nuit des Citrouilles Maudites")
   ===================================================================== */
body[data-theme="halloween"] {
  --bg-dark: #0a0414;
  --bg-card: rgba(29, 11, 52, 0.78);
  --border-subtle: rgba(249, 115, 22, 0.28);
  background: radial-gradient(circle at 20% 15%, #1e0b36 0%, #090414 65%);
}

body[data-theme="halloween"] .glow-1 {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.26) 0%, transparent 70%);
}

body[data-theme="halloween"] .glow-2 {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.26) 0%, transparent 70%);
}

.btn-halloween {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #9333ea 100%);
  color: #ffffff;
  border: 1px solid rgba(253, 224, 71, 0.45);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35), 0 0 16px rgba(168, 85, 247, 0.25);
  font-weight: 800;
}

.btn-halloween:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.5), 0 0 22px rgba(168, 85, 247, 0.4);
}

.btn-halloween-pill {
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.45);
  font-weight: 700;
}

.btn-halloween-pill.active,
body[data-theme="halloween"] .btn-halloween-pill {
  background: linear-gradient(135deg, #f97316, #9333ea);
  color: #ffffff;
  border-color: #fde047;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.45);
}

.halloween-event-section {
  margin-bottom: 1.75rem;
}

.halloween-event-card {
  --hw-card-bg: linear-gradient(135deg, rgba(28, 10, 53, 0.92), rgba(59, 7, 100, 0.85));
  --hw-card-border: rgba(249, 115, 22, 0.55);
  --hw-card-glow: rgba(249, 115, 22, 0.22);
  --hw-title-color: #fdba74;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.85rem;
  border-radius: 22px;
  background: var(--hw-card-bg);
  border: 2px solid var(--hw-card-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48), 0 0 28px var(--hw-card-glow);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Child-state-based styling via :has() when the Blood Moon mode toggle is checked */
.halloween-event-card:has(.halloween-bloodmoon-toggle:checked) {
  --hw-card-bg: linear-gradient(135deg, rgba(69, 10, 10, 0.94), rgba(88, 28, 135, 0.9));
  --hw-card-border: rgba(239, 68, 68, 0.85);
  --hw-card-glow: rgba(239, 68, 68, 0.38);
  --hw-title-color: #fca5a5;
}

@supports not selector(:has(*)) {
  .halloween-event-card.is-bloodmoon {
    --hw-card-bg: linear-gradient(135deg, rgba(69, 10, 10, 0.94), rgba(88, 28, 135, 0.9));
    --hw-card-border: rgba(239, 68, 68, 0.85);
    --hw-card-glow: rgba(239, 68, 68, 0.38);
    --hw-title-color: #fca5a5;
  }
}

.halloween-card-left {
  flex: 1;
}

.halloween-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.halloween-pill {
  background: linear-gradient(135deg, #f97316, #dc2626);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.halloween-biome-tag {
  background: rgba(168, 85, 247, 0.22);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.45);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.halloween-candy-tag {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.4);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.halloween-title {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--hw-title-color);
  margin: 0 0 0.45rem;
}

.halloween-desc {
  color: #e2e8f0;
  font-size: 0.94rem;
  line-height: 1.5;
  margin: 0 0 0.85rem;
}

.halloween-bloodmoon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.85rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fde68a;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 0.85rem;
  user-select: none;
}

.halloween-bloodmoon-toggle {
  accent-color: #ef4444;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.halloween-meta-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  align-items: center;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.halloween-unlock-pill {
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #fdba74;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
}

.halloween-unlock-pill.unlocked {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.halloween-card-right {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 225px;
}

@media (max-width: 768px) {
  .halloween-event-card {
    flex-direction: column;
    align-items: stretch;
  }

  .halloween-card-right {
    min-width: 0;
  }
}

/* =====================================================================
   17. SYSTÈME DE PAUSE & SAUVEGARDE DE LA CAMPAGNE INFINIE (v6.2)
   ===================================================================== */
.saved-campaign-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.35rem;
  max-width: 780px;
  margin: 0 auto 1.4rem;
  padding: 1.15rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(15, 23, 42, 0.92), rgba(245, 158, 11, 0.16));
  border: 2px solid rgba(16, 185, 129, 0.55);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), 0 0 24px rgba(16, 185, 129, 0.2);
  text-align: left;
}

.saved-campaign-banner[hidden] {
  display: none !important;
}

.saved-campaign-left {
  flex: 1;
}

.saved-campaign-pill {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #04131a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.saved-campaign-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.25rem;
}

.saved-campaign-meta {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin: 0;
}

.saved-campaign-meta strong {
  color: #fde047;
  font-family: var(--font-mono);
}

.saved-campaign-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 220px;
}

.campaign-pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 8, 17, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 40;
  animation: fadeStageBanner 0.2s ease-out;
}

.campaign-pause-overlay[hidden] {
  display: none !important;
}

.campaign-pause-card {
  width: 100%;
  max-width: 490px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  border: 2px solid rgba(34, 211, 238, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 36px rgba(34, 211, 238, 0.2);
  border-radius: 24px;
  padding: 1.75rem 2rem;
  text-align: center;
}

.pause-badge {
  display: inline-block;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.campaign-pause-card h3 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.45rem;
}

.campaign-pause-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1.2rem;
}

.pause-challenge-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin: 0 0 1.15rem;
  text-align: left;
}

.pause-challenge-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.pause-detail-label {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.pause-challenge-item strong {
  font-weight: 700;
  color: #f8fafc;
  text-align: right;
}

.pause-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}

.pause-stat-item {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pause-stat-item span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.pause-stat-item strong {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: #fde047;
}

.pause-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (max-width: 768px) {
  .saved-campaign-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .saved-campaign-actions {
    min-width: 0;
  }
}

/* =====================================================================
   18. CALENDRIER DES PLACES AU DÉFI DU JOUR (PROFIL JOUEUR — D.A. BABYWEB)
   ===================================================================== */
.modal-card-profile {
  width: 100%;
  max-width: 740px;
}

.daily-heatmap-section {
  margin-bottom: 1.35rem;
}

.daily-heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.daily-heatmap-summary-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.daily-heatmap-card {
  --heatmap-weeks: 20;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.94) 0%, rgba(20, 30, 48, 0.9) 100%);
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 18px;
  padding: 1.1rem 1.25rem 0.95rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  width: 100%;
}

.daily-heatmap-scroll {
  width: 100%;
  overflow-x: hidden;
}

.daily-heatmap-inner {
  display: block;
  width: 100%;
}

.daily-heatmap-months {
  display: grid;
  grid-template-columns: repeat(var(--heatmap-weeks, 20), minmax(0, 1fr));
  gap: 5px;
  height: 20px;
  margin-left: 36px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 700;
  user-select: none;
}

.daily-heatmap-month-label {
  grid-column-start: auto;
  white-space: nowrap;
  text-transform: capitalize;
}

.daily-heatmap-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.daily-heatmap-weekdays {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 5px;
  width: 28px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  text-align: right;
  padding-right: 4px;
}

.daily-heatmap-weekdays span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.daily-heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
  width: 100%;
  flex: 1;
}

.heatmap-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.heatmap-cell:hover,
.heatmap-cell:focus-visible {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

.heatmap-cell.is-future {
  opacity: 0.12;
  pointer-events: none;
}

/* Nuancier D.A. BabyWeb selon la place au classement */
.heatmap-cell.rank-level-0 {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.heatmap-cell.rank-level-1 {
  background: rgba(16, 185, 129, 0.28);
  border: 1px solid rgba(16, 185, 129, 0.55);
  box-shadow: inset 0 0 4px rgba(16, 185, 129, 0.2);
}

.heatmap-cell.rank-level-2 {
  background: rgba(6, 182, 212, 0.48);
  border: 1px solid rgba(34, 211, 238, 0.75);
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.35);
}

.heatmap-cell.rank-level-3 {
  background: linear-gradient(135deg, #06b6d4, #10b981);
  border: 1px solid #67e8f9;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
}

.heatmap-cell.rank-level-4 {
  background: linear-gradient(135deg, #f59e0b, #fde047);
  border: 1px solid #fef08a;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.75);
}

.daily-heatmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.daily-heatmap-hint {
  color: #cbd5e1;
  min-height: 1.3em;
  line-height: 1.4;
}

.daily-heatmap-hint strong {
  color: #f8fafc;
}

.daily-heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.daily-heatmap-legend .heatmap-cell {
  width: 14px;
  height: 14px;
  cursor: help;
}

.heatmap-winner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: #fde047;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  white-space: nowrap;
}

.legend-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 3px;
}






