﻿:root {
  --bg-1: #08131f;
  --bg-2: #0f2233;
  --surface: #102636;
  --surface-2: #173145;
  --text: #e5f2ff;
  --muted: #9ab3c8;
  --accent: #ff6f1a;
  --accent-2: #23b6d8;
  --good: #39d98a;
  --bad: #ff6b6b;
  --line: #24445b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px circle at 15% 10%, #1b3750, transparent 50%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
}

.app-shell {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero h1 {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 0;
}

.hero p {
  margin: 6px 0 20px;
  color: var(--muted);
}

.card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 210px;
}

.control-group.compact {
  min-width: 160px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #07131d;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: var(--accent-2);
}

button:hover {
  filter: brightness(1.05);
}

.status {
  margin: 14px 0;
  min-height: 20px;
  color: var(--muted);
}

.data-source {
  margin-bottom: 14px;
  min-height: 22px;
  font-size: 0.9rem;
}

.data-source .pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(35, 182, 216, 0.14);
  color: #bdefff;
  font-weight: 600;
}

.data-source .pill.fallback {
  background: rgba(255, 111, 26, 0.18);
  color: #ffd6b8;
  border-color: rgba(255, 111, 26, 0.5);
}

.data-source .pill.info {
  background: rgba(57, 217, 138, 0.14);
  color: #c6ffe5;
  border-color: rgba(57, 217, 138, 0.5);
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent-2);
  color: #07131d;
}

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

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon {
  font-size: 1.05rem;
}

.link-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th,
td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 500;
}

.sort-btn {
  all: unset;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.sort-btn:hover {
  color: var(--text);
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag.up {
  background: rgba(57, 217, 138, 0.16);
  color: var(--good);
}

.tag.down {
  background: rgba(255, 107, 107, 0.14);
  color: var(--bad);
}

.trend-move {
  font-weight: 600;
}

.trend-move.up {
  color: var(--good);
}

.trend-move.down {
  color: var(--bad);
}

.trend-move.flat {
  color: var(--muted);
}

.small-note {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.stat-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.stat-chip .label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-chip .value {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
}

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

.matchup-list {
  margin: 0;
  padding-left: 18px;
}

.matchup-list li {
  margin-bottom: 6px;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-photo {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  object-fit: cover;
  flex: 0 0 30px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 17, 0.68);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(900px, 94vw);
  max-height: 82vh;
  overflow: auto;
}

@media (max-width: 860px) {
  .two-up {
    grid-template-columns: 1fr;
  }

  .stat-strip,
  .matchup-columns {
    grid-template-columns: 1fr;
  }
}
