:root {
  color-scheme: dark;
  --bg: #0c111d;
  --panel: #151c2c;
  --panel-strong: #1d2940;
  --text: #eef4ff;
  --muted: #94a3b8;
  --line: #273449;
  --accent: #7dd3fc;
  --green: #86efac;
  --yellow: #fde68a;
  --red: #fca5a5;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(125, 211, 252, 0.2), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  padding: 2rem;
  align-items: end;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.summary,
.panel-title p,
.muted {
  color: var(--muted);
}

.status-card,
.panel {
  background: rgba(21, 28, 44, 0.88);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.status-card {
  display: grid;
  gap: 0.65rem;
  min-width: 18rem;
  padding: 1rem;
}

.status-card strong {
  text-align: center;
}

.status-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.status-topline > :nth-child(2) {
  text-align: center;
}

.status-topline > :last-child {
  text-align: right;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  background: rgba(125, 211, 252, 0.14);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.status-button {
  cursor: pointer;
}

.pill.warn {
  background: rgba(252, 165, 165, 0.14);
  color: var(--red);
}

.pick-alert {
  border-radius: 0.9rem;
  padding: 0.6rem 0.75rem;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.25);
  color: var(--accent);
  font-weight: 900;
}

.pick-alert.soon {
  background: rgba(253, 230, 138, 0.12);
  border-color: rgba(253, 230, 138, 0.3);
  color: var(--yellow);
}

.pick-alert.now {
  background: rgba(134, 239, 172, 0.14);
  border-color: rgba(134, 239, 172, 0.42);
  color: var(--green);
}

button,
select {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.65rem 0.8rem;
  background: var(--panel-strong);
  color: var(--text);
}

button {
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1rem;
  padding: 0 2rem 2rem;
}

.central-layout {
  display: grid;
  grid-template-columns: 26rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0 2rem 2rem;
}

.central-order-panel {
  grid-column: 1;
}

.central-latest-panel {
  grid-column: 2;
}

.central-board-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 1rem;
}

.recommendations-panel,
.sleepers-panel,
.board-panel {
  min-width: 0;
}

.recommendations-panel {
  grid-column: 1;
}

.sleepers-panel {
  grid-column: 1;
}

.side {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.board-panel {
  grid-column: 1 / -1;
}

.side {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.panel-title {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.75rem;
}

.player-card {
  position: relative;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(29, 41, 64, 0.95), rgba(15, 23, 42, 0.92));
}

.player-card:first-child {
  border-color: rgba(134, 239, 172, 0.65);
  box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.2), 0 24px 80px rgba(0, 0, 0, 0.35);
}

.pick-now {
  display: inline-flex;
  margin-bottom: 0.55rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(134, 239, 172, 0.14);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.player-name {
  font-weight: 800;
}

.score {
  color: var(--green);
  font-weight: 900;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.tag {
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  background: rgba(148, 163, 184, 0.13);
  color: var(--muted);
  font-size: 0.76rem;
}

.tag.risk {
  color: var(--yellow);
}

.reasons {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.8rem;
  margin: 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 700;
}

.pick-list {
  margin: 0;
  padding-left: 1.4rem;
}

.pick-list li {
  margin: 0.45rem 0;
  color: var(--muted);
}

.roster {
  display: grid;
  gap: 0.45rem;
}

.roster-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(39, 52, 73, 0.65);
  font-size: 0.9rem;
}

.roster-row:last-child {
  border-bottom: 0;
}

.alert-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.alert-list li {
  margin: 0.45rem 0;
}

.sleeper-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.sleeper-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.62);
}

.sleeper-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.draft-order {
  display: grid;
  gap: 0.4rem;
}

.large-order {
  gap: 0.5rem;
}

.latest-grid {
  columns: 2;
}

.tv-mode {
  --bg: #060913;
  --text: #f8fbff;
  --muted: #cbd5e1;
  --line: #3b4b66;
  font-size: 125%;
}

.tv-mode .hero {
  grid-template-columns: 1fr;
  align-items: center;
  padding: 1.4rem 3rem 1.2rem;
}

.tv-mode .hero > div:first-child {
  display: none;
}

.tv-mode h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.4rem, 4vw, 4.2rem);
}

.tv-mode .summary {
  margin-bottom: 0;
  font-size: 1rem;
}

.tv-mode .status-card {
  min-width: 34rem;
  width: 100%;
  padding: 1.55rem;
  gap: 1rem;
  font-size: 1.15rem;
}

.tv-mode .status-card strong {
  font-size: 2rem;
  line-height: 1.2;
}

.tv-mode .pill {
  font-size: 1rem;
  padding: 0.38rem 0.8rem;
}

.tv-mode .central-layout {
  grid-template-columns: 32rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0 3rem 3rem;
}

.tv-mode .panel {
  padding: 1.25rem;
  border-radius: 1.5rem;
}

.tv-mode h2 {
  font-size: 1.45rem;
}

.tv-mode .draft-order-row {
  grid-template-columns: 2.4rem 1fr auto;
  gap: 0.8rem;
  padding: 0.75rem;
}

.tv-mode .draft-slot {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

.tv-mode .draft-distance,
.tv-mode .draft-order-row small,
.tv-mode .pick-meta {
  font-size: 0.95rem;
}

.tv-mode .pick-list li {
  margin: 0.7rem 0;
  font-size: 1.15rem;
}

.tv-mode .round-row {
  grid-template-columns: 5rem repeat(13, minmax(12rem, 1fr));
  min-width: 122rem;
  gap: 0.55rem;
}

.tv-mode .round-label,
.tv-mode .pick-cell {
  min-height: 5.8rem;
  padding: 0.75rem;
  border-radius: 1rem;
}

.tv-mode .pick-cell.current-pick {
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(134, 239, 172, 0.22), 0 0 34px rgba(134, 239, 172, 0.16);
}

.draft-order-row {
  display: grid;
  grid-template-columns: 1.8rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid rgba(39, 52, 73, 0.75);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.45);
}

.draft-order-row.mine {
  border-color: rgba(134, 239, 172, 0.55);
  background: rgba(134, 239, 172, 0.08);
}

.draft-slot {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.78rem;
}

.draft-order-row small {
  display: block;
  color: var(--muted);
}

.draft-distance {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.board {
  overflow-x: auto;
  display: grid;
  gap: 0.5rem;
}

.round-row {
  display: grid;
  grid-template-columns: 4rem repeat(13, minmax(9rem, 1fr));
  gap: 0.4rem;
  min-width: 82rem;
}

.round-label,
.pick-cell {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.55rem;
  min-height: 4.4rem;
  background: rgba(15, 23, 42, 0.72);
}

.round-label {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 900;
}

.pick-cell.empty {
  color: var(--muted);
  border-style: dashed;
}

.pick-cell.current-pick {
  border-color: rgba(134, 239, 172, 0.7);
  background: rgba(134, 239, 172, 0.1);
}

.pick-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.error {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(36rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid rgba(252, 165, 165, 0.45);
  border-radius: 1rem;
  background: #451a1a;
  color: #fee2e2;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .hero,
  .layout,
  .central-layout {
    grid-template-columns: 1fr;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .status-card {
    min-width: 0;
  }

  .board-panel {
    grid-column: auto;
  }

  .recommendations-panel,
  .sleepers-panel,
  .side,
  .central-order-panel,
  .central-latest-panel,
  .central-board-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .latest-grid {
    columns: 1;
  }
}
