/* ===========================================================
   WC26 — cyber-wyse extension stylesheet
   Tokens follow cyber-wyse: dark base, mono+display+body fonts,
   single gold accent for AI/data, tri-country accents on hosts.
   =========================================================== */

:root {
  --bg-base:        #0a0a0a;
  --bg-card:        #141414;
  --bg-card-hover:  #1a1a1a;
  --bg-elevated:    #1d1d1d;
  --text:           #f5f5f5;
  --text-dim:       #a0a0a0;
  --text-faint:     #606060;
  --border:         #2a2a2a;
  --border-strong:  #3a3a3a;

  /* WC26 — host country accents */
  --can: #ff3a2d;
  --usa: #3b6bd8;
  --mex: #00a86b;

  /* Tournament gold — primary accent, replaces cyber-wyse teal here */
  --gold:        #d4af37;
  --gold-bright: #f4c950;
  --gold-dim:    #8a721f;

  --font-mono:    'Share Tech Mono', ui-monospace, monospace;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
}

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

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); font-size: 0.875em; letter-spacing: 0.04em; }
.dim  { color: var(--text-dim); }
.accent { color: var(--gold); }

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold-dim);
  transition: color .15s, border-color .15s;
}
a:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

/* ---------- Nav ---------- */

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px clamp(20px, 4vw, 60px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}
.site-nav .brand {
  color: var(--text);
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 16px;
}
.site-nav .crumbs { color: var(--text-dim); }
.site-nav .crumbs .dim { margin: 0 6px; color: var(--text-faint); }
.site-nav .nav-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
}
.site-nav .nav-link {
  color: var(--text-dim);
  border-bottom: 1px dotted transparent;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.site-nav .nav-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold-dim);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-dim);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ---------- Tri ribbon ---------- */

.tri-ribbon {
  display: flex;
  height: 4px;
}
.tri-ribbon span { flex: 1; display: block; }
.tri-ribbon .r-can { background: var(--can); }
.tri-ribbon .r-usa { background: var(--usa); }
.tri-ribbon .r-mex { background: var(--mex); }

/* ---------- Page header ---------- */

