/* =======================
   1. VARIABLES & AMBIANCE
   ======================= */
:root {
  --gold: #d4af37;          /* Or antique */
  --gold-bright: #fcd34d;   /* Or éclatant (plus lumineux pour le contraste) */
  --gold-muted: rgba(212, 175, 55, 0.15);
  
  --void: #020617;          /* Noir quasi total */
  --midnight: #0f172a;      /* Bleu nuit */
  
  --text-main: #f8fafc;     /* Blanc pur pour meilleure lisibilité */
  --text-muted: #94a3b8;    /* Gris bleuté */
  
  /* Glassmorphism AJUSTÉ (Plus opaque pour la lisibilité) */
  --card-bg: linear-gradient(145deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.95) 100%);
  --card-border: 1px solid rgba(255, 255, 255, 0.08); /* Bordure plus fine et subtile */
  
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
  --glow-card: 0 0 25px rgba(212, 175, 55, 0.1);
  
  --speed: 0.3s ease-out;
  --radius: 16px;
}

/* =======================
   2. BASE & TYPOGRAPHIE
   ======================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  scroll-behavior: smooth; 
  font-size: 16px; 
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--void);
  /* Fond subtil conservé */
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.6;
  /* padding-top retiré ici car géré par le composant sticky */
  overflow-x: hidden;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* UX : Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; border: 2px solid var(--void); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

a { text-decoration: none; color: inherit; transition: var(--speed); }
img { max-width: 100%; display: block; height: auto; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* =======================
   3. HEADER & NAV (Compatible Web Components)
   ======================= */
/* Correction pour le Web Component */
kyran-header {
  display: block;
  position: sticky; /* Remplacer fixed par sticky pour éviter les bugs de scroll */
  top: 0;
  z-index: 6000;
  width: 100%;
}

header {
  width: 100%;
  height: 80px;
  background: rgba(2, 6, 23, 0.9); /* Plus sombre */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex; align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 25px; width: 100%; }
.container.nav { display: flex; justify-content: space-between; align-items: center; height: 100%; }

.logo img { 
  height: 45px; width: auto; 
  filter: drop-shadow(0 0 5px rgba(212,175,55,0.2)); 
  transition: transform var(--speed);
}
.logo:hover img { transform: scale(1.05); }

/* Menu Desktop */
.nav ul { display: flex; gap: 32px; }
.nav ul a { 
  font-weight: 500; font-size: 0.95rem; letter-spacing: 0.5px;
  color: var(--text-muted); position: relative; padding: 5px 0;
}

/* Soulignement animé */
.nav ul a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px;
  background: var(--gold); transition: width var(--speed);
}
/* Support de la classe .active ajoutée par le JS */
.nav ul a:hover::after, .nav ul a.active::after, .nav ul a.accent::after { width: 100%; }
.nav ul a:hover, .nav ul a.active, .nav ul a.accent { 
  color: var(--gold); text-shadow: 0 0 10px rgba(212,175,55,0.4); opacity: 1;
}

/* Bouton Burger */
.nav-toggle { 
  display: none; 
  flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  width: 44px; height: 44px; border-radius: 8px; cursor: pointer;
  z-index: 6001;
}
.nav-toggle span {
  width: 24px; height: 2px; background: var(--gold); transition: var(--speed);
}

/* BackDrop */
.backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 5999;
}
.mobile-cta { display: none; margin-top: 15px; }

/* =======================
   4. BOUTONS & ANIMATIONS
   ======================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%);
  color: #000;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 50px; 
  text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--gold-bright) 0%, #b8860b 100%);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
  color: #000;
}
.btn:active { transform: translateY(1px); }

header .cta { display: block; }

/* Animation Pulse (Ajout demandé) */
@keyframes pulse-gold {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}
.cta-pulse {
  animation: pulse-gold 2s infinite;
}

/* =======================
   5. SECTIONS & UI
   ======================= */
main { flex: 1; } /* Pousse le footer en bas */
section { padding: 80px 0; scroll-margin-top: 80px; }

/* Hero */
.hero { text-align: center; padding: 100px 0 60px; position: relative; }
.hero h1 { 
  font-family: 'Bebas Neue', sans-serif; 
  font-size: clamp(3rem, 8vw, 5.5rem); 
  line-height: 1; margin-bottom: 25px; 
  text-shadow: 0 5px 30px rgba(0,0,0,0.8);
  letter-spacing: 2px; /* Espacement Premium */
}
.hero p { 
  font-size: 1.2rem; color: var(--text-muted); 
  max-width: 650px; margin: 0 auto 40px; 
}
.accent { color: var(--gold); }

