/* ==========================================================================
   WikiCrix - Feuille de Style Complète (CSS)
   Design Galactique Cosmique, Minimaliste, Moderne, Responsive & Blocs Proportionnels
   ========================================================================== */

/* Variables CSS - Thèmes Galactique Sombre & Clair */
/* Variables CSS - Thèmes Galactiques, Sombres et Clairs (7 Thèmes) */
:root, [data-theme="dark"] {
  /* 1. Galaxie Cosmique (Sombre Contrasté) */
  --bg-primary: #070913;
  --bg-secondary: rgba(16, 21, 46, 0.85);
  --bg-card: rgba(18, 24, 52, 0.95);
  --bg-input: rgba(12, 16, 36, 0.95);
  --border-color: rgba(139, 92, 246, 0.32);
  --border-light: rgba(56, 189, 248, 0.5);

  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Blocs masqués : Fort contraste et visibilité nette sur fond sombre */
  --mask-bg: #1e2846;
  --mask-border: rgba(148, 163, 184, 0.5);
  --mask-hover: #2e3c66;
  --mask-title-bg: #312e81;
  --mask-hint-bg: rgba(56, 189, 248, 0.16);

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-success: #34d399;
  --accent-success-hover: #10b981;
  --accent-warning: #fbbf24;
  --accent-reward: #a855f7;
  --accent-reward-hover: #9333ea;
  --accent-magenta: #ec4899;

  --just-revealed-bg: rgba(56, 189, 248, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(139, 92, 246, 0.16);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.7), 0 0 28px rgba(56, 189, 248, 0.22);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Lato, Helvetica, Arial, sans-serif;
  --font-wiki: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Lato, Helvetica, Arial, sans-serif;
  --font-wiki-title: 'Linux Libertine', Georgia, 'Times New Roman', Times, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --font-galactic: 'Orbitron', 'Space Grotesk', sans-serif;

  --header-height: 66px;
  --sidebar-width: 380px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

[data-theme="oled"] {
  /* 2. Noir Pur OLED (Lisibilité & Contraste Maximaux) */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --bg-input: #161616;
  --border-color: #2b2b2b;
  --border-light: #525252;

  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;

  --mask-bg: #262626;
  --mask-border: #4b5563;
  --mask-hover: #374151;
  --mask-title-bg: #3f3f46;
  --mask-hint-bg: rgba(56, 189, 248, 0.2);

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-success: #34d399;
  --accent-success-hover: #10b981;
  --accent-warning: #facc15;
  --accent-reward: #c084fc;
  --accent-reward-hover: #a855f7;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(56, 189, 248, 0.4);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.95);
}

[data-theme="cyberpunk"] {
  /* 3. Nébuleuse Cyberpunk (Néon Violet & Magenta) */
  --bg-primary: #0b0318;
  --bg-secondary: rgba(26, 10, 54, 0.88);
  --bg-card: #180934;
  --bg-input: #150630;
  --border-color: rgba(236, 72, 153, 0.35);
  --border-light: rgba(168, 85, 247, 0.55);

  --text-primary: #fdf2f8;
  --text-secondary: #e9d5ff;
  --text-muted: #f472b6;

  --mask-bg: #2e1254;
  --mask-border: #a855f7;
  --mask-hover: #451b7c;
  --mask-title-bg: #581c87;
  --mask-hint-bg: rgba(236, 72, 153, 0.2);

  --accent-primary: #ec4899;
  --accent-primary-hover: #db2777;
  --accent-success: #2dd4bf;
  --accent-success-hover: #14b8a6;
  --accent-warning: #facc15;
  --accent-reward: #c084fc;
  --accent-reward-hover: #a855f7;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(236, 72, 153, 0.4);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(168, 85, 247, 0.2);
  --shadow-lg: 0 16px 36px rgba(236, 72, 153, 0.25);
}

[data-theme="emerald"] {
  /* 4. Émeraude Stellaire (Nuit Verte & Jade) */
  --bg-primary: #03140e;
  --bg-secondary: rgba(8, 36, 27, 0.88);
  --bg-card: #08241b;
  --bg-input: #061c15;
  --border-color: rgba(16, 185, 129, 0.35);
  --border-light: rgba(52, 211, 153, 0.55);

  --text-primary: #f0fdf4;
  --text-secondary: #a7f3d0;
  --text-muted: #34d399;

  --mask-bg: #123e30;
  --mask-border: #10b981;
  --mask-hover: #1c5543;
  --mask-title-bg: #064e3b;
  --mask-hint-bg: rgba(52, 211, 153, 0.2);

  --accent-primary: #34d399;
  --accent-primary-hover: #10b981;
  --accent-success: #10b981;
  --accent-success-hover: #059669;
  --accent-warning: #facc15;
  --accent-reward: #6ee7b7;
  --accent-reward-hover: #34d399;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(52, 211, 153, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(16, 185, 129, 0.2);
  --shadow-lg: 0 16px 36px rgba(52, 211, 153, 0.25);
}

[data-theme="solar"] {
  /* 5. Supernova Solaire (Ambre Chaud & Bronze) */
  --bg-primary: #120902;
  --bg-secondary: rgba(36, 19, 6, 0.88);
  --bg-card: #241306;
  --bg-input: #1a0d04;
  --border-color: rgba(245, 158, 11, 0.35);
  --border-light: rgba(251, 191, 36, 0.55);

  --text-primary: #fffbeb;
  --text-secondary: #fde68a;
  --text-muted: #fbbf24;

  --mask-bg: #3c200c;
  --mask-border: #f59e0b;
  --mask-hover: #542d11;
  --mask-title-bg: #78350f;
  --mask-hint-bg: rgba(245, 158, 11, 0.2);

  --accent-primary: #f59e0b;
  --accent-primary-hover: #d97706;
  --accent-success: #34d399;
  --accent-success-hover: #10b981;
  --accent-warning: #fbbf24;
  --accent-reward: #ea580c;
  --accent-reward-hover: #c2410c;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(245, 158, 11, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(245, 158, 11, 0.2);
  --shadow-lg: 0 16px 36px rgba(251, 191, 36, 0.25);
}

[data-theme="light"] {
  /* 6. Aurore Boréale (Clair Moderne) */
  --bg-primary: #f0f4fd;
  --bg-secondary: rgba(255, 255, 255, 0.9);
  --bg-card: #ffffff;
  --bg-input: #f8faff;
  --border-color: rgba(99, 102, 241, 0.22);
  --border-light: rgba(56, 189, 248, 0.5);

  --text-primary: #0b0f2a;
  --text-secondary: #475569;
  --text-muted: #6366f1;

  --mask-bg: #dbe4f9;
  --mask-border: #93c5fd;
  --mask-hover: #bfdbfe;
  --mask-title-bg: #c7d2fe;
  --mask-hint-bg: rgba(56, 189, 248, 0.22);

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-success: #059669;
  --accent-success-hover: #047857;
  --accent-reward: #7c3aed;
  --accent-reward-hover: #6d28d9;
  --accent-magenta: #ec4899;

  --just-revealed-bg: #bae6fd;
  --just-revealed-color: #0369a1;

  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
  --shadow-md: 0 8px 20px rgba(99, 102, 241, 0.12);
  --shadow-lg: 0 16px 32px rgba(99, 102, 241, 0.16);
}

[data-theme="synthwave"] {
  /* 4. Néon Synthwave 80s (Rétro Sunset Fuchsia & Cyan) */
  --bg-primary: #0f0728;
  --bg-secondary: rgba(25, 12, 60, 0.9);
  --bg-card: #1c0e40;
  --bg-input: #150933;
  --border-color: rgba(244, 63, 94, 0.38);
  --border-light: rgba(6, 182, 212, 0.55);

  --text-primary: #fff1f8;
  --text-secondary: #fbcfe8;
  --text-muted: #f472b6;

  --mask-bg: #2d135d;
  --mask-border: #ec4899;
  --mask-hover: #451b8a;
  --mask-title-bg: #6b21a8;
  --mask-hint-bg: rgba(6, 182, 212, 0.22);

  --accent-primary: #06b6d4;
  --accent-primary-hover: #0891b2;
  --accent-success: #10b981;
  --accent-success-hover: #059669;
  --accent-warning: #fbbf24;
  --accent-reward: #f43f5e;
  --accent-reward-hover: #e11d48;
  --accent-magenta: #ec4899;

  --just-revealed-bg: rgba(244, 63, 94, 0.4);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(244, 63, 94, 0.22);
  --shadow-lg: 0 16px 36px rgba(6, 182, 212, 0.25);
}

[data-theme="nordic"] {
  /* 7. Fjord & Nuit Polaire (Bleu Arctique & Givre) */
  --bg-primary: #07101e;
  --bg-secondary: rgba(13, 27, 49, 0.9);
  --bg-card: #0e203b;
  --bg-input: #09172c;
  --border-color: rgba(56, 189, 248, 0.35);
  --border-light: rgba(96, 165, 250, 0.55);

  --text-primary: #f0f9ff;
  --text-secondary: #bae6fd;
  --text-muted: #60a5fa;

  --mask-bg: #153258;
  --mask-border: #38bdf8;
  --mask-hover: #1e4474;
  --mask-title-bg: #1e3a8a;
  --mask-hint-bg: rgba(56, 189, 248, 0.2);

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-success: #34d399;
  --accent-success-hover: #10b981;
  --accent-warning: #fbbf24;
  --accent-reward: #60a5fa;
  --accent-reward-hover: #3b82f6;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(56, 189, 248, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(56, 189, 248, 0.18);
  --shadow-lg: 0 16px 36px rgba(96, 165, 250, 0.22);
}

[data-theme="coffee"] {
  /* 8. Espresso & Moka (Chocolat Torréfié & Caramel Doré) */
  --bg-primary: #140d09;
  --bg-secondary: rgba(33, 21, 15, 0.9);
  --bg-card: #271911;
  --bg-input: #1b110b;
  --border-color: rgba(217, 119, 6, 0.35);
  --border-light: rgba(245, 158, 11, 0.5);

  --text-primary: #fef3c7;
  --text-secondary: #fde68a;
  --text-muted: #d97706;

  --mask-bg: #3d2619;
  --mask-border: #d97706;
  --mask-hover: #543522;
  --mask-title-bg: #78350f;
  --mask-hint-bg: rgba(245, 158, 11, 0.2);

  --accent-primary: #f59e0b;
  --accent-primary-hover: #d97706;
  --accent-success: #34d399;
  --accent-success-hover: #10b981;
  --accent-warning: #fbbf24;
  --accent-reward: #ea580c;
  --accent-reward-hover: #c2410c;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(245, 158, 11, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(217, 119, 6, 0.2);
  --shadow-lg: 0 16px 36px rgba(245, 158, 11, 0.25);
}

[data-theme="matrix"] {
  /* 9. Terminal Matrix (Noir Absolu & Vert Phosphoreux) */
  --bg-primary: #010803;
  --bg-secondary: rgba(2, 20, 8, 0.9);
  --bg-card: #031c0a;
  --bg-input: #011205;
  --border-color: rgba(0, 255, 102, 0.35);
  --border-light: rgba(134, 239, 172, 0.55);

  --text-primary: #e6ffed;
  --text-secondary: #86efac;
  --text-muted: #00ff66;

  --mask-bg: #073814;
  --mask-border: #00ff66;
  --mask-hover: #0b4e1d;
  --mask-title-bg: #042f11;
  --mask-hint-bg: rgba(0, 255, 102, 0.2);

  --accent-primary: #00ff66;
  --accent-primary-hover: #00cc52;
  --accent-success: #00ff66;
  --accent-success-hover: #00cc52;
  --accent-warning: #facc15;
  --accent-reward: #4ade80;
  --accent-reward-hover: #22c55e;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(0, 255, 102, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 8px 24px rgba(0, 255, 102, 0.2);
  --shadow-lg: 0 16px 36px rgba(0, 255, 102, 0.3);
}

[data-theme="dracula"] {
  /* 10. Manoir Gothique (Prune Mystique & Lilas Sombre) */
  --bg-primary: #110b1a;
  --bg-secondary: rgba(28, 18, 44, 0.9);
  --bg-card: #201533;
  --bg-input: #170e26;
  --border-color: rgba(192, 132, 252, 0.35);
  --border-light: rgba(244, 114, 182, 0.5);

  --text-primary: #faf5ff;
  --text-secondary: #e9d5ff;
  --text-muted: #c084fc;

  --mask-bg: #352152;
  --mask-border: #c084fc;
  --mask-hover: #482d70;
  --mask-title-bg: #581c87;
  --mask-hint-bg: rgba(244, 114, 182, 0.2);

  --accent-primary: #c084fc;
  --accent-primary-hover: #a855f7;
  --accent-success: #34d399;
  --accent-success-hover: #10b981;
  --accent-warning: #fbbf24;
  --accent-reward: #f472b6;
  --accent-reward-hover: #ec4899;
  --accent-magenta: #f43f5e;

  --just-revealed-bg: rgba(192, 132, 252, 0.35);
  --just-revealed-color: #ffffff;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(192, 132, 252, 0.2);
  --shadow-lg: 0 16px 36px rgba(244, 114, 182, 0.25);
}

[data-theme="sepia"] {
  /* 11. Parchemin d'Alexandrie (Papyrus Antique, Encre Noyer & Sceau de Cire) */
  --bg-primary: #f2e6cf;
  --bg-secondary: rgba(248, 239, 222, 0.95);
  --bg-card: #f9f2e3;
  --bg-input: #fcf8f0;
  --border-color: rgba(139, 90, 43, 0.35);
  --border-light: rgba(160, 100, 50, 0.5);

  --text-primary: #20140a;
  --text-secondary: #503724;
  --text-muted: #7a5839;

  --mask-bg: #dec9a5;
  --mask-border: #aa8455;
  --mask-hover: #cfb58c;
  --mask-title-bg: #c49f6b;
  --mask-hint-bg: rgba(163, 59, 30, 0.2);

  --accent-primary: #9c3b1e;
  --accent-primary-hover: #7d2e16;
  --accent-success: #1d6b38;
  --accent-success-hover: #144d28;
  --accent-warning: #b45309;
  --accent-reward: #b45309;
  --accent-reward-hover: #8d4006;
  --accent-magenta: #a0283e;

  --just-revealed-bg: #f5cca0;
  --just-revealed-color: #5c200b;

  --shadow-sm: 0 2px 8px rgba(90, 50, 20, 0.12);
  --shadow-md: 0 8px 24px rgba(90, 50, 20, 0.16);
  --shadow-lg: 0 16px 36px rgba(90, 50, 20, 0.22);
}

/* Réinitialisation de base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(1px 1px at 30px 40px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 150px 90px, rgba(56, 189, 248, 0.9), transparent),
    radial-gradient(1px 1px at 280px 220px, rgba(236, 72, 153, 0.8), transparent),
    radial-gradient(2px 2px at 420px 320px, rgba(168, 85, 247, 0.85), transparent),
    radial-gradient(1px 1px at 520px 140px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(ellipse at 15% 15%, rgba(139, 92, 246, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 20%, rgba(56, 189, 248, 0.16) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 85%, rgba(236, 72, 153, 0.13) 0%, transparent 50%);
  background-size: 550px 550px, 650px 650px, 450px 450px, 750px 750px, 500px 500px, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

[data-theme="light"] body {
  background-image: 
    radial-gradient(ellipse at 15% 15%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 20%, rgba(56, 189, 248, 0.09) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 85%, rgba(244, 63, 94, 0.06) 0%, transparent 50%);
  background-size: 100% 100%, 100% 100%, 100% 100%;
}

[data-theme="light"] .article-panel {
  background: #ffffff !important;
  color: #0b0f2a !important;
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.12);
}

[data-theme="sepia"] body {
  background-image: 
    radial-gradient(ellipse at 12% 18%, rgba(180, 130, 80, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 88% 25%, rgba(160, 100, 40, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 45% 82%, rgba(139, 69, 19, 0.1) 0%, transparent 60%);
  background-size: 100% 100%, 100% 100%, 100% 100%;
}

[data-theme="sepia"] .article-panel {
  background: #fbf5e8 !important;
  color: #20140a !important;
  border-color: rgba(146, 64, 14, 0.35) !important;
  box-shadow: 0 10px 30px rgba(110, 60, 20, 0.14) !important;
}

/* Accessibilité Lecteur d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Utilitaires */
.hidden {
  display: none !important;
}

/* ==========================================================================
   En-tête de l'application
   ========================================================================== */
.game-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-galactic);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  user-select: none;
}

