/* Palette like elitecup.edur.ninja - the sister site sets the tone. */
:root {
  color-scheme: dark;
  --page: #0d1b2a; --surface-1: #1b263b; --surface-2: #253553;
  --text-primary: #e0e1dd; --text-secondary: #a7b8ce; --muted: #9aabc2;
  --grid: #22314b; --axis: #33456b; --border: #253553;
  --series-1: #4cc9f0; --series-2: #f4c542;
  --pause: rgba(119,141,169,0.55); --uncertain: #46587a;
  --band: rgba(224,225,221,0.030);
  --void: rgba(244,197,66,0.10); --danger: #e74c3c; --success: #2ecc71;
  --milestone-special: #d0a2ff;
  --rainbow-stops: #4cc9f0, #8b8dff, #ef81bd, #f4c542, #2ecc71;
  --rainbow: linear-gradient(110deg, var(--rainbow-stops));
  --shadow: none;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: var(--topbar-height, 116px); }
body {
  margin: 0; background: var(--page); color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* 1800px: the upcoming table carries the most columns and must fit a FullHD
   screen without horizontal scrolling - and every other section follows the
   same width so the page keeps one line down its sides. */
main, .site-head, .topbar-inner { max-width: 1800px; margin: 0 auto; }
.site-head { padding: 20px 24px 0; }
main { padding: 0 24px 24px; }
h1 { font-size: 1.7rem; margin: 8px 0 2px; letter-spacing: -0.01em;
     color: var(--series-1); font-weight: 650; }
h2 { font-size: 1.15rem; margin: 36px 0 8px; font-weight: 650; letter-spacing: -0.01em; }
.sub { color: var(--text-secondary); margin: 0 0 12px; font-size: 0.9rem; }
.links { margin: 10px 0 0; font-size: 0.9rem; color: var(--text-secondary);
         display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  display: inline-block; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-1); box-shadow: var(--shadow);
  text-decoration: none; font-weight: 600;
}
.links a:hover { border-color: var(--series-1); }
/* Live badge: red and pulsing while on air; calm grey otherwise */
.links a.live { border-color: var(--danger); color: var(--danger); }
.links a.live::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px;
  border-radius: 50%; background: currentColor; vertical-align: 1px;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .links a.live::before { animation: none; } }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

/* Sticky filter bar: always present, content scrolls through beneath it */
.topbar {
  position: sticky; top: 0; z-index: 20; margin-top: 12px;
  background: color-mix(in srgb, var(--page) 85%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid var(--series-1);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) { .topbar { background: var(--page); } }
/* Smooth anchor jumps unless the reader asked for less motion; the offset
   below the sticky bar is scroll-padding-top on html above. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding: 8px 24px; font-size: 0.9rem;
}
.day-controls { display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap; margin-left: auto; }
.day-controls > .btn { white-space: nowrap; }
.day-controls .dropdown-panel { left: auto; right: 0; }
.control-label { color: var(--text-secondary); }
/* Multi-select: details handles open/close, JS only the outside click */
.dropdown { position: relative; }
.dropdown summary {
  /* Flex, not a plain block: with the shared min-height of 40px the label sat
     at the top of the box and read as misaligned next to the buttons. */
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; list-style: none; user-select: none;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; min-width: 12rem;
}
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: "▾"; color: var(--text-secondary); }
.dropdown summary:hover { border-color: var(--series-1); }
.dropdown-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  min-width: 16rem; max-height: 60vh; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.dropdown-actions { display: flex; gap: 8px; margin-bottom: 6px; }
.dropdown-actions .btn { flex: 1; font-size: 0.82rem; padding: 4px 8px; }
.day-opt {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 6px; border-radius: 6px;
}
.day-opt:hover { background: var(--surface-2); }
.day-opt em { margin-left: auto; font-style: normal; font-size: 0.8rem;
              color: var(--text-secondary); }
.day-opt input { accent-color: var(--series-1); }
.filter-chip { background: var(--series-1); color: var(--page); font-weight: 600;
               border-radius: 999px; padding: 3px 11px; font-size: 0.8rem; }