.page-header {
  padding: clamp(40px, 7vw, 80px) clamp(20px, 4vw, 60px) 36px;
  border-bottom: 1px solid var(--border);
}
.num-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 18px;
  letter-spacing: 0.08em;
}
.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.page-header h1 .accent { display: block; color: var(--gold); }
.lede {
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 16px;
  margin: 0 0 24px;
}
.lede-warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin: -12px 0 24px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  background: rgba(217, 119, 6, 0.08);
  border-left: 2px solid #d97706;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: nowrap;
  max-width: 100%;
}
.lede-warn span[aria-hidden] { color: #f59e0b; font-size: 14px; }
.lede-warn strong { color: var(--text); font-weight: 500; }
.lede-warn a { color: var(--text-dim); border-bottom-color: var(--text-faint); }
.lede-warn a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* On narrow screens, let it wrap rather than overflow */
@media (max-width: 600px) {
  .lede-warn { white-space: normal; }
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* ---------- Stat grid ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-card {
  background: var(--bg-base);
  padding: 24px clamp(20px, 3vw, 32px);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  margin: 8px 0 4px;
  color: var(--text);
  line-height: 1.1;
}
.stat-value.mono { font-family: var(--font-mono); font-weight: 400; }
.stat-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Sections ---------- */

.section {
  padding: 48px clamp(20px, 4vw, 60px);
  border-bottom: 1px solid var(--border);
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.section.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}
@media (max-width: 760px) {
  .section.two-col { grid-template-columns: 1fr; }
}

/* ---------- Contender list ---------- */

.contender-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contender-list .row {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: background .15s, border-color .15s;
}
.contender-list .row-link {
  display: grid;
  grid-template-columns: 30px 1fr 80px 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  border: none;
}
.contender-list .row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.contender-list .rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}
.contender-list .team-name { display: flex; align-items: center; gap: 8px; }
.contender-list .host-flag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
}
.contender-list .host-flag.h-can { color: var(--can); }
.contender-list .host-flag.h-usa { color: var(--usa); }
.contender-list .host-flag.h-mex { color: var(--mex); }
.contender-list .row.host-can { border-left: 3px solid var(--can); }
.contender-list .row.host-usa { border-left: 3px solid var(--usa); }
.contender-list .row.host-mex { border-left: 3px solid var(--mex); }
.contender-list .pct {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
  color: var(--gold);
}
.contender-list .bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.contender-list .bar > span {
  display: block;
  height: 100%;
  background: var(--gold-dim);
}
.contender-list .shift {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: 8px;
}
.shift.up   { color: #4ade80; }
.shift.down { color: #f87171; }
.shift.flat { color: var(--text-faint); }

/* ---------- Match cards ---------- */

.match-stack { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.card-meta .badge {
  background: var(--bg-elevated);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 3px;
}
.card-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.card-score .team {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
}
.card-score .team.away { text-align: right; }
.card-score .score {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.card-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.65;
}
.card-summary::before {
  content: "AI";
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  margin-right: 8px;
  letter-spacing: 0.1em;
}

/* host accent strips on team names */
.team.host-can { border-left: 3px solid var(--can); padding-left: 8px; }
.team.host-usa { border-left: 3px solid var(--usa); padding-left: 8px; }
.team.host-mex { border-left: 3px solid var(--mex); padding-left: 8px; }
.team.away.host-can,
.team.away.host-usa,
.team.away.host-mex {
  border-left: none;
  border-right: 3px solid;
  padding-left: 0;
  padding-right: 8px;
}
.team.away.host-can { border-right-color: var(--can); }
.team.away.host-usa { border-right-color: var(--usa); }
.team.away.host-mex { border-right-color: var(--mex); }

/* ---------- Narrative card ---------- */

.narrative-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.narrative-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.narrative-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

/* ---------- Fixtures ---------- */

.fixture-list { display: flex; flex-direction: column; gap: 6px; }
.fixture-date-header {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  padding: 14px 4px 6px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 4px;
}
.fixture-date-header:first-child { padding-top: 4px; }
.fixture-list .row {
  display: grid;
  grid-template-columns: 95px 1fr auto 1fr 90px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.fixture-list .row .when {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.fixture-list .row .when-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gold-dim);
}
.fixture-list .row .when-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.fixture-list .row .vs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.fixture-list .row .group {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
}
.fixture-list .row .away { text-align: right; }
.fixture-list .row .prob {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold-dim);
  display: block;
  margin-top: 2px;
}

/* ---------- Footer ---------- */

.page-footer {
  padding: 32px clamp(20px, 4vw, 60px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page-footer p { margin: 0; font-size: 12px; }

.disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid #d97706;
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.disclaimer p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0;
}
.disclaimer p strong {
  color: var(--text);
  font-weight: 500;
}
.disclaimer-head {
  color: #f59e0b !important;
  font-size: 12px !important;
  letter-spacing: 0.08em;
  margin-bottom: 2px !important;
}
.disclaimer a {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}
.disclaimer a:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

/* ---------- Loading ---------- */

.skeleton {
  color: var(--text-faint);
  background: var(--bg-card);
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ===========================================================
   Teams index + team detail pages
   =========================================================== */

/* -- Filter bar (teams index) -- */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--bg-elevated);
}

/* -- Teams index grid -- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.team-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background .15s, border-color .15s, transform .15s;
}
.team-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.team-card.host-can { border-left: 3px solid var(--can); }
.team-card.host-usa { border-left: 3px solid var(--usa); }
.team-card.host-mex { border-left: 3px solid var(--mex); }
.team-card-rank { color: var(--text-faint); font-size: 13px; }
.team-card-body { min-width: 0; }
.team-card-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.005em;
}
.team-card-meta {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.team-card-stat { text-align: right; }
.team-card-pct {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--gold);
}

.host-flag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  font-weight: 400;
}
.host-flag.h-can { color: var(--can); }
.host-flag.h-usa { color: var(--usa); }
.host-flag.h-mex { color: var(--mex); }

/* -- Team detail header -- */
.team-header.host-can { border-left: 4px solid var(--can); padding-left: clamp(16px, 4vw, 56px); }
.team-header.host-usa { border-left: 4px solid var(--usa); padding-left: clamp(16px, 4vw, 56px); }
.team-header.host-mex { border-left: 4px solid var(--mex); padding-left: clamp(16px, 4vw, 56px); }

.page-header h1 .host-flag {
  font-size: 12px;
  vertical-align: middle;
  margin-left: 12px;
}

/* -- Group standings table -- */
.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.group-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 400;
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.group-table th.num { text-align: right; }
.group-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.group-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.group-table td.pts { color: var(--text); font-weight: 500; }
.group-table tr:last-child td { border-bottom: none; }
.group-table tr.highlight td { background: var(--bg-elevated); color: var(--text); }
.group-table tr.highlight td.pts { color: var(--gold); }
.group-table tr.host-can td:nth-child(2) { border-left: 2px solid var(--can); }
.group-table tr.host-usa td:nth-child(2) { border-left: 2px solid var(--usa); }
.group-table tr.host-mex td:nth-child(2) { border-left: 2px solid var(--mex); }

/* -- Team match cards (extend existing card styles) -- */
.team-match.win  .badge { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.team-match.loss .badge { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.team-match.draw .badge { background: var(--bg-elevated); color: var(--text-dim); }
.team-match.upcoming { opacity: 0.85; }
.team-match.upcoming .badge.upcoming {
  background: var(--bg-elevated);
  color: var(--gold-dim);
}
.team-match .card-score .score.dim {
  font-size: 14px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.prob-readout {
  color: var(--gold-dim);
  font-size: 12px;
}
.prob-readout::before {
  content: "PROJ";
  font-size: 10px;
  color: var(--gold);
  margin-right: 8px;
  letter-spacing: 0.1em;
}

/* override the AI prefix when this is just a projection */
.team-match.upcoming .card-summary::before { content: ""; margin: 0; }

/* -- The model's path list -- */
.path-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.path-list li {
  display: grid;
  grid-template-columns: 220px 1fr 60px;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.path-label { color: var(--text-dim); }
.path-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.path-bar > span {
  display: block;
  height: 100%;
  background: var(--gold-dim);
}
.path-pct {
  text-align: right;
  color: var(--gold);
  font-size: 13px;
}
@media (max-width: 600px) {
  .path-list li {
    grid-template-columns: 1fr 50px;
    grid-template-rows: auto auto;
  }
  .path-label { grid-column: 1 / -1; }
}
