/* roflstats.com: one stylesheet, no inline styles (CSP style-src 'self'). */

:root {
  color-scheme: light;
  --bg: #f7f8fa; --surface: #ffffff; --text: #14171f; --muted: #5b6475; --line: #dde1e8; --accent: #0b6bcb;
  --track: #eef0f4; --notice-bg: #e8f1fb; --warn-bg: #fff3cd; --warn-text: #5c4400;
  /* Zones (Okabe-Ito), the same in both themes */
  --z-river: #56B4E9; --z-own_jungle: #009E73; --z-enemy_jungle: #D55E00; --z-top_lane: #E69F00;
  --z-mid_lane: #CC79A7; --z-bot_lane: #0072B2; --z-own_base: #7F8FA6; --z-enemy_base: #A65E5E;
  --z-other: #BBBBBB; --z-dead: #6B6B6B;
  /* Rank groups: an ordinal one-hue ramp, two adjacent ranks per step (Challenger alone),
     light to dark with rank; Unranked grey. Even OKLab lightness steps (adjacent dL 0.06),
     every step at least 3:1 on the surface in both themes (light end 3.3:1 here, 4.1:1 in
     dark). Colour shows the order only: every coloured mark sits next to its group's label. */
  --g-r1: #5d8fd0; --g-r2: #4d7cbb; --g-r3: #3c6aa6; --g-r4: #2d5892; --g-r5: #1d477e; --g-r6: #0d366b; --g-unranked: #6b7280; --g-all: #5b6475;
  --map-bg: #0b0d12; --scroll-shadow: rgba(20, 23, 31, .28);
  /* The followed person on the player pages (charts, their table columns): one colour for one
     thing, at 3:1 or more on the surface and apart from the rank ramp for colour-blind readers
     in both themes. The game map, always dark, uses its own fixed gold. */
  --followed: #9a6400; --followed-band: rgba(154, 100, 0, .16);
  /* The two groups of a comparison: the first (left) blue, the compared group (right) orange.
     Checked as a pair (OKLab): CVD dE 24.7, normal dE 33.6, both >= 3:1 on the surface. */
  --cmp-a: #2a78d6; --cmp-b: #eb6834;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1115; --surface: #171a21; --text: #e6e8ee; --muted: #9aa3b2; --line: #2a2f3a; --accent: #4cc2ff;
    --track: #20242d; --notice-bg: #13283a; --warn-bg: #3a2f00; --warn-text: #ffe08a;
    --g-r1: #4a7cbd; --g-r2: #6490ca; --g-r3: #7ea4d6; --g-r4: #98b9e3; --g-r5: #b2cdef; --g-r6: #cde2fb; --g-unranked: #8a919c; --g-all: #9aa3b2;
    --scroll-shadow: rgba(0, 0, 0, .7);
    --followed: #c2860f; --followed-band: rgba(194, 134, 15, .2);
    --cmp-a: #3987e5; --cmp-b: #d95926;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115; --surface: #171a21; --text: #e6e8ee; --muted: #9aa3b2; --line: #2a2f3a; --accent: #4cc2ff;
  --track: #20242d; --notice-bg: #13283a; --warn-bg: #3a2f00; --warn-text: #ffe08a;
  --g-r1: #4a7cbd; --g-r2: #6490ca; --g-r3: #7ea4d6; --g-r4: #98b9e3; --g-r5: #b2cdef; --g-r6: #cde2fb; --g-unranked: #8a919c; --g-all: #9aa3b2;
  --scroll-shadow: rgba(0, 0, 0, .7);
  --followed: #c2860f; --followed-band: rgba(194, 134, 15, .2);
  --cmp-a: #3987e5; --cmp-b: #d95926;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 22px; line-height: 28px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-size: 13px; overflow-wrap: anywhere; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.test-data-bar { background: var(--warn-bg); color: var(--warn-text); text-align: center; font-weight: 600; font-size: 14px; padding: 5px 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px; display: grid; align-items: center;
  grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav toggle"; column-gap: 16px;
}
.wordmark { grid-area: brand; font-weight: 750; font-size: 19px; color: var(--text); text-decoration: none; min-height: 48px; display: flex; align-items: center; }
.site-nav { grid-area: nav; min-width: 0; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav :is(a, summary) { display: flex; align-items: center; min-height: 48px; padding: 0 10px; color: var(--text); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.site-nav [aria-current] { border-bottom-color: var(--accent); font-weight: 600; }
.nav-group { position: relative; }
.site-nav .nav-group > summary { cursor: pointer; flex-direction: row-reverse; gap: 4px; }
.site-nav .nav-group > summary::before { transform: rotate(45deg); margin-bottom: 5px; }
.site-nav .nav-group[open] > summary::before { transform: rotate(225deg); margin-bottom: 0; }
.nav-group > ul { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 190px; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 16px var(--scroll-shadow); }
.theme-toggle {
  grid-area: toggle; min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}

/* Main grid */
#main {
  max-width: 1280px; margin: 0 auto; padding: 20px 24px 48px;
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 16px; align-items: start;
}
#main > * { grid-column: 1 / -1; min-width: 0; }
/* Below desktop width the wrapper is transparent: maps and cards are items of #main. */
.maps-and-cards { display: contents; }
.maps-and-cards > * { min-width: 0; }
.cards > *, .prose > *, .prose section > *, .map-grid > *,
.filters-body > *, .role-cards > *, .map-pair > *, .zone-figures > *, .maps > * { min-width: 0; }
#main.loading { opacity: .5; transition: opacity .2s; }
.notice { background: var(--notice-bg); border-left: 3px solid var(--accent); padding: 10px 14px; margin: 0; }
.load-error { max-width: 1280px; margin: 12px auto 0; background: var(--warn-bg); color: var(--warn-text); padding: 10px 14px; border-radius: 6px; }
.page-head h1 { max-width: 60ch; }
.lede > :not(.table-scroll, .scroll-top) { max-width: 80ch; }
.answer { font-size: 17px; line-height: 1.5; }
.population { color: var(--muted); font-size: 14px; }
.notes { margin: 4px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--line); list-style: none; font-size: 14px; color: var(--muted); }
.notes li { margin: 2px 0; }
.intro p { font-size: 16px; }

