/* ========================================================================== */
/* APPLE DESIGN SYSTEM — COMMENT ÇA S'APPELLE ?                              */
/* Based on Apple WWDC Design Talks: Designing Fluid Interfaces & Craft      */
/* ========================================================================== */

:root {
  /* ---- Design tokens v3 (refonte claire, validée en maquette) ---- */
  --bg-page: #ffffff;
  --bg-surface: #f2f3ec;
  --bg-surface-alt: #e9ebde;
  --ink: #19270a;
  --accent: #cdc61e;
  --accent-dim: #a39f1a; /* toujours avec du contenu sombre dessus, jamais blanc */
  --accent-text: #7a7500; /* accent assombri, seule variante lisible en TEXTE sur fond clair (4.80:1) */
  --text-secondary: #5b6356;
  --rank-1: #4a4a4a;
  --rank-2: #8a8a8a;
  --rank-3: #c7c7c7;

  /* ---- Alias historiques "apple-*" : conservés tels quels (game.js/app.js      */
  /* manipulent ces classes), mais REMAPPÉS sur les tokens clairs ci-dessus.      */
  /* Voir le plan : accent (#CDC61E) n'habille jamais du texte/trait sur fond     */
  /* clair (1.80:1, échec) — les rôles "texte/bordure/icône vive" ci-dessous      */
  /* pointent donc vers --ink, qui est le remplaçant sûr. L'accent réapparaît     */
  /* via des surcharges locales scopées aux éléments intrinsèquement sombres      */
  /* (ex. .island-pill, fond noir fixe) plus bas dans ce fichier.                 */
  --apple-black: #000000;
  --apple-bg: var(--bg-page);
  --apple-surface-elevated: rgba(255, 255, 255, 0.82);
  --apple-surface-card: rgba(255, 255, 255, 0.88);
  --apple-surface-secondary: rgba(25, 39, 10, 0.06);
  --apple-surface-interactive: rgba(25, 39, 10, 0.05);

  /* Materials & Specular Hairlines */
  --apple-hairline: rgba(25, 39, 10, 0.12);
  --apple-specular-top: rgba(255, 255, 255, 0.7);
  --apple-blur: blur(28px) saturate(190%);

  /* Apple Accent Colors — valeurs assombries pour rester ≥ 4.5:1 sur fond blanc */
  --apple-blue: var(--ink);
  --apple-blue-vibrant: var(--ink);
  --apple-coral: #d6353a;              /* erreur / destructif — 4.74:1 sur blanc */
  --apple-coral-glow: rgba(214, 53, 58, 0.35);
  --apple-amber: #8a6300;              /* 5.43:1 sur blanc */
  --apple-green: #136b3a;              /* succès — 6.58:1 sur blanc */
  --apple-purple: var(--ink);

  /* Typography Colors */
  --apple-label-primary: var(--ink);
  --apple-label-secondary: var(--text-secondary);
  --apple-label-tertiary: rgba(25, 39, 10, 0.5);
  --apple-label-quaternary: rgba(25, 39, 10, 0.32);

  /* Typography Stack — Police unique absolue : Geista Mond */
  --font-display: "Geista Mond", sans-serif;
  --font-system: "Geista Mond", sans-serif;

  /* Physics Timing */
  --spring-default: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-press: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@font-face {
  font-family: "Geista Mond";
  src: url("fonts/GEISTAMOND.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

/* Titres "display" : taille/espacement pour la hiérarchie, jamais de gras synthétique */
.apple-hero-title, .end-headline, .sheet-title, .gallery-main-title,
.missions-main-title, .card-headline {
  font-family: var(--font-display);
  font-weight: 400;
}

/* HUD de jeu (bandeau noir fixe, voir .island-pill plus bas, background: #000000
   littéral) : on y restaure l'accent et les teintes vives, toujours lisibles ici
   puisque le fond reste noir indépendamment du thème général de l'app. */
.island-pill {
  --apple-blue-vibrant: var(--accent);
  --apple-green: #30d158;
  --apple-coral: #ff375f;
}

/* Alertes, feuilles modales et toasts : restent des surfaces sombres fixes
   (rgba(20,20,30,.9+) littéral) quel que soit le thème général ; on y restaure
   le texte clair attendu, sans toucher --apple-blue-vibrant/--apple-blue
   (qui pointent vers --ink, déjà sûr avec du texte blanc dessus : 15.72:1). */
.apple-alert-box,
.apple-sheet-modal,
.toast-alert,
.achievement-toast {
  --apple-label-primary: #ffffff;
  --apple-label-secondary: rgba(255, 255, 255, 0.65);
  --apple-label-tertiary: rgba(255, 255, 255, 0.42);
  --apple-green: #30d158;
  --apple-amber: #ff9f0a;
  --apple-coral: #ff375f;
  /* --apple-blue-vibrant pointait vers --ink (texte sombre) pour le reste
     de l'app désormais claire ; restauré en bleu vif ici comme les autres
     couleurs sémantiques, sinon invisible sur ces surfaces sombres fixes
     (ex: .mission-status-pill.available dans la fiche de mission). */
  --apple-blue-vibrant: #0a84ff;
  --apple-hairline: rgba(255, 255, 255, 0.12);
  --apple-surface-secondary: rgba(255, 255, 255, 0.08);
  --apple-surface-card: rgba(255, 255, 255, 0.06);
}

/* ========================================================================== */
/* RESET & FOUNDATIONS                                                        */
/* ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button, input, select, textarea, optgroup {
  font-family: var(--font-system);
}

html, body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: none;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  touch-action: pan-y;
  font-synthesis: none;
  -webkit-font-synthesis: none;
}

body {
  background-color: var(--apple-bg);
  background-image: 
    radial-gradient(ellipse 65% 50% at 50% 0%, rgba(205, 198, 30, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(25, 39, 10, 0.05) 0%, transparent 70%);
  color: var(--apple-label-primary);
  font-family: var(--font-system);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ========================================================================== */
/* APPLE HARDWARE SHELL FRAME                                                 */
/* ========================================================================== */

.apple-device-frame {
  width: 100%;
  max-width: 420px;
  height: 94vh;
  max-height: 870px;
  /* Fond clair (et non plus --apple-black littéral) : .apple-screen et
     .screen-view n'ont pas toujours leur propre carte opaque par-dessus
     (ex. écran de connexion), donc ce fond EST ce que l'utilisateur voit
     dans ces zones — il doit suivre le thème clair, pas rester un bezel
     sombre hérité de l'ancien thème. */
  background: var(--bg-page);
  border-radius: 44px;
  position: relative;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  box-shadow:
    0 35px 80px -20px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}


.apple-screen {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

.screen-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  position: relative;
  z-index: 10;
  scrollbar-width: none;
}

.screen-view::-webkit-scrollbar {
  display: none;
}

.hidden {
  display: none !important;
}

/* Instant Response on Touch (Rule 1: Kill Latency) */
button, .segment-btn, .apple-widget {
  transition: transform 120ms var(--spring-press), opacity 120ms ease;
  will-change: transform;
}

button:active, .segment-btn:active, .apple-widget:active {
  transform: scale(0.965);
  opacity: 0.88;
}

/* ========================================================================== */
/* 1. ÉCRAN D'ACCUEIL — APPLE CRAFT & HIERARCHY                              */
/* ========================================================================== */

.apple-header {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 24px;
}

.apple-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apple-blue-vibrant);
  margin-bottom: 8px;
}

.apple-hero-title {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em; /* Negative tracking for display type */
  margin-bottom: 10px;
}

.hero-gradient {
  /* Aplat uni (pas de background-clip:text) : avec une police display à
     traits épais/stylisés comme Geista Mond, un dégradé clipé sur le texte
     rendait les lettres visuellement différentes (anti-aliasing du
     dégradé déformant le tracé), au point de sembler une autre police.
     --accent-text est une variante assombrie de l'accent (4.80:1 sur
     blanc) : l'accent brut (#CDC61E) échoue en texte sur fond clair. */
  color: var(--accent-text);
}

.apple-hero-subtitle {
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--apple-label-secondary);
  padding: 0 8px;
}