.logo-icon {
  font-size: 1.45rem;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
  animation: floatPlanet 4s ease-in-out infinite;
}

@keyframes floatPlanet {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(4deg); }
}

.logo-text {
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.35));
}

.logo-accent {
  background: linear-gradient(135deg, #c084fc 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-family: var(--font-galactic);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.badge-daily {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.15));
  color: var(--accent-primary);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.badge-random {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(236, 72, 153, 0.18));
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.3);
}

.badge-nlp {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(56, 189, 248, 0.16));
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.22);
  transition: all 0.3s ease;
  user-select: none;
}

.badge-nlp.ready {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.3);
}

.badge-nlp.loading {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
}

.dot-nlp {
  background-color: currentColor;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

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

.stat-value {
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

/* Bannière d'état en haut (Victoire / Partie Aléatoire en cours) */
.game-banner {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-success);
  padding: 0.65rem 1.25rem;
  position: sticky;
  top: var(--header-height);
  z-index: 45;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.banner-content {
  max-width: 1760px;
  width: 98%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.banner-info-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

#banner-message {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.btn-victory-reopen {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: #ffffff !important;
  border: 1px solid #34d399 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35) !important;
  font-weight: 800 !important;
  font-size: 0.84rem !important;
  padding: 0.35rem 0.8rem !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  text-decoration: none !important;
}

.btn-victory-reopen:hover {
  background: linear-gradient(135deg, #047857, #059669) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6) !important;
  transform: translateY(-1px) !important;
}

.post-victory-options {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.post-victory-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.post-victory-toggle input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.post-victory-toggle:hover {
  color: var(--accent-primary);
}

.post-victory-toggle.toggle-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

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

.word-block.revealed.post-win-revealed {
  color: var(--text-primary);
  opacity: 0.95;
}

/* Navigation mobile par onglets */
.mobile-tabs {
  display: none;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: var(--header-height);
  z-index: 40;
}

.mobile-tabs .tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.mobile-tabs .tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background-color: rgba(59, 130, 246, 0.05);
}

/* Disposition Principale - Zone Élargie & Compacte */
.main-layout {
  flex: 1;
  max-width: 1760px;
  width: 98%;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.25rem;
  align-items: start;
}

/* Panneau de l'Article (Style Wikipédia Cosmique / Compact & Élargi) */
.article-panel {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.75rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--font-wiki);
}

/* État de chargement */
.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.85rem;
}

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

.loading-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.article-error {
  text-align: center;
  padding: 2.5rem 1rem;
}

.error-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Structure de l'Article */
.article-header-meta {
  margin-bottom: 0.65rem;
}

.article-category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

/* Titre à trouver : Police sérif de Wikipédia avec bordure classique */
.article-title {
  font-family: var(--font-wiki-title);
  font-size: clamp(1.75rem, 2.7vw, 2.35rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.4rem;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  word-break: break-word;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

.article-meta-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.separator {
  color: var(--border-color);
}

.solvers-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.article-divider {
  display: none;
}

/* Corps de l'article : Police et espacements compacts style Wikipédia */
.article-body {
  font-family: var(--font-wiki) !important;
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400 !important;
  color: var(--text-primary) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.article-body p {
  font-family: inherit;
  margin-bottom: 0.65rem;
  text-align: left;
  word-spacing: normal;
  font-weight: 400 !important;
  color: var(--text-primary) !important;
}

.article-body b,
.article-body strong {
  font-weight: 400 !important; /* Évite que les balises <b> de Wikipedia n'épaississent le texte */
}

/* Gestion des exposants (sup) comme pour 7e, 1er, etc. */
sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  top: -0.45em;
}

sup .word-block {
  height: 1.15em !important;
  line-height: 1.05em !important;
  font-size: 0.82em !important;
  vertical-align: baseline !important;
}

/* ==========================================================================
   Blocs Masqués & Mots Découverts : ALIGNEMENT STRICT ET UNIFIÉ À LA MÊME HAUTEUR
   Toutes les cases (masquées vides, avec indice partiel, affichant le chiffre ou révélées)
   partagent STRICTEMENT le même modèle inline-flex, la même hauteur (1.35em) et vertical-align: middle.
   Cela élimine définitivement tout décalage d'altitude sur la ligne de texte.
   ========================================================================== */
.word-block {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  font-family: var(--font-wiki);
  font-weight: 400;
  font-size: inherit;
  height: 1.35em !important;
  line-height: 1 !important;
  border-radius: 4px;
  padding: 0 3px;
  margin: 0 1.5px;
  text-align: center;
  position: relative;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Mot MASQUÉ (Largeur en ch + 6px, proportionnelle et confortable) */
.word-block.masked {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  height: 1.35em !important;
  line-height: 1 !important;
  font-family: var(--font-mono) !important;
  background-color: var(--mask-bg);
  border: 1px solid var(--mask-border);
  color: transparent !important;
  user-select: none;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  min-width: calc(var(--block-len, 3) * 1ch + 6px);
  padding: 0 3px;
  margin: 0 1.5px;
}

.word-block.masked:hover {
  background-color: var(--mask-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}

/* Titre masqué */
.word-block.title-word {
  font-size: 1em;
  height: 1.38em !important;
  line-height: 1 !important;
  border-radius: 6px;
  margin: 0 2px;
  vertical-align: middle !important;
}

.word-block.title-word.masked {
  font-family: var(--font-mono) !important;
  background-color: var(--mask-title-bg);
  border-color: var(--accent-reward);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

/* SPÉCIFICATION : Affichage du chiffre du nombre de lettres sur le mot au clic pendant 3s avec fading
   La taille de la case NE DOIT PAS RÉTRÉCIR, le chiffre est parfaitement centré */
.word-block.masked.showing-length {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  font-family: var(--font-mono) !important;
  font-size: inherit !important;
  height: 1.35em !important;
  line-height: 1 !important;
  text-align: center !important;
  padding: 0 3px !important;
  margin: 0 1.5px !important;
  box-sizing: border-box !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #0284c7, #7c3aed) !important;
  border: 1px solid #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  opacity: 1;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.word-block.masked.showing-length.fading-out {
  opacity: 0.15 !important;
  transform: scale(0.92);
}

sup .word-block.masked.showing-length {
  height: 1.15em !important;
  line-height: 1 !important;
  font-size: 0.82em !important;
  vertical-align: middle !important;
}

/* Mot RÉVÉLÉ : POLICE OFFICIELLE WIKIPÉDIA (ARIAL/SANS-SERIF), FIN ET LÉGER
   Même hauteur (1.35em) et vertical-align: middle pour un alignement 100% au même niveau que les cases masquées */
.word-block.revealed {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  height: 1.35em !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: auto !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  color: var(--text-primary) !important;
  font-family: var(--font-wiki) !important;
  font-weight: 400 !important;
  letter-spacing: normal;
  padding: 0 1.5px !important;
  margin: 0 1px !important;
  overflow: visible !important;
}

/* Titre révélé : Police Wikipédia Titre */
.word-block.title-word.revealed {
  color: var(--accent-primary) !important;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  font-family: var(--font-wiki-title), var(--font-wiki) !important;
  font-weight: 700 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
}

/* SPÉCIFICATION UTILISATEUR : Mots partiellement découverts
   - Alignement parfait avec les autres cases masquées (hauteur 1.35em, vertical-align: middle)
   - Cas 1 : Si mot partiel <= vrai mot : le cadre masqué ne change pas de taille et mot centré
   - Cas 2 : Si mot partiel > vrai mot : la case est élargie pour contenir tout le mot
   - Case grise (var(--mask-bg)), texte de jaune clair à orange rouge foncé selon proximité et semi-transparent */
.word-block.hint-watermark {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  vertical-align: middle !important;
  height: 1.35em !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  font-size: inherit !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  background-color: var(--mask-bg) !important; /* La case reste grise */
  border: 1px solid var(--mask-border);
  font-weight: 400 !important;
  font-style: normal;
  padding: 0 3px !important;
  margin: 0 1.5px !important;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Cas 1 : Mot partiel plus court ou égal -> taille masquée conservée, texte au centre */
.word-block.hint-watermark.hint-centered {
  justify-content: center !important;
  text-align: center !important;
}

/* Cas 2 : Mot partiel plus grand -> élargissement fluide */
.word-block.hint-watermark.hint-expanded {
  width: auto !important;
  max-width: none !important;
}

.hint-watermark-text {
  font-family: var(--font-wiki) !important;
  font-weight: 400 !important;
  font-size: inherit !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
  height: 100%;
  transition: opacity 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

/* SPÉCIFICATION UTILISATEUR : Contour orange actif sur mot partiel
   Même comportement que les mots trouvés : contour orange qui pulse tant qu'on ne valide pas un nouveau mot */
@keyframes partialGlowPulse {
  0%, 100% {
    border-color: #f97316 !important;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.75), inset 0 0 4px rgba(249, 115, 22, 0.25) !important;
  }
  50% {
    border-color: #ea580c !important;
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.95), 0 0 20px rgba(234, 88, 12, 0.45), inset 0 0 6px rgba(249, 115, 22, 0.35) !important;
  }
}

.word-block.hint-watermark.partial-glow-active {
  border-color: #f97316 !important;
  animation: partialGlowPulse 1.8s ease-in-out infinite !important;
  position: relative !important;
  z-index: 2 !important;
}

/* ==========================================================================
   ANIMATION VERT STELLAIRE (PAR DÉFAUT POUR MOTS JUSTES)
   Les lettres restent animées tant qu'on ne valide pas un nouveau mot.
   Police fine Wikipédia (font-weight 400) sans effet gras lourd.
   ========================================================================== */
@keyframes emeraldGlowShift {
  0%, 100% {
    color: #34d399;
    text-shadow: 0 0 5px rgba(52, 211, 153, 0.65);
  }
  50% {
    color: #6ee7b7;
    text-shadow: 0 0 9px rgba(52, 211, 153, 0.95), 0 0 14px rgba(16, 185, 129, 0.5);
  }
}

.word-block.revealed.emerald-glow-active,
.word-block.revealed.cherry-fizz-active {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  height: 1.35em !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  color: #34d399 !important;
  animation: emeraldGlowShift 2s ease-in-out infinite !important;
  font-family: var(--font-wiki) !important;
  font-weight: 400 !important; /* Fin, élégant et léger, pas trop gras */
  position: relative !important;
  z-index: 2 !important;
  -webkit-font-smoothing: antialiased;
}

.word-block.revealed.emerald-glow-active::after,
.word-block.revealed.cherry-fizz-active::after {
  content: '';
  position: absolute;
  inset: -1px -3px;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.22) 0%, rgba(52, 211, 153, 0.08) 60%, transparent 80%);
  border-radius: 4px;
  pointer-events: none;
  animation: pulseDot 1.4s infinite ease-in-out;
  z-index: -1;
}

/* SPÉCIFICATION : ANIMATION ÉTINCELLES & SUPERNOVA LORS DE LA DÉCOUVERTE D'UN MOT */
@keyframes cosmicSparkleWord {
  0% {
    transform: scale(0.92);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.7), rgba(168, 85, 247, 0.7));
    color: #ffffff !important;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.95), 0 0 35px rgba(168, 85, 247, 0.8);
    text-shadow: 0 0 8px #ffffff, 0 0 16px #38bdf8;
  }
  30% {
    transform: scale(1.15);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(236, 72, 153, 0.35));
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.8), 0 0 40px rgba(236, 72, 153, 0.6);
    text-shadow: 0 0 10px #ffffff, 0 0 20px #c084fc;
  }
  65% {
    transform: scale(1.04);
    background-color: transparent;
    color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  }
  100% {
    transform: scale(1);
    background-color: transparent;
    color: var(--text-primary) !important;
    box-shadow: none;
    text-shadow: none;
  }
}

.word-block.just-revealed,
.word-block.cosmic-sparkle-reveal {
  animation: cosmicSparkleWord 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
}

/* Particules d'étincelles galactiques qui jaillissent du mot découvert */
.cosmic-sparkle-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  user-select: none;
  font-family: var(--font-mono);
  animation: flyAndFadeSparkle 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  filter: drop-shadow(0 0 6px currentColor);
}

