/* Velheim hiscores: /hiscores/ and /bosses/ (markup in hiscores/lib/View.php and the page classes).
   Colours, frames and buttons come from the client-theme tokens in /bin/css/style.css (--vh-*); the only colours of
   its own are the silver and bronze medals. Bump HiscoresView::ASSET_VERSION after editing. */

.hs {
    --hs-gold: linear-gradient(145deg, #f6dc95, #c39232);
    --hs-silver: linear-gradient(145deg, #f1eee8, #9a948a);
    --hs-bronze: linear-gradient(145deg, #e9b47f, #94592a);
    --hs-gold-text: linear-gradient(180deg, #fff4c8 10%, #e4c078 55%, #b8862e);
    --hs-silver-text: linear-gradient(180deg, #ffffff 10%, #d5d7db 55%, #9a9ea6);
    --hs-bronze-text: linear-gradient(180deg, #ffe0bf 10%, #d79358 55%, #9a5a2a);
    --hs-row-line: rgba(87, 80, 68, 0.55);
    --hs-stripe: rgba(24, 22, 22, 0.45);
    --hs-hover: rgba(228, 192, 120, 0.07);
    --hs-positive: #cfe9bd;
    --hs-negative: #ffb0a8;
}

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

/* skeleton.css spaces every form, table, paragraph, field and button. This reset outranks skeleton's element rules
   but only ties with a component class, so the components below (later in the file) keep their own margins. */
.hs :where(form, table, p, ol, input, button, h1, h2) {
    margin: 0;
}

.hs-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Top bar ------------------------------------------------------------------------------------------- */

.hs-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 20px;
}

.hs-bar__label {
    margin-right: auto;
    color: var(--vh-accent);
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 1px 1px 0 #000;
}

/* ---- Switch (segmented links) ------------------------------------------------------------------------- */

.hs-switch {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    background: var(--vh-track);
    border: 1px solid var(--vh-border);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hs-switch__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 16px;
    color: var(--vh-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.12s, color 0.12s;
}

.hs-switch__opt:hover,
.hs-switch__opt:focus-visible {
    background: var(--vh-button-hover);
    color: #fff;
}

.hs-switch__opt.is-active {
    background: var(--vh-button-selected);
    box-shadow: inset 0 0 0 1px var(--vh-fill);
    color: var(--vh-accent);
}

.hs-switch__opt img {
    height: 16px;
    width: auto;
}

.hs-switch--fill {
    display: flex;
}

.hs-switch--fill .hs-switch__opt {
    flex: 1 1 0;
}

/* ---- Layout -------------------------------------------------------------------------------------------- */

.hs-layout {
    display: grid;
    grid-template-columns: 312px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.hs-side,
.hs-main {
    min-width: 0;
}

.hs-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 18px;
}

.hs-main {
    position: relative;
    padding: 22px 24px 24px;
}

.hs-group__label {
    display: block;
    margin: 0 0 8px;
    color: var(--vh-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* ---- Chips (game modes) -------------------------------------------------------------------------------- */

.hs-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.hs-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 6px 12px;
    background: var(--vh-track);
    border: 1px solid var(--vh-border);
    color: var(--vh-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.12s, color 0.12s;
}

.hs-chip img {
    height: 16px;
    width: auto;
}

.hs-chip i {
    width: 16px;
    color: var(--vh-muted);
    text-align: center;
}

.hs-chip:hover,
.hs-chip:focus-visible {
    background: var(--vh-button-hover);
    color: #fff;
}

.hs-chip.is-active {
    background: var(--vh-button-selected);
    border-color: var(--vh-fill);
    color: var(--vh-accent);
}

/* ---- Skills (one sprite: assets/img/skills.png, 29 cells of 26px, --i = the skill's index) --------------- */

.hs-skill-icon {
    --s: 26px;
    display: inline-block;
    flex: 0 0 var(--s);
    width: var(--s);
    height: var(--s);
    background: var(--hs-skill-sprite, url("img/skills.png")) no-repeat;
    background-size: calc(var(--s) * 29) var(--s);
    background-position: calc(var(--i, 0) * var(--s) * -1) 0;
    vertical-align: middle;
}

.hs-skill-icon--lg {
    --s: 46px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.hs-skills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 5px;
}

.hs-skill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 3px 8px 3px 5px;
    background: var(--vh-track);
    border: 1px solid transparent;
    color: var(--vh-text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.12s, color 0.12s;
}

.hs-skill:hover,
.hs-skill:focus-visible {
    background: var(--vh-button);
    border-color: var(--vh-border);
    color: #fff;
}

.hs-skill.is-active {
    background: var(--vh-button-selected);
    border-color: var(--vh-fill);
    color: var(--vh-accent);
}

.hs-skill__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Every inverted skillcape slot of the skill is taken. */
.hs-skill__flag {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--vh-bad);
}

/* ---- Search, compare, buttons --------------------------------------------------------------------------- */

.hs input[type="search"],
.hs input[type="number"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    background: var(--vh-track);
    border: 1px solid var(--vh-border);
    border-radius: 0;
    color: var(--vh-text);
    font-size: 14px;
    box-shadow: none;
}

.hs input:focus {
    border-color: var(--vh-accent);
    outline: none;
}

.hs-search__row {
    display: flex;
    gap: 8px;
}

.hs-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    background: var(--vh-button);
    border: 1px solid #000;
    border-image: var(--vh-ring);
    color: var(--vh-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.hs-button:hover,
.hs-button:focus-visible {
    background: var(--vh-button-hover);
    color: #fff;
}

.hs-button--block {
    width: 100%;
    margin-top: 8px;
}

.hs-compare__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.hs-compare__vs,
.hs-vs {
    color: var(--vh-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.hs-vs {
    margin: 0 0.35em;
    font-size: 0.5em;
    vertical-align: middle;
}

/* ---- Heading -------------------------------------------------------------------------------------------- */

.hs-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--vh-border);
}

.hs-heading__text {
    flex: 1 1 auto;
    min-width: 0;
}

.hs .hs-heading__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--vh-accent);
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    text-shadow: 1px 1px 0 #000;
    overflow-wrap: anywhere;
}

.hs-heading__title .hs-crown {
    height: 20px;
}

.hs-heading__sub {
    margin-top: 4px;
    color: var(--vh-muted);
    font-size: 13px;
}

.hs-heading__aside {
    margin-left: auto;
    color: var(--vh-muted);
    font-size: 12px;
    text-align: right;
}

/* "Updated 1 minute 5s ago" (velheimCacheStatusHtml, ticked by /bin/js/cache-status.js). */
.hs-heading__aside .velheim-cache-status {
    margin: 0;
    font-size: 12px;
    text-align: inherit;
    white-space: nowrap;
}

.hs-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.hs-ribbon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 11px 14px;
    background: var(--vh-track);
    border-left: 3px solid var(--vh-good);
    color: var(--hs-positive);
    font-size: 13px;
    font-weight: 700;
}

.hs-ribbon.is-full,
.hs-ribbon.is-dead {
    border-left-color: var(--vh-bad);
    color: var(--hs-negative);
}

.hs-notice {
    padding: 28px 16px;
    color: var(--vh-muted);
    font-weight: 700;
    text-align: center;
}

.hs-notice--error {
    color: var(--hs-negative);
}

/* ---- Podium: the top three standing on stepped pedestals (2nd, 1st, 3rd) with their trophies ------------- */

.hs .hs-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 210px));
    justify-content: center;
    align-items: end;
    margin: 6px auto 28px;
    padding: 0;
    list-style: none;
}

.hs-podium__place {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

.hs-podium__place--1 { order: 2; --tall: 150px; --trophy: 66px; --numeral: 60px; --medal: var(--hs-gold); --medal-text: var(--hs-gold-text); --glow: rgba(228, 192, 120, 0.45); }
.hs-podium__place--2 { order: 1; --tall: 108px; --trophy: 52px; --numeral: 46px; --medal: var(--hs-silver); --medal-text: var(--hs-silver-text); --glow: rgba(225, 222, 216, 0.22); }
.hs-podium__place--3 { order: 3; --tall: 80px; --trophy: 48px; --numeral: 42px; --medal: var(--hs-bronze); --medal-text: var(--hs-bronze-text); --glow: rgba(214, 150, 92, 0.25); }

/* What stands on the step: trophy, name, figures. */
.hs-podium__stand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 10px 16px;
    text-align: center;
}

.hs-podium__place--1 .hs-podium__stand::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 50%;
    width: 200px;
    height: 160px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 38%, rgba(228, 192, 120, 0.2), transparent 68%);
    pointer-events: none;
}

