:root {
  --bg: #0a0e14;
  --bg-elevated: #121922;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf4;
  --muted: #8b98a8;
  --accent: #3ee0a8;
  --accent-dim: rgba(62, 224, 168, 0.15);
  --warn: #f5c15d;
  --err: #ff6b6b;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.header,
.explain,
main,
.footer {
  position: relative;
  z-index: 1;
  width: min(1100px, 100% - 2.5rem);
  margin-left: auto;
  margin-right: auto;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 2.25rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  color: var(--accent);
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.nav-tab {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-tab-active {
  background: var(--accent-dim);
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.date-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.date-input {
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.date-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: rgba(62, 224, 168, 0.45);
  background: #161e28;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.pill-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.pill-live {
  background: var(--accent-dim);
  color: var(--accent);
}

.explain {
  padding: 1.25rem 0 0;
}

.explain p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 62ch;
}

.explain strong {
  color: var(--text);
  font-weight: 600;
}

main {
  padding: 1.5rem 0 3rem;
}

.doc-page {
  padding: 0.5rem 0 3rem;
}

.doc {
  max-width: 58ch;
}

.doc-title {
  margin: 2rem 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.doc-title:first-child {
  margin-top: 0;
}

.doc p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.doc p:last-child {
  margin-bottom: 0;
}

.doc-list {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.doc-list li {
  margin-bottom: 0.5rem;
}

.doc-list li:last-child {
  margin-bottom: 0;
}

.doc strong {
  color: var(--text);
  font-weight: 600;
}

.doc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc a:hover {
  color: #5fe9bc;
}

.doc-formula {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  color: #c5d4e6;
}

.doc-formula code {
  font-family: inherit;
}

.doc-muted {
  font-size: 0.9rem !important;
  font-style: italic;
}

.support-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.support-league-table {
  width: 100%;
  min-width: min(100%, 520px);
  border-collapse: collapse;
  font-size: 0.9rem;
}

.support-league-table th,
.support-league-table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  vertical-align: top;
  text-align: left;
}

.support-league-table th {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.banner-error {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc9c9;
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.banner-warn {
  background: rgba(245, 193, 93, 0.1);
  color: #ffe6b0;
  border: 1px solid rgba(245, 193, 93, 0.35);
}

.hidden {
  display: none !important;
}

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.league-grid,
.drill-view {
  grid-column: 1 / -1;
}

.league-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

@media (min-width: 640px) {
  .league-grid {
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.league-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 168px;
  padding: 1.35rem 1rem;
  margin: 0;
  border: 1px solid rgba(62, 224, 168, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(
    165deg,
    rgba(62, 224, 168, 0.1),
    var(--bg-elevated) 48%
  );
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.2s,
    transform 0.15s ease,
    box-shadow 0.2s;
}

.league-tile:hover {
  border-color: rgba(62, 224, 168, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42);
}

.league-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.league-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.league-tile-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.league-tile-img {
  width: 100%;
  height: 100%;
  max-width: 88px;
  max-height: 88px;
  object-fit: contain;
  display: block;
}

.league-tile-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.btn-back {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.view-header-main {
  flex: 1;
  min-width: min(100%, 280px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.view-header-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-header-icon .league-tile-svg,
.view-header-icon .league-tile-img {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
}

.view-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.view-subtitle {
  margin: 0;
  width: 100%;
  flex-basis: 100%;
  font-size: 0.9rem;
  color: var(--muted);
  padding-left: 0;
}

.view-header-main:has(.view-header-icon) .view-subtitle {
  padding-left: calc(52px + 1rem);
}

@media (max-width: 480px) {
  .view-header-main:has(.view-header-icon) .view-subtitle {
    padding-left: 0;
  }
}

.drill-view {
  min-width: 0;
}

.game-row-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-row-tile {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.15s,
    background 0.15s;
}

.game-row-tile:hover {
  border-color: rgba(62, 224, 168, 0.28);
  background: #161e28;
}

.game-row-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.game-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.game-row-matchup {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.game-row-time {
  font-size: 0.85rem;
  color: var(--muted);
}

.game-row-badge {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(62, 224, 168, 0.12);
  color: var(--accent);
  border: 1px solid rgba(62, 224, 168, 0.28);
}

.game-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.game-picks-detail {
  margin-top: 0.25rem;
}

.league-box {
  margin: 0;
  background: var(--bg-elevated);
  border: 1px solid rgba(62, 224, 168, 0.2);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.league-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  margin: 0;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(62, 224, 168, 0.08), transparent 55%);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.league-toggle:hover {
  background: linear-gradient(165deg, rgba(62, 224, 168, 0.14), transparent 55%);
}

.league-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.league-chevron {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.2rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.league-chevron-open {
  transform: rotate(45deg);
  margin-top: 0.1rem;
}

.league-title-wrap {
  flex: 1;
  min-width: 0;
}

.league-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.league-meta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.league-badge {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(62, 224, 168, 0.12);
  color: var(--accent);
  border: 1px solid rgba(62, 224, 168, 0.28);
}

.league-panel {
  padding: 0 0.85rem 1rem;
  border-top: 1px solid var(--border);
}

.league-games {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 0.85rem;
}

.league-games .game-section {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.game-section {
  margin: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.game-top {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem 0.75rem;
}

.game-toggle {
  flex: 1;
  min-width: min(100%, 240px);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.35rem 0.5rem 0;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.game-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.game-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.game-chevron {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.game-chevron-open {
  transform: rotate(45deg);
  margin-top: 0.35rem;
}

.game-label {
  flex: 1;
  min-width: 0;
}

.game-matchup {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.game-time {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.game-pick-count {
  align-self: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.2rem 0;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  align-self: center;
}

.game-refresh {
  flex-shrink: 0;
}

.game-panel {
  padding-top: 0.75rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.game-picks-empty {
  margin: 0;
  padding: 1rem 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 52ch;
}

.game-picks {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .game-picks {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card-nested {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.pick-rank {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: rgba(62, 224, 168, 0.22);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.sport {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.matchup {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.time {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.edge-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(62, 224, 168, 0.12);
  color: var(--accent);
  border: 1px solid rgba(62, 224, 168, 0.25);
}

.pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.pick-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.pick-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.meta span strong {
  color: var(--text);
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
