/* ============================================================
   components.css — éléments réutilisables sur toutes les pages
   ============================================================ */

/* ============================================================
   TOPBAR — bloc sombre + navigation
   ============================================================ */
.dark-block {
  background: linear-gradient(155deg, var(--void) 0%, var(--void-2) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
  padding-bottom: 60px;
}
.dark-block--simple { padding-bottom: 44px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-dark);
}

/* ── Marque / logo ── */
.topbar .mark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 0;
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
.mark-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  will-change: transform;
}
.topbar .mark:hover .mark-logo {
  animation: foxSpin 0.5s cubic-bezier(.25,.8,.3,1.2) forwards;
  filter: drop-shadow(0 0 6px rgba(214,40,57,.7));
}
@keyframes foxSpin {
  0%   { transform: rotate(0deg)  scale(1);    }
  60%  { transform: rotate(20deg) scale(1.15); }
  100% { transform: rotate(0deg)  scale(1);    }
}
.mark-ak  { color: var(--cream); letter-spacing: 1.5px; }
.mark-num { color: var(--ember); letter-spacing: 0; }

/* ── Nav ── */
.topbar nav { display: flex; gap: 32px; flex-wrap: wrap; align-items: center; }
.nav-link {
  color: #cdbcb4;
  font-size: 14.5px;
  letter-spacing: 1px;
  font-weight: 600;
  position: relative;
  padding-bottom: 3px;
  text-decoration: none;
  transition: color 0.18s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--ember);
  border-radius: 2px;
  transition: width 0.22s ease;
}
.nav-link:hover { color: var(--cream); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--cream); }
.nav-link.active::after { width: 100%; background: var(--red); }

.nav-link--logout { color: var(--ash); font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }
.nav-link--logout:hover { color: var(--cream); }
.nav-link--logout::after { background: var(--ash); }

.topbar .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ember);
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* ============================================================
   BANNIÈRE SIMPLE — pages secondaires (ex : /tournois)
   ============================================================ */
.page-banner { padding: 54px 0 10px; }
.page-banner h1 { font-family: 'Bebas Neue', sans-serif; font-size: 46px; letter-spacing: 2px; color: var(--cream); }
.page-banner p { color: #cdbcb4; margin-top: 8px; font-size: 14px; }
.page-banner-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ============================================================
   HERO — accueil
   ============================================================ */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 20px; padding: 64px 0 30px; }
.hero-text { opacity: 0; animation: dealLeft .65s cubic-bezier(.25,.8,.3,1.2) .15s forwards; }
.hero .eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 3px; color: var(--gold); margin-bottom: 18px; }
.hero h1 {
  font-family: 'Bebas Neue', sans-serif; font-size: 104px; line-height: 0.88; letter-spacing: 3px; color: var(--cream);
  opacity: 0;
  animation: ignite 1.3s steps(1,end) .5s forwards;
}
.hero .sub { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 5px; color: var(--ember); margin-top: 10px; }
.hero p.tagline { max-width: 420px; margin-top: 20px; color: #cdbcb4; font-size: 15px; }
.cta-row { margin-top: 30px; display: flex; gap: 14px; }
.btn { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.4px; padding: 14px 26px; border-radius: 8px; display: inline-block; transition: transform .15s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--red); color: var(--cream); }
.btn.ghost { border: 1.5px solid rgba(253,246,238,.4); color: var(--cream); background: rgba(253,246,238,.05); }
.btn.ghost:hover { border-color: rgba(253,246,238,.7); background: rgba(253,246,238,.12); }

.hero-fox { position: relative; display: flex; justify-content: center; align-items: center; height: 340px; perspective: 900px; }
.hero-fox img {
  position: relative; z-index: 1; width: 280px; height: auto;
  transform-style: preserve-3d;
  opacity: 0;
  transform: rotateY(90deg) scale(.85);
  animation:
    flipReveal .7s cubic-bezier(.2,.7,.3,1) .5s forwards,
    neonOutline 0.5s ease-in-out .5s forwards;
}

/* ============================================================
   STATS — accueil
   ============================================================ */
