/* ============================================================
   UGO HUMBERT — FINAL CSS (overrides finaux)
   Fix scroll, fond premium, transitions cinematic
   ============================================================ */

/* ============================================================
   SCROLL — natif simple, fluide, sans JS surchargé
   ============================================================ */
html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html {
  scrollbar-gutter: stable;
}

/* Désactive smooth-scroll si reduce-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============================================================
   FOND PREMIUM — Vrai dégradé aurore subtil
   ============================================================ */
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 166, 81, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(212, 255, 0, 0.03), transparent),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(0, 166, 81, 0.04), transparent),
    #060606 !important;
  background-attachment: fixed;
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Désactive le noise overlay qui chargeait trop */
body::before {
  display: none !important;
}

/* ============================================================
   SECTIONS — Fonds alternés subtils
   ============================================================ */
.about { background: transparent !important; }
.palmares { background: rgba(255, 255, 255, 0.015) !important; }
.stats { background: transparent !important; }
.play-style { background: rgba(255, 255, 255, 0.015) !important; }
.tournaments-section { background: transparent !important; }
.calendar { background: rgba(255, 255, 255, 0.015) !important; }
.gallery { background: transparent !important; }
.ranking { background: rgba(255, 255, 255, 0.015) !important; }
.sponsors { background: transparent !important; }
.academy { background: rgba(255, 255, 255, 0.015) !important; }
.cta-section { background: transparent !important; }

/* ============================================================
   TRANSITIONS SECTIONS — Ligne dorée + ombre douce
   ============================================================ */
section + section {
  position: relative;
}

/* Retire l'ancien divider basique partout */
section + section::before {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 1px !important;
  height: 70px !important;
  background: linear-gradient(180deg, transparent, var(--accent) 50%, transparent) !important;
  opacity: 0.5 !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

/* Retire le ::after précédent qui faisait double ligne */
.about::after, .stats::after, .ranking::after,
.sponsors::after, .academy::after {
  display: none !important;
}

/* ============================================================
   PERFORMANCE — GPU + composition layers
   ============================================================ */
.hero, .about, .palmares, .stats, .gallery, .ranking,
.sponsors, .academy, .calendar, .play-style,
.tournaments-section, .cta-section, .footer {
  transform: translateZ(0);
  will-change: auto;
}

/* Évite que les images causent du reflow */
img {
  height: auto;
  max-width: 100%;
}

/* Désactive complètement les animations canvas/loader sur mobile */
@media (max-width: 768px) {
  #heroCanvas, #loaderCanvas { display: none !important; }
  .floating-ball { display: none !important; }
  .bg-stars { display: none !important; }
}

/* ============================================================
   TYPO — Garde-fous textes qui débordent
   ============================================================ */
.hero-title-line,
.section-title span,
.timeline-card h3,
.cta-title span,
.academy-title span,
.footer-big {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Le grand "PALMARES" et "2026" derrière les sections : caché si trop grand */
@media (max-width: 1200px) {
  .palmares::before, .calendar::before {
    font-size: clamp(80px, 12vw, 180px) !important;
    right: auto !important;
    left: -20px !important;
    opacity: 0.3 !important;
  }
}

@media (max-width: 768px) {
  .palmares::before, .calendar::before { display: none !important; }
}

/* ============================================================
   TOURNOIS — Logos en couleur, plus grands, mieux mis en valeur
   ============================================================ */
.tour-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important;
}

.tour-card {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  padding: 24px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  text-align: center !important;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1) !important;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.tour-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(212, 255, 0, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tour-card:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--accent) !important;
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.tour-card:hover::before { opacity: 1; }

.tour-card .tour-logo {
  height: 150px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  position: relative;
  z-index: 1;
}

.tour-card .tour-logo img {
  max-height: 140px !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  filter: none !important;
  opacity: 1 !important;
  transition: transform 0.5s var(--ease-out);
}

.tour-card:hover .tour-logo img {
  transform: scale(1.06);
}

.tour-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.tour-type {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text);
}

.tour-surface {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-3);
}

.tour-best {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-2);
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  display: inline-block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.tour-best.gold {
  background: linear-gradient(135deg, #C9A96E, #d9b97e);
  color: #0a0a0a;
  font-weight: 700;
}

/* ============================================================
   SPONSORS — Final polish (vraies couleurs)
   ============================================================ */
.sponsors-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

/* ============================================================
   NAV — Discrète mais lisible
   ============================================================ */
.nav {
  background: rgba(6, 6, 6, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav.scrolled {
  background: rgba(6, 6, 6, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   SECTION DOTS — Désactivés pour éviter conflit scroll
   ============================================================ */
.section-dots { display: none !important; }

/* ============================================================
   HERO — Ken Burns OFF, image stable
   ============================================================ */
.hero-bg-image {
  animation: none !important;
  transform: scale(1.03) !important;
}

.hero-overlay {
  background:
    linear-gradient(180deg, rgba(6,6,6,0.5) 0%, rgba(6,6,6,0.3) 40%, rgba(6,6,6,0.98) 100%),
    radial-gradient(ellipse at 30% 50%, rgba(0, 166, 81, 0.12), transparent 60%) !important;
}

/* ============================================================
   MARQUEE — Plus discrète
   ============================================================ */
.marquee {
  background: rgba(255, 255, 255, 0.02) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 24px 0 !important;
}

.marquee-track .dot { color: var(--accent); }

/* ============================================================
   GALLERY — Plus de respiration
   ============================================================ */
.gallery-grid {
  gap: 12px !important;
}

/* ============================================================
   FOOTER — Légèrement plus aéré
   ============================================================ */
.footer-big {
  letter-spacing: 0.02em !important;
  font-size: clamp(56px, 11vw, 160px) !important;
}

/* ============================================================
   FORCED IMAGE COLOR PRESERVE (logos)
   ============================================================ */
.sponsor-logo img,
.tour-logo img,
.cal-logo img {
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
}

/* ============================================================
   Loader sans canvas
   ============================================================ */
#loaderCanvas { display: none !important; }
