/* Highscores: OSRS-style skills tab index, dense rankings table and player records. */
.hs {
  --hs-well: #08111b;
  --hs-cell: #13212f;
  --hs-cell-top: #182a3b;
  --hs-row-hover: rgba(155, 215, 255, .045);
  --hs-silver: #d3dee8;
  --hs-bronze: #e3ad85;
  padding-bottom: 8px;
}
.adventure-highscores .site { overflow-x: clip; overflow-y: visible; }
.hs [hidden] { display: none !important; }
.hs button, .hs input, .hs select { font: inherit; letter-spacing: inherit; }
.hs-sprite { flex: none; width: auto; max-width: 25px; height: auto; max-height: 25px; object-fit: contain; }

/* Intro and player search */
.hs-intro { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-raised), var(--bg)); }
.hs-intro-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-block: 40px 30px; }
.hs-intro h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.08; letter-spacing: -.035em; }
.hs-intro-copy > p { max-width: 60ch; margin-top: 10px; color: var(--text-soft); font-size: 15.5px; line-height: 1.6; }
.hs-intro-copy > .hs-preview { display: inline-block; margin-top: 12px; padding: 3px 10px; border: 1px solid rgba(245, 199, 107, .35); border-radius: 999px; color: var(--gold); font-size: 12.5px; font-weight: 650; }
.hs-search { flex: 0 1 380px; }
.hs-search label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 13px; font-weight: 650; }
.hs-search-row { position: relative; display: flex; }
.hs-search-row svg { position: absolute; top: 50%; left: 14px; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }
.hs-search input { flex: 1; min-width: 0; height: 46px; padding: 0 12px 0 42px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); background: var(--hs-well); color: var(--text); font-size: 15px; }
.hs-search input::placeholder { color: var(--text-muted); }
.hs-search input[aria-invalid="true"] { border-color: var(--danger); }
.hs-search button { height: 46px; padding: 0 18px; border: 0; border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--gold); color: #1a1406; font-size: 14px; font-weight: 750; cursor: pointer; transition: background 160ms ease; }
.hs-search button:hover { background: var(--gold-bright); }
.hs-search :is(input, button):focus-visible { outline-offset: 2px; }
.hs-search-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hs-search:has([aria-invalid="true"]) .hs-search-help { position: static; width: auto; height: auto; margin-top: 6px; clip: auto; color: var(--danger); font-size: 13px; }

/* Board layout */
.hs-board { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 28px; }
.hs-board[data-view="player"] { grid-template-columns: minmax(0, 1fr); }
.hs-board[data-view="player"] .hs-index { display: none; }

/* Category index */
.hs-index { position: sticky; top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raised); }
.hs-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.hs-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 12px; border: 0; background: none; color: var(--text-soft); font-size: 14px; font-weight: 700; cursor: pointer; transition: color 160ms ease, background 160ms ease; }
.hs-tabs button + button { border-left: 1px solid var(--line); }
.hs-tabs button img { width: 20px; height: 20px; object-fit: contain; }
.hs-tabs button:hover { color: var(--text); background: var(--bg-panel); }
.hs-tabs button[aria-pressed="true"] { color: var(--gold); background: var(--bg-panel); box-shadow: inset 0 -2px var(--gold); }
.hs-tabs button:focus-visible { outline-offset: -3px; }
.hs-picker { padding: 10px; }
.hs-picker > summary { display: none; }
.hs-picker-current { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.hs-picker-current span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-picker-change { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--blue-bright); font-size: 13.5px; font-weight: 650; }
.hs-picker[open] .hs-picker-change svg { transform: rotate(180deg); }

