/* ISHKALA 2026 - white wave results theme
   Shared stylesheet for grand-total / first / final / toppers.
   Derived from the approved results hub (views/results.ejs). */

:root {
    --paper: #f0ece5;
    --poster: #fffdf9;
    --ink: #171310;
    --ink-soft: #4a423b;
    --ink-faint: #6f665e;
    --rule: #171310;
    --rule-soft: rgba(23, 19, 16, 0.16);
    --orange: #ef6a1e;
    --purple: #7b3f9d;
    --teal: #12867c;
    --amber: #c0680c;
    --red: #c9402a;
    --lavender: #ded1f0;
    --mint: #cfe7e0;
    --peach: #fdecd3;
    --blush: #f9dcda;
    --gold: #a97a08;
    --silver: #5f625f;
    --bronze: #a25430;
    --radius: 10px;
    --radius-sm: 8px;
    --shell: 76rem;
    --gap: 0.875rem;
    --tap: 3rem;
    --focus: #7b3f9d;
    /* fallback wash for browsers without color-mix(); overridden per accent below */
    --accent-soft: #f0ece5;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
}

/* ------------------------------------------------------------------ shell */

.poster {
    width: min(100% - 1.25rem, var(--shell));
    margin: 0.625rem auto;
    padding: 1rem 0.875rem 1.125rem;
    background: var(--poster);
    border-radius: var(--radius);
}

.round-results-page .poster {
    display: flex;
    min-height: calc(100dvh - 1.25rem);
    flex-direction: column;
}

.round-results-page main {
    flex: 1 0 auto;
}

.sitehead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: var(--tap);
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.brand__mark {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex: none;
}

.brand__name {
    display: block;
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.01em;
}

.brand__sub {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    line-height: 1.3;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

.backlink {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--tap);
    padding-inline: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    border-radius: var(--radius-sm);
}

.backlink svg {
    flex: none;
    color: var(--orange);
}

.rule {
    margin: 0.875rem 0 0;
    border: 0;
    border-top: 1.5px solid var(--rule);
}

/* -------------------------------------------------------------------- hero */

.wave {
    display: block;
    color: var(--orange);
}

.pagehead {
    padding-block: 1.25rem 1.5rem;
}

.pagehead__eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.pagehead__title {
    margin-top: 0.5rem;
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: clamp(2.125rem, 9vw, 4.25rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.pagehead__wave {
    margin-top: 0.75rem;
}

.pagehead__lede {
    margin-top: 0.875rem;
    max-width: 44rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

.pagehead__meta {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

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

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

.controls__label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* small logo-orange tick keeps the field set anchored to the brand */
.controls__label::before {
    content: '';
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--orange);
}

.controls__field {
    min-width: 0;
}

.select {
    position: relative;
    display: block;
    border-radius: var(--radius-sm);
}

.select select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.75rem 3.5rem 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--rule);
    border-radius: var(--radius-sm);
    text-overflow: ellipsis;
}

.select select:invalid {
    color: var(--ink-faint);
}

.select__chevron svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* custom chevron well: flat plate divided from the field by a crisp rule */
.select__chevron {
    position: absolute;
    inset: 1.5px 1.5px 1.5px auto;
    display: grid;
    place-items: center;
    width: 2.875rem;
    color: var(--orange);
    background: var(--paper);
    border-left: 1.5px solid var(--rule);
    border-radius: 0 calc(var(--radius-sm) - 1.5px) calc(var(--radius-sm) - 1.5px) 0;
    pointer-events: none;
}

.select:focus-within select {
    border-color: var(--purple);
}

.select:focus-within .select__chevron {
    background: var(--lavender);
    color: var(--purple);
}

/* ----------------------------------------------------------------- panels */

.panel {
    margin-top: 1.25rem;
    padding-top: 1.125rem;
    border-top: 1.5px solid var(--rule);
}

.panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}