/* Widgets Apple (Home Screen / Control Center aesthetic) */
.mode-widget-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.apple-widget {
  background: var(--apple-surface-card);
  backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-hairline);
  border-top: 1px solid var(--apple-specular-top); /* Light catching the glass edge */
  border-radius: 22px;
  padding: 16px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  position: relative;
  color: var(--apple-label-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.apple-widget.widget-featured {
  /* Carte "mise en avant" scopée sombre (comme .island-pill) : fond carte
     clair + texte --apple-label-primary (sombre) hérité du thème général
     rendait le texte illisible ici (fond rgba(38,38,48,.9) jamais remappé
     depuis le thème sombre d'origine). Alignée sur la maquette validée
     (carte catégorie fond --ink, texte clair). */
  background: var(--ink);
  border-color: rgba(205, 198, 30, 0.35);
  box-shadow: 0 10px 30px -5px rgba(25, 39, 10, 0.35);
  --apple-label-primary: #ffffff;
  --apple-label-secondary: rgba(255, 255, 255, 0.68);
}

.widget-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.icon-coral {
  background: linear-gradient(135deg, #ff375f 0%, #d62045 100%);
}

.icon-amber {
  background: linear-gradient(135deg, #ff9f0a 0%, #c97500 100%);
}

.icon-blue {
  background: linear-gradient(135deg, #2b3e15 0%, #19270a 100%);
  color: var(--accent);
}

.widget-content {
  flex: 1;
}

.widget-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.widget-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.apple-badge-featured {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.widget-desc {
  font-size: 12.5px;
  color: var(--apple-label-secondary);
  line-height: 1.35;
}

.widget-chevron {
  font-size: 22px;
  font-weight: 300;
  color: var(--apple-label-quaternary);
}

/* Footer Apple */
.apple-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.apple-capsule-btn {
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-hairline);
  color: var(--apple-label-primary);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.apple-feature-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-chip {
  font-size: 11px;
  color: var(--apple-label-tertiary);
  /* rgba blanc invisible sur fond clair : pastille sans contour visible. */
  background: var(--bg-surface);
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid var(--apple-hairline);
}

/* ========================================================================== */
/* 2. ÉCRAN DE JEU — DYNAMIC ISLAND & FOCUS CARD                              */
/* ========================================================================== */

/* Apple Dynamic Island Bar */
.dynamic-island-bar {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.island-pill {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-shadow: 
    0 10px 24px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.level-indicator {
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-green);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 8px;
}

/* app.js fixe une couleur de fond inline par palier de difficulté
   (#0071e3 bleu / #ff9f0a ambre / #ff453a rouge, cf. getCurrentDifficultyTier)
   — un seul texte ne peut pas rester lisible sur les 3 (vérifié
   hig_checker.py : blanc échoue sur ambre/rouge, --ink échoue sur bleu).
   On neutralise ce fond coloré variable par palier pour une pastille
   toujours lisible, cohérente avec la marque (fond accent, texte encre). */
#game-level-badge {
  background-color: var(--accent) !important;
  color: var(--ink) !important;
}

.island-timer-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.island-timer-text {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
}

.circular-timer-ring {
  width: 22px;
  height: 22px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3.5;
}

.ring-fg {
  fill: none;
  stroke: var(--apple-blue-vibrant);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 0.1s linear, stroke 0.25s ease;
}

.streak-indicator {
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-coral);
  margin-right: 6px;
}

.score-indicator {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--apple-label-secondary);
}

/* Spring Hairline Progress */
.spring-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(25, 39, 10, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.spring-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.1s linear, background-color 0.25s;
}

/* Apple Focus Card (The Museum Gallery Piece) */
.apple-focus-card {
  background: var(--apple-surface-card);
  backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-hairline);
  border-top: 1px solid var(--apple-specular-top);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.card-glass-specular {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  pointer-events: none;
}

.apple-photo-viewport {
  width: 100%;
  height: 240px;
  background: radial-gradient(circle at center, #1c2230 0%, #05070a 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 4px;
}

.card-svg {
  width: 80%;
  height: 80%;
}

.card-content-area {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-index-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--apple-label-tertiary);
}

.apple-text-btn {
  background: none;
  border: none;
  color: var(--apple-amber);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}

.apple-text-btn:hover {
  background: rgba(255, 159, 10, 0.12);
}

.card-headline {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--apple-label-primary);
}

.apple-hint-bubble {
  background: rgba(255, 159, 10, 0.12);
  border: 1px solid rgba(255, 159, 10, 0.3);
  color: var(--apple-amber);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.35;
}

/* ========================================================================== */
/* INTERACTION DOCK & iOS SEGMENTED CONTROL                                   */
/* ========================================================================== */

.interaction-dock {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* iOS Segmented Control (The Canonical Apple Design Toggle) */
.ios-segmented-control {
  background: rgba(120, 120, 128, 0.24);
  backdrop-filter: var(--apple-blur);
  border-radius: 12px;
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.segment-btn {
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 7px 0;
  font-family: var(--font-system);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--apple-label-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.segment-btn.active {
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.segment-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Docks */
.dock-zone {
  width: 100%;
}

/* Voice Dock with Acoustic Ripples */
.voice-dock {
  background: var(--apple-surface-card);
  border: 1px solid var(--apple-hairline);
  border-radius: 20px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.voice-dock:hover {
  border-color: rgba(25, 39, 10, 0.4);
  transform: translateY(-1px);
}

.voice-dock:active {
  transform: scale(0.98);
}

.voice-dock.listening {
  border-color: rgba(25, 39, 10, 0.7);
  box-shadow: 0 0 25px rgba(25, 39, 10, 0.3);
}

.acoustic-orb {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apple-blue-vibrant), var(--apple-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(25, 39, 10, 0.4);
}

.mic-glyph {
  font-size: 18px;
}

.acoustic-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--apple-blue-vibrant);
  opacity: 0;
  animation: acousticWave 1.8s infinite var(--spring-default);
}

.ripple-2 {
  animation-delay: 0.9s;
}

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

.dock-transcript-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.dock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--apple-blue-vibrant);
  text-transform: uppercase;
}

.dock-transcription {
  font-size: 13.5px;
  color: var(--apple-label-secondary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-transcription.active {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

/* Keyboard Dock */
.apple-input-field {
  position: relative;
  width: 100%;
}

.apple-input-field input {
  width: 100%;
  background: var(--apple-surface-card);
  border: 1px solid var(--apple-hairline);
  border-radius: 16px;
  padding: 13px 70px 13px 16px;
  /* Corrigé : texte blanc sur carte désormais claire = invisible pendant la
     saisie de la réponse en mode Clavier (bug réel, pas cosmétique). */
  color: var(--ink);
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s;
}

.apple-input-field input:focus {
  border-color: var(--apple-blue-vibrant);
  box-shadow: 0 0 0 3px rgba(25, 39, 10, 0.2);
}

.input-action-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-label-tertiary);
}

.apple-input-field input.shake {
  animation: shake 0.35s ease-in-out;
  border-color: var(--apple-coral);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Apple QCM Grid */
.apple-qcm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qcm-option-btn {
  background: var(--apple-surface-card);
  border: 1px solid var(--apple-hairline);
  border-radius: 14px;
  color: var(--apple-label-primary);
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.qcm-option-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.qcm-option-btn:disabled {
  cursor: default;
  opacity: 0.88;
}

.qcm-option-btn.correct {
  background: #34c759 !important;
  border-color: #34c759 !important;
  color: #000000 !important;
  box-shadow: 0 0 16px rgba(52, 199, 89, 0.45);
}

.qcm-option-btn.wrong {
  background: #ff3b30 !important;
  border-color: #ff3b30 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(255, 59, 48, 0.45);
  animation: shake 0.35s ease;
}

/* Dock Utilities */
.dock-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.apple-utility-btn {
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-hairline);
  color: var(--apple-label-secondary);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.voice-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  /* rgba blanc supposait un fond sombre pour rester visible : pastille
     quasi invisible sur le dock désormais clair. */
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--apple-label-secondary);
}

.voice-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.6);
  animation: pulseVoice 1.8s infinite ease-in-out;
}

.voice-status-pill.disabled .voice-dot {
  background: var(--apple-label-tertiary);
  box-shadow: none;
  animation: none;
}

@keyframes pulseVoice {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.pass-btn:hover {
  /* Fond hérité de .apple-utility-btn (clair) : texte blanc au survol
     devenait invisible. */
  color: var(--ink);
}

/* ========================================================================== */
/* 3. ÉCRAN DE RÉVÉLATION — iOS SHEET PRESENTATION                            */
/* ========================================================================== */

.apple-sheet-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: slideUpSheet 0.35s var(--spring-default);
}

@keyframes slideUpSheet {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-grabber {
  width: 36px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  margin-bottom: 14px;
}

.sheet-status-tag {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.status-correct {
  color: var(--apple-green);
}

.sheet-media-frame {
  width: 140px;
  height: 140px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 14px;
  background: #000;
}

.sheet-media-frame .card-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.sheet-word-block {
  margin-bottom: 14px;
}

.sheet-pre-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--apple-label-tertiary);
  text-transform: uppercase;
}

.sheet-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  margin: 3px 0 6px 0;
}

.sheet-phonetic-pill {
  display: inline-block;
  /* rgba blanc invisible sur la carte de révélation désormais claire. */
  background: var(--bg-surface);
  color: var(--apple-amber);
  font-size: 13px;
  font-family: var(--font-system);
  padding: 3px 12px;
  border-radius: 10px;
}

.sheet-trivia-box {
  /* rgba blanc invisible sur la carte de révélation désormais claire. */
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  margin-bottom: 18px;
  width: 100%;
}

.trivia-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.trivia-icon {
  font-size: 14px;
}

.trivia-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--apple-blue-vibrant);
  text-transform: uppercase;
}

