/* ===========================
   WC 2026 — Design B
   Teenage Engineering inspired
   Monochrome + Orange
   =========================== */

/* --- FIFA WC2026 Font --- */
@font-face {
  font-family: 'FWC 2026';
  src: url("/assets/FWC2026-UltraCondensedBlack-6b6c8e3f.woff2") format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* The `hidden` attribute must always win, even on elements with a `display`
   rule (e.g. .btn sets display:inline-flex, which otherwise beats the UA
   [hidden] rule on equal specificity). !important so a single component
   display rule can't re-leak a hidden element (cf. the creator-only prize
   Edit button). */
[hidden] {
  display: none !important;
}

/* --- Custom Properties --- */
:root {
  --color-bg: #f0eded;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f6f5;
  --color-text: #1a1a1a;
  --color-text-secondary: #8a8785;
  --color-fancy-grey: #3e3e3e;
  --color-border: #d9d5d2;
  --color-border-light: #e8e5e2;
  /* --color-accent: #ff6b00; */
  --color-accent: #fc430b;
  /* --color-accent-hover: #e85e00; */
  --color-accent-hover: #e63a0a;
  --color-correct: #2d8a4e;
  --color-correct-bg: #edf7f0;
  --color-wrong: #c4342d;
  --color-wrong-bg: #fdf0ef;
  --color-dark-green: #02362c;
  --color-alt-green: #011f18;
  --color-banker-bg: #fff5eb;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'FWC 2026', 'Barlow Condensed', 'Montserrat', sans-serif;
  --transition: 180ms ease;
  --ls-tight: 0.5px;
  --ls-normal: 1px;
  --ls-wide: 2px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100dvh;
}

/* The app shell is the width-capped, full-height flex column that holds the nav and
   the page view. Keeping the max-width here (rather than on body) leaves body as a
   full-bleed canvas, so page backgrounds reach the viewport edges with no html showing
   through. */
.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 2000px;
  margin: 0 auto;
}

/* --- Flag images --- */
.flag {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.flag:first-child { margin-right: 4px; }
.flag:last-child { margin-left: 4px; }

.flag-placeholder {
  background: var(--color-border);
  border-radius: 2px;
}

/* --- Layout --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-fancy-grey);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
  /* transform: translateY(-1px); */
}

.btn-outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn-small {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-google {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 14px 28px;
  font-size: 15px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.btn-google:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* --- Focus styles --- */
.btn:focus-visible,
.nav-pill:focus-visible,
.leagues-chevron:focus-visible,
.carousel-prev:focus-visible,
.carousel-back:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.segment:has(input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.banker-toggle:has(input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Flash messages --- */
/* End-of-tournament reveal banner: a rounded pill centred in the navbar's free
   space (between the nav pills and the avatar) while standings are hidden. */
.nav-reveal-banner {
  margin: 0 auto;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  background: var(--color-correct-bg);
  color: var(--color-correct);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* On narrow screens the pill would crowd the logo/avatar; hide it there (the
   hidden boards themselves still make the state obvious). */
@media (max-width: 900px) {
  .nav-reveal-banner {
    display: none;
  }
}

/* ============================
   END-OF-TOURNAMENT RESULT MODAL
   The emotional payoff of a 6-week game: rank number + accolade are the heroes.
   Rendered inside the .predictions-dialog shell (max 540px). All colours come
   from tokens so it tracks any future dark theme automatically. A subtle
   one-shot entrance plays on open (disabled under prefers-reduced-motion via
   the global rule above).
   ============================ */
.final-result {
  padding: 32px 32px 28px;
  text-align: center;
  /* Fill the shell (which is already max 540px / calc(100% - 32px) on mobile),
     rather than capping tighter, so the layout breathes on larger screens. */
  animation: finalResultIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  /* Own the scroll: the dialog shell caps at 85dvh but the scroll lives on the
     .predictions-dialog-content wrapper this frame doesn't use, so cap + scroll
     here. Otherwise a player with several mini-leagues overflows the dialog and
     the Print Certificate button gets pushed out of view. */
  max-height: 85dvh;
  overflow-y: auto;
}

@keyframes finalResultIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.final-result-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-text);
  margin: 0 0 22px;
}

/* --- Hero: final position + points --- */
.final-result-headline {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
  padding: 8px 0 4px;
}

/* Soft radial halo behind the big rank number to make it feel like a spotlight. */
.final-result-headline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -58%);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--color-accent) 16%, transparent) 0%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

.final-result-headline > * {
  position: relative;
  z-index: 1;
}

.final-result-rank {
  font-family: var(--font-display);
  font-size: 84px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -1px;
  /* Warm accent gradient fill; solid accent is the fallback where
     background-clip:text is unsupported. */
  color: var(--color-accent);
  background: linear-gradient(160deg, var(--color-accent) 0%, var(--color-accent-hover) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.final-result-of {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-normal);
  color: var(--color-text-secondary);
}

.final-result-points {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
}

/* --- Section subtitles --- */
.final-result-subtitle {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-secondary);
  margin: 24px 0 10px;
  display: block;
}

/* --- Player-type accolade: the second hero. A tinted card. --- */
.final-result-accolade {
  margin: 0 auto 22px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-accent) 24%, transparent);
}

.final-result-accolade-title {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--color-accent);
}

.final-result-accolade-blurb {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

/* --- Stat tiles: three-up, equal, must stay clean at ~300px wide. --- */
.final-result-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.final-result-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px 6px;
  min-width: 0; /* let tiles shrink below content width without overflowing */
  border-radius: var(--radius);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
}

.final-result-tile-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
}

.final-result-tile-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-normal);
  color: var(--color-text-secondary);
  line-height: 1.2;
}

/* --- Rank journey graph: framed as a clean sparkline card with a baseline. --- */
.final-result-graph-wrap {
  position: relative;
  margin: 4px 0 0;
  padding: 14px 16px 12px;
  border-radius: var(--radius);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
}

.final-result-graph-wrap .final-result-subtitle {
  margin-top: 0;
}

.final-result-graph {
  width: 100%;
  height: 60px;
  display: block;
  /* Faint horizontal gridlines behind the accent line for a chart-like read. */
  background-image: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-border) 55%, transparent) 0,
    color-mix(in srgb, var(--color-border) 55%, transparent) 1px,
    transparent 1px,
    transparent 20px
  );
  border-bottom: 1px solid var(--color-border);
}

.final-result-graph-empty {
  font-size: 13px;
  color: var(--color-text-secondary);
  padding: 12px 0;
}

/* Supporting climb stats: one quiet, evenly-spaced caption row directly under
   the chart. Kept small and muted so the eye lands on the line graph first;
   the numbers annotate it rather than compete as a stacked list. */
.final-result-climb-stats {
  display: flex;
  justify-content: space-around;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-light);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.final-result-climb-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.final-result-climb-label {
  text-transform: uppercase;
  letter-spacing: var(--ls-normal);
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.final-result-climb-stat strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
}

/* The single most celebratory number in this section — the best jump — gets the
   accent so there's still one small pop of colour tied to the climb. */
.final-result-climb-stat:last-child strong {
  color: var(--color-accent);
}

/* --- Mini-leagues --- */
.final-result-league-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
}

.final-result-league-row:last-child {
  border-bottom: none;
}

.final-result-league-name {
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-result-league-pos {
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--color-accent);
}

/* --- Print flow: a plain-text trigger that swaps in place for a "Confirm your
   name" input. --- */
.final-result-print {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
}

/* Text-only button; default text colour, turns accent on hover. */
.final-result-print-trigger {
  display: inline-block;
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}

.final-result-print-trigger:hover,
.final-result-print-trigger:focus-visible {
  outline: none;
  color: var(--color-accent);
}

/* The name step replaces the whole summary: a centred panel with the input and
   Back / Confirm & Print actions. */
.final-result-name-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 24px 0;
  text-align: left;
}

.final-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.final-result-actions .btn {
  flex: 1;
}

.final-result-name-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-secondary);
}