/* Filters and controls */
.filters { margin: 0; }
.filters > summary { display: none; }
.filters-body { display: grid; gap: 10px; }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a, .tab-disabled { display: flex; align-items: center; min-height: 44px; padding: 0 14px; text-decoration: none; color: var(--text); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }
.tab-disabled { color: var(--muted); cursor: not-allowed; }
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.field { display: inline-flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.field select {
  min-height: 44px; min-width: 7rem; padding: 0 8px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.field-small select { min-width: 5.5rem; }
.minutes { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; min-width: 0; }
.minutes legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 2px; float: left; width: 100%; }
.presets { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 6px; text-decoration: none; color: var(--text); background: var(--surface); white-space: nowrap;
}
.preset[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.submit { min-height: 44px; padding: 0 16px; font: inherit; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; cursor: pointer; }
.champion-field { justify-self: start; max-width: 100%; }
.champion-field select { min-width: 14rem; max-width: 100%; }
.back-link { margin: 0; }
.back-link a { display: inline-flex; align-items: center; min-height: 44px; }

/* Maps */
.maps { display: grid; gap: 10px; }
.map-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 440px)); gap: 16px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.map-panel { margin: 0; min-width: 0; }
.map-panel figcaption { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.map { position: relative; aspect-ratio: 1 / 1; background: var(--map-bg); border-radius: 6px; overflow: hidden; touch-action: manipulation; }
.minimap { position: absolute; left: 0; bottom: 0; width: 99%; height: 99%; filter: grayscale(1) brightness(.5) contrast(.95); }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.camps { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.camp { fill: #f4f1e6; stroke: #10151c; stroke-width: 1.3; }
.camps .camp { stroke-width: calc(60px / var(--zoom, 1)); }
.camp-scuttle { fill: none; stroke: #f4f1e6; }
.camps .camp-scuttle { stroke-width: calc(70px / var(--zoom, 1)); }
.map-single { max-width: 600px; }
.bushes { position: absolute; inset: 0; width: 100%; height: 100%; }
.bushes .bush-outline { fill: rgba(150, 240, 160, .6); stroke: #c6f7cc; stroke-width: 30; stroke-linejoin: round; }
.bushes .bush:hover .bush-outline { fill: rgba(150, 240, 160, .9); }
.bushes .bush-number { fill: #f4f6fa; stroke: #0b0d12; stroke-width: 50; paint-order: stroke; font: 600 340px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; pointer-events: none; }
.bush-top-table tbody th { white-space: normal; font-weight: 400; }
.bush-table th .bush-no, .bush-top-table th .bush-no { display: inline-block; min-width: 2.2em; font-variant-numeric: tabular-nums; font-weight: 650; }
.bush-table tbody th { white-space: normal; min-width: 12rem; }
.bush-table thead th.wrap-head { white-space: normal; min-width: 6rem; max-width: 8rem; }
.map-tip { position: absolute; z-index: 2; pointer-events: none; background: rgba(8, 10, 14, .92); color: #f2f4f8; font-size: 12px; line-height: 1.35; padding: 4px 7px; border-radius: 4px; width: max-content; max-width: min(300px, 92%); white-space: pre-line; }
.bush-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bush-lines .bush-outline { fill: none; stroke: rgba(198, 247, 204, .5); stroke-width: calc(40px / var(--zoom, 1)); stroke-linejoin: round; }
.bush-lines .bush.is-hover .bush-outline { fill: rgba(198, 247, 204, .2); stroke: #effff0; stroke-width: calc(80px / var(--zoom, 1)); }
/* Zoom and pan (mapzoom.js): one finger scrolls the page over the whole map and pans a zoomed one;
   the minimap image is moved by a transform, the SVG layers by their viewBox, the canvas redrawn. */
.map.zoomable { touch-action: pan-y; }
.map.zoomable.is-zoomed { touch-action: none; cursor: grab; }
.map.zoomable.is-zoomed:active { cursor: grabbing; }
.map-zoom { position: absolute; z-index: 1; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button {
  width: 32px; height: 32px; padding: 0; border: 1px solid rgba(244, 246, 250, .35); border-radius: 6px;
  background: rgba(8, 10, 14, .78); color: #f4f6fa; font: 600 18px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer; touch-action: manipulation;
}
.map-zoom button:hover:not(:disabled) { background: rgba(30, 36, 48, .92); }
.map-zoom button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.map-zoom button:disabled { opacity: .35; cursor: default; }
.map-zoom-hint {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  padding: 8px 14px; border-radius: 6px; background: rgba(8, 10, 14, .85); color: #f4f6fa; font-size: 14px;
  white-space: nowrap; transition: opacity .3s;
}
.map-grid .map-zoom button { width: 26px; height: 26px; font-size: 15px; }
@media (pointer: coarse) { .map-zoom button { width: 40px; height: 40px; font-size: 21px; } }
.map-gated { display: grid; align-content: start; }
.map-gated p { aspect-ratio: 1 / 1; margin: 0; display: grid; place-items: center; text-align: center; padding: 16px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); }
.map-legend { font-size: 13px; color: var(--muted); }
.map-legend p { margin: 2px 0; }
.ramp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ramp { display: inline-flex; background: var(--map-bg); padding: 2px; border-radius: 3px; }
.lv { display: inline-block; width: 20px; height: 12px; }
.lv0 { background: rgba(59, 15, 112, .45); } .lv1 { background: rgba(140, 41, 129, .55); }
.lv2 { background: rgba(222, 73, 104, .65); } .lv3 { background: rgba(254, 159, 109, .75); } .lv4 { background: rgba(252, 253, 191, .85); }
.sweep-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; padding: 0; list-style: none; }
.sweep-key li { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 20px; height: 12px; border-radius: 2px; }
.sw0 { background: rgba(44, 123, 182, .7); } .sw1 { background: rgba(171, 217, 233, .7); } .sw2 { background: rgba(255, 255, 191, .7); }
.sw3 { background: rgba(253, 174, 97, .75); } .sw4 { background: rgba(215, 25, 28, .8); }
.camp-key svg { vertical-align: -2px; background: var(--map-bg); border-radius: 2px; }
.camp-key svg + svg, .camp-key svg { margin-left: 6px; }

/* Cards */
.cards { display: grid; gap: 16px; }
.card, .gate, .how-to-read { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.card-note { color: var(--muted); font-size: 13px; }
.subhead { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.headline { margin: 4px 0 8px; }
.headline-value { font-size: 26px; font-weight: 650; display: block; line-height: 1.2; }
.gate { border-color: var(--accent); }
.gate ul { padding-left: 20px; }
.gate-links a { display: inline-flex; align-items: center; min-height: 44px; }
.builds-note { color: var(--muted); font-size: 14px; margin: 0; }
.how-to-read > summary, .table-view > summary, .below-threshold > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.table-view > summary, .below-threshold > summary { font-weight: 400; color: var(--accent); }
/* flex summaries lose the disclosure triangle: a chevron shows open and closed */
:is(.how-to-read, .table-view, .below-threshold, .filters, .check-detail, .nav-group) > summary { list-style: none; gap: 10px; }
:is(.how-to-read, .table-view, .below-threshold, .filters, .check-detail, .nav-group) > summary::-webkit-details-marker { display: none; }
:is(.how-to-read, .table-view, .below-threshold, .filters, .check-detail, .nav-group) > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 3px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg);
}
:is(.how-to-read, .table-view, .below-threshold, .filters, .check-detail, .nav-group)[open] > summary::before { transform: rotate(45deg); margin-bottom: 5px; }
.notes-card ul { padding-left: 20px; margin: 8px 0 0; }

/* Help buttons */
.help { flex: none; width: 44px; height: 44px; margin: 0 -8px 0 -6px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-grid; place-items: center; color: var(--muted); font: inherit; }
.help > span[aria-hidden] { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface); }
.help[aria-expanded="true"] > span[aria-hidden] { border-color: var(--accent); color: var(--accent); }
.help-text { font-size: 14px; background: var(--bg); border-left: 3px solid var(--accent); padding: 8px 10px; margin: 4px 0 8px; color: var(--text); }
th .help { margin: -10px -8px -10px -4px; }

/* Bars */
.bars { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.bar-axis, .part-bar { max-width: 760px; }
.bar-row { padding: 2px 0 6px; border-bottom: 1px solid var(--line); }
.bar-row:last-child { border-bottom: 0; }
.bar-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; min-height: 44px; }
.bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-value { text-align: right; white-space: nowrap; }
.bar { display: block; width: 100%; height: 16px; overflow: visible; }
.bar-track { fill: var(--track); }
.whisker { stroke: var(--text); stroke-width: 1.5; }
.ref-tick { stroke: var(--text); stroke-width: 3; }
.bar-ref { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.bar-ref .num { color: var(--text); }
.key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--muted); }
.bar-label .key { margin-right: 0; }

/* Colour classes: fills (SVG) and swatches (HTML) */
.z-own_base { fill: var(--z-own_base); background: var(--z-own_base); }
.z-enemy_base { fill: var(--z-enemy_base); background: var(--z-enemy_base); }
.z-top_lane { fill: var(--z-top_lane); background: var(--z-top_lane); }
.z-mid_lane { fill: var(--z-mid_lane); background: var(--z-mid_lane); }
.z-bot_lane { fill: var(--z-bot_lane); background: var(--z-bot_lane); }
.z-river { fill: var(--z-river); background: var(--z-river); }
.z-own_jungle { fill: var(--z-own_jungle); background: var(--z-own_jungle); }
.z-enemy_jungle { fill: var(--z-enemy_jungle); background: var(--z-enemy_jungle); }
.z-other { fill: var(--z-other); background: var(--z-other); }
.z-dead { fill: url(#hatch-dead); background: repeating-linear-gradient(45deg, #6B6B6B 0 3px, #3d3d3d 3px 5px); }
.bar-plain { fill: var(--accent); background: var(--accent); }
/* Categories of one list that share a stacked bar (bars.part_bar kind "cat"): Okabe-Ito order,
   the tail grey, the same in both themes */
.cat-0 { fill: var(--z-bot_lane); background: var(--z-bot_lane); } .cat-1 { fill: var(--z-top_lane); background: var(--z-top_lane); }
.cat-2 { fill: var(--z-own_jungle); background: var(--z-own_jungle); } .cat-3 { fill: var(--z-mid_lane); background: var(--z-mid_lane); }
.cat-4 { fill: var(--z-river); background: var(--z-river); } .cat-5 { fill: var(--z-enemy_jungle); background: var(--z-enemy_jungle); }
.cat-6 { fill: var(--z-enemy_base); background: var(--z-enemy_base); } .cat-7 { fill: var(--z-own_base); background: var(--z-own_base); }
.cat-8 { fill: #8a7f3c; background: #8a7f3c; } .cat-9 { fill: var(--z-other); background: var(--z-other); }
.hatch-bg { fill: var(--z-dead); }
.hatch-line { stroke: #3d3d3d; stroke-width: 3; }
.g-iron-iv, .g-iron-i-iii { fill: var(--g-r1); background: var(--g-r1); }
.g-bronze, .g-silver { fill: var(--g-r2); background: var(--g-r2); }
.g-gold, .g-platinum { fill: var(--g-r3); background: var(--g-r3); }
.g-emerald, .g-diamond { fill: var(--g-r4); background: var(--g-r4); }
.g-master, .g-grandmaster { fill: var(--g-r5); background: var(--g-r5); }
.g-challenger { fill: var(--g-r6); background: var(--g-r6); }
.g-unranked, .g-unknown { fill: var(--g-unranked); background: var(--g-unranked); }
.g-all, .g-gold-plus, .g-platinum-plus, .g-emerald-plus, .g-diamond-plus, .g-master-plus { fill: var(--g-all); background: var(--g-all); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Charts */
.chart { margin: 8px 0; max-width: 640px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart figcaption, .chart + figcaption { font-size: 13px; color: var(--muted); }
.chart-window { fill: var(--accent); opacity: .09; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-tick, .chart-axis { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-band { fill: var(--accent); opacity: .2; }
.band-q { fill: var(--z-river); } .band-w { fill: var(--z-own_jungle); } .band-e { fill: var(--z-enemy_jungle); } .band-r { fill: var(--z-mid_lane); }
.chart-dot { fill: var(--accent); } .dot-q { fill: var(--z-river); } .dot-w { fill: var(--z-own_jungle); } .dot-e { fill: var(--z-enemy_jungle); } .dot-r { fill: var(--z-mid_lane); }
.chart-whisker { stroke: var(--text); stroke-width: 1; opacity: .55; pointer-events: none; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-q { stroke: var(--z-river); } .line-w { stroke: var(--z-own_jungle); } .line-e { stroke: var(--z-enemy_jungle); } .line-r { stroke: var(--z-mid_lane); }
.chart-area { fill: var(--accent); opacity: .1; }
.chart-col { fill: var(--accent); }
.chart-hit { fill: transparent; }
/* The by-minute charts' read-out box (chart-tips.js) and the intervals switch */
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(8, 10, 14, .92); color: #f2f4f8;
             font-size: 12px; line-height: 1.35; padding: 4px 7px; border-radius: 4px; max-width: 280px; }
.ci-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 2px; cursor: pointer; }
html[data-hide-intervals] .chart-whisker, html[data-hide-intervals] .chart-band { display: none; }
.chart-hit:hover { fill: var(--accent); opacity: .12; }
.chart-col:hover { opacity: .75; }
/* The ping chart (afk-and-chat): a column per millisecond needs more width than .chart allows,
   so it draws twice, the usual frame on narrow windows and a wider one from 901 px on. */
.ping-chart { max-width: 960px; }
.ping-chart .ping-wide { display: none; }
@media (min-width: 901px) {
  .ping-chart .ping-narrow { display: none; }
  .ping-chart .ping-wide { display: block; }
}
@media (max-width: 900px) { .ping-chart { max-width: 640px; } }
.coverage-sentence { font-size: 14px; }

/* Tables */
/* Edge shadows where a table has more columns: the covers scroll with it (local) */
.table-scroll {
  overflow-x: auto; max-width: 100%; --scroll-cover: var(--surface);
  background:
    linear-gradient(90deg, var(--scroll-cover) 40%, #0000) left / 28px 100% no-repeat local,
    linear-gradient(270deg, var(--scroll-cover) 40%, #0000) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), #0000) left / 12px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), #0000) right / 12px 100% no-repeat;
}
.lede .table-scroll, .prose .table-scroll, .games .table-scroll { --scroll-cover: var(--bg); }
/* The scrollbar above a wide table (app.js), moving with the table's own: as wide as the box,
   its content as wide as the table. */
.scroll-top { overflow-x: auto; overflow-y: hidden; max-width: 100%; margin: 0 0 4px; }
.scroll-top > div { height: 1px; }
/* Drawn by the page, so it stays visible where the system shows scrollbars only while scrolling
   (phones, macOS); Firefox draws its own thin one in the same colours. */
.scroll-top::-webkit-scrollbar { height: 10px; }
.scroll-top::-webkit-scrollbar-track { background: var(--track); border-radius: 5px; }
.scroll-top::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 5px; }
.scroll-top::-webkit-scrollbar-thumb:hover { background: var(--text); }
@supports not selector(::-webkit-scrollbar) {
  .scroll-top { scrollbar-width: thin; scrollbar-color: var(--muted) var(--track); }
}
/* Shares that add up to 100% as one bar above their list (bars.part_bar). */
.part-bar { display: block; width: 100%; height: 14px; border-radius: 4px; overflow: hidden; margin: 2px 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
caption { text-align: left; color: var(--muted); font-size: 13px; padding-bottom: 6px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
th.num, td.num { text-align: right; white-space: nowrap; }
tbody th { font-weight: 500; }
tfoot th, tfoot td { font-weight: 600; border-bottom: 0; }
td.desc { min-width: 16rem; color: var(--muted); }
.games-table th, .games-table td { white-space: nowrap; }
/* a group's colour key stays on the line of its name (the cell-sub line below may wrap) */
.games-table tbody th, .rank-table tbody th { white-space: nowrap; }
.rank-table thead th.wrap-head { white-space: normal; min-width: 6.5rem; max-width: 9rem; }
.games-table td.dates-cell { white-space: normal; min-width: 12rem; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; white-space: normal; }
.narrow-only { display: none; }
.table-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.sampling-list { margin: 6px 0 0; }
.games > h3, .prose section > h3 { margin-top: 18px; }
.nowrap { white-space: nowrap; }
.sampling-list div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sampling-list div:last-child { border-bottom: 0; }
.sampling-list dt { font-weight: 600; }
.sampling-list dd { margin: 2px 0 0; color: var(--muted); max-width: 80ch; }
.population-table tr:has(+ .row-notes) th, .population-table tr:has(+ .row-notes) td { border-bottom: 0; padding-bottom: 2px; }
.population-table { max-width: 56rem; }
.population-table .row-notes td { padding-top: 0; font-size: 13px; color: var(--muted); white-space: normal; }
.population-table .row-notes strong { color: var(--text); font-weight: 600; }
.sticky-first th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.champ-table th a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; white-space: nowrap; }
.champ-table img { border-radius: 4px; flex: none; }
.champ-table thead th.wrap-head { white-space: normal; min-width: 6.5rem; max-width: 8rem; }
/* The search field above a "By champion" table and the "Show the rest" button under it
   (champion-filter.js) */
.champion-search { margin: 0 0 8px; }
.champion-search input {
  min-height: 44px; width: 16rem; max-width: 100%; padding: 0 10px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.show-rest {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 14px; font: inherit;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.show-rest:hover { border-color: var(--accent); }
.show-rest[hidden] { display: none; }
/* Sortable tables: the header buttons that sortable-tables.js adds */
.sort-button { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; white-space: inherit; cursor: pointer; }
th.num .sort-button { flex-direction: row-reverse; }
.sort-button:hover, th[aria-sort] { color: var(--text); }
.sort-arrow { display: inline-block; width: 1em; font-size: 11px; text-align: center; }
.sort-arrow::before { content: "\2195"; opacity: .45; }
th[aria-sort="descending"] .sort-arrow::before { content: "\25BC"; opacity: 1; }
th[aria-sort="ascending"] .sort-arrow::before { content: "\25B2"; opacity: 1; }
/* most written messages: a long message wraps */
.top-messages-table th, .top-messages-table td { padding: 8px 6px; }
.top-messages-table .chat-message { overflow-wrap: anywhere; min-width: 7rem; }
@media (max-width: 599px) { .top-messages-table thead th { white-space: normal; } }
.population-table tr.is-vs th { font-weight: 650; }
.help-row td { padding: 0 10px; border-bottom: 0; }
.zone-table tr:has(+ .ref-row) th, .zone-table tr:has(+ .ref-row) td { border-bottom: 0; padding-bottom: 2px; }
.ref-row td { padding-top: 0; }
.ref-row .bar-ref { margin: 0; }
.help-row .help-text { margin: 0 0 6px; }
.zone-table th, .rates-table thead th { white-space: nowrap; }
.rates-table th, .rates-table td { padding-left: 6px; padding-right: 6px; }
.below-threshold ul { columns: 2 14rem; margin: 4px 0 0; padding-left: 20px; font-size: 14px; }

/* Bar and dot scales, intervals inside table cells */
.bar-axis { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.bar-axis-note { text-align: center; }
.cell-interval { display: block; font-size: 12px; color: var(--muted); font-weight: 400; white-space: normal; }
.life-table thead th { white-space: normal; }
.small-sample { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; white-space: nowrap; }
.table-caption { color: var(--muted); font-size: 13px; margin: 8px 0 6px; }
.card-figures-note { font-size: 13px; margin: 4px 0 0; }
.map-gated p { color: var(--muted); font-size: 14px; }
.check-list { padding-left: 20px; }
.check-list li { margin: 6px 0; }
.check-detail > summary { cursor: pointer; color: var(--accent); font-size: 13px; min-height: 32px; display: inline-flex; align-items: center; }
.check-detail p { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin: 0; }

/* Compare: the comparison mode of the Positions page (compare.html, compare_charts.html) */
.cmp-answer { max-width: 64ch; }
.cmp-lead { font-size: 21px; line-height: 1.35; font-weight: 600; margin: 0 0 6px; text-wrap: pretty; }
.cmp-detail { font-size: 15px; color: var(--muted); margin: 0; }
.cmp-key { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; }
.cmp-a { background: var(--cmp-a); }
.cmp-b { background: var(--cmp-b); }
.cmp-cap { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 15px; }
.cmp-cap-name { font-weight: 650; }
.cmp-cap-side { color: var(--muted); }
.cmp-cap-n { display: block; font-size: 12px; color: var(--muted); margin-left: 19px; }
/* pair rows: [first group | difference bar | compared group] over [their intervals] */
.cmp-scale-axis, .cmp-row-body { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr) 5.25rem; column-gap: 10px; align-items: center; }
.cmp-scale { margin: 2px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.cmp-scale-names { display: flex; justify-content: space-between; gap: 12px; }
.cmp-head { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; min-width: 0; line-height: 1.2; }
.cmp-head-b { text-align: right; }
.cmp-scale-svg { display: block; height: 16px; overflow: visible; }
.cmp-rows { list-style: none; margin: 0; padding: 0; }
.cmp-row { padding: 8px 0 7px; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row.is-headline { background: var(--track); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 6px; }
.cmp-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 3px; }
.cmp-label { font-size: 14px; }
.cmp-row-head.is-alone { justify-content: flex-end; }
.cmp-diff { font-size: 14px; white-space: nowrap; }
.is-clear .cmp-diff { font-weight: 650; }
.cmp-diff.muted { font-size: 13px; white-space: normal; }
.cmp-row-body { row-gap: 1px; }
.cmp-val { font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.cmp-val-b, .cmp-sub-b { text-align: right; }
.cmp-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.cmp-sub-d { text-align: center; }
.cmp-bar { display: block; height: 20px; overflow: visible; }
.cmp-track { stroke: var(--track); stroke-width: 12; }
.cmp-grid { stroke: var(--line); stroke-width: 1; }
.cmp-zero { stroke: var(--muted); stroke-width: 1.5; }
.cmp-fill { fill: var(--muted); fill-opacity: .4; }
.cmp-fill-a { fill: var(--cmp-a); }
.cmp-fill-b { fill: var(--cmp-b); }
.is-clear .cmp-fill { fill-opacity: 1; }
.cmp-every { display: grid; gap: 8px; }
.cmp-every > * { min-width: 0; }
.strip-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); }
.strip-key li { display: inline-flex; align-items: center; gap: 6px; }
.strip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.strip-grid > * { min-width: 0; }
.strip-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 10px; }
.strip-head { display: flex; align-items: center; gap: 4px; min-height: 40px; }
.strip-rows { list-style: none; margin: 0; padding: 0; }
.strip-row, .strip-axis { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 8px; align-items: center; }
.strip-label { font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-row.is-vs .strip-label { font-weight: 650; }
.strip-plot { display: block; height: 18px; overflow: visible; }
.strip-band { fill: var(--cmp-b); fill-opacity: .16; }
.strip-band-line { stroke: var(--cmp-b); stroke-width: 1.5; }
.strip-dot { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.strip-dot.is-clear { fill: var(--cmp-a); stroke: var(--surface); stroke-width: 1.5; }
.strip-dot.is-vs { fill: var(--cmp-b); stroke: var(--surface); }
.strip-axis-svg { display: block; height: 14px; overflow: visible; }
.dot-gridline { stroke: var(--line); stroke-width: 1; }
.clear-mark {
  display: inline-block; padding: 0 5px; border: 1px solid currentColor; border-radius: 3px;
  font-size: 11px; font-weight: 600; line-height: 16px; color: var(--text); white-space: nowrap;
}
.cmp-table td.diff-clear { color: var(--text); font-weight: 600; }
.cmp-table tr.is-vs th, .cmp-table tr.is-vs td { background: var(--bg); }
/* every group's map as a small multiple, six to a row on a wide screen */
.cmp-every-maps .map-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }

/* Home */
.role-cards { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.role-card h3 { font-size: 17px; margin-bottom: 8px; }
.role-figures { margin: 8px 0; }
.role-figures div { padding: 4px 0; border-bottom: 1px solid var(--line); }
.role-figures dt { color: var(--muted); font-size: 13px; }
.role-figures dd { margin: 0; font-weight: 600; }
.role-card p { font-size: 13px; margin: 4px 0 0; }
.link-list a { display: inline-flex; align-items: center; min-height: 44px; }

/* Home: rank trends, one small chart per figure, lowest rank left, highest right */
.rank-trends .help-text { max-width: 80ch; }
.trend-cards { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap: 12px; }
.trend-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trend-title { font-size: 14px; font-weight: 600; line-height: 1.3; min-height: 2.6em; text-wrap: balance; }
.trend-title a { color: var(--text); text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.trend-title a:hover { text-decoration-color: currentColor; }
.trend-plot { display: block; overflow: visible; margin: 2px 0 0; }
.trend-link { stroke: var(--muted); stroke-opacity: .35; stroke-width: 1.5; }
.trend-whisker { stroke: var(--muted); stroke-width: 1.25; }
.trend-point .dot { stroke: var(--surface); stroke-width: 1.5; }
.trend-point-labelled .dot { stroke: var(--text); stroke-width: 1.5; }
.trend-ends { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
.trend-ends-3 { grid-template-columns: 1fr auto 1fr; }
.trend-end { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.trend-end:last-child { align-items: flex-end; text-align: right; }
.trend-ends-3 .trend-end:nth-child(2) { align-items: center; text-align: center; }
.trend-value { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.trend-group { font-size: 13px; line-height: 1.3; }
.trend-interval { font-size: 12px; color: var(--muted); line-height: 1.35; }
.trend-sample { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Methods and about */
.prose { display: grid; gap: 22px; }
.prose section > :not(.table-scroll, .scroll-top) { max-width: 80ch; }
.prose section > h2 { margin-bottom: 8px; scroll-margin-top: 12px; }
.prose ul { padding-left: 20px; }
.prose table { font-size: 13px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.zone-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 14px; margin: 10px 0; }
.zone-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.zone-legend li { display: flex; align-items: center; }
.glossary div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.glossary dt, .release-info dt { font-weight: 600; }
.glossary dd, .release-info dd { margin: 2px 0 0; }
.release-info div { padding: 4px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 18px 24px 28px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* Desktop: maps beside a 380 px card column */
@media (min-width: 1025px) {
  h1 { font-size: 28px; line-height: 34px; }
  /* the maps stay in view beside the cards, and only there: the sticky area is the wrapper */
  #main > .maps-and-cards { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 24px; align-items: start; }
  .maps-and-cards > .maps.beside { position: sticky; top: 12px; }
  /* the comparison's rows need room for two figures and the bar between them */
  #main > .maps-and-cards.cmp-pair { grid-template-columns: minmax(0, 1fr) 440px; }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  h1 { font-size: 26px; line-height: 32px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* Phone */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; grid-template-columns: 1fr auto; grid-template-areas: "brand toggle" "nav nav"; }
  .wordmark { min-height: 44px; }
  .site-nav { margin: 0 -16px; position: relative; }
  .site-nav > ul { padding: 0 8px; }
  .nav-group { position: static; }
  .nav-group > ul { left: 8px; right: 8px; min-width: 0; }
  .site-nav :is(a, summary) { min-height: 44px; padding: 0 6px; font-size: 13px; }
  #main { display: flex; flex-direction: column; align-items: stretch; padding: 12px 16px 40px; gap: 14px; }
  #main > .notice { order: -1; }
  #main > .page-head { order: 0; }
  #main > .role-nav, #main > .filters { order: 1; }
  #main > .maps, #main > .maps-and-cards > .maps { order: 2; }
  #main > .maps-and-cards > .cards { order: 4; }
  #main > .lede { order: 3; }
  #main > * { order: 4; }
  /* Home: the role cards (maps) come right after the introduction, before the games table */
  #main > .lede.intro { order: 1; }
  #main > .rank-trends { order: 2; }
  #main > .roles { order: 3; }
  .filters > summary {
    display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line);
    border-radius: 6px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px;
  }
  .filters[open] > summary { margin-bottom: 10px; }
  /* tabs wrap onto a second line rather than run off the screen */
  .tabs ul { flex-wrap: wrap; overflow-x: visible; }
  .tabs .tab-unit { display: none; }
  .tabs-note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
  .tabs a, .tab-disabled { padding: 0 6px; font-size: 15px; }
  /* patches, region and dates move under the group's name, so the table fits the screen */
  .wide-only { display: none; }
  .narrow-only { display: block; }
  .games-table th { white-space: normal; }
  .games-table tbody th, .games-table tfoot th { min-width: 8.5rem; }
  .population-table th, .population-table td { padding-left: 6px; padding-right: 6px; }
  .population-table thead th { white-space: normal; }
  .map-pair { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bush-table tbody th { min-width: 8.5rem; }
  /* the two maps of a comparison stay side by side */
  .cmp-pair .map-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cmp-cap { font-size: 14px; gap: 5px; }
  .cmp-cap-side { display: none; }
  .cmp-every-maps .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cmp-lead { font-size: 18px; }
  .cmp-scale-axis, .cmp-row-body { grid-template-columns: 4.75rem minmax(0, 1fr) 4.75rem; column-gap: 8px; }
  .cmp-val { font-size: 15px; }
  .cmp-card { padding-left: 12px; padding-right: 12px; }
  .cmp-detail { font-size: 14px; }
  .zone-figures { grid-template-columns: minmax(0, 1fr); }
  .role-cards { grid-template-columns: minmax(0, 1fr); }
  .trend-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .trend-card { padding: 10px 10px 8px; }
  .trend-title { font-size: 13px; min-height: 3.9em; }
  .trend-value { font-size: 17px; }
  .trend-group { font-size: 12px; }
  .trend-interval, .trend-sample { font-size: 11px; }
  .trend-ends-3 { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .trend-ends-3 .trend-end, .trend-ends-3 .trend-end:nth-child(2), .trend-ends-3 .trend-end:last-child {
    flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 5px; text-align: left; }
  .trend-ends-3 .trend-interval { flex-basis: 100%; }
  .answer { font-size: 16px; }
  .footer-inner { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .bar-fill, .cmp-fill, .cmp-key, .strip-dot, .strip-band { forced-color-adjust: none; }
}
.camp-key .key-item { white-space: nowrap; }
[hidden] { display: none !important; }

/* Jungle openings: the opening-route map beside the route list (jungle-openings.html,
   jungle-routes.js). The 12 route colours are the page's own: the script reads them from
   --route-c1..12, so a line on the map and the key of its list row always agree. */
:root {
  --route-c1: #e26565; --route-c2: #65e265; --route-c3: #6565e2; --route-c4: #e2e265;
  --route-c5: #65e2e2; --route-c6: #e265e2; --route-c7: #e2a365; --route-c8: #65e2a3;
  --route-c9: #a365e2; --route-c10: #a3e265; --route-c11: #65a3e2; --route-c12: #e265a3;
}
.route-c1 { fill: var(--route-c1); stroke: var(--route-c1); background: var(--route-c1); }
.route-c2 { fill: var(--route-c2); stroke: var(--route-c2); background: var(--route-c2); }
.route-c3 { fill: var(--route-c3); stroke: var(--route-c3); background: var(--route-c3); }
.route-c4 { fill: var(--route-c4); stroke: var(--route-c4); background: var(--route-c4); }
.route-c5 { fill: var(--route-c5); stroke: var(--route-c5); background: var(--route-c5); }
.route-c6 { fill: var(--route-c6); stroke: var(--route-c6); background: var(--route-c6); }
.route-c7 { fill: var(--route-c7); stroke: var(--route-c7); background: var(--route-c7); }
.route-c8 { fill: var(--route-c8); stroke: var(--route-c8); background: var(--route-c8); }
.route-c9 { fill: var(--route-c9); stroke: var(--route-c9); background: var(--route-c9); }
.route-c10 { fill: var(--route-c10); stroke: var(--route-c10); background: var(--route-c10); }
.route-c11 { fill: var(--route-c11); stroke: var(--route-c11); background: var(--route-c11); }
.route-c12 { fill: var(--route-c12); stroke: var(--route-c12); background: var(--route-c12); }
.route-map-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.route-map-list { min-width: 0; }
.route-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.route-line { fill: none; stroke-width: calc(100px / var(--zoom, 1)); stroke-linejoin: round; stroke-linecap: round; opacity: .75; pointer-events: stroke; }
.route-lines.is-active .route-line { opacity: .12; }
.route-lines.is-active .route-line.is-hover { opacity: 1; stroke-width: calc(220px / var(--zoom, 1)); }
.route-start { stroke: var(--map-bg); stroke-width: calc(40px / var(--zoom, 1)); pointer-events: none; }
.route-lines.is-active .route-start { opacity: .2; }
.route-lines.is-active .route-start.is-hover { opacity: 1; }
.route-row.is-hover { background: var(--track); }
.route-row.is-hover .bar-label { font-weight: 650; }
/* a row is a button once the script runs: a click pins its route (jungle-routes.js) */
.route-row[role="button"] { cursor: pointer; border-radius: 4px; }
.route-row[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.route-row.is-pinned { background: var(--track); box-shadow: inset 3px 0 0 var(--accent); }
.route-row.is-pinned .bar-label { font-weight: 650; }
.route-list .bar-head { min-height: 34px; }
.route-row { padding: 0 4px 4px; }
.route-other .key, .route-other .bar-fill { fill: var(--muted); background: var(--muted); }
.route-map-tools { display: flex; justify-content: flex-end; min-height: 0; }
.route-unpin { min-height: 32px; margin-bottom: 4px; padding: 0 12px; font: inherit; font-size: 13px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); border-radius: 6px; cursor: pointer; }
@media (min-width: 901px) {
  /* the map stays in view while the pointer moves down the list */
  .route-map-side { position: sticky; top: 12px; }
}
@media (max-width: 900px) {
  .route-map-layout { grid-template-columns: minmax(0, 1fr); }
  /* stacked: a smaller map stays at the top of the screen while the list scrolls under it */
  .route-map-side { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; background: var(--surface); padding-bottom: 6px; }
  .route-map-side .map-panel { max-width: 300px; margin: 0 auto; }
  .route-map-side figcaption { font-size: 12px; }
}

/* Jungle openings: the invade map (jungle-routes.js drawInvades) beside its figures, and the
   champion lists under them */
.invade-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.invade-marks { position: absolute; inset: 0; width: 100%; height: 100%; }
.invade-disc { fill: #ff8a3d; fill-opacity: .78; stroke: #1b1d22; stroke-width: 40px; }
.invade-disc:hover { fill-opacity: 1; }
.invade-label { fill: #ffffff; font-size: 440px; font-weight: 700; paint-order: stroke; stroke: rgba(8, 10, 14, .85); stroke-width: 100px; pointer-events: none; }
.invade-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 12px; }
.invade-figures > div { border-left: 3px solid #ff8a3d; padding-left: 10px; }
.invade-figures dd { margin: 0; font-size: 14px; color: var(--muted); }
.invade-figures .headline-value { font-size: 21px; }
.invade-champ-list .bar-head { min-height: 34px; }
.invade-champ-list .bar-row { padding-bottom: 3px; }
.chart-narrow { max-width: 540px; }
.invade-champs-head { margin-top: 18px; }
.invade-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 28px; }
.minor-head { font-size: 15px; margin: 6px 0 2px; }
.invade-champ-list .bar-label img { border-radius: 4px; }
@media (max-width: 900px) {
  .invade-layout { grid-template-columns: minmax(0, 1fr); }
}
/* the jungle page's smaller cards two to a row on wide screens (other pages keep one column
   beside their maps) */
@media (min-width: 1025px) {
  .jungle-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jungle-cards > .wide { grid-column: 1 / -1; }
}
.column-chart .column { fill: var(--accent); }

/* Fermi: the daily estimation game (/fermi, fermi.js). One card holds the day: the question with
   its picture (the minimap with the role's lane in the rank's colour), the guess field, then the
   result panel (fermi/result.html) and the summary (fermi/summary.html). The card is dark in both
   themes, like the map panels; its display face is Archivo (OFL, static/fonts/archivo-OFL.txt),
   self-hosted and loaded on this page only. Every control is at least 44 px tall. */
@font-face { font-family: "Archivo"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/archivo-800.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/archivo-600.woff2") format("woff2"); }
.fermi {
  --fc-bg: #0f1828; --fc-raise: #18243a; --fc-line: #2a3a58; --fc-ink: #f5f0e6; --fc-dim: #a7b4ca;
  --fc-faint: #7d8ba6; --fc-gold: #f2c14e; --fc-gold-hi: #ffd56b; --fc-on-gold: #1d1503;
  --fc-cream: #fbf4e2; --fc-on-cream: #1b1508; --fc-cream-dim: #5d5440;
  --tier-iron: #9a8c86; --tier-bronze: #c0825a; --tier-silver: #b4c3cf; --tier-gold: #e8b64c;
  --tier-platinum: #4fc0b4; --tier-emerald: #3cc285; --tier-diamond: #7c9cf5; --tier-master: #c07ae0;
  --tier-grandmaster: #ec6a5f; --tier-challenger: #8fd8f8;
  width: 100%; max-width: 760px; margin: 4px auto 0;
}
.fermi, .fermi-below { --fc-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; }
.fermi .tier-iron-iv, .fermi .tier-iron-i-iii { --tier: var(--tier-iron); }
.fermi .tier-bronze { --tier: var(--tier-bronze); }
.fermi .tier-silver { --tier: var(--tier-silver); }
.fermi .tier-gold { --tier: var(--tier-gold); }
.fermi .tier-platinum { --tier: var(--tier-platinum); }
.fermi .tier-emerald { --tier: var(--tier-emerald); }
.fermi .tier-diamond { --tier: var(--tier-diamond); }
.fermi .tier-master { --tier: var(--tier-master); }
.fermi .tier-grandmaster { --tier: var(--tier-grandmaster); }
.fermi .tier-challenger { --tier: var(--tier-challenger); }
.fermi-card {
  position: relative; color: var(--fc-ink); border-radius: 28px; padding: clamp(20px, 4.5vw, 40px);
  background: radial-gradient(120% 90% at 0% 0%, #1b2945 0%, rgba(27, 41, 69, 0) 55%), var(--fc-bg);
  border: 1px solid #22314d;
  box-shadow: 0 28px 56px -22px rgba(6, 12, 26, .55), 0 2px 6px rgba(6, 12, 26, .25);
}
.fermi-card ::selection { background: var(--fc-gold); color: var(--fc-on-gold); }
.fermi-card a { color: var(--fc-gold); text-underline-offset: 3px; }
.fermi-card a:hover { color: var(--fc-gold-hi); }
.fermi-card :focus-visible { outline: 3px solid var(--fc-gold); outline-offset: 3px; }
.fermi .num { font-variant-numeric: tabular-nums; }

/* header: title, question tabs, date */
.fermi-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: clamp(18px, 3vw, 28px); }
.fermi-title { margin: 0; font-family: var(--fc-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--fc-ink); }
.fermi-date { margin: 0; justify-self: end; font-size: .875rem; color: var(--fc-dim); font-variant-numeric: tabular-nums; }
.fermi-tabs { display: flex; gap: 4px; }
.fermi-tab {
  min-width: 48px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  color: var(--fc-dim); font: 600 .875rem/1 var(--fc-display); letter-spacing: .04em; cursor: pointer; position: relative;
}
.fermi-tab:hover:not(:disabled, [aria-current="step"]) { color: var(--fc-ink); background: rgba(255, 255, 255, .06); }
.fermi-tab[aria-current="step"] { color: var(--fc-on-gold); background: var(--fc-gold); }
.fermi-tab:disabled { color: var(--fc-faint); opacity: .55; cursor: default; }

/* the question: its picture floats right, the text wraps beside it */
.fermi-question { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 3vw, 26px); }
.fermi-ask { min-width: 0; }
.fermi-ask::after { content: ""; display: block; clear: both; }
.fermi-text {
  margin: 0; font-family: var(--fc-display); font-weight: 800; color: var(--fc-ink);
  font-size: clamp(1.6rem, 1.05rem + 2.3vw, 2.7rem); line-height: 1.07; letter-spacing: -.028em; text-wrap: balance;
}
.fermi-note { margin: 12px 0 0; max-width: 46ch; font-size: .9375rem; line-height: 1.45; color: var(--fc-dim); }
.fermi-photo {
  float: right; width: clamp(112px, 24vw, 196px); margin: 0 0 14px clamp(16px, 3vw, 28px); padding: 8px 8px 0;
  background: #f6f1e4; border-radius: 4px; transform: rotate(3deg);
  box-shadow: 0 14px 26px -10px rgba(0, 0, 0, .6), 0 2px 4px rgba(0, 0, 0, .3);
}
.fermi-photo-img { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: #0b111c; }
.fermi-photo-map { position: absolute; inset: 0; width: 100%; height: 100%; filter: saturate(.55) brightness(.62) contrast(1.05); }
.fermi-photo-lanes { position: absolute; inset: 0; width: 100%; height: 100%; }
.fermi-lane, .fermi-lane-under { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fermi-lane-under { stroke: #0a0f19; stroke-width: 10; }
circle.fermi-lane-under { fill: #0a0f19; stroke-width: 3; }
.fermi-lane { stroke: var(--tier); stroke-width: 6; }
.fermi-camp { fill: var(--tier); }
.fermi-photo-faint .fermi-lane { opacity: .55; }
/* the heat map: the minimap greyed and dimmed like the site's maps, the 64 x 64 heat smoothly
   scaled over it (as the Positions page's canvas draws it) */
.fermi-photo-heatmap .fermi-photo-map { filter: grayscale(1) brightness(.5) contrast(.95); }
.fermi-photo-heat { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; }
.fermi-photo-heatmap .fermi-photo-champ { left: auto; top: 6%; right: 6%; width: 34%; transform: none; border-width: 2px; border-radius: 8px; }
.fermi-photo-champ {
  position: absolute; left: 50%; top: 50%; width: 46%; height: auto; transform: translate(-50%, -50%);
  border-radius: 12px; border: 3px solid var(--tier); box-shadow: 0 6px 14px rgba(0, 0, 0, .55);
}
.fermi-photo-caption {
  padding: 8px 2px 9px; text-align: center; font: 600 .6875rem/1.2 var(--fc-display); letter-spacing: .1em;
  text-transform: uppercase; color: #3b372e; overflow-wrap: break-word;
}

/* the guess */
.fermi-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.fermi-field {
  display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 0 22px; border-radius: 20px;
  background: var(--fc-raise); border: 1px solid var(--fc-line); transition: border-color .2s, box-shadow .2s;
}
.fermi-field:focus-within { border-color: var(--fc-gold); box-shadow: 0 0 0 4px rgba(242, 193, 78, .2); }
.fermi-input {
  flex: 1; min-width: 0; height: 74px; border: 0; padding: 0; background: transparent; color: var(--fc-ink);
  caret-color: var(--fc-gold); font: 800 clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem)/1 var(--fc-display); letter-spacing: -.02em;
}
.fermi-input:focus { outline: none; }
.fermi-input::placeholder { color: #8a98b2; opacity: 1; }
.fermi-input:read-only { color: var(--fc-dim); }
.fermi-input-unit { flex: none; max-width: 40%; font: 600 .8125rem/1.2 var(--fc-display); letter-spacing: .1em; text-transform: uppercase; color: var(--fc-dim); text-align: right; }
.fermi-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.fermi-preview { margin: 0; font: 600 1.0625rem/1.2 var(--fc-display); color: var(--fc-gold); font-variant-numeric: tabular-nums; }
.fermi-error { margin: 0; color: #ffb4a8; font-size: .9375rem; }
.fermi-lock, .fermi-next, .fermi-copy, .fermi-share {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  font: 800 .8125rem/1 var(--fc-display); letter-spacing: .14em; text-transform: uppercase;
  transition: background-color .15s, transform .15s, box-shadow .15s;
}
.fermi-lock, .fermi-copy { margin-left: auto; background: var(--fc-gold); color: var(--fc-on-gold); box-shadow: 0 8px 18px -8px rgba(242, 193, 78, .55); }
.fermi-lock:hover:not(:disabled), .fermi-copy:hover { background: var(--fc-gold-hi); transform: translateY(-1px); }
.fermi-lock:disabled { background: transparent; border-color: var(--fc-line); color: var(--fc-faint); box-shadow: none; cursor: progress; }
.fermi-lock::after, .fermi-next::after {
  content: ""; width: 16px; height: 16px; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h9M8.5 4l4 4-4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fermi-next, .fermi-share { background: var(--fc-cream); color: var(--fc-on-cream); justify-self: end; }
.fermi-next:hover, .fermi-share:hover { background: #fff; transform: translateY(-1px); }

/* once answered, the question steps back and the result takes the card */
.fermi-question:has(.fermi-result:not([hidden])) .fermi-form { display: none; }
.fermi-question:has(.fermi-result:not([hidden])) .fermi-text { font-size: clamp(1.05rem, .9rem + .7vw, 1.3rem); line-height: 1.25; letter-spacing: -.01em; color: var(--fc-dim); }
.fermi-question:has(.fermi-result:not([hidden])) .fermi-photo { width: 104px; margin-bottom: 4px; }
.fermi-question:has(.fermi-result:not([hidden])) .fermi-photo { padding-bottom: 8px; }
.fermi-question:has(.fermi-result:not([hidden])) .fermi-photo-caption { display: none; }
.fermi-question:has(.fermi-result:not([hidden])) .fermi-note { display: none; }

/* result panel */
.fermi-result-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 3vw, 26px); }
/* the guess steps back, the answer is the card to look at: wider, raised, tilted, ringed in gold,
   its number the largest on the card */
.fermi-tiles { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; align-items: center; }
.fermi-tile { padding: 18px 22px 20px; border-radius: 20px; container-type: inline-size; }
.fermi-tile-guess { background: var(--fc-raise); border: 1px solid var(--fc-line); }
.fermi-tile-answer {
  padding: 22px 26px 24px; border-radius: 24px; background: var(--fc-cream); color: var(--fc-on-cream);
  border: 3px solid var(--fc-gold); transform: rotate(-1.5deg) translateY(-4px);
  box-shadow: 0 0 0 7px rgba(242, 193, 78, .22), 0 26px 48px -14px rgba(242, 193, 78, .7), 0 10px 22px -10px rgba(0, 0, 0, .55);
}
.fermi-tile-label { margin: 0 0 6px; font: 600 .75rem/1.2 var(--fc-display); letter-spacing: .12em; text-transform: uppercase; color: var(--fc-dim); }
.fermi-tile-answer .fermi-tile-label { display: inline-block; margin-bottom: 10px; padding: 5px 11px; border-radius: 999px; background: var(--fc-gold); color: var(--fc-on-gold); }
.fermi-tile-sub { color: var(--fc-cream-dim); }
.fermi-tile-value { margin: 0; font: 800 clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem)/1 var(--fc-display); letter-spacing: -.035em; white-space: nowrap; }
.fermi-tile-guess .fermi-tile-value { color: var(--fc-dim); }
/* each number fills its tile without breaking: 9 characters (2,095,760) still fit */
.fermi-tile-guess .fermi-tile-value { font-size: clamp(1.5rem, 17cqi, 2.6rem); }
.fermi-tile-answer .fermi-tile-value { font-size: clamp(2.6rem, 21cqi, 5rem); letter-spacing: -.045em; }
.fermi-tile-unit { margin: 6px 0 0; font: 800 1.0625rem/1.2 var(--fc-display); }
.fermi-tile-sub { margin: 8px 0 0; font-size: .8125rem; line-height: 1.35; }
.fermi-tile-sample, .fermi-nowrap { white-space: nowrap; }
.fermi-landing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(18px, 3.5vw, 32px); align-items: end; }
.fermi-verdict > p { margin: 0; }
.fermi-factor { font: 800 clamp(2.4rem, 1.5rem + 3.6vw, 3.75rem)/1 var(--fc-display); letter-spacing: -.035em; color: var(--fc-gold); }
.fermi-direction { margin-top: 2px; font: 800 clamp(1.4rem, 1.05rem + 1.4vw, 1.9rem)/1.05 var(--fc-display); letter-spacing: -.02em; color: var(--fc-gold); text-transform: capitalize; }
.fermi-exact .fermi-factor { color: var(--tier-emerald); }
.fermi-closer { margin-top: 12px !important; font-size: .9375rem; color: var(--fc-dim); }
.fermi-small-head { margin: 0 0 10px; font: 600 .75rem/1.2 var(--fc-display); letter-spacing: .12em; text-transform: uppercase; color: var(--fc-dim); }
.fermi-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; align-items: end; }
.fermi-bar-col { min-width: 0; display: grid; grid-template-rows: 112px auto; justify-items: center; gap: 6px; }
.fermi-bar-svg { width: 100%; height: 112px; display: block; overflow: visible; }
.fermi-bar { fill: var(--tier); opacity: .5; }
.fermi-bar-asked .fermi-bar { opacity: 1; stroke: var(--fc-gold); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.fermi-bar-label { font: 600 .6875rem/1 var(--fc-display); color: var(--fc-faint); letter-spacing: .04em; }
.fermi-bar-asked .fermi-bar-label { color: var(--fc-ink); }
.fermi-crowd { border-top: 1px solid var(--fc-line); padding-top: 18px; }
.fermi-figure { margin: 0; }
.fermi-figcaption, .fermi-quiet { margin: 6px 0 0; font-size: .8125rem; line-height: 1.45; color: var(--fc-dim); }
.fermi-key { white-space: nowrap; margin-left: 10px; }
.fermi-key::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.fermi-key-mine::before { background: var(--fc-gold); }
.fermi-key-answer::before { background: var(--fc-cream); }
.fermi-hist { display: block; overflow: visible; }
.fermi-hist-bar { fill: #3a4e74; }
.fermi-hist-bar.fermi-hist-mine { fill: var(--fc-gold); }
.fermi-hist-answer { stroke: var(--fc-cream); stroke-width: 2; stroke-dasharray: 4 4; }
.fermi-hist-marker { stroke: var(--fc-gold); stroke-width: 2.5; }
.fermi-hist-axis, .fermi-hist-tick { stroke: var(--fc-line); }
.fermi-hist-label { fill: var(--fc-dim); font: 600 11px var(--fc-display); }
.fermi-source { margin: 0; font-size: .9375rem; }
.fermi-question > .fermi-next { margin-top: -4px; }

/* the result lands: the factor settles in from a soft blur, the answer tile lifts (one moment;
   entry transitions from @starting-style, so nothing runs where it is not supported) */
@media (prefers-reduced-motion: no-preference) {
  .fermi-verdict { transition: transform .6s cubic-bezier(.16, 1, .3, 1), filter .6s cubic-bezier(.16, 1, .3, 1), opacity .45s ease-out; }
  .fermi-tile-answer { transition: transform .65s cubic-bezier(.34, 1.4, .64, 1), box-shadow .6s ease-out; }
  @starting-style {
    .fermi-verdict { transform: translateY(10px) scale(.94); filter: blur(4px); opacity: .35; }
    .fermi-tile-answer { transform: rotate(0) scale(.86); box-shadow: 0 0 0 0 rgba(242, 193, 78, 0), 0 0 0 rgba(242, 193, 78, 0), 0 0 0 rgba(0, 0, 0, 0); }
  }
}

/* summary */
.fermi-summary:focus { outline: none; }
.fermi-summary-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 3vw, 26px); }
.fermi-score { text-align: center; padding-top: 4px; }
.fermi-score-head { margin: 0; font: 600 .875rem/1.2 var(--fc-display); letter-spacing: .12em; text-transform: uppercase; color: var(--fc-dim); }
.fermi-score-value { margin: 6px 0 0; font: 800 clamp(4rem, 2.6rem + 6vw, 6rem)/.95 var(--fc-display); letter-spacing: -.04em; color: var(--fc-gold); }
.fermi-score-top { display: inline-block; margin: 14px 0 0; padding: 8px 16px; border-radius: 999px; background: var(--fc-cream); color: var(--fc-on-cream); font: 800 .9375rem/1.2 var(--fc-display); }
.fermi-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fermi-row { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 4px 8px; padding: 14px 16px; border-radius: 18px; background: var(--fc-raise); border: 1px solid var(--fc-line); }
.fermi-row-q { font: 600 .75rem/1 var(--fc-display); letter-spacing: .1em; color: var(--fc-dim); }
.fermi-row-sign { font: 800 1.1rem/1 var(--fc-display); color: var(--fc-dim); }
.fermi-row-factor { font: 800 1.5rem/1 var(--fc-display); letter-spacing: -.03em; color: var(--fc-ink); }
.fermi-row-dir { grid-column: 1 / -1; font-size: .8125rem; color: var(--fc-dim); }
.fermi-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 0; }
.fermi-actions .fermi-copy { margin-left: 0; }
.fermi-copied { color: var(--fc-gold); font: 600 .9375rem var(--fc-display); }
.fermi-empty, .fermi-noscript { margin: 0; color: var(--fc-dim); }

/* below the card */
.fermi-below { max-width: 760px; margin: 32px auto 0; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; }
.fermi-below h2 { margin: 0 0 10px; font: 800 1.15rem/1.2 var(--fc-display); letter-spacing: -.01em; }
.fermi-how ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--muted); line-height: 1.5; font-size: .9375rem; }
.fermi-how code { font-size: .875em; color: var(--text); }
.fermi-archive { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fermi-today { margin: 0 0 10px; }
.fermi-today a, .fermi-archive a {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 52px; justify-content: center; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 .875rem/1 var(--fc-display); text-decoration: none; font-variant-numeric: tabular-nums;
}
.fermi-archive a:hover { border-color: var(--accent); }
.fermi-archive a[aria-current="page"] { border-color: var(--text); }
.fermi-archive a.fermi-played::after {
  content: ""; width: 12px; height: 12px; margin-left: 6px; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

@media (max-width: 620px) {
  .fermi-card { border-radius: 22px; }
  .fermi-head { grid-template-columns: 1fr auto; }
  .fermi-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .fermi-photo { width: 120px; margin-left: 12px; }
  .fermi-photo-caption { font-size: .5625rem; letter-spacing: .05em; }
  .fermi-field { padding: 0 16px; min-height: 68px; }
  .fermi-input { height: 66px; }
  .fermi-lock, .fermi-next { padding: 0 20px; }
  /* the guess a slim row right above the answer card */
  .fermi-tiles { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .fermi-tile { padding: 14px 16px 16px; border-radius: 16px; }
  .fermi-tile-guess { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 16px; }
  .fermi-tile-guess .fermi-tile-label { margin: 0; }
  .fermi-tile-guess .fermi-tile-value { font-size: 1.5rem; }
  .fermi-tile-answer { padding: 18px 20px 20px; transform: rotate(-1deg); }

  .fermi-landing { grid-template-columns: 1fr; align-items: start; }
  .fermi-bar-col { grid-template-rows: 84px auto; }
  .fermi-bar-svg { height: 84px; }
  .fermi-bars { gap: 3px; }
  .fermi-bar-label { font-size: .5625rem; letter-spacing: 0; }
  .fermi-rows { grid-template-columns: 1fr; }
  .fermi-row { grid-template-columns: auto auto auto 1fr; }
  .fermi-row-dir { grid-column: auto; justify-self: end; }
  .fermi-below { grid-template-columns: 1fr; }
  .fermi-hist-far { display: none; }
}
@media (forced-colors: active) {
  .fermi-card { border: 1px solid CanvasText; }
  .fermi-bar, .fermi-hist-bar { fill: GrayText; }
  .fermi-bar-asked .fermi-bar, .fermi-hist-bar.fermi-hist-mine, .fermi-hist-marker { fill: Highlight; stroke: Highlight; }
  .fermi-hist-answer { stroke: CanvasText; }
  .fermi-lane { stroke: Highlight; }
}
/* Upload page (/upload, upload.js): the drop box and one line per file. */
.upload-drop { display: grid; gap: 8px; justify-items: start; padding: 20px; border: 2px dashed var(--line); border-radius: 10px; background: var(--surface); }
.upload-drop.upload-over { border-color: var(--accent); background: var(--notice-bg); }
.upload-input { max-width: 100%; font: inherit; }
.prose .upload-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: 2px 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.upload-list .upload-name { overflow-wrap: anywhere; }
.upload-list progress { width: 100%; }
.upload-list .upload-result { grid-column: 1 / -1; font-size: 14px; }
.upload-list .upload-ok .upload-result { color: var(--up); }
.upload-list .upload-error .upload-result { color: var(--down); }
@media (max-width: 480px) { .upload-list li { grid-template-columns: 1fr; } }
/* Track an account (/track, track.js): the form, the answer under it and the count. */
.track-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 12px 0; }
.track-field { display: grid; gap: 4px; }
.track-field label { font-weight: 600; }
.track-form input, .track-form select, .track-form button { min-height: 44px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.track-form input { width: 16rem; max-width: 100%; padding: 0 10px; }
.track-form select { max-width: 100%; padding: 0 8px; }
.track-form button { padding: 0 16px; font-weight: 600; cursor: pointer; }
.track-form button:hover:not(:disabled) { background: var(--track); }
.track-form button:disabled { opacity: .5; cursor: default; }
.track-result { margin: 0 0 8px; padding: 10px 14px; background: var(--notice-bg); border-left: 3px solid var(--accent); }
.track-result[data-state="error"] { background: var(--down-bg); border-left-color: var(--down); }