.trivia-body {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--apple-label-secondary);
}

.apple-prominent-btn {
  width: 100%;
  background: var(--apple-blue);
  color: #ffffff;
  border: none;
  border-radius: 18px;
  padding: 15px 20px;
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Ombre bleue littérale (reliquat du thème sombre) remplacée par une
     ombre teintée encre, cohérente avec le fond --ink du bouton. */
  box-shadow: 0 8px 24px rgba(25, 39, 10, 0.35);
}

.apple-prominent-btn:hover {
  /* #0077ed littéral (bleu du thème sombre d'origine) faisait flasher le
     bouton principal en bleu au survol, à l'opposé du code couleur de la
     refonte. Remplacé par un simple éclaircissement de --ink. */
  filter: brightness(1.15);
}

.apple-prominent-btn.share-btn {
  background: linear-gradient(135deg, var(--apple-coral) 0%, #d62045 100%);
  box-shadow: 0 8px 24px rgba(255, 55, 95, 0.4);
}

/* ========================================================================== */
/* 4. ÉCRAN DE FIN DE PARTIE                                                  */
/* ========================================================================== */

.apple-end-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.end-celebration-badge {
  font-size: 44px;
  margin-bottom: 8px;
  animation: floatBadge 2.2s infinite ease-in-out;
}

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

.end-headline {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.end-summary-tile {
  background: var(--apple-surface-card);
  backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-hairline);
  border-top: 1px solid var(--apple-specular-top);
  border-radius: 24px;
  padding: 18px 24px;
  width: 100%;
  margin-bottom: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.summary-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--apple-label-tertiary);
  text-transform: uppercase;
}

.summary-score-value {
  font-size: 46px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.05;
  margin: 6px 0 10px 0;
}

.summary-rank-pill {
  display: inline-block;
  background: linear-gradient(90deg, var(--apple-coral), var(--apple-purple));
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 14px;
}

.end-quote-description {
  font-size: 13px;
  line-height: 1.45;
  color: var(--apple-label-secondary);
  margin-bottom: 16px;
  padding: 0 10px;
}

.end-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--apple-surface-secondary);
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-box span {
  font-size: 10px;
  font-weight: 600;
  color: var(--apple-label-tertiary);
  text-transform: uppercase;
}

.stat-box strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* Progression Campagne (120 Niveaux) & Difficulté */
.end-campaign-tile {
  width: 100%;
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-hairline);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.campaign-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.campaign-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.campaign-glyph {
  font-size: 15px;
}

.campaign-tier-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  /* Bleu littéral (reliquat du thème sombre, hors code couleur) remplacé
     par une teinte accent cohérente avec le reste du système de badges. */
  background: rgba(205, 198, 30, 0.16);
  color: var(--ink);
  border: 1px solid rgba(205, 198, 30, 0.35);
}

.campaign-level-indicator {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.campaign-progress-bar-wrapper {
  width: 100%;
  height: 6px;
  /* rgba blanc invisible sur fond clair : barre sans piste visible. */
  background: var(--bg-surface-alt);
  border-radius: 6px;
  overflow: hidden;
}

.campaign-bar-fill {
  height: 100%;
  /* #30d158 littéral (reliquat du thème sombre, pas remappé via variable)
     remplacé par le dégradé accent de la marque. */
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.end-actions-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.next-round-btn {
  background: linear-gradient(135deg, var(--ink) 0%, #0d1505 100%);
  box-shadow: 0 8px 24px rgba(25, 39, 10, 0.45);
  font-size: 17px;
  font-weight: 700;
  padding: 16px 20px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  color: #fff;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.15s ease;
}

.next-round-btn:active {
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}

.social-share-strip {
  display: flex;
  gap: 8px;
  width: 100%;
}

.social-chip {
  flex: 1;
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-hairline);
  color: var(--ink);
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.social-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

/* ========================================================================== */
/* 5. ÉCRAN GALERIE                                                           */
/* ========================================================================== */

.gallery-apple-header {
  margin-bottom: 16px;
}

.apple-nav-back {
  background: none;
  border: none;
  color: var(--apple-blue-vibrant);
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gallery-main-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.gallery-subtitle {
  font-size: 12.5px;
  color: var(--apple-label-secondary);
}

.gallery-apple-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-card {
  background: var(--apple-surface-card);
  backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-hairline);
  border-top: 1px solid var(--apple-specular-top);
  border-radius: 20px;
  padding: 14px;
  position: relative;
}

.gallery-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 3px 8px;
  border-radius: 8px;
}

.gallery-photo {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: radial-gradient(circle at center, #1c2230 0%, #05070a 100%);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 10px;
  display: block;
}

.gallery-svg {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 14px;
  margin-bottom: 10px;
}

.gallery-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 2px;
}

.gallery-pron {
  font-size: 12px;
  color: var(--apple-amber);
  font-family: var(--font-system);
  margin-bottom: 6px;
}

.gallery-question {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--apple-label-secondary);
  margin-bottom: 6px;
}

.gallery-trivia {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--apple-label-tertiary);
}