.final-result-name-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.final-result-name-input::placeholder {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.final-result-name-input:hover {
  border-color: var(--color-text-secondary);
}

.final-result-name-input:focus,
.final-result-name-input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

/* Certificate is print-only; hide it on screen entirely. */
.certificate {
  display: none;
}

/* ============================
   PRINT: certificate only, A4 landscape
   The certificate is normally display:none; when printing we hide the whole app
   and show ONLY the certificate, laid out to fill one A4 landscape page.
   ============================ */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  /* Hide everything, then reveal just the certificate subtree. */
  body * {
    visibility: hidden;
  }

  .certificate,
  .certificate * {
    visibility: visible;
  }

  .certificate {
    display: block;
    position: fixed;
    inset: 0;
    width: 297mm;
    height: 210mm;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #1a1a1a;
    /* keep borders/fills when printing */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Ornamental double frame drawn with the page's own pseudo-elements: a bold
     outer gold rule and a fine inner hairline, the classic engraved-certificate
     look. Kept off the content box so text never collides with the border. */
  .certificate::before {
    content: "";
    position: absolute;
    inset: 8mm;
    border: 2.5pt solid #b8860b;
    pointer-events: none;
  }

  .certificate::after {
    content: "";
    position: absolute;
    inset: 10mm;
    border: 0.75pt solid #c9a94a;
    pointer-events: none;
  }

  .certificate-inner {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20mm 30mm 26mm;
  }

  .certificate-emblem {
    line-height: 0;
  }

  .certificate-emblem-svg {
    height: 26mm;
    width: auto;
    color: #1a1a1a;
  }

  .certificate-kicker {
    margin: 6mm 0 4mm;
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 10.5pt;
    font-weight: 600;
    color: #8a6d1f;
  }

  .certificate-heading {
    margin: 0;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    font-size: 42pt;
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #1a1a1a;
  }

  /* Gold flourish rule beneath the heading. */
  .certificate-heading::after {
    content: "";
    display: block;
    width: 44mm;
    height: 0;
    margin: 5mm auto 0;
    border-top: 1pt solid #b8860b;
    position: relative;
  }

  .certificate-presented {
    margin: 7mm 0 3mm;
    font-family: var(--font);
    font-size: 12pt;
    font-style: italic;
    color: #555;
  }

  /* Name (filled from the modal's field via JS before printing). */
  .certificate-name {
    margin: 0 auto;
    display: inline-block;
    text-align: center;
    color: #1a1a1a;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    font-size: 34pt;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1.25pt solid #b8860b;
    padding: 0 10mm 3mm;
  }

  .certificate-placement {
    margin: 7mm auto 0;
    font-family: var(--font);
    font-size: 13.5pt;
    line-height: 1.5;
    color: #333;
    /* Content area is 237mm wide (297 − 30mm padding each side); keep the cap
       below that but wide enough that the champion's long line
       ("...crowned the ultimate GOAT World Cup Champion.") stays on one line. */
    max-width: 220mm;
  }

  .certificate-placement strong {
    color: #1a1a1a;
  }

  .certificate-accolade {
    margin: 4mm 0 0;
    font-family: var(--font);
    font-size: 12pt;
    font-style: italic;
    color: #6b6b6b;
  }

  .certificate-accolade strong {
    margin-left: 2mm;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 12.5pt;
    color: #8a6d1f;
  }

  /* Footer pinned to the base of the frame, so the main block stays centred. */
  .certificate-footer {
    position: absolute;
    left: 30mm;
    right: 30mm;
    bottom: 18mm;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: var(--font);
    font-size: 9pt;
    color: #777;
  }

  /* Signature block: a handwritten name sitting on a rule, with the committee
     title beneath it (classic signed-and-titled certificate foot). */
  .certificate-signature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60mm;
  }

  .certificate-signature-img {
    display: block;
    height: 16mm;
    width: auto;
    max-width: 70mm;
    object-fit: contain;
    margin: 0 auto 1mm;
  }

  .certificate-sign {
    /* title label, under the signature's hairline rule */
    padding-top: 1.5mm;
    border-top: 0.75pt solid #999;
    width: 100%;
    text-align: center;
    color: #555;
  }

  .certificate-edition {
    text-align: right;
    max-width: 90mm;
  }

  /* ===== PODIUM (top 3): a richer, more ornate treatment per medal ===== */
  /* Heavier double frame; medal colour set per tier below. */
  .certificate-gold::before,
  .certificate-silver::before,
  .certificate-bronze::before {
    inset: 7mm;
    border-width: 3.5pt;
  }

  .certificate-gold::after,
  .certificate-silver::after,
  .certificate-bronze::after {
    inset: 9.5mm;
    border-width: 1pt;
  }

  /* Podium medal: a laurel-wreath award badge (inline SVG, see _medal partial)
     seated in the upper-right of the frame. The SVG is monochrome and drawn with
     currentColor, so the per-tier `color` below drives the whole badge. Sits in
     the top ~40mm — clear of the heading/name and the footer (bottom 18mm). */
  .certificate-medal {
    position: absolute;
    top: 14mm;
    right: 24mm;
    width: 26mm;
    height: 26mm;
    line-height: 0;
  }

  .certificate-medal-svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  /* --- Per-tier frame + medal colours --- */
  /* Gold — Champion */
  .certificate-gold::before { border-color: #b8860b; }
  .certificate-gold::after { border-color: #d4af37; }
  .certificate-gold .certificate-heading { color: #9a6f0f; }
  .certificate-gold .certificate-name { border-bottom-color: #d4af37; }
  .certificate-gold .certificate-medal { color: #c9a227; }

  /* Silver — Runner-Up */
  .certificate-silver::before { border-color: #8a8d91; }
  .certificate-silver::after { border-color: #b9bdc2; }
  .certificate-silver .certificate-heading { color: #6b6e72; }
  .certificate-silver .certificate-name { border-bottom-color: #b9bdc2; }
  .certificate-silver .certificate-medal { color: #9a9da1; }

  /* Bronze — Third Place */
  .certificate-bronze::before { border-color: #8c5a2b; }
  .certificate-bronze::after { border-color: #c07f43; }
  .certificate-bronze .certificate-heading { color: #7a4a22; }
  .certificate-bronze .certificate-name { border-bottom-color: #c07f43; }
  .certificate-bronze .certificate-medal { color: #b06e34; }
}

/* ============================
   WINNER STATE (rank #1)
   Turns up the celebration: brighter halo, animated glow on the rank, a
   gradient title. Hook added in the ERB via the pre-computed `won` variable.
   ============================ */
.final-result-winner .final-result-title {
  color: var(--color-text);
}

.final-result-winner .final-result-headline::before {
  width: 260px;
  height: 260px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--color-accent) 30%, transparent) 0%,
    transparent 66%
  );
  animation: finalResultGlow 3.2s ease-in-out infinite;
}

@keyframes finalResultGlow {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -58%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -58%) scale(1.06); }
}

.final-result-winner .final-result-rank {
  font-size: 92px;
}

/* The champion's accolade card gets a warmer fill to match the hero. */
.final-result-winner .final-result-accolade {
  background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.flash {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: flashIn 0.3s ease;
}

.flash-notice {
  background: var(--color-correct-bg);
  color: var(--color-correct);
  border: 1px solid var(--color-correct);
}

.flash-alert {
  background: var(--color-wrong-bg);
  color: var(--color-wrong);
  border: 1px solid var(--color-wrong);
}

@keyframes flashIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================
   NAV BAR
   ============================ */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 48px);
  flex-shrink: 0;
  position: relative;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  height: 44px;
  width: auto;
}

/* Logo doubles as the home link, top-left (modern convention). */
.nav-logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 8px;
  cursor: pointer;
  color: var(--color-fancy-grey); /* inline SVG logo inherits this via currentColor */
  transition: opacity var(--transition);
}

/* Inline SVG logo — height matches .nav-logo; width scales by viewBox ratio. */
.nav-logo-svg {
  height: 44px;
  width: auto;
  display: block;
}

.nav-logo-link:hover {
  opacity: 0.85;
}

.nav-logo-link-active {
  cursor: default;
}

.nav-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-alt);
}

.nav-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--color-dark-green);
  position: relative;
  overflow: hidden;
}

/* Photo overlays the initial-letter fallback; if it errors it is removed,
   revealing the letter beneath. */
.nav-avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.nav-avatar-clickable {
  cursor: pointer;
  transition: opacity var(--transition);
}

.nav-avatar-clickable:hover {
  opacity: 0.8;
}

/* Avatar dropdown (nickname + log out) on the far right of the nav bar. */
.nav-avatar-menu {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.nav-dropdown[hidden] {
  display: none;
}

/* button_to renders a <form>; collapse it so the inner button lays out flat. */
.nav-dropdown form {
  margin: 0;
  display: contents;
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition);
}

.nav-dropdown-item:hover {
  background: var(--color-surface-alt);
}

.nav-dropdown-item-logout {
  color: var(--color-accent);
}

/* Grouped sub-section within the dropdown (e.g. Mini league → create/join),
   set off with hairline dividers above and below. */
.nav-dropdown-section {
  display: flex;
  flex-direction: column;
  margin: 6px 0;
  padding: 6px 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-dropdown-label {
  padding: 4px 12px;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.nav-nickname-hint {
  font-family: var(--font);
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: -12px 0 4px;
  line-height: 1.4;
}

.nav-pills-desktop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-fancy-grey);
  border-radius: 1px;
}

/* On the coming-soon view the nav sits on a dark background, so the lines flip to
   the light bg colour to stay visible. */
.body-coming-soon .nav-hamburger-line {
  background: var(--color-bg);
}

.nav-mobile-menu {
  display: none;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  justify-content: space-between;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #ffffff;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.nav-pill:hover {
  color: var(--color-text-secondary);
}

/* "SUMMARY" nav button (post-reveal): same pill chrome as .nav-pill, but with
   accent-coloured text. */
.nav-pill-result {
  color: var(--color-accent);
}

.nav-pill-accent {
  background: linear-gradient(164deg, #ff8c3a, var(--color-accent) 50%);
  border-color: #ff8c3a;
  color: #ffffff;
}

.nav-pill-accent:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.nav-pill-active {
  border-color: var(--color-dark-green);
  background: var(--color-dark-green);
  color: #fff;
}

.nav-pill-accent.nav-pill-active {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* Mini-leagues toggle pill: accent orange in "MINI LEAGUES" state, flips to
   dark-green in the "LEADERBOARD" (back) state so the two read distinctly. */
.nav-pill-leagues {
  background: linear-gradient(164deg, #ff8c3a, var(--color-accent) 50%);
  border-color: #ff8c3a;
  color: #ffffff;
  /* Background is a gradient and can't smoothly transition to the solid hover/
     active states — animating it causes a flicker. Only transition the
     properties that can animate. */
  transition: border-color var(--transition), filter var(--transition);
}

.nav-pill-leagues:hover {
  filter: brightness(1.08);
  border-color: var(--color-accent);
  color: #ffffff;
}

.nav-pill-leagues.is-leagues {
  background: var(--color-dark-green);
  border-color: var(--color-dark-green);
  color: #ffffff;
}

.nav-pill-leagues.is-leagues:hover {
  background: var(--color-dark-green);
  border-color: var(--color-dark-green);
  filter: brightness(1.2);
}

.nav-pill-small {
  padding: 4px 12px;
  font-size: 10px;
}

/* ============================
   CAROUSEL
   ============================ */

.carousel {
  position: relative;
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  padding: 0 clamp(16px, 4vw, 48px) clamp(12px, 2vw, 24px);
}

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  container-type: inline-size;
}

.carousel-track {
  --card-gap: 16px;
  display: flex;
  gap: var(--card-gap);
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-track.carousel-pos-1 {
  transform: translateX(calc(-50cqi - var(--card-gap) / 2));
}

.carousel-track.carousel-pos-1.carousel-pos-2 {
  transform: translateX(calc(-100cqi - var(--card-gap)));
}

.carousel-card {
  flex: 0 0 calc(50cqi - var(--card-gap) / 2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  transition: flex-basis 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Narrow desktop (e.g. a half-screen / snapped window): too wide for the mobile
   vertical layout but too narrow for two cards side-by-side, so show ONE
   full-width card and flip through them with the arrows. Cards become 100cqi and
   each position shifts by a whole card width (overriding the 50cqi 2-up shifts).
   The carousel position then maps 1:1 to a card index (0 info, 1 leaderboard,
   2 fixtures) — same as mobile — so the info-card uses the mobile button set.
   NB: placed AFTER the base .carousel-card / .carousel-pos rules so it wins on
   equal specificity (media queries don't add specificity). */
@media (min-width: 768px) and (max-width: 999px) {
  .carousel-card {
    flex: 0 0 100cqi;
  }

  .carousel-track.carousel-pos-1 {
    transform: translateX(calc(-100cqi - var(--card-gap)));
  }

  .carousel-track.carousel-pos-1.carousel-pos-2 {
    transform: translateX(calc(-200cqi - 2 * var(--card-gap)));
  }

  /* Surface the next arrow here (it's display:none elsewhere). The .carousel
     ancestor lifts this to specificity 0,2,0 so it beats the base
     `.carousel-next { display:none }` (0,1,0) that appears LATER in the source
     (media queries don't add specificity). The controller still sets [hidden] at
     the last position, and the global [hidden] !important rule keeps it hidden
     there even though we set display:block. */
  .carousel .carousel-next {
    display: block;
  }

  /* One card per position = card index, like mobile: show LEADERBOARD (1) +
     FIXTURES (2); hide the Teams link and the desktop FIXTURES (window-pos 1).
     The .card-info-half ancestor lifts these to specificity 0,3,0 so the SHOW
     rules beat the default `.card-info-actions .card-info-btn-* { display:none }`
     (0,2,0) that appears LATER in the source — without it the buttons stay
     hidden in this range. */
  .card-info-half .card-info-actions .card-info-btn-teams,
  .card-info-half .card-info-actions .card-info-btn-fixtures-desktop {
    display: none;
  }

  .card-info-half .card-info-actions .card-info-btn-leaderboard,
  .card-info-half .card-info-actions .card-info-btn-fixtures-mobile {
    display: inline-block;
  }

  /* The card is now full-viewport-width, so width-based (cqi) sizing in the
     half-card roughly doubles vs 2-up. Halve the cqi coefficients so the title
     and countdown keep their intended size and the height cap (dvh) governs on
     short viewports — otherwise an oversized title pushes the buttons off.
     Selector carries .card-info too (0,2,1) so it beats the base half-card rule
     (0,1,1) that appears later in the source. */
  /* Let the title fill the zone (the buttons are flex-pinned to the card bottom,
     so a larger title eats the middle whitespace rather than pushing them off).
     The dvh term is just the overflow ceiling for genuinely short viewports;
     the cqi term does the everyday sizing. */
  .card-info.card-info-half .card-info-title {
    font-size: clamp(40px, min(20cqi, 30dvh), 140px);
  }

  .card-info.card-info-half .kickoff-value {
    font-size: clamp(24px, min(4cqi, 8dvh), 48px);
  }

  /* Schedule (/groups): the standalone group tables get cramped in this range
     too, so hide the secondary columns (GF:GA, GD, cards) up to 999px — same as
     the <=767px rule below. Position, team, P/W/D/L and points stay. */
  .group-table .group-col-g,
  .group-table .group-col-gd,
  .group-table .group-col-cards {
    display: none;
  }

  /* Drop long nation names to their short form before they'd wrap. */
  .group-team-name { display: none; }
  .group-team-short { display: inline; }
}

/* Wide screens: show all 3 carousel cards side-by-side instead of the 2-up
   sliding window. The .app-shell caps at 2000px, so at >= 2000px viewport each
   card is (2000 - 2x48 padding - 2x16 gap) / 3 ~ 624px, clearing our ~600px
   minimum. The carousel controller's isWide guard (same breakpoint) neutralises
   the slide/arrow/pill logic to match. */
@media (min-width: 2000px) {
  .carousel-card {
    flex: 1 1 0;
  }

  .carousel-track,
  .carousel-track.carousel-pos-1,
  .carousel-track.carousel-pos-1.carousel-pos-2 {
    transform: none;
  }

  .carousel-prev,
  .carousel-back {
    display: none;
  }

  /* All cards are on screen, so any carousel-jump button is a no-op. Hide all
     three jump buttons; only the TEAMS channel link remains. */
  .card-info-actions .card-info-btn-fixtures-desktop,
  .card-info-actions .card-info-btn-fixtures-mobile,
  .card-info-actions .card-info-btn-leaderboard {
    display: none;
  }
}

.card-info-half {
  user-select: none;
}

.card-info-half .card-info-content {
  justify-content: space-between;
  height: 100%;
}

.card-info-half .card-info-main {
  align-items: center;
  text-align: center;
}

.card-info-half .card-info-title {
  /* Scale with whichever is smaller: card-width (cqi) or viewport-height (dvh).
     cqi drives everyday sizing; the dvh term is the overflow ceiling that only
     bites on genuinely short viewports (the buttons are flex-pinned to the card
     bottom, so the title filling the middle whitespace is fine — it shouldn't be
     clamped small on a tall card). dvh is a sound height proxy without making
     the card a size container, which would change what cqi resolves against. */
  font-size: clamp(28px, min(26cqi, 30dvh), 124px);
  max-width: 5ch;
  word-spacing: 100vw;
}

/* The fixed vertical paddings are the main height hogs on a short card; tie them
   to viewport height so they collapse before content gets clipped. */
.card-info-half.card-info {
  padding-top: clamp(12px, 3dvh, 48px);
  padding-bottom: clamp(12px, 3dvh, 48px);
}

.card-info-half .card-info-main {
  padding: clamp(8px, 5dvh, 80px) 0;
  min-height: 0;
}

.card-info-half .kickoff-value {
  font-size: clamp(20px, min(5cqi, 9dvh), 44px);
}

.card-info-half .card-info-date,
.card-info-half .card-info-hosts,
.card-info-half .card-info-cities,
.card-info-half .card-info-goat {
  display: none;
}

.card-info-half .card-info-actions {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 280px;
}

.card-info-half .card-info-actions .card-info-btn {
  padding: clamp(10px, 1.5cqi, 14px) clamp(16px, 4cqi, 24px);
  font-size: clamp(13px, 2.2cqi, 16px);
  width: 100%;
  text-align: center;
}

.card-info-half .kickoff-countdown {
  gap: clamp(8px, 2cqi, 16px);
}

.card-info-half .kickoff-value {
  font-size: clamp(24px, 5cqi, 40px);
}

.card-info-half .kickoff-label {
  font-size: clamp(9px, 1cqi, 11px);
}

.card-info-half .kickoff-next-match {
  font-size: clamp(9px, 1.2cqi, 12px);
}

.carousel-card-header {
  padding: 24px 24px 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.carousel-card-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-dark-green);
  line-height: 1;
}


.carousel-card-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
  min-height: 0;
}

.carousel-card-scroll[data-leaderboard-target="scroll"] {
  padding: 0;
}

/* ============================
   LEADERBOARD DRILL-IN (card 2)
   ============================ */
/* The card header holds one visible row at a time (global vs league mode);
   each row spans the full header width. */
.lb-drill-headrow:not([hidden]) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.lb-drill-headrow .carousel-card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* League mode header: league name + revolving chevron, clustered on the left
   so the code chip can sit at the far right. */
.lb-drill-league {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lb-switcher-arrow {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
}

.lb-switcher-arrow:hover {
  color: var(--color-text);
}

/* Each panel takes over the card's remaining space and lays out its own
   scroll region, just like the old single-leaderboard card did. */
.lb-switcher-panel:not([hidden]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Empty state when the player is in no leagues. */
.lb-drill-empty:not([hidden]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}

.lb-drill-empty-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--color-text);
}

.lb-drill-empty-sub {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
}

.lb-drill-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Back chevron (inside info card) */
.carousel-prev {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--transition);
}

/* Next (›) arrow: only surfaced in the 1-up layout (a single card with no other
   way forward). Hidden everywhere else — 2-up shows the next card alongside,
   3-up shows all, mobile scrolls. Mirrors .carousel-prev, pinned right. */
.carousel-next {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--transition);
}

.carousel-next:hover {
  color: var(--color-text);
}

.carousel-prev:hover {
  color: var(--color-text);
}

.carousel-back {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: opacity var(--transition);
}

.carousel-back:hover {
  color: #fff;
}

/* ============================
   CARD 1 — INFO (compact)
   ============================ */

.card-info {
  position: relative;
  overflow: hidden;
  justify-content: center;
  padding: clamp(20px, 4cqi, 48px) clamp(16px, 3cqi, 24px);
  background-color: var(--color-dark-green);
  background-image: url('https://cdn.prod.website-files.com/689fd0a66c26ce8fe1446c25/695e1d07ef9f21833f9ca4b7_home-mx-bg-element.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
}

.card-info-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 120ms ease;
}

.card-info-content.is-fading {
  opacity: 0;
}

.card-info-header {
  text-align: center;
}

.card-info-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
}

.card-info-badge {
  font-size: clamp(10px, 1.2cqi, 13px);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.card-info-goat {
  height: clamp(40px, 8cqi, 100px);
  width: auto;
  margin: clamp(8px, 2cqi, 24px) 0;
  opacity: 0.4;
}

.card-info-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 14cqi, 160px);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -2px;
  color: #62857e;
  margin-bottom: clamp(12px, 2cqi, 24px);
  text-align: center;
}

.card-info-subtitle {
  color: var(--color-accent);
}

.card-info-hosts {
  display: flex;
  gap: 8px;
  margin-bottom: clamp(12px, 2cqi, 24px);
  flex-wrap: wrap;
}

.card-info-hosts span {
  font-size: clamp(10px, 1.2cqi, 13px);
  font-weight: 700;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.card-info-cities {
  max-width: 100%;
  transition: max-width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-info-cities p {
  font-size: clamp(10px, 1.2cqi, 13px);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  line-height: 1.8;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.card-info-date {
  margin-bottom: 16px;
  font-size: clamp(11px, 1.4cqi, 14px);
  font-weight: 700;
  letter-spacing: var(--ls-normal);
  color: var(--color-accent);
  text-transform: uppercase;
}

.card-info-blob {
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,0,0.12), transparent 70%);
  pointer-events: none;
}

/* --- Info Card Action Buttons --- */
.card-info-actions {
  display: flex;
  gap: clamp(8px, 1.5cqi, 16px);
  justify-content: center;
  padding-top: clamp(8px, 1.5cqi, 16px);
  position: relative;
  z-index: 1;
}

/* Per-breakpoint button visibility. DEFAULT = laptop (2-up sliding window):
   TEAMS + the desktop FIXTURES jump (window position 1). The mobile-only and
   leaderboard buttons are hidden here and switched on in the media queries below
   (mobile) / ultra-wide query (which hides the jump).
   Scoped under .card-info-actions (specificity 0,2,0) so these beat the
   `.card-info-half .card-info-actions .card-info-btn` sizing rule and the base
   `.card-info-btn { display: inline-block }`. */
.card-info-actions .card-info-btn-leaderboard,
.card-info-actions .card-info-btn-fixtures-mobile {
  display: none;
}

.card-info-btn {
  /* Used on both <button> and <a> (e.g. the Teams channel link), so set the
     inline-block + no-underline bits an anchor needs. */
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(14px, 2cqi, 20px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: clamp(10px, 1.5cqi, 16px) clamp(20px, 5cqi, 48px);
  border-radius: 999px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  border: 2px solid transparent;
}

.card-info-btn:active {
  transform: scale(0.97);
}

/* Coming-soon action buttons sit alone (not in a half-card grid), so give them a
   comfortable minimum width. Scoped to the coming-soon view so the shared info-card
   buttons elsewhere keep sizing to their content. */
.coming-soon-view .card-info-btn {
  min-width: 180px;
  text-align: center;
}

.card-info-btn-filled {
  background: #fff;
  color: var(--color-dark-green);
  border-color: #fff;
  border-top-left-radius: 0;
}

/* Teams button: icon + label on one centred row. The icon inherits the button
   text colour (currentColor in the SVG). */
.card-info-btn-teams {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.card-info-btn-icon {
  height: 1.2em;
  width: auto;
  flex-shrink: 0;
  transform: translateY(-2px);
}

.card-info-btn-filled:hover {
  opacity: 0.9;
}

.card-info-btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  border-bottom-right-radius: 0;
}

.card-info-btn-outline:hover {
  border-color: #fff;
}

/* --- Kickoff Countdown --- */
.kickoff-next-match {
  font-size: clamp(11px, 1.4cqi, 14px);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 12px;
}

.kickoff-countdown {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3cqi, 32px);
  position: relative;
  z-index: 1;
}

.kickoff-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.kickoff-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 6cqi, 56px);
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
}

.kickoff-label {
  font-family: var(--font);
  font-size: clamp(10px, 1.2cqi, 13px);
  font-weight: 600;
  letter-spacing: var(--ls-tight);
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* ============================
   CARD 2 — LEADERBOARD ROWS
   ============================ */

.lb-rows {
  display: flex;
  flex-direction: column;
}

.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: end;
  gap: 12px;
  padding: 14px 24px 14px 12px;
  border-bottom: 1px solid var(--color-border-light);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.lb-row-1st {
  font-size: 150%;
}

.lb-row-2nd,
.lb-row-3rd {
  font-size: 120%;
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-row-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 2px 2px 0;
}

.lb-row-1st .lb-row-bar { background: var(--color-accent); }
.lb-row-2nd .lb-row-bar { background: var(--color-correct); }
.lb-row-3rd .lb-row-bar { background: var(--color-dark-green); }

.lb-row-me {
  background: rgba(255, 107, 0, 0.04);
}
.lb-row-me .lb-row-name {
  color: var(--color-accent);
}

.lb-row-rank {
  font-weight: 800;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: center;
  align-self: center;
}

.lb-row-rank-top {
  color: var(--color-text);
}

.lb-row-name {
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-self: center;
}

/* Hidden leaderboard: the cell holds a random X/o decoy (generated server-side,
   NOT the real value), blurred so it reads as redacted. Purely cosmetic — there
   is no real data behind it to reveal by removing the blur. */
.lb-blur {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.lb-row-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  min-width: 48px;
}

/* Toggle views: every stat view is always laid out (stacked in the same grid
   cell); an `lb-variant-<name>` class on the .lb-rows container picks which is
   shown. Hidden ones keep their space via visibility so rows don't jump.
   Variants: correct (default) | rounds | movement (global board only).
   Default-hide the non-default cells, then reveal the active one. */
.lb-rows .lb-row-stat-alt,
.lb-rows .lb-row-stat-movement {
  visibility: hidden;
}

/* rounds active */
.lb-rows.lb-variant-rounds .lb-row-stat-default { visibility: hidden; }
.lb-rows.lb-variant-rounds .lb-row-stat-alt { visibility: visible; }

/* movement active */
.lb-rows.lb-variant-movement .lb-row-stat-default { visibility: hidden; }
.lb-rows.lb-variant-movement .lb-row-stat-movement { visibility: visible; }

.lb-row-stat-value {
  font-weight: 400;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lb-row-stat-points .lb-row-stat-value {
  font-weight: 800;
  font-size: 24px;
}

.lb-row-stat-label {
  font-size: 8px;
  /* font-weight: 600; */
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  line-height: 1;
}

.lb-row-points-top {
  color: var(--color-accent);
}
/* Toggle cell — stacks both views in same space */
.lb-row-toggle-cell {
  display: grid;
  align-items: end;
  align-self: end;
}

.lb-row-toggle-cell > * {
  grid-area: 1 / 1;
}

/* Block-by-block points (alt view) */
.lb-row-blocks {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Movement view: arrow + places moved since the last round. */
.lb-row-movement {
  display: flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.lb-row-movement-up { color: var(--color-correct); }
.lb-row-movement-down { color: var(--color-wrong); }
.lb-row-movement-none { 
  color: var(--color-text-secondary);
  margin-right: 4px;
}

.lb-row-movement-arrow {
  line-height: 1;
}

.lb-block-pt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
}

.lb-block-pos { background: var(--color-correct); }
.lb-block-neg { background: var(--color-wrong); }
.lb-block-zero { background: var(--color-text-secondary); }

/* Perfect round: every pick correct AND the GOAT landed (chip hit the block's max).
   A brighter green with a subtle ring so it pops against the standard positive chip. */
.lb-block-max {
  background: #1fbf5a;
  box-shadow: 0 0 0 1.5px rgba(31, 191, 90, 0.35);
}

.lb-row-pinned {
  /* margin-top: 8px; */
  padding-top: 14px;
}

.lb-row-pinned .lb-row-name {
  color: var(--color-accent);
}

.lb-load-more {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: none;
  /* border: 1px solid var(--color-border); */
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.lb-load-more:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

/* ============================
   CARD 3 — SCORECARD
   ============================ */

/* --- Green Summary Header (results state) --- */
.scorecard-header {
  background: var(--color-dark-green);
  color: #fff;
  padding: 14px 16px;
  flex-shrink: 0;
}

.scorecard-header-date {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  line-height: 1.1;
}

.scorecard-header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}

.scorecard-goat {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

/* --- Two-half layout --- */
.scorecard-halves {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.scorecard-half {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.scorecard-half + .scorecard-half {
  border-top: 1px solid var(--color-border);
}

.scorecard-half-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 0;
  flex-shrink: 0;
}

.scorecard-divider-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.scorecard-half-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.scorecard-half-empty {
  color: var(--color-text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

/* --- Scroll area (upcoming-only state) --- */
.scorecard-scroll {
  padding: 12px 16px 16px;
}

/* --- Empty state --- */
.scorecard-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 48px 24px;
}

/* --- Footer action bar --- */
.scorecard-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-top: 1px solid var(--color-border-light);
  gap: 12px;
}

.scorecard-footer-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-accent);
  padding: 0;
}

.scorecard-footer-btn:hover {
  color: var(--color-accent-hover);
}

/* --- Scorecard Card (shared component) --- */
.sc-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Fill the flex parent (.carousel-card). flex:1 works whether the card's size
     comes from height (desktop) or min-height (mobile = 100dvh per section), so the
     footer always sits at the bottom of the screen. height:100% alone collapses
     against a parent that only has min-height. */
  flex: 1;
  min-height: 0;
  height: 100%;
}

.carousel-card .sc-card {
  background: none;
  border: none;
  border-radius: 0;
}

.sc-card-header {
  padding: 24px 24px 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.sc-card-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-dark-green);
  line-height: 1;
}

.sc-card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sc-card-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  overflow-y: auto;
  container-type: inline-size;
}

.sc-card-section + .sc-card-section {
  border-top: 1px solid var(--color-border-light);
}

.sc-card-section .sc-grid {
  flex: 1;
  grid-template-rows: 1fr 1fr;
  align-content: space-evenly;
}

/* Variant 2: Compact 3-col (5+ tiles) */
.sc-card-section .sc-grid:has(> :nth-child(5)) {
  grid-template-columns: repeat(3, 1fr);
}

.sc-card-section .sc-grid:has(> :nth-child(5)) > .sc-tile {
  padding: 20px 12px;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-teams {
  padding: 4px 0;
  /* gap: 4px; */
  color: 24px;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-team {
  font-size: 12px;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-team .flag {
  width: 20px;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-score {
  font-size: 20px;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-time {
  display: none;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-vs {
  display: block;
}

.sc-card-section .sc-grid:has(> :nth-child(5)) .sc-tile-footer {
  font-size: 11px;
}

/* Variant 3: Expanded single-column */
.sc-card-section.sc-card-section-expanded .sc-grid {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  align-content: start;
  gap: 8px;
}

.sc-card-section-expanded .sc-tile {
  flex-direction: row;
  align-items: center;
  max-height: none;
  padding: 20px 12px; 
  gap: 12px;
}

.sc-card-section-expanded .sc-tile-teams {
  flex: none;
  width: 70%;
  padding: 0;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.sc-card-section-expanded .sc-tile-team {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  gap: 8px;
  font-size: 14px;
}

.sc-card-section-expanded .sc-tile-center {
  flex-shrink: 0;
  min-width: 64px;
  text-align: center;
}

.sc-card-section-expanded .sc-tile-team:first-child {
  flex-direction: row-reverse;
  text-align: right;
}

.sc-card-section-expanded .sc-tile-team:last-child {
  text-align: left;
}

.sc-card-section-expanded .sc-tile-team-name {
  display: none;
}

.sc-card-section-expanded .sc-tile-team-full {
  display: block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.sc-card-section-expanded .sc-tile-time {
  display: inline;
  font-size: 18px;
  font-weight: 700;
}

.sc-card-section-expanded .sc-tile-score {
  font-size: 20px;
}

.sc-card-section-expanded .sc-tile-vs {
  display: none;
}

.sc-card-section-expanded .sc-tile-stage {
  display: block;
}

.sc-card-section-expanded .sc-tile-footer {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.sc-card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sc-card-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.sc-card-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
}

.sc-card-expand-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-alt);
}

.sc-card-collapse-icon {
  display: none;
}

.sc-card-section-expanded .sc-card-expand-icon {
  display: none;
}

.sc-card-section-expanded .sc-card-collapse-icon {
  display: inline;
}

/* Collapsed section */
.sc-card-section-collapsed {
  flex: 0 0 auto;
  overflow: hidden;
  padding-top: 8px;
  padding-bottom: 8px;
}

.sc-card-section-collapsed .sc-grid {
  display: none;
}

/* Expanded section takes all remaining space */
.sc-card-section-expanded {
  flex: 1;
  overflow-y: auto;
}

.sc-card-empty {
  color: var(--color-text-secondary);
  font-size: 14px;
  text-align: center;
  padding: 48px 0;
}

.sc-card-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  gap: 12px;
}

.sc-card-footer-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-text);
  padding: 0;
}

.sc-card-footer-btn:hover {
  color: var(--color-accent);
}

.sc-card-footer-btn:disabled {
  color: var(--color-text-secondary);
  opacity: 0.5;
  cursor: default;
}

.sc-card-footer-btn:disabled:hover {
  color: var(--color-text-secondary);
}

.sc-card-footer-btn-accent {
  color: var(--color-accent);
}

@keyframes pulse {
  0%, 100% { transform: rotate(0deg);  }
  50% { transform: rotate(2deg); }
}

.sc-card:has(.sc-card-section:hover) .sc-card-footer-btn-accent {
  animation: pulse 1.5s ease-in-out infinite;
}

/* --- Tile Grid --- */
.sc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  height: 100%;
}

/* --- Scorecard Tile --- */
.sc-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 0;
  min-width: 0;
  max-height: 144px;
  overflow: hidden;
  background: var(--color-surface);
  position: relative;
}

/* ---- Pick-aid info popover ---- */
/* The "i" trigger is centered on the tile's left edge. It's absolutely
   positioned so it doesn't reflow the teams row, but a tile that HAS the trigger
   reserves a left lane (via :has) so the button never overlaps the home team's
   flag/name. Scored tiles have no trigger and keep their normal padding. */
/* The info trigger is a hover-only overlay; absolutely positioned so it reserves
   no layout space (every tile keeps identical padding and rows stay aligned).
   Sits on the left, vertically aligned with the team-name row. */
.sc-tile-info {
  position: absolute;
  top: calc(42%);
  left: 6px;
  z-index: 2;
}

/* Hidden by default; revealed only when THIS tile is hovered (or the button is
   keyboard-focused, so it stays reachable). Opacity (not display) so it can
   fade and still be focusable. */
.sc-tile-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}

.sc-tile:hover .sc-tile-info-btn,
.sc-tile-info-btn:focus-visible {
  opacity: 1;
}

.sc-tile-info-btn:hover {
  color: var(--color-accent);
}

/* The panel is position:fixed and JS-placed, so the tile's overflow:hidden /
   max-height can't clip it. Width is capped to stay readable on small screens. */
.sc-info-popover {
  position: fixed;
  z-index: 1000;
  width: min(280px, calc(100vw - 16px));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12px;
  /* allow normal text flow / wrapping inside, unlike the tile */
  white-space: normal;
}

/* Comparison header: the two teams stated once (name + FIFA rank), establishing
   the left=home / right=away columns that the form section aligns under. The
   right-hand row label is positioned absolutely so it doesn't disturb the
   two-column grid. */
.sc-info-compare,
.sc-info-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  padding-top: 12px; /* room for the small row label */
}

.sc-info-compare-label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.sc-info-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px;
  background: var(--color-surface-alt);
  border-radius: 8px;
  min-width: 0;
}

.sc-info-col-name { font-weight: 600; text-align: center; }
.sc-info-col-rank { font-size: 16px; font-weight: 800; color: var(--color-accent); }

.sc-info-form-team {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0; /* let long team names / scores ellipsize rather than overflow */
}

.sc-info-form-name { font-weight: 600; }
.sc-info-form-empty { color: var(--color-text-secondary); font-style: italic; }

/* Within a team's column the results stack vertically (most recent flow). */
.sc-info-form-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sc-info-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--color-surface-alt);
  font-size: 10px;
  white-space: nowrap; /* keep badge + score + opponent on one line */
  font-weight: 600;
}