@keyframes flyAndFadeSparkle {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.4), calc(var(--dy) * 0.4)) scale(1.4) rotate(60deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(220deg);
  }
}

/* Effet au clic dans le tableau pour faire clignoter le mot ciblé dans l'article */
@keyframes pulseTargetWord {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
    border-radius: 3px;
  }
}

.word-block.target-pulse {
  animation: pulseTargetWord 1s ease-in-out 2;
}

/* ==========================================================================
   Panneau Latéral : Carte Unifiée (Saisie, Stats & Historique fusionnés)
   ========================================================================== */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--header-height) + 0.85rem);
  max-height: calc(100vh - var(--header-height) - 1.7rem);
}

/* Carte Unifiée Fusionnée */
.sidebar-unified-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height) - 1.7rem);
  overflow: hidden;
  gap: 0.85rem;
}

.unified-guess-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sidebar-unified-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0;
  opacity: 0.7;
}

.unified-history-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 0.75rem;
}

/* Carte Formulaire rétro-compatible */
.guess-form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.guess-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.guess-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 16px rgba(168, 85, 247, 0.25);
}

/* SPÉCIFICATION : ZONE D'ÉCRITURE ROUGE QUAND ON FAIT FAUX */
@keyframes inputErrorShake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-6px); }
  30%, 60%, 90% { transform: translateX(6px); }
}

