/* ──────────────────────────────────────────────────────────
   FIFA WC 2026 / PL — RISO MEMPHIS THEME
   Chunky pastels · hard offset shadows · halftone paper
   ────────────────────────────────────────────────────────── */

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

:root {
  /* core (names preserved so JS / rest of stylesheet keep working) */
  --bg: #fef0d9;
  --surface: #fff8e8;
  --surface2: #fbe8c4;
  --primary: #ff5e93;
  --primary-bright: #ff3d7c;
  --gold: #3b6dff;        /* re-pointed to riso-blue accent */
  --gold-bright: #1a1a2e;
  --text: #1a1a2e;
  --muted: #6b6b7a;
  --border: #1a1a2e;      /* chunky black ink */
  --win: #1f8a5a;
  --loss: #d6336c;
  --text-secondary: #4a4a5e;
  --shadow-card: 4px 4px 0 #1a1a2e;

  /* riso palette extras */
  --paper: #fff8e8;
  --pink: #ff5e93;
  --blue: #3b6dff;
  --yellow: #ffd23f;
  --mint: #7be0ad;
  --ink: #1a1a2e;

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-mono: "Space Mono", monospace;
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle, rgba(26, 26, 46, 0.07) 1px, transparent 1.4px);
  background-size: 14px 14px;
}

/* ── Header ── */
header {
  background: var(--paper);
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.wc-badge {
  width: 60px;
  height: 60px;
  background: var(--pink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  flex-shrink: 0;
  letter-spacing: -0.5px;
  text-align: center;
  line-height: 1;
  border-radius: 0;
  transform: rotate(-6deg);
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1.2px;
  line-height: 1;
  color: var(--ink);
}

.header-title h1 em {
  font-style: italic;
  font-weight: 900;
  color: var(--blue);
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 0 8px;
  display: inline-block;
  transform: rotate(-2deg);
  margin-left: 4px;
}

.header-title p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.header-stats {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.stat-pill {
  background: var(--mint);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 14px;
  text-align: center;
  border-radius: 0;
}
.stat-pill:nth-child(2) {
  background: var(--yellow);
  transform: rotate(2deg);
}
.stat-pill:nth-child(3) {
  background: #fff;
  transform: rotate(-1.5deg);
}
.stat-pill .val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.stat-pill .lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 3px;
  font-weight: 700;
}

/* ── View nav tabs ── */
.view-nav {
  background: transparent;
  border-bottom: 2px dashed var(--ink);
  padding: 16px 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view-tab {
  padding: 9px 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.1s;
}
.view-tab:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.view-tab.active {
  background: var(--ink);
  color: var(--yellow);
}

/* ── Container ── */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 28px;
}

/* ── Group shortcut bar ── */
.group-shortcut-bar {
  position: sticky;
  top: var(--header-h, 108px);
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 0 12px;
  background: var(--bg);
  /* repeat the dot-grid pattern so it blends with the body */
  background-image: radial-gradient(circle, rgba(26,26,46,.07) 1px, transparent 1.4px);
  background-size: 14px 14px;
  margin-bottom: 20px;
  border-bottom: 2px dashed var(--ink);
}

.gs-sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 5px 9px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
  white-space: nowrap;
}
.gs-sc-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.gs-sc-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.gs-sc-3rd {
  background: var(--yellow);
}

.gs-sc-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--ink);
  opacity: 0.3;
  margin: 0 2px;
}

/* Anchor offset so sticky header + shortcut bar don’t cover the target */
.group-block,
.third-place-section {
  scroll-margin-top: calc(var(--header-h, 108px) + 60px);
}

/* ── Groups grid ── */
.groups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 900px) {
  .groups-grid { grid-template-columns: 1fr; }
}

.group-block {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--blue);
}
.group-block:nth-child(2n) { box-shadow: 6px 6px 0 var(--mint); }
.group-block:nth-child(3n) { box-shadow: 6px 6px 0 var(--pink); }
.group-block:nth-child(4n) { box-shadow: 6px 6px 0 var(--yellow); }