.sc-info-result-badge {
  font-weight: 800;
  width: 12px;
  text-align: center;
}

.sc-info-result-w .sc-info-result-badge { color: var(--color-correct); }
.sc-info-result-l .sc-info-result-badge { color: var(--color-wrong); }
.sc-info-result-d .sc-info-result-badge { color: var(--color-text-secondary); }

.sc-info-result-score { 
  color: var(--color-text);
  font-variant-numeric: tabular-nums; 
}
.sc-info-result-opp { color: var(--color-text-secondary); }

.sc-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.sc-info-table th {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: center;
  padding: 2px 4px;
}

/* The group label header cell sits left, branding the table lightly. */
.sc-info-table th[colspan] { text-align: left; }

.sc-info-table td {
  text-align: center;
  padding: 3px 4px;
  font-variant-numeric: tabular-nums;
}

.sc-info-table-pos { color: var(--color-text-secondary); width: 14px; }
.sc-info-table-team { text-align: left !important; font-weight: 600; }
.sc-info-table-pts { font-weight: 800; color: var(--color-accent); }
.sc-info-table-here { background: var(--color-banker-bg); }

/* Mobile: the tile is too small for the trigger, and the popover is cramped.
   Hide the trigger entirely below the 1-up breakpoint. */
@media (max-width: 767px) {
  .sc-tile-info { display: none; }
}