.guess-input.input-error,
.mobile-guess-input.input-error {
  animation: inputErrorShake 0.45s ease-in-out !important;
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35), 0 0 20px rgba(239, 68, 68, 0.6) !important;
}

/* ZONE D'ÉCRITURE VERTE/CYAN DE SUCCÈS */
.guess-input.input-success,
.mobile-guess-input.input-success {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35), 0 0 20px rgba(16, 185, 129, 0.5) !important;
}

.guess-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.meta-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

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

.meta-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Carte Historique des essais & En-tête */
.history-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 380px;
  overflow: hidden;
}

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

.history-card-header h3,
.history-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.history-sort-group,
.history-filters {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.sort-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.sort-btn.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 700;
}

/* Barre de Filtres Avancée */
.history-filters-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.history-search-container {
  width: 100%;
}

.history-search-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  box-sizing: border-box;
}

.history-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

.history-secondary-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.history-select-filter {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.history-select-filter:focus {
  border-color: var(--accent-primary);
}

/* Conteneur et Tableau */
.history-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  max-height: calc(100vh - 380px);
  min-height: 200px;
}

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

.history-table th {
  position: sticky;
  top: 0;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  z-index: 1;
}

.history-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.history-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.history-table tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.12);
}

.history-table tbody tr.row-zero {
  opacity: 0.7;
}

