/* ============================================================
   World Cup 2026 — "Floodlit Pitch" design system
   Palette, type and primitives. Grounded in night-match turf.
   ============================================================ */

:root {
  /* Color — a pitch at night under floodlights */
  --ink:        #07120D;   /* page base, darkest turf */
  --pitch:      #0C1B14;   /* raised surface */
  --pitch-2:    #102619;   /* cards */
  --line:       #1C3A2A;   /* hairlines / pitch chalk faint */
  --turf:       #00E07A;   /* primary accent — vivid grass */
  --turf-dim:   #0B6A41; /* dim turf for borders/hover */
  --amber:      #FFC24B;   /* trophy / live secondary */
  --chalk:      #E9F2EC;   /* primary text */
  --chalk-mut:  #84A091;   /* muted text */
  --live:       #FF5A4D;   /* live ball red */

  /* Type */
  --display: "Archivo", system-ui, sans-serif;
  --body:    "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* Geometry */
  --r-sm: 6px;
  --r:    12px;
  --r-lg: 20px;
  --maxw: 1180px;
  --pad:  clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0,224,122,.10), transparent 60%),
    var(--ink);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Faint pitch stripes behind everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(
    90deg, transparent 0 7.5%, rgba(255,255,255,.012) 7.5% 15%);
  pointer-events: none; z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); position: relative; z-index: 1; }

/* ---------- Type scale ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--turf); margin: 0 0 .6rem;
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: .98; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); text-transform: uppercase; }
h3 { font-size: 1.15rem; }
.lede { color: var(--chalk-mut); font-size: 1.05rem; max-width: 56ch; }

/* ---------- Header / nav ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,18,13,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.masthead .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 50%;
  background:
    conic-gradient(from 45deg, #fff 0 25%, var(--ink) 0 50%, #fff 0 75%, var(--ink) 0);
  box-shadow: 0 0 0 2px var(--turf) inset, 0 0 14px rgba(0,224,122,.5);
}
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .04em;
  color: var(--chalk-mut); padding: 8px 12px; border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--chalk); background: var(--pitch-2); }
.nav a.active { color: var(--ink); background: var(--turf); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .82rem; letter-spacing: .03em;
  padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--pitch-2); color: var(--chalk); cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--turf-dim); }
.btn-go { background: var(--turf); color: var(--ink); border-color: var(--turf); font-weight: 700; }
.btn-go:hover { background: #1cff92; }

/* ---------- Live pill ---------- */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--live); border: 1px solid color-mix(in srgb, var(--live) 40%, transparent);
  padding: 3px 9px; border-radius: 100px;
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{ opacity: 1; box-shadow: 0 0 0 0 rgba(255,90,77,.6);} 50%{ opacity:.6; box-shadow: 0 0 0 6px rgba(255,90,77,0);} }