/* Teams: flags on each side of the score, names below flags */
.sc-tile-teams {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  /* gap: 8px; */
  column-gap: 24px;
  flex: 1;
  padding: 16px 0;
}

.sc-tile-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
}

.sc-tile-team .flag {
  width: 32px;
  height: auto;
}

.sc-tile-team-name {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sc-tile-team-full {
  display: none;
  text-align: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  line-height: 1.2;
  font-size: 15px;
}

.sc-tile-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.sc-tile-stage {
  display: block;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  width: 100%;
  text-align: center;
}

.sc-tile-venue {
  /* Hidden by default (the /simple scorecard doesn't show venue); the merged
     fixtures card opts back in via .card-fixtures .sc-tile-venue. */
  display: none;
  font-size: 9px;
  line-height: 1.1;
  color: var(--color-text-secondary);
  opacity: 0.75;
  text-align: center;
  margin-bottom: 2px;
}

.sc-tile-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1;
}

/* Extra-time / penalty detail beneath the big full-time score, e.g. "(1–1) pen
   5–4". Small and muted so the headline score stays dominant. */
.sc-tile-score-detail {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 1px;
  white-space: nowrap;
}

.sc-tile-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.sc-tile-vs {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

/* Footer: pick left, points right */
.sc-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border-light);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.sc-tile-pick {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-tile-pick-icon {
  font-weight: 900;
}

.sc-tile-pick-correct {
  color: var(--color-correct);
}

.sc-tile-pick-wrong {
  color: var(--color-wrong);
}

.sc-tile-pick-empty {
  color: var(--color-text-secondary);
  font-style: italic;
  font-size: 11px;
}

.sc-tile-pick-short {
  display: none;
}

/* "Your pick" caption above the picked team, styled like the venue caption
   (small, muted) — replaces the unclear 🤞 emoji for pending picks. */
.sc-tile-pick-label {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  color: var(--color-text-secondary);
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  margin-bottom: 1px;
}

.sc-tile-pick strong {
  color: var(--color-text);
  font-weight: 700;
}

.sc-tile-pick em {
  font-style: italic;
}

.sc-tile-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sc-tile-goat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  white-space: nowrap;
}

