:root {
  --navy: #102a43;
  --navy-soft: #183b56;
  --red: #b4232a;
  --gold: #b68b2f;
  --paper: #f7f7f2;
  --panel: #ffffff;
  --line: #d8ddd8;
  --ink: #172026;
  --muted: #667085;
  --good: #1b6b4a;
  --bad: #a33a3a;
  --wash: #eef3f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: 22px 14px 76px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
}

header {
  border-bottom: 3px solid var(--navy);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.header-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0 0 4px;
  color: var(--navy);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 30px;
  letter-spacing: 0;
}

.sub {
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 11px;
  background: var(--panel);
  color: var(--navy);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.button:hover {
  border-color: var(--navy-soft);
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.stat {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 11px 12px;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  margin-top: 5px;
  color: var(--navy);
  font-size: 21px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 9px;
  background: var(--navy);
  color: #fff;
  text-align: left;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr {
  border-top: 1px solid var(--line);
}

tbody tr[data-row] {
  cursor: pointer;
}

tbody tr[data-row]:hover,
tbody tr:hover {
  background: var(--wash);
}

tbody tr.leader td {
  background: #fff7dd;
}

tbody tr.picked td {
  background: #fffaf0;
}

tbody tr.cut-row td {
  color: var(--muted);
  font-style: italic;
}

td {
  padding: 10px 9px;
  font-size: 14px;
  vertical-align: middle;
}

.rank {
  width: 42px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.num,
.money,
.center {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.center {
  text-align: center;
}

.entrant {
  font-weight: 720;
}

.total {
  color: var(--navy);
  font-weight: 780;
}

.total.over {
  color: var(--bad);
}

.details {
  background: #fbfcfb;
  padding: 0 12px 14px 54px;
}

.details table {
  margin-top: 6px;
  border: 0;
  background: transparent;
}

.details td {
  padding: 5px 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}

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

.pick-list {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 1px 6px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.pill.cut {
  background: #fae8e8;
  color: var(--bad);
}

.pill.live {
  background: #e7f2eb;
  color: var(--good);
}

.picker-pills {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  flex-wrap: wrap;
  vertical-align: middle;
}

.picker-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 5px;
  padding: 2px 5px;
  color: #1d2730;
  font-size: 10px;
  font-weight: 800;
  cursor: help;
}

.legend {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
}

.legend-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--good);
  vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.err {
  border: 1px solid #e8b6b6;
  border-radius: 8px;
  background: #fff1f1;
  color: var(--bad);
  padding: 14px;
  font-size: 14px;
}

footer {
  margin-top: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  body {
    padding-inline: 10px;
  }

  .header-row {
    display: block;
  }

  .nav {
    margin-top: 10px;
  }

  h1 {
    font-size: 23px;
  }

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

  thead th,
  td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .hide-sm {
    display: none;
  }

  .details {
    padding-left: 8px;
  }
}

