:root {
  --court: #0c1c33;
  --court-2: #10243f;
  --court-3: #163055;
  --chalk: #eef2f7;
  --ink-2: #b7c3d4;
  --muted: #8494ab;
  --line: rgba(238, 242, 247, .14);
  --optic: #dcf542;
  --pos: #1fa483;
  --neg: #dd5f2c;
  --pos-text: #4fd3ae;
  --neg-text: #ff8a5c;
  --neutral: #5b6b82;
  --radius: 14px;
  --display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--chalk);
  font: 400 16px/1.55 var(--display);
  background-color: var(--court);
  background-image:
    linear-gradient(90deg, transparent calc(50% - 1px), var(--line) calc(50% - 1px), var(--line) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(180deg, transparent 419px, var(--line) 419px, var(--line) 421px, transparent 421px),
    radial-gradient(1200px 600px at 85% -10%, rgba(220, 245, 66, .09), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(79, 148, 232, .12), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px);
  background-attachment: fixed, scroll, fixed, fixed, fixed;
  min-height: 100vh;
}
a { color: var(--optic); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.pos-text { color: var(--pos-text); }
.neg-text { color: var(--neg-text); }
.neutral-text { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- masthead */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 18px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--chalk); text-decoration: none; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.brand b { color: var(--optic); }
.ball {
  width: 22px; height: 22px; border-radius: 50%; background: var(--optic); position: relative; overflow: hidden;
  box-shadow: 0 0 18px rgba(220, 245, 66, .45);
}
.ball::before, .ball::after {
  content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--court); border-radius: 50%;
}
.ball::before { left: -13px; }
.ball::after { right: -13px; }
.masthead nav { display: flex; gap: 4px; flex-wrap: wrap; }
.masthead nav a {
  color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: background .2s, color .2s;
}
.masthead nav a:hover { background: var(--court-3); color: var(--chalk); }
.masthead nav a[aria-current] { background: var(--optic); color: var(--court); }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 40px 0 28px; }
.kicker { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--optic); margin: 0 0 12px; }
h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: .98; letter-spacing: -.035em; margin: 0 0 18px; font-weight: 800; }
h1 em { font-style: normal; color: var(--optic); }
h1 a { color: inherit; text-decoration: none; }
h1 a:hover { color: var(--optic); }
.hero--player h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
.vs { color: var(--muted); font-weight: 400; font-size: .6em; vertical-align: middle; padding: 0 .2em; }
.lede { color: var(--ink-2); font-size: 1.12rem; max-width: 760px; margin: 0 0 22px; }
.archetype { margin: 0 0 18px; color: var(--ink-2); }
.archetype b { color: var(--chalk); background: var(--court-3); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; font-weight: 600; }

/* ---------------------------------------------------------------- forms */
.forms { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card {
  background: linear-gradient(160deg, var(--court-3), var(--court-2)); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 12px; align-content: start;
}
.card h2 { margin: 0; font-size: 1.15rem; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
input, select {
  font: inherit; color: var(--chalk); background: var(--court); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; width: 100%; min-width: 0; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--optic); box-shadow: 0 0 0 3px rgba(220, 245, 66, .2); }
button {
  font: 700 1rem var(--display); color: var(--court); background: var(--optic); border: 0; border-radius: 10px; padding: 12px 18px;
  cursor: pointer; transition: transform .15s, box-shadow .2s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(220, 245, 66, .25); }
button:active { transform: translateY(1px); }
.hint { margin: 0; font-size: .9rem; color: var(--muted); }
.inline-form { display: flex; gap: 8px; max-width: 520px; }
.inline-form input { flex: 1; }

/* ---------------------------------------------------------------- panels */
.panel {
  background: rgba(16, 36, 63, .78); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; margin: 0 0 18px; backdrop-filter: blur(4px);
}
.panel h2 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -.02em; }
.panel h3 { margin: 18px 0 8px; font-size: 1.02rem; color: var(--chalk); }
.panel h3.who { color: var(--optic); margin-top: 6px; }
.note { color: var(--muted); font-size: .92rem; margin: 0 0 14px; max-width: 820px; }
.callout { background: var(--court-3); border-left: 3px solid var(--optic); padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 0 0 14px; }
.callout .muted { display: block; font-size: .9rem; margin-top: 4px; }
.two, .three, .trio, .ev-grid, .charts { display: grid; gap: 18px 28px; grid-template-columns: 1fr; }
.trio div { border-top: 2px solid var(--optic); padding-top: 10px; }
.trio p { margin: 6px 0 0; color: var(--ink-2); font-size: .95rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  color: var(--chalk); text-decoration: none; background: var(--court-3); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-weight: 600; transition: border-color .2s, transform .2s;
}
.chip:hover { border-color: var(--optic); transform: translateY(-1px); color: var(--chalk); }
.chip .mono { color: var(--muted); }

.matchlist { list-style: none; margin: 0; padding: 0; }
.matchlist a {
  display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; padding: 10px 4px; border-bottom: 1px solid var(--line);
  color: var(--chalk); text-decoration: none; transition: background .15s, padding .15s;
}
.matchlist a:hover { background: var(--court-3); padding-left: 10px; }