.hs-trophy {
    position: relative;
    width: var(--trophy);
    height: var(--trophy);
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 14px var(--glow));
}

.hs-podium__player {
    position: relative;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.25;
}

.hs-podium__place--1 .hs-podium__player {
    font-size: 17px;
}

.hs-podium__player .hs-player {
    flex-wrap: wrap;
    justify-content: center;
}

.hs-podium__player--empty {
    color: var(--vh-muted);
    font-style: italic;
}

.hs-podium__value {
    position: relative;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hs-podium__place--1 .hs-podium__value {
    font-size: 17px;
}

.hs-podium__detail {
    position: relative;
    color: var(--vh-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* The step: a lit top surface to stand on, a front face with the place in its medal colour. */
.hs-podium__step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: var(--tall);
    margin-top: 12px;
    padding-top: 14px;
    background: linear-gradient(180deg, #3d362c 0%, #2a2520 45%, #1a1714 100%);
    border: 1px solid #000;
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.4), 0 6px 12px rgba(0, 0, 0, 0.45);
}

.hs-podium__step::before {
    content: "";
    position: absolute;
    right: -1px;
    bottom: 100%;
    left: -1px;
    height: 12px;
    background: linear-gradient(180deg, #675b48, #463d31);
    clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%);
}

.hs-podium__step::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--medal);
}