.history-table tbody tr.row-hit {
  background-color: rgba(16, 185, 129, 0.08);
}

.history-table tbody tr.row-similar {
  background-color: rgba(245, 158, 11, 0.08);
}

/* Badges d'apparitions et de correspondances */
.badge-hit-exact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 0.5rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1.5px solid #10b981;
  border-radius: 9999px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.badge-hit-similar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 0.5rem;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1.5px solid #f59e0b;
  border-radius: 9999px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

.badge-hit-zero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border-radius: 9999px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.word-cell-content {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.similar-dot-indicator {
  font-size: 0.7rem;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
}

.col-num {
  width: 15%;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.col-word {
  width: 55%;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.col-count {
  width: 30%;
  text-align: right;
  white-space: nowrap;
}

.count-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: center;
}

.count-badge.zero {
  background-color: var(--border-color);
  color: var(--text-muted);
}

.count-badge.found {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.empty-row td {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 50%, #6d28d9 100%);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.55), 0 0 15px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--border-light);
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.btn-reward {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.45);
}

.btn-reward:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.55), 0 0 18px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Barre de saisie mobile fixe en bas (Mobile Sticky Bar)
   ========================================================================== */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mobile-guess-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.mobile-guess-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-guess-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 16px rgba(168, 85, 247, 0.25);
}

.btn-mobile-submit {
  padding: 0.7rem 1.1rem;
}

.mobile-sticky-meta {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mobile-sticky-meta strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Modales (Dialogues)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.25s ease;
}

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

.modal-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Modale de Victoire */
.victory-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.victory-card .btn-close-modal {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 10;
}

.victory-confetti-canvas-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#victory-canvas {
  width: 100%;
  height: 100%;
}

