/* Page d'accueil — habillage propre à index.html, s'appuie sur les tokens de styles.css.
 * Performances : aucun filtre de flou (les halos sont des dégradés déjà doux), animations limitées à
 * transform/opacity (rendues par le GPU), sections hors écran en rendu différé (content-visibility),
 * effets de survol réservés aux appareils qui ont une souris. */

.page-home { overflow-x: hidden; }
.page-home h1, .page-home h2, .page-home h3 { text-wrap: balance; }
.page-home p { text-wrap: pretty; }

/* Sections sous la ligne de flottaison : le navigateur ne les dessine qu'à l'approche. */
.home-defer { content-visibility: auto; contain-intrinsic-size: auto 560px; }

/* ============ Accroche ============ */
.home-hero {
  position: relative; overflow: hidden;
  padding: 92px 0 88px;
  border-bottom: 1px solid var(--border);
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 234, 240, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 234, 240, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 78%);
}
.home-hero-glow {
  position: absolute; pointer-events: none;
  /* Chaque dégradé s'éteint entièrement à l'intérieur de la boîte (rayon <= distance au bord le plus proche) :
     sans flou, un dégradé qui dépasse laisserait un bord net. */
  width: 1200px; height: 900px; top: -425px; left: -430px;
  background:
    radial-gradient(circle 400px at 540px 405px, rgba(255, 90, 31, 0.3), transparent),
    radial-gradient(circle 340px at 802px 541px, rgba(34, 211, 238, 0.15), transparent);
}
/* Réticule : cercles concentriques et croix, en filigrane derrière le panneau. */
.home-hero-scope {
  position: absolute; pointer-events: none;
  width: 700px; height: 700px; right: -200px; top: 50%; margin-top: -350px;
  background:
    linear-gradient(rgba(232, 234, 240, 0.08), rgba(232, 234, 240, 0.08)) center / 1px 100% no-repeat,
    linear-gradient(rgba(232, 234, 240, 0.08), rgba(232, 234, 240, 0.08)) center / 100% 1px no-repeat,
    repeating-radial-gradient(circle, transparent 0 76px, rgba(232, 234, 240, 0.07) 76px 77px);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 25%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 25%, transparent 100%);
}
.home-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.home-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Oxanium", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.74rem;
  color: var(--accent-2);
}
.home-kicker-dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
}
.home-kicker-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-2);
  animation: home-pulse 2s ease-out infinite;
}
@keyframes home-pulse {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(3.4); opacity: 0; }
}
.home-title {
  font-size: clamp(3.2rem, 9vw, 6.6rem);
  font-weight: 800; line-height: 0.92; text-transform: uppercase;
  margin: 18px 0 22px;
  letter-spacing: 0.01em;
}
.home-title span {
  background: linear-gradient(120deg, var(--accent) 10%, #ffb066 60%, var(--accent-2) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-sub { max-width: 560px; color: var(--muted); font-size: 1.12rem; line-height: 1.65; }
.home-sub strong { color: var(--text); }
.home-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.home-actions--center { justify-content: center; margin-top: 30px; }

/* Panneau "tableau de bord" à droite */
.home-board {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 90, 31, 0.08), transparent 55%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.home-board::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.home-board-head {
  font-family: "Oxanium", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  color: var(--muted); margin-bottom: 16px;
}
.home-board-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.home-board-stats > div {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px;
}
.home-board-stats dt {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--muted);
}
.home-board-stats dd {
  margin: 6px 0 0; font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.45rem; line-height: 1.1;
}
.home-board-stats small {
  font-family: "Inter", sans-serif; font-weight: 500; font-size: 0.72rem; color: var(--muted); margin-left: 4px;
}

/* Échelle des rangs : sept marches aux couleurs des paliers du classement (voir rank.js). */
.home-ladder-wrap { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.home-ladder-title {
  font-family: "Oxanium", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  color: var(--muted); margin-bottom: 14px;
}
.home-ladder { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; align-items: end; height: 54px; }
.home-ladder span {
  display: block; background: var(--c); border-radius: 5px 5px 3px 3px;
  transform-origin: bottom; animation: home-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.home-ladder span:nth-child(1) { --c: #cd7f32; height: 14px; animation-delay: 0.05s; }
.home-ladder span:nth-child(2) { --c: #aab8c7; height: 20px; animation-delay: 0.1s; }
.home-ladder span:nth-child(3) { --c: #f2b937; height: 26px; animation-delay: 0.15s; }
.home-ladder span:nth-child(4) { --c: #3fb6a8; height: 32px; animation-delay: 0.2s; }
.home-ladder span:nth-child(5) { --c: #4aa3ff; height: 38px; animation-delay: 0.25s; }
.home-ladder span:nth-child(6) { --c: #b45cff; height: 46px; animation-delay: 0.3s; }
.home-ladder span:nth-child(7) { --c: #ff5a1f; height: 54px; animation-delay: 0.35s; box-shadow: 0 0 22px -4px rgba(255, 90, 31, 0.7); }
@keyframes home-rise { from { transform: scaleY(0.15); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.home-ladder-cap {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ============ Prochains rendez-vous (API) ============ */
.home-next-list { display: grid; gap: 16px; }
.home-next {
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(255, 90, 31, 0.14), rgba(34, 211, 238, 0.06) 70%), var(--surface);
  border: 1px solid var(--accent); border-radius: 20px;
  padding: 26px 30px;
  box-shadow: 0 24px 50px -34px rgba(255, 90, 31, 0.6);
}
.home-next-label {
  font-family: "Oxanium", sans-serif; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.18em; font-size: 0.72rem; color: var(--accent);
}
.home-next-title {
  font-family: "Oxanium", sans-serif; font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.9rem);
  text-transform: uppercase; margin: 6px 0 4px;
}
.home-next-meta { color: var(--muted); font-size: 0.95rem; }
.home-next-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ Sections génériques ============ */
.home-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: "Oxanium", sans-serif; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.22em; font-size: 0.72rem; color: var(--accent-2); margin-bottom: 10px;
}
.home-eyebrow::before { content: ""; width: 20px; height: 2px; background: currentColor; opacity: 0.7; }
.home-eyebrow--live { color: var(--accent); }
.home-eyebrow--live::before {
  width: 8px; height: 8px; border-radius: 50%; opacity: 1; animation: home-blink 1.6s ease-in-out infinite;
}
@keyframes home-blink { 50% { opacity: 0.25; } }

/* Deux colonnes : texte d'introduction qui reste en vue à gauche, cartes à droite. */
.home-split {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 56px; align-items: start;
}
.home-split-copy { position: sticky; top: 104px; }
.home-split-copy .home-actions { margin-top: 26px; }

/* ============ Cartes « étapes » ============ */
.home-steps {
  list-style: none; margin-top: 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px;
  counter-reset: none;
}
.home-step {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 26px 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-step::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0.35; transition: opacity 0.2s ease;
}
.home-step-num {
  position: absolute; top: 10px; right: 16px;
  font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 2.6rem; line-height: 1;
  color: rgba(255, 255, 255, 0.05);
}
.home-step-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(255, 90, 31, 0.12); color: var(--accent);
}
.home-step-ic svg { width: 22px; height: 22px; }
.home-step h3 { font-size: 1.2rem; margin-bottom: 8px; position: relative; }
.home-step p { color: var(--muted); font-size: 0.95rem; position: relative; }
.home-steps--pair { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-steps--four { grid-template-columns: repeat(4, 1fr); }

/* Parcours : un trait relie les quatre étapes (grand écran seulement). */
@media (min-width: 1101px) {
  .home-steps--flow .home-step { overflow: visible; }
  .home-steps--flow .home-step:not(:last-child)::after {
    content: ""; position: absolute; top: 50px; right: -19px; width: 20px; height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(255, 90, 31, 0.15));
  }
}

/* ============ Les trois modes ============ */
.home-modes {
  margin-top: 36px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.home-mode {
  --mc: var(--accent); --mc-soft: rgba(255, 90, 31, 0.12);
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 26px 26px 24px;
  border: 1px solid var(--border); border-top: 3px solid var(--mc); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--mc-soft), transparent 45%), var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-mode--capture { --mc: var(--accent-2); --mc-soft: rgba(34, 211, 238, 0.1); }
.home-mode--sabotage { --mc: #f2b13c; --mc-soft: rgba(242, 177, 60, 0.1); }
.home-mode-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-mode-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; background: var(--mc-soft); color: var(--mc);
}
.home-mode-ic svg { width: 22px; height: 22px; }
.home-mode-chip {
  padding: 5px 12px; border: 1px solid var(--mc); border-radius: 999px; color: var(--mc);
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
}
.home-mode h3 { font-size: 1.4rem; }
.home-mode p { color: var(--muted); font-size: 0.95rem; }
.home-mode ul {
  list-style: none; display: grid; gap: 8px; margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.home-mode li { position: relative; padding-left: 20px; font-size: 0.9rem; }
.home-mode li::before {
  content: ""; position: absolute; left: 2px; top: 0.5em; width: 7px; height: 7px; border-radius: 2px; background: var(--mc);
}
.home-mode-go {
  margin-top: auto; padding-top: 8px; color: var(--mc);
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ============ Le tournoi ============ */
.home-terrain {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: center;
}
.home-terrain-copy .section-lead { margin-top: 10px; }
.home-figures { margin-top: 26px; }
.home-facts { list-style: none; margin-top: 22px; display: grid; gap: 14px; }
.home-facts li {
  position: relative; padding-left: 30px; color: var(--muted); font-size: 0.97rem;
}
.home-facts li::before {
  content: ""; position: absolute; left: 4px; top: 0.55em;
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.home-facts strong { color: var(--text); font-family: "Oxanium", sans-serif; }
.home-map {
  position: relative;
  margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 18px; box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.8);
}
/* Repères d'angle façon viseur. */
.home-map::before, .home-map::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none;
  border: 2px solid var(--accent); opacity: 0.8;
}
.home-map::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.home-map::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.home-map img { display: block; width: 100%; height: auto; border-radius: 12px; }
.home-map figcaption { color: var(--muted); font-size: 0.86rem; margin-top: 12px; text-align: center; }

/* ============ Explorer : liens en cartes ============ */
.home-links {
  margin-top: 36px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.home-links--four { grid-template-columns: repeat(4, 1fr); }
.home-link {
  --lc: var(--accent-2); --lc-soft: rgba(34, 211, 238, 0.12);
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-link--t { --lc: var(--accent); --lc-soft: rgba(255, 90, 31, 0.12); }
.home-link--e { --lc: #f2b13c; --lc-soft: rgba(242, 177, 60, 0.12); }
.home-link-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 4px;
  background: var(--lc-soft); color: var(--lc);
}
.home-link-ic svg { width: 20px; height: 20px; }
.home-link-tag {
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--lc);
}
.home-link h3 { font-size: 1.1rem; }
.home-link p { color: var(--muted); font-size: 0.9rem; flex: 1; }
.home-link-go {
  margin-top: 4px; color: var(--lc);
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Effets de survol : uniquement avec une vraie souris (sur mobile ils resteraient « collés » après un toucher). */
@media (hover: hover) {
  .home-step:hover { transform: translateY(-4px); border-color: rgba(255, 90, 31, 0.5); box-shadow: 0 20px 40px -26px rgba(255, 90, 31, 0.5); }
  .home-step:hover::before { opacity: 1; }
  .home-mode:hover { transform: translateY(-5px); box-shadow: 0 24px 44px -28px var(--mc); }
  .home-link:hover { transform: translateY(-4px); border-color: var(--lc); box-shadow: 0 20px 40px -26px var(--lc); }
}

/* ============ Live ============ */
.home-live {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 30px 32px;
}
.home-live::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #9146ff, #c9a6ff);
}
.home-live::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; pointer-events: none;
  background: radial-gradient(circle, rgba(145, 70, 255, 0.18), transparent 65%);
}
.home-live-copy { position: relative; display: flex; align-items: flex-start; gap: 18px; max-width: 620px; z-index: 1; }
.home-live-copy h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin: 4px 0 8px; }
.home-live-copy p { color: var(--muted); }
.home-live-ic {
  flex: none; width: 48px; height: 48px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(145, 70, 255, 0.16); color: #a970ff;
}
.home-live-ic svg { width: 24px; height: 24px; fill: currentColor; }
.home-live .btn-twitch { position: relative; z-index: 1; flex: none; }

/* ============ Appel final ============ */
.home-cta {
  position: relative; overflow: hidden;
  padding: 104px 0;
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
  border-top: 1px solid var(--border);
  text-align: center;
}
.home-cta::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 900px; height: 560px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 90, 31, 0.24), transparent);
}
.home-cta::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 68px, rgba(232, 234, 240, 0.05) 68px 69px);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 20%, transparent 100%);
}
.home-cta-inner { position: relative; z-index: 1; display: grid; gap: 16px; justify-items: center; }
.home-cta h2 { font-size: clamp(2rem, 5.5vw, 3.4rem); text-transform: uppercase; }
.home-cta p { color: var(--muted); max-width: 520px; font-size: 1.05rem; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .home-steps--four, .home-links--four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .home-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .home-hero-scope { right: -340px; opacity: 0.7; }
  .home-terrain { grid-template-columns: 1fr; gap: 36px; }
  .home-split { grid-template-columns: 1fr; gap: 34px; }
  .home-split-copy { position: static; }
}
@media (max-width: 760px) {
  .home-modes { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .home-steps--four, .home-steps--pair, .home-links--four { grid-template-columns: 1fr; }
  .home-hero { padding: 64px 0 60px; }
  .home-hero-scope { display: none; }
  .home-live { padding: 24px 22px; }
  .home-next { padding: 22px 20px; }
  .home-board { padding: 20px; }
  .home-cta { padding: 76px 0; }
  .home-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .home-kicker-dot::after, .home-ladder span, .home-eyebrow--live::before { animation: none !important; }
  .home-step, .home-link, .home-mode { transition: none !important; }
}

/* Raccourcis de la page d'accueil : deux rangées titrées (au quotidien / pour comprendre). */
.home-links-title { margin: 30px 0 14px; font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.home-links-title:first-of-type { margin-top: 26px; }
