:root {
  color-scheme: light;
  --navy: #0f172a;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #16a34a;
  --accent-soft: #dcfce7;
  --accent-strong: #15803d;
  --secondary: #2563eb;
  --secondary-soft: #dbeafe;
  --danger: #b91c1c;
  --warning: #b45309;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --container: min(1200px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-shell,
.page-shell,
.footer-shell {
  width: var(--container);
  margin: 0 auto;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.sport-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sport-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cbd5e1;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
}

button.sport-tab {
  cursor: pointer;
}

.sport-tab.active {
  color: var(--navy);
  background: #ffffff;
}

.sport-tab.disabled {
  opacity: 0.62;
}

.sport-tab span {
  color: #93c5fd;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(22, 163, 74, 0.5);
  border-radius: 999px;
  color: #bbf7d0;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-badge::before {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 999px;
  content: "";
}

.date-bar {
  position: sticky;
  top: 68px;
  z-index: 9;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.date-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: var(--container);
  margin: 0 auto;
  padding: 14px 0;
}

.date-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 5px 6px 5px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-weight: 900;
}

.date-label input {
  min-height: 34px;
  max-width: 140px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
}

.league-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 6px 5px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.league-control[hidden] {
  display: none;
}

.league-control span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.league-control select {
  min-height: 34px;
  max-width: 190px;
  padding: 0 34px 0 10px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 850;
}

.day-button,
.details-button,
.retry-button {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.day-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.day-button:hover,
.details-button:hover,
.retry-button:hover {
  transform: translateY(-1px);
}

.day-button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.page-shell {
  padding: 30px 0 54px;
}

.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1;
  letter-spacing: 0;
}

.tagline,
.disclaimer {
  color: var(--muted);
}

.tagline {
  margin: 12px 0 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.disclaimer {
  max-width: 420px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: right;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.matchup-card,
.state-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.matchup-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.matchup-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.state-card {
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
}

.state-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.state-card p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.55;
}

.retry-button {
  min-height: 42px;
  margin-top: 18px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--secondary);
}

