/*
 * World Cup 2026 preview — shared stylesheet.
 *
 * Ported 1:1 from apps/backend/app/preview/wc/layout.tsx (Next.js
 * prototype). Every selector is scoped under `.wc-preview` so the
 * styles don't leak into the surrounding theme. The hub/groups/
 * topscorers/winner templates all live inside the same `.wc-preview`
 * wrapper.
 *
 * When adjusting visuals, keep this file and the layout.tsx CSS block
 * in sync — the preview pages still rely on the inline copy so they
 * can be diff'd visually against the WP-rendered version.
 */

.wc-preview {
  background: #f5f6f8;
  color: #141d26;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.wc-preview a { color: inherit; text-decoration: none; }
.wc-preview__main { max-width: 1225px; margin: 0 auto; padding: 32px 24px 80px; }

.wc-preview__nav {
  display: flex; gap: 18px; font-size: 14px; font-weight: 500;
  margin: 0 0 24px;
}
.wc-preview__nav a:hover { color: #00b327; }
.wc-preview__nav a.is-active { color: #00b327; }

.wc-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden;
  /* Lock the card to its grid track. Without these three the card would
   * expand to fit its widest content row (a longer team name in one
   * group's standings makes that one card wider than the others — most
   * visible when Group A's "Czech Republic" stretches it past its
   * neighbours). min-width:0 lets text inside truncate cleanly.
   *
   * !important because the host WP theme (X Theme on Bold) injects its
   * own .x-container/.x-section width rules that win on specificity and
   * leave the first .wc-card in the grid wider than the rest. We need
   * deterministic equal-width tracks for the visual alignment to hold,
   * so we force these three. */
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
/* Ditto for direct grid children — some themes set width on them too,
 * which leaks the first card out of its track. Cap them to the track. */
.wc-grid > .wc-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.wc-card + .wc-card { margin-top: 24px; }
.wc-card__head {
  padding: 14px 20px; border-bottom: 1px solid #eef0f3;
  display: flex; align-items: center; justify-content: space-between;
  background: #fafbfc;
}
.wc-card__title { font-size: 15px; font-weight: 700; letter-spacing: 0.2px; }
.wc-card__meta  { font-size: 12px; color: #6b7280; }

.wc-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  /* Auto layout — team cell grows to fit the full name. We used to
   * pin this to `fixed` to keep multiple cards equal-width in the old
   * 2-column grid, but the grid is now a single vertical stack
   * (.wc-grid below) so each card has the full row to itself. */
  table-layout: auto;
}
.wc-table th, .wc-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid #f1f3f5;
}
/* Numeric stat columns (K/V/U/T/+-/P) stay on one line so the digits
 * don't wrap — and we keep them narrow with white-space:nowrap. */
.wc-table th.wc-table__num,
.wc-table td.wc-table__num {
  white-space: nowrap;
}
/* Team column gets to use as much horizontal space as it needs to fit
 * the full country name ("Bosnia & Herzegovina", "United States",
 * "Saudi Arabia"). On narrow widths (mobile) the name wraps to a
 * second line instead of getting ellipsised. */
.wc-table td:nth-child(2),
.wc-table th:nth-child(2) {
  white-space: normal;
  width: auto;
}
.wc-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: #6b7280; font-weight: 600; background: #fff;
}
.wc-table tbody tr:last-child td { border-bottom: 0; }
.wc-table tbody tr:hover { background: #f9fafb; }
.wc-table__num { text-align: right; font-variant-numeric: tabular-nums; }

.wc-team {
  display: flex; align-items: center; gap: 10px;
  /* Required so flex children honour the parent <td>'s overflow rules
   * instead of inheriting their own min-content min-width. */
  min-width: 0;
}
.wc-team img,
.wc-team__flag {
  width: 22px; height: 22px; object-fit: contain;
  border-radius: 4px; background: #f1f3f5;
  flex-shrink: 0; /* Don't squash the flag when the name truncates. */
}
.wc-team__name {
  font-weight: 600;
  /* No truncation — editor explicitly asked for full team names. The
   * table cell already provides enough width for "Saudi Arabia",
   * "United States" etc. on desktop; mobile wraps to a second line
   * which is preferable to the previous ellipsis cutoff. */
  min-width: 0; flex: 1 1 auto;
  word-break: break-word;
  line-height: 1.25;
}

.wc-rank { color: #6b7280; font-variant-numeric: tabular-nums; width: 22px; display: inline-block; }
.wc-empty { padding: 32px; text-align: center; color: #6b7280; font-size: 14px; }

/* Single vertical stack so every group card has the full content
 * width to itself — gives the team column room to render full names
 * ("Mexico", "South Korea", "Czech Republic", …) without truncation
 * and matches the standalone-per-group layout requested in 3.3.19.
 * Each card is also independently addressable via `#groupa` anchors
 * so editors can drop prose between them on the public page. */
.wc-grid {
  display: flex; flex-direction: column;
  gap: 24px;
}

/* "Hop til" / "Jump to" navigator at top of [wc_groups]. With 8
 * groups in a vertical stack the page is long; this lets visitors
 * click a letter chip and skip straight to the desired group. */
.wc-grid-nav {
  display: flex; align-items: center; gap: 12px;
  margin: -4px 0 20px;
  flex-wrap: wrap;
}
.wc-grid-nav__label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: #6b7280;
}
.wc-grid-nav__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.wc-grid-nav__list a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px;
  background: #f3f4f6; color: #1f2937;
  text-decoration: none; font-weight: 700; font-size: 13px;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.wc-grid-nav__list a:hover {
  background: #2563eb; color: #fff;
  transform: translateY(-1px);
}

.wc-fixtures {
  font-size: 13px; padding-top: 4px;
  border-top: 1px solid #eef0f3; background: #fafbfc;
}
.wc-fixtures__heading {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: #6b7280; margin: 0;
  padding: 14px 16px 8px;
}
.wc-fixtures__row {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f3f5;
}
.wc-fixtures__row:last-child { border-bottom: 0; }
.wc-fixtures__row--link {
  cursor: pointer; transition: background 0.12s ease; background: #fff;
  text-decoration: none; color: inherit;
}
.wc-fixtures__row--link:hover { background: #f0f9ff; }
.wc-fixtures__row--link:hover .wc-fixtures__cta { color: #0369a1; }
.wc-fixtures__row--link:hover .wc-fixtures__cta-arrow { transform: translateX(3px); }
.wc-fixtures__date {
  color: #6b7280; font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; flex-shrink: 0;
  min-width: 110px;
}
.wc-fixtures__teams { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.wc-fixtures__team  { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wc-fixtures__team img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.wc-fixtures__team > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-fixtures__score { font-weight: 700; color: #6b7280; font-variant-numeric: tabular-nums; font-size: 13px; flex-shrink: 0; }
.wc-fixtures__score--played { color: #141d26; }
/* Fixture-row CTA — turned into a real pill button in 3.3.19 after
 * editor feedback that the plain inline "Se preview" text didn't read as
 * a click target. Background fill + subtle shadow makes the affordance
 * obvious without competing with the row itself. Stays compact on
 * desktop and gets full-width-ish styling on mobile (see media query). */
.wc-fixtures__cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2563eb; color: #fff !important;
  padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  margin-left: auto;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.wc-fixtures__row--link:hover .wc-fixtures__cta {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
  transform: translateY(-1px);
}
.wc-fixtures__cta-text { letter-spacing: 0.15px; }
.wc-fixtures__cta-arrow {
  font-size: 14px; line-height: 1;
  transition: transform 0.15s ease;
}
.wc-fixtures__row--link:hover .wc-fixtures__cta-arrow { transform: translateX(2px); }

/* Anchor link on the group heading — same visible label, but an inline
 * hash icon reveals on hover so editors know they can deep-link to it
 * (e.g. #groupa, #groupb). Heading colour is inherited from the host
 * theme so the styling stays neutral. */
.wc-card__anchor {
  color: inherit; text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.wc-card__anchor:hover { color: #2563eb; }
.wc-card__anchor-icon {
  font-size: 11px; font-weight: 500; color: #94a3b8;
  opacity: 0; transition: opacity 0.12s ease;
}
.wc-card__anchor:hover .wc-card__anchor-icon { opacity: 1; }

/* Single-group widget [wc_group] — optional dropdown selector that
 * switches between groups without a page reload. Dropdown only appears
 * when the shortcode is invoked without a group= attribute. */
.wc-group-selector {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 12px 14px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.wc-group-selector__label {
  font-size: 13px; font-weight: 600; color: #334155;
}
.wc-group-selector__input {
  appearance: none; -webkit-appearance: none;
  padding: 8px 32px 8px 12px; border-radius: 8px;
  border: 1px solid #cbd5e1; background: #fff;
  font-size: 13px; font-weight: 600; color: #0f172a;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.wc-group-stack__item--hidden { display: none; }

.wc-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; color: #4338ca;
}
.wc-pill--neutral { background: #f3f4f6; color: #6b7280; }

/* `.wc-cmp` is the card wrapper for the winner / topscorers tables.
 *
 * IMPORTANT: do NOT add `overflow: hidden` here. The spec says
 * `position: sticky` is silently neutered if *any* ancestor has
 * overflow:hidden / auto / scroll / clip, even when that ancestor is
 * taller than the viewport. We rely on .wc-cmp__providers-row being
 * sticky so visitors always see which logo column maps to which
 * provider while they scroll through the long list. Adding overflow
 * here breaks that — we tried it in 3.3.19 and the providers row
 * scrolled away with the rest of the card.
 *
 * To still get the rounded-corner clipping effect, the header and
 * the last row inherit border-radius from their position instead. */
.wc-cmp {
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 100%;
}
.wc-cmp__header {
  background: linear-gradient(to right, #1e293b, #334155);
  color: #fff !important; padding: 20px; text-align: center;
  border-radius: 16px 16px 0 0;
}
.wc-cmp__rows { border-radius: 0 0 16px 16px; overflow: hidden; }
/* !important guards against host themes that target generic h2/p in
   page content (e.g. Cornerstone, Twenty Twenty-* themes set their own
   foreground colour on headings and accidentally darken our banner). */
.wc-cmp__header h2 {
  font-size: 20px; font-weight: 700; margin: 0 0 6px;
  color: #fff !important;
}
.wc-cmp__header .wc-cmp__sub {
  font-size: 13px;
  color: #cbd5e1 !important;
}

.wc-cmp__intro {
  background: #fffbeb; color: #92400e;
  padding: 12px 16px; font-size: 12px; line-height: 1.5;
  border-bottom: 1px solid #fde68a;
}

/* Bookmaker-logo header. Pinned to the top of the viewport while the
 * visitor scrolls through the long winner/topscorers list so they can
 * always see which column maps to which provider.
 *
 * Why no `position: sticky` here? Host themes (X Theme on Bold,
 * Yoast/Cornerstone on OF) wrap our shortcode in containers with
 * `overflow:hidden` / `transform` / `will-change`, all of which
 * silently kill native sticky. We instead drive sticky from
 * assets/wc/wc.js via `position: fixed` + a placeholder — see
 * initStickyProviders(). Hosts can override the top offset by
 * setting `--low-sticky-offset` on `<html>` (default: 0). The JS
 * also auto-detects fixed/sticky site headers and clears them. */
.wc-cmp__providers-row {
  position: static;
  padding: 14px 16px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.wc-cmp__providers-row--stuck {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.wc-cmp__providers-inner { display: flex; justify-content: center; }
.wc-cmp__providers-list  { display: flex; gap: 8px; }

/* Vertical brand tile — same proportions and rotation as the 1X2
 * comparator on match pages (Desktop.tsx). Background is set inline
 * per-provider via low_wc_provider_brand_color() in PHP. */
.wc-cmp__provider-tag {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 116px;
  border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: #D1D5DB; /* fallback — overridden inline per provider */
}
.wc-cmp__provider-tag img {
  width: 70px; height: 100px; object-fit: contain;
  transform: rotate(90deg) scale(1.8);
}

.wc-cmp__rows { display: flex; flex-direction: column; }
.wc-cmp__row { position: relative; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; }
.wc-cmp__row:last-child { border-bottom: 0; }

/* "Plain" rows render the entity row only (no odds card / no expand
 * toggle). Used by [wc_top_assists] which has no outright market and
 * therefore no provider columns. The default `.wc-cmp__entity-left` is
 * absolutely-positioned (so it can overlap the odds grid) — that would
 * stack every plain row on the same vertical position. We override it
 * back to flow layout here. */
.wc-cmp__row--plain {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
}
.wc-cmp__row--plain .wc-cmp__entity-left {
  position: static; transform: none;
  max-width: none; width: 100%;
}

.wc-cmp__row-toggle {
  background: none; border: 0; padding: 0;
  width: 100%; text-align: left; display: block;
  cursor: default; color: inherit; font: inherit;
}
.wc-cmp__row-toggle:focus-visible {
  outline: 2px solid #93c5fd; outline-offset: 2px;
  border-radius: 4px;
}

.wc-cmp__best-mobile { display: none; }
.wc-cmp__row-chevron { display: none; }
.wc-cmp__odd-provider-logo { display: none; }
.wc-cmp__odd-cell { display: flex; flex-direction: column; align-items: center; }

.wc-cmp__entity-left {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: 260px;
}
.wc-cmp__entity-rank {
  width: 26px; font-size: 13px; font-weight: 600;
  color: #94a3b8; font-variant-numeric: tabular-nums;
  text-align: right; flex-shrink: 0;
}
.wc-cmp__entity-img {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wc-cmp__entity-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.wc-cmp__entity-img--round img { border-radius: 50%; }
.wc-cmp__entity-body { display: flex; flex-direction: column; min-width: 0; }
.wc-cmp__entity-name {
  font-size: 14px; font-weight: 600; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-cmp__entity-sub {
  font-size: 11px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}

.wc-cmp__odds-wrap { display: flex; justify-content: center; }
.wc-cmp__odds-list { display: flex; gap: 8px; }

.wc-cmp__odd {
  /* Width matches .wc-cmp__provider-tag so every odd cell sits exactly
   * underneath its column header. Heights differ (the brand tile is a
   * tall vertical rectangle; the odd is a square chip) but column
   * alignment is what matters visually. */
  width: 56px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: #f3f4f6; border: 1px solid #d1d5db;
  color: #1f2937;
  transition: transform 0.15s ease;
  cursor: pointer; text-decoration: none;
}
.wc-cmp__odd--best {
  background: #d1fae5; border: 2px solid #34d399; color: #065f46;
}
.wc-cmp__odd:hover { transform: scale(1.05); }

/* ─────────────────────────────────────────
 * Tablet
 * ───────────────────────────────────────── */
@media (max-width: 768px) {
  .wc-preview__nav { gap: 12px; font-size: 13px; }
  .wc-preview__main { padding: 20px 12px 60px; }

  .wc-cmp__header { padding: 14px 16px; }
  .wc-cmp__header h2 { font-size: 16px; }
  .wc-cmp__header .wc-cmp__sub { font-size: 11px; }

  .wc-cmp__providers-row { padding: 10px 12px 12px; }
  .wc-cmp__providers-list { gap: 6px; }
  .wc-cmp__provider-tag { width: 48px; height: 100px; }
  .wc-cmp__provider-tag img { width: 60px; height: 88px; transform: rotate(90deg) scale(1.6); }

  .wc-cmp__row { padding: 10px 12px; }
  .wc-cmp__entity-left { left: 12px; max-width: 170px; gap: 8px; }
  .wc-cmp__entity-rank { width: 18px; font-size: 11px; }
  .wc-cmp__entity-img { width: 24px; height: 24px; }
  .wc-cmp__entity-name { font-size: 12px; }
  .wc-cmp__entity-sub  { font-size: 10px; }

  .wc-cmp__odds-list { gap: 6px; }
  /* Tablet tile width = 48px (see .wc-cmp__provider-tag override above) —
   * keep odd cell at the same width so columns stay vertically aligned. */
  .wc-cmp__odd { width: 48px; height: 42px; font-size: 11px; }

  .wc-card__head { padding: 10px 14px; }
  .wc-card__title { font-size: 14px; }
  .wc-table th, .wc-table td { padding: 8px 10px; }
  .wc-fixtures__row { padding: 8px 12px; gap: 10px; }
  .wc-fixtures__date { font-size: 11px; min-width: 92px; }
  .wc-fixtures__heading { padding: 12px 12px 6px; }
}

/* ─────────────────────────────────────────
 * Phone — expand/collapse comparator rows
 * ───────────────────────────────────────── */
@media (max-width: 520px) {
  .wc-preview__main { padding: 16px 8px 60px; }
  .wc-preview__nav { gap: 10px; font-size: 12px; }

  .wc-cmp__header { padding: 12px; }
  .wc-cmp__header h2 { font-size: 15px; }

  .wc-cmp__providers-row { display: none; }
  /* Brand-coloured tile behind the best-provider logo on mobile
   * matches the per-provider tile used on desktop's provider header
   * row. Background colour is set inline via low_wc_provider_brand_color()
   * so each bookmaker keeps its house colour. */
  .wc-cmp__best-mobile-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0f172a; /* fallback if PHP didn't supply one */
  }
  .wc-cmp__best-mobile-logo {
    width: 72px;
    height: 24px;
    object-fit: contain;
  }

  .wc-cmp__row { padding: 0; border-bottom: 1px solid #e5e7eb; }
  .wc-cmp__row-toggle {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 12px 12px 10px;
    cursor: pointer; width: 100%;
  }
  .wc-cmp__row-toggle:active { background: #f8fafc; }

  .wc-cmp__entity-left {
    position: static; transform: none;
    max-width: none; flex: 1 1 auto;
    min-width: 0; gap: 10px; margin: 0;
  }
  .wc-cmp__entity-rank { width: 20px; font-size: 12px; flex-shrink: 0; }
  .wc-cmp__entity-img { width: 28px; height: 28px; flex-shrink: 0; }
  .wc-cmp__entity-name { font-size: 13px; }
  .wc-cmp__entity-sub  { font-size: 10px; }

  .wc-cmp__best-mobile {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  }
  .wc-cmp__best-mobile-label {
    font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: #94a3b8;
  }
  .wc-cmp__odd--inline {
    width: auto; height: 32px; padding: 0 12px; font-size: 12px;
  }
  .wc-cmp__row-chevron {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; color: #94a3b8; font-size: 18px; line-height: 1;
    transition: transform 0.15s ease;
  }
  .wc-cmp__row--open .wc-cmp__row-chevron { transform: rotate(90deg); }

  .wc-cmp__odds-wrap {
    display: none; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 12px;
  }
  .wc-cmp__odds-wrap::-webkit-scrollbar { height: 4px; }
  .wc-cmp__odds-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
  .wc-cmp__row--open .wc-cmp__odds-wrap { display: flex; justify-content: flex-start; }
  .wc-cmp__odds-list { gap: 8px; }

  .wc-cmp__odd-cell { flex-shrink: 0; gap: 5px; }
  .wc-cmp__odd-provider-logo {
    display: block;
    width: 56px; height: 20px;
    object-fit: contain; border-radius: 3px;
  }
  .wc-cmp__odd {
    width: 56px; height: 36px;
    font-size: 12px; border-radius: 6px;
    flex-shrink: 0;
  }

  /* On phones the row uses a 2-column grid:
   *
   *   ┌─────────────────────┬──────────┐
   *   │ Date                │          │
   *   ├─────────────────────┤   CTA    │
   *   │ Teams               │          │
   *   └─────────────────────┴──────────┘
   *
   * Date + teams stack on the left in a single column, CTA sits on
   * the right vertically centred across both rows. Editor asked for
   * the button on the *side* (3.3.27) instead of under teams so the
   * row reads as one tappable card with the action obvious on the
   * trailing edge. */
  .wc-fixtures__row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date cta"
      "teams cta";
    gap: 4px 12px;
    padding: 12px;
    align-items: center;
  }
  .wc-fixtures__date {
    grid-area: date;
    min-width: 0;
  }
  .wc-fixtures__teams {
    grid-area: teams;
    font-size: 13px; gap: 6px;
    flex-basis: auto;
    min-width: 0;
  }
  .wc-fixtures__team img { width: 16px !important; height: 16px !important; }
  .wc-fixtures__cta {
    grid-area: cta;
    align-self: center;
    margin: 0;
    padding: 7px 14px;
    font-size: 11px;
    width: auto;
    justify-content: center;
  }
  .wc-fixtures__cta-arrow { font-size: 12px; }

  .wc-table th, .wc-table td { padding: 8px 6px; font-size: 12px; }
  .wc-table th { font-size: 10px; }
  .wc-team img { width: 18px; height: 18px; }
}

/* Error state */
.wc-preview--error .wc-preview__error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #991b1b; padding: 16px;
  border-radius: 8px; font-size: 14px;
}

/* ─────────────────────────────────────────
 * Previous winners leaderboard (winner.php)
 * Static list of every nation that's won the World Cup, ordered
 * by total wins desc → most recent win desc.
 * ───────────────────────────────────────── */
.wc-history {
  margin-top: 24px;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; overflow: hidden;
}
.wc-history__head {
  padding: 16px 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
}
.wc-history__title {
  margin: 0; font-size: 16px; font-weight: 700;
  letter-spacing: 0.2px; color: #fff !important;
}
.wc-history__sub {
  margin: 4px 0 0; font-size: 12px;
  color: #cbd5e1 !important;
}

.wc-history__list {
  list-style: none; margin: 0; padding: 0;
}
.wc-history__row {
  display: grid;
  grid-template-columns: 28px 32px 1fr auto auto;
  align-items: center; gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
}
.wc-history__row:last-child { border-bottom: 0; }
.wc-history__row:hover { background: #f9fafb; }

.wc-history__rank {
  color: #6b7280; font-variant-numeric: tabular-nums;
  font-size: 13px; text-align: center;
}
.wc-history__flag {
  width: 32px; height: 24px; object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.wc-history__name {
  font-weight: 600; color: #111827;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.wc-history__count {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.wc-history__count strong {
  font-size: 16px; font-weight: 700; color: #0f172a;
}
.wc-history__count-label {
  font-size: 11px; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.wc-history__years {
  font-size: 12px; color: #6b7280;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .wc-history__row {
    /* On phones the year list overflows the auto column — collapse it
     * onto its own row below the flag/name. */
    grid-template-columns: 24px 28px 1fr auto;
    grid-template-areas:
      "rank flag name count"
      "rank flag years years";
    row-gap: 2px; padding: 10px 14px;
  }
  .wc-history__rank  { grid-area: rank; }
  .wc-history__flag  { grid-area: flag; width: 28px; height: 21px; }
  .wc-history__name  { grid-area: name; }
  .wc-history__count { grid-area: count; }
  .wc-history__years {
    grid-area: years; font-size: 11px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}
