/* ==========================================================================
   0. VARIABLES — un seul :root avec les valeurs finales du thème §10.
   Rendu visuel inchangé.
   NOTE perf : les Google Fonts ne sont PLUS en @import ici (chaîne
   bloquante) mais en <link> + preconnect dans partials/header.html,
   avec display=swap. Baloo 2 supprimé (jamais utilisé).
   ========================================================================== */

:root {
  --bg: #080b10;
  --panel: #10131a;
  --panel-light: #151522;
  --panel-lighter: #1b1a27;
  --border: #302d42;
  --yellow: #ffe52f;
  --gold: #ffd21c;
  --purple: #a855f7;
  --purple2: #8b3dff;
  --twitch: #9146FF;
  --text: #f5f2ff;
  --text-dim: #8f8aa5;
  --font-display: 'Orbitron', 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body: 'Rajdhani', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   1. RÉINITIALISATION & FOND
   ========================================================================== */
* {
  box-sizing: border-box;
}

/* Anti-drag : les images ne peuvent pas être glissées (complète le
   blocage JS des liens dans le footer partagé). */
img {
  user-select: none;
  -webkit-user-drag: none;
}

/* Défilement doux des ancres */
html {
  scroll-behavior: smooth;
}

/* Révélation douce au scroll (classe posée par le footer partagé) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Focus clavier visible et unifié */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   MODE RELIEF FIREFOX (.is-firefox posé par le footer) — même look à l'arrêt,
   sans les animations qui saturent son pipeline (box-shadow / blur animés).
   Le détail par page vit dans son propre CSS (ex: tirage.css).
   ========================================================================== */
.is-firefox body {
  background-attachment: scroll;
}

.is-firefox body::before {
  display: none;
}

.is-firefox .quest-progress-fill::after,
.is-firefox .quests-bonus-banner,
.is-firefox .hero-xp-fill::after,
.is-firefox .shop-card[data-item-id="bd_VIP"] {
  animation: none;
}

.is-firefox .account-bar::after {
  animation: none;
}
/* Phase 3 : fusion base + §10.2 — fond final, structure base conservée */
body {
  background:
    radial-gradient(circle at 50% -10%, rgba(112, 39, 178, 0.28), transparent 42%),
    radial-gradient(circle at 8% 65%, rgba(255, 220, 35, 0.055), transparent 35%),
    radial-gradient(circle at 92% 25%, rgba(113, 61, 255, 0.08), transparent 38%),
    linear-gradient(135deg, #090b10 0%, #0b0d12 48%, #080b10 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  margin: 0;
  padding: 30px 20px 60px;
}

/* Phase 3 : fusion base + §10 — valeurs finales §10, props structurelles base conservées */
.container {
  max-width: 1100px;
  margin: 0 auto;
}

/* §10.2 conserve dans le CORE (§1) : fond html + grille futuriste */
html {
  background: #080b10;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
}

/* ==========================================================================
   2. HEADER & LOGO (COMMUN)
   ========================================================================== */
.header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  object-fit: cover;
  margin-bottom: 12px;
  box-shadow:
    0 0 0 4px rgba(8, 11, 16, 0.95),
    0 0 14px rgba(255, 229, 47, 0.35),
    0 0 32px rgba(168, 85, 247, 0.20);
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 0 5px rgba(24,24,27,0.9), 0 0 18px rgba(255, 225, 53, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(24,24,27,0.9), 0 0 34px rgba(255, 225, 53, 0.7); }
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  font-weight: 800;
  margin: 5px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fffbdc 0%, #ffe52f 48%, #ffc800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 5px rgba(255, 229, 47, 0.20))
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.75));
}

/* Banane miroir en fin de titre */
.banana-flip {
  display: inline-block;
  transform: scaleX(-1);
}

.subtitle {
  color: #89839d;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.subtitle .count {
  color: var(--yellow);
  font-weight: 700;
}

/* ==========================================================================
   3. BOUTONS — style "manette" bombé, cohérent avec le bouton de tirage gacha
   ========================================================================== */
/* Phase 3 : fusion base + §10.4 — look HUD rectangulaire final */
.btn-social,
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  border-radius: 5px;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn-social::before,
.btn-nav::before {
  display: none;
}