/* ---------- Section heading ---------- */
.sec { padding: clamp(40px, 7vw, 88px) 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ============================================================
   SCOREBOARD — the signature element (LED tabular scoreline)
   ============================================================ */
.board {
  background: linear-gradient(180deg, var(--pitch-2), var(--pitch));
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.board-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--chalk-mut);
}
.board-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 22px 18px; }
.team { display: flex; align-items: center; gap: 12px; min-width: 0; }
.team.home { justify-content: flex-end; text-align: right; }
.flag {
  width: 40px; height: 28px; border-radius: 4px; flex: 0 0 auto;
  background: var(--line); object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
  display: grid; place-items: center; font-family: var(--mono); font-size: .72rem; color: var(--chalk-mut);
}
.team .name { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(1rem,2.4vw,1.5rem); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score {
  font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: .04em;
  color: var(--turf); text-shadow: 0 0 18px rgba(0,224,122,.35);
  padding: 4px 16px; border-radius: var(--r-sm);
  background: rgba(0,0,0,.28); border: 1px solid var(--line);
}
.score .sep { color: var(--chalk-mut); padding: 0 6px; text-shadow: none; }
.score.pending { color: var(--chalk-mut); text-shadow: none; font-size: clamp(.9rem,2.4vw,1.1rem); letter-spacing: .1em; }
.board-foot { padding: 9px 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: .72rem; color: var(--chalk-mut); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* hero board larger */
.hero { padding: clamp(28px,6vw,64px) 0 clamp(20px,4vw,40px); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px,4vw,44px); align-items: center; }
.hero h1 .pop { color: var(--turf); }
.hero .meta { font-family: var(--mono); color: var(--chalk-mut); font-size: .82rem; margin-top: 18px; display: flex; gap: 18px; flex-wrap: wrap; }
.hero .meta b { color: var(--amber); font-weight: 700; }

/* ---------- Match list ---------- */
.matches { display: grid; gap: 12px; }
.match-row {
  display: grid; grid-template-columns: 84px 1fr auto 1fr 84px; align-items: center; gap: 10px;
  background: var(--pitch-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; transition: border-color .15s, transform .12s;
}
.match-row:hover { border-color: var(--turf-dim); transform: translateY(-1px); }
.match-row .when { font-family: var(--mono); font-size: .76rem; color: var(--chalk-mut); line-height: 1.3; }
.match-row .when b { display: block; color: var(--chalk); font-size: .92rem; }
.match-row .side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.match-row .side.h { justify-content: flex-end; text-align: right; }
.match-row .side .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-row .mid { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: center; color: var(--turf); font-weight: 700; min-width: 56px; }
.match-row .mid.pending { color: var(--chalk-mut); font-size: .78rem; }
.match-row .grp { font-family: var(--mono); font-size: .7rem; color: var(--chalk-mut); text-align: right; }

/* ---------- Standings ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 18px; }
.gtable { background: var(--pitch-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gtable h3 { padding: 13px 16px; background: var(--pitch); border-bottom: 1px solid var(--line); font-family: var(--display); text-transform: uppercase; font-size: .95rem; letter-spacing: .04em; }
table { width: 100%; border-collapse: collapse; }
.gtable th, .gtable td { padding: 9px 10px; font-size: .85rem; text-align: center; border-bottom: 1px solid var(--line); }
.gtable th { font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--chalk-mut); font-weight: 500; }
.gtable td.team-cell { text-align: left; font-weight: 600; }
.gtable td.pts { font-family: var(--mono); color: var(--turf); font-weight: 700; }
.gtable tr:last-child td { border-bottom: 0; }
.gtable tr.qual td:first-child { box-shadow: inset 3px 0 0 var(--turf); }

/* ---------- Bracket ---------- */
.bracket { display: flex; gap: 36px; overflow-x: auto; padding-bottom: 16px; }
.round { display: flex; flex-direction: column; justify-content: space-around; gap: 18px; min-width: 220px; }
.round h4 { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--chalk-mut); margin: 0 0 4px; }
.tie { background: var(--pitch-2); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.tie .t { display: flex; justify-content: space-between; padding: 9px 12px; font-size: .85rem; }
.tie .t + .t { border-top: 1px solid var(--line); }
.tie .t .s { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--chalk-mut); }
.tie .t.win { color: var(--turf); font-weight: 700; }
.tie .t.win .s { color: var(--turf); }
.final-tie { border-color: var(--amber); box-shadow: 0 0 22px rgba(255,194,75,.18); }

/* ============================================================
   CHANNELS / video library
   ============================================================ */
.note {
  background: var(--pitch-2); border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: var(--r-sm); padding: 14px 16px; font-size: .9rem; color: var(--chalk-mut);
}
.note b { color: var(--chalk); }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.vid-card {
  background: var(--pitch-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  cursor: pointer; transition: border-color .15s, transform .12s;
}
.vid-card:hover { border-color: var(--turf-dim); transform: translateY(-2px); }
.vid-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--pitch), var(--ink)); display: grid; place-items: center; position: relative; }
.vid-thumb .play { width: 46px; height: 46px; border-radius: 50%; background: var(--turf); display: grid; place-items: center; color: var(--ink); box-shadow: 0 4px 20px rgba(0,224,122,.4); }
.vid-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-meta { padding: 13px 14px; }
.vid-meta .t { font-weight: 700; font-size: .95rem; margin-bottom: 3px; }
.vid-meta .d { font-family: var(--mono); font-size: .72rem; color: var(--chalk-mut); }

/* Player modal */
.player-stage { background: #000; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.player-stage video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.player-shell { display: none; }
.player-shell.open { display: block; }
.player-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0; color: var(--chalk-mut); font-family: var(--mono); font-size: .76rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Forms (admin) ---------- */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--chalk-mut); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); color: var(--chalk);
  border-radius: var(--r-sm); padding: 11px 13px; font-family: var(--body); font-size: .95rem;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--turf); border-color: var(--turf); }
.tag { font-family: var(--mono); font-size: .7rem; color: var(--turf); }

/* ---------- Utility ---------- */
.skel { background: linear-gradient(90deg, var(--pitch-2) 25%, var(--line) 37%, var(--pitch-2) 63%); background-size: 400% 100%; animation: sh 1.3s infinite; border-radius: var(--r); height: 78px; }
@keyframes sh { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.muted { color: var(--chalk-mut); }
.center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .match-row { grid-template-columns: 64px 1fr auto 1fr; }
  .match-row .grp { display: none; }
}
@media (max-width: 520px) {
  .nav { display: none; }
  .board-body { padding: 16px 12px; }
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--turf); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