.stats { margin-top: -46px; position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat-card {
  background: var(--card); border-radius: 14px; padding: 22px 18px;
  box-shadow: 0 10px 28px rgba(28,20,20,0.08); border-top: 3px solid var(--ember);
  opacity: 0; transform: translateY(26px) rotate(-2deg);
}
.stats.in-view .stat-card { animation: dealUp .55s cubic-bezier(.25,.8,.3,1.3) forwards; }
.stats.in-view .stat-card:nth-child(1) { animation-delay: .02s; }
.stats.in-view .stat-card:nth-child(2) { animation-delay: .12s; }
.stats.in-view .stat-card:nth-child(3) { animation-delay: .22s; }
.stats.in-view .stat-card:nth-child(4) { animation-delay: .32s; }
.stat-card:nth-child(2) { border-top-color: var(--red); }
.stat-card:nth-child(3) { border-top-color: var(--gold); }
.stat-card:nth-child(4) { border-top-color: var(--ink); }
.stat-card .label { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 1px; color: var(--ash); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.stat-card .label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.stat-card .value { font-family: 'Bebas Neue', sans-serif; font-size: 38px; letter-spacing: 1px; color: var(--ink); }
.stat-card .value.reel .digit { display: inline-block; width: 1.1ch; text-align: center; }
.stat-card .value.reel .digit.settle { animation: settleBounce .3s ease-out; }
.stat-card .value.clock { font-family: 'JetBrains Mono', monospace; font-size: 24px; font-weight: 700; color: var(--red); display: flex; align-items: baseline; gap: 1px; perspective: 300px; }
.stat-card .value.clock .seg { display: inline-block; min-width: 1.5ch; text-align: center; }
.stat-card .value.clock .seg.flip { animation: segFlip .32s ease-out; }
.stat-card .value.clock .sep { opacity: .45; font-size: 18px; }
.stat-card .sub { font-size: 11.5px; color: var(--ash); margin-top: 4px; }

/* ============================================================
   PILIERS — accueil
   ============================================================ */
.pillars { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 74px 0 70px; }
.pillar { border-radius: 12px; padding: 24px 18px; background: var(--card); border: 1px solid var(--line); opacity: 0; transform: translateY(26px) rotate(2deg); }
.pillars.in-view .pillar { animation: dealUp .55s cubic-bezier(.25,.8,.3,1.3) forwards; }
.pillars.in-view .pillar:nth-child(1) { animation-delay: .02s; }
.pillars.in-view .pillar:nth-child(2) { animation-delay: .12s; }
.pillars.in-view .pillar:nth-child(3) { animation-delay: .22s; }
.pillars.in-view .pillar:nth-child(4) { animation-delay: .32s; }
.pillar h3 { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.pillar h3 .suit { font-size: 20px; line-height: 1; }
.pillar:nth-child(odd) h3 .suit { color: var(--red); }
.pillar:nth-child(even) h3 .suit { color: var(--ember); }
.pillar p { font-size: 12.5px; color: var(--ash); }

/* ============================================================
   APERÇU CALENDRIER — widget "prochains tournois" (accueil)
   Reprend volontairement le même habillage que la page /tournois
   (.tourney-row, .type, .access) pour que le rendu soit identique —
   seule différence : gardé une animation d'entrée dealRowIn propre
   au widget, déclenchée par .schedule.in-view.
   ============================================================ */
.schedule-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.schedule-head h2 { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 1px; }
.schedule-head a { color: var(--red); font-size: 13px; font-weight: 700; }
.schedule { margin-bottom: 80px; }
.schedule .tourney-row { opacity: 0; transform: translateX(-16px); }
.schedule.in-view .tourney-row { animation: dealRowIn .5s ease-out forwards; }
.schedule.in-view .tourney-row:nth-child(1) { animation-delay: .02s; }
.schedule.in-view .tourney-row:nth-child(2) { animation-delay: .12s; }
.schedule.in-view .tourney-row:nth-child(3) { animation-delay: .22s; }

/* ============================================================
   CALENDRIER COMPLET — page /tournois
   Namespacé .tourney-* pour ne jamais entrer en collision avec
   le widget homepage ci-dessus (même s'ils se ressemblent).
   ============================================================ */
.page-head-cal { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 40px 0 8px; }
.access-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ash); align-items: center; }

/* ---- séparateur de mois ---- */
.month-divider { display: flex; align-items: center; gap: 14px; margin: 52px 0 20px; }
.month-divider:first-of-type { margin-top: 8px; }
.month-chip {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--void); border: 2px solid var(--gold); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 12px; letter-spacing: 1px;
}
.month-divider h2 { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 2px; margin: 0; color: var(--ink); white-space: nowrap; }
.month-divider .count { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ash); white-space: nowrap; }
.month-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- révélation progressive par mois (voir main-additions.js) ---- */
.month-group.pending {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows .6s ease, opacity .5s ease;
}
.month-group.pending .month-group-inner { min-height: 0; }
.month-group.pending.in-view { grid-template-rows: 1fr; opacity: 1; }
.month-sentinel { height: 1px; }