/* ========================================================================== */
/* TOAST NOTIFICATION — iOS FLOATING CAPSULE                                  */
/* ========================================================================== */

.toast-alert {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(30, 30, 38, 0.94);
  backdrop-filter: var(--apple-blur);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: all 0.28s var(--spring-default);
  z-index: 99999;
  pointer-events: none;
}

.toast-alert.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========================================================================== */
/* ACCESSIBILITY & REDUCED MOTION (Rule 14)                                   */
/* ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .apple-sheet-card {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .apple-focus-card, .apple-widget, .ios-segmented-control, .voice-dock, .toast-alert {
    backdrop-filter: none !important;
    background: #181822 !important;
  }
}

/* ========================================================================== */
/* BANNERS : VIRAL CHALLENGE & IN-APP WEBVIEW HELPER                         */
/* ========================================================================== */

.challenge-banner {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.18) 0%, rgba(255, 69, 58, 0.14) 100%);
  border: 1px solid rgba(255, 159, 10, 0.4);
  backdrop-filter: var(--apple-blur);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(255, 159, 10, 0.15);
  animation: slideDownIn 0.4s var(--spring-default);
}

.challenge-badge-row {
  display: flex;
  margin-bottom: 4px;
}

.challenge-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  /* #ff9f0a littéral sur son propre fond orange pâle = 1.70:1 (vérifié). */
  color: var(--apple-amber);
  background: rgba(255, 159, 10, 0.2);
  padding: 3px 8px;
  border-radius: 10px;
}

.challenge-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
}

.challenge-text strong {
  color: #ff9f0a;
  font-weight: 700;
}

.webview-helper-banner {
  background: rgba(25, 39, 10, 0.12);
  border: 1px solid rgba(25, 39, 10, 0.35);
  backdrop-filter: var(--apple-blur);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.helper-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.helper-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.helper-title {
  font-size: 11.5px;
  font-weight: 700;
  /* #2997ff littéral sur son propre fond bleu pâle = 2.54:1 (vérifié). */
  color: var(--ink);
  letter-spacing: 0.02em;
}

.helper-desc {
  font-size: 11px;
  color: var(--apple-label-secondary);
  line-height: 1.35;
}

@keyframes slideDownIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================================== */
/* NATIVE MOBILE EDGE-TO-EDGE SUPPORT                                         */
/* ========================================================================== */

@media (max-width: 480px) {
  body {
    padding: 0;
    overflow-x: hidden;
    touch-action: pan-y;
  }
  .apple-device-frame {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
  .screen-view {
    overflow-x: hidden;
    touch-action: pan-y;
  }
}

/* ========================================================================== */
/* GAMIFICATION & PROGRESSION SYSTEM (XP, COMBOS, TROPHIES, MODALS)           */
/* ========================================================================== */

/* En-tête Accueil avec Sélecteur de Langue */
/* 1. Carte Profil Joueur (Accueil) */
.player-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  backdrop-filter: var(--apple-blur);
  border-radius: 22px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 10px 25px rgba(25, 39, 10, 0.12);
}

.profile-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.player-avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.25) 0%, rgba(255, 69, 58, 0.2) 100%);
  border: 1.5px solid rgba(255, 159, 10, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 159, 10, 0.2);
}

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

.player-level-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--apple-amber);
  /* Noir sur ambre assombri = 3.87:1 (vérifié, échoue). */
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 8px;
}

.player-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.player-xp-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xp-count {
  font-size: 10.5px;
  color: var(--apple-label-secondary);
  font-weight: 500;
}

.xp-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9f0a 0%, #ff453a 100%);
  border-radius: 4px;
  transition: width 0.6s var(--spring-default);
}

.profile-stats-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-stat-item {
  background: none;
  border: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.profile-stat-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.stat-glyph {
  font-size: 18px;
}

.stat-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.stat-text-col strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.stat-text-col span {
  font-size: 10px;
  color: var(--apple-label-tertiary);
}

.stat-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

/* 2. Barre de Navigation Supérieure de Jeu (Quitter + Combo) */
.game-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.apple-nav-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--apple-hairline);
  color: var(--apple-label-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.apple-nav-back-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.game-combo-pill {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.2) 0%, rgba(255, 159, 10, 0.2) 100%);
  border: 1px solid rgba(255, 69, 58, 0.4);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 800;
  /* #ff453a littéral sur fond rouge/orange pâle = 2.76:1 (vérifié). */
  color: var(--apple-coral);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s var(--spring-default);
}

.game-combo-pill.active {
  transform: scale(1.08);
  border-color: #ff453a;
  box-shadow: 0 0 14px rgba(255, 69, 58, 0.4);
}

.combo-label {
  font-size: 9px;
  /* blanc à 70% invisible sur le fond rose/orange pâle de .game-combo-pill. */
  color: var(--apple-coral);
}

/* 3. Scores Flottants (+150 pts, +50 Éclair) */
.floating-score-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.floating-score-pill {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(48, 209, 88, 0.6);
  color: #30d158;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(48, 209, 88, 0.35);
  animation: floatUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.floating-bonus-pill {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 159, 10, 0.6);
  color: #ff9f0a;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 16px;
  animation: floatUp 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.85);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1.05);
  }
  80% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.9);
  }
}

/* 4. Notification Pop-in Succès Débloqué */
.achievement-toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 24, 0.92);
  border: 1px solid rgba(255, 159, 10, 0.5);
  backdrop-filter: blur(28px) saturate(190%);
  border-radius: 24px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 159, 10, 0.3);
  z-index: 999;
  animation: dropInToast 0.4s var(--spring-default);
}

.trophy-glyph {
  font-size: 24px;
}

.achievement-toast-content {
  display: flex;
  flex-direction: column;
}

.ach-label {
  font-size: 9px;
  font-weight: 800;
  color: #ff9f0a;
  letter-spacing: 0.08em;
}

.achievement-toast-content strong {
  font-size: 13px;
  color: #fff;
}

@keyframes dropInToast {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-25px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* 5. Écran Révélation : Points breakdown, New Discovery & Quit */
.reveal-points-pill {
  background: rgba(48, 209, 88, 0.15);
  border: 1px solid rgba(48, 209, 88, 0.4);
  /* #30d158 littéral sur son propre fond vert pâle = 1.76:1 (vérifié). */
  color: var(--apple-green);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 14px;
  margin-top: 4px;
}

.new-discovery-pill {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.25) 0%, rgba(255, 69, 58, 0.2) 100%);
  border: 1px solid rgba(255, 159, 10, 0.5);
  /* #ff9f0a littéral sur fond orange/rouge pâle = 1.68:1 (vérifié). */
  color: var(--apple-amber);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 14px;
  margin-top: 6px;
  animation: pulseDot 2s infinite ease-in-out;
}

