/* ============================================================
   WC '26 PREDICT — DESIGN TOKENS & THEME SYSTEM
   ============================================================ */

:root {
  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Container */
  --max-width: 1200px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.65, 0.3, 1);
  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-slow: 420ms;

  /* Color (accent stays constant across themes) */
  --accent: hsl(140 65% 50%);
  --accent-deep: hsl(140 65% 40%);
  --accent-soft: hsl(140 65% 50% / 0.12);
  --live: hsl(0 75% 60%);
  --live-soft: hsl(0 75% 60% / 0.15);
}

/* DARK theme (default) */
:root,
[data-theme="dark"] {
  --bg: hsl(28 12% 7%);
  --bg-elevated: hsl(30 10% 10%);
  --bg-card: hsl(32 9% 11%);
  --bg-input: hsl(30 8% 14%);
  --fg: hsl(40 18% 94%);
  --fg-muted: hsl(35 10% 65%);
  --fg-dim: hsl(35 8% 45%);
  --border: hsl(30 10% 18%);
  --border-strong: hsl(30 10% 26%);
  --shadow-card: 0 1px 0 hsl(30 10% 18%), 0 12px 24px -12px hsl(0 0% 0% / 0.4);
  --selection-bg: var(--accent-soft);
  --selection-fg: var(--accent);
}

/* LIGHT theme */
[data-theme="light"] {
  --bg: hsl(40 28% 96%);
  --bg-elevated: hsl(38 22% 98%);
  --bg-card: hsl(40 30% 99%);
  --bg-input: hsl(40 20% 94%);
  --fg: hsl(28 22% 12%);
  --fg-muted: hsl(28 10% 38%);
  --fg-dim: hsl(28 8% 55%);
  --border: hsl(35 18% 86%);
  --border-strong: hsl(35 16% 72%);
  --shadow-card: 0 1px 0 hsl(35 18% 86%), 0 8px 18px -10px hsl(28 22% 12% / 0.12);
  --selection-bg: var(--accent-soft);
  --selection-fg: var(--accent-deep);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  min-height: 100vh;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-feature-settings: inherit;
}

input {
  font: inherit;
  color: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
input:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-8);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 32;
}
.brand-mark { color: var(--fg); }
.brand-year { color: var(--accent); font-style: italic; }

.primary-nav {
  display: flex;
  gap: var(--sp-1);
  justify-self: center;
}
.nav-link {
  padding: var(--sp-2) var(--sp-3);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg-muted);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--fg); background: var(--bg-elevated); }
.nav-link.is-active { color: var(--fg); background: var(--bg-elevated); }

.header-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.icon-button:hover { color: var(--fg); background: var(--bg-elevated); }

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.wallet-button {
  height: 38px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.wallet-button:hover { transform: translateY(-1px); }
.wallet-button[data-state="connected"] {
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
}
.wallet-button[data-state="connected"]::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   PAGES
   ============================================================ */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6) var(--sp-24);
  min-height: calc(100vh - 200px);
}

.page[hidden] { display: none; }

.page-header { margin-bottom: var(--sp-8); }
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: var(--sp-3) 0 0;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 72;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
  margin: 0;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: var(--sp-6);
  transition: color var(--dur-fast) var(--ease);
}
.back-link:hover { color: var(--accent); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  margin-bottom: var(--sp-16);
  max-width: 900px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 7.5vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: var(--sp-3) 0 var(--sp-6);
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 96;
}
.hero-title em {
  font-style: italic;
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 96;
  color: var(--accent);
}

.hero-lead {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 580px;
  margin: 0 0 var(--sp-12);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-6);
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: var(--sp-2); }
.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}

/* ============================================================
   FILTER TABS
   ============================================================ */

.match-controls {
  margin-bottom: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.filter-tabs {
  display: inline-flex;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: var(--sp-2) var(--sp-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: 6px;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--fg); }
.filter-tab.is-active {
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.08);
}

/* ============================================================
   MATCH CARDS
   ============================================================ */

.match-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-4);
}

.match-card {
  display: block;
  padding: var(--sp-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  position: relative;
  overflow: hidden;
}
.match-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
}
.match-stage {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}
.match-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.match-teams {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.match-team {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
}
.team-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 24;
}
.team-score {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.match-card[data-status="live"] .team-score,
.match-card[data-status="finished"] .team-score,
.match-card[data-status="resolved"] .team-score {
  color: var(--fg);
}

.match-card[data-status="live"]::before {
  content: "LIVE";
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-6);
  background: var(--live-soft);
  color: var(--live);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 4px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.match-pools {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-2);
  font-size: 11px;
}
.pool-pill {
  text-align: center;
  padding: var(--sp-2) var(--sp-1);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pool-pill-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: var(--fg-dim);
  font-weight: 600;
}
.pool-pill-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-6);
  background: var(--accent);
  color: hsl(140 60% 8%);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  cursor: pointer;
}
.primary-button:hover { background: var(--accent-deep); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-6);
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  cursor: pointer;
}
.secondary-button:hover { background: var(--bg-elevated); border-color: var(--fg-muted); }

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */

.empty-state {
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
  color: var(--fg-muted);
  font-size: 15px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.65);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: var(--sp-6);
  animation: backdrop-in var(--dur) var(--ease);
}
.modal-backdrop[hidden] { display: none; }

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  animation: modal-in var(--dur-slow) var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 32;
}
.modal-lead {
  color: var(--fg-muted);
  font-size: 14px;
  margin: 0 0 var(--sp-6);
  line-height: 1.5;
}

#username-form {
  display: flex;
  gap: var(--sp-2);
}
#username-form input { flex: 1; }

.modal-error {
  color: var(--live);
  font-size: 13px;
  margin: var(--sp-3) 0 0;
}

/* ============================================================
   TOASTS
   ============================================================ */

.toast-stack {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 14px;
  max-width: 360px;
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  animation: toast-in var(--dur) var(--ease);
}
.toast[data-tone="success"] { border-left: 3px solid var(--accent); }
.toast[data-tone="error"] { border-left: 3px solid var(--live); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-16);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-6);
  font-size: 13px;
  color: var(--fg-muted);
  text-align: center;
}
.footer-inner a { color: var(--accent); }
.footer-inner a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: auto auto;
    gap: var(--sp-4);
  }
  .primary-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-self: stretch;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .primary-nav::-webkit-scrollbar { display: none; }
  main { padding-top: var(--sp-8); }
  .wallet-button .wallet-label { display: none; }
  .wallet-button { padding: 0 var(--sp-3); }
  .wallet-button[data-state="disconnected"] .wallet-label { display: inline; }
}

/* ============================================================
   MATCH DETAIL PAGE
   ============================================================ */

.match-detail { max-width: 720px; margin: 0 auto; }

.match-detail-header {
  margin-bottom: var(--sp-12);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border);
}

.match-detail-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-6);
  align-items: center;
  margin: var(--sp-4) 0 var(--sp-6);
}

.match-detail-team { text-align: center; }
.match-detail-team-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 60;
}

.match-detail-vs,
.live-score-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 3vw, 32px);
  color: var(--fg-muted);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 32;
}

.live-score-display {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.live-score-sep { color: var(--fg-dim); margin: 0 var(--sp-2); }

.match-detail-meta { text-align: center; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.status-badge.is-live {
  background: var(--live-soft);
  color: var(--live);
  border-color: transparent;
  animation: pulse 1.6s ease-in-out infinite;
}
.status-badge.is-resolved { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status-badge.is-warning { background: hsl(40 80% 50% / 0.15); color: hsl(40 80% 50%); border-color: transparent; }
.status-badge.is-claimed { background: var(--bg-elevated); color: var(--fg-muted); }

/* ──────────────  Predict form ────────────── */

.predict-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  margin-bottom: var(--sp-8);
}

.pick-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-6);
}

.pick-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  min-height: 90px;
}
.pick-button:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.pick-button.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pick-button-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 24;
}
.pick-button-meta {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}
.pick-button.is-selected .pick-button-meta { color: var(--accent-deep); }

.stake-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  align-items: end;
}

.stake-input-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.stake-input-wrap input {
  font-family: var(--font-mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.stake-label, .payout-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
}
.stake-suffix {
  display: none;
}

.payout-display {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  text-align: right;
}
.payout-value {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#submit-prediction-btn {
  width: 100%;
  height: 52px;
  font-size: 16px;
}

.predict-disclaimer {
  font-size: 12px;
  color: var(--fg-dim);
  text-align: center;
  margin: var(--sp-3) 0 0;
}

/* ──────────────  My-prediction panel ────────────── */

.my-prediction-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
}

.my-prediction-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-3);
  gap: var(--sp-4);
}

.my-prediction-pick {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 36;
}

.my-prediction-stake {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  font-size: 14px;
  margin-top: 4px;
}

.pick-status {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
  text-align: right;
}
.pick-status.pick-won { color: var(--accent); }
.pick-status.pick-lost { color: var(--live); }
.pick-status.pick-pending { color: var(--fg-muted); }

/* ──────────────  Pools display ────────────── */

