:root {
  --bg: #050505;
  --surface: #1f1f1f;
  --surface-2: #262626;
  --surface-3: #2e2e2e;
  --border: #343537;
  --border-soft: rgba(255,255,255,0.05);
  --text: #f5f5f5;
  --text-2: #b5b5b7;
  --muted: #656567;
  --accent: #0d51fb;
  --accent-deep: #103693;
  --accent-glow: rgba(13,81,251,0.45);
  --accent-soft: rgba(13,81,251,0.12);

  --nav-h: 58px;
  --font: 'Public Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
}

body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

#app { min-height: 100vh; }
.view { display: block; animation: view-in 0.22s var(--ease); }
.view.hidden { display: none; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Masthead ---------- */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  padding-top: calc(18px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
}
.masthead-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.masthead-brand .brand-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}
.masthead-brand .brand-ai {
  color: var(--accent);
  font-weight: 800;
}
.masthead-edition {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

/* ---------- Feed ---------- */
.feed { padding: 0; }

.feed-loading {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

/* ---------- Date section ---------- */
.date-section { padding: 22px 20px 4px; }
.date-section + .date-section { border-top: 1px solid var(--border); }

.date-headline {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 14px;
}
.dh-weekday {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.dh-date {
  font-size: 10px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.date-headline .dh-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.date-headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 14px;
}

/* ---------- League block ---------- */
.league-block { margin-bottom: 18px; }

.league-title {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0 8px;
}
.league-title img {
  width: 15px; height: 15px; object-fit: contain;
  opacity: 0.9;
}
.lt-name {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
}
.lt-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ---------- Fixture row ---------- */
.fixture {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: transform 0.12s var(--ease),
              background 0.15s var(--ease),
              border-color 0.15s var(--ease);
  position: relative;
  overflow: hidden;
}
.fixture::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.25s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.fixture:active {
  transform: scale(0.985);
  background: var(--surface-2);
  border-color: var(--accent);
}
.fixture:active::after {
  opacity: 1;
  transform: translateX(100%);
}

.fixture-teams { flex: 1; min-width: 0; }
.fx-team {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 0;
}
.fx-team img {
  width: 20px; height: 20px; object-fit: contain;
  flex-shrink: 0;
}
.fx-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fixture-time {
  flex-shrink: 0;
  text-align: right;
  min-width: 54px;
}
.ft-time {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- Match detail ---------- */
.match-header {
  padding: 20px 20px 24px;
  padding-top: calc(20px + env(safe-area-inset-top));
  position: relative;
  border-bottom: 1px solid var(--border);
}
.match-back {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top)); left: 14px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  padding: 0;
}
.match-back:active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(0.92);
  box-shadow: 0 0 0 6px var(--accent-glow);
}
.match-kicker {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  margin-bottom: 18px;
  margin-top: 4px;
}
.match-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.match-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.match-team img {
  width: 46px; height: 46px; object-fit: contain;
}
.mt-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}
.match-vs {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  padding-top: 36px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------- Win probability ---------- */
.win-prob {
  padding: 26px 20px 24px;
  border-bottom: 1px solid var(--border);
}
.wp-kicker {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}
.wp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.wp-col { text-align: left; }
.wp-num {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s var(--ease);
}
.wp-num .wp-unit {
  font-size: 0.45em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.wp-col.wp-top .wp-num { color: var(--accent); }
.wp-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ---------- Win Probability Bar ---------- */
.wp-bar {
  display: flex;
  height: 14px; /* Fatter */
  background: var(--surface-3);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.wp-seg {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Home Team Color (Matches Jersey) */
.wp-seg.home {
  background: #0d51fb; 
}

/* Draw Color (Ash/Grey) */
.wp-seg.draw {
  background: #a1a1aa;
  /* Adds a tiny separation line between segments */
  border-left: 1px solid rgba(0,0,0,0.1);
  border-right: 1px solid rgba(0,0,0,0.1);
}

/* Away Team Color (Matches Jersey) */
.wp-seg.away {
  background: #ef4444; 
}

/* ---------- Sections ---------- */
.section {
  padding: 24px 20px 8px;
  border-bottom: 1px solid var(--border);
  animation: section-in 0.32s var(--ease) backwards;
}
.section:last-child { border-bottom: none; }
.section:nth-of-type(1) { animation-delay: 0.04s; }
.section:nth-of-type(2) { animation-delay: 0.08s; }
.section:nth-of-type(3) { animation-delay: 0.12s; }
.section:nth-of-type(4) { animation-delay: 0.16s; }

@keyframes section-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-kicker {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  margin-bottom: 16px;
  display: block;
}

/* ---------- Pick ---------- */
.pick {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.pick:first-of-type { padding-top: 0; }
.pick:last-child { border-bottom: none; }

.pick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.pick-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  flex: 1;
}
.pick-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.pick-prob {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.risk {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 2px 0;
}
.risk.low { color: #22c55e; }
.risk.medium { color: #f59e0b; }
.risk.high { color: #f87171; }

.pick-insight {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--accent-deep);
}
.pick-meta {
  display: flex;
  gap: 18px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.pick-meta strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.pick-meta .edge strong { color: #22c55e; }

/* ---------- Form / data ---------- */
.data-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-row:last-child { border-bottom: none; }
.dr-label {
  color: var(--text-2);
  font-weight: 400;
}
.dr-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

/* ---------- H2H ---------- */
.h2h-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.h2h-row:last-child { border-bottom: none; }
.h2h-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.h2h-label { color: var(--text-2); }
.h2h-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}
.h2h-track {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.h2h-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s var(--ease);
}

/* ---------- Lineups ---------- */
.lineup-heading {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.lineup-list { margin-bottom: 22px; }
.lineup-player {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.lineup-player:last-child { border-bottom: none; }
.lineup-num {
  min-width: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.lineup-name { color: var(--text); }
.lineup-pos {
  margin-left: auto;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.lineup-player.sub { opacity: 0.5; }

.match-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

/* ---------- Floater ---------- */
.slip-floater {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  z-index: 90;
  box-shadow:
    0 0 0 0 var(--accent-glow),
    0 8px 24px -6px rgba(13,81,251,0.55),
    0 4px 12px -4px rgba(0,0,0,0.4);
  transition: all 0.2s var(--ease);
  animation: floater-pulse 2.8s ease-in-out infinite;
}
@keyframes floater-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow), 0 8px 24px -6px rgba(13,81,251,0.55), 0 4px 12px -4px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(13,81,251,0), 0 8px 24px -6px rgba(13,81,251,0.55), 0 4px 12px -4px rgba(0,0,0,0.4); }
}
.slip-floater svg { width: 15px; height: 15px; }
.slip-floater:active {
  transform: scale(0.94);
  background: var(--accent-deep);
}
.slip-floater.hidden { display: none; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(5,5,5,0.94);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--muted);
  transition: color 0.18s var(--ease);
  position: relative;
}
.nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  transition: transform 0.2s var(--ease);
}
.nav-btn.active { color: var(--text); }
.nav-btn.active .nav-label {
  color: var(--accent);
  transform: translateY(-1px);
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24%;
  right: 24%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 0 12px var(--accent-glow);
  animation: nav-in 0.25s var(--ease);
}
@keyframes nav-in {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ---------- Placeholder ---------- */
.placeholder {
  padding: 80px 32px;
  text-align: center;
}
.placeholder-mark {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 20px;
}
.placeholder-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}
.placeholder-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 280px;
  margin: 0 auto;
}

/* ---------- Hero pick ---------- */
.pick-hero {
  background: linear-gradient(180deg, rgba(13,81,251,0.08) 0%, rgba(13,81,251,0.02) 100%);
  border: 1px solid rgba(13,81,251,0.28);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.pick-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.ph-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ph-cat {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.ph-risk {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.ph-risk.low { color: #22c55e; }
.ph-risk.medium { color: #f59e0b; }
.ph-risk.high { color: #f87171; }

.ph-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 10px;
}
.ph-insight {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}
.pick-hero-multi .ph-stats {
  display: flex;
  align-items: center;
  gap: 24px; /* Gives space between Probability and Fair Odds */
  margin-bottom: 12px;
}

.pick-hero-multi .ph-stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

.pick-hero-multi .ph-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- Grouped picks ---------- */
.picks-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pick-group { }
.pg-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.pick-row:last-child { border-bottom: none; }
.pr-left { min-width: 0; flex: 1; }
.pr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.pr-meta {
  display: flex;
  gap: 10px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pr-prob {
  color: var(--text-2);
  font-weight: 600;
}
.pr-fair { }
.pr-edge {
  font-size: 15px;
  font-weight: 700;
  color: #22c55e;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.pr-edge-unit {
  font-size: 0.65em;
  color: var(--muted);
  margin-left: 1px;
  font-weight: 600;
}

/* ---------- Smaller fixture time ---------- */
.ft-time {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  letter-spacing: 0.02em !important;
}
.fixture-time {
  min-width: 40px !important;
  padding-left: 8px !important;
}

/* ---------- Slip Builder ---------- */
.slip-modes {
  display: flex;
  gap: 0;
  padding: 16px 20px 8px;
}
.slip-mode {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  color: var(--text-2);
  transition: all 0.15s var(--ease);
  border-radius: 10px;
  margin-right: 8px;
}
.slip-mode:last-child { margin-right: 0; }
.slip-mode.active {
  background: linear-gradient(180deg, rgba(13,81,251,0.14) 0%, rgba(13,81,251,0.04) 100%);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(13,81,251,0.08);
}
.sm-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sm-sub {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-top: 2px;
  color: var(--muted);
}
.slip-mode.active .sm-sub { color: var(--accent); opacity: 0.85; }

.slip-panel { padding: 0 20px 32px; }
.slip-panel.hidden { display: none; }

/* Presets */
.slip-presets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 20px;
}
.preset {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  text-align: left;
}
.preset:active {
  transform: scale(0.985);
  border-color: var(--accent);
  background: var(--surface-2);
}
.preset-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.preset-desc {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Filters */
.slip-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 16px;
  margin: 12px 0 16px;
}
.filter-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.filter-row:last-child { border-bottom: none; }
.filter-row label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.filter-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.filter-input-group input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
}
.filter-input-group input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.filter-input-group input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg);
}
.filter-val {
  min-width: 52px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.build-btn {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  box-shadow: 0 8px 24px -8px rgba(13,81,251,0.5);
}
.build-btn:active {
  transform: scale(0.97);
  background: var(--accent-deep);
}

/* Result slip */
.slip-result { margin-top: 20px; }
.slip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--border);
}
.slip-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.slip-copy {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.slip-copy:active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.slip-leg {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.slip-leg:last-child { border-bottom: none; }
.sl-left { min-width: 0; flex: 1; }
.sl-match {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.sl-pick {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.sl-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.sl-odds {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  text-align: right;
}
.sl-odds-unit {
  display: block;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-top: 3px;
}

.slip-totals {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(13,81,251,0.08) 0%, rgba(13,81,251,0.02) 100%);
  border: 1px solid rgba(13,81,251,0.28);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.slip-totals::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}
.st-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.st-col { text-align: left; }
.st-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.st-val.accent { color: var(--accent); }
.st-val.green { color: #22c55e; }
.st-unit {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 1px;
}
.st-lbl {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-top: 8px;
}
.st-note {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.slip-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1efeb;
  --surface-3: #e5e2dc;
  --border: #dcd9d2;
  --border-soft: rgba(0,0,0,0.06);
  --text: #0a0a0a;
  --text-2: #4a4a4a;
  --muted: #8a8a8a;
  --accent: #0d51fb;
  --accent-deep: #103693;
  --accent-glow: rgba(13,81,251,0.25);
  --accent-soft: rgba(13,81,251,0.08);
}
[data-theme="light"] .bottom-nav {
  background: rgba(247,246,243,0.94);
}
[data-theme="light"] .fixture { background: var(--surface); }

/* Nav label size for 5 tabs */
.nav-label { font-size: 10px; letter-spacing: 0.1em; }
.nav-btn { padding: 6px 4px; }

/* ---------- Settings ---------- */
.settings-body { padding: 0 0 40px; }

.settings-section {
  padding: 20px 20px 8px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }

.settings-kicker {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  margin-bottom: 12px;
  display: block;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row.static { padding: 12px 0; }

.sr-label { min-width: 0; flex: 1; }
.sr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.sr-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.sr-control { flex-shrink: 0; }
.sr-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.settings-row select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23656567' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 30px;
  min-width: 130px;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 100px;
  transition: 0.2s var(--ease);
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; top: 3px;
  background: var(--text-2);
  border-radius: 50%;
  transition: 0.2s var(--ease);
}
.toggle input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: white;
}

.settings-note {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 0 8px;
  line-height: 1.5;
}

.settings-legal {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  padding: 4px 0 16px;
}

.settings-danger {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(248,113,113,0.3);
  color: #f87171;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  margin: 12px 0;
}
.settings-danger:active {
  background: rgba(248,113,113,0.08);
  border-color: #f87171;
}

/* ---------- Chat ---------- */
#view-chat:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h) - env(safe-area-inset-bottom));
  padding-bottom: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-welcome {
  text-align: center;
  padding: 60px 20px;
}
.cw-icon {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 16px;
}
.cw-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.cw-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 300px;
  margin: 0 auto 24px;
}
.cw-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  margin: 0 auto;
}
.suggestion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 18px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  text-align: left;
}
.suggestion:active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(0.98);
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msg-in 0.2s var(--ease);
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.assistant strong { color: var(--accent); font-weight: 700; }
.chat-msg.error {
  align-self: flex-start;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  color: #f87171;
  font-size: 13px;
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.typing span {
  width: 6px; height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: dot 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-input-bar {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  padding: 12px 16px;
  background: rgba(5,5,5,0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  z-index: 50;
}
[data-theme="light"] .chat-input-bar {
  background: rgba(247,246,243,0.96);
}
#chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 12px 18px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--ease);
}
#chat-input:focus {
  border-color: var(--accent);
}
#chat-input::placeholder { color: var(--muted); }

#chat-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}
#chat-send svg { width: 18px; height: 18px; }
#chat-send:active {
  transform: scale(0.92);
  background: var(--accent-deep);
}
#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chat-msg.assistant code {
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}
.chat-msg.assistant em { font-style: italic; color: var(--text-2); }

/* ---------- Date strip ---------- */
.date-strip {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.date-strip::-webkit-scrollbar { display: none; }

.date-cell {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 54px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.date-cell .dc-weekday {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1;
}

.date-cell .dc-day {
  font-size: 20px;
  font-weight: 700;
  color: inherit;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.date-cell .dc-day {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 17px;
  font-weight: 700;
  color: inherit;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.date-cell .dc-month {
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: inherit;
  opacity: 0.7;
}
.date-cell .dc-count {
  font-size: 10px;
  font-weight: 600;
  color: inherit;
  opacity: 0.65;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Today's cell — subtle dot marker above the weekday */
.date-cell.is-today::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* Active cell — raised surface */
.date-cell.active {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.date-cell.active .dc-count { opacity: 0.9; }
.date-cell.active.is-today::before { background: var(--accent); }

.date-cell .dc-weekday {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1;
  color: inherit;
}

.date-cell .dc-day {
  font-size: 19px;
  font-weight: 700;
  color: inherit;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.date-cell .dc-count {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Active tab: raised surface, subtle elevation */
.date-cell.active {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.date-cell.active .dc-count {
  opacity: 0.9;
}
/* ---------- Finished fixtures ---------- */
.fixture-finished {
  background: var(--surface-2);
  opacity: 0.88;
}
.fixture-finished:active { opacity: 1; }

.ft-score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.02em;
}
.ft-score .ft-goals { min-width: 14px; text-align: center; }
.ft-score .ft-sep { color: var(--muted); font-weight: 400; }

.ft-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.ft-dot.won { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.6); }
.ft-dot.lost { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.5); }

.fx-winner .fx-name {
  font-weight: 700;
  color: var(--text);
}

.fixture-status {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  min-width: 60px;
  justify-content: flex-end;
}

/* Match detail score */
.match-score {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  padding-top: 20px;
  align-self: flex-start;
}
.match-score .ms-sep {
  color: var(--muted);
  font-weight: 400;
  margin: 0 4px;
}

/* Pick resolution badges */
.ph-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-resolution {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.ph-resolution.won {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.ph-resolution.lost {
  background: rgba(248,113,113,0.15);
  color: #f87171;
}

.pr-resolution {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
}
.pr-resolution.won {
  color: #22c55e;
  background: rgba(34,197,94,0.1);
}
.pr-resolution.lost {
  color: #f87171;
  background: rgba(248,113,113,0.1);
}
/* ---------- All picks missed banner ---------- */
.pick-all-missed-banner {
  background: linear-gradient(180deg, rgba(248,113,113,0.08) 0%, rgba(248,113,113,0.02) 100%);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pam-icon {
  color: #f87171;
  flex-shrink: 0;
  margin-top: 1px;
}
.pam-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}
.pam-text strong {
  color: var(--text);
  display: block;
  margin-bottom: 3px;
  font-weight: 700;
  font-size: 13px;
}

/* ---------- Star ratings ---------- */
.stars {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1.5px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.stars-filled { color: #f59e0b; }
.stars-empty { color: var(--border); opacity: 0.6; }

/* In the hero card, larger stars */
.pick-hero .stars {
  font-size: 15px;
  letter-spacing: 2px;
}

/* ---------- Risk badges ---------- */

/* Grouped pick rows */
.risk-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.risk-badge.low {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.risk-badge.medium {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}
.risk-badge.high {
  background: rgba(248,113,113,0.15);
  color: #f87171;
}

/* Hero card risk indicator */
.ph-risk {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ph-risk.low {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.ph-risk.medium {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}
.ph-risk.high {
  background: rgba(248,113,113,0.15);
  color: #f87171;
}
.crest-fallback {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.05em;
  flex-shrink: 0;
}
.fixture-teams .crest-fallback {
  width: 18px;
  height: 18px;
  font-size: 8px;
}
.match-team .crest-fallback {
  width: 46px;
  height: 46px;
  font-size: 16px;
  margin-bottom: 10px;
}
/* ---------- Lower Divs EV Styling ---------- */
.pr-meta {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pr-prob {
  color: var(--text-2);
  font-weight: 600;
}

.pr-ev {
  color: var(--accent);
  font-weight: 700;
}
/* ---------- Lower Div Dropdowns ---------- */
.pick-group-dropdown {
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.pick-group-dropdown summary {
  list-style: none; /* Hide default browser arrow */
  cursor: pointer;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.pick-group-dropdown summary::-webkit-details-marker {
  display: none; /* Hide Safari/Chrome arrow */
}

.pick-group-dropdown summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.pick-group-dropdown[open] summary::after {
  content: "−";
  color: var(--accent);
}

.pick-group-dropdown .pg-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
  color: var(--text) !important;
  text-transform: uppercase !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.pick-group-dropdown .pg-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-left: auto;
  margin-right: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.pick-group-dropdown .pg-content {
  padding-bottom: 14px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.match-empty-hero {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--muted);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
}

/* Muted styling for fallback picks */
.pick-hero-fallback {
  background: var(--surface-2) !important;
  border: 1px dashed var(--border) !important;
}
.pick-hero-fallback .ph-title {
  color: var(--text-2) !important;
}

/* Confidence Tier Badges */
.ph-risk.tier-strong { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.ph-risk.tier-solid { background: rgba(13,81,251,0.15); color: #0d51fb; border: 1px solid rgba(13,81,251,0.3); }
.ph-risk.tier-lean { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
/* ---------- Top 3 Picks Grid ---------- */
.top-picks-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.top-picks-grid::-webkit-scrollbar { display: none; }

.pick-hero-multi {
  flex: 0 0 85%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .pick-hero-multi { flex: 0 0 calc(33.333% - 8px); }
}

.pick-hero-multi .ph-cat {
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
}
.pick-hero-multi .ph-title {
  font-size: 18px; font-weight: 700; color: var(--text); margin-top: 8px; margin-bottom: 12px; line-height: 1.2;
}

.ph-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 12px;
}
.ph-title-row .ph-title {
  margin-top: 0;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}
.pick-hero-multi .ph-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
}
.pick-hero-multi .ph-stat-val {
  font-size: 28px; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; line-height: 1;
}
.pick-hero-multi .ph-unit { font-size: 14px; color: var(--muted); font-weight: 600; }
.pick-hero-multi .ph-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.pick-hero-multi .ph-insight-small {
  font-size: 12px; color: var(--text-2); line-height: 1.5; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}

/* Tier Badges */
.ph-risk.tier-strong { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.ph-risk.tier-solid { background: rgba(13,81,251,0.15); color: #0d51fb; border: 1px solid rgba(13,81,251,0.3); }
.ph-risk.tier-lean { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
/* ---------- Vertical Top Picks ---------- */
.top-picks-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.pick-section {
  display: flex;
  flex-direction: column;
}

.pick-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

.psh-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.pick-hero-multi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* ---------- Match Tabs ---------- */
.match-tabs {
  display: flex;
  padding: 0 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15,17,21,0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.mt-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  padding: 14px 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.mt-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-pane {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.tab-pane.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ---------- Modern Segmented Tabs ---------- */
.match-tabs {
  display: flex;
  background: var(--surface);
  padding: 4px;
  border-radius: 10px;
  margin: 0 14px 20px 14px;
  position: sticky;
  top: 10px; /* Sticks to the top as you scroll */
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}

.mt-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  letter-spacing: 0.02em;
}

/* The Active State: A sleek elevated pill */
.mt-btn.active {
  background: var(--bg); /* Contrasts with the surface container */
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Hover effect for desktop */
.mt-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

/* Remove old underline styling just in case */
.mt-btn {
  border-bottom: none !important;
}
/* ---------- Sliding Segmented Tabs ---------- */
.match-tabs {
  display: flex;
  background: var(--bg); /* Soft grey background */
  padding: 4px;
  border-radius: 12px;
  margin: 0 14px 20px 14px;
  position: sticky;
  top: 10px;
  z-index: 10;
  border: 1px solid var(--border);
}

.mt-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  /* The cubic-bezier makes the transition feel like a physical slider */
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}

.mt-btn.active {
  background: var(--surface); /* Bright white */
  color: var(--text);
  /* Soft shadow makes it look like a pill floating above the track */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* Remove old underline */
.mt-btn {
  border-bottom: none !important;
}
/* ---------- Form Tab Styling ---------- */
.form-split {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 600px) {
  .form-split { flex-direction: row; }
}

.team-stats-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.tsc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
}

.tsc-header img {
  width: 24px; height: 24px; object-fit: contain;
}

.tsc-stat { margin-bottom: 16px; }
.tsc-stat:last-child { margin-bottom: 0; }

.tsc-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-weight: 600;
}

.tsc-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1;
}

.tsc-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}

.tsc-fill {
  height: 100%;
  border-radius: 4px;
}
.tsc-fill.attack { background: #22c55e; } /* Green for goals scored */
.tsc-fill.defense { background: #f87171; } /* Red for goals conceded */

/* ---------- H2H Tab Styling ---------- */
.h2h-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  margin-bottom: 12px;
}

.h2h-team {
  text-align: center;
  flex: 1;
}
.h2h-team.draw { flex: 0.6; opacity: 0.7; }

.h2h-score {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.h2h-name {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.2;
}

.h2h-bar-container {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: 12px;
}

.h2h-bar-home { background: var(--accent); }
.h2h-bar-draw { background: var(--muted); }
.h2h-bar-away { background: var(--text-2); }

.h2h-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Lineups Pitch Styling ---------- */
.pitch-container {
  width: 100%;
  max-width: 450px; /* Prevents it from getting too wide on desktop */
  height: 650px;    /* Gives it a fixed, realistic pitch height */
  margin: 0 auto;   /* Centers it on the screen */
  background: linear-gradient(180deg, #1e5631 0%, #2f7a44 50%, #1e5631 100%);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  border: 2px solid #4ade80;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Center Line */
.pitch-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.3);
  transform: translateY(-50%);
}

/* Center Circle */
.pitch-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.empty-lineups {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
}
.empty-lineups svg {
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty-lineups p {
  font-size: 13px;
  font-weight: 500;
}
/* ---------- Pitch & Lineups Styling ---------- */
.pitch-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px;
}

.pitch-container {
  width: 100%;
  max-width: 500px;
  height: 600px;
  background: linear-gradient(180deg, #1e5631 0%, #2f7a44 50%, #1e5631 100%);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

/* Pitch Markings */
.pitch-line {
  position: absolute; top: 50%; left: 0; right: 0; height: 2px;
  background: rgba(255,255,255,0.3); transform: translateY(-50%);
}
.pitch-circle {
  position: absolute; top: 50%; left: 50%; width: 80px; height: 80px;
  border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.pitch-box-top {
  position: absolute; top: 0; left: 50%; width: 200px; height: 80px;
  border: 2px solid rgba(255,255,255,0.3); border-top: none;
  transform: translateX(-50%);
}
.pitch-box-bottom {
  position: absolute; bottom: 0; left: 50%; width: 200px; height: 80px;
  border: 2px solid rgba(255,255,255,0.3); border-bottom: none;
  transform: translateX(-50%);
}

/* Halves */
.pitch-half {
  position: absolute;
  width: 100%;
  height: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 2;
}

.top-half {
  top: 0;
  /* Away team faces down, so their forwards are near the center line */
  flex-direction: column-reverse; 
}

.bottom-half {
  bottom: 0;
  /* Home team faces up, so their forwards are near the center line */
  flex-direction: column;
}

/* Rows */
.pitch-row {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
}

/* Player Token */
.player-token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 40px;
}

.player-shirt {
  width: 28px;
  height: 28px;
  background: #ffffff;
  color: #000000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  border: 2px solid rgba(0,0,0,0.1);
}

.player-name {
  font-size: 9px;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 48px;
  line-height: 1.1;
}
.top-half {
  top: 0;
  /* Away team GK is at the top, Forwards at the bottom */
  flex-direction: column; 
}

.bottom-half {
  bottom: 0;
  /* Home team GK is at the bottom, Forwards at the top */
  flex-direction: column-reverse; 
}

/* Jersey Colors */
.home-shirt {
  background: #0d51fb; /* Home Blue */
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
}

.away-shirt {
  background: #ef4444; /* Away Red */
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
}
/* ---------- Form Pips ---------- */
.form-pips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.pips-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.form-pip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.h2h-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}
/* ---------- Global Layout Constraints ---------- */
#app {
  max-width: 600px;       /* Stops the app from stretching on desktop */
  margin: 0 auto;         /* Centers it */
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.2); /* Subtle shadow on desktop */
}

/* Add breathing room around the tab contents */
.match-tab-content {
  padding: 0 16px 40px 16px;
}
.pick-hero-multi .ph-stats {
  display: flex;
  align-items: flex-start;
  justify-content: space-between; /* Spreads the 3 columns evenly */
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
}
/* ---------- Risk Ladder UI ---------- */
.ladder-container {
  margin-bottom: 24px;
}

.match-verdict {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ladder-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ladder-rung {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

/* Left accent borders for risk levels */
.rung-safest { border-left: 4px solid #22c55e; }
.rung-core { border-left: 4px solid #f59e0b; }
.rung-bold { border-left: 4px solid #ef4444; }

.lr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lr-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.rung-safest .lr-tag { color: #22c55e; }
.rung-core .lr-tag { color: #f59e0b; }
.rung-bold .lr-tag { color: #ef4444; }

.lr-be {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
}

.lr-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.lr-bottom {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}

.lr-prob {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.lr-prob span {
  font-size: 14px;
  color: var(--muted);
}

.lr-bookie {
  font-size: 13px;
  color: #22c55e;
  background: rgba(34,197,94,0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

.lr-insight {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
/* ---------- Lineup Notice ---------- */
.lineup-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-2);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.4;
}
.ln-icon {
  font-size: 14px;
  opacity: 0.8;
}