:root {
  --bg: #0f1411;
  --surface: #171e19;
  --border: #2a332c;
  --text: #e8f0ea;
  --muted: #8a9a90;
  --green: #1f6b45;
  --green-dim: #163d2b;
  --gold: #c4a035;
  --gold-dim: #5c4f1e;
  --danger: #c45c5c;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 10% -10%, #1a2e22 0%, transparent 55%),
    radial-gradient(900px 600px at 90% 0%, #1e1a0f 0%, transparent 50%), var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hero {
  margin-bottom: 1.75rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 44rem;
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.98rem;
}

.lede--pool {
  max-width: 46rem;
}

.lede--pool p {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.55;
}

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

.lede-tech {
  font-size: 0.88rem !important;
  color: var(--muted) !important;
}

.lede strong {
  color: var(--text);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.25rem;
  margin-bottom: 0.75rem;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.btn.primary {
  background: linear-gradient(180deg, #2a8f5c 0%, var(--green) 100%);
  border-color: #2d6b4a;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.primary:active {
  transform: translateY(1px);
}

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

.status.err {
  color: var(--danger);
}

.external {
  color: #8ecfff;
  text-decoration: none;
  font-size: 0.88rem;
}

.external:hover {
  text-decoration: underline;
}

.banner {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  background: rgba(142, 207, 255, 0.08);
  border: 1px solid rgba(142, 207, 255, 0.22);
  color: #c5e6ff;
  font-size: 0.88rem;
  max-width: 44rem;
}

.banner.warn {
  background: rgba(196, 160, 53, 0.12);
  border-color: rgba(196, 160, 53, 0.35);
  color: #f5e6b8;
}

.skipped-inline {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #d4c49a;
  max-width: 52rem;
  line-height: 1.45;
}

.round-winners {
  margin-bottom: 1.35rem;
}

.rw__title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
}

.rw__hint {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 48rem;
  line-height: 1.45;
}

.rw__scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rw__table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rw__table th,
.rw__table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
}

.rw__table thead th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  text-align: center;
}

.rw__labelcol {
  min-width: 8.5rem;
  text-align: left;
}

.rw__table tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.rw__checkcell {
  text-align: center;
}

.rw__check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
  user-select: none;
}

.rw__check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--green);
}

.rw__input {
  width: 100%;
  min-width: 7rem;
  box-sizing: border-box;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.rw__input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.rw__input:focus {
  outline: 2px solid rgba(127, 212, 168, 0.35);
  outline-offset: 1px;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1rem 0.65rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}

.tab-panel[hidden] {
  display: none !important;
}

.boxpool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
}

.boxpool-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 0.65rem;
}

.boxpool-desc {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 48rem;
}

.boxpool-desc strong {
  color: var(--text);
}

.boxpool-test {
  display: inline-flex;
  margin-bottom: 1rem;
}

.boxpool-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.boxpool-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.boxpool-grid th,
.boxpool-grid td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.45rem;
  vertical-align: middle;
  min-width: 4.5rem;
  max-width: 7rem;
}

.boxpool-corner {
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.boxpool-colhead {
  background: rgba(196, 160, 53, 0.12);
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  hyphens: auto;
  word-break: break-word;
}

.boxpool-rowhead {
  background: rgba(31, 107, 69, 0.18);
  font-weight: 600;
  text-align: right;
  padding-right: 0.5rem;
  line-height: 1.25;
  hyphens: auto;
  word-break: break-word;
}

.boxpool-cell {
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  min-height: 2.25rem;
  color: #c5d4ca;
}

.boxpool-cell:empty::after {
  content: "";
  display: inline-block;
  min-height: 1em;
}

.test-panel {
  margin-top: 0.75rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.test-panel summary {
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0;
}

.test-panel summary:hover {
  color: var(--text);
}

.test-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--green);
}

.leader-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 880px) {
  .leader-widgets {
    grid-template-columns: 1fr;
  }
}

.lw {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.25rem;
}

.lw--a {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 1px rgba(31, 107, 69, 0.2) inset;
}

.lw--b {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(196, 160, 53, 0.18) inset;
}

.lw__heading {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.lw__rule {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.lw__hero {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.lw__badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.lw--a .lw__badge {
  color: #8fd4b0;
}

.lw--b .lw__badge {
  color: #e8d080;
}

.lw__name {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.lw__line {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.lw__sep {
  margin: 0 0.35rem;
  color: var(--muted);
  font-weight: 400;
}

.lw__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.lw__select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.lw__select:focus {
  outline: 2px solid rgba(127, 212, 168, 0.35);
  outline-offset: 1px;
}

.lw__detail {
  margin: 0.65rem 0 0;
  font-size: 0.86rem;
  color: #b8c9be;
  min-height: 1.25rem;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 880px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

.tracker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tracker--a {
  border-color: var(--green-dim);
  box-shadow: 0 0 0 1px rgba(31, 107, 69, 0.2) inset;
}

.tracker--b {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(196, 160, 53, 0.18) inset;
}

.tracker__head {
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tracker__title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.tracker__subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
}

.tracker__summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.tracker__summary--compact {
  grid-template-columns: 1fr;
  padding: 0.65rem 1.15rem;
}

.tracker__meta--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.5rem;
}

.tracker__meta--inline dt {
  margin: 0;
}

.tracker__meta--inline dd {
  margin: 0 0 0 0.25rem;
}

@media (max-width: 480px) {
  .tracker__summary {
    grid-template-columns: 1fr;
  }
}

.tracker__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.85rem;
  margin: 0;
  font-size: 0.86rem;
}

.tracker__meta dt {
  color: var(--muted);
  margin: 0;
}

.tracker__meta dd {
  margin: 0;
  font-weight: 500;
}

.tracker__table {
  flex: 1;
  margin: 0;
}

.tracker__table table {
  font-size: 0.84rem;
}

.tracker__table th,
.tracker__table td {
  padding: 0.55rem 0.65rem;
}

.tracker__table .cell-name {
  font-weight: 500;
}

.tracker__table td.num,
.tracker__table th.num {
  text-align: right;
}

.tracker__table th.num .th-sort {
  justify-content: flex-end;
  width: 100%;
}

.th-sort {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.th-sort:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.th-sort.is-active {
  color: #7fd4a8;
}

.tracker--b .th-sort.is-active {
  color: #e8d080;
}

.th-sort .sort-ind {
  font-size: 0.65rem;
  opacity: 0.55;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.footer {
  margin-top: 2rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer code {
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
}

.footer a {
  color: #8ecfff;
}

.muted {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}