.group-header {
  background: var(--yellow);
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.group-block:nth-child(2n) .group-header { background: var(--pink); color: var(--paper); }
.group-block:nth-child(3n) .group-header { background: var(--mint); color: var(--ink); }
.group-block:nth-child(4n) .group-header { background: var(--blue); color: var(--paper); }

.group-header::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  background: var(--ink);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Group mini-standings ── */
.group-standings {
  border-bottom: 2px dashed var(--ink);
}

.gs-header,
.gs-row {
  display: grid;
  grid-template-columns: 22px 1fr 22px 22px 22px 22px 30px 30px;
  gap: 4px;
  padding: 9px 14px;
  align-items: center;
  font-size: 12px;
  font-family: var(--font-mono);
}

.gs-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  background: rgba(26, 26, 46, 0.05);
}

.gs-row {
  border-bottom: 1px dashed rgba(26, 26, 46, 0.25);
  transition: background 0.1s;
}
.gs-row:last-child { border-bottom: none; }
.gs-row:hover { background: rgba(255, 210, 63, 0.4); }

.gs-row.advance {
  background: rgba(123, 224, 173, 0.45);
}
.gs-row.maybe {
  background: rgba(255, 210, 63, 0.25);
}
.gs-row.out {
  opacity: 0.5;
}

.gs-pos {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  font-size: 14px;
}

.gs-team {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.gs-team img {
  width: 22px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}
.gs-team span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-num {
  text-align: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.gs-pts {
  font-family: var(--font-display);
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  color: var(--blue);
}

.gs-gd {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gs-gd.pos { color: var(--win); }
.gs-gd.neg { color: var(--loss); }
.gs-gd.zer { color: var(--ink); }

/* ── Best 3rd-placed teams table ── */
.third-place-section {
  margin-top: 36px;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--yellow);
  background: var(--paper);
  overflow: hidden;
}

.third-place-title {
  background: var(--yellow);
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.third-place-title::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  background: var(--ink);
  border-radius: 50%;
  flex-shrink: 0;
}

.third-place-note {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 8px 16px 6px;
  border-bottom: 1px dashed rgba(26,26,46,0.2);
}

.third-place-table {
  border-bottom: none;
}

.third-header,
.third-row {
  grid-template-columns: 22px 1fr 28px 22px 22px 22px 22px 30px 30px;
}

.gs-grp {
  font-family: var(--font-display);
  font-weight: 900;
  text-align: center;
  color: var(--ink);
  font-size: 13px;
}

/* ── Group fixtures section ── */
.group-fixtures {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group-fixtures-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink);
  font-weight: 700;
  padding: 2px 2px 4px;
}

/* ── Match card (compact) ── */
.match-card {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 11px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.match-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

/* Full-size variant for knockout view */
.match-card.full {
  padding: 16px 20px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--blue);
}
.match-card.full:hover {
  box-shadow: 5px 5px 0 var(--blue);
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.team.away {
  flex-direction: row-reverse;
  text-align: right;
}
.team img {
  width: 32px;
  height: 23px;
  object-fit: contain;
  flex-shrink: 0;
}
.match-card.full .team img {
  width: 42px;
  height: 30px;
}

.team-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.match-card.full .team-name { font-size: 14px; }

.match-card.home-win .team.home .team-name { color: var(--win); }
.match-card.away-win .team.away .team-name { color: var(--win); }

.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.score-nums {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}
.score-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.match-card.full .score-num { font-size: 26px; min-width: 22px; }

.score-sep {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--pink);
  font-weight: 900;
}
.match-card.full .score-sep { font-size: 18px; }

.score-extra {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--blue);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.match-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.match-card.full .match-time { font-size: 12px; min-height: 30px; }

.match-kickoff {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  row-gap: 2px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px dashed rgba(20, 20, 20, 0.18);
}
.match-kickoff .match-time { min-height: 0; }

.match-status {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 7px;
  border-radius: 0;
  border: 1.5px solid var(--ink);
  background: #fff;
}
.match-card.full .match-status { font-size: 10px; padding: 3px 9px; }

.s-ft   { background: var(--mint);   color: var(--ink); }
.s-aet  { background: var(--yellow); color: var(--ink); }
.s-pen  { background: var(--yellow); color: var(--ink); }
.s-ns   { background: #fff;          color: var(--ink); }
.s-live { background: var(--pink);   color: var(--paper); animation: blink 1.4s infinite; }
.s-pst  { background: #ffb347;       color: var(--ink); }
.s-canc { background: var(--loss);   color: var(--paper); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ── Timeline section ── */
.timeline-section {
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--mint);
  background: var(--paper);
  overflow: hidden;
}

.tl-day-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--paper);
  background: var(--ink);
  padding: 6px 14px;
}

.tl-row {
  display: grid;
  grid-template-columns: 50px 1fr 90px 1fr;
  gap: 6px;
  padding: 8px 14px;
  align-items: center;
  border-bottom: 1px dashed rgba(26,26,46,0.2);
  font-size: 12px;
}
.tl-row:last-child { border-bottom: none; }
.tl-row:hover { background: rgba(255,210,63,0.25); }
.tl-row.tl-row-live { background: rgba(255,94,147,0.08); }

.tl-round {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-team {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tl-team.tl-away {
  flex-direction: row-reverse;
  text-align: right;
}
.tl-team img {
  width: 20px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}
.tl-team span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tl-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}
.tl-score .tl-sep {
  margin: 0 2px;
  color: var(--muted);
  font-weight: 400;
}
.tl-score.tl-live { color: var(--pink); }

.tl-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.tl-elapsed {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--pink);
}

.tl-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 5px;
  border: 1.5px solid var(--ink);
  white-space: nowrap;
}

