/* ------------------------------------------------------------------
   Worldle Results — minimal editorial dashboard
   Paper, ink, one green accent. Hairlines instead of boxes.
   ------------------------------------------------------------------ */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/InterVariable.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
    /* One palette in two modes. color-scheme resolves light-dark(): the system
       preference by default, the toggle's data-theme once it has a choice. */
    color-scheme: light dark;

    --paper: light-dark(#f3f2ec, #161815);
    --paper-deep: light-dark(#e9e8e0, #20231f);
    --ink: light-dark(#1a1c19, #eceade);
    --ink-soft: light-dark(#45483f, #c2c4b8);
    --muted: light-dark(#74776c, #8d9186);
    --rule: light-dark(#d9d7cd, #2e312c);
    --rule-strong: light-dark(#b3b1a5, #4a4e46);
    --accent: light-dark(#1f4b3b, #7fbfa2);
    --accent-bright: light-dark(#2c6450, #9ad3b8);
    --miss: light-dark(#a13d33, #e08b7e);
    --scrim: light-dark(rgba(26, 28, 25, 0.62), rgba(0, 0, 0, 0.72));
    --shadow: 0 2px 6px light-dark(rgba(26, 28, 25, 0.16), rgba(0, 0, 0, 0.5));

    --sans: "Inter", sans-serif;
    --serif: "Inter", sans-serif;
    --mono: "Inter", monospace;

    --page: 1440px;
    --axis-width: 34px;
}

/* The theme toggle pins one mode; without it the system preference wins. */
:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

::selection {
    background: var(--accent);
    color: var(--paper);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------- controls */

/* Shared outline pill for the small controls: First, Latest, Yearly breakdown
   and the segmented theme switch. */
.pill {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    background: none;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.6875rem;
    line-height: 1.5;
    letter-spacing: 0.02em;
    white-space: nowrap;
    cursor: pointer;
}

.pill[hidden] {
    display: none;
}

.pill:hover,
.pill:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
}

/* Compact paging arrows; .pill supplies the outline, background and states. */
.chart-arrow {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.is-miss {
    color: var(--miss);
}

.skip-link {
    position: absolute;
    top: -4rem;
    left: 1rem;
    z-index: 100;
    padding: 0.6rem 0.9rem;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.8125rem;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

/* ------------------------------------------------------------------ page */

.page {
    max-width: var(--page);
    margin: 0 auto;
    padding: 1rem clamp(1rem, 4vw, 3rem) 1rem;
}

/* -------------------------------------------------------------- masthead */

.masthead__tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
}

/* Three modes, one pill: the active mode is filled, the others recede. */
.theme-switch {
    align-items: stretch;
    gap: 0;
    padding: 0;
}

.theme-switch__option {
    padding: 0.25rem 0.625rem;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    letter-spacing: inherit;
    white-space: inherit;
    cursor: pointer;
}

.theme-switch__option:first-child {
    border-radius: 999px 0 0 999px;
}

.theme-switch__option:last-child {
    border-radius: 0 999px 999px 0;
}

.theme-switch__option + .theme-switch__option {
    border-left: 1px solid var(--rule-strong);
}

.theme-switch:hover .theme-switch__option + .theme-switch__option {
    border-left-color: var(--accent);
}

.theme-switch__option:hover,
.theme-switch__option:focus-visible {
    background: var(--paper-deep);
}

.theme-switch__option[aria-pressed="true"],
.theme-switch__option[aria-pressed="true"]:hover,
.theme-switch__option[aria-pressed="true"]:focus-visible {
    background: var(--ink);
    color: var(--paper);
}

.masthead .stat--scores {
    margin: 0;
    padding: 0 0 1.5rem;
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
}

/* The breakdown headline matches the section headlines. */
.masthead .section__title {
    margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------- section */

.section {
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.625rem;
    margin-bottom: 0.625rem;
    border-bottom: 1px solid var(--ink);
}

.section__title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section__meta {
    flex: 0 0 auto;
    margin: 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    color: var(--muted);
}

/* Current streak lives beside the section title, not in a stat column. */
.section__streak {
    flex: 0 1 auto;
    margin: 0;
    font-family: var(--mono);
    font-size: 0.6875rem;
    line-height: 1.5;
    color: var(--ink-soft);
    text-align: right;
}

.section__streak[data-slug] {
    margin-left: 0;
    padding: 0.125rem 0.25rem;
    cursor: default;
}

.section__streak[data-slug]:hover,
.section__streak[data-slug]:focus-within {
    background: var(--paper-deep);
}

/* The visible date range and First/Latest share the end of the chart heading row. */
.chart-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.375rem;
    margin-left: auto;
}

.chart-range {
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

.empty {
    margin: 1.5rem 0 0;
    color: var(--muted);
}

/* ----------------------------------------------------------------- chart */

.figure {
    margin: 0;
}

.chart-frame {
    display: grid;
    grid-template-columns: var(--axis-width) minmax(0, 1fr);
}

.chart-gutter {
    position: relative;
    height: var(--chart-height);
    border-right: 1px solid var(--rule-strong);
}

.chart-gutter__label {
    position: absolute;
    right: 0.5625rem;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 0.6875rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.chart-gutter__label--miss {
    color: var(--miss);
    font-size: 0.75rem;
}

.chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
}

.chart-scroll::-webkit-scrollbar {
    height: 10px;
}

.chart-scroll::-webkit-scrollbar-track {
    background: transparent;
    border-top: 1px solid var(--rule);
}

.chart-scroll::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
}

.chart {
    position: relative;
    width: var(--chart-width);
    height: var(--chart-height);
}

.chart-rule {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--rule);
    pointer-events: none;
}

/* A hairline thread through the dot centres. */
.chart-line {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

.chart-line polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
    stroke-linejoin: round;
    stroke-linecap: round;
    opacity: 0.4;
}

/* Streak rail --------------------------------------------------------- */

/* One hairline above the plot per streak longer than Timeline::STREAK_MIN,
   labelled with its length and competition rank. */
.chart-streak {
    position: absolute;
    height: 1px;
    background: var(--rule-strong);
    border-radius: 1px;
    pointer-events: none;
}

.chart-streak__label {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 0.625rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

/* dots ---------------------------------------------------------------- */

.dot {
    position: absolute;
    display: grid;
    place-items: center;
    /* One day is 10px wide, so the hit box is 10px too: wider boxes would
       overlap the next dot and steal its clicks. */
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    transform: translate(-50%, -50%);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
}

.dot::before {
    content: "";
    position: absolute;
    inset: -5px;
}

/* Fine pointers need no extra hit area: it would cover the next dot. */
@media (pointer: fine) {
    .dot::before {
        content: none;
    }
}

.dot__mark {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 120ms ease;
}

/* Every dot is the same size; the row, not the size, carries the score. */
.dot--miss .dot__mark {
    position: relative;
    width: 7px;
    height: 7px;
    background: none;
}

.dot--miss .dot__mark::before,
.dot--miss .dot__mark::after {
    content: "";
    position: absolute;
    top: calc(50% - 0.75px);
    left: 0;
    width: 7px;
    height: 1.5px;
    background: var(--miss);
}

.dot--miss .dot__mark::before {
    transform: rotate(45deg);
}

.dot--miss .dot__mark::after {
    transform: rotate(-45deg);
}

.dot:hover .dot__mark,
.dot:focus-visible .dot__mark,
.dot--selected .dot__mark {
    transform: scale(1.35);
}

.dot:focus-visible,
.dot--selected {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

@media (pointer: coarse) {
    .dot {
        width: 24px;
        height: 24px;
    }

    .dot::before {
        inset: -12px;
    }
}

/* axis ---------------------------------------------------------------- */

.chart-axis {
    position: relative;
    width: var(--chart-width);
    height: 2rem;
}

.tick {
    position: absolute;
    top: 0;
}

.tick__mark {
    display: block;
    width: 1px;
    height: 4px;
    background: var(--rule-strong);
}

.tick--major .tick__mark {
    height: 8px;
    background: var(--ink);
}

.tick__label {
    position: absolute;
    top: 0.625rem;
    left: 0.1875rem;
    font-family: var(--mono);
    font-size: 0.625rem;
    line-height: 1;
    color: var(--muted);
    white-space: nowrap;
}

.tick__month {
    font-weight: 700;
    color: var(--ink);
}

.tick__year {
    font-weight: 400;
    color: var(--muted);
}

/* --------------------------------------------------------------- world map */

/* The transform lives on the SVG, so the frame keeps an untransformed box for
   pointer maths and clips the panned map at its edges. */
.map-frame {
    position: relative;
    overflow: hidden;
}

.map-frame .world-map {
    transform-origin: 0 0;
}

.world-map {
    display: block;
    width: 100%;
    height: auto;
}

.world-map__land {
    fill: var(--paper-deep);
    stroke: var(--rule-strong);
    stroke-width: 0.6;
}

.world-map__marker {
    fill: var(--paper-deep);
    stroke: var(--rule-strong);
    stroke-width: 1;
}

.world-map__country {
    cursor: help;
    transition: fill 120ms ease;
}

.world-map__country.has-results {
    cursor: pointer;
}

/* Cursor states live on the frame and reach down over the country paths that
   set their own cursors. Source order is the precedence: panning wins, then
   the zoom modifiers, then the plain zoomed grab. Each state uses the same
   selector shapes so equal-specificity rules fall back to that order. */
.map-frame.is-zoomed,
.map-frame.is-zoomed .world-map__country,
.map-frame.is-zoomed .world-map__country.has-results {
    cursor: grab;
}

.map-frame.is-zoom-in,
.map-frame.is-zoom-in .world-map__country,
.map-frame.is-zoom-in .world-map__country.has-results {
    cursor: zoom-in;
}

.map-frame.is-zoom-out,
.map-frame.is-zoom-out .world-map__country,
.map-frame.is-zoom-out .world-map__country.has-results {
    cursor: zoom-out;
}

.map-frame.is-panning,
.map-frame.is-panning .world-map__country,
.map-frame.is-panning .world-map__country.has-results {
    cursor: grabbing;
}

.map-frame.is-panning {
    user-select: none;
}

/* The pointer can leave the map before the mouse button is released, so the
   selection guard has to cover the whole document for the whole gesture. */
html.is-map-panning,
html.is-map-panning * {
    -webkit-user-select: none !important;
    user-select: none !important;
}

.world-map__country.is-active {
    fill: var(--accent);
    stroke: var(--ink);
    stroke-width: 1.2;
}

@media (prefers-reduced-motion: reduce) {
    .world-map__country {
        transition: none;
    }
}

.chart-note {
    max-width: 60ch;
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--rule);
    font-size: 0.8125rem;
    color: var(--ink-soft);
}

/* ----------------------------------------------------------------- stats */

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
    padding: 1.375rem 1.75rem 1.625rem 0;
}

.stat + .stat {
    padding-left: 1.75rem;
    border-left: 1px solid var(--rule);
}

.stat:last-child {
    padding-right: 0;
}

.stat__title {
    margin: 0 0 0.75rem;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.1875rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* A second block inside one stat column: lighter heading, hairline above. */
.stat__block {
    margin-top: 1.75rem;
}

.stat__subtitle {
    margin: 0 0 0.75rem;
    padding-top: 1.375rem;
    border-top: 1px solid var(--rule);
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.stat__list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: rank;
}

.stat__list--plain .stat__item {
    padding-left: 0;
}

.stat__list--plain .stat__item::before {
    content: none;
}

.stat__lead {
    margin: 0 0 0.75rem;
}

.stat__item {
    position: relative;
    padding: 0.5625rem 0 0.5625rem 1.625rem;
    border-top: 1px solid var(--rule);
    counter-increment: rank;
}

.stat__item:first-child {
    border-top: 0;
}

.stat__item::before {
    content: counter(rank);
    position: absolute;
    top: 0.6875rem;
    left: 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.stat__value {
    display: block;
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.stat__meta {
    display: block;
    margin-top: 0.125rem;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    color: var(--muted);
}

.stat__name {
    font-size: 0.90625rem;
    line-height: 1.4;
}

.stat__item--miss,
.stat__item--breaker {
    padding-right: 0.25rem;
    cursor: default;
}

.stat__item--miss:hover,
.stat__item--miss:focus-within,
.stat__item--breaker:hover,
.stat__item--breaker:focus-within {
    background: var(--paper-deep);
}

.stat__miss-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.stat__dates {
    display: block;
    margin-top: 0.1875rem;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.55;
    color: var(--muted);
}

.stat__date {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

.stat__date:hover,
.stat__date:focus-visible {
    color: var(--accent);
    text-decoration-color: currentColor;
}

.stat__date:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.stat__count {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 0.6875rem;
    line-height: 1.5;
    color: var(--ink-soft);
    white-space: nowrap;
}

.stat__empty {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
}

/* ---------------------------------------------------------- country filter */

.country-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}

.country-filter__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.375rem 0;
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
    border-radius: 0;
    background: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.8125rem;
    line-height: 1.5;
    appearance: none;
}

.country-filter__input::placeholder {
    color: var(--muted);
}

.country-filter__input:focus-visible {
    outline: none;
    border-bottom-color: var(--accent);
}

/* The box has its own Reset button; the native search cross would duplicate it. */
.country-filter__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.country-filter__reset {
    flex: 0 0 auto;
    padding: 0.125rem 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.65625rem;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.country-filter__reset:hover,
.country-filter__reset:focus-visible {
    color: var(--accent-bright);
    text-decoration: underline;
}

/* ---------------------------------------------------------- country table */

.table-wrap {
    border-bottom: 1px solid var(--rule);
}

.stat--countries {
    min-width: 0;
}

.countries {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.countries th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule-strong);
    background: var(--paper);
    text-align: left;
    font-weight: 400;
}

.countries th.num {
    width: 3.25rem;
}

.countries th.trend-head {
    width: 2.75rem;
    text-align: right;
}

.trend-head__label {
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
}

.countries th.num,
.countries td.num {
    text-align: right;
}

.countries .sort {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.125rem 0;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.countries .sort:hover,
.countries .sort:focus-visible {
    color: var(--accent);
}

.countries th[aria-sort="ascending"] .sort,
.countries th[aria-sort="descending"] .sort {
    color: var(--ink);
}

.countries th[aria-sort="ascending"] .sort::after {
    content: "\2191";
}

.countries th[aria-sort="descending"] .sort::after {
    content: "\2193";
}

.countries td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.8125rem;
    vertical-align: baseline;
}

.countries tbody tr:last-child td {
    border-bottom: 0;
}

.countries tbody tr {
    /* The whole row is the tooltip/overlay target, not just the name. */
    cursor: pointer;
}

.countries tbody tr:hover {
    background: var(--paper-deep);
}

.countries td.num {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

.countries td.is-miss {
    color: var(--miss);
}

.countries td.trend {
    font-family: var(--mono);
    font-size: 0.8125rem;
    text-align: right;
}

/* A trend arrow compares the latest guess with the country's own average. */
.trend__mark {
    font-variant-numeric: normal;
}

.trend__mark--better {
    color: var(--accent);
}

.trend__mark--worse {
    color: var(--miss);
}

.trend__mark--level {
    color: var(--muted);
}

.country {
    padding: 0.125rem 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    cursor: pointer;
}

.country:hover,
.country:focus-visible {
    color: var(--accent);
    text-decoration-color: currentColor;
}

.table__note {
    margin: 0.75rem 0 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.6;
    color: var(--muted);
}

/* score breakdown ------------------------------------------------------ */

.scores {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.score {
    display: grid;
    gap: 0.375rem;
    align-content: start;
}

.score__label {
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1;
    color: var(--muted);
}

.score__share {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.875rem;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.score__bar {
    display: block;
    height: 3px;
    background: var(--rule);
}

.score__fill {
    display: block;
    height: 100%;
    background: var(--accent);
}

.score--miss .score__fill {
    background: var(--miss);
}

.score__count {
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    color: var(--muted);
}

/* The mean score closes the row: a hairline separates it from the bands. */
.score--average {
    padding-left: 1.25rem;
    border-left: 1px solid var(--rule);
}

/* No bar here: the mean is not a share of anything in the row. */
.score__bar--none {
    background: none;
}

/* The yearly toggle sits on the breakdown heading row, not below the grid. */
.breakdown__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.breakdown__head .section__title {
    margin: 0;
}

.breakdown__toggle {
    gap: 0.375rem;
    margin-left: auto;
}

.breakdown__toggle-mark {
    font-size: 0.875rem;
    line-height: 1;
}

.years {
    margin-top: 1.5rem;
}

.year {
    padding-top: 1.125rem;
    border-top: 1px solid var(--rule);
}

.year:first-child {
    padding-top: 0;
    border-top: 0;
}

.year + .year {
    margin-top: 1.25rem;
}

.year__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.75rem;
    font-weight: 400;
}

.year__label {
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.year__meta {
    font-family: var(--mono);
    font-size: 0.65625rem;
    color: var(--muted);
}

/* -------------------------------------------------------------- colophon */

.colophon {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: 0.875rem;
    border-top: 1px solid var(--rule);
}

.colophon p {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.6;
    color: var(--muted);
}

/* --------------------------------------------------------------- tooltip */

.tooltip {
    position: fixed;
    z-index: 60;
    width: 264px;
    padding: 0.75rem 0.875rem 0.6875rem;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    color: var(--ink);
    pointer-events: none;
}

.tooltip[hidden] {
    display: none;
}

.tooltip__date {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.tooltip__name {
    margin: 0.1875rem 0 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.tooltip__score {
    margin: 0.3125rem 0 0;
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.tooltip__score.is-miss {
    color: var(--miss);
}

.tooltip__spark {
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rule);
}

.tooltip__spark svg {
    display: block;
    width: 100%;
    height: auto;
}

.tooltip__count {
    margin: 0.375rem 0 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    color: var(--muted);
}

.tooltip--empty .tooltip__date,
.tooltip--empty .tooltip__spark,
.tooltip--empty .tooltip__count {
    display: none;
}

.tooltip--empty .tooltip__name {
    margin-top: 0;
}

.tooltip--empty .tooltip__score {
    margin-top: 0.375rem;
}

/* ------------------------------------------------------------- sparkline */

.sparkline {
    display: block;
    overflow: visible;
}

.spark-grid {
    stroke: var(--rule);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.spark-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.25;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.spark-hit {
    fill: var(--accent);
}

.spark-miss {
    fill: var(--miss);
}

.spark-active {
    stroke: var(--paper);
    stroke-width: 1.5;
}

.spark-target {
    pointer-events: all;
    cursor: pointer;
}

/* --------------------------------------------------------------- overlay */

.overlay {
    width: 340px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    color: var(--ink);
    overflow: hidden;
}

.overlay[open] {
    display: flex;
    flex-direction: column;
}

.overlay::backdrop {
    background: var(--scrim);
}

.overlay__bar {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    align-items: center;
    padding: 0.125rem 0.25rem;
    border-bottom: 1px solid var(--rule);
}

.overlay__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
}

.overlay__close:hover {
    color: var(--accent);
}

.overlay__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.overlay__status {
    margin: 0;
    padding: 1.75rem 1.375rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.overlay__plate {
    margin: 0;
    padding: 0 9px 9px;
}

.overlay__image {
    display: block;
    width: 100%;
    height: auto;
    background: var(--paper-deep);
}

.overlay__meta {
    padding: 1rem 1.375rem 1.375rem;
}

.overlay__meta--plain {
    padding-top: 1.25rem;
}

.overlay__date {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.overlay__title {
    margin: 0.25rem 0 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.625rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.overlay__score {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--ink-soft);
}

.overlay__score.is-miss {
    color: var(--miss);
}

.overlay__spark {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
}

.overlay__spark svg {
    display: block;
    width: 100%;
    height: auto;
}

.spark-tip {
    position: fixed;
    z-index: 1;
    margin: 0;
    padding: 0.25rem 0.4375rem;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.6875rem;
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow);
}

.overlay__history {
    margin: 0.5rem 0 0;
    font-family: var(--mono);
    font-size: 0.65625rem;
    line-height: 1.5;
    color: var(--muted);
}

.overlay__note {
    max-width: 34ch;
    margin: 0.625rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* ----------------------------------------------------------------- setup */

.setup {
    max-width: 660px;
}

.setup__wordmark {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

.setup__title {
    margin: clamp(2rem, 8vw, 4rem) 0 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.setup__lede {
    max-width: 52ch;
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--ink);
    font-family: var(--serif);
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

.setup__code {
    margin: 1.75rem 0 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--rule-strong);
    background: var(--paper-deep);
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.9;
    overflow-x: auto;
}

.setup__code code {
    font: inherit;
}

.setup__note {
    max-width: 52ch;
    margin: 1.25rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--muted);
}

.setup__note code {
    font-family: var(--mono);
    font-size: 0.75rem;
}

/* ------------------------------------------------------------ responsive */

/* The stats row needs a wide third column, so it stacks before the table's
   five columns would squeeze the country names. */
@media (max-width: 1200px) {
    .stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat {
        padding: 1.25rem 0 1.375rem;
    }

    .stat + .stat {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--rule);
    }

    .section__streak {
        width: 100%;
        text-align: left;
    }

    .scores {
        grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    /* The score column wraps onto its own row here, so the hairline would hang. */
    .score--average {
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 520px) {
    .figure__caption {
        display: block;
    }

    .figure__hint {
        display: block;
        margin-top: 0.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