/* ---- badge d'accès ---- */
.access {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; justify-self: end;
}
.access.membres { background: rgba(214,40,57,.08); color: #a3232f; border: 1px solid rgba(214,40,57,.22); }
.access.ouvert  { background: rgba(31,122,69,.09); color: #1f7a45; border: 1px solid rgba(31,122,69,.24); }
.access .dot { width: 6px; height: 6px; border-radius: 50%; background: #2ba84a; animation: pulse 1.6s ease-in-out infinite; }

/* ---- ligne tournoi régulier ---- */
.tourney-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px;
  padding: 15px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.tourney-row .date { font-family: 'JetBrains Mono', monospace; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 118px; }
.tourney-row .type { color: var(--ash); }
.tourney-row .type.type-championnat { color: #8a6a1a; font-weight: 700; }
.tourney-row .type.type-estival { color: #5b84b3; font-weight: 700; }
.tourney-row .time { color: var(--ash); font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }

/* ---- carte "billet" — tournois spéciaux ---- */
.ticket {
  position: relative; display: grid; grid-template-columns: 120px 1px 1fr; align-items: stretch;
  background: var(--card); border: 1.5px solid var(--gold); border-radius: 14px; overflow: hidden;
  margin: 16px 0; box-shadow: 0 10px 26px rgba(28,20,20,.09);
}
.ticket-stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--void); color: var(--cream); padding: 18px 8px; }
.ticket-stub .wd { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 1.5px; color: rgba(253,246,238,.6); text-transform: uppercase; margin-bottom: 2px; }
.ticket-stub .day { font-family: 'Bebas Neue', sans-serif; font-size: 48px; line-height: 1; color: var(--gold); }
.ticket-stub .mon { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* ---- effet "plaque d'aéroport" au scroll — cf. flapReveal() dans main.js ----
   Chaque bloc (jour de semaine / quantième / mois) flippe sur lui-même en
   affichant des valeurs aléatoires avant de se poser sur la vraie valeur,
   comme un panneau d'horaires à palettes. Déclenché une fois par carte. */
.ticket-stub .wd,
.ticket-stub .day,
.ticket-stub .mon {
  display: inline-block;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
.ticket-stub .flap-flip {
  animation: flapFlip .22s cubic-bezier(.5,0,.5,1);
}
@keyframes flapFlip {
  0%   { transform: rotateX(0deg);    opacity: 1;   }
  45%  { transform: rotateX(-95deg);  opacity: .25; }
  55%  { transform: rotateX(95deg);   opacity: .25; }
  100% { transform: rotateX(0deg);    opacity: 1;   }
}
.ticket-perf {
  position: relative;
  background-image:
    radial-gradient(circle 7px at 0 0, transparent 7px, var(--cream) 7.5px),
    radial-gradient(circle 7px at 0 100%, transparent 7px, var(--cream) 7.5px);
  background-repeat: no-repeat;
  background-position: top left, bottom left;
}
.ticket-perf::before {
  content: ''; position: absolute; top: 10px; bottom: 10px; left: 0; width: 0;
  border-left: 2px dashed rgba(28,20,20,.18);
}
.ticket-body { padding: 18px 22px 18px 26px; position: relative; }
.ticket-tag { position: absolute; top: 16px; right: 18px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; font-weight: 700; }
.ticket-body h3 { font-family: 'Bebas Neue', sans-serif; font-size: 23px; letter-spacing: .5px; margin: 0 0 6px; padding-right: 80px; }
.ticket-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ash); margin-bottom: 12px; }
.ticket-meta b { color: var(--ink); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.ticket-hook { font-family:'JetBrains Mono',monospace; font-size:12.5px;font-weight: 700; color: #d62839; }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ticket-foot .access { margin-left: auto; }

/* ============================================================
   BLOCS GÉNÉRIQUES
   ============================================================ */
.card-section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; margin: 40px 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ash); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font-family: 'Manrope', sans-serif; font-size: 14px; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px; }
.alert.error { background: #fdeceb; color: var(--red); }
.alert.success { background: #eaf6ee; color: #1f7a45; }

/* ============================================================
   FOOTER
   ============================================================ */
footer { background: var(--void); color: #cdbcb4; padding: 34px 0; font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
footer .addr { font-family: 'JetBrains Mono', monospace; color: var(--cream); }
.footer-by { font-size: 13px; color: var(--ash); }
.footer-by a { color: var(--ember); font-weight: 600; text-decoration: none; }
.footer-by a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  /* ---- topbar ---- */
  .topbar { flex-wrap: wrap; gap: 10px; padding: 16px 0; }
  .topbar nav { order: 3; width: 100%; justify-content: center; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line-dark); }
  .topbar nav a { font-size: 13px; }
  .topbar .tag { font-size: 10px; }
  .mark-logo { width: 28px; height: 28px; }
  .dark-block { clip-path: polygon(0 0, 100% 0, 100% 97%, 0 100%); padding-bottom: 40px; }

  /* ---- hero ---- */
  .hero { grid-template-columns: 1fr; text-align: center; padding: 36px 0 20px; gap: 24px; }
  .hero p.tagline { margin-inline: auto; }
  .cta-row { justify-content: center; flex-wrap: wrap; }
  .hero h1 { font-size: 72px; }
  .hero-fox { height: 220px; }
  .hero-fox img { width: 190px; }

  /* ---- bannière simple ---- */
  .page-banner { padding: 36px 0 6px; }
  .page-banner h1 { font-size: 34px; }
  .page-banner-actions { flex-wrap: wrap; }

  /* ---- stats / piliers ---- */
  .stats, .pillars { grid-template-columns: repeat(2,1fr); }

  /* ---- aperçu calendrier (accueil) : réutilise le mobile de .tourney-row ci-dessous ---- */

  /* ---- calendrier complet (page /tournois) : 2 lignes ---- */
  .tourney-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date   access" "time   type";
    row-gap: 4px; font-size: 12.5px;
  }
  .tourney-row .date   { grid-area: date; }
  .tourney-row .access { grid-area: access; justify-self: end; }
  .tourney-row .time   { grid-area: time; }
  .tourney-row .type   { grid-area: type; justify-self: end; text-align: right; font-size: 11px; }

  .ticket { grid-template-columns: 84px 1px 1fr; }
  .ticket-stub .day { font-size: 34px; }
  .ticket-body { padding: 14px 16px 14px 20px; }
  .ticket-body h3 { font-size: 19px; padding-right: 0; margin-top: 4px; }
  .ticket-tag { position: static; display: block; margin-bottom: 6px; }

  /* ---- footer ---- */
  footer .wrap { flex-direction: column; align-items: flex-start; }
  .footer-by { text-align: left; }
}

@media (max-width: 400px) {
  .topbar nav { gap: 10px; }
  .topbar nav a { font-size: 11px; }
  .hero h1 { font-size: 58px; }
  .stats, .pillars { grid-template-columns: 1fr; }
}