.sc-tile-goat-badge img {
  width: 14px;
  height: 14px;
}

.sc-tile-points {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  line-height: 1;
}

.sc-tile-points-pos { color: var(--color-correct); }
.sc-tile-points-neg { color: var(--color-wrong); }
.sc-tile-points-zero { color: var(--color-text-secondary); }

/* --- Tile state treatments --- */
.sc-tile-correct {
  background: var(--color-correct-bg);
  border-color: rgba(45, 138, 78, 0.2);
}

.sc-tile-banker-correct {
  background: var(--color-correct-bg);
  border-color: rgba(45, 138, 78, 0.2);
}

.sc-tile-wrong {
  background: var(--color-wrong-bg);
  border-color: rgba(196, 52, 45, 0.15);
}

.sc-tile-banker-wrong {
  background: var(--color-wrong-bg);
  border-color: rgba(196, 52, 45, 0.15);
}

.sc-tile-missed {
  opacity: 0.5;
}

.sc-tile-banker {
  /* background: var(--color-banker-bg); */
  /* border-color: rgba(255, 107, 0, 0.15); */
}

/* --- Shared banker-goat styles (used in predictions form & reveal) --- */
.banker-goat {
  transition: filter var(--transition), transform var(--transition);
  filter: grayscale(1) opacity(0.35);
}

.banker-goat-active {
  filter: none;
}

.banker-goat-inline {
  vertical-align: text-bottom;
  margin-left: 4px;
}

.no-matches {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* ============================
   MAIN VIEW (dashboard)
   ============================ */

.main-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

/* ============================
   COMING SOON (pre-launch gate) — reuses card-info styling
   ============================ */

/* The card-info background extends across the whole body in this view. */
body.body-coming-soon {
  background-color: var(--color-dark-green);
  background-image: url('https://cdn.prod.website-files.com/689fd0a66c26ce8fe1446c25/695e1d07ef9f21833f9ca4b7_home-mx-bg-element.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #fff;
}

/* Emblem uses the dark-green tone on coming-soon only (inline SVG = currentColor). */
body.body-coming-soon .nav-logo-link {
  color: var(--color-accent-hover); /* #011f18 */
}

.coming-soon-view {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-y: auto; /* safety: actions stay reachable if content can't fit */
  container-type: inline-size;
}

.coming-soon-card {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(20px, 4vw, 48px);
}

/* Coming-soon spacing is proportional to viewport height so the action button is
   never pushed out of view (the shared .card-info-main uses a fixed 5rem padding). */
.coming-soon-card .card-info-main {
  padding: clamp(1rem, 5vh, 4rem) 0;
  flex: 0 1 auto; /* don't greedily grow; let the action button keep its space */
}

.coming-soon-card .card-info-goat {
  margin: clamp(6px, 2vh, 24px) 0;
}

/* Title scales with width (cqi) but is also capped by height so a wide, short
   window can't blow it up past the viewport. */
.coming-soon-card .card-info-title {
  font-size: min(clamp(40px, 14cqi, 140px), 16vh);
  margin-bottom: clamp(8px, 1.5vh, 20px);
}

/* Welcome line at the top of the coming-soon card (replaces the old eyebrow label). */
.coming-soon-eyebrow {
  font-size: clamp(14px, 2cqi, 18px);
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 16px;
}


/* ============================
   LEAGUES VIEW
   ============================ */

.leagues-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}


.leagues-track {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.league-carousel-card {
  flex: 0 0 calc(50% - var(--card-gap) / 2);
}

.leagues-chevron {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: opacity var(--transition);
}

.leagues-chevron:hover {
  color: var(--color-text);
}

.leagues-chevron-left { left: 12px; }
.leagues-chevron-right { right: 12px; }

.league-card-code {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  /* color: var(--color-accent); */
  color: var(--color-text-secondary);
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  transition: opacity var(--transition);
}

.league-card-code:hover {
  opacity: 0.7;
  color: var(--color-accent);
}

/* Right-hand cluster in the league header: prize gift + code. */
.lb-drill-headmeta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-right: -5px;
}

.lb-prize-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--color-banker-bg);
  border: none;
  border-radius: 4px;
  color: var(--color-accent);
  cursor: pointer;
  transition: transform var(--transition);
}