/* Titres */
.section-title { 
  font-family: 'Bebas Neue'; font-size: clamp(2.5rem, 5vw, 3.5rem); 
  text-align: center; margin-bottom: 10px; color: #fff;
  letter-spacing: 1px;
}
.section-title::after {
  content: "✦"; display: block; color: var(--gold);
  font-size: 24px; margin-top: 5px; opacity: 0.8;
}
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 50px; font-size: 1.1rem; }

/* Grilles */
.grid { display: grid; gap: 30px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Cartes (Ajustées pour lisibilité) */
.card, .feature-card, article {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius); padding: 30px; 
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px); /* Augmenté pour flouter le fond */
  transition: var(--speed);
}

.card:hover { 
  border-color: rgba(212, 175, 55, 0.4); 
  transform: translateY(-5px); 
  box-shadow: var(--glow-card), var(--shadow-card);
}

.card h3 { 
  color: var(--gold-bright); 
  font-family: 'Bebas Neue'; font-size: 1.6rem; letter-spacing: 1px;
  margin-bottom: 15px; 
}
.card p { font-size: 0.95rem; color: #cbd5e1; line-height: 1.6; }

/* Listes Techniques */
.tech-list li, .power-list li {
  padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; justify-content: space-between; color: var(--text-muted);
}
.tech-list li strong { 
  color: var(--gold); font-weight: 400; font-family: 'Bebas Neue'; letter-spacing: 1px; font-size: 1.1rem; 
}

/* Timeline */
.timeline { 
  border-left: 2px solid rgba(255, 255, 255, 0.1); 
  padding-left: 35px; margin-top: 30px; margin-left: 10px; 
}
.timeline li { position: relative; margin-bottom: 35px; color: var(--text-muted); }
.timeline li::before {
  content: ''; position: absolute; left: -41px; top: 6px;
  width: 10px; height: 10px; background: var(--gold); border-radius: 50%;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}
.timeline strong { 
  color: #fff; font-family: 'Bebas Neue'; font-size: 1.3rem; 
  display: block; margin-bottom: 5px; letter-spacing: 1px;
}

/* Video */
.video-container {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: var(--radius); background: #000; border: var(--card-border);
  box-shadow: var(--shadow-card);
  max-width: 900px; margin: 0 auto;
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Règles */
#regles h3 { 
  color: var(--gold); font-family: 'Bebas Neue'; font-size: 2rem; 
  border-bottom: 1px solid rgba(212,175,55,0.3); margin: 40px 0 25px; padding-bottom: 10px;
}
.rule-note { 
  background: var(--gold-muted); border-left: 4px solid var(--gold); 
  padding: 20px; margin: 30px 0; border-radius: 0 8px 8px 0;
  color: var(--text-main);
}
.rule-note strong { color: var(--gold-bright); }

/* =======================
   6. FOOTER (Web Component)
   ======================= */
kyran-footer { display: block; margin-top: auto; }

footer {
  background: #010409; padding: 60px 20px 30px; 
  border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.95rem; color: #64748b;
}
footer h4 { color: #fff; margin-bottom: 15px; font-family: 'Bebas Neue'; font-size: 1.3rem; letter-spacing: 1px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; max-width: 1100px; margin: 0 auto 40px; }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 25px; opacity: 0.6; }

/* =======================
   7. RESPONSIVE
   ======================= */
@media (max-width: 900px) {
  /* Hide Desktop Nav & CTA */
  .nav nav, header .cta { display: none; }
  
  .nav-toggle { display: flex; }

  /* Menu Mobile Ouvert */
  body.menu-open { overflow: hidden; }
  
  body.menu-open .nav nav {
    display: flex; position: fixed; top: 80px; left: 0; width: 100%; height: calc(100vh - 80px);
    background-color: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(15px);
    flex-direction: column; padding: 40px 20px; border-top: 1px solid rgba(212, 175, 55, 0.3);
    z-index: 6000; animation: fadeIn 0.3s;
    overflow-y: auto;
  }
  @keyframes fadeIn { from{opacity:0} to{opacity:1} }

  .nav ul { flex-direction: column; gap: 25px; text-align: center; width: 100%; }
  .nav ul a { font-size: 1.4rem; font-family: 'Bebas Neue'; letter-spacing: 2px; display: block; padding: 10px; }
  
  .mobile-cta { display: block; margin-top: 30px; }

  /* Animation Croix Burger */
  body.menu-open .nav-toggle { border-color: var(--gold); background: rgba(212,175,55,0.1); }
  body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .hero h1 { font-size: 3.5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =======================
   8. MODE IMPRESSION
   ======================= */
@media print {
  kyran-header, kyran-footer, .video-container, .hero .btn, .cta, #mini-jeu-section {
    display: none !important;
  }
  body { 
    background: #fff !important; 
    color: #000 !important; 
    background-image: none !important;
  }
  .card, article {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
    break-inside: avoid;
  }
}