/* ======================================================================
   wc.css — World Cup 2026 styles, extracted from styles.css.
   IMPORTANT: must load AFTER styles.css. Source-order preserved exactly
   from styles.css; rules retain their relative cascade position by being
   loaded last (equal-specificity ties resolve in WC's favor, which is
   desirable since these are scoped to the WC section only).
   Extracted: v31-css-split-f1.
   ====================================================================== */
img.wc-flag.wc-flag--inline {
  width: 18px; height: 13px;
  vertical-align: -2px;
  margin: 0 2px;
}

/* ======================================================================
   World Cup 2026 (v24-worldcup) — Brazil-vibes accent (yellow→green)
   ====================================================================== */

.nav-tab--wc:not(.active) {
  background: linear-gradient(135deg, rgba(254,205,7,0.16), rgba(0,156,59,0.18));
  color: #ffe177;
  box-shadow: inset 0 0 0 1px rgba(254,205,7,0.45);
  font-weight: 600;
}
.nav-tab--wc:not(.active):hover {
  background: linear-gradient(135deg, rgba(254,205,7,0.26), rgba(0,156,59,0.28));
  color: #fff5b8;
}
body.wc-phase-post .nav-tab--wc { display: none; }

.accent-bar--wc {
  background: linear-gradient(180deg, #fecd07 0%, #009c3b 100%);
  box-shadow: 0 0 14px rgba(254,205,7,0.45);
}

.wc-topbar-chip {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: 999px;
  text-decoration: none; white-space: nowrap;
  background: linear-gradient(135deg, rgba(254,205,7,0.18), rgba(0,156,59,0.22));
  color: #ffe177;
  border: 1px solid rgba(254,205,7,0.45);
  letter-spacing: 0.2px;
}
.wc-topbar-chip:hover { color: #fff5b8; }
.wc-topbar-chip[hidden] { display: none; }

.section-wc { /* inherits .section */ }

.wc-countdown-hero {
  position: relative;
  padding: 28px 24px;
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(254,205,7,0.18), transparent 60%),
    radial-gradient(120% 80% at 100% 100%, rgba(0,156,59,0.22), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.10));
  border: 1px solid rgba(254,205,7,0.30);
  box-shadow: 0 12px 40px rgba(0,156,59,0.18);
  margin-bottom: 18px;
}
.wc-countdown-eyebrow {
  color: #ffe177; font-size: 12px; letter-spacing: 1.2px;
  text-transform: uppercase; font-weight: 700; margin-bottom: 8px;
}
.wc-countdown-big { font-size: 26px; font-weight: 700; line-height: 1.2; }
.wc-cd-num { color: #fecd07; }
.wc-countdown-meta { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.wc-countdown-brazil {
  margin-top: 14px; padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,156,59,0.16);
  border: 1px solid rgba(0,156,59,0.45);
  font-size: 14px; color: #d9fbe2;
}
.wc-cd-mini { color: #ffe177; font-weight: 600; margin-left: 6px; }

.wc-subheading {
  font-size: 14px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-2); margin: 18px 0 10px;
}
.wc-count {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: rgba(254,205,7,0.22); color: #ffe177;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}

.wc-today-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.wc-match-card {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.wc-match-card--brazil {
  border-color: rgba(0,156,59,0.65);
  box-shadow: 0 0 0 2px rgba(0,156,59,0.25), 0 8px 24px rgba(0,156,59,0.18);
  background:
    linear-gradient(180deg, rgba(0,156,59,0.10), rgba(0,0,0,0)) , var(--surface);
}
.wc-match-card--live { border-color: rgba(239,68,68,0.55); }
.wc-match-card--live .wc-live-dot {
  color: #fecaca; font-weight: 700; font-size: 13px;
  animation: wc-pulse 1.4s ease-in-out infinite;
}
@keyframes wc-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.wc-match-card--done { opacity: 0.85; }

.wc-match-head {
  display: flex; gap: 8px; align-items: center;
  font-size: 11.5px; color: var(--text-2);
}
.wc-group-tag {
  padding: 2px 8px; border-radius: 999px; font-weight: 700;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  font-size: 11px; letter-spacing: 0.4px;
}
.wc-stage-tag { background: rgba(254,205,7,0.18); color: #ffe177; border-color: rgba(254,205,7,0.45); }
.wc-kickoff { margin-left: auto; font-variant-numeric: tabular-nums; }
.wc-match-teams {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
}
.wc-team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.wc-team--away { justify-content: flex-end; text-align: right; }
.wc-team.is-brazil .wc-team-name { color: #d9fbe2; font-weight: 700; }
.wc-team-name {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-flag { font-size: 20px; line-height: 1; display: inline-block; vertical-align: middle; }
.wc-score-wrap { font-weight: 800; font-size: 18px; min-width: 56px; text-align: center; }
.wc-vs { color: var(--muted); font-weight: 500; font-size: 13px; }
.wc-score { font-variant-numeric: tabular-nums; }
.wc-match-foot {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--text-2);
}
.wc-venue { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wc-broadcast {
  padding: 2px 8px; border-radius: 999px;
  background: rgba(34,197,94,0.14); color: #bbf7d0;
  border: 1px solid rgba(34,197,94,0.40); font-size: 11px; font-weight: 600;
  white-space: nowrap;
}

.wc-groups-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.wc-group-table {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
}
.wc-group-table--brazil {
  border-color: rgba(0,156,59,0.6);
  box-shadow: 0 0 0 2px rgba(0,156,59,0.22);
}
.wc-group-name {
  font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 8px; font-weight: 700;
}
.wc-group-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wc-group-table th, .wc-group-table td {
  text-align: right; padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wc-group-table th { color: var(--muted); font-weight: 500; font-size: 11px; }
.wc-group-table td.wc-tn, .wc-group-table th:first-child { text-align: left; }
.wc-group-table tr.is-brazil-row td {
  background: rgba(0,156,59,0.16);
  color: #d9fbe2;
}

.wc-bracket .empty,
.wc-scorers ol:empty { display: none; }
.wc-scorers ol { list-style: none; padding: 0; margin: 0; }
.wc-scorers li {
  display: grid;
  grid-template-columns: 28px 24px 1fr auto auto;
  align-items: center; gap: 8px;
  padding: 8px 6px; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.wc-scorer-rank { font-weight: 700; color: var(--muted); }
.wc-scorer-team { color: var(--text-2); font-size: 12px; }
.wc-scorer-goals { font-weight: 700; }

.adam-next--wc {
  border-color: rgba(0,156,59,0.65) !important;
  box-shadow: 0 12px 36px rgba(0,156,59,0.25) !important;
  background:
    linear-gradient(180deg, rgba(0,156,59,0.20), rgba(254,205,7,0.10));
}
.adam-next--wc .adam-next-eyebrow { color: #ffe177; }

@media (max-width: 640px) {
  .wc-countdown-hero { padding: 22px 16px; }
  .wc-countdown-big { font-size: 22px; }
  .wc-today-grid, .wc-groups-grid { grid-template-columns: 1fr; }
  .wc-match-teams { gap: 6px; }
  .wc-team-name { font-size: 14px; }
}
@media (max-width: 380px) {
  .wc-countdown-big { font-size: 19px; }
  .wc-flag { font-size: 17px; }
  .wc-score-wrap { min-width: 44px; font-size: 16px; }
  .wc-kickoff { font-size: 10.5px; }
}
/* WC fixtures (all-matches browser, used pre and during tournament) */
.wc-fixtures { margin-top: 24px; }
.wc-day {
  margin: 12px 0;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.wc-day[open] { background: rgba(255,255,255,0.04); }
.wc-day > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  font-weight: 600;
  transition: background 0.15s;
}
.wc-day > summary:hover { background: rgba(255,255,255,0.04); }
.wc-day > summary::-webkit-details-marker { display: none; }
.wc-day > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s;
  color: var(--text-2, #aaa);
  margin-right: 4px;
}
.wc-day[open] > summary::before { transform: rotate(90deg); }
.wc-day-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wc-day-count {
  font-size: 12px; font-weight: 500;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.06); color: var(--text-2, #aaa);
}
.wc-day-brazil {
  font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(254,205,7,0.22), rgba(0,156,59,0.28));
  color: #d9fbe2;
}
.wc-day--brazil { border-color: rgba(0,156,59,0.28); }
.wc-day-grid {
  padding: 0 12px 14px 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
@media (max-width: 640px) {
  .wc-day > summary { padding: 12px 12px; }
  .wc-day-grid { padding: 0 8px 10px 8px; grid-template-columns: 1fr; }
}
/* Flag images (replaces emoji-flag rendering which Windows shows as letter pairs).
   Span.wc-flag remains for emoji fallback (TBD teams in knockout). */
img.wc-flag {
  width: 22px; height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10);
  object-fit: cover;
  vertical-align: -3px;
  display: inline-block;
  background: rgba(255,255,255,0.04);
}
.wc-team img.wc-flag { margin-right: 8px; }
.wc-tn img.wc-flag { margin-right: 6px; }
.wc-scorers li img.wc-flag { margin-right: 6px; }
.wc-day-brazil img.wc-flag { width: 18px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.wc-countdown-brazil img.wc-flag { width: 24px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.adam-next--wc img.wc-flag { width: 22px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ===== Wave 1 — match-day polish ===== */
/* Pulse the actual score numerals during a live match, in addition to the
   existing red border on .wc-match-card--live. */
.wc-score--pulse {
  animation: wc-pulse 1.4s ease-in-out infinite;
  color: #ff6b6b;
}
.wc-match-card--brazil .wc-score--pulse { color: #ffe177; }

/* Per-card 🔗 share button (also used by Wave 2 deep-linking). */
.wc-share-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); border-radius: 999px;
  width: 26px; height: 26px; padding: 0; margin-left: 4px;
  cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wc-share-btn:hover { background: var(--surface-strong); color: var(--text); border-color: var(--border-strong); }

/* Brazil match-day takeover hero — kickoff/score/broadcast/form pills.
   Sits on top of the rugby hero on /#adam during a Brazil match-day. */
.wc-hero-takeover { padding-bottom: 16px; }
.wc-hero-takeover .wc-hero-opp { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.wc-hero-venue { color: var(--text-2); margin-left: 8px; }
.wc-hero-bcast { display: flex; flex-wrap: wrap; gap: 6px; }
.wc-hero-cd-row { font-size: 18px; font-weight: 700; margin-top: 4px; }
.wc-hero-cd-row .wc-cd-mini { font-size: 18px; }
.wc-hero-cd-row .wc-hero-cd-num { color: #ffe177; }
.wc-hero-form {
  display: inline-flex; gap: 4px; margin-top: 10px;
  align-items: center;
}
.wc-hero-form::before {
  content: "Form:"; color: var(--muted); font-size: 11px;
  letter-spacing: 0.6px; text-transform: uppercase; margin-right: 6px;
}
.wc-form-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: 11px; font-weight: 800; line-height: 1;
}
.wc-form-pill--w { background: rgba(45,208,120,0.22); color: #6cf2a3; border: 1px solid rgba(45,208,120,0.5); }
.wc-form-pill--l { background: rgba(255,77,109,0.22); color: #ff8aa0; border: 1px solid rgba(255,77,109,0.5); }
.wc-form-pill--d { background: rgba(255,203,5,0.20);  color: #ffe27a; border: 1px solid rgba(255,203,5,0.5); }
.wc-hero-jump {
  display: inline-block; margin-top: 10px;
  color: #ffe177; text-decoration: none; font-weight: 600; font-size: 13px;
}
.wc-hero-jump:hover { text-decoration: underline; }

.wc-scorers--empty .empty {
  padding: 14px; color: var(--text-2); text-align: center;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: 12px;
}
.wc-scorers--empty ol:empty { display: block; } /* override the global ":empty hides" rule for the empty-state copy */
@media (prefers-reduced-motion: reduce) {
  .wc-score--pulse, .wc-match-card--live .wc-live-dot { animation: none; }
}

/* ===== Light-theme WC overrides (was after general light-theme block in styles.css) ===== */
/* Keep Brazil greens popping in light mode (dark-on-light reads OK). */
:root[data-theme="light"] .adam-next--wc,
:root[data-theme="light"] .wc-match-card--brazil,
:root[data-theme="light"] .wc-group-table--brazil { color: #0f172a; }
:root[data-theme="light"] .wc-team.is-brazil .wc-team-name { color: #064e23; }
