/* ============================================================
   MONDIAL 26 — "Le Tableau"
   Desk de presse sportive × tableau d'affichage de stade.
   Noir chaud + grain · accent orange flamme · Anton/Archivo/Space Mono.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg:        #0d0c0a;
  --bg-2:      #131210;
  --card:      #18160f;
  --card-2:    #1f1c14;
  --line:      #2a261c;
  --line-2:    #3a3424;
  --text:      #f3ede0;
  --muted:     #b3a98f;
  --faint:     #7c735c;

  --flame:     #ff6a1a;
  --flame-2:   #ff8c3f;
  --ember:     #d2410a;
  --live:      #ff3b3b;
  --qual:      #4ade80;
  --qual-dim:  #2e6e44;

  --mono: 'Space Mono', ui-monospace, monospace;
  --sans: 'Archivo', system-ui, sans-serif;
  --display: 'Anton', 'Archivo', sans-serif;

  --maxw: 1180px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(255,106,26,.10), transparent 55%),
    radial-gradient(90% 60% at 0% 0%, rgba(210,65,10,.08), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain papier */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .05; mix-blend-mode: screen;
  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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--flame); color: #1a0c00; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--flame); }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px) 14px;
  background: linear-gradient(180deg, rgba(13,12,10,.96), rgba(13,12,10,.82));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark { text-decoration: none; color: var(--text); display: block; line-height: .9; }
.wordmark__main {
  font-family: var(--display); font-size: clamp(28px, 5vw, 46px);
  letter-spacing: .01em; display: inline-flex; align-items: baseline; gap: .08em;
}
.wordmark__year {
  color: var(--bg); background: var(--flame);
  padding: 0 .14em; transform: skewX(-7deg); display: inline-block;
  box-shadow: 4px 4px 0 var(--ember);
}
.wordmark__sub {
  display: block; margin-top: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .32em;
  color: var(--faint); text-transform: uppercase;
}

.nav { display: flex; gap: 4px; }
.nav__tab {
  font-family: var(--sans); font-weight: 700; font-size: 13px;
  letter-spacing: .02em; color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  padding: 9px 15px; cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.nav__tab:hover { color: var(--text); background: var(--card); }
.nav__tab.is-active { color: var(--flame); border-color: var(--line-2); background: var(--card); }

/* ---------- Ticker ---------- */
.ticker {
  position: relative; z-index: 10;
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin;
  background: #0a0908;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(16px, 4vw, 40px);
}
.ticker:empty { display: none; }
.tk {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-right: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; white-space: nowrap;
}
.tk__abbr { color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.tk__sc { color: var(--text); font-weight: 700; }
.tk--in .tk__sc { color: var(--flame-2); }
.tk__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 0 rgba(255,59,59,.6); animation: pulse 1.4s infinite;
}
.tk__t { color: var(--faint); font-size: 11px; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,59,.55); }
  70% { box-shadow: 0 0 0 7px rgba(255,59,59,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); }
}

/* ---------- Stage / views ---------- */
.stage { position: relative; z-index: 5; max-width: var(--maxw); margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 64px; }
.view { display: none; }
.view.is-active { display: block; animation: fade .4s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 22px; padding-bottom: 12px; border-bottom: 2px solid var(--line-2);
}
.section-head h2 {
  font-family: var(--display); font-size: clamp(22px, 3.4vw, 34px);
  letter-spacing: .01em; text-transform: uppercase;
}
.section-head .tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  color: var(--faint); text-transform: uppercase;
}
.section-head .tag b { color: var(--flame); }