.hs-podium__numeral {
    background: var(--medal-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    font-size: var(--numeral);
    font-weight: 800;
    line-height: 1;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.75));
}

.hs-podium__ordinal {
    margin-top: 3px;
    color: var(--vh-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hs-podium__place.is-empty .hs-trophy {
    opacity: 0.22;
    filter: grayscale(1);
}

.hs-podium__place.is-highlight .hs-podium__step {
    outline: 2px solid var(--vh-accent);
    outline-offset: -3px;
}

/* ---- Tables --------------------------------------------------------------------------------------------- */

.hs-table-wrap {
    container: hs-table / inline-size;
}

/* Browsers without container queries (iOS 15 and older) keep the wide table; let it scroll inside its box there. */
@supports not (container-type: inline-size) {
    .hs-table-wrap {
        overflow-x: auto;
    }
}

.hs-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--vh-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.hs-table th {
    padding: 10px 12px;
    background: var(--vh-track);
    border-bottom: 1px solid var(--vh-border);
    color: var(--vh-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.hs-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--hs-row-line);
    vertical-align: middle;
}

.hs-table tbody tr:nth-child(even) td {
    background: var(--hs-stripe);
}

.hs-table tbody tr:hover td {
    background: var(--hs-hover);
}

.hs-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hs-table .hs-col-rank {
    width: 70px;
    color: var(--vh-muted);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hs-table td.hs-col-rank a {
    color: var(--vh-accent);
}

.hs-table tr.is-highlight td {
    background: rgba(228, 192, 120, 0.16);
    box-shadow: inset 0 1px 0 var(--vh-accent), inset 0 -1px 0 var(--vh-accent);
}

.hs-table tr.is-current td {
    background: rgba(228, 192, 120, 0.09);
}

.hs-table tr.is-dead td {
    background: rgba(72, 21, 21, 0.24);
    color: var(--vh-muted);
}

.hs-table__empty td {
    padding: 28px 16px;
    color: var(--vh-muted);
    font-weight: 700;
    text-align: center;
}

.hs-player {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--vh-accent);
    font-weight: 700;
    text-decoration: none;
}

.hs-player:hover .hs-player__name,
.hs-player:focus-visible .hs-player__name {
    color: #fff;
    text-decoration: underline;
}

.hs-player.is-dead {
    color: #d29b9b;
}

.hs-player__name {
    overflow-wrap: anywhere;
}

.hs-crowns {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

.hs-crown {
    height: 15px;
    width: auto;
}

.hs-podium .hs-crown {
    height: 17px;
}

.hs-death {
    display: block;
    margin-top: 2px;
    color: var(--hs-negative);
    font-size: 11px;
    font-weight: 700;
}

.hs-prestige {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 5px;
    background: var(--vh-accent);
    color: var(--vh-primary-text);
    font-size: 10px;
    font-weight: 800;
    vertical-align: 1px;
}

.hs-col-skill {
    white-space: nowrap;
}

.hs-skill-label {
    margin-left: 8px;
}

.hs-progress {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 140px;
}

.hs-progress__track {
    display: block;
    height: 6px;
    background: #0d0c0b;
    border: 1px solid var(--vh-border);
}

.hs-progress__fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--vh-fill), var(--vh-accent));
}