.btn { font: inherit; cursor: pointer; border: 1px solid var(--border);
       background: var(--surface-1); color: var(--text-primary);
       border-radius: 8px; padding: 5px 10px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-inline { padding: 2px 10px; font-size: 0.82rem; margin-left: 6px; }
/* Toggle next to a heading: font: inherit would have taken over the h2's
   weight, and the button would read like heading text. Accent border and
   arrow icon say "something happens here"; the label names the next view,
   not the current one. */
.btn-toggle {
  font-family: inherit; font-size: 0.78rem; font-weight: 600; line-height: 1.5;
  letter-spacing: 0.01em; cursor: pointer; white-space: nowrap;
  margin-left: 12px; padding: 3px 12px; vertical-align: 2px;
  border: 1px solid var(--series-1); border-radius: 999px;
  background: var(--surface-1); color: var(--series-1);
}
.btn-toggle:hover, .btn-toggle:focus-visible {
  background: var(--series-1); color: var(--page);
}

.tiles { display: flex; gap: 14px; flex-wrap: wrap; margin: 20px 0; }
.tile {
  position: relative;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 20px; min-width: 150px; flex: 1 1 0;
}
.tile b { display: block; font-size: 1.8rem; font-weight: 650; color: var(--series-1);
          letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile span { display: block; color: var(--text-secondary); font-size: 0.78rem;
             text-transform: uppercase; letter-spacing: 0.04em; }
.tile em { display: block; margin-top: 3px; font-style: normal;
           font-size: 0.76rem; color: var(--muted); }
/* Change against the previous stream day, on the value's line but out of the
   flow: in the flow it widened every tile that carries one. */
.tile-delta { position: absolute; top: 18px; right: 14px;
              font-size: 0.8rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.tile-delta.is-up { color: var(--success); }
.tile-delta.is-down { color: var(--danger); }

/* The forecast is tea-leaf reading with numbers - set apart as its own
   surface so it stands out from the measured part of the page. */
.panel {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2px 24px 24px;
  margin: 36px 0 0;
}
.panel h2 { margin-top: 20px; }
/* No heading in this one, so the box centres its tiles instead of keeping the
   24px the heading used to balance. */
#sec-status { padding-top: 24px; }
#sec-status .tiles { margin: 0; }
.panel .tile { background: var(--surface-1); }

/* z-index 0: own stacking context, or ECharts tooltips paint over the topbar */
.chart {
  width: 100%; height: 400px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; z-index: 0;
}
.chart--auto { height: auto; }
/* Set before the chart is built: sized afterwards, the canvas kept 400px and
   the box cut off the day labels. */
#chart-trend { height: 360px; }

.note {
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--series-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 4px 20px; margin: 12px 0;
}
.note p { color: var(--text-secondary); line-height: 1.55; }
.note b { color: var(--text-primary); }
/* The deadline is an announcement, not a hint - hence the warning colour */
.note--break { border-left-color: var(--danger); margin: 18px 0 0; }

/* Same skin as the forecast note, but as a full-width band above the fold:
   while the challenge is paused that is the first thing a visitor needs. */
/* Inherits width and padding from <main>, so it stands on the same edge as
   the tables and statistics sections - no max-width of its own. */
.note--banner { margin: 20px 0 0; border-left-width: 4px; }
.note--banner p { color: var(--text-primary); }

/* The one-off finale: green rail on the banner, and a confetti burst that
   stops by itself after three falls - a stats page nobody can read because
   something keeps moving is worse than no confetti at all. */
.note--finale { border-left-color: var(--success); }
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 60; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 9px; height: 15px;
  background: var(--series-1); animation: confetti-fall 3.4s linear var(--d) 3 forwards; }
.confetti i:nth-child(4n+2) { background: var(--series-2); }
.confetti i:nth-child(4n+3) { background: var(--success); border-radius: 50%; }
.confetti i:nth-child(4n)   { background: var(--danger); }
/* Three cheap knobs against a curtain of identical squares: drift sideways in
   both directions, two sizes, two fall speeds. */
.confetti i:nth-child(odd) { --drift: -26px; }
.confetti i:nth-child(3n)  { width: 7px; height: 11px; animation-duration: 4.2s; }
.confetti i:nth-child(5n)  { animation-duration: 2.8s; }
@keyframes confetti-fall {
  from { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  to   { transform: translate3d(var(--drift, 24px), 102vh, 0) rotate(760deg); opacity: 0.15; }
}
/* Decoration is the first thing to drop when someone asks for less motion. */
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* Explanation only for those who want it - native details, no JS */
.explainer { margin: 24px 0 0; }
.explainer summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-1);
}
.explainer summary::-webkit-details-marker { display: none; }
.explainer summary:hover { border-color: var(--series-2); }
.explainer summary::after {
  content: "▾"; margin-left: auto; color: var(--text-secondary);
  transition: transform 0.15s;
}
.explainer[open] > summary::after { transform: rotate(180deg); }
.explainer[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.explainer[open] > .note { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.ex-icon {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--series-2); color: var(--page);
  font: 600 0.85rem/22px Georgia, serif; text-align: center;
}
/* Inline variant for the prose above the charts: the page carried a
   paragraph of explanation over every single chart, and most readers came
   for the chart. The short lead stays visible, the rest opens on demand -
   same native details, only without the full-width box. */
/* Heading row: the info toggle sits at its right end, on the same baseline
   as the h2. Opened, the text hangs below it as a panel instead of pushing
   the section apart - the toggle keeps its place, so a second click closes
   it where it was clicked. */
.sec-head { display: flex; align-items: baseline; justify-content: space-between;
            gap: 16px; position: relative; }
.sec-head > h2 { min-width: 0; }
.sec-head > .explainer--inline { flex: 0 0 auto; margin: 36px 0 8px; }
:is(.sec-head, .rivalry-header) > .explainer--inline > .sub {
  position: absolute; right: 0; top: 100%; z-index: 5;
  width: min(64ch, 100%); margin: 2px 0 0; padding: 11px 15px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
/* Fixed columns keep both triggers in place when either text is opened. */
.info-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
            align-items: start; gap: 16px; margin: 14px 0 8px; }
.info-row > .explainer--inline { margin: 0; min-width: 0; }
.info-row > details.explainer--inline > summary { display: flex; width: 100%; min-height: 44px;
  padding: 10px 12px; border-radius: 8px; border-color: var(--axis); }
.info-row > .explainer--inline > summary:is(:hover, :focus-visible) {
  border-color: var(--series-1); background: var(--surface-2); }
.info-row > .explainer--inline > .sub {
  margin: 8px 0 4px; padding: 10px 14px; max-width: none;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--series-2); border-radius: var(--radius);
}
.explainer--inline { margin: 0 0 12px; }
.explainer--inline summary {
  display: inline-flex; padding: 3px 12px 3px 6px; gap: 7px;
  font-size: 0.88rem; font-weight: 400; color: var(--text-secondary);
  letter-spacing: 0; border-radius: 999px;
}
.explainer--inline summary::after { margin-left: 4px; font-size: 0.8rem; }
.explainer--inline[open] > summary { border-radius: 999px; }
.explainer--inline .ex-icon {
  width: 18px; height: 18px; font: 600 0.72rem/18px Georgia, serif;
}
.explainer--inline > .sub { margin: 8px 0 0; max-width: 74ch; }
.info-copy { line-height: 1.55; }
.info-copy > p { margin: 0 0 10px; }
.info-copy > p:last-child { margin-bottom: 0; }
.spoiler-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.spoiler-toggle[aria-pressed="true"] { border-color: var(--series-1); color: var(--series-1); }
#spoiler-mode { font-size: 0.75rem; text-transform: uppercase; padding: 2px 6px;
  border: 1px solid currentColor; border-radius: 4px; }