.match-card.match-placeholder {
  opacity: 0.4;
  pointer-events: none;
  background: var(--surface2);
}
.match-card.match-placeholder.ko-placeholder { opacity: 0.75; }
.match-card.match-placeholder .team-name { color: var(--muted); }
.ko-placeholder .ko-slot {
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.ko-venue {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
  text-align: center;
}
.tbd-text {
  font-style: italic;
  color: var(--muted);
}

/* ── Knockout view ── */
.knockout-rounds {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.ko-round-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 16px;
  padding: 8px 14px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.ko-round-title::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  flex-shrink: 0;
}
.ko-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}
@media (max-width: 600px) {
  /* Header: compact */
  header {
    padding: 12px 14px;
    gap: 12px;
  }
  .wc-badge {
    width: 42px;
    height: 42px;
    font-size: 11px;
  }
  .header-title h1 {
    font-size: 20px;
    letter-spacing: -0.6px;
  }
  .header-title h1 em {
    padding: 0 5px;
    font-size: 18px;
  }
  .header-title p { display: none; }
  .header-stats { display: none; }

  /* Nav: let nav-right break to its own full-width row */
  .view-nav {
    padding: 10px 14px;
    gap: 6px;
    row-gap: 8px;
  }
  .nav-right {
    width: 100%;
    justify-content: flex-end;
  }

  /* Container */
  .container { padding: 16px 12px; }

  /* Groups */
  .groups-grid { gap: 14px; }
  .group-fixtures { padding: 8px 10px 10px; }

  /* Match card: tighter, allow team names to wrap */
  .match-card {
    grid-template-columns: 1fr 76px 1fr;
    padding: 9px 10px;
    gap: 6px;
  }
  .team-name {
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
  }
  /* Match time: allow wrapping so "SUN 17 MAY, 13:30" doesn't overflow */
  .match-time {
    white-space: normal;
    font-size: 9.5px;
    letter-spacing: 0;
    line-height: 1.4;
    word-break: break-word;
  }
  .score-num { font-size: 22px; min-width: 18px; }
  .match-card.full .score-num { font-size: 26px; min-width: 22px; }
  .match-card.full .team-name { font-size: 13px; }

  .match-odds { font-size: 9.5px; }
  .odds-val { font-size: 11px; }

  /* KO */
  .ko-matches-grid { grid-template-columns: 1fr; }
  .ko-round-title { font-size: 16px; }

  /* Timeline */
  .tl-row {
    grid-template-columns: 36px 1fr 76px 1fr;
    padding: 7px 10px;
    gap: 4px;
  }
  .tl-round { font-size: 8px; }
  .tl-team span { font-size: 11px; }
  .tl-score { font-size: 13px; }
}