.hs-progress__text {
    color: var(--vh-muted);
    font-size: 11px;
}

.hs-capped {
    color: var(--hs-positive);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.hs-capped i {
    color: var(--vh-accent);
}

/* Compare */
.hs-versus {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.hs-versus__side {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: var(--vh-track);
    border: 1px solid var(--vh-border);
}

.hs-versus__side--2 {
    align-items: flex-end;
    text-align: right;
}

.hs-versus__meta {
    color: var(--vh-muted);
    font-size: 12px;
}

.hs-table--compare th.hs-col-cmp {
    width: 38%;
}

.hs-cmp {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    font-variant-numeric: tabular-nums;
}

.hs-cmp strong {
    min-width: 2.2em;
    font-size: 15px;
}

.hs-cmp small {
    color: var(--vh-muted);
    font-size: 12px;
}

.hs-cmp.is-ahead strong {
    color: var(--vh-good);
}

/* Boss tables */
.hs-time {
    font-variant-numeric: tabular-nums;
}

/* ---- Pager ---------------------------------------------------------------------------------------------- */

.hs-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.hs-pager__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.hs-pager__page,
.hs-pager__step {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--vh-track);
    border: 1px solid var(--vh-border);
    color: var(--vh-text);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.hs-pager__page:hover,
.hs-pager__step:hover,
.hs-pager__page:focus-visible,
.hs-pager__step:focus-visible {
    background: var(--vh-button-hover);
    color: #fff;
}

.hs-pager__page.is-active {
    background: var(--vh-button-selected);
    border-color: var(--vh-fill);
    color: var(--vh-accent);
}

.hs-pager__step.is-disabled {
    opacity: 0.35;
}

.hs-pager__gap {
    padding: 0 2px;
    color: var(--vh-muted);
}

.hs-jump {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-jump label {
    color: var(--vh-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hs .hs-jump input {
    flex: 0 0 96px;
    width: 96px;
}

/* ---- Bosses --------------------------------------------------------------------------------------------- */

.hs-bosses {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding-right: 4px;
    max-height: 640px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--vh-fill) var(--vh-track);
    scrollbar-width: thin;
}

.hs-boss {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 3px 8px 3px 3px;
    background: var(--vh-track);
    border: 1px solid transparent;
    color: var(--vh-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.hs-boss:hover,
.hs-boss:focus-visible {
    background: var(--vh-button);
    border-color: var(--vh-border);
    color: #fff;
}

.hs-boss.is-active {
    background: var(--vh-button-selected);
    border-color: var(--vh-fill);
    color: var(--vh-accent);
}

.hs-boss.is-soon {
    opacity: 0.55;
}

.hs-boss[hidden] {
    display: none;
}

/* One sprite for every boss (assets/img/bosses.jpg, 60px cells drawn at 30px; --i = the boss's cell in bosses.json). */
.hs-boss-icon {
    --s: 30px;
    flex: 0 0 var(--s);
    width: var(--s);
    height: var(--s);
    background: var(--hs-boss-sprite, url("img/bosses.jpg")) no-repeat var(--vh-track);
    background-size: auto var(--s);
    background-position: calc(var(--i, 0) * var(--s) * -1) 0;
    border: 1px solid #000;
}

.hs-boss-icon--lg {
    --s: 64px;
    border: 1px solid #000;
    border-image: var(--vh-ring);
}

.hs-boss-icon--total {
    display: grid;
    place-items: center;
    background: var(--vh-button-selected);
    color: var(--vh-accent);
}

.hs-boss-icon--lg.hs-boss-icon--total {
    font-size: 26px;
}

.hs .hs-filter-input {
    margin-bottom: 8px;
}

/* Most kills / Fastest times above a boss board. */
.hs-board-tools {
    display: flex;
    justify-content: center;
    margin: 0 0 22px;
}

.hs-boss-portrait {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    object-fit: cover;
    object-position: 50% 20%;
    background: var(--vh-track);
    border: 1px solid #000;
    border-image: var(--vh-ring);
}

.hs-notice__more {
    margin-top: 16px;
}

/* ---- In-place loading (assets/hiscores.js) -------------------------------------------------------------- */

.hs.is-loading [data-hs-region="main"] > * {
    opacity: 0.55;
    transition: opacity 0.15s;
}

.hs.is-loading .hs-main::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--vh-accent), transparent) no-repeat;
    background-size: 40% 100%;
    animation: hs-loading 0.9s linear infinite;
}

@keyframes hs-loading {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hs.is-loading .hs-main::after {
        animation: none;
        background-size: 100% 100%;
    }
}

/* ---- Narrow tables: each row becomes a small block (table space under 560px) ---------------------------- */

@container hs-table (max-width: 560px) {
    .hs-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .hs-table,
    .hs-table tbody {
        display: block;
    }

    .hs-table tr {
        display: grid;
        gap: 3px 10px;
        align-items: baseline;
        padding: 8px 10px;
        border-bottom: 1px solid var(--hs-row-line);
    }

    .hs-table tbody tr:nth-child(even) {
        background: var(--hs-stripe);
    }

    .hs-table tr.is-highlight {
        background: rgba(228, 192, 120, 0.16);
        box-shadow: inset 0 1px 0 var(--vh-accent), inset 0 -1px 0 var(--vh-accent);
    }

    .hs-table tr.is-dead {
        background: rgba(72, 21, 21, 0.24);
    }

    /* Cells sit transparent on their row's own stripe, so every per-cell background state above is undone here. */
    .hs-table td,
    .hs-table tbody tr td,
    .hs-table tbody tr:hover td,
    .hs-table tbody tr:nth-child(even) td,
    .hs-table tr.is-highlight td,
    .hs-table tr.is-current td,
    .hs-table tr.is-dead td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .hs-table td.num[data-label]::before {
        content: attr(data-label) " ";
        color: var(--vh-muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .hs-table__empty td {
        padding: 20px 8px;
    }

    .hs-table--ranks tr,
    .hs-table--boss tr {
        grid-template-columns: 3.2em minmax(0, 1fr) auto;
        grid-template-areas:
            "rank player a"
            "rank b b";
    }

    .hs-table .hs-col-rank { grid-area: rank; }
    .hs-table .hs-col-player { grid-area: player; }
    .hs-table--ranks .hs-col-xp,
    .hs-table--boss td:nth-child(3) { grid-area: a; text-align: right; }
    .hs-table--ranks .hs-col-level,
    .hs-table--boss td:nth-child(4) { grid-area: b; text-align: left; }

    .hs-table--player tr {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "skill level rank"
            "progress progress xp";
    }

    .hs-table--player .hs-col-skill { grid-area: skill; }
    .hs-table--player .hs-col-level { grid-area: level; }
    .hs-table--player .hs-col-rank { grid-area: rank; width: auto; text-align: right; }
    .hs-table--player .hs-col-xp { grid-area: xp; }
    .hs-table--player .hs-col-progress { grid-area: progress; }
    .hs-table--player .hs-col-rank::before {
        content: "#";
    }

    .hs-table--compare tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "skill skill"
            "one two";
    }

    .hs-table--compare td:nth-child(1) { grid-area: skill; }
    .hs-table--compare td:nth-child(2) { grid-area: one; }
    .hs-table--compare td:nth-child(3) { grid-area: two; }
    .hs-table--compare td:nth-child(3) .hs-cmp { justify-content: flex-end; text-align: right; }
}

/* ---- Tablets and phones: filters above the board ------------------------------------------------------- */

@media (max-width: 900px) {
    .hs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .hs-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 12px;
    }

    .hs-group--modes,
    .hs-group--skills,
    .hs-group--bosses {
        grid-column: 1 / -1;
    }

    .hs-chips {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    }

    /* Skills become an icon grid; the chosen skill is named in the heading below. */
    .hs-skills {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    }

    .hs-skill {
        justify-content: center;
        min-height: 38px;
        padding: 4px;
    }

    .hs-skill__name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .hs-bosses {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        max-height: 300px;
    }
}

@media (max-width: 600px) {
    .hs-bar {
        padding: 12px 14px;
    }

    .hs-bar__label {
        width: 100%;
        font-size: 19px;
    }

    .hs-bar .hs-switch {
        flex: 1 1 100%;
    }

    .hs-bar .hs-switch__opt {
        flex: 1 1 0;
        padding: 0 8px;
    }

    .hs-side {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px 14px;
    }

    .hs-main {
        padding: 16px 14px 18px;
    }

    .hs-heading {
        flex-wrap: wrap;
        gap: 10px;
    }

    .hs .hs-heading__title {
        font-size: 23px;
    }

    .hs-heading__aside {
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .hs-actions {
        justify-content: flex-start;
    }

    .hs .hs-podium {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 22px;
    }

    .hs-podium__place--1 { --tall: 112px; --trophy: 50px; --numeral: 44px; }
    .hs-podium__place--2 { --tall: 80px; --trophy: 40px; --numeral: 34px; }
    .hs-podium__place--3 { --tall: 60px; --trophy: 36px; --numeral: 30px; }

    .hs-podium__stand {
        padding: 0 4px 12px;
    }

    .hs-podium__player,
    .hs-podium__place--1 .hs-podium__player,
    .hs-podium__value,
    .hs-podium__place--1 .hs-podium__value {
        font-size: 13px;
    }

    .hs-podium__detail {
        font-size: 11px;
    }

    .hs-podium__ordinal {
        font-size: 10px;
    }

    .hs-versus {
        grid-template-columns: minmax(0, 1fr);
    }

    .hs-versus__side--2 {
        align-items: flex-start;
        text-align: left;
    }

    .hs-pager {
        justify-content: center;
    }

    /* 16px keeps iOS from zooming into a focused field. */
    .hs input[type="search"],
    .hs input[type="number"] {
        font-size: 16px;
    }
}

/* After an in-place load the new heading takes focus (hiscores.js); it is not a control, so no focus ring. */
.hs .hs-heading__title:focus {
    outline: none;
}