.quit-reveal-btn {
  color: var(--apple-label-tertiary);
  font-size: 12px;
  margin-top: 4px;
}

.quit-reveal-btn:hover {
  color: var(--apple-coral);
}

/* 6. Écran Fin : XP Tile & Discoveries Box */
.end-xp-tile {
  /* rgba blanc invisible sur fond clair : tuile XP sans contour visible. */
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  backdrop-filter: var(--apple-blur);
  border-radius: 18px;
  padding: 14px 18px;
  width: 100%;
  margin-bottom: 12px;
}

.xp-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.xp-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--apple-label-secondary);
}

.xp-earned-value {
  font-size: 15px;
  font-weight: 800;
  /* #ff9f0a littéral échoue sur fond clair (2.06:1 sur blanc, vérifié). */
  color: var(--apple-amber);
}

.xp-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  /* blanc à 80% invisible sur la tuile XP désormais claire. */
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.xp-bar-container {
  width: 100%;
  height: 8px;
  /* rgba blanc invisible sur fond clair : barre d'XP sans piste visible. */
  background: var(--bg-surface-alt);
  border-radius: 5px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  /* Dégradé orange->vert littéral (reliquat du thème sombre, pas remappé
     via variable) remplacé par le dégradé accent de la marque. */
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.end-discoveries-box {
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.25);
  border-radius: 16px;
  padding: 12px 14px;
  width: 100%;
  margin-bottom: 14px;
}

.discoveries-label {
  font-size: 10px;
  font-weight: 800;
  /* #30d158 littéral échoue sur fond clair (2.02:1 sur blanc, vérifié). */
  color: var(--apple-green);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 8px;
}

.discoveries-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discovery-chip {
  background: rgba(48, 209, 88, 0.2);
  border: 1px solid rgba(48, 209, 88, 0.4);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

/* 7. Collection (Galerie) Pokédex : Filtres & Objets Verrouillés */
.gallery-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}

.gallery-percent-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-green);
  background: rgba(48, 209, 88, 0.15);
  border: 1px solid rgba(48, 209, 88, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
}

.gallery-filter-chips {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.filter-chip {
  /* rgba blanc invisible sur fond clair : chips de filtre sans contour. */
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  color: var(--apple-label-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.gallery-card.locked {
  opacity: 0.55;
  filter: grayscale(0.85);
  position: relative;
}

.gallery-card.locked .gallery-photo,
.gallery-card.locked .gallery-svg {
  filter: blur(8px);
}

.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(10, 10, 15, 0.7);
  border-radius: 18px;
  z-index: 5;
}

.locked-icon {
  font-size: 26px;
}

.locked-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-label-secondary);
  text-align: center;
  padding: 0 12px;
}

/* 8. MODALS (Quitter la partie & Salle des Trophées) */
.apple-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.apple-alert-box {
  background: rgba(28, 28, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(32px) saturate(190%);
  border-radius: 24px;
  padding: 24px 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: scaleUpIn 0.25s var(--spring-default);
}

.alert-icon-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 69, 58, 0.15);
  border: 1px solid rgba(255, 69, 58, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 14px;
}

.alert-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.alert-message {
  font-size: 12.5px;
  color: var(--apple-label-secondary);
  line-height: 1.45;
  margin-bottom: 20px;
}

.alert-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-btn {
  width: 100%;
  padding: 12px 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-system);
}

.alert-btn-primary {
  background: var(--apple-blue);
  color: #fff;
}

.alert-btn-destructive {
  background: rgba(255, 69, 58, 0.15);
  /* var(--apple-coral) (même teinte vive que le fond) ne passait que
     3.91:1 sur ce fond semi-transparent assombri (vérifié hig_checker.py).
     Texte blanc, beaucoup plus sûr (13.78:1). */
  color: #ffffff;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.alert-btn-destructive:hover {
  background: rgba(255, 69, 58, 0.25);
}

/* Modal Salle des Trophées */
.apple-sheet-modal {
  background: rgba(22, 22, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(36px) saturate(200%);
  border-radius: 28px;
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  animation: slideUpModal 0.3s var(--spring-default);
  overflow-x: hidden;
  touch-action: pan-y;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 0 auto 12px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.sheet-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.sheet-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--apple-label-secondary);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievements-subtitle {
  font-size: 11.5px;
  color: var(--apple-label-secondary);
  margin-bottom: 14px;
}

.achievements-list-container {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.achievement-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--apple-hairline);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  background: rgba(255, 159, 10, 0.1);
  border-color: rgba(255, 159, 10, 0.35);
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-icon-frame {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.achievement-card.unlocked .achievement-icon-frame {
  background: rgba(255, 159, 10, 0.2);
}

.achievement-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.achievement-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.achievement-desc {
  font-size: 11px;
  color: var(--apple-label-secondary);
  line-height: 1.3;
}

.achievement-reward {
  font-size: 10px;
  font-weight: 800;
  color: #ff9f0a;
}

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

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

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================================== */
/* ÉCRAN DE CONNEXION (PSEUDO UNIQUE & BACKEND)                               */
/* ========================================================================== */

.apple-login-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 12px;
  animation: fadeIn 0.35s ease;
}

.login-badge-glyph {
  font-size: 48px;
  margin-bottom: 10px;
  filter: drop-shadow(0 8px 16px rgba(25, 39, 10, 0.4));
  animation: floatBadge 2.2s infinite ease-in-out;
}

.login-instruction {
  font-size: 13px;
  color: var(--apple-label-secondary);
  line-height: 1.45;
  max-width: 300px;
  margin: 10px auto 24px;
}

.login-form-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apple-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 0 16px;
  transition: all 0.2s ease;
  backdrop-filter: var(--apple-blur);
}

.apple-input-wrapper:focus-within {
  border-color: var(--apple-blue-vibrant);
  box-shadow: 0 0 0 3px rgba(25, 39, 10, 0.25);
  background: rgba(255, 255, 255, 0.12);
}

.apple-input-wrapper .input-icon {
  font-size: 18px;
  opacity: 0.6;
}

.apple-input-hero {
  width: 100%;
  height: 52px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-system);
  padding-left: 10px;
}

.apple-input-hero::placeholder {
  color: var(--apple-label-tertiary);
  font-weight: 500;
}

.login-error-pill {
  background: rgba(255, 69, 58, 0.18);
  border: 1px solid rgba(255, 69, 58, 0.4);
  /* #ff6961 littéral sur son propre fond rouge pâle = 2.28:1 (vérifié). */
  color: var(--apple-coral);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
  line-height: 1.35;
  text-align: center;
  animation: shake 0.35s ease;
}

.login-btn {
  margin-top: 4px;
}

.login-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--apple-label-tertiary);
  margin-top: 24px;
  max-width: 300px;
  line-height: 1.4;
  text-align: center;
}

.btn-switch-player {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--apple-hairline);
  border-radius: 10px;
  color: var(--apple-label-secondary);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  align-self: flex-start;
  margin-top: 2px;
  margin-left: auto;
}