.victory-body {
  position: relative;
  z-index: 1;
}

.victory-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: bounce 1s infinite alternate ease-in-out;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.victory-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent-success);
  margin-bottom: 0.25rem;
}

.victory-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.revealed-article-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.revealed-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.wiki-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.wiki-link:hover {
  text-decoration: underline;
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.vstat-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
}

.vstat-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.vstat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

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

/* Modale de Simulation Publicitaire */
.ad-card {
  max-width: 480px;
}

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

.ad-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-reward);
  background-color: rgba(139, 92, 246, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.ad-countdown {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ad-countdown strong {
  color: var(--accent-warning);
  font-size: 1.1rem;
}

.ad-video-container {
  height: 220px;
  background: linear-gradient(135deg, #1e1b4b, #312e81, #1e293b);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.ad-placeholder-animation {
  text-align: center;
}

.ad-play-pulse {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: pulse 1.5s infinite;
}

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

.ad-sponsor-label {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
}

.ad-subtext {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-top: 0.25rem;
}

.ad-progress-bar-container {
  height: 8px;
  background-color: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.ad-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-reward), var(--accent-primary));
  transition: width 0.1s linear;
}

.ad-dev-note {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ad-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.ad-reward-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modale Règles / Comment Jouer */
.rules-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rule-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-desc strong {
  color: var(--text-primary);
}

/* Modale Stats */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  display: block;
}

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

.stats-current-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.stats-current-box h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.stats-current-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* Toasts de Notification */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.25s 3.25s forwards;
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px); }
}