.retry-button:hover {
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.card-topline,
.probability-labels,
.team-row,
.model-vegas-strip,
.pitcher-line,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-topline {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-time {
  color: var(--text);
}

.status-pill,
.pick-badge,
.agreement-pill,
.total-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill {
  min-height: 26px;
  padding: 0 10px;
  color: var(--secondary);
  background: var(--secondary-soft);
  font-size: 0.72rem;
}

.status-pill.live-state {
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.3);
  animation: livePulse 1.8s infinite;
}

.status-pill.final-state {
  color: var(--text);
  background: #e2e8f0;
}

.live-inning {
  color: var(--danger);
  font-weight: 950;
  text-align: right;
}

.teams {
  display: grid;
  gap: 10px;
}

.team-row {
  position: relative;
  min-height: 74px;
  padding: 12px 12px 12px 14px;
  overflow: hidden;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.team-row.predicted {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.11), #ffffff 68%);
  border-color: rgba(22, 163, 74, 0.32);
  box-shadow: inset 4px 0 0 var(--accent);
}

.team-row.actual-winner {
  border-color: rgba(15, 23, 42, 0.26);
}

.team-row.actual-winner .team-name,
.team-row.actual-winner .team-score {
  font-weight: 950;
}

.team-row.finalized:not(.actual-winner) {
  opacity: 0.82;
}

.team-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.team-logo {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.team-text {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.team-name-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.team-name {
  overflow: hidden;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-abbrev {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.team-record {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.team-outcome {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.team-win-percent {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 950;
}

.team-score {
  color: var(--text);
  font-size: 2rem;
  font-weight: 950;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.pick-badge {
  min-height: 22px;
  padding: 0 8px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.pick-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.pick-result.correct {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.pick-result.wrong {
  color: var(--danger);
  background: #fee2e2;
}

.probability-block {
  display: grid;
  gap: 8px;
}

.probability-labels {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.probability-bar {
  display: flex;
  height: 16px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.prob-away,
.prob-home,
.prob-draw {
  min-width: 5%;
  background: #94a3b8;
}

.prob-away.favored,
.prob-home.favored,
.prob-draw.favored {
  background: var(--accent);
}

.prob-draw {
  background: #cbd5e1;
  border-inline: 1px solid rgba(255, 255, 255, 0.72);
}

.soccer-model-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.card-insights {
  display: grid;
  gap: 10px;
}

.model-vegas-strip {
  align-items: stretch;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.mini-stat {
  display: grid;
  gap: 2px;
}

.mini-stat-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-stat strong {
  color: var(--text);
  font-size: 0.9rem;
}

.mini-stat.muted strong {
  color: var(--muted);
}

.agreement-pill {
  align-self: center;
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.agreement-pill.agree {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.agreement-pill.disagree {
  color: var(--warning);
  background: #fef3c7;
}

.agreement-pill.muted {
  color: var(--muted);
  background: #e2e8f0;
}

.total-chip {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  color: var(--secondary);
  background: var(--secondary-soft);
  border: 1px solid rgba(37, 99, 235, 0.18);
  font-size: 0.86rem;
}

.winner-line,
.vegas-line,
.total-line,
.projection-note {
  margin: 0;
}

.winner-line {
  color: var(--accent-strong);
  font-weight: 950;
}

.vegas-line,
.projection-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.total-line {
  color: var(--text);
  font-weight: 900;
}

.pitchers {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.pitcher-line {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.pitcher-side {
  flex: 0 0 auto;
  min-width: 44px;
  color: var(--text);
  font-weight: 950;
}

.details-button {
  min-height: 42px;
  color: var(--secondary);
  background: #ffffff;
  border: 1px solid var(--line-strong);
}

.details-button:hover {
  background: var(--secondary-soft);
  border-color: rgba(37, 99, 235, 0.28);
}

.details-panel {
  display: grid;
  gap: 22px;
}

.details-panel[hidden] {
  display: none;
}

.details-panel section {
  display: grid;
  gap: 12px;
}

.details-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.comparison-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.comparison-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  overflow-wrap: anywhere;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comparison-table tr:last-child th,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.comparison-table td.favored {
  color: var(--accent-strong);
  font-weight: 950;
}

.factor-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.factor-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.factor-title {
  font-weight: 950;
}

.factor-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.lineup-analysis-content,
.lineup-analysis-results {
  display: grid;
  gap: 12px;
}

.lineup-estimate-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.lineup-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lineup-column {
  padding: 14px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.lineup-column h4,
.lineup-block h5 {
  margin: 0;
}

.lineup-column h4 {
  font-size: 0.96rem;
}

.lineup-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.lineup-block h5 {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lineup-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 24px;
}

.lineup-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.modal-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 950;
}

.modal-close:hover {
  background: var(--secondary-soft);
}

.modal-body {
  padding: 20px;
}

.skeleton {
  min-height: 360px;
  padding: 18px;
}

.skeleton-line,
.skeleton-box {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 220% 100%;
  animation: shimmer 1.35s infinite linear;
}

.skeleton-line {
  height: 18px;
  margin-bottom: 14px;
}

.skeleton-line.short {
  width: 45%;
}

.skeleton-line.medium {
  width: 70%;
}

.skeleton-box {
  height: 134px;
  margin: 18px 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-shell span:first-child {
  color: var(--text);
  font-weight: 950;
}

@keyframes shimmer {
  from {
    background-position: 220% 0;
  }

  to {
    background-position: -220% 0;
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.28);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(185, 28, 28, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0);
  }
}

@media (max-width: 1040px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --container: min(100% - 24px, 1200px);
  }

  .nav-shell {
    flex-wrap: wrap;
    min-height: auto;
    padding: 14px 0;
  }

  .sport-tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .date-bar {
    top: 96px;
  }

  .date-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .date-label {
    flex: 1;
    justify-content: space-between;
    min-width: 0;
    padding-left: 14px;
  }

  .date-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .date-label input {
    width: 116px;
    min-width: 116px;
  }

  .league-control {
    width: 100%;
    justify-content: space-between;
  }

  .league-control select {
    max-width: min(260px, 68vw);
  }

  .section-intro {
    display: grid;
    gap: 14px;
  }

  .disclaimer {
    max-width: none;
    text-align: left;
  }

  .results-grid,
  .lineup-columns {
    grid-template-columns: 1fr;
  }

  .model-vegas-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .soccer-model-strip {
    grid-template-columns: 1fr;
  }

  .lineup-estimate-row {
    grid-template-columns: 1fr;
  }

  .agreement-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .footer-shell {
    display: grid;
  }
}

@media (max-width: 480px) {
  .live-badge {
    display: none;
  }

  .date-bar {
    top: 132px;
  }

  .day-button {
    width: 40px;
    height: 40px;
  }

  .date-label {
    display: grid;
    justify-items: center;
    gap: 6px;
    border-radius: var(--radius-lg);
  }

  .date-label input {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .matchup-card {
    padding: 14px;
  }

  .team-row {
    align-items: flex-start;
  }

  .team-logo {
    width: 36px;
    height: 36px;
  }
}