.btn-switch-player:hover {
  background: rgba(255, 69, 58, 0.15);
  color: var(--apple-coral);
  border-color: rgba(255, 69, 58, 0.3);
}

.player-name-text {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.player-title-row {
  margin: 1px 0 3px 0;
}

/* Badge de catégorie au-dessus de la question */
.card-category-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--apple-blue-vibrant);
  background: rgba(25, 39, 10, 0.15);
  border: 1px solid rgba(25, 39, 10, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-headline-minimal {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

/* État vide de la collection (quand rien n'a été découvert) */
.gallery-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px 22px;
  background: var(--apple-surface-card);
  backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-hairline);
  border-radius: 24px;
  margin-top: 14px;
}

.empty-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.icon-inline {
  display: inline-flex;
  align-items: center;
}

.empty-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-subtext {
  font-size: 12.5px;
  color: var(--apple-label-secondary);
  line-height: 1.45;
  max-width: 280px;
  margin-bottom: 22px;
}

.empty-action-btn {
  max-width: 220px;
  padding: 12px 18px;
  font-size: 13.5px;
}

/* ==========================================================================
   SÉLECTEUR DE LANGUE (APPLE SEGMENTED CONTROL)
   ========================================================================== */

.apple-global-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 4px 14px;
  position: relative;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar-brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(25, 39, 10, 0.18);
}

.topbar-brand-text,
.topbar-brand-highlight {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--apple-label-primary);
}

.topbar-brand-highlight {
  color: var(--accent-text);
}

.apple-lang-segmented {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid var(--apple-hairline);
  box-shadow: 0 4px 16px rgba(25, 39, 10, 0.1);
  gap: 2px;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--apple-label-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lang-toggle-btn:hover {
  color: #ffffff;
}

.lang-toggle-btn:active {
  transform: scale(0.94);
}

.lang-toggle-btn.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lang-toggle-btn .flag {
  font-size: 13px;
  line-height: 1;
}

/* Sélecteur héro sur l'écran de connexion */
.login-lang-picker {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.lang-prompt {
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-label-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.apple-lang-segmented-large {
  display: flex;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--apple-hairline);
  gap: 4px;
  width: 100%;
  max-width: 260px;
}

.lang-choice-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--apple-label-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lang-choice-btn:hover {
  color: #ffffff;
}

.lang-choice-btn:active {
  transform: scale(0.96);
}

.lang-choice-btn.active {
  background: var(--apple-blue-vibrant);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(25, 39, 10, 0.4);
}

.lang-choice-btn .flag {
  font-size: 15px;
}

/* ========================================================================== */
/* 14. LOGO OFFICIEL & 120 MISSIONS & RÉCOMPENSES                            */
/* ========================================================================== */

.welcome-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.welcome-brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(212, 216, 45, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Widget Missions (Accueil) */
.apple-widget.widget-missions {
  background: linear-gradient(135deg, rgba(212, 216, 45, 0.1) 0%, rgba(255, 159, 10, 0.08) 100%), var(--apple-surface-secondary);
  border: 1px solid rgba(212, 216, 45, 0.25);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.apple-widget.widget-missions:hover {
  border-color: rgba(212, 216, 45, 0.45);
  box-shadow: 0 8px 24px rgba(212, 216, 45, 0.15);
}

.apple-badge-gold {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(212, 216, 45, 0.18);
  /* #e2e638 (accent clair) sur son propre fond pâle = 1.24:1 (vérifié) —
     même défaut que l'accent brut en texte sur fond clair. */
  color: var(--ink);
  border: 1px solid rgba(212, 216, 45, 0.35);
}

.apple-footer-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.apple-footer-buttons-row .apple-capsule-btn {
  /* flex-basis ~50% : 2 boutons par ligne sur mobile (4 boutons au total
     depuis l'ajout d'"À propos"), une seule ligne si la largeur le permet
     (tablette/desktop, cadre bien plus large). */
  flex: 1 1 calc(50% - 4px);
  justify-content: center;
  min-width: 0;
}

/* Écran 120 Missions & Récompenses */
.missions-apple-header {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.missions-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.missions-percent-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(212, 216, 45, 0.18);
  /* Même défaut que .apple-badge-gold : accent clair illisible sur fond pâle. */
  color: var(--ink);
  border: 1px solid rgba(212, 216, 45, 0.3);
}

.missions-header-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.missions-header-logo-badge {
  flex-shrink: 0;
}

.missions-header-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(212, 216, 45, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.missions-title-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.missions-main-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.missions-subtitle {
  font-size: 13px;
  color: var(--apple-label-secondary);
  line-height: 1.4;
}

/* Résumé Récompenses & XP */
.missions-summary-card {
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-rewards-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reward-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.reward-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--apple-label-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reward-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.reward-stat-divider {
  width: 1px;
  height: 24px;
  background: var(--apple-hairline);
}

.missions-progress-bar-container {
  width: 100%;
  height: 7px;
  /* rgba blanc invisible sur la carte résumé désormais claire. */
  background: var(--bg-surface-alt);
  border-radius: 6px;
  overflow: hidden;
}

.missions-progress-bar-fill {
  height: 100%;
  /* Dégradé jaune->vert littéral (reliquat du thème sombre) remplacé par
     le dégradé accent de la marque, cohérent avec les autres barres. */
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Filtres segmentés Apple */
.missions-filter-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.missions-filter-strip::-webkit-scrollbar {
  display: none;
}

.missions-filter-chip {
  /* rgba blanc invisible sur fond clair : chips de filtre sans contour. */
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  border-radius: 12px;
  color: var(--apple-label-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.missions-filter-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.missions-filter-chip.active {
  background: var(--apple-blue-vibrant);
  color: #ffffff;
  border-color: var(--apple-blue-vibrant);
  box-shadow: 0 4px 12px rgba(25, 39, 10, 0.35);
}

/* Grille des Cartes Missions */
.missions-card-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 40px;
}

.mission-card {
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.15s ease;
}

.mission-card:active {
  transform: scale(0.985);
}

.mission-card.completed {
  border-color: rgba(48, 209, 88, 0.35);
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.06) 0%, rgba(22, 27, 34, 0.95) 100%);
}

.mission-card.active-target {
  border-color: rgba(212, 216, 45, 0.45);
  box-shadow: 0 4px 16px rgba(212, 216, 45, 0.12);
}

.mission-card.locked {
  opacity: 0.65;
}

.mission-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mission-number-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--apple-label-secondary);
}

.mission-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.mission-status-pill.completed {
  background: rgba(48, 209, 88, 0.18);
  /* #30d158 littéral sur son propre fond vert pâle = 1.76:1, quasi
     invisible (vérifié hig_checker.py). Remplacé par le vert assombri
     de la marque (var(--apple-green), 6.58:1 sur blanc). */
  color: var(--apple-green);
  border: 1px solid rgba(48, 209, 88, 0.35);
}

.mission-status-pill.available {
  /* Fond/bordure littéraux "encre" remplacés par les tokens adaptatifs
     (clairs sur page claire, clairs-translucides sur fiche sombre) :
     sur la fiche de mission (.apple-sheet-modal, fond déjà sombre), un
     fond ET un texte tous deux "encre" étaient quasi invisibles. */
  background: var(--apple-surface-secondary);
  color: var(--apple-blue-vibrant);
  border: 1px solid var(--apple-hairline);
}

.mission-status-pill.locked {
  background: rgba(255, 255, 255, 0.06);
  color: var(--apple-label-tertiary);
  border: 1px solid var(--apple-hairline);
}

.mission-body-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mission-thumb-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: #161b22;
  border: 1px solid var(--apple-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mission-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mission-thumb-placeholder {
  font-size: 22px;
}

.mission-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mission-category-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-label-tertiary);
  text-transform: uppercase;
}

.mission-word-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.mission-hint-cue {
  font-size: 12px;
  color: var(--apple-label-secondary);
  line-height: 1.35;
}

/* Récompenses */
.mission-rewards-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mission-rewards-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--apple-label-tertiary);
  margin-right: 2px;
}

.mission-reward-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mission-reward-tag.tag-xp {
  /* #5ac8fa littéral sur son propre fond bleu pâle = 1.63:1, quasi
     invisible (vérifié hig_checker.py). Fond/texte remplacés par des
     tokens adaptatifs : ce tag s'affiche aussi bien sur une carte claire
     (missions) que sur la fiche de mission à fond sombre fixe — --ink en
     dur y était illisible. */
  background: var(--apple-surface-secondary);
  color: var(--apple-label-primary);
  border: 1px solid var(--apple-hairline);
}

.mission-reward-tag.tag-pts {
  background: rgba(255, 159, 10, 0.16);
  /* #ffd60a littéral sur son propre fond orange pâle = 1.26:1, quasi
     invisible (vérifié hig_checker.py). Remplacé par l'ambre de la marque. */
  color: var(--apple-amber);
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.mission-reward-tag.tag-milestone {
  background: linear-gradient(135deg, rgba(212, 216, 45, 0.25) 0%, rgba(255, 159, 10, 0.2) 100%);
  /* #f5f84d littéral sur son propre fond jaune pâle = 1.03:1, totalement
     invisible (vérifié hig_checker.py) — l'une des "pastilles illisibles"
     signalées. Remplacé par l'ambre assombri de la marque. */
  color: var(--apple-amber);
  border: 1px solid rgba(212, 216, 45, 0.45);
}

.mission-reward-tag.earned {
  border-color: rgba(48, 209, 88, 0.4);
}

.mission-bottom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.mission-action-btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.mission-action-btn:active {
  transform: scale(0.96);
}

.mission-action-btn.btn-play {
  background: var(--apple-blue-vibrant);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(25, 39, 10, 0.35);
}

.mission-action-btn.btn-detail {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid var(--apple-hairline);
}

.mission-action-btn.btn-locked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--apple-label-tertiary);
  cursor: not-allowed;
}