/* ---------- Match card (scoreboard) ---------- */
.matches { display: grid; gap: 12px; }
.match {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(8px, 3vw, 28px);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  border-radius: var(--radius); padding: 16px clamp(14px, 3vw, 26px);
  position: relative; opacity: 0; animation: rise .5s var(--ease) forwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.match--in { border-left-color: var(--live); background: linear-gradient(180deg, #221610, var(--card)); }
.match--post { border-left-color: var(--flame); }

.side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.side--away { flex-direction: row-reverse; text-align: right; }
.crest {
  width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto;
  background: #0a0908; border: 1px solid var(--line); border-radius: 50%; padding: 3px;
}
.side__name { font-weight: 700; font-size: clamp(14px, 2vw, 18px); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__abbr { display: none; font-family: var(--mono); color: var(--faint); font-size: 12px; }

.center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px; }
.score { font-family: var(--mono); font-weight: 700; font-size: clamp(26px, 5vw, 40px); letter-spacing: .02em; line-height: 1; font-variant-numeric: tabular-nums; }
.score .dash { color: var(--faint); margin: 0 .18em; }
.match--in .score { color: var(--flame-2); }
.kick { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: .04em; }

.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.pill--live { color: #fff; background: var(--live); border-color: var(--live); display: inline-flex; align-items: center; gap: 6px; }
.pill--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1s steps(2) infinite; }
.pill--post { color: var(--flame); border-color: var(--ember); }
@keyframes blink { 50% { opacity: .2; } }

.match__meta {
  grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .04em;
}
.match__meta .gp { color: var(--flame); }

/* empty / next-up note */
.note { color: var(--muted); font-size: 14px; margin: 8px 0 20px; }
.note b { color: var(--flame); font-weight: 700; }

/* ---------- Groups grid ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; opacity: 0; animation: rise .5s var(--ease) forwards; }
.gcard__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.gcard__head h3 { font-family: var(--display); font-size: 20px; letter-spacing: .02em; text-transform: uppercase; }
.gcard__head .lt { font-family: var(--display); font-size: 26px; color: var(--flame); line-height: 1; }

.gtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.gtable th { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 400; padding: 8px 4px; text-align: center; }
.gtable th.team { text-align: left; padding-left: 14px; }
.gtable td { padding: 9px 4px; text-align: center; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.gtable td.team { text-align: left; padding-left: 14px; }
.gtable .rk { font-family: var(--mono); color: var(--faint); width: 26px; }
.gtable .pts { font-family: var(--mono); font-weight: 700; color: var(--text); }
.gtable .gd { font-family: var(--mono); color: var(--muted); }
.team-cell { display: flex; align-items: center; gap: 9px; }
.team-cell img { width: 22px; height: 22px; border-radius: 50%; object-fit: contain; background: #0a0908; flex: 0 0 auto; }
.team-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
/* zone qualification (top 2) */
.gtable tr.qz td { background: linear-gradient(90deg, rgba(74,222,128,.07), transparent); }
.gtable tr.qz td.team { box-shadow: inset 3px 0 0 var(--qual); }
.gtable tr.qz3 td.team { box-shadow: inset 3px 0 0 var(--flame); }

.gcard__foot { padding: 8px 14px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--faint); display: flex; gap: 14px; border-top: 1px solid var(--line); }
.legend { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend i.q { background: var(--qual); }
.legend i.b { background: var(--flame); }

/* ---------- Calendar ---------- */
.cal-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 6px 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--muted);
  border-radius: 999px; cursor: pointer; transition: .14s;
}
.chip:hover { color: var(--text); border-color: var(--flame); }
.chip.is-active { background: var(--flame); color: #1a0c00; border-color: var(--flame); }

.day { margin-bottom: 26px; }
.day__label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--flame); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.crow {
  display: grid; grid-template-columns: 58px 1fr auto 1fr 76px; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); margin-bottom: 6px; font-size: 14px;
}
.crow__time { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.crow .h { display: flex; align-items: center; gap: 8px; justify-content: flex-end; text-align: right; font-weight: 600; min-width: 0; }
.crow .a { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.crow .h span, .crow .a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow img { width: 22px; height: 22px; border-radius: 50%; object-fit: contain; background: #0a0908; flex: 0 0 auto; }
.crow__sc { font-family: var(--mono); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); }
.crow--in .crow__sc { color: var(--flame-2); }
.crow--pre .crow__sc { color: var(--faint); }
.crow__grp { font-family: var(--mono); font-size: 10px; color: var(--faint); text-align: right; letter-spacing: .08em; }
.crow__grp.in { color: var(--live); }

/* ---------- Footer ---------- */
.foot {
  position: relative; z-index: 5; max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  padding: 26px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .06em;
}
.foot__brand { color: var(--flame); font-weight: 700; letter-spacing: .12em; }

.loading { color: var(--faint); font-family: var(--mono); font-size: 13px; padding: 40px 0; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .side__name { font-size: 0; } /* show abbr on tiny screens */
  .side__abbr { display: block; font-size: 14px; color: var(--text); font-weight: 700; }
  .crest { width: 32px; height: 32px; }
  .crow { grid-template-columns: 46px 1fr auto 1fr; }
  .crow__grp { display: none; }
  .match__meta { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
}