.lb-prize-btn:hover {
  transform: scale(1.15);
}

.lb-prize-btn-empty {
  color: var(--color-border);
  background: var(--color-surface-alt);
}

.lb-prize-btn[hidden] {
  display: none;
}

.prize-dialog-text {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
  margin-bottom: 24px;
}

.prize-dialog-empty {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: 24px;
}

.prize-dialog-input {
  resize: vertical;
  min-height: 96px;
  white-space: pre-wrap;
}

/* ============================
   RULES VIEW
   ============================ */

.rules-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

.rules-card-wrap {
  flex: 1;
  padding: 0 48px 24px;
  overflow: hidden;
  display: flex;
  min-width: 0;
}

.card-rules {
  flex: 1;
}

.card-rules .carousel-card-scroll {
  overflow: hidden;
  overflow-y: auto;
}

.rules-content {
  columns: 2;
  column-gap: 48px;
}

.rules-section {
  margin-bottom: 32px;
  break-inside: avoid;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border-light);
}

.rules-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rules-section h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rules-section-number {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.rules-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 8px;
}

.rules-section p:last-child {
  margin-bottom: 0;
}

/* Leaderboard tiebreaker list. The global reset strips list defaults, so restore
   numbers + indent here. */
.rules-tiebreakers {
  list-style: decimal;
  padding-left: 24px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}

/* --- Points Strip (replaces table) --- */
.rules-points-strip {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

/* Inline UI examples shown within the rules text — static replicas of real
   components (same classes for identical styling, JS hooks stripped). */
.rules-example {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

/* The avatar dropdown is normally position:absolute + hidden; show it in-flow
   here. Reset z-index too — it's a static content illustration, not an overlay,
   so it must not stack above the (sticky) nav bar. */
.rules-dropdown-static {
  position: static;
  z-index: auto;
  display: flex;
  min-width: 180px;
}

/* Frame the mini-league header replica like a little card so it reads as a header
   sample rather than a full-width bar. */
.rules-example .lb-drill-headrow {
  flex: 0 1 auto;
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
}

/* Title in the replica shouldn't shrink to nothing. */
.rules-example .lb-drill-headrow .carousel-card-title {
  font-size: 22px;
}

.rules-points-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  transition: all var(--transition);
}

.rules-points-item-final {
  background: var(--color-text);
  border-color: var(--color-text);
}

.rules-points-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  color: var(--color-accent);
}

.rules-points-item-final .rules-points-value {
  color: var(--color-accent);
}

.rules-points-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  color: var(--color-text-secondary);
}

.rules-points-item-final .rules-points-label {
  color: rgba(255, 255, 255, 0.7);
}

/* --- Banker Section --- */
.rules-section-banker {
  background: var(--color-banker-bg);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-left: -4px;
  margin-right: -4px;
}

.rules-goat-icon {
  vertical-align: text-bottom;
  margin-left: 4px;
}

.rules-banker-outcomes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.rules-banker-outcome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
}

/* Title strong (direct child) sits on its own line above the description; only that
   one is block-level. A nested <strong> inside the description (e.g. the bolded "20"
   / "−10") must stay inline so the sentence doesn't break across lines. */
.rules-banker-outcome > div > strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.rules-banker-outcome span {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.rules-banker-outcome span strong {
  color: var(--color-text);
}

.rules-banker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}

.rules-banker-outcome-correct .rules-banker-icon {
  background: var(--color-correct-bg);
  color: var(--color-correct);
  border: 1px solid var(--color-correct);
}

.rules-banker-outcome-wrong .rules-banker-icon {
  background: var(--color-wrong-bg);
  color: var(--color-wrong);
  border: 1px solid var(--color-wrong);
}

.rules-note {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: 4px;
}

/* ============================
   LOGIN
   ============================ */

/* Full-screen brand hero — same dark-green + MX background treatment as the
   dashboard's .card-info card, so the front door matches the app it opens. */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  color: #fff;
  background-color: var(--color-dark-green);
  background-image: url('https://cdn.prod.website-files.com/689fd0a66c26ce8fe1446c25/695e1d07ef9f21833f9ca4b7_home-mx-bg-element.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-hero {
  text-align: center;
  padding: 48px 32px;
  max-width: 520px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-flags {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.hero-art {
  display: block;
  max-width: 280px;
  padding-right: 32px;
  height: auto;
  margin: 0 auto 16px;
  opacity: 0.85;
  filter: drop-shadow(0 12px 32px rgba(0,0,0,0.25));
  pointer-events: none;
}

.hero-flag {
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
}

.hero-flag:hover { transform: scale(1.1) rotate(-2deg); }
.hero-flag:nth-child(2) { transform: scale(1.1); }
.hero-flag:nth-child(2):hover { transform: scale(1.2) rotate(2deg); }

/* Headline — mirrors .card-info-title (display font, teal, tight tracking) */
.login-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 18vw, 120px);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -2px;
  text-transform: uppercase;
  color: #62857e;
  margin-bottom: 16px;
}

/* Date line — mirrors .card-info-date */
.login-date {
  font-size: clamp(11px, 1.4cqi, 14px);
  font-weight: 700;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 60px;
}

/* White CTA on green — mirrors .card-info-btn-filled */
.login-submit-btn {
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  background: #fff;
  color: var(--color-dark-green);
}

.login-submit-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.login-note {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.login-rules-link {
  display: inline-block;
  margin-top: 60px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition);
}

.login-rules-link:hover {
  color: #fff;
}

.login-rules-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ============================
   MESSAGES
   ============================ */

.msg {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
}

.msg-error {
  background: var(--color-wrong-bg);
  color: var(--color-wrong);
}

.msg-success {
  background: var(--color-correct-bg);
  color: var(--color-correct);
}

.msg-info {
  background: #fff5eb;
  color: var(--color-accent);
}

/* ============================
   PREDICTIONS
   ============================ */

.predictions-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.view-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-text);
}

.countdown {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
  letter-spacing: var(--ls-normal);
}

.countdown-expired {
  color: var(--color-wrong);
}

.prediction-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.prediction-card.prediction-banker {
  background: var(--color-banker-bg);
  border-color: var(--color-accent);
}

.prediction-kickoff {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  margin-bottom: 10px;
}

/* --- Segmented Control --- */
.segmented-control {
  display: flex;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}

.segment {
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
}

.segment + .segment {
  border-left: 1px solid var(--color-border);
}

.segment input[type='radio'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segment-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment:hover {
  background: rgba(2,54,44,0.05);
}

.segment.selected {
  background: var(--color-dark-green);
  color: white;
}

.segment.selected .segment-label {
  color: white;
}

.segment.selected .flag {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
}

.segment-draw .segment-label {
  font-size: 12px;
}

.segment:has(input:disabled) {
  cursor: default;
  opacity: 0.7;
}

.segment:has(input:disabled):hover {
  background: transparent;
}

.segment.selected:has(input:disabled) {
  background: var(--color-dark-green);
  opacity: 0.7;
}

/* --- Banker Toggle --- */
.banker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  margin-left: -10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-secondary);
  user-select: none;
}

.banker-toggle input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.banker-toggle:hover .banker-goat {
  transform: scale(1.15);
}

.banker-text {
  font-weight: 600;
}

.predictions-dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
}

.predictions-submit {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
}

/* ============================
   PREDICTIONS DIALOG
   ============================ */

.predictions-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--color-surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  max-width: 540px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  margin: auto;
  position: fixed;
  inset: 0;
  height: fit-content;
  overflow: hidden;
}

.predictions-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.predictions-dialog-content {
  padding: 28px 32px 32px;
  overflow-y: auto;
  max-height: 85dvh;
}

.predictions-dialog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.predictions-dialog-title,
.reveal-dialog-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
}

.reveal-dialog-title {
  margin-bottom: 12px;
}

.reveal-dialog-content {
  padding: 28px 32px 32px;
  overflow-y: auto;
  max-height: 85dvh;
}

.predictions-dialog-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-secondary);
}

.predictions-dialog-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
}

.predictions-dialog-check {
  font-size: 48px;
  color: var(--color-correct);
}

.predictions-dialog-message {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

/* ============================
   REVEAL
   ============================ */

.reveal-card {
  position: relative;
  overflow: hidden;
  border: 2px dashed var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  background: transparent;
}

.reveal-card-pending > * {
  opacity: 0;
}

.reveal-card-pending {
  animation: revealCardIn 0.4s ease forwards;
}

.reveal-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 64px;
  opacity: 0;
  pointer-events: none;
  line-height: 1;
}

.reveal-card-pending .reveal-emoji {
  animation: revealEmojiBurst 1.4s ease forwards;
  animation-delay: inherit;
}

@keyframes revealCardIn {
  0% {
    background: transparent;
    border-style: dashed;
    border-color: var(--color-border-light);
  }
  100% {
    background: var(--reveal-bg, var(--color-surface));
    border-style: solid;
    border-color: var(--reveal-border, var(--color-border));
  }
}

.reveal-card-pending > * {
  animation: revealContentIn 0.3s ease forwards;
  animation-delay: inherit;
}

@keyframes revealContentIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes revealEmojiBurst {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0.9;
  }
  50% {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.5);
    opacity: 0;
  }
}

.reveal-correct, .reveal-banker-correct {
  --reveal-bg: var(--color-correct-bg);
  --reveal-border: var(--color-correct);
}

.reveal-wrong {
  --reveal-bg: var(--color-wrong-bg);
  --reveal-border: var(--color-wrong);
}

.reveal-banker-wrong {
  --reveal-bg: var(--color-wrong-bg);
  --reveal-border: var(--color-wrong);
}

.reveal-missed {
  --reveal-bg: var(--color-bg);
  --reveal-border: var(--color-border);
  color: var(--color-text-secondary);
}

.reveal-card:not(.reveal-card-pending) {
  background: var(--reveal-bg, var(--color-surface));
  border-style: solid;
  border-color: var(--reveal-border, var(--color-border));
}

.reveal-card:not(.reveal-card-pending) > * {
  opacity: 1;
}

.reveal-banker-correct:not(.reveal-card-pending) {
  box-shadow: 0 0 0 2px var(--color-correct), 0 0 20px rgba(45,138,78,0.12);
}