/* 15. Modal Fiche / Détail de Mission (Apple Bottom Sheet) */
.mission-detail-sheet {
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  padding-bottom: 24px;
}

.mission-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.modal-mission-banner {
  width: 100%;
  height: 190px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--apple-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.modal-mission-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-mission-banner svg {
  width: 100%;
  height: 100%;
  max-height: 170px;
}

.modal-mission-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-mission-word-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.modal-mission-pron-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--apple-blue-vibrant);
  font-size: 14px;
  font-weight: 600;
}

.modal-pron-btn {
  background: rgba(25, 39, 10, 0.15);
  border: 1px solid rgba(25, 39, 10, 0.35);
  color: var(--apple-blue-vibrant);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-pron-btn:active {
  transform: scale(0.9);
}

.modal-mission-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--apple-hairline);
  border-radius: 14px;
  padding: 12px 14px;
}

.modal-mission-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-label-secondary);
  margin-bottom: 6px;
}

.modal-mission-trivia-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--apple-label-primary);
  margin: 0;
}

.modal-mission-rewards-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.modal-mission-cta-btn {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
  margin-top: 6px;
}

.modal-mission-cta-btn.play {
  background: var(--apple-blue-vibrant);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(25, 39, 10, 0.4);
}

.modal-mission-cta-btn.play:hover {
  filter: brightness(1.1);
}

.modal-mission-cta-btn.play:active {
  transform: scale(0.98);
}

.modal-mission-cta-btn.close {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid var(--apple-hairline);
}

/* ========================================================================== */
/* 7. ÉCRAN CLASSEMENT                                                        */
/* ========================================================================== */

.leaderboard-podium {
  background: var(--ink);
  border-radius: 24px;
  padding: 22px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.podium-badge {
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.podium-name {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.podium-score {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 10px 12px;
}

.leaderboard-row-me {
  background: var(--ink);
}

.leaderboard-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  width: 20px;
  flex-shrink: 0;
}

.leaderboard-row-me .leaderboard-rank {
  color: rgba(255, 255, 255, 0.65);
}

.leaderboard-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--bg-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leaderboard-row-me .leaderboard-avatar {
  background: rgba(255, 255, 255, 0.15);
}

.leaderboard-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row-me .leaderboard-name {
  color: #ffffff;
  font-weight: 700;
}

.leaderboard-me-badge {
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.leaderboard-score-pill {
  background: var(--rank-1);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.leaderboard-score-pill-me {
  background: var(--accent);
  color: var(--ink);
}

/* ==========================================================================
   CARTE DÉFI PARTAGÉ / DÉTAIL DU SCORE SUR LEADERBOARD
   ========================================================================== */
.challenge-shared-card {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12) 0%, rgba(255, 69, 58, 0.08) 100%);
  border: 1.5px solid rgba(255, 149, 0, 0.4);
  border-radius: 22px;
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: 0 10px 28px rgba(255, 149, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUpModal 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.shared-challenge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #ff9500 0%, #ff3b30 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 10px;
  align-self: flex-start;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(255, 59, 48, 0.3);
}

.shared-challenge-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shared-challenger-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shared-challenger-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700 0%, #ff9500 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.35);
  flex-shrink: 0;
}

.shared-challenger-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shared-challenger-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.shared-challenger-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-label-secondary);
}

.shared-score-banner {
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shared-score-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-label-secondary);
}

.shared-score-val {
  font-size: 26px;
  font-weight: 800;
  color: #ff9500;
  letter-spacing: -0.5px;
}

.shared-score-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--apple-label-tertiary);
}

.shared-challenge-msg {
  font-size: 13px;
  line-height: 1.45;
  color: var(--apple-label-secondary);
  margin: 0;
}

.shared-challenge-msg strong {
  color: var(--ink);
}

.btn-shared-accept {
  width: 100%;
  background: linear-gradient(135deg, #ff9500 0%, #ff3b30 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-shared-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.45);
}

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

/* ==========================================================================
   STYLE ROADMAP DU VOCABULAIRE — ÉCRAN 120 MISSIONS / SENTIER D'ÉTAPES
   Respect absolu des design tokens v3 de la marque
   ========================================================================== */

.roadmap-view {
  background: var(--bg-page);
  padding: 0 0 50px 0;
}

.roadmap-header {
  padding: 16px 16px 14px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--apple-hairline);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.roadmap-badge-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  border-radius: 20px;
  padding: 5px 12px;
  letter-spacing: 0.2px;
}

.roadmap-hero-block {
  margin: 12px 0 10px;
}

.roadmap-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.roadmap-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.4px;
}

.roadmap-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* Carte de synthèse et progression */
.roadmap-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 12px 14px;
  margin-top: 12px;
}

.roadmap-summary-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roadmap-stat-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roadmap-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.roadmap-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.roadmap-stat-divider {
  width: 1px;
  height: 24px;
  background: var(--apple-hairline);
}