/* Skills tab: three columns, eight rows, bevelled cells in a dark well. */
.hs-skilltab { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 4px; border: 1px solid rgba(0, 0, 0, .5); border-radius: var(--radius-md); background: var(--hs-well); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); list-style: none; }
.hs-skilltab[data-board="bosses"] { display: flex; flex-direction: column; gap: 2px; max-height: min(560px, 62vh); overflow-y: auto; scrollbar-width: thin; }
.hs-skilltab > li { display: contents; }
.hs-skill { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 46px; padding: 5px 7px; border: 1px solid rgba(0, 0, 0, .55); border-radius: 3px; background: linear-gradient(180deg, var(--hs-cell-top), var(--hs-cell)); box-shadow: inset 1px 1px rgba(255, 255, 255, .06), inset -1px -1px rgba(0, 0, 0, .3); color: var(--text-soft); cursor: pointer; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.hs-skill:hover { border-color: rgba(155, 215, 255, .35); color: var(--text); }
.hs-skill:focus-visible { z-index: 1; outline-offset: 1px; }
.hs-skill[aria-current="true"] { border-color: var(--gold); background: linear-gradient(180deg, rgba(245, 199, 107, .2), rgba(245, 199, 107, .08)); color: var(--gold-bright); }
nav.hs-skilltab .hs-sprite { width: 26px; height: 24px; max-width: none; max-height: none; }
nav.hs-skilltab .hs-skill { flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 2px 5px; }
.hs-cell-label { max-width: 100%; overflow: hidden; font-size: 11.5px; font-weight: 650; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.hs-boss { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--text-soft); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.hs-boss:hover { background: var(--hs-cell); color: var(--text); }
.hs-boss[aria-current="true"] { border-color: rgba(245, 199, 107, .6); background: rgba(245, 199, 107, .1); color: var(--gold-bright); }
.hs-boss:focus-visible { outline-offset: -3px; }
.hs-boss .hs-cell-label { font-size: 14px; white-space: normal; }
.hs-boss-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 24px; }
.hs-boss-icon img { width: auto; max-width: 24px; height: auto; max-height: 22px; object-fit: contain; }
.hs-boss-icon.is-group img { max-width: 14px; margin-inline: -2px; }
.hs-boss-search { margin-bottom: 8px; }
.hs-boss-search input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--hs-well); color: var(--text); font-size: 14px; }
.hs-boss-search input:focus-visible { outline-offset: 1px; }
.hs-empty { padding: 12px 4px; color: var(--text-muted); font-size: 14px; }