.spoiler-placeholder { display: inline-block; width: 5em; text-align: center;
  color: var(--text-secondary); user-select: none; }
.spoiler-placeholder > span { color: transparent; text-shadow: 0 0 7px var(--text-secondary); pointer-events: none; }
#sec-upcoming > .note { border-left-color: var(--series-1); }
#upcoming-table { margin: 12px 0 0; }
/* Links and IDs reserve compact space; metadata retains its natural proportions. */
:is(#maps-table, #upcoming-table) table:not(.compact-table) th[data-column="links"] { width: 1px; min-width: 115px; }
:is(#maps-table, #upcoming-table) table:not(.compact-table) th:is([data-column="id"], [data-column="mapid"]) { width: 1px; min-width: 85px; }
:is(#maps-table, #upcoming-table) table:not(.compact-table) th[data-column="idx"] { width: 1px; min-width: 85px; }
:is(#maps-table, #upcoming-table) table:not(.compact-table) td[data-column="type"] { white-space: nowrap; }
.summary-hint { display: block; color: var(--text-secondary); font-size: 0.75rem; }
/* Narrow previews expose every field directly, with no horizontal scroll region. */
.table-cards { display: grid; gap: 12px; }
.table-card { min-width: 0; padding: 14px; background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: var(--radius); }
.table-cards > .table-card { content-visibility: auto; contain-intrinsic-size: auto 520px; }
.table-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin: 0; }
.card-field { min-width: 0; }
.card-field:is([data-field="name"], [data-field="author"], [data-field="type"], [data-field="links"]) { grid-column: 1 / -1; }
.table-card dt { color: var(--text-secondary); font-size: 0.78rem; margin-bottom: 4px; }
.table-card dd { margin: 0; overflow-wrap: anywhere; }
.table-card [data-column="name"] { font-size: 1.05rem; }
.table-card .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.table-card [data-column="links"] .nowrap { display: flex; gap: 8px; flex-wrap: wrap; }
.table-card [data-column="links"] :is(button, a) { display: inline-flex; align-items: center;
  min-height: 44px; margin: 0; padding: 6px 12px; background: var(--surface-2); border-radius: 6px; }
.table-card [data-column="id"] a { display: inline-flex; align-items: center; min-height: 32px; }
.table-card [data-column="idx"] { display: flex; align-items: center; min-height: 32px; }
.table-card.next-start { border-left: 3px solid var(--series-2); }
.table-card--summary { margin-top: 12px; background: var(--surface-2); }
.table-card--summary h3 { margin: 0 0 16px; font-size: 1rem; }

/* Search above the maps table. type="search" so mobile keyboards offer the
   right layout and browsers add their own clear button - no JS for either. */
.searchbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
             margin: 10px 0 12px; }
.searchbar label { color: var(--text-secondary); font-size: 0.82rem;
                   text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.searchbar input { font: inherit; font-size: 16px; padding: 10px 12px;
                   min-width: 0; max-width: 100%; flex: 1 1 240px;
                   background: var(--surface-1); color: var(--text-primary);
                   border: 1px solid var(--border); border-radius: 8px; }
.searchbar input:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }
.searchbar .sub { margin: 0; }

.scroll { overflow-x: auto; }
/* No border-radius: it has no effect on a table with collapsed borders. */
table { border-collapse: collapse; width: 100%; min-width: 760px;
        background: var(--surface-1); box-shadow: var(--shadow);
        border: 1px solid var(--border); font-size: 0.9rem; }
th, td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--grid); }
thead th { border-top: none; color: var(--text-secondary); font-weight: 600;
           background: var(--surface-2); font-size: 0.8rem;
           text-transform: uppercase; letter-spacing: 0.03em; }