.panel__title {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.panel__note {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.sectionhead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1.5px solid var(--rule);
}

.sectionhead__title {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.sectionhead__note {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.empty {
    margin-top: 1.5rem;
    padding: 1.5rem 1.25rem;
    background: var(--peach);
    border-radius: var(--radius);
}

.empty__title {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1.2;
}

.empty__body {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

.empty--blush {
    background: var(--blush);
}

.empty--mint {
    background: var(--mint);
}

/* ------------------------------------------------------------------ ranks */

.ranks {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.625rem;
}

.rank {
    --accent: var(--ink);
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 1rem;
    min-width: 0;
    padding: 0.875rem 1rem 1.125rem;
    overflow: hidden;
    background: #fff;
    border: 1.5px solid var(--rule-soft);
    border-radius: var(--radius);
}

.rank--champion {
    background: var(--peach);
}

.rank__no {
    display: grid;
    gap: 0.15rem;
    min-width: 3rem;
    padding-right: 1rem;
    border-right: 1px solid var(--rule-soft);
}

.rank__no-k {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.rank__no-v {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.rank--champion .rank__no-v {
    color: var(--gold);
}

.rank__id {
    min-width: 0;
}

.rank__house {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.rank__caption {
    margin-top: 0.2rem;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
}

.rank__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 1rem;
    margin-top: 0.4rem;
}

.rank__stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 0;
}

.rank__stat-k {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.rank__stat-v {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.rank__score {
    display: grid;
    justify-items: end;
    gap: 0.15rem;
    min-width: 4rem;
    white-space: nowrap;
}

.rank__score-v {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.625rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.rank--champion .rank__score-v {
    color: var(--ink);
}

.rank__score-k {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* the row rule doubles as the share marker: house ink up to the share,
   a plain hairline for the rest */
.rank__share {
    position: absolute;
    inset: auto 1rem 0.625rem 1rem;
    height: 2px;
    overflow: hidden;
    background: rgba(23, 19, 16, 0.1);
    border-radius: 2px;
}

.rank__share::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--pct, 0%);
    background: var(--accent, var(--ink));
}

/* house identity follows the shared chip palette */
.rank[data-house='hira'] {
    --accent: #c2540f;
}

.rank[data-house='tuwa'] {
    --accent: #0f7c72;
}

.rank[data-house='safa'] {
    --accent: #7b3f9d;
}

.rank[data-house='quba'] {
    --accent: #55608f;
}

/* ------------------------------------------------------------------ lists */

.entries {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.entry {
    --accent: var(--ink);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1.5px solid var(--rule-soft);
    border-radius: var(--radius);
}

.entry--hira {
    --accent: #c2540f;
}

.entry--tuwa {
    --accent: #0f7c72;
}

.entry--safa {
    --accent: #7b3f9d;
}

.entry--quba {
    --accent: #55608f;
}

.entry__bib {
    display: grid;
    gap: 0.15rem;
    padding-right: 1rem;
    border-right: 1px solid var(--rule-soft);
}

.entry__bib-k {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.entry__bib-v {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.entry__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 0.75rem;
    min-width: 0;
}

.entry__name {
    min-width: 0;
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.entry__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.4rem;
}

/* ------------------------------------------------------------------ chips */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.75rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.chip--plain {
    background: var(--paper);
    color: var(--ink-soft);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.chip--house {
    color: #fffdf9;
}

/* house fills stay separate from each other, drawn from the logo hues
   (orange / teal / purple and a purple-teal blend) instead of new colours */
.chip--hira {
    background: #c2540f;
}

.chip--tuwa {
    background: #0f7c72;
}

.chip--safa {
    background: var(--purple);
}

.chip--quba {
    background: #55608f;
}

.chip--grade {
    background: var(--lavender);
    color: #3f2752;
}

.chip--points {
    background: var(--peach);
    color: #6d3f05;
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- podium */

/* three stepped cylinders, second - first - third, with the winning
   identity floating above each one */
.podium__title {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1.5px solid var(--rule);
}

.podium {
    margin: 1.25rem auto 0;
    max-width: 36rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 0.5rem;
}

.podium__place {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* warm gold cylinder, tuned per step */
    --ped-a: #b0750f;
    --ped-b: #e3b455;
    --ped-c: #f8e6bd;
    --ped-d: #dcab48;
    --ped-e: #9d660d;
}

.podium__place--first {
    order: 2;
    --pedestal-h: 11rem;
    --metal: #e5a91f;
    --metal-deep: #96650a;
}

.podium__place--second {
    order: 1;
    --pedestal-h: 8.25rem;
    --metal: #b6bbc3;
    --metal-deep: #5e646c;
    --ped-a: #ab8c60;
    --ped-b: #ddc7a0;
    --ped-c: #f7efdb;
    --ped-d: #d2ba8f;
    --ped-e: #96794f;
}

.podium__place--third {
    order: 3;
    --pedestal-h: 7rem;
    --metal: #c67a4b;
    --metal-deep: #7f421d;
    --ped-a: #9d6529;
    --ped-b: #d0a066;
    --ped-c: #f4dfc0;
    --ped-d: #c6955b;
    --ped-e: #8a5720;
}

/* the ordinal is carried by the cylinder face, so the heading is for
   assistive tech only */
.podium__place-title {
    position: absolute;
    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;
}

.podium__winners {
    width: 100%;
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    text-align: center;
}

.podium__winner {
    min-width: 0;
}

.podium__name {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.podium__place--first .podium__name {
    font-size: 1.375rem;
}

/* details stay on the page: a dark pill holds the house and grade */
.podium__pill {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    max-width: 100%;
    margin-top: 0.5rem;
    padding: 0.25rem 0.3rem;
    background: var(--ink);
    border-radius: 999px;
}

.podium__pill .chip {
    min-height: 1.5rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
}

.podium__chest {
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.podium__poster-actions {
    position: absolute;
    right: 0.45rem;
    bottom: 0.45rem;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.podium__poster-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #2d81ff;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 3px 9px rgba(45, 129, 255, 0.25);
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.podium__poster-button::before {
    position: absolute;
    inset: -0.375rem;
    content: "";
}

.podium__poster-button::after {
    position: absolute;
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    content: "";
    opacity: 0;
}

.podium__poster-button:hover,
.podium__poster-button:focus-visible {
    background: #1769e0;
    box-shadow: 0 5px 12px rgba(23, 105, 224, 0.3);
    transform: translateY(-1px);
}

.podium__poster-button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.podium__poster-button:disabled {
    cursor: wait;
    transform: none;
}

.podium__poster-button[aria-busy="true"] svg {
    opacity: 0;
}

.podium__poster-button[aria-busy="true"]::after {
    opacity: 1;
    animation: podium-poster-progress 700ms linear infinite;
}

.podium__poster-status {
    max-width: 32rem;
    margin: 0.5rem auto 0;
    color: var(--red);
    font-size: 0.6875rem;
    line-height: 1.35;
    text-align: center;
}

.podium__poster-status:empty {
    display: none;
}

@keyframes podium-poster-progress {
    to {
        transform: rotate(360deg);
    }
}

.podium__medal {
    position: relative;
    z-index: 1;
    display: block;
    width: 3.25rem;
    margin-bottom: -0.5rem;
}

.podium__place--first .podium__medal {
    width: 4rem;
}

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

.medal__ribbon {
    fill: none;
    stroke: var(--metal-deep, var(--rule));
    stroke-linejoin: round;
}

.medal__disc {
    fill: var(--metal, var(--paper));
}

.medal__ring {
    fill: none;
    stroke: var(--metal-deep, var(--rule));
    opacity: 0.5;
}

.medal__star {
    fill: var(--metal-deep, var(--rule));
}

.podium__pedestal {
    position: relative;
    width: min(100%, 10.5rem);
    height: var(--pedestal-h, 9rem);
}

/* cylinder body */
.podium__pedestal::before {
    content: '';
    position: absolute;
    inset: 11% 0 0 0;
    border-radius: 0 0 50% 50% / 0 0 13% 13%;
    background:
        linear-gradient(180deg,
            rgba(255, 253, 246, 0.3) 0%,
            rgba(255, 253, 246, 0.05) 26%,
            rgba(23, 19, 16, 0.12) 100%),
        linear-gradient(90deg,
            var(--ped-a) 0%,
            var(--ped-b) 20%,
            var(--ped-c) 48%,
            var(--ped-d) 76%,
            var(--ped-e) 100%);
    box-shadow: 0 1.125rem 1.5rem -1.125rem rgba(23, 19, 16, 0.55);
}

/* glossy elliptical cap, painted over the body rim */
.podium__pedestal::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 22%;
    border-radius: 50%;
    background:
        radial-gradient(58% 132% at 30% 24%,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.34) 38%,
            rgba(255, 255, 255, 0) 64%),
        linear-gradient(180deg, var(--ped-c) 0%, var(--ped-b) 76%, var(--ped-a) 100%);
    box-shadow: inset 0 -0.25rem 0.5rem -0.1875rem rgba(23, 19, 16, 0.3);
}

.podium__pedestal-num {
    position: absolute;
    inset: 11% 0 0;
    display: grid;
    place-items: center;
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--metal-deep, var(--rule));
    opacity: 0.7;
}

.podium__empty {
    width: 100%;
    margin-bottom: 0.875rem;
    padding: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink-faint);
    background: var(--paper);
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------- tables */

.tablewrap {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1.5px solid var(--rule-soft);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: transparent;
    border-bottom: 1.5px solid var(--rule-soft);
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--rule-soft);
    vertical-align: middle;
}

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

.table__name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.table__sub {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- toppers */

.toppers {
    margin-top: 1rem;
    display: grid;
    gap: var(--gap);
}

.topper {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.875rem;
    padding: 1rem;
    background: var(--accent-soft, #fff);
    border: 1.5px solid var(--rule);
    border-top: 2px solid var(--accent, var(--rule));
    border-radius: var(--radius);
}

.topper__rank {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.topper__body {
    min-width: 0;
}

.topper__name {
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.topper__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    margin-top: 0.4rem;
}

.topper__points {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.topper__points-v {
    display: block;
    font-family: 'Gloock', Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    line-height: 1;
}

.topper__points-k {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.topper[data-rank='1'] {
    --accent: var(--gold);
    --accent-soft: color-mix(in srgb, var(--accent) 8%, #fff);
    --accent-wash: color-mix(in srgb, var(--accent) 14%, #fff);
}

.topper[data-rank='2'] {
    --accent: var(--silver);
    --accent-soft: color-mix(in srgb, var(--accent) 8%, #fff);
    --accent-wash: color-mix(in srgb, var(--accent) 14%, #fff);
}

.topper[data-rank='3'] {
    --accent: var(--bronze);
    --accent-soft: color-mix(in srgb, var(--accent) 8%, #fff);
    --accent-wash: color-mix(in srgb, var(--accent) 14%, #fff);
}

.topper[data-rank]:not([data-rank='1']):not([data-rank='2']):not([data-rank='3']) {
    --accent: #8d857c;
    --accent-soft: color-mix(in srgb, var(--accent) 7%, #fff);
    --accent-wash: color-mix(in srgb, var(--accent) 13%, #fff);
}

.topper[data-rank='1'] .topper__rank {
    background: var(--peach);
    color: #6d3f05;
}

.topper[data-rank='2'] .topper__rank {
    background: #e8e9ea;
    color: #45484a;
}

.topper[data-rank='3'] .topper__rank {
    background: #f3e2da;
    color: #7a3a1d;
}

/* ----------------------------------------------------------- disclosures */

.disclosure {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
}

.disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--tap);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--paper);
    border-radius: var(--radius-sm);
    cursor: pointer;
    list-style: none;
}

.disclosure > summary::-webkit-details-marker {
    display: none;
}

.disclosure > summary .disclosure__icon {
    flex: none;
    color: var(--orange);
    transition: transform 0.18s ease;
}

.disclosure[open] > summary .disclosure__icon {
    transform: rotate(180deg);
}

.disclosure__count {
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

.programs {
    margin-top: 0.625rem;
    display: grid;
    gap: 0.5rem;
}

.program {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--poster);
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius-sm);
}

.program__name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.program__tags {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ---------------------------------------------------------------- focus */

.brand:focus-visible,
.backlink:focus-visible,
.select select:focus-visible,
.disclosure > summary:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

@media (hover: hover) {
    .backlink:hover {
        background: var(--paper);
    }

    .disclosure > summary:hover {
        background: #e7e1d7;
    }

    .select select:hover {
        background: var(--poster);
    }

    .topper:hover {
        background: var(--accent-wash);
    }

}

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

/* ------------------------------------------------------------ bottom nav */

/* app-style tab bar: mobile only, so it starts hidden */
.bottomnav {
    display: none;
}

/* --------------------------------------------------------- compact mobile */

@media (max-width: 39.99rem) {
    :root {
        --tap: 2.875rem;
        --gap: 0.5rem;
    }

    .poster {
        width: min(100% - 0.5rem, var(--shell));
        margin: 0.25rem auto;
        padding: 0.75rem;
        border-radius: var(--radius-sm);
    }

    .round-results-page .poster {
        min-height: calc(100dvh - var(--site-mobile-nav-height, 4rem) - env(safe-area-inset-bottom, 0px) - 0.5rem);
    }

    .sitehead {
        gap: 0.25rem 0.75rem;
    }

    .brand {
        gap: 0.5rem;
        min-height: 2.5rem;
    }

    .brand__mark {
        width: 38px;
        height: 38px;
    }

    .brand__name {
        font-size: 1.125rem;
    }

    .brand__sub {
        margin-top: 0.125rem;
        font-size: 0.625rem;
    }

    .backlink {
        gap: 0.35rem;
        min-height: 2.5rem;
        padding-inline: 0.4rem;
        font-size: 0.6875rem;
    }

    .rule {
        margin-top: 0.625rem;
    }

    .pagehead {
        padding-block: 0.875rem 1rem;
    }

    .pagehead__eyebrow {
        font-size: 0.625rem;
        letter-spacing: 0.18em;
    }

    .pagehead__title {
        margin-top: 0.3rem;
        font-size: clamp(1.875rem, 8.5vw, 2.5rem);
    }

    .pagehead__wave {
        margin-top: 0.5rem;
        width: 112px;
        height: 9px;
    }

    .pagehead__lede {
        margin-top: 0.5rem;
        font-size: 0.8125rem;
        line-height: 1.45;
    }

    .controls {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .controls__label {
        margin-bottom: 0.375rem;
        font-size: 0.625rem;
    }

    .select select {
        min-height: 2.875rem;
        padding: 0.625rem 3rem 0.625rem 0.75rem;
        font-size: 0.9375rem;
    }

    .select__chevron {
        width: 2.5rem;
    }

    .panel {
        margin-top: 0.875rem;
        padding-top: 0.75rem;
    }

    .panel__title {
        font-size: 1.25rem;
    }

    .panel__note {
        font-size: 0.625rem;
    }

    .sectionhead {
        margin-top: 1.25rem;
        padding-top: 0.75rem;
    }

    .sectionhead__title {
        font-size: 1.25rem;
    }

    .sectionhead__note {
        font-size: 0.625rem;
    }

    .ranks,
    .entries,
    .toppers {
        margin-top: 0.625rem;
    }

    .rank {
        column-gap: 0.75rem;
        padding: 0.75rem 0.875rem 1rem;
    }

    .rank__no {
        min-width: 2.5rem;
        padding-right: 0.75rem;
    }

    .rank__no-v {
        font-size: 1.25rem;
    }

    .rank__house {
        font-size: 1.25rem;
    }

    .rank__stats {
        gap: 0.1rem 0.75rem;
        margin-top: 0.3rem;
    }

    .rank__score-v {
        font-size: 1.375rem;
    }

    .entries {
        gap: 0.4rem;
    }

    .entry {
        gap: 0.75rem;
        padding: 0.75rem 0.875rem;
    }

    .entry__name {
        font-size: 1.125rem;
    }

    .entry__bib {
        padding-right: 0.75rem;
    }

    .entry__bib-v {
        font-size: 1.25rem;
    }

    .entry__body {
        gap: 0.3rem 0.5rem;
    }

    .chip {
        min-height: 1.5rem;
        padding: 0.15rem 0.45rem;
        font-size: 0.6875rem;
    }

    .podium {
        margin-top: 0.875rem;
        gap: 0.375rem;
    }

    .podium__title {
        margin-top: 1.25rem;
        padding-top: 0.75rem;
    }

    .podium__place--first {
        --pedestal-h: 8rem;
    }

    .podium__place--second {
        --pedestal-h: 6.25rem;
    }

    .podium__place--third {
        --pedestal-h: 5.25rem;
    }

    .podium__winners {
        gap: 0.5rem;
        margin-bottom: 0.625rem;
    }

    .podium__name {
        font-size: 0.875rem;
        line-height: 1.15;
    }

    .podium__place--first .podium__name {
        font-size: 1rem;
    }

    .podium__pill {
        gap: 0.2rem;
        margin-top: 0.375rem;
        padding: 0.2rem 0.25rem;
    }

    .podium__pill .chip {
        min-height: 1.25rem;
        padding: 0.08rem 0.4rem;
        font-size: 0.5625rem;
    }

    .podium__chest {
        margin-top: 0.25rem;
        font-size: 0.5625rem;
        letter-spacing: 0.05em;
    }

    .podium__medal {
        width: 2.5rem;
        margin-bottom: -0.375rem;
    }

    .podium__place--first .podium__medal {
        width: 3rem;
    }

    .podium__pedestal-num {
        font-size: 1.5rem;
    }

    .podium__empty {
        margin-bottom: 0.625rem;
        padding: 0.5rem;
        font-size: 0.6875rem;
    }

    .tablewrap {
        margin-top: 0.625rem;
    }

    .table {
        min-width: 0;
    }

    .table th {
        padding: 0.5rem 0.625rem;
        font-size: 0.625rem;
    }

    .table td {
        padding: 0.625rem;
        font-size: 0.875rem;
    }

    .table__sub {
        font-size: 0.75rem;
    }

    .topper {
        column-gap: 0.625rem;
        padding: 0.75rem;
    }

    .topper__rank {
        width: 2.375rem;
        height: 2.375rem;
        font-size: 1.0625rem;
    }

    .topper__name {
        font-size: 1.0625rem;
    }

    .topper__meta {
        gap: 0.25rem 0.375rem;
        margin-top: 0.3rem;
    }

    .topper__points-v {
        font-size: 1.375rem;
    }

    .disclosure {
        margin-top: 0.5rem;
    }

    .disclosure > summary {
        min-height: 2.75rem;
        padding: 0.4rem 0.625rem;
        font-size: 0.6875rem;
    }

    .programs {
        gap: 0.375rem;
        margin-top: 0.5rem;
    }

    .program {
        padding: 0.5rem 0.625rem;
    }

    .empty {
        margin-top: 1rem;
        padding: 1rem 0.875rem;
    }

    .empty__title {
        font-size: 1.0625rem;
    }

    .empty__body {
        margin-top: 0.375rem;
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    .bottomnav {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 20;
        display: block;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--poster);
        border-top: 1.5px solid var(--rule);
    }

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

    .bottomnav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        min-height: 3rem;
        padding: 0.4rem 0.125rem;
        font-size: 0.625rem;
        font-weight: 700;
        line-height: 1.15;
        letter-spacing: 0.04em;
        text-align: center;
        text-transform: uppercase;
        text-decoration: none;
        color: var(--ink-faint);
        border-top: 2px solid transparent;
    }

    .bottomnav__link svg {
        flex: none;
        width: 1.25rem;
        height: 1.25rem;
    }

    .bottomnav__link[aria-current='page'] {
        color: var(--ink);
        border-top-color: var(--orange);
    }

    .bottomnav__link[aria-current='page'] svg {
        color: var(--orange);
    }
}

@media (min-width: 40rem) {
    .poster {
        padding: 1.5rem 1.75rem;
    }

    .pagehead {
        padding-block: 1.75rem 2rem;
    }

    .pagehead__lede {
        font-size: 1rem;
    }

    .controls {
        display: flex;
        align-items: flex-end;
        gap: 1rem;
    }

    .controls__field {
        flex: 1 1 20rem;
        max-width: 34rem;
    }

    .entries {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
    }

    .disclosure > summary {
        font-size: 0.75rem;
    }
}

@media (min-width: 48rem) {
    .ranks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 64rem) {
    .pagehead {
        padding-block: 2.25rem 2.5rem;
    }

    /* classic podium order 2 - 1 - 3, centred under the panel heading */
    .podium {
        gap: 0.75rem;
    }

    .podium__place--first {
        --pedestal-h: 11rem;
    }

    .podium__place--second {
        --pedestal-h: 8.25rem;
    }

    .podium__place--third {
        --pedestal-h: 7rem;
    }

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

    .toppers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
