/* ========================================================================
   MPP — Famille Lège · Dashboard Coupe du Monde 2026
   Aesthetic: broadcast sportif nocturne — noir stadium, or MPP, scoreboard
   ======================================================================== */

:root {
  --bg:        #0a0c10;
  --bg-2:      #0d1016;
  --surface:   #14181f;
  --surface-2: #1b2029;
  --line:      rgba(233, 185, 73, 0.13);
  --line-soft: rgba(255, 255, 255, 0.06);

  --gold:      #e9b949;
  --gold-lite: #f7da8c;
  --gold-deep: #b98e2b;
  --ink:       #ece7d8;
  --ink-dim:   #9aa0ad;
  --ink-faint: #5d636f;

  --up:        #46cf8b;
  --down:      #ef5d44;
  --pitch:     #163a2b;

  --r:    16px;
  --r-sm: 10px;
  --shadow: 0 18px 50px -18px rgba(0,0,0,.85);
  --maxw: 1180px;

  --font-display: "Anton", sans-serif;
  --font-body:    "Archivo", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* atmospheric background: stadium glow + pitch lines + grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1100px 600px at 78% -8%, rgba(233,185,73,.16), transparent 60%),
    radial-gradient(900px 700px at 8% 110%, rgba(22,58,43,.40), transparent 60%),
    linear-gradient(180deg, #0b0e13, #07090d 70%);
  z-index: -2;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: .5;
  z-index: -1; pointer-events: none;
}

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
section { margin: 64px auto; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(8,10,14,.92), rgba(8,10,14,.55));
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold), #c9962f);
  color: #11130f; font-family: var(--font-display); font-size: 20px;
  box-shadow: 0 6px 18px -6px rgba(233,185,73,.7);
}
.brand-name { font-family: var(--font-display); letter-spacing: .04em; font-size: 17px; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a {
  color: var(--ink-dim); text-decoration: none; font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px; border-radius: 8px;
  transition: .2s;
}
.topbar nav a:hover { color: var(--gold); background: rgba(233,185,73,.08); }

/* ---------- hero ---------- */
.hero { padding-top: 54px; }
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.hero-eyebrow::before { content:""; width: 38px; height: 1px; background: var(--gold); }
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(58px, 12vw, 158px); line-height: .84; letter-spacing: -.01em;
  margin: 0; text-transform: uppercase;
}
.hero h1 .out {
  -webkit-text-stroke: 1.5px var(--gold); color: transparent;
  text-stroke: 1.5px var(--gold);
}
.hero-sub {
  margin-top: 20px; color: var(--ink-dim); max-width: 560px; font-size: 16px;
}
.hero-sub b { color: var(--ink); font-weight: 700; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hstat {
  border: 1px solid var(--line); background: rgba(255,255,255,.015);
  border-radius: var(--r-sm); padding: 14px 18px; min-width: 120px;
}
.hstat .n { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.hstat .l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 7px; }

/* ---------- section heads ---------- */
.shead { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.shead .idx {
  font-family: var(--font-mono); color: var(--gold); font-size: 12px; letter-spacing: .12em;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin-bottom: 6px;
}
.shead h2 {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(26px, 4.4vw, 44px); line-height: .95; margin: 0; letter-spacing: .005em;
}
.shead p { margin: 4px 0 0; color: var(--ink-dim); font-size: 13.5px; }

/* ---------- cards / panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 22px;
}
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px){ .g-2,.g-3{ grid-template-columns: 1fr; } }

/* ---------- podium ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.18fr 1fr; align-items: end; gap: 16px; margin-bottom: 26px; }
.pod {
  position: relative; border-radius: var(--r); padding: 22px 16px 18px; text-align: center;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  overflow: hidden;
}
.pod.first  { border-color: rgba(233,185,73,.5); background: linear-gradient(180deg, rgba(233,185,73,.16), rgba(233,185,73,.02)); }
.pod .medal { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.pod.first .medal { color: var(--gold); }
.pod.second .medal { color: #cdd3dc; }
.pod.third .medal { color: #d7965a; }
.pod .who { font-family: var(--font-display); font-size: clamp(18px,2.4vw,26px); margin-top: 6px; text-transform: uppercase; letter-spacing:.01em; }
.pod .who.me { color: var(--gold-lite); }
.pod .pts { font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim); margin-top: 4px; }
.pod .bar { height: 6px; border-radius: 4px; margin-top: 14px; background: linear-gradient(90deg, var(--gold), transparent); opacity:.6;}
.pod.first .crown { position:absolute; top:10px; right:12px; font-size: 18px; }

/* ---------- standings table ---------- */
.standings { width: 100%; border-collapse: collapse; }
.standings th {
  text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500; padding: 0 12px 14px; white-space: nowrap;
}
.standings th.num, .standings td.num { text-align: right; }
.standings td { padding: 13px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.standings tr.me td { background: rgba(233,185,73,.07); }
.standings tr:hover td { background: rgba(255,255,255,.025); }
.rk { font-family: var(--font-display); font-size: 20px; width: 30px; color: var(--ink-dim); }
.rk.top { color: var(--gold); }
.pname { display:flex; align-items:center; gap: 11px; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.pname .nm { font-weight: 700; letter-spacing: .005em; }
.pname .nm.me::after { content:"TOI"; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em;
  background: var(--gold); color:#11130f; padding: 2px 5px; border-radius: 4px; margin-left: 8px; vertical-align: middle; }
.ptsbar { position: relative; height: 22px; min-width: 110px; }
.ptsbar i { position:absolute; left:0; top:50%; transform: translateY(-50%); height: 7px; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.ptsbar span { position: relative; font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 13.5px; }
.mv { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.mv.up { color: var(--up); } .mv.down { color: var(--down); } .mv.flat { color: var(--ink-faint); }

/* ---------- charts ---------- */
.chart-box { position: relative; width: 100%; }
.chart-box.tall  { height: 460px; }
.chart-box.mid   { height: 360px; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 9px; margin-top: 16px; }
.lg {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line-soft); cursor: pointer;
  color: var(--ink-dim); background: rgba(255,255,255,.02); transition: .16s; user-select: none;
}
.lg:hover { border-color: var(--line); color: var(--ink); }
.lg.off { opacity: .38; }
.lg .d { width: 9px; height: 9px; border-radius: 50%; }
.lg.me { border-color: rgba(233,185,73,.5); color: var(--gold-lite); }

/* segmented control */
.seg { display:inline-flex; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-dim); background: none; border: 0; padding: 7px 13px; border-radius: 7px; cursor: pointer; transition:.15s;
}
.seg button.on { background: var(--gold); color: #11130f; font-weight: 700; }

/* ---------- fun stat cards ---------- */
.fcard {
  border: 1px solid var(--line-soft); border-radius: var(--r); padding: 20px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2)); position: relative; overflow: hidden;
  min-height: 150px; display: flex; flex-direction: column;
}
.fcard .tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.fcard .big { font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px); line-height: .98; margin: 10px 0 2px; }
.fcard .desc { color: var(--ink-dim); font-size: 13px; margin-top: auto; }
.fcard .desc b { color: var(--ink); }
.fcard .glyph { position:absolute; right: -8px; top: -14px; font-size: 92px; opacity: .06; }

.scoreline { display:flex; align-items:center; gap:10px; font-family: var(--font-mono); font-size: 13px; margin-top: 8px; }
.scoreline .vs { color: var(--ink-faint); }
.scoreline .sc { font-family: var(--font-display); font-size: 20px; color: var(--gold-lite); }

/* ---------- head to head ---------- */
.h2h-pick { display:flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 20px; }
.h2h-pick select {
  font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; cursor: pointer;
}
.h2h-pick .vs { font-family: var(--font-display); font-size: 22px; color: var(--ink-faint); }
.h2h-grid { display:grid; grid-template-columns: 1fr auto 1fr; gap: 10px 20px; align-items:center; }
.h2h-row { display: contents; }
.h2h-row .lbl { grid-column: 2; text-align:center; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.h2h-row .a, .h2h-row .b { font-family: var(--font-display); font-size: 26px; }
.h2h-row .a { text-align: right; } .h2h-row .b { text-align: left; }
.h2h-row .a.win, .h2h-row .b.win { color: var(--gold); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 30px 0 60px; color: var(--ink-faint); font-size: 12.5px; }
footer .wrap { display:flex; flex-wrap:wrap; gap: 8px 20px; justify-content: space-between; }
footer code { font-family: var(--font-mono); color: var(--ink-dim); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* custom chart tooltip */
#tt {
  position: fixed; pointer-events: none; z-index: 100; opacity: 0; transition: opacity .12s;
  background: rgba(10,12,16,.96); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 150px;
}
#tt .tt-h { font-family: var(--font-mono); font-size: 10.5px; letter-spacing:.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 7px; }
#tt .tt-r { display:flex; align-items:center; gap: 8px; padding: 2px 0; }
#tt .tt-r .d { width: 8px; height: 8px; border-radius: 50%; }
#tt .tt-r .v { margin-left: auto; font-family: var(--font-mono); font-weight: 600; }