.reveal-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reveal-team {
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reveal-vs {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.reveal-score {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 4px 0;
}

.reveal-cards {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.reveal-pick {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.reveal-banker-badge {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

.reveal-points {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  margin-top: 8px;
  color: var(--color-accent);
}

.reveal-card.reveal-correct .reveal-points,
.reveal-card.reveal-banker-correct .reveal-points {
  color: var(--color-correct);
}

.reveal-card.reveal-wrong .reveal-points,
.reveal-card.reveal-banker-wrong .reveal-points {
  color: var(--color-wrong);
}

.reveal-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 20px 0 16px;
  animation: revealFadeIn 0.4s ease forwards;
}

.reveal-total-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.reveal-total-value {
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
}

.total-positive { color: var(--color-correct); }
.total-negative { color: var(--color-wrong); }

/* ============================
   GROUPS (full page + mini)
   ============================ */

.groups-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

/* Schedule view — section headings + knockout bracket list */
/* Top-level section heading — outranks the per-group/round card titles. */
.schedule-section-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-dark-green);
  margin: 28px 0 14px;
}
.schedule-section-title:first-child { margin-top: 0; }

/* Third-place ranking framed as a card so it reads distinct from the group tables. */
.third-place-card .schedule-note {
  margin: 0 0 12px;
}

/* Accessible visually-hidden text (announced by screen readers, off-screen visually). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Unresolved knockout slot ("2A", "W74", "RU101") — a muted chip, not a fake flag. */
.slot-chip {
  display: inline-block;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  padding: 2px 7px;
}

/* Qualifying-position marker — a non-colour cue alongside the row highlight. */
.group-qual-dot {
  color: var(--color-accent);
  font-size: 8px;
  vertical-align: middle;
  margin-left: 3px;
}

.schedule-knockout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
}

/* Knockout matches within a round — responsive grid (1 col mobile, 2-3 on wide). */
.ko-round-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.ko-round-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ko-match {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.ko-match-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  min-height: 14px; /* reserve the row so cards stay level when venue is blank */
}

.ko-match-venue {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ko-match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

/* Flag + name stay on ONE line as a single unit (never break mid-word or split
   the flag onto its own row). The grid's 1fr columns keep home/away balanced. */
.ko-team {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ko-team-home { justify-content: flex-end; }
.ko-team-away { justify-content: flex-start; }

.ko-match-score {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  /* Stack the score and the (ET/pens) detail vertically: detail drops below. */
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

/* Unplayed match: the "v" is a quiet placeholder, not a bold score. */
.ko-match-score-tbd {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--ls-normal);
  color: var(--color-text-secondary);
}

.ko-pens {
  display: block; /* drop onto its own line, below the score */
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.schedule-note {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: -4px 0 12px;
}

.third-place-table { margin-bottom: 8px; }

/* Admin third-place slot assignment */
.admin-third-row {
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.admin-third-slot {
  font-weight: 700;
  color: var(--color-text-secondary);
}
.admin-third-select {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  min-width: 180px;
}

.groups-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 48px 24px;
}

.groups-list {
  display: grid;
  gap: 24px;
}

@media (min-width: 640px) {
  .groups-list {
    grid-template-columns: 1fr 1fr;
  }
}

.group-full {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.group-full-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 10px;
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.group-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  text-align: center;
  padding: 4px 6px;
  border-bottom: 2px solid var(--color-border);
}

.group-table th:nth-child(2) { text-align: left; }

.group-table td {
  text-align: center;
  padding: 6px 6px;
  border-bottom: 1px solid var(--color-border-light);
  font-variant-numeric: tabular-nums;
}

.group-table tbody tr:last-child td { border-bottom: none; }

.group-pos {
  font-weight: 700;
  color: var(--color-text-secondary);
  width: 24px;
}

.group-team {
  text-align: left !important;
  font-weight: 600;
  white-space: nowrap;
}

/* The cell carries both a full and short name; show the full one by default and
   keep it on a single line. Narrow layouts swap to the short form (see the
   <=999px rules) so a long nation never wraps. */
.group-team-name { display: inline; }
.group-team-short { display: none; }

.group-pts-col {
  font-weight: 800;
  color: var(--color-accent);
}

.group-row-qualified {
  background: var(--color-banker-bg);
}
/* Left accent bar on the position cell — a visible, non-colour-only "qualifying" cue
   (paired with the .group-qual-dot marker in the cell). */
.group-row-qualified .group-pos {
  box-shadow: inset 3px 0 0 var(--color-accent);
  font-weight: 700;
}

/* Group mini (sidebar/card) */
.group-mini {
  margin-bottom: 12px;
}

.group-mini-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
  margin-bottom: 4px;
}

.group-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
}

.group-mini-row + .group-mini-row {
  border-top: 1px solid var(--color-border-light);
}

.group-mini-qualified .group-mini-team { font-weight: 700; }

.group-mini-team {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.group-mini-pts {
  font-weight: 700;
  color: var(--color-accent);
  min-width: 20px;
  text-align: right;
}

/* ============================
   FIXTURES PAGE
   ============================ */

.fixtures-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 24px;
}

.fixtures-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

.fixtures-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 48px 24px;
}

.fixtures-block {
  margin-bottom: 28px;
}

.fixtures-block-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

/* --- Merged fixtures+picks card (dashboard card 3) ---------------------------
   The fixtures card renders _match_row tiles (.sc-tile) in one full-width column
   (not the scorecard's 2-up grid). Each tile is a single horizontal row: a
   fixed-width teams block on the left, the pick/points footer pushed to the
   right. Borderless. (All scoped to .card-fixtures so the /simple scorecard,
   which shares _match_row, is untouched.) */
/* The scroll area is the size container the tiles query against, so the
   full-name -> short-code swap responds to the CARD width (which changes between
   2-up, ultra-wide 3-up, and mobile), not the viewport. */
.card-fixtures .carousel-card-scroll {
  container-type: inline-size;
  container-name: fixtures-card;
}

.card-fixtures .sc-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
}

.card-fixtures .sc-tile {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border: none;
  max-height: none;
}

/* Teams block: a fixed share of the tile width so every tile lines up. Venue
   sits on its own line at the top (full width via wrap), the teams row below. */
.card-fixtures .sc-tile-teams {
  flex: 0 0 70%;
  max-width: 70%;
  flex-wrap: wrap;
  padding: 0;
}

.card-fixtures .sc-tile-venue {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 4px;
}

/* Nation names beside the flag (row), not stacked below it. Full names by
   default; swap to short codes when the tile gets narrow (see container query). */
.card-fixtures .sc-tile-team {
  flex-direction: row;
  gap: 8px;
  font-size: 12px;
}

/* Names on the OUTER edges, flags toward the centre, symmetric around the
   score/time:   Haiti ....[flag] | 02:00 | [flag].... Scotland
   Each team is flex:1 (its own half); space-between pushes its two items to the
   half's two ends. DOM order is flag,name.
   Home: row-reverse -> visual name,flag, with name at the outer (left) end.
   Away: row        -> visual flag,name, with name at the outer (right) end. */
.card-fixtures .sc-tile-team-home {
  flex-direction: row-reverse;
}

.card-fixtures .sc-tile-team-away {
  flex-direction: row;
}

.card-fixtures .sc-tile-team-name { display: none; }
.card-fixtures .sc-tile-team-full { display: inline; }

.card-fixtures .sc-tile-footer {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
  flex: 1;
  min-width: 0;
  width: auto;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

/* Narrow tiles: fall back to short team codes so names don't truncate/wrap. The
   fixtures card is a container (see .card-fixtures container-type below). */
@container fixtures-card (max-width: 520px) {
  .card-fixtures .sc-tile-team-full { display: none; }
  .card-fixtures .sc-tile-team-name { display: inline; }
}

/* Subtle per-block pick button (replaces the loud "Make picks" primary button). */
.fixtures-block-pick-btn {
  border: none;
  background: none;
  border-radius: var(--radius);
  padding: 4px 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition);
}

.fixtures-block-pick-btn:hover,
.fixtures-block-pick-btn:focus-visible {
  color: var(--color-accent);
}

.fixtures-block-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0;
  padding-bottom: 0;
}

.fixtures-block-status {
  font-size: 13px;
  font-weight: 600;
}

.fixtures-block-done {
  color: var(--color-correct);
}

/* Submitted chip doubles as the edit button: a bare, transparent button that shows
   "✓ Picks submitted" by default and swaps to "EDIT" (accent) on hover/focus. The
   "submitted" label always reserves its width (it just goes invisible on hover) and
   "EDIT" is overlaid centred, so the button width never changes. */
.fixtures-block-edit {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.fixtures-block-edit .fixtures-block-edit-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  color: var(--color-accent);
}

.fixtures-block-edit:hover .fixtures-block-edit-done,
.fixtures-block-edit:focus-visible .fixtures-block-edit-done {
  visibility: hidden;
}

.fixtures-block-edit:hover .fixtures-block-edit-hover,
.fixtures-block-edit:focus-visible .fixtures-block-edit-hover {
  visibility: visible;
}

/* Knockout block whose teams aren't decided yet — picks not available. */
.fixtures-block-pending {
  color: var(--color-text-secondary);
}

.fixture-row {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 6px;
  box-shadow: var(--shadow);
}

.fixture-row-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.fixture-home {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

.fixture-away {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

.fixture-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 0 12px;
}

.fixture-center-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.fixture-center-score {
  color: var(--color-accent);
  font-weight: 800;
}

.fixture-stage {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.fixture-venue {
  font-size: 10px;
  color: var(--color-text-secondary);
  opacity: 0.65;
  text-align: center;
  margin-top: 4px;
}

/* ============================
   ADMIN
   ============================ */

.admin-results {
  overflow-y: auto;
  height: 100dvh;
}

.admin-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  scroll-margin-top: 16px;
}

.admin-block-current { border-color: var(--color-accent); }
.admin-block-closed { opacity: 0.72; }

.admin-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-block-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-block-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.admin-block-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  padding: 2px 6px;
  border-radius: 4px;
}
.admin-block-badge-current { background: var(--color-accent); color: #fff; }
.admin-block-badge-closed  { background: var(--color-border); color: var(--color-text-secondary); }
.admin-block-badge-future  { background: transparent; color: var(--color-text-secondary); border: 1px solid var(--color-border); }

.admin-block-matches {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.admin-match-home { text-align: right; font-size: 14px; font-weight: 600; }
.admin-match-away { text-align: left;  font-size: 14px; font-weight: 600; }

.admin-match-scores {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-match-dash { color: var(--color-text-secondary); }

.admin-score-input {
  width: 48px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  text-align: center;
}

.admin-match-pens {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 6px;
}

.admin-match-pens-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-right: 4px;
}

.admin-pen-input {
  width: 38px;
  padding: 3px 6px;
  font-size: 12px;
}

.admin-match-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 2px 0 6px;
}

.admin-match-cards-label { font-size: 12px; }
.admin-match-cards-label-red { margin-left: 8px; }

/* "API" tag on auto-filled fixtures + colour-coded audit-log actions. */
.admin-api-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  padding: 1px 4px;
  vertical-align: middle;
}