/* Results panel */
.hs-results { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raised); }
.hs-results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.hs-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hs-title-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; }
.hs-title-icon .hs-sprite { max-width: 32px; max-height: 32px; }
.hs-title-icon .hs-boss-icon { width: 36px; height: 32px; }
.hs-title-icon .hs-boss-icon img { max-width: 32px; max-height: 30px; }
.hs-title-icon .hs-boss-icon.is-group img { max-width: 18px; }
.hs-title h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: -.03em; overflow-wrap: anywhere; }
.hs-board[data-view="player"] .hs-title h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.hs-title h2:focus { outline: none; }
.hs-title h2:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.hs-title p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 3px; color: var(--text-soft); font-size: 14px; }
.hs-profile-mode { display: inline-flex; align-items: center; gap: 6px; }
.hs-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.hs-field { display: grid; gap: 4px; }
.hs-field span { color: var(--text-muted); font-size: 12.5px; font-weight: 650; }
.hs-field select { min-width: 150px; height: 40px; padding: 0 32px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--hs-well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23b4c3cf' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--text); font-size: 14px; appearance: none; cursor: pointer; }
.hs-field select:focus-visible { outline-offset: 1px; }
.hs-clear { height: 40px; padding: 0 6px; border: 0; background: none; color: var(--blue-bright); font-size: 14px; font-weight: 650; cursor: pointer; }
.hs-clear:hover { text-decoration: underline; text-underline-offset: 3px; }
.hs-back { display: none; align-items: center; gap: 6px; flex-basis: 100%; width: fit-content; padding: 0; border: 0; background: none; color: var(--blue-bright); font-size: 14px; font-weight: 650; cursor: pointer; }
.hs-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.hs-board[data-view="player"] .hs-back { display: inline-flex; }
.hs-board:not([data-view="leaderboard"]) .hs-filters { display: none; }
.hs-fetched { padding: 0 20px 16px; color: var(--text-muted); font-size: 13px; }
.hs-fetched:empty { display: none; }

/* Rankings table */
.hs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hs-table th, .hs-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.hs-table thead th { position: sticky; top: 0; z-index: 1; padding-block: 11px; background: var(--bg-raised); box-shadow: inset 0 -1px var(--line-strong); color: var(--text-muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.hs-table tbody tr { transition: background 120ms ease; }
.hs-table tbody tr:hover { background: var(--hs-row-hover); }
.hs-table .hs-num { text-align: right; white-space: nowrap; }
.hs-rankings td { font-size: 14.5px; }
.hs-rankings tbody tr:last-child td { border-bottom: 0; }
.hs-col-rank { width: 72px; }
.hs-rankings td.hs-col-rank { color: var(--text-muted); font-weight: 650; }
.hs-col-meta { width: 1%; white-space: nowrap; color: var(--text-soft); font-size: 14px; }
.hs-rankings .hs-score { color: var(--text); font-weight: 700; }
.hs-rankings td:not(.hs-num, .hs-col-meta) { width: 99%; }
.hs-rankings tr[data-medal] td:first-child { box-shadow: inset 3px 0 var(--hs-medal); color: var(--hs-medal); font-weight: 800; }
.hs-rankings tr[data-medal="1"] { --hs-medal: var(--gold); background: linear-gradient(90deg, rgba(245, 199, 107, .09), transparent 60%); }
.hs-rankings tr[data-medal="2"] { --hs-medal: var(--hs-silver); }
.hs-rankings tr[data-medal="3"] { --hs-medal: var(--hs-bronze); }
.hs-rankings tr[data-medal="1"] .hs-player-link { color: var(--gold-bright); }
.hs-player { display: grid; gap: 1px; }
.hs-player-meta { display: none; color: var(--text-muted); font-size: 12.5px; }
.hs-player-link { display: inline-flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text); font-weight: 650; text-align: left; cursor: pointer; }
.hs-player-link span { overflow-wrap: anywhere; }
.hs-player-link:hover span { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 3px; }
.hs-player-link:focus-visible { outline-offset: 3px; }
.hs-mode-icon { flex: none; width: auto; height: 13px; }
.hs-mode[data-mode="ironman"] { color: #c7d9e7; }
.hs-mode[data-mode="hardcore"] { color: var(--danger); }
.hs-mode[data-mode="ultimate"] { color: #e3ebf1; }
.hs-mode[data-mode="group"] { color: var(--success); }
.hs-mode[data-mode="lucklocked"] { color: #9ad86f; }
.hs-rank-text[data-medal="1"] { color: var(--gold); font-weight: 800; }
.hs-rank-text[data-medal="2"] { color: var(--hs-silver); font-weight: 800; }
.hs-rank-text[data-medal="3"] { color: var(--hs-bronze); font-weight: 800; }

.hs-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--text-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.hs-pagination-controls { display: flex; align-items: center; gap: 12px; }
.hs-button { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-panel); color: var(--text); font-size: 14px; font-weight: 650; cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.hs-button:hover:not(:disabled) { border-color: var(--blue); background: var(--bg-soft); }
.hs-button:disabled { opacity: .4; cursor: default; }
.hs-button:focus-visible { outline-offset: 2px; }

.hs-message { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; text-align: center; }
.hs-message h3 { font-size: 1.25rem; }
.hs-message p { max-width: 46ch; color: var(--text-soft); }
.hs-message .hs-button { margin-top: 8px; }

.hs-skeleton { display: grid; gap: 1px; padding: 8px 0; }
.hs-skeleton span { height: 44px; margin-inline: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--bg-panel) 0%, var(--bg-soft) 50%, var(--bg-panel) 100%) 0 0 / 200% 100%; opacity: .5; animation: hs-shimmer 1.4s linear infinite; }
@keyframes hs-shimmer { to { background-position: -200% 0; } }

/* Player profile */
.hs-profile { display: grid; gap: 24px; padding: 20px; }
.hs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--line); }
.hs-facts > div { padding: 14px 16px; background: var(--bg-panel); }
.hs-facts dt { color: var(--text-muted); font-size: 13px; font-weight: 650; }
.hs-facts dd { margin: 2px 0 0; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hs-facts .is-rank dd { color: var(--gold); }
.hs-profile-layout { display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); gap: 28px; align-items: start; }
.hs-profile-side { display: grid; gap: 28px; }
.hs-profile-block h3 { margin-bottom: 10px; font-size: 1.1rem; letter-spacing: -.02em; }
.hs-skilltab-profile .hs-skill { justify-content: space-between; padding: 5px 9px 8px; color: var(--text); text-decoration: none; }
.hs-skill-level { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hs-skill.is-99 .hs-skill-level { color: var(--gold); }
.hs-skill.is-empty { cursor: default; color: var(--text-muted); }
.hs-skill-xp { position: absolute; right: 6px; bottom: 4px; left: 6px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.hs-skill-xp::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--xp, 0%); background: var(--blue); }
.hs-skill.is-max .hs-skill-xp::after { background: var(--gold); }
.hs-skill-total { flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; line-height: 1.15; }
.hs-skilltab-profile .hs-skill-total { justify-content: center; }
.hs-total-label { color: var(--text-soft); font-size: 11px; font-weight: 650; }
.hs-skill-total strong { color: var(--gold); font-size: 15px; font-variant-numeric: tabular-nums; }
.hs-profile-table th, .hs-profile-table td { padding: 8px 10px; font-size: 14px; }
.hs-profile-table tbody th { font-weight: 600; }
.hs-profile-table tr.is-total th, .hs-profile-table tr.is-total td { font-weight: 800; }
.hs-record-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.hs-record-link .hs-sprite { max-width: 20px; max-height: 20px; }
.hs-record-link .hs-sprite, .hs-record-link .hs-boss-icon { width: 22px; }
.hs-record-link:hover span:last-child { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 3px; }
.hs-record-link:focus-visible { outline-offset: 2px; }

.hs-footnote { padding-block: 22px 56px; color: var(--text-soft); font-size: 14.5px; }
.hs-footnote a { color: var(--blue-bright); text-decoration: underline; text-decoration-color: rgba(155, 215, 255, .4); text-underline-offset: 3px; }
.hs-footnote a:hover { text-decoration-color: currentColor; }

@media (max-width: 1080px) {
  .hs-board { grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
  .hs-profile-layout { grid-template-columns: minmax(0, 1fr); }
  .hs-profile-side { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; }
}

@media (max-width: 860px) {
  .hs-intro-inner { flex-direction: column; align-items: stretch; gap: 22px; padding-block: 28px 24px; }
  .hs-search { flex-basis: auto; }
  .hs-board { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  .hs-index { position: static; }
  .hs-picker { padding: 0; }
  .hs-picker > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 14px; list-style: none; cursor: pointer; }
  .hs-picker > summary::-webkit-details-marker { display: none; }
  .hs-picker > summary:focus-visible { outline-offset: -3px; }
  .hs-picker[open] > summary { border-bottom: 1px solid var(--line); }
  .hs-picker[open] > :not(summary) { margin: 10px; }
  .hs-picker[open] > .hs-skilltab { margin-top: 10px; }
  .hs-table-region { overflow-x: auto; }
  .hs-table thead th { position: static; }
}

@media (max-width: 640px) {
  .hs-results-head { padding: 16px 14px; }
  .hs-filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .hs-field select { min-width: 0; width: 100%; }
  .hs-clear { grid-column: 1 / -1; justify-self: start; height: auto; padding: 2px 0; }
  .hs-col-meta { display: none; }
  .hs-player-meta { display: block; }
  .hs-table th, .hs-table td { padding-inline: 10px; }
  .hs-rankings td { font-size: 14px; }
  .hs-col-rank { width: 48px; }
  .hs-pagination { padding: 12px 14px; }
  .hs-pagination-controls { width: 100%; justify-content: space-between; }
  .hs-profile { padding: 14px; }
  .hs-facts { grid-template-columns: 1fr 1fr; }
  .hs-facts dd { font-size: 1.25rem; }
  .hs-profile-side { grid-template-columns: minmax(0, 1fr); }
  .hs-profile-table th, .hs-profile-table td { padding-inline: 8px; font-size: 13.5px; }
  .hs-fetched { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-skeleton span { animation: none; }
  .hs *, .hs *::before, .hs *::after { transition: none !important; }
}