/* ── Loading / Error ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  gap: 16px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--ink);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p {
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.error-box {
  background: var(--paper);
  border: 3px solid var(--loss);
  box-shadow: 5px 5px 0 var(--loss);
  border-radius: 0;
  padding: 24px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-display);
  font-weight: 700;
}

.empty-state {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  border-radius: 0;
  padding: 24px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-display);
  font-weight: 700;
}

/* ── Live / next highlight ── */
.match-card.match-live {
  box-shadow: 4px 4px 0 var(--pink);
}
.match-card.match-live .match-status { background: var(--yellow); color: var(--ink); }

.match-card.match-next {
  background: var(--mint);
}

/* ── Match events (scorers / cards) ── */
.match-events-body {
  grid-column: 1 / -1;
  display: none;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 2px dashed var(--ink);
}
.match-card.events-expanded .match-events-body {
  display: block;
}
.match-events-body > .match-events-timeline:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.show-lineups-btn {
  display: block;
  margin: 10px auto 0;
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.show-lineups-btn:hover { opacity: 1; }
.match-events-timeline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 2px dashed var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.evt-tl-home,
.evt-tl-away {
  padding: 2px 0;
  min-height: 1em;
}
.evt-tl-home {
  text-align: right;
  padding-right: 12px;
}
.evt-tl-away {
  text-align: left;
  padding-left: 12px;
  border-left: 2px dashed var(--ink);
}
.match-events-cards,
.match-events-subs {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(26, 26, 46, 0.4);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.match-events-subs { opacity: 0.78; }
.evt-sub-on { color: var(--blue); font-weight: 700; }

.match-events {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 2px dashed var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.match-events-home,
.match-events-away {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.match-events-home {
  align-items: flex-end;
  text-align: right;
}
.match-events-away {
  align-items: flex-start;
  text-align: left;
}
.match-evt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.5;
}
.evt-assist {
  font-size: 0.78em;
  opacity: 0.7;
}

/* ── Events: hug edges on mobile ── */
@media (max-width: 600px) {
  .match-evt {
    white-space: normal;
    word-break: break-word;
  }
  .match-events-timeline {
    gap: 2px 4px;
  }
  .evt-tl-home {
    text-align: left;
    padding-right: 2px;
  }
  .evt-tl-away {
    padding-left: 2px;
    border-left: none;
  }
}

/* ── Match odds (upcoming fixtures) ── */
.match-odds {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px 8px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 2px dashed var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.match-odds-header {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  margin-bottom: 2px;
  text-align: center;
}
.match-odds-home {
  text-align: right;
}
.match-odds-draw {
  text-align: center;
}
.match-odds-away {
  text-align: left;
}
.odds-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.odds-lbl {
  display: block;
  font-size: 9px;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}
.match-tv {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.match-tv .tv-label {
  display: inline-block;
  margin-right: 3px;
  padding: 1px 4px;
  background: var(--ink);
  color: #fff;
  font-size: 8px;
  letter-spacing: 1px;
}
.tl-time-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tl-tv {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  padding: 1px 5px;
  white-space: nowrap;
}
.tl-row-placeholder { opacity: 0.7; }
.tl-row-placeholder .tl-time-wrap {
  flex-direction: column;
  gap: 0;
}
.tl-slot {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-venue {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 88px;
}
.match-weather {
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
}
.match-weather:empty {
  display: none;
}
.match-tv .match-weather {
  margin-left: 9px;
}
.tl-weather {
  font-size: 10px;
  margin-left: 3px;
}

/* ── Nav right area ── */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── League toggle ── */
.league-toggle {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.ltoggle {
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s;
}
.ltoggle + .ltoggle { border-left: 2px solid var(--ink); }
.ltoggle:hover { background: var(--yellow); }
.ltoggle.active { background: var(--blue); color: var(--paper); }

/* ── Notification bell button ── */
.notif-btn {
  padding: 6px 10px;
  font-size: 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.notif-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.notif-btn.active { background: var(--mint); }
.notif-btn.denied { opacity: 0.4; cursor: not-allowed; }

/* ── Live polling indicator ── */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 5px 11px;
  box-shadow: 3px 3px 0 var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  animation: blink 1s infinite;
}

/* ── Matchday (Fixtures view) ── */
.matchday-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.matchday-block {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--mint);
}
.matchday-block:nth-child(2n) { box-shadow: 6px 6px 0 var(--pink); }
.matchday-block:nth-child(3n) { box-shadow: 6px 6px 0 var(--yellow); }
.matchday-block:nth-child(4n) { box-shadow: 6px 6px 0 var(--blue); }

.matchday-title {
  background: var(--yellow);
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.3px;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
}
.matchday-cards {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── PL Standings view ── */
.pl-standings-block {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 6px 6px 0 var(--blue);
}
.pl-standings-header {
  background: var(--pink);
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.pl-legend {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 2px dashed var(--ink);
  flex-wrap: wrap;
  background: rgba(26, 26, 46, 0.04);
}
.pl-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.pl-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
}
.pl-legend-dot.cl  { background: var(--mint); }
.pl-legend-dot.el  { background: var(--yellow); }
.pl-legend-dot.rel { background: var(--loss); }

/* ── Toast notifications ── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 12px 16px;
  min-width: 240px;
  max-width: 340px;
  box-shadow: 5px 5px 0 var(--ink);
  animation: toast-in 0.25s ease;
  pointer-events: auto;
}
.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}
.toast-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toast-body {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) rotate(-2deg); }
  to   { opacity: 1; transform: translateX(0) rotate(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 28px 16px 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  border-top: 3px dashed var(--ink);
  margin-top: 36px;
}
footer a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid var(--blue);
}
footer a:hover {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

/* ── Match detail panel (expanded) ── */
.match-card[data-fid] { cursor: pointer; }
.match-expand-bar {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1;
  user-select: none;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.2s;
  font-weight: 700;
}
.match-card[data-fid]:hover .match-expand-bar { opacity: 0.8; }
.match-card.events-expanded .match-expand-bar {
  opacity: 1;
  transform: rotate(180deg);
}

.match-detail-panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-top: none;
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--ink);
  font-family: var(--font-mono);
  animation: detail-in 0.18s ease;
  margin-top: -3px;
  margin-bottom: 4px;
}
@keyframes detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detail-loading {
  display: flex;
  justify-content: center;
  padding: 16px;
}
.detail-lineups {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.detail-lineup {
  flex: 1;
  min-width: 0;
}
.detail-lineup-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  text-align: center;
  margin-bottom: 6px;
  padding: 4px 6px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lineup-formation {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  text-align: center;
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 1px;
}
.lineup-player {
  font-family: var(--font-display);
  font-size: 12px;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
}
.lineup-player .player-num {
  font-family: var(--font-mono);
  color: var(--pink);
  font-size: 10px;
  margin-right: 4px;
  min-width: 16px;
  display: inline-block;
  text-align: right;
  font-weight: 700;
}
.lineup-player .player-pos {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  margin-left: 3px;
}
.lineup-subs {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink);
  border-top: 2px dashed var(--ink);
  padding-top: 6px;
  line-height: 1.55;
  opacity: 0.85;
}
.lineup-subs-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
  color: var(--blue);
}
.detail-no-lineup {
  text-align: center;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 12px 0;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.detail-stats {
  border-top: 2px dashed var(--ink);
  padding-top: 12px;
}
.detail-stats-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  text-align: center;
  margin-bottom: 10px;
}
.detail-stat-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.detail-stat-row .stat-label {
  text-align: center;
  font-size: 9px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.7;
}
.detail-stat-row .stat-val {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ink);
  font-size: 13px;
}
.detail-stat-row .stat-val.home { text-align: right; }
.detail-stat-row .stat-val.away { text-align: left; }
.stat-bar-wrap {
  height: 6px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}
.stat-bar-home {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--pink);
}
.stat-bar-away {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: var(--blue);
}