.roadmap-progress-bar-container {
  width: 100%;
  height: 7px;
  background: var(--bg-surface-alt);
  border-radius: 8px;
  margin-top: 10px;
  overflow: hidden;
}

.roadmap-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim) 0%, var(--accent) 100%);
  border-radius: 8px;
  transition: width 0.4s ease;
}

.roadmap-filter-strip {
  margin-top: 12px;
}

/* Conteneur principal de la Roadmap */
.roadmap-container {
  padding: 16px 14px 40px;
  position: relative;
}

.roadmap-track {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Grand Jalon de Palier (Milestone Gate) */
.roadmap-milestone-gate {
  margin: 22px 0 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, #ffffff 100%);
  border: 1.5px solid var(--accent);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(205, 198, 30, 0.12);
  position: relative;
  z-index: 4;
}

.roadmap-gate-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roadmap-gate-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--apple-hairline);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.roadmap-gate-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.roadmap-gate-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.roadmap-gate-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
}

.roadmap-gate-badge.active {
  background: var(--ink);
  color: var(--accent);
}

/* Ligne d'étape sur la Roadmap */
.roadmap-step {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}

/* Colonne de l'indicateur vertical (Spine) */
.roadmap-spine-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 42px;
  flex-shrink: 0;
  position: relative;
}

.roadmap-node-disc {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  z-index: 3;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.roadmap-step.completed .roadmap-node-disc {
  background: var(--ink);
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 0 3px 10px rgba(25, 39, 10, 0.2);
}

.roadmap-step.current .roadmap-node-disc {
  background: var(--accent);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: 0 0 0 4px rgba(205, 198, 30, 0.35);
  animation: roadmap-pulse 1.8s infinite;
}

.roadmap-step.available .roadmap-node-disc {
  background: #ffffff;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.roadmap-step.locked .roadmap-node-disc {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  border: 1.5px solid var(--apple-hairline);
  opacity: 0.8;
}

@keyframes roadmap-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(205, 198, 30, 0.65), 0 3px 10px rgba(25, 39, 10, 0.2);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(205, 198, 30, 0), 0 3px 10px rgba(25, 39, 10, 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(205, 198, 30, 0), 0 3px 10px rgba(25, 39, 10, 0.2);
  }
}

.roadmap-trail-line {
  width: 3px;
  flex: 1;
  background: var(--bg-surface-alt);
  margin-top: -2px;
  z-index: 1;
}

.roadmap-step.completed .roadmap-trail-line {
  background: linear-gradient(180deg, var(--accent) 0%, var(--bg-surface-alt) 100%);
}

/* Carte de contenu de l'étape */
.roadmap-step-card {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 3px 10px rgba(25, 39, 10, 0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.roadmap-step-card:active {
  transform: scale(0.985);
}

.roadmap-step.completed .roadmap-step-card {
  border-color: rgba(19, 107, 58, 0.22);
}

.roadmap-step.current .roadmap-step-card {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(205, 198, 30, 0.22);
}

.roadmap-step.locked .roadmap-step-card {
  background: var(--bg-surface);
  opacity: 0.75;
}

.roadmap-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.roadmap-step-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.roadmap-status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.roadmap-status-pill.completed {
  background: rgba(19, 107, 58, 0.12);
  color: var(--apple-green);
}

.roadmap-status-pill.current {
  background: var(--ink);
  color: var(--accent);
}

.roadmap-status-pill.available {
  background: var(--bg-surface);
  color: var(--ink);
  border: 1px solid var(--apple-hairline);
}

.roadmap-status-pill.locked {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
}

.roadmap-step-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roadmap-thumb-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.roadmap-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roadmap-thumb-placeholder {
  font-size: 22px;
}

.roadmap-step-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roadmap-step-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.roadmap-word-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roadmap-hint-cue {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.roadmap-rewards-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--apple-hairline);
}

.roadmap-rewards-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.roadmap-reward-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--ink);
}

.roadmap-reward-tag.tag-xp {
  color: var(--accent-text);
  background: rgba(205, 198, 30, 0.15);
}

.roadmap-reward-tag.tag-xp.earned {
  color: var(--apple-green);
  background: rgba(19, 107, 58, 0.12);
}

.roadmap-reward-tag.tag-pts {
  color: var(--ink);
}

.roadmap-reward-tag.tag-milestone {
  background: linear-gradient(135deg, rgba(205, 198, 30, 0.25) 0%, rgba(205, 198, 30, 0.08) 100%);
  color: var(--ink);
  border: 1px solid var(--accent);
}

.roadmap-step-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.btn-roadmap-action {
  flex: 1;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--apple-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-roadmap-detail {
  background: var(--bg-surface);
  color: var(--ink);
}

.btn-roadmap-detail:hover {
  background: var(--bg-surface-alt);
}

.btn-roadmap-play {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.btn-roadmap-play:hover {
  background: #253911;
}

.btn-roadmap-play.btn-prominent {
  background: var(--ink);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(25, 39, 10, 0.25);
}

/* ========================================================================== */
/* TABLETTE / DESKTOP — on quitte la métaphore "cadre de téléphone"           */
/* En dessous de 768px, .apple-device-frame reste le bezel mobile ci-dessus   */
/* (et devient edge-to-edge sous 480px, voir plus bas). À partir de 768px,    */
/* le cadre noir centré sur 420px n'a plus de sens : on bascule sur une page  */
/* claire pleine largeur, sans bezel, qui suit le thème (--bg-page).         */
/* ========================================================================== */
@media (min-width: 768px) {
  .apple-device-frame {
    max-width: 640px;
    height: 92vh;
    max-height: 920px;
    background: var(--bg-page);
    border-radius: 28px;
    box-shadow: 0 30px 70px -20px rgba(25, 39, 10, 0.18);
  }

  /* Titre display plus grand, dans l'esprit des pages produit apple.com */
  .apple-hero-title {
    font-size: 56px;
  }
}

/* ========================================================================== */
/* 8. ÉCRAN À PROPOS                                                          */
/* ========================================================================== */

.about-section-card {
  background: var(--apple-surface-card);
  backdrop-filter: var(--apple-blur);
  border: 1px solid var(--apple-hairline);
  border-top: 1px solid var(--apple-specular-top);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}

.about-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.about-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--ink);
  flex-shrink: 0;
}

.about-section-heading h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--apple-label-primary);
  margin: 0;
}

.about-section-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--apple-label-secondary);
  margin: 0;
}

.about-mode-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--apple-hairline);
  color: var(--apple-label-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 10px 8px 0 0;
}

@media (min-width: 1024px) {
  .apple-device-frame {
    max-width: 1100px;
    width: 94vw;
    height: 90vh;
    max-height: 980px;
    background: var(--bg-page);
    border-radius: 24px;
    box-shadow: 0 30px 70px -20px rgba(25, 39, 10, 0.15), 0 0 0 1px var(--apple-hairline);
  }

  /* Les écrans qui empilaient leurs widgets/cartes en une seule colonne de   */
  /* largeur téléphone passent en grille à partir du desktop : plus de       */
  /* "liste verticale géante" dans un cadre large.                           */
  .mode-widget-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .gallery-apple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }

  .missions-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    align-content: start;
  }

  .end-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .screen-view {
    padding: 28px 40px;
  }

  /* Titre display grand format, façon pages produit apple.com */
  .apple-hero-title {
    font-size: 72px;
  }
}
