:root {
  --bg: #f5ecd6;       /* warm cream — neal.fun-style editorial backdrop */
  --surface: #ffffff;
  --ink: #222;
  --muted: #6f6855;    /* warmer muted to harmonize with cream */
  --border: #e3d9bf;   /* cream-tinted border */
  --primary: #013369;       /* NFL navy */
  --accent:  #d50a0a;       /* NFL red */
  --hover-tint: rgba(187,187,187,0.55);
  --header-tint: #fff36b;   /* sticky-header hover yellow */
  --select-ring: magenta;
  --col-count: 9;       /* dynamic — number of position columns currently displayed */
  --cell-w: 56px;
  --cell-h: 22px;
  --label-w: 44px;
  --header-h: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

/* Canonical almart.in wordmark — shared across all almart.in/labs/* spokes.
   Keep in sync with the snippet in almart.in/CLAUDE.md. */
.al-brand {
  display: inline-block;
  padding: 14px 24px 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.al-brand:hover { text-decoration: underline; text-underline-offset: 3px; }
.al-brand-sep {
  color: var(--muted);
  font-weight: 400;
  margin: 0 0.15em;
}

header {
  padding: 8px 24px 8px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
}
header h1 {
  font-family: 'Arvo', serif;
  font-weight: 700;
  font-size: 2.4em;
  margin: 0;
  letter-spacing: 0.01em;
}
.title-link {
  color: inherit;
  text-decoration: none;
}
.title-link:hover { text-decoration: none; }
.title-link:hover .title-glyph { transform: translateY(-2px) rotate(60deg); }
.title-glyph { transition: transform 200ms ease; }
.title-glyph {
  display: inline-block;
  color: var(--accent);
  font-size: 0.95em;
  margin-right: 4px;
  transform: translateY(-2px);
}
.subtitle { margin: 0; color: var(--muted); }
.subtitle--definition {
  font-size: 0.95em;
  line-height: 1.4;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
}
.subtitle--definition strong {
  font-family: 'Arvo', serif;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.subtitle--definition .pron {
  color: var(--muted);
  font-style: normal;
  font-feature-settings: "kern" 1;
  margin: 0 6px;
}
.subtitle--definition em {
  color: var(--muted);
  font-style: italic;
  margin-right: 4px;
}
@media (max-width: 600px) {
  .subtitle--definition { font-size: 0.85em; }
  .subtitle--definition .pron { display: none; }
}

.controls {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 8px 24px 16px;
  flex-wrap: wrap;
}
.toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.era-buttons { display: flex; gap: 4px; }
.era-buttons button {
  background: white;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
}
.era-buttons button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.splits {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.splits-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.splits .toggle { font-size: 13px; }

/* Search trigger — floats to the right of the controls bar */
.search-trigger {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  padding: 4px 10px 4px 8px;
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
  color: var(--muted);
}
.search-trigger:hover { border-color: var(--primary); color: var(--ink); }
.search-trigger .search-icon { font-size: 16px; line-height: 1; color: var(--muted); }
.search-trigger-label { font-size: 13px; }
.search-trigger-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) min-content minmax(0, 360px);
  gap: 28px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 24px;
  align-items: start;
}
main#chart {
  padding: 0;
}
.rail { font-size: 13px; }
.rail--left {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rail--right {
  position: relative;
  min-height: var(--grid-height, auto);
}

/* === LATEST DRAFTIGAMI hero card === */
.latest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 6px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.latest-card .eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.latest-card .eyebrow::before { content: "🟥  "; }
.latest-card .coord {
  font-family: 'Arvo', serif;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.latest-card .player { font-weight: 600; font-size: 15px; }
.latest-card .meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.latest-card .jump-btn {
  margin-top: 4px;
  align-self: flex-start;
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.latest-card .jump-btn:hover { background: #002558; }

/* === stat tiles === */
.stat-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-tile .num {
  font-family: 'Arvo', serif;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-tile .lbl {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.stat-tile.full { grid-column: 1 / -1; }
.stat-tile.full .num { font-size: 17px; }
.stat-tile.full .num a { color: var(--primary); text-decoration: none; }
.stat-tile.full .num a:hover { text-decoration: underline; }
/* The next-draftigami tile is the only stat tile that shows a *predicted*
   value rather than a historical fact. Subtle red eyebrow accent ties it
   to the LATEST DRAFTIGAMI hero card visually — both are about future-y
   draftigami events. */
.stat-tile.full.next {
  border-top: 2px solid var(--accent);
  background: linear-gradient(180deg, rgba(213,10,10,0.04) 0%, var(--surface) 35%);
}
.stat-tile.full.next .num a { color: var(--accent); }
.stat-tile.full.next .lbl { color: var(--ink); font-weight: 500; }
.grid {
  display: grid;
  grid-template-rows: var(--header-h);
  grid-auto-rows: var(--cell-h);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  width: max-content;
}
.col-headers,
.row {
  display: contents;
}
.col-header,
.row-label {
  background: var(--surface);
  font-weight: 600;
  color: var(--ink);
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: sticky;
}
.col-header {
  top: 0;
  height: var(--header-h);
  width: var(--cell-w);
  font-size: 13px;
  font-family: 'Arvo', serif;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--surface);
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}
.row-label {
  left: 0;
  width: var(--label-w);
  justify-content: flex-end;
  padding-right: 8px;
  background: var(--surface);
  z-index: 5;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--muted);
}
.row-label--dim { color: #c0c0c0; }
.col-header.hi, .row-label.hi { background: var(--header-tint); color: black; }

/* Round dividers — picks 33/65/97/129/161/193 each open a new round in
   the modern era. A stronger top border on the row label + a faint top
   border across every cell on the same row gives the eye a landmark while
   scanning right; an "R2 / R3 / …" tag in the row-label gutter labels it. */
.row-label--round {
  border-top: 2px solid var(--ink);
}
.cell--round-divider {
  border-top: 1px solid #c8bfa5;
}
.round-tag {
  position: absolute;
  top: 1px;
  left: 2px;
  font-family: 'Arvo', serif;
  font-style: italic;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  pointer-events: none;
  line-height: 1;
}
.corner-cell {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 15;
  width: var(--label-w);
  height: var(--header-h);
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cell {
  width: var(--cell-w);
  height: var(--cell-h);
  border-right: 1px solid #f1f1f1;
  border-bottom: 1px solid #f1f1f1;
  background: white;
  position: relative;
}
.cell.has { background: var(--primary); }
.cell.cross { box-shadow: inset 0 0 0 9999px var(--hover-tint); }
.cell.selected { box-shadow: inset 0 0 0 3px var(--select-ring); }
.cell[data-annotated="true"] { box-shadow: inset -3px 0 0 var(--accent); }
.cell[data-annotated="true"].selected { box-shadow: inset -3px 0 0 var(--accent), inset 0 0 0 3px var(--select-ring); }

/* Mr. Irrelevant cells — every (pos, pick) that has been the very last pick
   of some modern-era draft (1994+). A small gold dot in the top-right
   corner marks the cell. The variance in pick number across years is exactly
   what makes Mr. Irrelevant interesting; click any dotted cell to see which
   year(s) and player(s). */
.cell[data-mr-irrelevant="true"]::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  background: #f5b041;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
  pointer-events: none;
}

/* Subtle "last time this combo happened" year tag, rendered inside each
   filled cell. Italic, very low contrast — a quiet bonus, not visual noise.
   mix-blend-mode: difference auto-inverts on light cells so a pale-navy
   heatmap cell still shows readable text without per-cell logic. */
.cell-yr {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 300;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: white;
  mix-blend-mode: difference;
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

/* === editorial annotations (right rail) ===
   Cards stack in normal flow. JS sets `margin-top` per card so each card
   either lines up with its anchor row OR sits below the previous card.
   Overlap is structurally impossible — if a card grows after font load,
   the next card just shifts down. No absolute positioning, no rAF race. */
.rail--right .ann {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.45;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.rail--right .ann:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateX(1px);
}
.rail--right .ann-coord {
  font-family: 'Arvo', serif;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rail--right .ann h3 {
  margin: 4px 0 6px;
  font-family: 'Arvo', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.rail--right .ann p { margin: 0; color: #444; }
.rail--right .ann::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 14px;
  width: 13px;
  border-top: 1px dashed var(--accent);
}

.loading { color: var(--muted); padding: 24px 0; }

dialog#cell-modal {
  border: none;
  border-radius: 8px;
  padding: 20px 24px;
  max-width: 480px;
  width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
dialog#cell-modal::backdrop { background: rgba(0,0,0,0.4); }
dialog .close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 22px; cursor: pointer;
}
dialog h2 { font-family: 'Arvo', serif; margin: 0 0 4px; font-size: 1.1em; }
dialog .muted { color: var(--muted); margin: 0 0 12px; }
dialog ul { margin: 0; padding: 0; list-style: none; max-height: 300px; overflow-y: auto; }
dialog li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
}
dialog li .yr { color: var(--muted); font-variant-numeric: tabular-nums; }
.modal-title-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin: 0 0 4px;
}
.modal-title-link:hover h2 { color: var(--accent); }
.modal-title-link h2 { margin: 0 0 2px; }
.modal-title-cta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal-title-link--disabled .modal-title-cta { display: none; }
.modal-title-link--disabled { cursor: default; }
.modal-title-link--disabled:hover h2 { color: inherit; }

/* === Cmd-K search palette ============================================== */
dialog#search-palette {
  border: none;
  border-radius: 8px;
  padding: 0;
  width: 520px;
  max-width: 92vw;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  background: var(--surface);
  /* center by default; on tall viewports lift it up a touch */
  margin-top: max(8vh, 64px);
}
dialog#search-palette::backdrop { background: rgba(20, 20, 20, 0.42); }

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.search-input-icon {
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
}
#search-input {
  flex: 1;
  border: none;
  outline: none;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  padding: 4px 0;
}
#search-input::placeholder { color: var(--muted); }
.search-esc-hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--muted);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 50vh;
  overflow-y: auto;
}
.search-result {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  grid-template-areas:
    "coord  name   badges"
    "coord  meta   badges";
  column-gap: 12px;
  row-gap: 1px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  border-left: 3px solid transparent;
}
.search-result:hover,
.search-result.active {
  background: var(--hover-tint);
  border-left-color: var(--primary);
}
.search-result-coord {
  grid-area: coord;
  font-family: 'Arvo', serif;
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}
.search-result-name {
  grid-area: name;
  font-weight: 600;
  color: var(--ink);
}
.search-result-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 12px;
}
.search-result-badges {
  grid-area: badges;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Aggregate header rows: "All Bears picks (87)" — slightly different look */
.search-result--agg {
  grid-template-columns: 24px 1fr auto;
  grid-template-areas: "icon  name  count";
  background: linear-gradient(0deg, var(--bg) 0%, var(--surface) 100%);
}
.search-result--agg .search-result-coord {
  grid-area: icon;
  font-size: 14px;
  color: var(--accent);
  text-align: center;
}
.search-result--agg .search-result-name {
  grid-area: name;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  align-self: center;
}
.search-result--agg .search-result-count {
  grid-area: count;
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.search-result--agg-team {
  grid-template-columns: 24px 1fr auto 16px;
  grid-template-areas: "icon  name  count arrow";
}
.search-result--agg-team .search-result-arrow {
  grid-area: arrow;
  align-self: center;
  color: var(--accent);
  font-weight: 600;
}

.search-empty,
.search-tip {
  padding: 12px 16px 14px;
  font-size: 12px;
  margin: 0;
  border-top: 1px solid var(--border);
}
.search-tip kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  margin: 0 1px;
}
.search-tip em { font-style: normal; color: var(--ink); font-weight: 600; }

@media (max-width: 600px) {
  dialog#search-palette {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    height: 100vh;
  }
  .search-results { max-height: calc(100vh - 130px); }
}

.faq { padding: 24px; max-width: 720px; }
.faq h2 { font-family: 'Arvo', serif; font-size: 1.2em; }
.faq details { border-top: 1px solid var(--border); padding: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: 8px; }
.more-reading {
  padding: 24px;
  max-width: 720px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.more-reading p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 12px 0;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

footer {
  padding: 28px 24px 40px;
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  border-top: 1px solid var(--border);
}
footer .footer-line {
  margin: 0 0 6px;
  font-family: 'Arvo', serif;
  font-weight: 400;
  color: var(--ink);
}
footer .footer-line:last-of-type { margin-bottom: 18px; }
footer .footer-credit {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
footer a:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
    gap: 20px;
  }
  .rail--left {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rail--left .latest-card { flex: 1 1 240px; }
  .rail--left .stat-tiles { flex: 2 1 320px; }
  /* IMPORTANT: no overflow on main here. overflow creates a new sticky containing
     block which breaks the position-sticky col-headers. Cells are sized via the
     <600px breakpoint to fit narrow viewports without needing horizontal scroll. */
  main#chart { order: 2; max-width: 100%; }
  .rail--right { order: 3; min-height: 0; }
  .rail--right .ann {
    position: static;
    margin-bottom: 12px;
  }
  .rail--right .ann::before { display: none; }
}

/* Phone viewports: swap the matrix for a chip-bar + pick-strip layout. The
   matrix is unreadable on portrait phones (262 rows × 13 cols of 24px cells);
   the strip view shows one pick per row at full width with a heat tint, and
   a sticky scroll-snap chip bar swaps the active position. The desktop grid
   stays in the DOM and is hidden via .layout-mobile; the mobile DOM stays
   hidden by default and shown by the same toggle. JS picks which to populate. */
@media (max-width: 600px) {
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .latest-card .coord { font-size: 20px; }
  .latest-card .player { font-size: 16px; }
  .latest-card .meta { font-size: 13px; }
  .stat-tile .num { font-size: 20px; }
  .stat-tile .lbl { font-size: 12px; }
  .controls { padding: 6px 12px 12px; gap: 12px; font-size: 14px; }
  .era-buttons button { padding: 6px 12px; font-size: 14px; }
  header { padding: 16px 12px 4px; }
  header h1 { font-size: 1.7em; }
  .layout { padding: 0 12px 24px; gap: 16px; }
  .rail--right .ann { font-size: 13px; line-height: 1.5; }
  .rail--right .ann h3 { font-size: 15px; }
  .search-trigger { margin-left: 0; }
}

body.layout-mobile main#chart { display: none; }
body:not(.layout-mobile) #mobile-chart { display: none !important; }
body.layout-mobile .rail--left { order: 3; }
body.layout-mobile .rail--right { order: 4; }
body.layout-mobile #mobile-chart { order: 2; }

.mobile-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Sticky position chip bar — horizontal scroll with scroll-snap. The
   chip strip survives content scroll so the user always knows which
   position they're seeing. */
.mobile-chip-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px;
  margin: 0 -12px;        /* bleed into layout padding for full-width feel */
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.mobile-chip-bar::-webkit-scrollbar { display: none; }
.mobile-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-family: 'Arvo', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.mobile-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Pick strips — one row per pick. Heat tint via background gradient mask
   from left (heat) to surface (right). Empty cells get a draftigami-red
   left-edge bar. Tap → existing cell modal. */
.mobile-strips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.pick-strip {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  grid-template-areas:
    "pick body badges"
    "pick meta badges";
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  background: var(--surface);
  overflow: hidden;
}
.pick-strip::before {
  /* heat tint: a left-anchored colored fill that rides under the content */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--strip-fill, var(--surface));
  z-index: 0;
  pointer-events: none;
}
.pick-strip > * { position: relative; z-index: 1; }
.pick-strip:hover { background: var(--hover-tint); }
.pick-strip--round {
  border-top: 2px solid var(--ink);
}
.pick-strip--round::after {
  content: "R" attr(data-round);
  position: absolute;
  top: 4px;
  right: 8px;
  font-family: 'Arvo', serif;
  font-style: italic;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  z-index: 2;
}

.pick-strip-num {
  grid-area: pick;
  font-family: 'Arvo', serif;
  font-size: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 6px;
  border-right: 1px solid var(--border);
}
.pick-strip-num--white { color: var(--accent); }
.pick-strip-body {
  grid-area: body;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.pick-strip-body--white { color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.pick-strip-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 12px;
}
.pick-strip-badges {
  grid-area: badges;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pick-strip[data-mr-irrelevant="true"]::before {
  background:
    radial-gradient(circle 4px at calc(100% - 16px) 50%, #f5b041 0 4px, transparent 5px),
    var(--strip-fill, var(--surface));
}

/* === LATEST DRAFTIGAMIS feed (rail card) === */
.latest-feed {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.latest-feed-row {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 1px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.latest-feed-row:hover { background: var(--hover-tint); }
.latest-feed-coord {
  font-family: 'Arvo', serif;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.latest-feed-player { font-weight: 600; font-size: 13px; }
.latest-feed-meta { color: var(--muted); font-size: 11px; }
.latest-feed-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  vertical-align: 1px;
  margin-left: 2px;
}
.latest-feed-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-top: 4px;
  align-self: flex-start;
}
.latest-feed-link:hover { text-decoration: underline; }

/* === /2026 page === */
.back-link { color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.page-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 24px 32px;
}
.page-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.page-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
}
.page-tab:hover { color: var(--ink); }
.page-tab.active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border);
}
.page-summary {
  font-size: 13px;
  margin: 0 0 16px;
}
.page-h2 {
  font-family: 'Arvo', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 8px;
  letter-spacing: -0.01em;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }

/* Top-of-page browse strip: Year picker + Team picker, with optional
   prev/next year arrows. Shared component across homepage, year pages,
   team pages, and remaining page (rendered by browse-nav.js). */
.browse-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 12px;
  font-size: 13px;
}
.browse-label {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}
.browse-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.browse-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 30px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}
.browse-arrow:hover { background: var(--hover-tint); }
.browse-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.browse-pill:hover { background: var(--hover-tint); }
.browse-pill--current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.browse-pill--current:hover {
  background: var(--primary);
  color: #fff;
}
.browse-group--quick { gap: 8px; flex-wrap: wrap; }
.browse-arrow--disabled {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.browse-select {
  display: inline-flex;
  align-items: center;
}
.browse-select select {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-width: 130px;
}
.browse-select select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Homepage variant — sits in its own strip just under the header so it
   doesn't compete with the chart controls. */
.browse-nav--top {
  padding: 0 24px;
  margin-top: -2px;
  margin-bottom: 8px;
}
@media (max-width: 600px) {
  .browse-nav--top { padding: 0 12px; }
}

/* Sort toggle on team pages — two buttons; click the active one to flip
   direction, click the other to switch sort mode. */
.sort-toggle {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  background: var(--surface);
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 3px;
}
.sort-btn:hover { color: var(--ink); }
.sort-btn.is-active {
  background: var(--ink);
  color: var(--bg, #fff);
}
.sort-arrow { font-size: 12px; line-height: 1; }

.dlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.dlist-empty {
  padding: 24px 0;
  color: var(--muted);
  font-style: italic;
}
/* The row uses an inset background-link pattern: the whole row clicks
   through to the cell page via .d-row-bg (absolute, covers the row),
   while inline links inside cells (e.g. team code on year pages, year
   on team pages) sit above with pointer-events restored. This avoids
   nested-anchor invalid HTML. */
.d-row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  grid-template-areas:
    "coord player badges"
    "coord meta   badges";
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  color: var(--ink);
}
.d-row:first-child { border-top: 1px solid var(--border); }
.d-row:hover { background: var(--hover-tint); }
.d-row-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  text-indent: -9999px;
  overflow: hidden;
}
.d-row > .d-coord,
.d-row > .d-player,
.d-row > .d-meta,
.d-row > .d-badges {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.d-coord {
  grid-area: coord;
  font-family: 'Arvo', serif;
  font-size: 16px;
}
.d-player { grid-area: player; font-weight: 600; font-size: 14px; }
.d-meta { grid-area: meta; color: var(--muted); font-size: 12px; }
.d-badges { grid-area: badges; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.d-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
/* Inline meta link (team code / year). Re-enables pointer events so
   clicks land on the deep link instead of the row's bg link. */
.d-meta-link {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
}
.d-meta-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

@media (max-width: 600px) {
  .page-main { padding: 8px 12px 24px; }
  .d-row {
    grid-template-columns: 80px 1fr;
    grid-template-areas:
      "coord player"
      "coord meta"
      "badges badges";
    row-gap: 4px;
  }
  .d-badges { justify-content: flex-start; margin-top: 2px; }
}

/* === /c/<pos>-<pick> standalone cell pages === */
.cell-page { max-width: 720px; }
.cell-coord {
  font-family: 'Arvo', serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.cell-coord-pos { color: var(--primary); }
.cell-coord-sep { color: var(--muted); margin: 0 8px; }
.cell-coord-pick { color: var(--ink); }

.cell-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 18px 22px 20px;
  margin-bottom: 24px;
}
.cell-hero--empty { border-left-color: var(--primary); }
.cell-eyebrow {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}
.cell-eyebrow--empty { background: var(--primary); }
.cell-eyebrow-badge {
  display: inline-block;
  margin-bottom: 10px;
  margin-left: 6px;
  vertical-align: 1px;
}
.cell-rarity-section { background: rgba(37, 99, 235, 0.04); border-radius: 4px; padding: 12px 16px; }
.cell-rarity-section h3 { border-bottom: none; padding-bottom: 0; }
.cell-rarity-line { font-size: 14px; }
.cell-rarity-foot { font-size: 12px; margin-top: 8px !important; }

/* Editor's note — curated, opinionated take on a cell. Mirrors the rail
   annotation's voice; lives between hero and the rarity/trend blocks so an
   informed reader sees the editorial framing before the model output. */
.cell-notes { border-left: 3px solid var(--accent, #ef4444); padding-left: 14px; }
.cell-notes h3 { border-bottom: none; padding-bottom: 0; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cell-note + .cell-note { margin-top: 12px; }
.cell-note-title { font-family: "Arvo", Georgia, serif; font-size: 18px; margin: 0 0 4px; }
.cell-note-body { font-size: 15px; line-height: 1.5; margin: 0; }

.cell-trend-svg {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 8px 0 4px;
  font-size: 10px;
  font-family: 'Inter', system-ui, sans-serif;
}
.cell-trend-line {
  fill: none;
  stroke: rgb(37, 99, 235);
  stroke-width: 1.5;
}
.cell-trend-area {
  fill: rgba(37, 99, 235, 0.06);
  stroke: none;
}
.cell-trend-ci {
  /* 90% Laplace-approximation CI band from the spline GAM. Sits between the
     area fill and the line so the line stays the dominant visual element. */
  fill: rgba(37, 99, 235, 0.18);
  stroke: none;
}
.cell-trend-axis,
.cell-trend-ticks line {
  stroke: var(--border);
  stroke-width: 1;
}
.cell-trend-ticks text,
.cell-trend-ylabels text {
  fill: var(--muted);
  font-size: 10px;
}
.cell-trend-event-line {
  stroke: rgb(220, 38, 38);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}
.cell-trend-event-dot {
  fill: rgb(220, 38, 38);
  stroke: var(--bg, #fff);
  stroke-width: 1.5;
}
.cell-trend-event-label {
  fill: rgb(220, 38, 38);
  font-size: 10px;
  font-weight: 600;
}
.cell-trend-stats {
  font-size: 12px;
  margin-top: 4px !important;
}
.cell-headline {
  font-family: 'Arvo', serif;
  font-size: 28px;
  margin: 0 0 8px;
  line-height: 1.2;
}
.cell-sub {
  margin: 0 0 4px;
  font-size: 15px;
}
.cell-when {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Totals strip — sits directly under the hero on filled cell pages with
   more than one occurrence. Big count + caption + most-recent line. */
.cell-totals {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 14px 22px;
  margin: 0 0 24px;
}
.cell-totals-num {
  font-family: 'Arvo', serif;
  font-size: 56px;
  line-height: 1;
  color: var(--primary);
  flex-shrink: 0;
}
.cell-totals-body { min-width: 0; }
.cell-totals-cap {
  font-family: 'Arvo', serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}
.cell-totals-recent {
  font-size: 13px;
  color: var(--muted);
}
.team-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}
.team-link:hover { text-decoration-color: currentColor; }

.cell-section {
  margin-bottom: 28px;
}
.cell-section h3 {
  font-family: 'Arvo', serif;
  font-size: 16px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.cell-section p { margin: 4px 0; }

.cell-mri { background: rgba(255, 215, 0, 0.08); border-radius: 4px; padding: 12px 16px; }
.cell-mri h3 { border-bottom: none; padding-bottom: 0; }
.cell-mri-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.cell-mri-list li { padding: 2px 0; }
.cell-mri-list .yr {
  display: inline-block;
  font-family: 'Arvo', serif;
  width: 48px;
  color: var(--muted);
}

.surr-list, .later-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.surr-row, .later-row {
  display: grid;
  grid-template-columns: 60px 50px 1fr;
  grid-template-areas:
    "pick pos player"
    "pick pos meta";
  column-gap: 10px;
  row-gap: 1px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.surr-row:first-child, .later-row:first-child { border-top: 1px solid var(--border); }

.surr-pick { grid-area: pick; font-family: 'Arvo', serif; color: var(--muted); }
.surr-pos {
  grid-area: pos;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--primary);
  align-self: center;
}
.surr-player { grid-area: player; font-weight: 600; }
.surr-meta { grid-area: meta; color: var(--muted); font-size: 12px; }

.later-row {
  grid-template-columns: 60px 1fr;
  grid-template-areas:
    "yr player"
    "yr meta";
}
.later-yr { grid-area: yr; font-family: 'Arvo', serif; color: var(--muted); }
.later-player { grid-area: player; }
.later-meta { grid-area: meta; color: var(--muted); font-size: 12px; }

.cell-back-cta {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

@media (max-width: 600px) {
  .cell-headline { font-size: 22px; }
  .cell-coord { font-size: 18px; }
  .cell-hero { padding: 14px 16px 16px; }
  .cell-totals { padding: 12px 16px; gap: 14px; }
  .cell-totals-num { font-size: 44px; }
  .cell-totals-cap { font-size: 14px; }
}

/* === Rarity tiers (Pokémon-flavored ladder) ============================
   Shared visual language for the three surfaced tiers. COMMON has no badge.
   Each tier has a saturated background + white text; LEGENDARY adds an
   animated rainbow shimmer because the kid named the feature.
   Used by .d-rarity (in /2026 list rows) and .latest-feed-badge--rarity
   (in homepage Latest feed) and .modal-rarity (in cell modal). */
.d-rarity,
.modal-rarity {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  color: white;
}
.modal-rarity { font-size: 11px; vertical-align: 1px; }
.modal-rarity-wrap {
  margin-left: 8px;
  font-style: italic;
  color: var(--muted);
  font-size: 12px;
}

.d-rarity--rare,
.latest-feed-badge--rare,
.modal-rarity--rare           { background: #2563eb; }                              /* blue */
.d-rarity--super-rare,
.latest-feed-badge--super-rare,
.modal-rarity--super-rare     { background: linear-gradient(135deg, #f59e0b, #d97706);  /* gold */
                                color: #1a1303; text-shadow: 0 0 1px rgba(255,255,255,0.4); }
/* SUPER RARE escalates to gold (formerly the MEGA RARE color) so the three-
   tier ladder still reads as RARE (blue) → SUPER RARE (gold) → LEGENDARY
   (rainbow shimmer). */

/* LEGENDARY — animated rainbow gradient. Background-size larger than the
   element so the position transition reads as a slow shimmer. */
.d-rarity--legendary,
.latest-feed-badge--legendary,
.modal-rarity--legendary {
  background: linear-gradient(
    90deg, #ff3366, #ff9f1c, #ffd60a, #34d399, #38bdf8, #818cf8, #d946ef, #ff3366
  );
  background-size: 300% 100%;
  animation: rarity-shimmer 6s linear infinite;
  color: white;
  text-shadow: 0 0 2px rgba(0,0,0,0.55);
}
@keyframes rarity-shimmer {
  from { background-position: 0% 0%; }
  to   { background-position: 300% 0%; }
}
@media (prefers-reduced-motion: reduce) {
  .d-rarity--legendary,
  .latest-feed-badge--legendary,
  .modal-rarity--legendary { animation: none; }
}

/* In the Latest feed the rarity chip rides next to the existing super
   chip — same visual weight as .latest-feed-badge but with tier color. */
.latest-feed-badge--rarity {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  vertical-align: 1px;
  margin-left: 2px;
  color: white;
}

.cell:focus-visible { outline: 3px solid #c0392b; outline-offset: 1px; z-index: 2; }
.live-page { max-width: 1080px; }
.watch-controls { display:flex; flex-wrap:wrap; gap:16px; align-items:center; margin:16px 0; }
.watch-controls select,.watch-controls button,.event-feed button { font:inherit; min-height:44px; padding:8px; }
.watch-options { list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; }
.watch-options li { border-left:3px solid #013369; background:#fff9; padding:14px; display:grid; gap:6px; }
.event-feed { padding-left:24px; }.event-feed li { padding:12px 0; border-bottom:1px solid #01336933; }
.live-grid { display:grid; grid-template-columns:repeat(13,minmax(38px,1fr)); overflow:auto; max-height:440px; font-size:11px; }
.live-grid a { padding:4px; text-align:center; border:1px solid #01336922; color:#013369; }.live-grid small { display:block; }.live-filled { background:#01336922; }
#live-status { font-weight:600; border-bottom:2px solid #c0392b; padding:12px 0; }
@media(max-width:600px){.live-page{padding:0 12px}.live-grid{grid-template-columns:repeat(13,42px)}.watch-controls label{display:grid;gap:4px}}
.media-story { margin:30px 0; padding-top:20px; border-top:1px solid #01336955; }.media-story img { width:100%;height:auto;max-width:720px; }
.broadcast { padding:24px;max-width:1100px;margin:auto; }.broadcast h1 { font-size:clamp(36px,8vw,88px); }.broadcast h2 { font-size:clamp(24px,5vw,52px); }