/* Summary row: same tone as the head, so the table reads as framed rather
   than as having one oddly bold data row at the bottom. */
tfoot td { background: var(--surface-2); border-top: 2px solid var(--border); }

/* The preview is the long list people scroll through, so its head rides along
   under the filter bar. A sticky head binds to the nearest scroll container,
   and the wrapper around the table is one - so the head can only pin to the
   page where the wrapper has nothing to scroll: its twelve columns need about
   1400px. Below that the wrapper keeps its sideways scroll and the head
   behaves as before. */
@media (min-width: 1520px) {
  #upcoming-table .scroll { overflow-x: clip; }   /* clip has no scrollport, auto has */
  #upcoming-table thead th { position: sticky; top: var(--topbar-height, 116px); z-index: 2; }
}

/* Activity-calendar layout: the day axis is shared across three stacked grids.
   Only the day columns scroll; hour labels and legends stay readable on mobile. */
.activity-intro { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; }
.activity-intro > span { color: var(--muted); font-size: 0.8rem; }
.rhythm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.rhythm-grid figure { margin: 0; min-width: 0; padding: 16px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); }
.rhythm-grid figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  font-size: 0.95rem; font-weight: 650; margin: 0 0 10px; }
.rhythm-grid figcaption span { font-size: 0.8rem; font-weight: 400; color: var(--text-secondary); }
.activity-board { display: flex; min-width: 0; }
.activity-hours { flex: 0 0 62px; padding-top: 28px; color: var(--text-secondary);
  font-size: 11px; font-variant-numeric: tabular-nums; }
.activity-hours span { display: flex; align-items: center; height: var(--activity-cell, 28px); }
/* The day row is a different quantity than the hours above it. */
.activity-hours .activity-total { color: var(--text-primary); font-weight: 650; }
.activity-scroll { min-width: 0; flex: 1; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--border) var(--surface-1); }
.activity-scroll:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; border-radius: 4px; }
/* Five hours plus the day-total row, at the 28 px cell of a desktop grid. */
.activity-scroll .chart { height: 204px; border: 0; border-radius: 0; box-shadow: none; }
.activity-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: 12px 0 0 62px; font-size: 0.75rem; color: var(--text-secondary); }
.activity-key { display: inline-flex; align-items: center; gap: 6px; }
.activity-swatch { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 3px; }
.activity-swatch--empty { background: var(--surface-2); border: 1px solid var(--border); }
.activity-ramp { display: inline-flex; gap: 3px; }
.activity-scroll-hint { margin-top: 12px; font-size: 0.8rem; }
@media (max-width: 600px) {
  .rhythm-grid figure { padding: 12px 8px; }
  .activity-hours { flex-basis: 56px; }
  .activity-legend { margin-left: 0; gap: 8px 12px; }
}
.last-day { color: var(--series-1); font-size: 1.05em; }
.last-when { color: var(--text-primary); font-weight: 600; }
/* Says a chart is not just a picture. Sits inside the existing sub line. */
.clickable-hint { color: var(--series-2); font-weight: 600; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Highest and lowest value per column: nobody finds them in 21 rows otherwise */
td .hi { color: var(--series-2); font-weight: 650; }
td .lo { color: var(--muted); }
/* Lars' personal best against the author time he has to beat: under it the
   map is as good as done, over it the grind is still owed. Without an author
   time the number stays neutral rather than claiming either. */
:is(td, dd) b.pb--under { color: var(--success); }
:is(td, dd) b.pb--over, .wr-diff--over { color: var(--danger); }
.wr-diff { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 400; line-height: 1.25;
  --wr-margin-mid: #f0a44b; color: var(--wr-diff-color, var(--text-primary)); }
.wr-diff-percent { display: block; font-size: 0.72rem; }
#upcoming-table tbody tr { height: 3.375rem; }
/* Net column in the colours of the daily-net chart */
td .net-won { color: var(--success); }
td .net-lost { color: var(--danger); }
.void-mark { color: var(--series-2); cursor: help; }
td .hi::after { content: " ▲"; font-size: 0.7em; }
td .lo::after { content: " ▼"; font-size: 0.7em; }
th .sort { font: inherit; font-weight: 600; color: inherit; background: none;
           border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
th .sort::after { content: " ↕"; opacity: 0.35; }
th[aria-sort="ascending"] .sort::after { content: " ▲"; opacity: 1; }
th[aria-sort="descending"] .sort::after { content: " ▼"; opacity: 1; }
.table-foot { display: flex; justify-content: space-between; align-items: center;
              gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 0.9rem; }
.pager { display: flex; gap: 8px; align-items: center; color: var(--text-secondary); }

a { color: var(--series-1); }
/* Link target at the link: VOD leads into the recording, TMX to the map
   page. Colour and weight only, no fill - in a 75-row table a red blob
   per row would be louder than the content. */
.src { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
       margin-right: 5px; vertical-align: 1px; color: var(--danger); }
.src--tmx { color: var(--text-secondary); }
/* Second link to the same map, kept quiet next to the first one */
.alt-link { font-size: 0.8em; color: var(--text-secondary); margin-left: 4px;
            white-space: nowrap; }
/* Copies the map UID - styled like the quiet alt link, not like a button */
.copy-uid { font: inherit; font-size: 0.8em; color: var(--text-secondary);
            background: none; border: 0; padding: 0; margin-left: 4px;
            cursor: pointer; white-space: nowrap; text-decoration: underline; }
.copy-uid:hover { color: var(--series-1); }
.nowrap { white-space: nowrap; }   /* map ID with its links stays on one line */
/* Mapper name as a filter button - reads like the map links, not like a button */
.mapper-link { font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
               color: var(--series-1); text-align: left; }
.mapper-link:hover { text-decoration: underline; }
td .tag { margin-bottom: 3px; }   /* multi-line type tags should not stick together */
.tag {
  /* A box with softened corners, not a lozenge: the half circles ate the
     horizontal padding of short type names and read as buttons. */
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 0.78rem; white-space: nowrap;
  border: 1px solid transparent;   /* per-type colour is set by app.js */
}

/* Timeline of the challenge: the whole journey on one line */
.road { margin: 22px 2px 4px; }
.road-head { display: flex; justify-content: space-between; align-items: baseline;
             margin-bottom: 10px; color: var(--text-secondary); font-size: 0.9rem; }
.road-head b { color: var(--series-2); font-size: 1.15rem; }
.road-head em { font-style: normal; color: var(--muted); }
.road-head span:last-child { text-align: right; }
.road-track {
  position: relative; height: 14px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--border);
  margin: 34px 26px 0 0;   /* room for the bubble above and the skull on the right */
}
.road-done {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--series-1), var(--series-2));
  min-width: 6px;
}
.road-tick { position: absolute; top: -4px; bottom: -4px; width: 1px;
             background: var(--border); }
