:root {
  color-scheme: dark;
  --bg: #07110d;
  --panel: #0d1b16;
  --panel-2: #12251e;
  --line: #28443a;
  --text: #eef7f0;
  --muted: #9fb2a8;
  --accent: #f59f2f;
  --accent-2: #42d392;
  --blue: #74a7ff;
  --danger: #ff6b6b;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.36);
  --splus: #fff3a6;
  --s: #f8d66d;
  --aplus: #9cf7c4;
  --a: #42d392;
  --b: #74a7ff;
  --c: #c6d1c9;
  --d: #8c9a92;
  --f: #ff7777;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(7, 17, 13, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
}

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

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

main {
  display: grid;
  gap: 38px;
}

section {
  padding: 0 clamp(18px, 4vw, 56px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  min-height: calc(100vh - 118px);
  padding-top: 34px;
}

.hero-copy {
  max-width: 760px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 7vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #160f05;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.court-visual {
  position: relative;
  min-width: 0;
  min-height: 520px;
  border: 2px solid rgba(245, 159, 47, 0.85);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #0d1b16;
  background-size: 36px 36px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.court-line {
  position: absolute;
  border: 2px solid rgba(238, 247, 240, 0.5);
}

.center-circle {
  left: 50%;
  top: 50%;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.paint {
  left: 50%;
  bottom: -2px;
  width: 230px;
  height: 220px;
  transform: translateX(-50%);
}

.rim {
  left: 50%;
  bottom: 148px;
  width: 62px;
  height: 62px;
  border-color: var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
}

.court-stat {
  position: absolute;
  display: grid;
  gap: 2px;
  width: 148px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(7, 17, 13, 0.82);
}

.court-stat strong {
  font-size: 1.7rem;
}

.court-stat span {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-one {
  left: 24px;
  top: 28px;
}

.stat-two {
  right: 24px;
  top: 124px;
}

.stat-three {
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
}

.tool-band,
.seo-band,
.formula,
.notes,
.top-grid {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 20px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.first-screen {
  padding-top: 22px;
}

.workbench-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 16px;
}

.workbench-head h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.workbench-head .lede {
  max-width: min(880px, 100%);
  margin-bottom: 0;
  font-size: 1rem;
}

.tier-counts {
  width: min(780px, calc(100vw - (clamp(18px, 4vw, 56px) * 2)));
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.tier-counts th,
.tier-counts td {
  padding: 8px 10px;
  border-bottom: 0;
  text-align: center;
  white-space: nowrap;
}

.tier-counts th {
  position: static;
  width: 86px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.72rem;
}

.tier-counts td {
  width: calc((100% - 86px) / 8);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.tier-counts strong {
  color: var(--text);
  font-size: 1rem;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #08140f;
  color: var(--text);
  font: inherit;
}

.ranking-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
}

.ranking-meta {
  min-height: 28px;
  color: var(--muted);
}

.microcopy {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.pagination {
  display: flex;
  gap: 8px;
}

button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #102019;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: #e8f4ec;
}

td.player-cell {
  min-width: 230px;
  font-weight: 800;
}

.team-chip,
.team-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--team-bg);
  color: var(--team-fg);
  font-weight: 900;
}

.sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  font-weight: 900;
}

.tier.tier-splus {
  width: 42px;
  background: linear-gradient(135deg, #fff7bd, #f4b942);
  box-shadow: inset 0 0 0 1px rgba(30, 22, 2, 0.18);
  color: #1e1602;
}

.tier.tier-s {
  background: var(--s);
  color: #1e1602;
}

.tier.tier-aplus {
  width: 42px;
  background: linear-gradient(135deg, #b7ffd6, #39c87f);
  box-shadow: inset 0 0 0 1px rgba(3, 24, 13, 0.16);
  color: #03180d;
}

.tier.tier-a {
  background: var(--a);
  color: #03180d;
}

.tier.tier-b {
  background: var(--b);
  color: #061325;
}

.tier.tier-c {
  background: var(--c);
  color: #09110d;
}

.tier.tier-d {
  background: var(--d);
  color: #07110d;
}

.tier.tier-f {
  background: var(--f);
  color: #260808;
}

.stat-head,
.stat-cell {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

tr.row-tier-splus td {
  background: rgba(255, 243, 166, 0.16);
}

tr.row-tier-s td {
  background: rgba(248, 214, 109, 0.1);
}

tr.row-tier-aplus td {
  background: rgba(156, 247, 196, 0.13);
}

tr.row-tier-a td {
  background: rgba(66, 211, 146, 0.08);
}

tr.row-tier-f td {
  background: rgba(255, 119, 119, 0.07);
}

td.stat-cell {
  font-weight: 800;
}

td.stat-cell.heat-1 {
  background: linear-gradient(90deg, rgba(245, 159, 47, 0.1), rgba(245, 159, 47, 0.04));
}

td.stat-cell.heat-2 {
  background: linear-gradient(90deg, rgba(245, 159, 47, 0.16), rgba(245, 159, 47, 0.06));
}

td.stat-cell.heat-3 {
  background: linear-gradient(90deg, rgba(245, 159, 47, 0.24), rgba(245, 159, 47, 0.09));
  color: #fff3d0;
}

td.stat-cell.heat-4 {
  background: linear-gradient(90deg, rgba(245, 159, 47, 0.34), rgba(245, 159, 47, 0.12));
  color: #fff7df;
}

td.stat-cell.heat-5 {
  background: linear-gradient(90deg, rgba(245, 159, 47, 0.48), rgba(245, 159, 47, 0.18));
  color: #fff9e8;
  box-shadow: inset 3px 0 #f7c95d;
}

.player-grid,
.seo-grid,
.team-era-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.player-card,
.seo-list,
.team-era-card,
.position-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.team-era-band {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.reset-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.reset-rules article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.reset-rules span {
  color: var(--muted);
  font-size: 0.92rem;
}

.team-era-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.team-era-toolbar label {
  width: min(260px, 100%);
}

.team-era-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-table table {
  min-width: 760px;
}

.team-era-row {
  cursor: pointer;
}

.team-era-row:hover td {
  filter: brightness(1.12);
}

.team-era-row .expand-cue {
  color: var(--muted);
  font-weight: 800;
}

.details-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

.details-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.details-list strong,
.details-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.details-list small {
  color: var(--muted);
  font-size: 0.78rem;
}

.details-list .tier {
  flex: 0 0 auto;
  transform: scale(0.9);
}

.team-era-detail {
  display: none;
}

.team-era-detail.is-open {
  display: table-row;
}

.team-era-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-color: color-mix(in srgb, var(--team-accent), var(--line) 38%);
}

.team-era-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-era-card h3 {
  margin: 0;
}

.team-era-card p {
  margin: 0;
  color: var(--muted);
}

.team-era-card ol {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding-left: 20px;
}

.team-era-card li span {
  color: var(--muted);
  font-size: 0.82rem;
}

.player-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
}

.player-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.player-card dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}

.player-card dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.player-card dd {
  margin: 0;
  font-weight: 900;
}

.position-list,
.seo-list {
  padding: 18px;
}

.position-list {
  padding: 12px;
}

.position-list h3 {
  margin-bottom: 10px;
  font-size: 1.08rem;
}

.position-list ol,
.seo-list ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.position-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.position-list .rank {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.player-summary {
  min-width: 0;
}

.player-summary strong,
.player-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-list .team-chip {
  min-width: 34px;
  min-height: 22px;
  padding: 0 6px;
  font-size: 0.74rem;
}

.position-list .tier {
  width: 28px;
  height: 24px;
  font-size: 0.78rem;
}

.position-list .tier.tier-splus,
.position-list .tier.tier-aplus {
  width: 34px;
}

.player-summary small {
  color: var(--muted);
  font-size: 0.74rem;
}

.formula {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 24px;
  align-items: start;
  padding-top: 34px;
  padding-bottom: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.guide-cards {
  display: grid;
  gap: 10px;
}

.guide-cards article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.guide-cards span {
  color: var(--muted);
}

pre {
  margin: 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050c09;
}

code {
  color: #ddf8e6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.notes {
  padding-bottom: 40px;
}

.notes p,
.formula p {
  color: var(--muted);
}

footer {
  padding: 24px clamp(18px, 4vw, 56px) 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 1080px) {
  .hero,
  .formula {
    grid-template-columns: 1fr;
  }

  .court-visual {
    min-height: 420px;
  }

  .filters,
  .player-grid,
  .seo-grid,
  .team-era-grid,
  .position-grid,
  .reset-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  .court-visual {
    min-height: 340px;
  }

  .filters,
  .player-grid,
  .seo-grid,
  .team-era-grid,
  .position-grid,
  .reset-rules {
    grid-template-columns: 1fr;
  }

  .ranking-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .tool-band,
  .seo-band,
  .formula,
  .notes,
  .top-grid,
  .team-era-band {
    width: auto;
    max-width: none;
    margin: 0;
  }

  .team-era-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .team-era-actions {
    justify-content: flex-start;
  }

  .player-card dl {
    grid-template-columns: repeat(2, 1fr);
  }

  .court-stat {
    width: 126px;
  }
}