.score-log-table td { font-size: 12px; }

.score-log-action {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-tight);
}
.score-log-action-score_applied { color: var(--color-correct); }
.score-log-action-skipped_manual,
.score-log-action-unchanged { color: var(--color-text-secondary); }
.score-log-action-unmatched,
.score-log-action-error { color: var(--color-wrong); }

.admin-card-input {
  width: 34px;
  padding: 3px 5px;
  font-size: 12px;
}

.admin-block-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* ============================
   LEAGUE DIALOG
   ============================ */

.league-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--color-surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  max-width: 380px;
  width: calc(100% - 32px);
  margin: auto;
  position: fixed;
  inset: 0;
  height: fit-content;
}

.league-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.league-dialog-content {
  padding: 32px;
}

.league-dialog-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* League-created confirmation — prominent, copyable share code. */
.league-created-content {
  text-align: center;
}

.league-created-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.league-created-code {
  display: inline-block;
  font-family: monospace;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--color-accent);
  background: var(--color-surface-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.league-created-code:hover {
  opacity: 0.8;
}

.league-created-hint {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin: 10px 0 20px;
}

.league-dialog-form:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.league-dialog-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  background: var(--color-surface-alt);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.league-dialog-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.league-dialog-input-code {
  text-transform: uppercase;
  font-family: monospace;
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
}

.league-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================
   SIDEBAR COMPAT (for card 3)
   ============================ */

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-section-header h3 {
  margin-bottom: 0;
}

.sidebar-section-header + * {
  margin-top: 10px;
}

/* ============================
   SIMPLE VIEW
   ============================ */

.simple-view {
  flex: 1;
  overflow-y: auto;
  padding: 0 clamp(16px, 4vw, 48px) 48px;
}

.simple-section {
  margin-bottom: 32px;
}

.simple-section-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100dvh - 96px);
}

.simple-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.simple-panel-leaderboard {
  display: flex;
  flex-direction: column;
}

.simple-panel-leaderboard > [data-simple-leagues-target] {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.simple-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.simple-panel-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--color-dark-green);
  line-height: 1;
}

.simple-panel-link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
}

.simple-panel-link:hover {
  color: var(--color-accent);
}

.simple-panel-link-back {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--color-dark-green);
  text-decoration: none;
}

.simple-panel-link-back:hover {
  color: var(--color-accent);
}

.simple-panel-body {
  padding: 16px 24px;
}

.simple-league-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.simple-league-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
}

.simple-league-arrow {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 28px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color var(--transition);
}

.simple-league-arrow:hover {
  color: var(--color-text);
}

.simple-fixtures-toggle {
  margin-top: 16px;
  width: 100%;
  border: none;
}

.simple-groups .groups-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ============================
   MOBILE
   ============================ */

@media (max-width: 767px) {
  body {
    overflow: hidden;
    height: 100dvh;
  }

  /* Mobile (1 card, vertical scroll): cards are reached by card INDEX, so show
     LEADERBOARD (index 1) + FIXTURES (index 2). Hide the Teams link and the
     desktop FIXTURES button (which uses the window-position param). Scoped under
     .card-info-actions to beat the higher-specificity sizing rule. */
  .card-info-actions .card-info-btn-teams,
  .card-info-actions .card-info-btn-fixtures-desktop {
    display: none;
  }

  .card-info-actions .card-info-btn-leaderboard,
  .card-info-actions .card-info-btn-fixtures-mobile {
    display: inline-block;
  }

  .nav-bar {
    padding: 8px 16px;
    gap: 8px;
  }

  /* Mobile header is just logo (top-left, in .nav-left) + hamburger (right). */
  .nav-pills-desktop,
  .nav-avatar-menu {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  /* Full-width sheet dropping from under the header — no rounded corners. */
  .nav-mobile-menu:not([hidden]) {
    display: flex;
  }

  .nav-mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    flex-direction: column;
    width: 100%;
    padding: 8px;
    background: var(--color-surface);
    border: none;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  }

  .nav-mobile-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 12px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 6px;
  }

  .nav-mobile-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .nav-mobile-name {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-mobile-links {
    display: flex;
    flex-direction: column;
  }

  .nav-mobile-section {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--color-border-light);
  }

  .nav-mobile-section-label {
    padding: 4px 12px;
    font-family: var(--font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    text-transform: uppercase;
    color: var(--color-text-secondary);
  }

  /* button_to renders a <form>; collapse it so the button lays out flat. */
  .nav-mobile-menu form {
    margin: 0;
    display: contents;
  }

  .nav-mobile-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: var(--ls-tight);
    text-transform: uppercase;
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
  }

  .nav-mobile-link:hover,
  .nav-mobile-link:active {
    background: var(--color-surface-alt);
  }

  .nav-mobile-link-active {
    color: var(--color-accent);
  }

  .nav-mobile-link-logout {
    color: var(--color-accent);
  }

  .main-view,
  .leagues-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .carousel {
    flex: 1;
    padding: 0;
    overflow: hidden;
  }

  .carousel-viewport {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .carousel-prev,
  .carousel-back,
  .leagues-chevron { display: none; }

  .carousel-track {
    flex-direction: column;
    transform: none !important;
    gap: 0;
    height: auto;
  }

  .carousel-card {
    flex: none;
    min-height: calc(100dvh - 60px);
    scroll-snap-align: start;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .carousel-card + .carousel-card {
    border-top: none;
  }

  .carousel-card-scroll {
    max-height: none;
    overflow-y: auto;
  }

  .card-info {
    padding: 32px 20px;
  }

  .card-info-title {
    font-size: clamp(48px, 18cqi, 102px);
  }

  .card-info-cities {
    max-width: none;
    margin-inline: 0;
  }

  /* On phones two 180px buttons can't sit side-by-side, so stack them vertically.
     Each keeps the 180px minimum and centres in the card. */
  .coming-soon-view .card-info-actions {
    flex-direction: column;
    align-items: center;
  }

  /* On the document-scrolling pages (rules + schedule), the whole body scrolls,
     so the in-flow nav would scroll away. Pin it. The dashboard scrolls its inner
     view instead, so its nav already stays put and needs no change. */
  body:has(.rules-view) .nav-bar,
  body:has(.groups-view) .nav-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
  }

  body:has(.rules-view) {
    overflow: auto;
    height: auto;
  }

  body:has(.rules-view) .app-shell {
    height: auto;
  }

  .rules-view {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .rules-card-wrap {
    padding: 0;
    overflow: visible;
    flex: none;
  }

  .card-rules {
    border-radius: 0;
    border-left: none;
    border-right: none;
    overflow: visible;
    min-height: auto;
    max-width: 100vw;
  }

  .card-rules .carousel-card-scroll {
    overflow: visible;
    padding: 16px 20px 24px;
  }

  .rules-content {
    columns: 1;
  }

  .rules-section p,
  .rules-section li {
    font-size: 13px;
  }

  .rules-section-banker {
    margin-left: 0;
    margin-right: 0;
    padding: 16px;
  }

  .rules-points-strip {
    gap: 4px;
  }

  .rules-points-item {
    padding: 10px 2px;
  }

  .rules-points-value {
    font-size: 20px;
  }

  .rules-points-label {
    font-size: 9px;
  }

  .rules-banker-outcome {
    padding: 8px 12px;
    gap: 10px;
  }

  .rules-banker-outcome strong,
  .rules-banker-outcome span {
    font-size: 12px;
  }

  .rules-banker-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .league-carousel-card {
    flex: 0 0 auto;
  }

  .container {
    padding: 16px;
  }

  .login-hero {
    padding: 32px 20px;
  }

  .hero-art {
    max-width: 200px;
  }

  .hero-flag {
    width: 56px;
  }

  .reveal-team {
    font-size: 13px;
  }

  .segment-label {
    padding: 8px 6px;
    font-size: 12px;
  }

  body:has(.fixtures-view) {
    overflow: auto;
    height: auto;
  }

  body:has(.fixtures-view) .app-shell {
    height: auto;
  }

  .fixtures-view {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .fixtures-scroll {
    padding: 0 16px 24px;
    overflow: visible;
  }

  .fixtures-block-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .fixture-home,
  .fixture-away {
    font-size: 12px;
  }

  .fixture-center-value {
    font-size: 15px;
  }

  .fixture-row {
    padding: 10px;
  }

  .predictions-dialog {
    max-width: none;
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    inset: 0;
    margin: 0;
  }

  .predictions-dialog-content {
    max-height: 100dvh;
    padding: 20px 16px 24px;
  }

  body:has(.groups-view) {
    overflow: auto;
    height: auto;
  }

  body:has(.groups-view) .app-shell {
    height: auto;
  }

  .groups-view {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .groups-scroll {
    padding: 0 16px 24px;
    overflow: visible;
  }

  .group-table .group-col-g,
  .group-table .group-col-gd,
  .group-table .group-col-cards {
    display: none;
  }

  /* Long nation names drop to their short form here too (see the 768-999px
     block for the same swap). */
  .group-team-name { display: none; }
  .group-team-short { display: inline; }

  .sc-tile-team {
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  /* Full team name is smaller on mobile (15px on larger screens). */
  .sc-tile-team-full {
    font-size: 12px;
  }

  .sc-tile-team .flag {
    width: 20px;
  }

  .sc-tile {
    padding: 8px;
    max-height: none;
  }

  .sc-tile-teams {
    padding: 8px 0;
  }

  .sc-card-section .sc-grid:has(> :nth-child(5)) {
    grid-template-columns: 1fr 1fr;
  }

  .sc-tile-footer {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sc-tile-pick-full {
    display: none;
  }

  .sc-tile-pick-short {
    display: inline;
    padding-right: 2px;
  }

  .sc-tile-goat-label {
    display: none;
  }

  .sc-tile-time {
    display: none;
  }

  .sc-tile-vs {
    display: block;
  }

  .sc-card-expand-btn {
    display: none;
  }

  .simple-section-top {
    grid-template-columns: 1fr;
    height: auto;
  }

  /* The merged fixtures card is a roomy single-column list even on mobile, so it
     does NOT need the cramped-scorecard compaction above. Restore the full GOAT
     label, kickoff time, and full pick text; keep "vs" hidden. (Scoped overrides
     so the /simple scorecard keeps its compact 2-col mobile treatment.) */
  .card-fixtures .sc-tile-goat-label { display: inline; }
  .card-fixtures .sc-tile-time { display: block; }
  .card-fixtures .sc-tile-vs { display: none; }
  .card-fixtures .sc-tile-pick-full { display: inline; }
  .card-fixtures .sc-tile-pick-short { display: none; }
}