.road-tick em { position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
                font-style: normal; font-size: 0.68rem; color: var(--muted); }
.road-void { position: absolute; top: -4px; bottom: -4px; min-width: 2px;
             background: var(--danger); opacity: 0.65; border-radius: 3px; }
.road-note { position: absolute; top: 20px; font-size: 0.7rem; color: var(--danger);
             white-space: nowrap; padding-left: 5px; }
.road-now { position: absolute; top: -30px; }
.road-now--c { transform: translateX(-50%); }
.road-now--r { transform: translateX(-100%); }
.road-now::after {
  content: ""; position: absolute; top: 22px; width: 2px; height: 16px;
  background: var(--series-2);
}
.road-now--c::after { left: 50%; transform: translateX(-50%); }
.road-now--l::after { left: 0; }
.road-now--r::after { right: 0; }
.road-now em {
  display: block; font-style: normal; white-space: nowrap; font-size: 0.74rem;
  font-weight: 600; color: var(--page); background: var(--series-2);
  padding: 2px 8px; border-radius: 999px;
}
.road-end { position: absolute; right: -26px; top: -5px; font-size: 1.35rem;
            line-height: 1; }
.road-milestone { --milestone-color: var(--series-1); color: var(--milestone-color);
  font-size: 0.75rem; text-decoration: none; }
.road-milestone.is-passed { opacity: 0.7; }
.road-milestone.road-milestone--special { --milestone-color: var(--milestone-special); font-weight: 650; }
.road-milestone--pin { position: absolute; top: -15px; width: 10px; height: 44px;
  transform: translateX(-50%); z-index: 1; }
.road-milestone::before { content: ""; display: inline-block; width: 9px; height: 9px;
  flex-shrink: 0; border-radius: 50%; background: var(--milestone-color); }
.road-milestone--pin::before { position: absolute; top: 18px; left: 0; }
.road-milestone--pin::after { content: ""; position: absolute; top: 28px; left: 4px;
  height: calc(12px + var(--milestone-row, 0) * 34px);
  border-left: 1px solid var(--milestone-color); opacity: 0.35; pointer-events: none; }
.road-milestone--special::before { content: "★"; width: 18px; height: 18px;
  font-size: 18px; line-height: 18px; background: none; border-radius: 0; box-shadow: none; }
.road-milestone--special.road-milestone--pin::before { top: 13px; left: -4px; }
.road-milestone--pin .road-milestone-label { position: absolute;
  top: calc(44px + var(--milestone-row, 0) * 34px); left: 50%;
  display: flex; flex-direction: column; align-items: center; min-height: 24px;
  line-height: 1.2; transform: translateX(-50%); white-space: nowrap; }
.road:has(.road-milestone--pin) .road-milestone-tiles { margin-top: 146px; }
.road-milestone:hover .road-milestone-label { text-decoration: underline; }
.road-milestone-pct { display: block; font-style: normal; font-weight: 500; opacity: 0.85; }
.road-milestone-legend { display: none; }
/* One narrow tile per marker under the road, in road order. */
.road-milestone-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.road-milestone-tile { flex: 1 1 140px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--milestone-color, var(--series-1));
  border-radius: var(--radius); background: var(--surface-1); }