/* ---------------------------------------------------------------- metrics */
.metrics { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 6px 0 12px; }
.metric { background: var(--court); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; }
.metric-label { color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.metric-value { font: 600 2.2rem/1.1 var(--mono); letter-spacing: -.04em; }
.metric-value.pos { color: var(--pos-text); }
.metric-value.neg { color: var(--neg-text); }
.metric-value.neutral { color: var(--chalk); }
.metric-value .pm { font-size: .45em; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: .2em; }
.metric-sub { color: var(--muted); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 6px; border-bottom: 1px solid var(--line); }
td { padding: 7px 6px; border-bottom: 1px solid rgba(238, 242, 247, .06); vertical-align: middle; }
th.num, td.num { text-align: right; }
td.num { white-space: nowrap; }
th.center { text-align: center; }
tr.best td { background: rgba(31, 164, 131, .14); }
tr.best td:first-child { box-shadow: inset 3px 0 0 var(--pos); }
tr.sumrow td { border-top: 1px solid var(--line); font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.attribution { min-width: 640px; }
.attribution td.total { min-width: 92px; }
.attribution td.total b { display: block; }
.barcell { width: 32%; min-width: 90px; }

.dbar { display: block; position: relative; height: 10px; background: linear-gradient(90deg, transparent calc(50% - 1px), var(--neutral) calc(50% - 1px), var(--neutral) calc(50% + 1px), transparent calc(50% + 1px)); }
.dbar-fill { position: absolute; top: 1px; height: 8px; border-radius: 4px; }
.dbar-fill.pos { background: var(--pos); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.dbar-fill.neg { background: var(--neg); border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dbar-fill.neutral { background: var(--neutral); }
.sbar { display: inline-block; width: 48px; height: 6px; background: rgba(238, 242, 247, .08); border-radius: 3px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.sbar span { display: block; height: 100%; background: var(--optic); border-radius: 0 3px 3px 0; }

.ev { background: var(--court); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 12px; }
.ev h3 { font-size: .98rem; }
.ev p { margin: -4px 0 8px; font-size: .78rem; }

.patterns, .similar, .board { margin: 0; padding-left: 1.4em; }
.patterns li { padding: 6px 0; border-bottom: 1px solid rgba(238, 242, 247, .06); }
.patterns li span { display: block; }
.similar li { padding: 4px 0; }
.mini { font-family: var(--mono); font-size: .75rem; margin-left: 6px; }
.board li { display: list-item; padding: 5px 0; border-bottom: 1px solid rgba(238, 242, 247, .06); }
.board li .mono { float: right; }
.serveplan p { margin: 6px 0 0; }

.toggles { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.toggles a { color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.toggles a[aria-current] { background: var(--chalk); color: var(--court); border-color: var(--chalk); }
.toggles .sep { width: 12px; }

/* ---------------------------------------------------------------- charts */
.legend { display: flex; gap: 16px; font-family: var(--mono); font-size: .85rem; color: var(--ink-2); margin: 0; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart { margin: 0; background: var(--court); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px 8px; }
.chart figcaption { font-weight: 600; margin: 0 4px 6px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(238, 242, 247, .08); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 10px var(--mono); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: transparent; stroke: transparent; cursor: crosshair; }
.chart .dot:hover { fill: var(--c); stroke: var(--court); stroke-width: 2; }
.chart .zero { stroke: rgba(238, 242, 247, .28); }
.chart .whisker { stroke-width: 1.5; opacity: .55; }
.chart .dlabel { fill: var(--ink-2); font: 600 10px var(--mono); }
.chart details { margin: 6px 4px 0; font-size: .85rem; }
.chart summary { color: var(--muted); cursor: pointer; }

.prose { max-width: 860px; }
.prose p, .prose li { color: var(--ink-2); }
.prose b { color: var(--chalk); }

/* ---------------------------------------------------------------- footer */
.colophon { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.colophon p { margin: 0 0 6px; }

/* ---------------------------------------------------------------- motion */
.reveal { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
main > .reveal:nth-child(2) { animation-delay: .08s; }
main > .reveal:nth-child(3) { animation-delay: .16s; }
main > .reveal:nth-child(4) { animation-delay: .24s; }
main > .reveal:nth-child(n+5) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } * { transition: none !important; } }

/* ---------------------------------------------------------------- larger screens */
@media (min-width: 720px) {
  .panel { padding: 26px 28px; }
  .forms { grid-template-columns: 1.15fr 1fr; }
  .two { grid-template-columns: 1fr 1fr; }
  .trio, .metrics { grid-template-columns: repeat(3, 1fr); }
  .ev-grid { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .three { grid-template-columns: repeat(3, 1fr); }
  .charts { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------- heatmaps, sequences */
.heat td { border: 2px solid var(--court-2); }
.heat td:first-child { white-space: nowrap; }
.matrix td.num { min-width: 42px; text-align: center; }
.matrix th.num { text-align: center; }
.sequences li span + span { margin-top: 2px; }
.pm { color: var(--muted); font-size: .8em; font-weight: 400; margin-left: .3em; white-space: nowrap; }
.ci { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