.btn-social:hover,
.btn-nav:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-social:active,
.btn-nav:active {
  transform: translateY(1px);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.btn-social {
  padding: 9px 18px;
  font-size: 0.85rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -3px 6px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-twitch { background: linear-gradient(180deg, #b47bff, var(--twitch)); }
.btn-discord { background: linear-gradient(180deg, #7f8cff, #5865F2); }
.btn-tiktok { background: linear-gradient(180deg, #2b2b2b, #000000); border-color: #444; }
.btn-youtube { background: linear-gradient(180deg, #ff4d4d, #FF0000); }
.btn-youtube-rediff { background: linear-gradient(180deg, #e64545, #CC0000); }

/* Navigation interne (Accueil, Boutique, Classement) */
.nav-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Dropdowns nav ---- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #181622 0%, #0d1016 100%);
  border: 2px solid var(--yellow);
  border-radius: 8px;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 12px rgba(255,229,47,0.15);
  overflow: hidden;
}

/* Pont invisible entre le déclencheur et le menu pour éviter la coupure au hover */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 10px 18px;
  color: var(--yellow);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:hover {
  background: linear-gradient(180deg, #fff06a 0%, #ffe52f 100%);
  color: #17120a;
}

.nav-dropdown-item--bananier {
  color: var(--gold);
  font-weight: 800;
  background: linear-gradient(180deg, rgba(48, 37, 10, 0.9), rgba(23, 19, 11, 0.9));
  border-top: 1px solid rgba(255, 210, 28, 0.35);
  text-shadow: 0 0 8px rgba(255, 210, 28, 0.55);
  box-shadow: inset 0 0 12px rgba(255, 210, 28, 0.12), 0 0 12px rgba(255, 210, 28, 0.2);
}

.nav-dropdown-item--bananier:hover {
  color: #17120a;
  background: linear-gradient(180deg, #fff06a 0%, #ffd21c 100%);
  text-shadow: none;
  box-shadow: 0 0 16px rgba(255, 210, 28, 0.5);
}

/* Zone de connexion Twitch (rempli par le script du header) */
.account-zone {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.account-chip--loading {
  color: #71717a;
  font-size: 0.85rem;
}

.account-chip-connect {
  border-radius: 999px;
}

/* Utilitaire : teinte dorée pour un emoji (ex : banane dorée).
   Les emojis ne se recolorent pas avec color, on passe par un filtre. */
.emoji-gold {
  display: inline-block;
  filter: sepia(1) saturate(2.5) hue-rotate(-15deg) brightness(1.05)
    drop-shadow(0 0 4px rgba(255, 215, 0, 0.55));
}

/* Badge de rôle — composant partagé (profil, tirage).
   Base d'origine (profil.css surcharge pour la carte personnage).
   Logo : 30px (taille normale d'avant découpage). */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
  margin-left: 14px;
  padding: 5px 13px 5px 7px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-display);
  background: #17151f;
  border: 2px solid #6b4f95;
  color: #d0bfff;
}

.v2-role .role-badge:first-child {
  margin-left: 0;
}

.role-badge-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}

img.role-badge-icon {
  object-fit: cover;
}

.role-badge--broadcaster { border-color: #eab308; color: #eab308; box-shadow: 0 0 12px rgba(234, 179, 8, 0.35); }
.role-badge--mod, .role-badge--moderator { border-color: #00ad03; color: #4ade80; box-shadow: 0 0 12px rgba(0, 173, 3, 0.35); }
.role-badge--vip { border-color: #e005b9; color: #ff5fd8; box-shadow: 0 0 12px rgba(224, 5, 185, 0.35); }
.role-badge--sub, .role-badge--subscriber { border-color: #a855f7; color: #c084fc; box-shadow: 0 0 12px rgba(168, 85, 247, 0.35); }
.role-badge--supermod { border-color: #f97316; color: #fb923c; box-shadow: 0 0 12px rgba(249, 115, 22, 0.4); }
.role-badge--beta { border-color: #6366f1; color: #a5b4fc; box-shadow: 0 0 12px rgba(99, 102, 241, 0.35); }

/* → BARRE DE COMPTE deplacee dans /css/player-bar.css (source de verite) */

/* Phase 3 : fusion base + §10.4 — HUD rectangulaire final */
.btn-nav {
  min-height: 40px;
  padding: 9px 20px;
  color: var(--yellow);
  background: linear-gradient(180deg, #181622 0%, #0d1016 100%);
  border: 2px solid var(--yellow);
  box-shadow:
    inset 0 0 0 1px rgba(255, 229, 47, 0.08),
    0 0 0 rgba(255, 229, 47, 0);
}

/* Petit effet lumineux au survol */
.btn-nav:hover {
  background: linear-gradient(180deg, #fff06a 0%, #ffe52f 100%);
  color: #17120a;
  border-color: #fff3a0;
  box-shadow:
    0 0 10px rgba(255, 229, 47, 0.35),
    inset 0 0 8px rgba(255, 255, 255, 0.35);
}

/* Bouton caché : n'apparaît que pour ceux qui ont débloqué le Bananier */
.btn-nav--bananier {
  background: linear-gradient(180deg, #30250a 0%, #17130b 100%);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 210, 28, 0.20);
}

.btn-nav--bananier:hover {
  background: linear-gradient(180deg, #fff06a 0%, #ffd21c 100%);
  color: #17120a;
}

.btn-nav--admin {
  background: linear-gradient(180deg, #2a0a0a 0%, #1a0505 100%);
  border-color: #e94560;
  color: #e94560;
  box-shadow: 0 0 12px rgba(233, 69, 96, 0.20);
}

.btn-nav--admin:hover {
  background: linear-gradient(180deg, #e94560 0%, #c0392b 100%);
  color: #fff;
}

/* ==========================================================================
   4. COMPOSANTS COMMUNS (INSTRUCTIONS & ÉTATS VIDES)
   ========================================================================== */
/* Phase 3 : fusion base + §10.7 — HUD final */
.instructions {
  position: relative;
  max-width: 700px;
  margin: 0 auto 34px;
  text-align: center;
  background: linear-gradient(90deg, #14121d, #101119);
  border: 1px solid #312c43;
  border-left: 2px solid var(--purple);
  border-radius: 7px;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: #908aa3;
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
}

.instructions code {
  background: #1b1825;
  color: var(--yellow);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  font-family: var(--font-display);
}

.empty {
  position: relative;
  text-align: center;
  color: var(--text-dim);
  padding: 46px 20px 40px;
  font-size: 0.95rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
}

.empty::before {
  content: '🍌';
  display: block;
  font-size: 2.4rem;
  margin-bottom: 12px;
  opacity: 0.8;
  filter: saturate(0.7);
}

/* → TABLEAU / CLASSEMENT deplace dans /css/leaderboard.css */

/* → GRILLE & CARTES BOUTIQUE deplacees dans /css/shop.css */
.reveal-zone h2 {
  font-family: var(--font-display);
  color: var(--yellow);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* → CARTE DE PROFIL RPG + stats/inventaire/monnaies deplaces dans /css/profil.css */

/* → TCHAT TWITCH + HOMEPAGE-LAYOUT deplaces dans /css/home.css */

/* → QUETES deplacees dans /css/quests.css */

/* → NIVEAU (level-section, level-progress-*) deplace dans /css/profil.css */

/* → DORE (inventory-item--golden, currency-box--gold) deplace dans /css/profil.css */

/* → INVENTAIRE VIDE + RESPONSIVE PROFIL deplaces dans /css/profil.css */

/* Lien cliquable sur les pseudos du classement, vers /profil/:username */
.player-link {
  color: inherit;
  text-decoration: none;
}
.player-link:hover {
  color: var(--yellow);
  text-decoration: underline;
}

/* Cache le titre/sous-titre du header quand une page ne les utilise pas (ex: profil, changelog) */
.header h1:empty,
.header .subtitle:empty {
  display: none;
  margin: 0;
}

/* → COMPLEMENTS PROFIL (avatar-wrapper, level-section, ::after, ...) dans /css/profil.css */

/* → TIRAGE GACHA deplace dans /css/tirage.css */

/* → BOUTONS D'ACHAT (.shop-card, .shop-buy-btn) deplaces dans /css/shop.css */

/* --- Pied de page ------------------------------------------------------------- */
.site-footer {
  text-align: center;
  margin-top: 40px;
  padding: 24px 15px 15px;
  font-size: 0.9em;
  border-top: 1px solid var(--border);
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 12px;
}

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--yellow);
}

.footer-nav span {
  color: #3f3f46;
}

.footer-credit {
  margin: 0;
  font-size: 0.8rem;
  color: #71717a;
}

.footer-credit a {
  color: inherit;
}

.fx-toggle--nav {
  align-self: center;
  padding: 6px 12px;
  font-size: 1rem;
  line-height: 1;
}

.fx-toggle.is-off {
  opacity: 0.45;
  border-style: dashed;
}

.fx-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.fx-toggle:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}

/* --- Page d'erreur (404) ---------------------------------------------------- */
.error-page {
  max-width: 560px;
  margin: 30px auto;
  padding: 48px 32px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(168, 85, 247, 0.22), transparent 70%),
    linear-gradient(145deg, rgba(23, 21, 32, 0.98), rgba(11, 14, 19, 0.98));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.error-art {
  display: block;
  font-size: 4rem;
  line-height: 1;
  transform: rotate(-14deg);
  filter: drop-shadow(0 0 18px rgba(255, 225, 53, 0.5));
  animation: errorWobble 3s ease-in-out infinite;
}

@keyframes errorWobble {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(-6deg) translateY(-6px); }
}

.error-code {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255, 229, 47, 0.4);
}

.error-title {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

.error-text {
  margin: 0 0 22px;
  color: var(--text-dim);
}

.error-ctas {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .error-art {
    animation: none;
  }
}

/* Interrupteur d'effets global : animations d'ambiance coupées */
html.fx-off .logo,
html.fx-off .error-art {
  animation: none;
}

/* --------------------------------------------------------------------------
   LIENS TEXTE DU CONTENU — jaune partout (cartes accueil/boutique,
   consignes tirage, sous-titre boutique). Les bleus/violets navigateur
   sont illisibles sur fond sombre. Nav, footer et player-bar gardent
   leurs propres couleurs (règles dédiées ci-dessus/ailleurs).
   -------------------------------------------------------------------------- */
.reward-card a,
.reward-card a:visited,
.instructions a,
.instructions a:visited,
.subtitle a,
.subtitle a:visited,
.shop-banner-text a,
.shop-banner-text a:visited {
  color: var(--yellow);
  font-weight: 700;
}

.reward-card a:hover,
.instructions a:hover,
.subtitle a:hover,
.shop-banner-text a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   10.17 PETITS AJUSTEMENTS RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 700px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .account-bar {
    padding: 10px;
  }

  .currency-pill {
    padding-right: 9px;
  }

  .btn-nav {
    padding: 8px 13px;
    font-size: 0.75rem;
  }

  h1 {
    letter-spacing: 0.045em;
  }
}