.road-milestone-tile.is-passed { opacity: 0.75; }
.road-milestone-tile h3 { margin: 0; font-size: 0.95rem; color: var(--milestone-color, var(--text-primary)); }
.road-milestone-tile--special h3::before { content: "★ "; color: var(--milestone-special); }
.road-milestone-where { display: block; margin-top: 2px; font-size: 0.72rem; color: var(--text-secondary); }
.road-milestone-metrics { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
.road-milestone-metrics > div { display: flex; flex-direction: column-reverse; }
.road-milestone-metrics dt { color: var(--text-secondary); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.04em; }
.road-milestone-metrics dd { margin: 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.road-milestone-status { display: block; margin-top: 10px; font-weight: 600; color: var(--milestone-special); }
.road-milestone-tile.is-passed .road-milestone-status { color: var(--muted); }
@media (max-width: 1100px) {
  /* Closely spaced milestones use separate full-size links below the road. */
  .road-milestone--pin::after { display: none; }
  .road-milestone--pin .road-milestone-label { display: none; }
  .road:has(.road-milestone--pin) .road-milestone-tiles { margin-top: 20px; }
  .road-milestone-legend { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; }
  .road-milestone-legend .road-milestone { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
  .road-milestone-legend .road-milestone-pct { display: inline; margin-left: 6px; }
}
@media (max-width: 640px) {
  .road-head b { font-size: 1rem; }
  .road-milestone-tile { flex-basis: 45%; }
}

.tag--warn { background: rgba(244,197,66,0.16); color: var(--series-2);
             border-color: rgba(244,197,66,0.5); }
/* Tiles and The Void are one block: the state right now. Without the shared
   surface the page head fell apart into separate strips. */
#sec-forecast > #sec-void { margin: 20px 0 0; }
#sec-forecast #sec-void .explainer { margin: 0; }

.stars { color: var(--uncertain); letter-spacing: 1px; white-space: nowrap; }
.stars b { color: var(--series-2); font-weight: 400; }
#forecast p { margin: 10px 0 0; color: var(--text-secondary); font-size: 0.9rem; }
footer { color: var(--muted); font-size: 0.8rem; margin: 36px 0 16px;
         border-top: 1px solid var(--border); padding-top: 16px; }
footer p { margin: 4px 0; line-height: 1.55; }
/* The disclaimer is no footnote: whoever takes the numbers seriously should
   first read how they were made. Hence set apart instead of fine print. */
#disclaimer {
  margin: 0 0 14px; padding: 12px 18px; line-height: 1.6;
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 3px solid var(--series-2); border-radius: var(--radius);
  color: var(--text-secondary); font-size: 0.85rem;
}
#disclaimer b { color: var(--text-primary); }
#empty { padding: 40px; text-align: center; color: var(--text-secondary); }

/* Two-column head: who/what on the left, how to join in on the right */
.site-head { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.head-main { flex: 1 1 26rem; min-width: 0; }
.head-how {
  flex: 0 1 27rem; margin: 10px 0 0 auto;
  color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5;
  border-left: 3px solid var(--series-2); padding-left: 14px;
}
.head-how b { color: var(--text-primary); }
@media (max-width: 900px) {
  .head-how { margin-left: 0; }
}

@media (max-width: 640px) {
  .tile { flex: 1 1 40%; min-width: 0; }
  .sec-head { flex-wrap: wrap; gap: 0 12px; }
  .sec-head > .explainer--inline { margin: 0 0 8px; }
  .dropdown summary { min-width: 0; }
  .topbar-inner { gap: 8px; }
}
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px;
  background: var(--surface-1); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.head-how summary { cursor: pointer; padding: 6px 0; color: var(--text-primary); }
.head-how p { margin: 8px 0; }
/* Shrinkable: rigid, the links could not wrap between 640 and ~800px and
   pushed Upcoming and the download off the right edge. */
.section-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 0 1 auto; }
/* The download is not a jump: a divider and the accent colour set it apart. */
.section-nav .nav-download { margin-left: 8px; padding-left: 14px; color: var(--series-2);
  border-left: 1px solid var(--border); border-radius: 0 6px 6px 0; }
.section-nav a { display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 10px; text-decoration: none; border-radius: 6px;
  font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.section-nav a:hover { background: var(--surface-2); }
.spoiler-icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--series-2); }
.overview-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.overview-charts section { min-width: 0; }
.chart--main { height: 400px; }
.chart { overflow: hidden; }
.rhythm-grid > figure { min-width: 0; }
.tile b { white-space: nowrap; }
/* The equation cannot wrap, so the tile must not shrink below it: squeezed
   to 150px it spilled out of the panel and scrolled the page sideways. */
.tile--prime { min-width: min-content; }
.tile b small { margin-left: 6px; font-size: 0.5em; font-weight: 600; color: var(--muted); }
.tile--buffer { border-color: var(--buffer-color, var(--muted)); }
.tile--buffer b { color: var(--buffer-color, var(--muted)); }
.section-disclosure > summary { cursor: pointer; padding: 20px; border: 2px solid transparent;
  border-radius: var(--radius); font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(var(--surface-1), var(--surface-1)) padding-box, var(--rainbow) border-box;
  box-shadow: 0 0 24px rgba(76,201,240,0.12); }
.section-disclosure > summary::-webkit-details-marker { display: none; }
.section-disclosure > summary:hover { background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    var(--rainbow) border-box; }
/* The fun facts wear the analysis box's rainbow, running round the frame from
   a start angle app.js picks per tile (--spin). */
#sec-scale .tile { border: 2px solid transparent;
  background: linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    conic-gradient(from var(--spin, 0deg), var(--rainbow-stops), #4cc9f0) border-box; }
.section-disclosure > summary .sub { display: block; font-weight: 400; margin: 6px 0 0; }
.analysis-toggle { margin-left: auto; flex: 0 0 auto; padding: 10px 14px;
  color: var(--page); background: var(--series-1); border-radius: 8px; }
.analysis-toggle::after { content: "Open charts +"; }
.section-disclosure[open] .analysis-toggle::after { content: "Close charts −"; }
.analysis-content { padding-bottom: 12px; }
.map-controls, .table-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.map-controls label, .table-sort label { display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--text-secondary); }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px 24px; margin: 10px 0 12px; }
.map-toolbar > .searchbar { flex: 1 1 320px; max-width: 480px; margin: 0; }
.map-toolbar .searchbar input { flex: 1 1 180px; width: 180px; }
.map-toolbar > .map-controls { margin: 0 0 0 auto; }
select { font: inherit; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 8px; padding: 9px 10px; max-width: 100%; }
.btn, .dropdown summary, .day-opt { min-height: 40px; }
.section-error { color: var(--text-primary); padding: 16px; border-left: 3px solid var(--series-2); }
.compact-table { table-layout: fixed; width: 100%; min-width: 0; }
.compact-table td, .compact-table th { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.compact-table td:first-child, .compact-table th:first-child { width: 65%; }
.compact-table .nowrap { white-space: normal; }
.row-details { margin-top: 6px; }
.row-details summary { cursor: pointer; color: var(--text-secondary); padding: 7px 0; font-size: 0.8rem; }
.row-details dl { margin: 8px 0; font-size: 0.85rem; }
.row-details dt { color: var(--text-secondary); margin-top: 10px; }
.row-details dd { margin: 2px 0 8px; }
.chart-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.chart-expand { display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 40px; height: 40px; color: var(--series-1); }
.chart-expand:hover { border-color: var(--series-1); background: var(--surface-2); }
.chart-expand svg { width: 18px; height: 18px; }
.chart-dialog { width: min(1600px, calc(100vw - 32px)); height: min(1000px, calc(100dvh - 32px));
  max-width: none; max-height: none; padding: 20px; border: 1px solid var(--axis);
  border-radius: 14px; background: var(--page); color: var(--text-primary); }
.chart-dialog[open] { display: flex; flex-direction: column; gap: 16px; }
.chart-dialog::backdrop { background: rgba(3,10,20,0.82); }
.chart-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chart-dialog h2 { margin: 0; }
.chart-dialog-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chart-dialog .chart { height: 100%; flex: 1; min-height: 0; }
.chart-dialog .section-error { margin: 0; }
body.chart-dialog-open { overflow: hidden; }
/* Two records side by side, equal width and height. */
.records { display: flex; flex-wrap: wrap; gap: 16px; }
.records .longest-map { flex: 1 1 320px; margin: 16px 0; }
.longest-map { margin: 16px 0; padding: 16px 20px; background: var(--surface-1);
  border: 1px solid var(--border); border-left: 3px solid var(--series-2); border-radius: var(--radius); }
.record-note { margin: 6px 0 0; }
.longest-map .record-label { display: block; color: var(--series-2); font-size: 0.8rem;
  font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.longest-map p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.longest-map .record-day { display: inline-block; margin-left: 12px; font-weight: 600; }
.next-start, .next-start:hover { background: rgba(244,197,66,0.09); }
.next-start > td { border-top: 1px solid rgba(244,197,66,0.5); border-bottom: 1px solid rgba(244,197,66,0.5); }
.next-start > td:first-child { border-left: 3px solid var(--series-2); }
.next-start-label { display: block; margin-top: 6px; color: var(--series-2);
  font-size: 0.78rem; font-weight: 650; white-space: normal; }
@media (max-width: 1000px) { .overview-charts { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 640px) {
  .site-head { padding: 14px 16px 0; gap: 8px; }
  main { padding: 0 16px 20px; }
  h1 { font-size: 1.45rem; }
  .head-how { flex-basis: 100%; margin-top: 2px; }
  .tiles { gap: 10px; margin: 12px 0; }
  .tile { padding: 12px; }
  .tile b { font-size: 1.5rem; }
  .tile--buffer { flex-basis: 100%; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
  .tile--buffer b { font-size: 2.35rem; }
  .tile--buffer span { align-self: center; }
  .tile--buffer em { grid-column: 1 / -1; }   /* the note runs under both, not beside them */
  /* "1 Prime = 3:51 min" is one unbreakable line (.tile b is nowrap) and needs
     more than a 40 % column: without its own row it pushed the whole page
     into horizontal scrolling on a phone. */
  .tile--prime { flex-basis: 100%; }
  .chart--main { height: 320px; }
  .topbar-inner { padding: 8px 16px; }
  .day-controls { width: 100%; }
  .day-controls .dropdown-panel { left: 0; right: auto; max-width: calc(100vw - 32px); }
  .dropdown { flex: 1 1 auto; min-width: 0; }
  .control-label { display: none; }
  .section-nav { width: 100%; justify-content: space-between; }
  .section-nav a { padding: 10px 8px; font-size: 0.82rem; }
  /* Own row below the jump links, so five links plus a download fit 320 px. */
  .section-nav .nav-download { flex-basis: 100%; justify-content: center; margin-left: 0;
    padding-left: 8px; border-left: 0; border-top: 1px solid var(--border); border-radius: 0; }
  .info-row { grid-template-columns: minmax(0, 1fr); }
  .section-disclosure > summary { padding: 16px; }
  .section-disclosure > summary { flex-wrap: wrap; gap: 14px; }
  .analysis-toggle { margin-left: 0; }
  .chart-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 12px; }
  .chart-dialog header { align-items: flex-start; }
  .chart-dialog h2 { font-size: 1rem; padding-top: 8px; }
  .chart-dialog header .btn { flex-shrink: 0; }
  .panel { padding: 2px 14px 16px; }
  #sec-status { padding-top: 16px; }   /* headingless box stays symmetric */
  .map-controls label { flex: 1 1 130px; flex-direction: column; align-items: stretch; }
  .map-controls select { width: 100%; }
  .map-toolbar > .searchbar { max-width: none; }
  .map-toolbar > .map-controls { width: 100%; }
  .table-sort { gap: 8px; font-size: 0.8rem; }
  .table-sort select { max-width: 170px; }
}
@media (max-width: 380px) {
  .section-nav { gap: 0; }
  .section-nav a { padding-inline: 4px; }
}
/* Personal-best rivalry: the same cyan/gold series, with text and symbols. */
.rivalry-header { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 30px; padding-bottom: 12px; }
.rivalry-title { flex: 1 1 220px; }
.rivalry-title h2 { margin: 0; }
#rivalry-verdict { margin: 4px 0 0; font-size: .9rem; font-weight: 600; }
.rivalry-header > .searchbar { flex: 1 1 260px; max-width: 420px; margin: 0; flex-wrap: nowrap; }
.rivalry-header .searchbar input { flex: 1 1 180px; width: 180px; }
.rivalry-header > :is(.map-controls, .explainer--inline) { margin: 0; }
.rivalry-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 12px 0; }
.rivalry-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rivalry-score small, .rivalry-gap small { font-size: .8rem; color: var(--muted); }
.rivalry-score, .rivalry-gap { display: flex; flex-direction: column; justify-content: center; gap: .2rem;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.rivalry-score strong { font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rivalry-score--lars strong, .rivalry-winner--lars { color: var(--series-1); }
.rivalry-score--scrapie strong, .rivalry-winner--scrapie { color: var(--series-2); }
.rivalry-gap strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.rivalry-state { padding-block: 1.5rem; color: var(--muted); }
.rivalry-map-name { display: block; min-width: 130px; max-width: 260px; overflow-wrap: anywhere; }
.rivalry-faster { color: var(--success); }
.rivalry-slower { color: var(--danger); }
.rivalry-gap-percent { display: block; font-size: .85em; }
.rivalry-gap-time, .rivalry-gap-percent { white-space: nowrap; }
.rivalry-winner { white-space: nowrap; font-weight: 700; }
#chart-rivalry { height: 360px; }
/* The world keeps its own proportions (ECharts' equirectangular at
   aspectScale 0.75 is 1.94:1); the box is a tenth flatter than that, so the
   map fits its height with a little room at the sides. Capped only where the
   whole map would no longer fit on the screen. */
#chart-visitors { height: auto; aspect-ratio: 2.16; max-height: 85vh; }
.visitors-list { margin-top: 12px; line-height: 1.6; }
#rivalry-table table { font-variant-numeric: tabular-nums; }
.rivalry-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rivalry-style-panel { min-width: 0; }
.rivalry-style-panel h3 { margin: 0 0 8px; font-size: .95rem; font-weight: 600; }
.rivalry-style-panel--lars h3 { color: var(--series-1); }
.rivalry-style-panel--scrapie h3 { color: var(--series-2); }
.rivalry-style-panel ol { list-style: none; margin: 0; padding: 0; }
.rivalry-style-panel li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.rivalry-style-name { min-width: 0; }
.rivalry-style-score { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rivalry-style-score b { font-size: .9rem; }
.rivalry-style-score small { display: block; color: var(--muted); font-size: .73rem; }
@media (max-width: 1000px) {
  .rivalry-overview { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 640px) {
  .rivalry-styles { grid-template-columns: 1fr; gap: 16px; }
  .rivalry-title { flex-basis: 100%; }
  .rivalry-header > .searchbar { flex-basis: 100%; max-width: none; }
  .rivalry-header > .map-controls { flex: 1 1 140px; }
  #chart-rivalry { height: 300px; }
  #rivalry-table .rivalry-map-name { min-width: 0; max-width: 150px; }
  #rivalry-table .compact-table :is(td, th):first-child { width: 50%; }
  #rivalry-table .compact-table :is(td, th)[data-column="winner"] { width: 20%; }
  #rivalry-table .compact-table :is(td, th)[data-column="gap"] { width: 30%; }
}
