:root {
    color-scheme: dark;
    --bg: #0e0e0e;
    --bg-elevated: #141414;
    --panel: #181818;
    --panel-2: #1f1f1f;
    --panel-hover: #262626;
    --stage-bg: radial-gradient(circle at center, #262626 0%, #121212 85%);
    --line: #2e2e2e;
    --line-strong: #3f3f3f;
    --text: #f2f2f2;
    --muted: #a3a3a3;
    --accent: #ffd16b;
    --accent-hover: #ffe4a8;
    --accent-blue: #53dff1;
    --violet: #53dff1;
    --mint: #10b981;
}
html[data-startup="arena"] .site-shell:not(.router-ready)>:not(#startup-shield):not(noscript) { visibility: hidden; }
.site-shell .page { animation: none; min-width: 0; }
.site-shell #main:focus { outline: none; }
.site-shell #page-name { color: var(--text); }
.site-shell .mode-toggle { min-height: 34px; background: var(--panel-2); border-color: var(--line-strong); color: var(--text); }
.site-shell .mode-toggle:hover { background: var(--panel-hover); border-color: var(--line-strong); color: var(--text); }
.site-shell .state-pill { background: var(--panel-2); border-color: var(--line); color: var(--muted); }
.site-shell .state-pill[data-state=running] { color: #8be1ba; border-color: #3d7662; background: #172e29; }
.site-shell .state-pill[data-state=paused] { color: #ffd16b; border-color: #83643b; background: #2e241b; }
.site-planned { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.site-shell .page-heading { align-items: center; gap: 24px; margin: 0 0 32px; padding: 24px 0 28px; border-bottom: 1px solid var(--line); position: relative; }
.site-shell .page-heading::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 64px; height: 3px; background: var(--accent); }
.site-shell .page-heading h1 { font: 800 clamp(28px, 3.3vw, 44px)/1.17 var(--font-heading); letter-spacing: -1.4px; color: var(--text); margin: 0; }
.site-shell .page-heading p:not(.eyebrow) { max-width: 520px; margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.8; }
.site-shell .eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 2px; margin: 0 0 12px; }
.site-shell .page-heading.compact { padding-top: 8px; margin-bottom: 24px; }
.site-shell .panel, .site-shell .controls-card, .site-shell .play-session-card { background: var(--panel); border-color: var(--line); border-radius: 6px; box-shadow: 0 9px 30px rgba(0,0,0,0.3); }
.site-shell .panel { padding: clamp(20px, 2.4vw, 32px); }
.site-shell .panel h2 { color: var(--text); font: 700 19px/1.4 var(--font-heading); margin-top: 0; }
.site-shell .panel p { color: var(--muted); line-height: 1.85; }
.site-shell .panel a:not(.button), .site-shell .edit-link, .site-shell .hud-config-link { color: var(--accent); }
.site-shell .button { min-height: 44px; border-radius: 6px; font-size: 12px; padding: 12px 20px; transition: background .16s, border-color .16s, color .16s; white-space: normal; text-align: center; }
.site-shell .button.primary { color: #17110a; background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 0 #9a6b37; }
.site-shell .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.site-shell .button.secondary, .site-shell .button.ghost { color: var(--text); background: var(--panel-2); border-color: var(--line-strong); }
.site-shell .button.secondary:hover, .site-shell .button.ghost:hover { background: var(--panel-hover); border-color: var(--accent-blue); color: var(--text); }
.site-shell input[type=search]:not(:where(.app-search input)), .site-shell select { color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 6px; min-height: 44px; }
.site-shell input[type=checkbox], .site-shell input[type=range] { accent-color: var(--accent); }
.site-shell .panel-heading { gap: 16px; flex-wrap: wrap; }
.site-shell .inline-actions { flex-wrap: wrap; gap: 10px; }
.site-shell .two-columns { align-items: start; }
.site-shell .two-columns > *, .site-shell .bindings-grid > *, .site-shell .settings-layout > * { min-width: 0; }
.site-shell .binding-player h3 { color: var(--accent); }
.site-shell .binding-player:nth-child(2) h3 { color: #53dff1; }
.site-shell .binding-row { color: var(--text); border-color: var(--line); min-height: 54px; gap: 16px; }
.site-shell .binding-button { background: var(--panel-2); color: var(--text); border-color: var(--line-strong); min-height: 40px; min-width: 74px; }
.site-shell .binding-button.capturing { color: #17110a; background: var(--accent); border-color: var(--accent); }
.site-shell kbd { color: var(--text); background: var(--panel-2); border-color: var(--line-strong); }
.site-shell .shortcut-list > div { border-color: var(--line); gap: 16px; }
.site-shell .shortcut-list dt { color: var(--text); }
.site-shell .shortcut-list dd { color: var(--muted); overflow-wrap: anywhere; }
.site-shell .settings-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); max-width: none; gap: 24px; align-items: start; }
.site-shell .setting-row { gap: 24px; border-color: var(--line); }
.site-shell .setting-row > div:first-child { min-width: 0; }
.site-shell .setting-row p { font-size: 12px; color: var(--muted); }
.site-shell .setting-row input[type=checkbox] { min-width: 44px; width: 44px; height: 28px; flex: 0 0 auto; background: var(--panel-2); border-color: var(--line-strong); }
.site-shell .setting-row input[type=checkbox]::before { width: 18px; height: 18px; top: 4px; left: 4px; background: var(--muted); }
.site-shell .setting-row input[type=checkbox]:checked { background: #604723; border-color: var(--accent); }
.site-shell .setting-row input[type=checkbox]:checked::before { transform: translateX(16px); background: var(--accent); }
.site-shell .range-control { max-width: 100%; width: 160px; }
.site-shell .range-control input { min-width: 0; min-height: 44px; }
.site-shell .roster-tools { margin-bottom: 28px; }
.site-shell .roster-tools label { color: var(--muted); }
.site-shell .directory-sidebar { position: sticky; top: 24px; background: var(--panel); border-color: var(--line); border-radius: 6px; padding: 20px 12px; }
.site-shell .directory-sidebar h2 { color: var(--muted); font-size: 11px; }
.site-shell .series-filter { color: var(--text); min-height: 44px; }
.site-shell .series-filter:hover { color: var(--accent); background: var(--panel-hover); }
.site-shell .series-filter[aria-pressed=true] { color: var(--accent); border-color: #88623c; background: rgba(255,159,67,.15); }
.site-shell .directory-card { background: var(--panel); border-color: var(--line); border-radius: 6px; box-shadow: none; }
.site-shell .directory-portrait { background: var(--stage-bg); border-color: var(--line); }
.site-shell .directory-series { color: var(--accent); }
.site-shell .directory-card h3 { color: var(--text); }
.site-shell .directory-result-heading p, .site-shell .directory-pagination, .site-shell .directory-empty { color: var(--muted); }
.site-shell .directory-forms summary, .site-shell .roster-guide summary { color: var(--accent); }
.site-shell .directory-card > .directory-note { background: var(--panel-2); border-color: #83643b; color: #ffdc93; }
.site-shell .game-surface { border-color: var(--line-strong); border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,0.6); background: #0c0c0c; }
.site-shell .game-toolbar { background: var(--bg-elevated); border-color: var(--line); color: var(--text); }
.site-shell .icon-button { color: var(--text); background: var(--panel-2); border-color: var(--line-strong); }
.site-shell .icon-button:hover:not(:disabled) { background: var(--panel-hover); border-color: var(--accent); color: var(--text); }
.site-shell .game-action-btn { color: var(--text); background: var(--panel-2); border-color: var(--line-strong); border-radius: 6px; min-height: 44px; }
.site-shell .game-action-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-hover); border-color: var(--line-strong); box-shadow: none; }
.site-shell .game-action-btn.stop-btn { color: #ffb5be; border-color: #7c424d; }
.site-shell .game-action-btn.stop-btn:hover:not(:disabled) { color: #ffdae0; background: #3f2027; border-color: #d2899c; }
.site-shell .game-action-btn.muted { color: var(--muted); }
.site-shell .card-title, .site-shell .hud-heading h3 { color: var(--accent); }
.site-shell .keybind-row { background: var(--panel-2); }
.site-shell .key-caps kbd, .site-shell .hud-key { background: var(--panel-2); color: var(--text); border-color: var(--line-strong); }
.site-shell .key-caps.ulti kbd { background: #49351f; color: #ffe0a1; border-color: #88623c; }
.site-shell .input-hud, .site-shell .virtual-panel, .site-shell .log-panel { background: var(--panel); border-color: var(--line); border-radius: 6px; }
.site-shell .hud-player { color: var(--accent); }
.site-shell .hud-player.p2 { color: #53dff1; }
.site-shell .hud-key.pressed { background: var(--accent); color: #141414; border-color: #ffe7ab; }
.site-shell .hud-key.p2.pressed { background: #53dff1; color: #141414; border-color: #a5f3fc; }
.site-shell .hud-toggle-btn { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.site-shell .hud-toggle-btn:hover { background: var(--panel-hover); border-color: var(--line-strong); }
.site-shell .footer-ver { color: #ffdb8f; background: #2b2219; border-color: #775236; border-radius: 3px; }
.site-shell :is(#online-quick-slot, #online-ranked-slot) { min-width: 0; }
.site-shell .online-access-loading { margin-top: 16px; }
.site-shell .online-access-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.site-shell .online-access-progress .online-quick-spinner { flex: none; }
.site-shell .online-access-skeleton .v2-stage { background: var(--panel-hover); }
.site-shell .online-access-skeleton .online-placeholder-label { display: block; width: 52%; height: 14px; margin: 20px; border-radius: 4px; background: var(--panel-hover); }
.site-shell .online-room-buttons, .site-shell :is(#online-quick-slot, #online-ranked-slot) .online-quick-actions { margin: auto 20px 20px; }
.site-shell .online-room-buttons { display: grid; gap: 8px; }
.site-shell .online-room-buttons .v2-button, .site-shell :is(#online-quick-slot, #online-ranked-slot) .online-quick-actions .v2-button { width: 100%; margin: 0; }
.site-shell .online-room-code summary { list-style: none; cursor: pointer; }
.site-shell .online-room-code summary::-webkit-details-marker { display: none; }
.site-shell .online-room-choice { display: grid; gap: 7px; padding-top: 10px; }
.site-shell .online-room-choice label { color: var(--muted); }
.site-shell .online-room-join { display: flex; flex-wrap: wrap; gap: 8px; }
.site-shell .online-room-join .button { flex: 1 0 auto; }
.site-shell #online-join-code { flex: 1 1 9rem; box-sizing: border-box; width: 100%; min-width: 0; padding: 8px 10px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 6px; font: 700 1.15rem/1.2 ui-monospace, monospace; letter-spacing: .25em; text-align: center; }
.site-shell #online-join-error { margin: 0; color: #ffb4a8; }
.site-shell .roadmap-steps { justify-content: center; margin-block: 28px; }
.site-shell .roadmap-step { border-radius: 3px; color: var(--text); background: var(--panel-2); border-color: var(--line-strong); line-height: 1.6; }
.site-shell .roadmap-step.done { color: #b1dfc7; background: #192b26; border-color: #3d6557; }
.site-shell .roadmap-step.active { color: #ffdb8f; background: #2e2319; border-color: #80603a; }
.site-shell .site-footer { position: relative; z-index: 21; background: var(--bg-elevated); border-top: 1px solid var(--line); padding: 6px clamp(20px, 4vw, 64px); gap: 12px; flex-wrap: wrap; backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-shell .footer-brand { color: var(--text); }
.site-shell .footer-center, .site-shell .footer-status { display: none; }
.site-shell .footer-right, .site-shell .footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-shell .footer-link { color: var(--muted); min-height: 36px; display: inline-flex; align-items: center; }
.site-shell .footer-link:hover, .site-shell .footer-link.active { color: var(--accent); }
.site-shell .toast { background: var(--panel); color: var(--text); border-color: #ff9f43; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

@media (max-width: 900px) {
    .site-shell .settings-layout { grid-template-columns: 1fr; }
    .site-shell .settings-layout .panel { margin-bottom: 0; }
}
@media (max-width: 700px) {
    .site-shell .page-heading { align-items: flex-start; flex-direction: column; padding: 20px 0 24px; gap: 16px; }
    .site-shell .page-heading h1 { font-size: 30px; letter-spacing: -1px; }
    .site-shell .directory-sidebar { position: static; padding: 16px 12px; }
    .site-shell .mode-toggle { font-size: 10px; padding: 6px 8px; }
    .site-shell .state-pill { font-size: 10px; }
    .site-shell .panel-heading { align-items: flex-start; }
    .site-shell .shortcut-list > div { flex-wrap: wrap; }
    .site-shell .shortcut-list dd { flex: 1 1 180px; margin: 0; }
}
@media (max-width: 480px) {
    .site-shell .setting-row { flex-wrap: wrap; gap: 12px; }
    .site-shell .setting-row > div:first-child { flex: 1 1 190px; }
    .site-shell .range-control { width: 100%; }
    .site-shell .directory-grid { gap: 12px; }
    .site-shell .directory-portrait { height: 140px; padding: 18px; }
    .site-shell .roster-tools > div { flex: 1 1 100%; }
    .site-shell .roster-tools .roster-availability { line-height: 1.7; }
    .site-shell .panel { padding: 20px 16px; }
    .site-shell .site-footer { padding: 5px 16px; gap: 4px; }
    .site-shell .footer-left { flex-wrap: wrap; }
    .site-shell .footer-right, .site-shell .footer-nav { gap: 18px; }
    .site-shell .p2-note { white-space: normal; }
    .site-shell .under-game { gap: 8px; }
    .site-shell .hud-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
    .site-shell .hud-heading-actions { width: 100%; justify-content: space-between; }
    .site-shell .hud-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
    .site-shell .hud-player { grid-column: 1 / -1; }
    .site-shell .hud-key { min-width: 0; }
    .site-shell .hud-key:nth-of-type(5) { margin-left: 0; }
    .site-shell .game-action-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .site-shell *, .site-shell *::before, .site-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root .published-announcements { color:var(--text,#f2f2f2); background:var(--panel,#181818); border:1px solid var(--line,#2e2e2e); border-radius:8px; padding:20px; width:min(680px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; }
.published-announcements::backdrop { background:rgba(0,0,0,.75); }
.published-announcements header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.published-announcements h2 { font-size:24px; margin:0; }
.published-announcements article { border-top:1px solid var(--line,#2e2e2e); padding:16px 0; }
.published-announcements h3 { font-size:18px; }
.published-announcements .announcement-meta { color:var(--muted,#a3a3a3); font-size:13px; }
.published-announcements .announcement-body { white-space:pre-wrap; overflow-wrap:anywhere; }
.published-announcements button { color:inherit; background:var(--panel-2,#1f1f1f); border:1px solid var(--line,#2e2e2e); border-radius:6px; padding:8px 12px; }
.footer-nav button.footer-link { background:none; border:0; padding:0; font:inherit; color:inherit; cursor:pointer; }
.sidebar-announcements { display:block; margin:12px 16px; padding:12px; background:var(--panel-2,#1f1f1f); color:var(--text,#f2f2f2); border:1px solid var(--line,#2e2e2e); border-radius:6px; text-align:left; cursor:pointer; }
.site-shell .online-access-note { max-width: 620px; margin: 24px auto 0; padding: 14px 18px; border: 1px solid rgba(255,159,67,.45); border-radius: 12px; background: rgba(255,159,67,.1); color: var(--text, inherit); }
.site-shell .online-access-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.site-shell .online-access-actions:has(:not([hidden])) { margin-top: 12px; }
.site-shell :is(#online-quick-slot, #online-ranked-slot) :is(.online-quick-hint, .online-quick-counts, .online-quick-search) { margin: 0 20px 12px; }
.site-shell :is(#online-quick-slot, #online-ranked-slot) .online-quick-actions { padding-top: 14px; }
.site-shell #online-desktop-only { text-align: center; }
.site-shell .online-quick:not(.v2-mode-card) { padding: 20px; border-radius: 16px; border: 1px solid rgba(255,159,67,.45); background: linear-gradient(135deg, rgba(255,159,67,.14), rgba(255,159,67,.03)); }
.site-shell .online-quick-head { display: flex; align-items: center; gap: 10px; }
.site-shell .online-quick-head h3 { margin: 0; }
.site-shell .online-beta { padding: 2px 8px; border-radius: 999px; background: #ff9f43; color: #1b1208; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.site-shell .online-heading .online-beta {
    display: inline-block;
    vertical-align: middle;
    margin-inline-start: 6px;
    padding: 4px 8px;
    border: 1px solid #78532b;
    background: #2c2117;
    color: #ffd18b;
    line-height: 1.15;
    letter-spacing: .025em;
}
.site-shell .online-quick-hint { margin: 6px 0 0; color: var(--muted, #b9b9c6); }
.site-shell .online-quick-counts { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 800; color: #ffd08a; }
.site-shell .online-quick-counts[hidden] { display: none; }
.site-shell .online-quick-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: online-quick-pulse 2s ease-out infinite; }
@keyframes online-quick-pulse { 70% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
@media (prefers-reduced-motion: reduce) { .site-shell .online-quick-dot { animation: none; } }
.site-shell .online-quick-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.site-shell .online-quick-spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,159,67,.25); border-top-color: #ff9f43; animation: online-quick-spin .8s linear infinite; }
@keyframes online-quick-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .site-shell .online-quick-spinner { animation-duration: 3s; } }
.site-shell .online-quick-timer { font: 800 15px/1 'JetBrains Mono', Consolas, monospace; color: #ffd08a; }
.site-shell .online-quick-note { flex-basis: 100%; color: var(--muted, #b9b9c6); }
.site-shell .online-quick-actions { display: flex; gap: 10px; margin-top: 14px; }
/* Quick Match */
dialog.qm-stage-host,
#remote-versus-dialog[data-mode="quick"] {
    box-sizing: border-box;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: clamp(12px, 3vw, 32px);
    border: 0;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: var(--text, #f2f2f2);
    overflow: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
}
dialog.qm-stage-host[open],
#remote-versus-dialog[data-mode="quick"][open] {
    display: grid;
}
dialog.qm-stage-host::backdrop,
#remote-versus-dialog[data-mode="quick"]::backdrop {
    background: rgb(10 10 10 / 0.63);
    backdrop-filter: grayscale(0.75) blur(7px);
}
.qm-stage {
    box-sizing: border-box;
    width: 100%;
    max-width: 56rem;
    margin: auto;
    color: var(--text, #f2f2f2);
    text-align: center;
}

.qm-arena {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(12px, 4vw, 46px);
}
.qm-card {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    min-width: 0;
    padding: clamp(12px, 2.5vw, 24px) clamp(10px, 2vw, 20px);
    border: 1px solid var(--line, #2e2e2e);
    border-radius: 12px;
    background: rgb(24 24 24 / 0.94);
}
.qm-card[data-side="me"] { border-color: rgb(255 179 64 / 0.4); }
.qm-card-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted, #a3a3a3);
    font-size: 0.76rem;
    font-weight: 700;
}
.qm-card[data-side="me"] .qm-card-tab { color: #ffd16b; }
.qm-card-tab-icon { width: 13px; height: 13px; display: inline-flex; }
.qm-card-tab-icon svg { width: 100%; height: 100%; }
.qm-name-row {
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.qm-name {
    font-size: clamp(0.96rem, 2vw, 1.3rem);
    font-weight: 800;
    color: var(--text, #f2f2f2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
.qm-rank {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.qm-rank-icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: #9ca3af;
}
.qm-rank-icon svg { width: 100%; height: 100%; display: block; }
.qm-rank-pill {
    color: #e5e7eb;
    font-size: 0.75rem;
    font-weight: 700;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.qm-rank[data-tier="bronze"] .qm-rank-icon { color: #d97742; }
.qm-rank[data-tier="bronze"] .qm-rank-pill { color: #f6b992; }
.qm-rank[data-tier="silver"] .qm-rank-icon { color: #cbd5e1; }
.qm-rank[data-tier="silver"] .qm-rank-pill { color: #e2e8f0; }
.qm-rank[data-tier="gold"] .qm-rank-icon { color: #fbbf24; }
.qm-rank[data-tier="gold"] .qm-rank-pill { color: #fde68a; }
.qm-rank[data-tier="platinum"] .qm-rank-icon { color: #67e8f9; }
.qm-rank[data-tier="platinum"] .qm-rank-pill { color: #bae6fd; }
.qm-rank[data-tier="diamond"] .qm-rank-icon { color: #a78bfa; }
.qm-rank[data-tier="diamond"] .qm-rank-pill { color: #ddd6fe; }
.qm-rank[data-tier="master"] .qm-rank-icon { color: #fb7185; }
.qm-rank[data-tier="master"] .qm-rank-pill { color: #fecdd3; }
.qm-rank[data-tier="unranked"] .qm-rank-icon { color: #d4a45a; }
.qm-rank[data-tier="unranked"] .qm-rank-pill { color: #f6d496; }

.qm-metric {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 7px;
    min-width: 0;
}
.qm-flag {
    flex: none;
    display: inline-flex;
    width: 20px;
    height: 14px;
}
.qm-flag[hidden] { display: none; }
.qm-flag-svg { width: 100%; height: 100%; display: block; border-radius: 2px; }
.qm-metric-label {
    font-size: 0.75rem;
    color: var(--muted, #a3a3a3);
}
.qm-metric-value {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text, #f2f2f2);
    font-variant-numeric: tabular-nums;
}
.qm-metric-ping { --qm-ping-color: #9ca3af; }
.qm-metric-ping[data-level="4"] { --qm-ping-color: #4ade80; }
.qm-metric-ping[data-level="3"] { --qm-ping-color: #a3e635; }
.qm-metric-ping[data-level="2"] { --qm-ping-color: #fbbf24; }
.qm-metric-ping[data-level="1"] { --qm-ping-color: #f87171; }
.qm-metric-ping[data-level="1"] .qm-metric-value,
.qm-metric-ping[data-level="2"] .qm-metric-value,
.qm-metric-ping[data-level="3"] .qm-metric-value,
.qm-metric-ping[data-level="4"] .qm-metric-value { color: var(--qm-ping-color); }
.qm-ping-bars {
    flex: none;
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}
.qm-ping-bars i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, 0.18); }
.qm-ping-bars i:nth-child(1) { height: 30%; }
.qm-ping-bars i:nth-child(2) { height: 54%; }
.qm-ping-bars i:nth-child(3) { height: 78%; }
.qm-ping-bars i:nth-child(4) { height: 100%; }
.qm-metric-ping[data-level="1"] .qm-ping-bars i:nth-child(-n+1),
.qm-metric-ping[data-level="2"] .qm-ping-bars i:nth-child(-n+2),
.qm-metric-ping[data-level="3"] .qm-ping-bars i:nth-child(-n+3),
.qm-metric-ping[data-level="4"] .qm-ping-bars i { background: var(--qm-ping-color); }

/* Readiness sits below each player?s details. */
.qm-ready-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #d1d5db;
    font-size: 0.84rem;
    font-weight: 700;
}
.qm-ready-pill[data-state="ready"] {
    color: #86efac;
}
.qm-ready-pill[data-state="ready"] .qm-ready-icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4ade80;
    color: #082714;
}
.qm-ready-pill[data-state="failed"] {
    color: #fecaca;
}
.qm-ready-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; }
.qm-ready-icon svg { width: 13px; height: 13px; }
.qm-mini-spin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px dotted #f5b953;
    animation: qm-spin 2.2s linear infinite;
}

/* Center 30s segmented SVG countdown ring */
.qm-center {
    display: grid;
    place-items: center;
}
.qm-ring-wrap {
    position: relative;
    width: clamp(8rem, 18vw, 11rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(255 176 56 / 0.13), transparent 70%);
}
.qm-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.qm-ring-bg { fill: rgb(18 18 18 / 0.88); }
.qm-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 11;
}
.qm-ring-progress {
    fill: none;
    stroke: #ffb33f;
    stroke-width: 11;
    stroke-linecap: butt;
    transition: stroke-dashoffset 0.16s linear, stroke 0.2s ease;
}
.qm-ring-segments {
    fill: none;
    stroke: #121212;
    stroke-width: 13.5;
    stroke-dasharray: 3.4 25.92;
}
.qm-center[data-qm-ring-state="urgent"] .qm-ring-progress {
    stroke: #f87171;
}
.qm-center[data-qm-ring-state="urgent"] .qm-ring-value { color: #fca5a5; }
.qm-ring-spinner { display: none; }
.qm-center[data-qm-ring-state="connecting"] .qm-ring-svg { visibility: hidden; }
.qm-center[data-qm-ring-state="connecting"] .qm-ring-spinner {
    display: block;
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background: conic-gradient(from 0turn, #ffbb57, #ffc87a 0.6turn, #ffb044 0.74turn, #393027 0.74turn);
    mask: radial-gradient(farthest-side, transparent 82%, #000 83%);
    will-change: transform;
    animation: qm-spin 1.8s linear infinite;
}
.qm-center[data-qm-ring-state="ready"] .qm-ring-progress {
    stroke: #4ade80;
}
.qm-center[data-qm-ring-state="ready"] .qm-ring-icon,
.qm-center[data-qm-ring-state="ready"] .qm-ring-value { color: #86efac; }
.qm-center[data-qm-ring-state="failed"] .qm-ring-progress {
    stroke: #ef4444;
}
.qm-center[data-qm-ring-state="failed"] .qm-ring-icon,
.qm-center[data-qm-ring-state="failed"] .qm-ring-value { color: #fca5a5; }
.qm-ring-inner {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 2px;
}
.qm-ring-icon { width: 20px; height: 20px; color: #ffd16b; }
.qm-ring-icon svg { width: 100%; height: 100%; display: block; }
.qm-ring-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #fff6df;
    font-variant-numeric: tabular-nums;
}
.qm-center:is([data-qm-ring-state="connecting"], [data-qm-ring-state="ready"], [data-qm-ring-state="failed"]) .qm-ring-value {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Ready check actions */
.qm-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}
.qm-actions[hidden] { display: none; }
.qm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 10px;
    font: 800 0.96rem/1 system-ui, sans-serif;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.qm-btn:focus-visible { outline: 2px solid #ffd16b; outline-offset: 2px; }
.qm-btn-icon, .qm-btn-trail { width: 18px; height: 18px; display: inline-flex; }
.qm-btn-icon svg, .qm-btn-trail svg { width: 100%; height: 100%; }
.qm-btn-trail[hidden] { display: none; }
.qm-btn-accept {
    min-width: 204px;
    border: 1px solid #ffe08a;
    background: linear-gradient(180deg, #ffce59 0%, #f59e0b 58%, #d97706 100%);
    color: #1b1206;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.qm-btn-accept:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.qm-btn-accept:active:not(:disabled) { transform: translateY(0); }
.qm-btn-accept[data-accepted="true"] {
    border-color: rgba(74, 222, 128, 0.5);
    background: linear-gradient(180deg, rgba(22, 101, 52, 0.82), rgba(20, 83, 45, 0.92));
    color: #dcfce7;
    box-shadow: none;
    cursor: default;
}
.qm-btn-accept:disabled:not([data-accepted="true"]) { opacity: 0.65; cursor: progress; }
.qm-btn-cancel {
    min-width: 124px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(24, 26, 33, 0.9);
    color: #e5e7eb;
}
.qm-btn-cancel:hover:not(:disabled) { border-color: rgba(248, 113, 113, 0.55); background: rgba(127, 29, 29, 0.35); color: #fecaca; }
.qm-btn-cancel:disabled { opacity: 0.45; cursor: not-allowed; }

.qm-status {
    margin: 14px auto 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #e5e7eb;
    min-height: 1.3em;
}
.qm-status[hidden] { display: none; }
.qm-stage:not([data-private-room]):is([data-stage="found"], [data-stage="route"], [data-stage="connect"], [data-stage="ready"]) .qm-status {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@keyframes qm-spin { to { transform: rotate(360deg); } }

@media (max-width: 660px) {
    .qm-arena {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        align-items: stretch;
    }
    .qm-center { grid-column: 1 / -1; grid-row: 1; }
    .qm-ring-wrap { width: 7.5rem; }
    .qm-ring-value { font-size: 1.7rem; }
    .qm-card { gap: 10px; }
}
@media (max-height: 480px) {
    .qm-stage { padding-block: 12px; }
    .qm-ring-wrap { width: 7rem; }
    .qm-actions { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .qm-mini-spin,
    .qm-center[data-qm-ring-state="connecting"] .qm-ring-spinner { animation: none; }
    .qm-ring-progress { transition: none !important; }
}

/* Donate page */
.site-shell .donate-page .page-heading { margin-bottom: 24px; }
.site-shell .donate-page [data-donate-subtitle] { max-width: 680px; white-space: pre-line; font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.site-shell .donate-layout { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(300px, .92fr); gap: 20px; align-items: stretch; }
.site-shell .donate-hero-card,
.site-shell .donate-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #141518 0%, #101114 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
}
.site-shell .donate-hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 520px;
    padding: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 36px);
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 209, 107, .12) 0%, rgba(255, 209, 107, .03) 34%, transparent 64%),
        radial-gradient(circle at 18% 92%, rgba(255, 196, 84, .1) 0%, transparent 45%),
        radial-gradient(circle at 86% 90%, rgba(255, 196, 84, .09) 0%, transparent 46%),
        linear-gradient(180deg, #131417 0%, #0f1013 100%);
}
.site-shell .donate-hero-card::before,
.site-shell .donate-hero-card::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    border: 1px solid rgba(255, 209, 107, .08);
}
.site-shell .donate-hero-card::before {
    width: 440px;
    height: 440px;
    left: -130px;
    bottom: -190px;
}
.site-shell .donate-hero-card::after {
    width: 390px;
    height: 390px;
    right: -130px;
    bottom: -170px;
}
.site-shell .donate-qr-showcase {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}
.site-shell .donate-qr-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.site-shell .donate-qr-tab {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s;
}
.site-shell .donate-qr-tab:hover { color: var(--text); border-color: rgba(255, 209, 107, .35); }
.site-shell .donate-qr-tab.is-active {
    background: rgba(255, 209, 107, .14);
    border-color: rgba(255, 209, 107, .55);
    color: var(--accent);
}
.site-shell .donate-qr-frame {
    padding: 16px;
    border: 0;
    border-radius: 20px;
    background: #fff;
    cursor: zoom-in;
    box-shadow: 0 0 46px rgba(255, 209, 107, .24), 0 18px 40px rgba(0, 0, 0, .55);
    transition: transform .18s ease, box-shadow .18s ease;
}
.site-shell .donate-qr-frame:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 56px rgba(255, 209, 107, .34), 0 22px 46px rgba(0, 0, 0, .6);
}
.site-shell .donate-qr-frame img {
    display: block;
    width: min(296px, 68vw);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
}
.site-shell .donate-scan-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 24px;
    border-radius: 999px;
    border: 1px solid rgba(255, 209, 107, .48);
    background: linear-gradient(180deg, rgba(255, 209, 107, .12), rgba(255, 209, 107, .04));
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(255, 209, 107, .12);
    transition: background .16s, border-color .16s, transform .16s, box-shadow .16s;
}
.site-shell .donate-scan-pill:hover {
    background: linear-gradient(180deg, rgba(255, 209, 107, .2), rgba(255, 209, 107, .08));
    border-color: rgba(255, 209, 107, .75);
    box-shadow: 0 0 28px rgba(255, 209, 107, .22);
    transform: translateY(-1px);
}
.site-shell .donate-scan-icon { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.site-shell .donate-accounts-strip,
.site-shell .donate-links-strip {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.site-shell .donate-section-label {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.site-shell .donate-account-list { display: flex; flex-direction: column; gap: 10px; }
.site-shell .donate-account {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
}
.site-shell .donate-bank { display: block; color: var(--accent); font-size: 13px; }
.site-shell .donate-number-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.site-shell .donate-number { font: 800 1.08rem/1.25 'JetBrains Mono', Consolas, monospace; letter-spacing: .04em; user-select: all; color: var(--text); }
.site-shell .donate-copy { padding: 5px 12px; min-height: 32px; font-size: 12px; border-radius: 8px; }
.site-shell .donate-holder,
.site-shell .donate-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.site-shell .donate-link-list { display: flex; flex-wrap: wrap; gap: 10px; }
.site-shell .donate-empty-note { position: relative; z-index: 1; margin: 0; color: var(--muted); }

.site-shell .donate-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.site-shell .donate-card { padding: 18px 20px; }
.site-shell .donate-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    background: rgba(255, 209, 107, .09);
    border: 1px solid rgba(255, 209, 107, .22);
}
.site-shell .donate-icon-box svg { width: 22px; height: 22px; }
.site-shell .donate-icon-box.small { width: 34px; height: 34px; border-radius: 10px; }
.site-shell .donate-icon-box.small svg { width: 17px; height: 17px; }

.site-shell .donate-total-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background:
        radial-gradient(circle at 92% 95%, rgba(255, 209, 107, .18) 0%, transparent 52%),
        linear-gradient(180deg, #15161a 0%, #101114 100%);
}
.site-shell .donate-total-body { min-width: 0; }
.site-shell .donate-card-label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.site-shell .donate-total-value {
    margin: 4px 0 0;
    font: 800 clamp(22px, 2.2vw, 28px)/1.15 var(--font-heading);
    letter-spacing: -.02em;
    color: var(--accent);
}
.site-shell .donate-vnd { text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }

.site-shell .donate-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.site-shell .donate-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.site-shell .donate-card-title {
    margin: 0;
    font: 700 15px/1.3 var(--font-heading);
    color: var(--text);
}
.site-shell .donate-goal-pct {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
}
.site-shell .donate-goal-amounts {
    margin: 14px 0 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    font-size: 15px;
}
.site-shell .donate-goal-current { font-weight: 800; font-size: 16px; color: var(--accent); }
.site-shell .donate-goal-sep,
.site-shell .donate-goal-target { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.site-shell .donate-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #23252b;
    overflow: hidden;
}
.site-shell .donate-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e5a938 0%, #ffd875 100%);
    transition: width .35s ease;
}

.site-shell .donate-supporters-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}
.site-shell .donate-supporters-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.site-shell .donate-supporter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.site-shell .donate-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
    border: 1.5px solid rgba(255, 255, 255, .18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.site-shell .donate-supporter-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.site-shell .donate-supporter-name {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-shell .donate-supporter-amount {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.3;
}
.site-shell .donate-supporter-money { color: var(--accent); font-weight: 700; }
.site-shell .donate-supporter-note {
    font-size: 11.5px;
    color: #8b8f99;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-shell .donate-supporter-time {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    font-size: 11.5px;
    color: #7e838e;
    white-space: nowrap;
}
.site-shell .donate-supporters-empty {
    margin: 18px 0 4px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 18px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .02);
    border: 1px dashed rgba(255, 255, 255, .08);
}
.site-shell .donate-more-btn {
    margin-top: 16px;
    width: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, border-color .16s;
}
.site-shell .donate-more-btn:hover {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 209, 107, .3);
}
.site-shell .donate-more-icon { width: 15px; height: 15px; color: var(--muted); }

.site-shell .donate-zoom {
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    max-width: min(92vw, 480px);
    max-height: 92dvh;
    overflow: visible;
}
.site-shell .donate-zoom::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(4px); }
.site-shell .donate-zoom-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    background: #16171b;
    border: 1px solid rgba(255, 209, 107, .28);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .75);
}
.site-shell .donate-zoom-box img {
    display: block;
    width: min(76vw, 400px);
    max-height: min(68dvh, 420px);
    height: auto;
    object-fit: contain;
    background: #fff;
    padding: 12px;
    border-radius: 14px;
}
.site-shell .donate-zoom-label { margin: 0; font-weight: 700; color: var(--accent); font-size: 14px; }
.site-shell .donate-zoom-close { min-height: 36px; padding: 6px 18px; }

@media (max-width: 960px) {
    .site-shell .donate-layout { grid-template-columns: 1fr; }
    .site-shell .donate-hero-card { min-height: 0; padding: 28px 20px; }
}
@media (max-width: 480px) {
    .site-shell .donate-card { padding: 16px; }
    .site-shell .donate-qr-frame { padding: 12px; border-radius: 16px; }
    .site-shell .donate-qr-frame img { width: min(240px, 74vw); }
    .site-shell .donate-scan-pill { width: 100%; }
}
.online-update-dialog {
    width: min(30rem, calc(100% - 2rem));
    padding: 24px;
    color: var(--text, #f2f2f2);
    background: #181818;
    border: 1px solid #383838;
    border-radius: 10px;
}
.online-update-dialog::backdrop { background: #000b; }
.online-update-dialog h2 { margin: 0; font-size: 1.25rem; }
.online-update-dialog p { margin: 12px 0 20px; color: var(--muted, #a3a3a3); }
.unranked-board {
    --board-line: var(--line-strong);
    --board-gold: var(--accent);
    --board-score: var(--accent);
    width: min(100%, 1540px);
    margin-inline: auto;
    padding-bottom: 26px;
    container: leaderboard / inline-size;
    font-variant-numeric: tabular-nums;
}
.board-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.board-title h1 {
    margin: 0;
    font: 800 clamp(28px, 3.3vw, 44px)/1.17 var(--font-heading);
    letter-spacing: -1.4px;
    color: var(--text);
}
.board-heading p { margin: 7px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.board-title [data-board-copy="sample"] { color: var(--board-score); font-size: .8rem; font-weight: 650; }
.board-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 26px; margin-block: 23px 0; }
.board-modes { display: inline-flex; gap: 4px; }
.board-toolbar :is(button, select, input) { color: var(--text); }
.board-toolbar :is(button, select), .board-search {
    min-height: 44px;
    border: 1px solid var(--board-line);
    border-radius: 10px;
    background: linear-gradient(145deg, #181818, #141414);
}
.board-modes button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 6px clamp(12px, 2.3vw, 32px);
    font-weight: 700;
    white-space: nowrap;
}
.board-modes button[aria-pressed="true"] {
    border-color: var(--board-gold);
    background: linear-gradient(145deg, #342718, #201b15);
    box-shadow: inset 0 0 9px #ffbc4c45, 0 0 10px #ffb74617;
}
.board-modes button[aria-pressed="true"] svg { color: var(--board-gold); }
.board-modes button:disabled { color: #a9a9a9; opacity: 1; cursor: default; }
.board-toolbar svg { flex-shrink: 0; width: 19px; height: 19px; }
.board-period { position: relative; width: clamp(156px, 16vw, 230px); padding-inline-start: 26px; }
.board-period::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--board-line); }
.board-period svg { position: absolute; inset: 0 auto 0 40px; margin-block: auto; color: #a3a3a3; pointer-events: none; }
.board-period select { width: 100%; padding: 0 10px 0 39px; color: #c2c2c2; opacity: 1; }
.board-search { display: flex; align-items: center; gap: 10px; flex: 0 1 368px; margin-inline-start: auto; padding: 0 14px; }
.board-search svg { color: #a3a3a3; }
.unranked-board .board-search input[type="search"] { width: 100%; min-width: 0; min-height: 41px; padding: 0; background: transparent; border: 0; outline: 0; }
.board-search input::placeholder { color: #a3a3a3; }
.board-search:focus-within { border-color: var(--board-gold); box-shadow: 0 0 0 2px #ffbd4c25; }
.unranked-board :is(button, summary):focus-visible { outline: 2px solid var(--board-gold); outline-offset: 3px; }

.board-podium {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(12px, 1.7vw, 28px);
    margin-block: clamp(24px, 2.5vw, 31px);
}
.board-podium:has(:only-child.board-podium-card) { grid-template-columns: minmax(0, 1fr); }
.board-podium:has([data-rank="3"]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.07fr) minmax(0, 1fr); }
.board-podium:has([data-rank="3"]) [data-rank="1"] { grid-area: 1 / 2; }
.board-podium:has([data-rank="3"]) [data-rank="2"] { grid-area: 1 / 1; }
.unranked-board [data-rank="1"] { --medal: var(--board-gold); --rank-tint: #ffbd4c; }
.unranked-board [data-rank="2"] { --medal: #e0e0e0; --rank-tint: #ababab; }
.unranked-board [data-rank="3"] { --medal: #ffac74; --rank-tint: #e9945e; }
.board-podium-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(10px, 1.7vw, 28px);
    min-height: 102px;
    padding: 12px clamp(12px, 2.15vw, 36px);
    border: 1px solid color-mix(in srgb, var(--medal) 70%, #212121);
    border-radius: 10px;
    background: var(--panel);
}
.board-podium-card[data-rank="1"] {
    min-height: 109px;
    border-color: var(--medal);
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.board-podium-medal { display: flex; align-items: center; color: var(--medal); }
.board-podium-medal::after { content: ""; width: 1px; height: 25px; margin-inline-start: clamp(7px, 1.25vw, 20px); background: #ffffff32; }
.board-podium-card h2 { margin: 0 0 6px; font: 700 clamp(16px, 1.45vw, 20px)/1.35 var(--font-heading); overflow-wrap: anywhere; }
.board-podium-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px clamp(8px, 1.5vw, 24px); font-size: .95rem; }
.board-podium-stats > span { display: flex; align-items: center; gap: 6px; }
.board-podium-stats svg { flex-shrink: 0; width: .88em; height: .88em; color: var(--medal); }
.board-podium-stats strong { margin-inline-start: auto; color: var(--board-score); border-inline-start: 1px solid #ffffff32; padding-inline-start: clamp(8px, 2.25vw, 36px); white-space: nowrap; }

.board-medal {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 1.4em;
    height: 1.5em;
    vertical-align: middle;
    color: var(--medal);
    font-size: 1.56rem;
    line-height: 1;
    font-weight: 800;
}
.board-podium .board-medal { font-size: clamp(1.72rem, 2.6vw, 2.5rem); }
.unranked-board tbody .board-medal { font-size: inherit; }
.board-podium [data-rank="1"] .board-medal { margin-top: .2em; }
.board-medal-crown { display: none; }
.board-podium [data-rank="1"] .board-medal-crown { display: block; position: absolute; top: -.42em; width: .82em; height: .82em; }

.unranked-board-panel { margin-block: 24px; border: 1px solid var(--board-line); border-radius: 11px; background: #131313; overflow: hidden; }
.board-podium:not([hidden]) + .unranked-board-panel { margin-block-start: 0; }
.unranked-board-panel > p { margin: 0; padding: 16px; color: #c6c6c6; }
.unranked-board-panel > button { margin: 0 16px 16px; }
.unranked-board table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: clamp(.9rem, 1.05vw, 1rem); }
.unranked-board :is(th, td) { padding: 9px clamp(8px, 1.7vw, 28px); text-align: end; line-height: 1.22; }
.unranked-board :is(th, td):first-child { width: 8%; min-width: 52px; padding-inline: 3px; text-align: center; }
.unranked-board :is(th, td):nth-child(2) { text-align: start; overflow-wrap: anywhere; }
.unranked-board thead th { background: #191919; color: #ddd; font-size: .95rem; font-weight: 550; padding-block: 13px; }
.unranked-board thead th:nth-child(n+3) { width: 14%; }
.unranked-board thead th:last-child { width: 12%; }
.unranked-board tbody tr { border-top: 1px solid #ffffff16; }
.unranked-board tbody [data-rank] { background: color-mix(in srgb, var(--rank-tint, transparent) 10%, transparent); }
.unranked-board tbody :is(th, td) { height: 40px; }
.unranked-board tbody :is([data-rank="1"], [data-rank="2"], [data-rank="3"]) :is(th, td) { height: 45px; }
.unranked-board tbody th { color: var(--text); font-weight: 700; }
.unranked-board tbody td:first-child { padding-block: 0; }
.unranked-board tbody td:nth-child(3) { overflow-wrap: anywhere; }
.unranked-board tbody td:nth-child(n+4) { white-space: nowrap; }
.unranked-board td:last-child { color: var(--board-score); font-weight: 750; }
.board-scoring { border: 1px solid var(--board-line); border-radius: 10px; background: #171717; }
.board-scoring summary { display: flex; align-items: center; gap: 13px; cursor: pointer; padding: 14px 19px; list-style: none; border-radius: inherit; }
.board-scoring summary::-webkit-details-marker { display: none; }
.board-scoring summary::before {
    content: "";
    flex: 0 0 auto;
    border: 6px solid transparent;
    border-left: 10px solid currentColor;
    border-right: 0;
}
.board-scoring[open] summary::before { transform: rotate(90deg); }
.board-scoring-title { font-size: 1.08rem; font-weight: 750; }
.board-scoring-summary { border-inline-start: 1px solid var(--board-line); padding-inline-start: 18px; color: #c1c1c1; }
.board-scoring p { margin: 0 19px 14px; padding-top: 12px; border-top: 1px solid var(--board-line); color: #c1c1c1; line-height: 1.55; }

@media (max-height: 930px) and (min-width: 850px) {
    .board-toolbar { margin-top: 19px; }
    .board-podium { margin-block: 24px; }
    .unranked-board-panel { margin-block-end: 20px; }
    .unranked-board tbody :is(th, td) { height: 37px; padding-block: 7px; }
    .unranked-board tbody td:first-child { padding-block: 0; }
    .unranked-board tbody :is([data-rank="1"], [data-rank="2"], [data-rank="3"]) :is(th, td) { height: 42px; }
}
@container leaderboard (max-width: 930px) {
    .board-toolbar { gap: 10px 18px; }
    .board-search { flex-basis: 255px; }
    .board-podium-card { padding-inline: 12px; gap: 10px; }
    .board-podium-medal::after { margin-inline-start: 8px; }
    .board-podium-stats { column-gap: 8px; }
    .board-podium-stats strong { padding-inline-start: 8px; }
    .unranked-board thead th:nth-child(n+3) { width: 16%; }
    .unranked-board thead th:last-child { width: 12%; }
}
@container leaderboard (max-width: 690px) {
    .board-period { width: auto; padding-inline-start: 0; }
    .board-period::before { display: none; }
    .board-period svg { inset-inline-start: 10px; width: 16px; }
    .board-period select { padding-inline: 30px 5px; }
    .board-search { flex: 1 0 100%; }
    .board-podium { grid-template-columns: minmax(0, 1fr); }
    .board-podium:has([data-rank="3"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .board-podium:has([data-rank="3"]) [data-rank="1"] { grid-area: 1 / 1 / 2 / -1; }
    .board-podium:has([data-rank="3"]) [data-rank="2"] { grid-area: auto; }
    .board-podium-card { min-height: 91px; }
    .board-podium-card[data-rank="1"] { min-height: 88px; }
    .board-podium-card h2 { margin-bottom: 5px; }
    .board-podium-stats { font-size: .91rem; }
    .unranked-board table { font-size: .9rem; }
    .unranked-board thead th { font-size: .8rem; }
    .unranked-board :is(th, td):first-child { width: 12%; }
    .unranked-board thead th:nth-child(n+3) { width: 18%; }
    .unranked-board thead th:last-child { width: 15%; }
}
@container leaderboard (max-width: 410px) {
    .board-toolbar { gap: 9px; }
    .board-modes button { padding-inline: 9px; gap: 6px; font-size: .84rem; }
    .board-period select { font-size: .84rem; }
    .board-podium-card:not([data-rank="1"]) { display: block; padding: 8px 11px; }
    .board-podium-card:not([data-rank="1"]) .board-podium-medal::after { display: none; }
    .board-podium-card:not([data-rank="1"]) .board-medal { font-size: 1.3rem; }
    .unranked-board :is(th, td) { padding-inline: 5px; }
    .unranked-board thead th:nth-child(n+3) { width: 20%; }
    .unranked-board thead th:nth-child(4) { width: 21%; }
    .unranked-board thead th:last-child { width: 16%; }
    .unranked-board tbody td:nth-child(n+3) { font-size: .83rem; }
    .board-scoring summary { padding-inline: 13px; }
    .board-scoring-summary { display: none; }
}