.pools-display {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.pools-bars {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.pool-bar {
  display: grid;
  grid-template-columns: 1fr 60px;
  gap: var(--sp-3);
  align-items: center;
}
.pool-bar-header {
  grid-column: 1;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.pool-bar-label { color: var(--fg); font-weight: 500; }
.pool-bar-value { color: var(--fg-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.pool-bar-track {
  grid-column: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.pool-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--dur) var(--ease);
}
.pool-bar-pct {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pools-total {
  margin-top: var(--sp-4);
  font-size: 13px;
  color: var(--fg-muted);
  text-align: right;
}
.pools-total strong { color: var(--fg); font-family: var(--font-mono); }

@media (max-width: 540px) {
  .pick-buttons { grid-template-columns: 1fr; }
  .stake-row { grid-template-columns: 1fr; }
  .payout-display { text-align: left; }
}


/* ============================================================
   MY PICKS PAGE
   ============================================================ */

.my-picks-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  padding: var(--sp-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.my-picks-stat { text-align: center; }
.my-picks-stat-value {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 36;
}
.my-picks-stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: var(--sp-2);
  font-weight: 600;
}

.my-picks-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  max-width: 720px;
  margin: 0 auto;
}

.my-pick-card {
  display: block;
  padding: var(--sp-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.my-pick-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.my-pick-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.my-pick-teams {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-4);
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 24;
}

.my-pick-detail {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-3);
  align-items: end;
}

.my-pick-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 2px;
}
.my-pick-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

/* ============================================================
   LEADERBOARD PAGE
   ============================================================ */

.leaderboard-table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.leaderboard-table thead {
  background: var(--bg-elevated);
}
.leaderboard-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}
.leaderboard-table th.num,
.leaderboard-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.leaderboard-table td.mono { font-family: var(--font-mono); }

.leaderboard-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.leaderboard-table tbody tr:hover { background: var(--bg-elevated); }
.leaderboard-table tbody tr:last-child td { border-bottom: none; }

.leaderboard-table td.rank {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-muted);
  width: 40px;
}
.leaderboard-table tbody tr:nth-child(1) .rank { color: hsl(45 95% 55%); }
.leaderboard-table tbody tr:nth-child(2) .rank { color: hsl(0 0% 75%); }
.leaderboard-table tbody tr:nth-child(3) .rank { color: hsl(30 60% 50%); }

.leaderboard-table .player-name {
  font-weight: 600;
  color: var(--fg);
}

/* ============================================================
   SHARED
   ============================================================ */

.link-accent {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.link-accent:hover { text-decoration: underline; }

.back-link {
  display: inline-block;
  margin-bottom: var(--sp-6);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.05em;
  transition: color var(--dur-fast) var(--ease);
}
.back-link:hover { color: var(--fg); }

@media (max-width: 720px) {
  .my-picks-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .my-pick-detail { grid-template-columns: 1fr 1fr; }
  .leaderboard-table { font-size: 13px; }
  .leaderboard-table th, .leaderboard-table td { padding: var(--sp-2) var(--sp-3); }
}


/* ============================================================
   FLAGS
   ============================================================ */

/* Match card team flags */
.team-flag {
  width: 28px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--sp-3);
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}

.match-team {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}
.match-team .team-name {
  flex: 1;
}
.match-team .team-score {
  margin-left: auto;
}

/* Match detail page — big flags above team names */
.match-detail-flag {
  display: block;
  width: 80px;
  height: auto;
  margin: 0 auto var(--sp-4);
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--border);
  object-fit: cover;
  aspect-ratio: 3 / 2;
}

/* Pick button flags — centered */
.pick-flag {
  width: 44px;
  height: auto;
  margin: 0 auto var(--sp-2);
  display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border);
  object-fit: cover;
  aspect-ratio: 3 / 2;
}
.pick-draw-icon {
  display: block;
  font-size: 28px;
  margin: 0 auto var(--sp-2);
  height: 30px;
  width: 44px;
  text-align: center;
  color: var(--fg-muted);
  filter: grayscale(1);
}

/* My picks card flags */
.my-pick-teams {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.my-pick-flag {
  width: 28px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}
.my-pick-vs {
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  padding: 0 var(--sp-1);
}

/* On small screens, shrink flags slightly */
@media (max-width: 540px) {
  .team-flag { width: 22px; }
  .match-detail-flag { width: 60px; }
  .pick-flag { width: 36px; }
  .my-pick-flag { width: 24px; }
}

/* ============================================================
   FOOTER LINKS
   ============================================================ */

.footer-links {
  margin-top: var(--sp-2);
  font-size: 13px;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}
.footer-links a:hover {
  color: var(--accent-deep, var(--accent));
  text-decoration: underline;
}

.footer-sep {
  color: var(--fg-dim);
  font-weight: 400;
}

@media (max-width: 540px) {
  .footer-links {
    font-size: 12px;
    gap: var(--sp-1);
  }
}