.toast-warning {
  border-color: var(--accent-warning);
  color: var(--accent-warning);
}

.toast-success {
  border-color: var(--accent-success);
  color: var(--accent-success);
}

/* SPÉCIFICATION : POP VERT (JUSTES) & ORANGE (PARTIELLEMENT JUSTES / RESSEMBLANTS) */
.count-toast-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  pointer-events: none;
  animation: countToastPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.count-toast-group.count-toast-out {
  opacity: 0;
  transform: scale(0.8) translateY(-8px);
  transition: all 0.25s ease-in;
}

@keyframes countToastPop {
  0% { opacity: 0; transform: scale(0.6) translateY(-8px); }
  70% { transform: scale(1.15) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.count-toast-pill {
  font-family: var(--font-galactic), var(--font-mono), sans-serif;
  font-size: 1.95rem;
  font-weight: 900;
  min-width: 65px;
  height: 56px;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  user-select: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* En vert : nombre de mots justes */
.count-toast-exact {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: 2px solid #34d399;
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.85), 0 8px 24px rgba(0, 0, 0, 0.6);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* En orange : nombre de mots partiellement justes (ressemblants) */
.count-toast-partial {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: 2px solid #fbbf24;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.85), 0 8px 24px rgba(0, 0, 0, 0.6);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Aucun mot trouvé (0) */
.count-toast-miss {
  background: rgba(30, 16, 24, 0.94);
  color: #f87171;
  border: 2px solid #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}

/* Mot inexistant dans le dictionnaire */
.count-toast-invalid {
  background: linear-gradient(135deg, #ef4444, #991b1b) !important;
  color: #ffffff !important;
  border: 2px solid #f87171 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.85), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  padding: 0 1.25rem !important;
  min-width: 140px !important;
  height: 52px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
}

.victory-community-banner {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Responsive & Adaptation Smartphones */
@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .main-layout {
    grid-template-columns: 1fr;
    padding: 1rem 0.75rem;
    padding-bottom: 6rem;
    gap: 1rem;
  }

  .article-panel {
    padding: 1.25rem 1rem;
    min-height: auto;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .article-body {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .article-body p {
    text-align: left;
    margin-bottom: 0.65rem;
  }

  .sidebar-panel {
    position: static;
    max-height: none;
  }

  .mobile-tabs {
    display: flex !important;
  }

  .sidebar-panel.tab-hidden,
  .article-panel.tab-hidden {
    display: none !important;
  }

  .sidebar-panel .guess-form-card,
  .sidebar-panel .unified-guess-section,
  .sidebar-panel .sidebar-unified-divider {
    display: none !important;
  }

  .history-card {
    min-height: 450px;
  }

  .history-table-container {
    max-height: 480px;
  }

  .victory-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.75rem;
  }

  .logo-text {
    font-size: 1.15rem;
  }

  .badge {
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
}

/* ==========================================================================
   Modale de Sélection des Thèmes de Couleur
   ========================================================================== */
.theme-picker-intro {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.15rem;
  line-height: 1.5;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.theme-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.theme-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.theme-card.active {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px var(--accent-primary), 0 0 16px rgba(56, 189, 248, 0.25) !important;
  background: rgba(56, 189, 248, 0.08) !important;
}

.theme-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.theme-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.theme-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
}

.theme-swatch {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.theme-card-active-check {
  font-size: 0.85rem;
  color: var(--accent-success);
  font-weight: 800;
  margin-left: 0.35rem;
}

/* ==========================================================================
   Pied de page (Site Footer) & Pages Légales (WikiCrix)
   ========================================================================== */
.site-footer {
  margin-top: 2rem;
  padding: 2rem 1.25rem 2.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-secondary);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-logo {
  font-family: var(--font-galactic);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

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

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.footer-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.footer-sep {
  color: var(--border-color);
}

.footer-credits {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .site-footer {
    padding-bottom: 7.5rem; /* Dégage la barre mobile fixe (mobile-sticky-bar) */
  }
}

/* ==========================================================================
   Pages Légales Dédiées (Mentions Légales & Confidentialité)
   ========================================================================== */
.legal-page-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.legal-main {
  flex: 1;
  max-width: 920px;
  width: 92%;
  margin: 2rem auto 3.5rem;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.25rem 2.75rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  line-height: 1.75;
}

.legal-back-nav {
  margin-bottom: 1.75rem;
}

.btn-back-game {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border-light);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-back-game:hover {
  background: var(--accent-primary);
  color: #ffffff;
  transform: translateX(-3px);
  box-shadow: var(--shadow-sm);
}

.legal-card h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-family: var(--font-wiki-title);
  letter-spacing: -0.02em;
}

.legal-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.legal-section {
  margin-bottom: 2.25rem;
}

.legal-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.15rem 0 0.45rem;
}

.legal-section p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  margin-bottom: 0.85rem;
}

.legal-section ul {
  list-style: disc;
  margin-left: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.legal-section li {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.legal-section strong {
  color: var(--text-primary);
}

.legal-section a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.legal-section a:hover {
  color: var(--accent-primary-hover);
}

.legal-highlight-box {
  background: rgba(56, 189, 248, 0.08);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
  color: var(--text-secondary);
}

.legal-highlight-box strong {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .legal-card {
    padding: 1.5rem 1.15rem;
  }
  .legal-card h1 {
    font-size: 1.6rem;
  }
  .legal-section h2 {
    font-size: 1.15rem;
  }
}
