/* Logged-in player portal. Kept separate from the admin interface. */
:root {
    --portal-sidebar: 224px;
    --portal-topbar: 64px;
    --portal-panel: #0c1115;
    --portal-panel-2: #10161a;
    --portal-line: #20282d;
    --portal-rust: #d95732;
    --portal-rust-bright: #f06b45;
    --portal-gold: #e3a93c;
    --portal-green: #65c767;
    --portal-blue: #58a6e7;
    --portal-purple: #bb77e6;
}

body.user-portal {
    padding-left: var(--portal-sidebar);
    background:
        radial-gradient(circle at 88% 7%, rgba(202, 74, 37, .055), transparent 28rem),
        linear-gradient(rgba(255, 255, 255, .009) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .009) 1px, transparent 1px),
        #070a0c;
    background-size: auto, 44px 44px, 44px 44px, auto;
}

.user-sidebar {
    position: fixed;
    z-index: 1200;
    inset: 0 auto 0 0;
    width: var(--portal-sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden auto;
    background: linear-gradient(180deg, #080c0f, #06090b 72%);
    border-right: 1px solid #1d2529;
    box-shadow: 12px 0 36px rgba(0, 0, 0, .2);
}

.user-side-brand {
    min-height: var(--portal-topbar);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f2f1eb;
    border-bottom: 1px solid #1d2529;
}

.user-side-brand:hover { color: #fff; }

.user-side-brand > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1;
}

.user-side-brand strong {
    font-family: var(--heading);
    font-size: 27px;
    letter-spacing: .035em;
}

.user-side-brand small {
    max-width: 146px;
    margin-top: 5px;
    overflow: hidden;
    color: #767f84;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .1em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-side-brand-mark {
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    background: var(--portal-rust);
    box-shadow: 0 0 20px rgba(217, 87, 50, .2);
}

.user-side-brand-mark i {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #15191b;
    transform: rotate(9deg);
}

.user-side-brand-mark i:nth-child(1) { top: 5px; left: 5px; }
.user-side-brand-mark i:nth-child(2) { top: 5px; right: 5px; }
.user-side-brand-mark i:nth-child(3) { bottom: 5px; left: 7px; }
.user-side-brand-mark i:nth-child(4) { right: 5px; bottom: 4px; width: 9px; height: 9px; }

.user-side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 12px 14px;
}

.user-side-link {
    position: relative;
    min-height: 43px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #aab1b5;
    font-family: var(--heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.user-side-link svg { width: 18px; height: 18px; flex: 0 0 18px; }
.user-side-link:hover { color: #f3f2ed; background: rgba(255, 255, 255, .035); }

.user-side-link.active {
    color: #f1e7df;
    border-color: rgba(217, 87, 50, .12);
    background: linear-gradient(90deg, rgba(217, 87, 50, .18), rgba(217, 87, 50, .035));
    box-shadow: inset 2px 0 0 var(--portal-rust);
}

.user-side-link.active svg { color: var(--portal-rust-bright); }
.user-side-admin { margin-top: 8px; color: #e7b65d; }
.user-side-divider { height: 1px; margin: 8px 10px; background: #1d2428; }
.user-side-bottom { margin-top: auto; padding: 16px 14px 20px; }

.user-server-card {
    overflow: hidden;
    border: 1px solid #222b2f;
    border-radius: 7px;
    background: #0b1013;
}

.user-server-art {
    position: relative;
    height: 84px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(180deg, transparent, rgba(3, 7, 8, .78)),
        radial-gradient(circle at 55% 30%, rgba(218, 91, 50, .25), transparent 28%),
        linear-gradient(140deg, #283135, #101719 60%, #080c0e);
}

.user-server-art::before,
.user-server-art::after {
    content: "";
    position: absolute;
    bottom: -8px;
    width: 44px;
    height: 67px;
    border: 3px solid rgba(227, 233, 232, .16);
    border-bottom: 0;
    transform: skew(-5deg);
}

.user-server-art::before { left: 34px; }
.user-server-art::after { right: 29px; height: 48px; }
.user-server-art span { position: relative; z-index: 1; color: rgba(255, 255, 255, .65); font: 800 18px var(--heading); letter-spacing: .18em; }
.user-server-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.user-server-art.has-image {
    background: #111719;
}
.user-server-art.has-image::before { display: block; inset: 0; z-index: 1; width: auto; height: auto; border: 0; transform: none; background: linear-gradient(180deg, rgba(3, 7, 8, .03), rgba(3, 7, 8, .72)); }
.user-server-art.has-image::after { display: none; }
.user-server-art.has-image span {
    z-index: 2;
    padding: 5px 9px;
    border-radius: 3px;
    background: rgba(4, 8, 10, .6);
    color: #fff;
    text-shadow: 0 2px 4px #000;
}

.user-server-card-body { padding: 13px 14px; display: flex; flex-direction: column; gap: 4px; }
.user-server-label { color: #9ca4a8; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.user-server-state { display: flex; align-items: center; gap: 7px; color: #c3c9cc; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.user-server-state i { width: 7px; height: 7px; border-radius: 50%; background: #687176; }
.user-server-state.online { color: var(--portal-green); }
.user-server-state.online i { background: var(--portal-green); box-shadow: 0 0 9px rgba(101, 199, 103, .65); }
.user-server-state.starting { color: var(--portal-gold); }
.user-server-state.starting i { background: var(--portal-gold); }
.user-server-count { color: #6f797e; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-server-address { color: #596267; font-size: 9px; }

.user-server-vip {
    min-height: 36px;
    display: grid;
    place-items: center;
    margin: 0 12px 12px;
    border-radius: 3px;
    background: linear-gradient(180deg, #dc603c, #b73e25);
    color: #fff;
    font-family: var(--heading);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.user-server-vip:hover { color: #fff; filter: brightness(1.08); }

.user-navbar {
    min-height: var(--portal-topbar);
    padding: 0 26px;
    justify-content: flex-end;
    background: rgba(8, 12, 15, .92);
    border-bottom-color: #1d2529;
    box-shadow: none;
}

.user-navbar::after { display: none; }
.user-top-home { display: none; margin-right: auto; color: #c9ced0; font: 700 11px var(--heading); letter-spacing: .05em; text-transform: uppercase; }
.user-top-links { display: flex; align-items: center; gap: 22px; }
.user-top-links > a:not(.btn) { color: #a6adb1; font-size: 11px; }
.user-top-links > a:not(.btn):hover { color: #fff; }
.user-top-links > a.active:not(.btn) { color: #fff; box-shadow: inset 0 -2px 0 var(--portal-rust); }
.user-top-name { max-width: 190px; overflow: hidden; color: #d7dadb; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-top-links .btn { min-height: 36px; padding: 0 18px; }

.user-menu-toggle {
    position: fixed;
    z-index: 1300;
    top: 14px;
    left: 13px;
    width: 38px;
    height: 36px;
    display: none;
    place-content: center;
    gap: 4px;
    border: 1px solid #313a3e;
    border-radius: 4px;
    background: #11171a;
    color: #fff;
}

.user-menu-toggle span { width: 17px; height: 2px; display: block; background: currentColor; }
.user-sidebar-backdrop { position: fixed; z-index: 1150; inset: 0; background: rgba(0, 0, 0, .66); backdrop-filter: blur(2px); }

.user-portal .container,
.user-portal .shell {
    width: min(1450px, calc(100% - 36px));
    margin: 22px auto;
}

.user-portal footer { width: min(1450px, calc(100% - 36px)); }
.user-portal .hero,
.user-portal .player-strip,
.user-portal .public-page-head,
.user-portal .shop-card,
.user-portal .vip-hero,
.user-portal .vip-account-panel,
.user-portal .vip-package-card {
    border-radius: 7px;
}

/* Profile dashboard */
.profile-shell.profile-dashboard {
    width: min(1360px, calc(100% - 36px));
    margin: 22px auto;
    padding: 0 0 46px;
}

.profile-dashboard .profile-alert { margin-bottom: 14px; }

.profile-summary-card,
.profile-metric-card,
.profile-panel {
    border: 1px solid var(--portal-line);
    border-radius: 7px;
    background: linear-gradient(145deg, rgba(15, 21, 25, .985), rgba(10, 15, 18, .985));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.profile-summary-card {
    display: grid;
    grid-template-columns: minmax(350px, 1.15fr) minmax(350px, 1.25fr) minmax(160px, .5fr);
    min-height: 214px;
    overflow: hidden;
}

.profile-identity {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 19px;
    border-right: 1px solid var(--portal-line);
}

.profile-avatar,
.profile-avatar-fallback {
    width: 122px;
    height: 154px;
    flex: 0 0 122px;
    border: 1px solid #444d50;
    border-radius: 8px;
    background: #151b1e;
    object-fit: cover;
}

.profile-avatar-fallback { display: grid; place-items: center; color: var(--portal-rust-bright); font: 800 40px var(--heading); }
.profile-identity-copy { min-width: 0; }
.profile-online-label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; color: #899297; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.profile-online-label i { width: 6px; height: 6px; border-radius: 50%; background: #687176; }
.profile-online-label.online { color: var(--portal-green); }
.profile-online-label.online i { background: var(--portal-green); box-shadow: 0 0 7px rgba(101, 199, 103, .6); }
.profile-title { margin: 0 0 6px; overflow: hidden; color: #f0f0ec; font: 800 clamp(23px, 2vw, 28px)/1.1 var(--heading); text-overflow: ellipsis; white-space: nowrap; }
.profile-steam-link { display: inline-flex; align-items: center; gap: 5px; color: #b8bfc2; font-size: 11px; }
.profile-steam-link:hover { color: #fff; }
.profile-id { margin-top: 7px; color: #778187; font: 10px ui-monospace, monospace; }
.profile-discord-state { display: flex; align-items: center; gap: 7px; margin-top: 14px; color: #7c858a; font-size: 10px; }
.profile-discord-state.ok { color: var(--portal-green); }
.profile-discord-state svg { width: 16px; height: 16px; }

.profile-progress-zone { padding: 29px 30px; display: flex; flex-direction: column; justify-content: center; }
.profile-level-line { display: flex; align-items: center; gap: 20px; }
.profile-level-badge {
    width: 72px;
    height: 78px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    clip-path: polygon(50% 0, 90% 21%, 90% 76%, 50% 100%, 10% 76%, 10% 21%);
    background: linear-gradient(145deg, var(--portal-rust-bright), #782817);
    color: #fff;
    font: 800 29px var(--heading);
}

.profile-level-badge span {
    width: 61px;
    height: 67px;
    display: grid;
    place-items: center;
    clip-path: inherit;
    background: #141a1d;
}

.profile-level-copy { flex: 1; min-width: 0; }
.profile-level-copy h2 { margin: 0 0 12px; color: #ededeb; font: 800 15px var(--heading); text-transform: uppercase; }
.profile-xp-track { height: 8px; overflow: hidden; border-radius: 10px; background: #252c30; }
.profile-xp-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #e25636, #f1754d); }
.profile-xp-copy { display: block; margin-top: 9px; color: #9ba3a7; font-size: 10px; }
.profile-progress-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-top: 1px solid var(--portal-line); }
.profile-progress-stat { padding: 15px 18px 0 0; }
.profile-progress-stat + .profile-progress-stat { padding-left: 18px; border-left: 1px solid var(--portal-line); }
.profile-progress-stat small { display: block; color: #707a80; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.profile-progress-stat strong { display: block; margin-top: 5px; color: var(--portal-blue); font-size: 18px; }
.profile-progress-stat:nth-child(2) strong { color: var(--portal-gold); }
.profile-progress-stat:nth-child(3) strong { color: var(--portal-purple); }

.profile-vip-card { margin: 20px; padding: 20px 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px solid #252e32; border-radius: 5px; background: rgba(7, 11, 13, .58); }
.profile-vip-crown { color: var(--portal-gold); font-size: 36px; line-height: 1; }
.profile-vip-card span { margin-top: 8px; color: #899297; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.profile-vip-card strong { margin-top: 8px; color: var(--portal-gold); font: 800 27px var(--heading); }
.profile-vip-card small { max-width: 135px; margin-top: 4px; color: #747e83; font-size: 9px; }
.profile-vip-card.inactive .profile-vip-crown,
.profile-vip-card.inactive strong { color: #687176; }

.profile-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.profile-metric-card { min-height: 116px; padding: 18px 20px; }
.profile-metric-label { display: flex; align-items: center; gap: 9px; color: #939ca1; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.profile-metric-icon { color: var(--portal-gold); font-size: 17px; }
.profile-metric-card strong { display: block; margin-top: 13px; color: #f0f0ed; font: 800 25px var(--heading); }
.profile-metric-card small { display: block; margin-top: 2px; color: #717b80; font-size: 9px; }

.profile-main-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 12px; margin-top: 12px; }
.profile-panel { padding: 20px; min-width: 0; }
.profile-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.profile-panel h2,
.profile-panel-head h2 { margin: 0; color: #e8e9e6; font: 800 13px var(--heading); letter-spacing: .025em; text-transform: uppercase; }
.profile-panel-head span { color: #6f797e; font-size: 9px; }
.profile-row,
.connection-row,
.purchase-row,
.history-row { min-height: 52px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--portal-line); }
.profile-row:last-child,
.connection-row:last-child,
.purchase-row:last-child,
.history-row:last-child { border-bottom: 0; }
.profile-row-label { display: flex; align-items: center; gap: 9px; color: #9ba3a7; font-size: 10px; }
.profile-row-label svg { width: 16px; height: 16px; color: #788287; }
.profile-row-value { max-width: 58%; overflow: hidden; color: #c6cbcd; font-size: 10px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.profile-row-value.gold { color: var(--portal-gold); }
.profile-row-value.green { color: var(--portal-green); }
.profile-row-value a { color: var(--portal-blue); }
.profile-empty { padding: 18px 0; color: #778186; font-size: 11px; }

.purchase-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.purchase-icon { width: 39px; height: 39px; flex: 0 0 39px; padding: 3px; object-fit: contain; border: 1px solid #283136; border-radius: 5px; background: #090d0f; }
.purchase-copy { min-width: 0; }
.purchase-copy strong { display: block; overflow: hidden; color: #d8dcdd; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.purchase-copy small { display: block; margin-top: 3px; color: #687277; font-size: 8px; }
.purchase-total { flex: 0 0 auto; color: #d4d8da; font-size: 10px; text-align: right; white-space: nowrap; }
.purchase-total small { display: block; margin-top: 2px; color: #677176; font-size: 8px; }
.purchase-source { color: #9f8c62; font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }
.profile-all-link { width: 100%; min-height: 36px; margin-top: 13px; display: grid; place-items: center; border: 1px solid rgba(217, 87, 50, .6); border-radius: 4px; background: transparent; color: var(--portal-rust-bright); cursor: pointer; font: 800 9px var(--heading); letter-spacing: .06em; text-transform: uppercase; }
.profile-all-link:hover { color: #fff; background: rgba(217, 87, 50, .12); }

.profile-rewards-panel { margin-top: 12px; }
.profile-reward-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.profile-reward-day { position: relative; min-height: 210px; padding: 13px 8px 11px; display: flex; flex-direction: column; align-items: center; border: 1px solid #2a3236; border-radius: 5px; background: #0b1013; text-align: center; }
.profile-reward-day.claimed { border-color: rgba(76, 161, 80, .56); background: rgba(39, 100, 44, .1); }
.profile-reward-day.current { border-color: rgba(227, 169, 60, .8); background: rgba(126, 83, 18, .13); box-shadow: inset 0 0 22px rgba(227, 169, 60, .04); }
.profile-reward-day.locked { opacity: .6; }
.profile-reward-day > span { color: #929a9e; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.profile-reward-day.claimed > span { color: var(--portal-green); }
.profile-reward-day.current > span { color: var(--portal-gold); }
.profile-reward-state { position: absolute; top: 9px; right: 9px; color: #667075; font-size: 15px; line-height: 1; }
.profile-reward-day.claimed .profile-reward-state { color: var(--portal-green); }
.profile-reward-day.current .profile-reward-state { color: var(--portal-gold); }
.profile-reward-items { width: 100%; min-height: 92px; margin: 12px 0 8px; display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: 5px; }
.profile-reward-item { position: relative; width: 36px; height: 36px; padding: 3px; border: 1px solid #2b3539; border-radius: 5px; background: #11181c; }
.profile-reward-item img { width: 100%; height: 100%; object-fit: contain; }
.profile-reward-item b { position: absolute; right: -3px; bottom: -4px; min-width: 16px; padding: 2px 4px; border: 1px solid #364247; border-radius: 8px; background: #05090b; color: #f0f2f2; font-size: 7px; line-height: 1; }
.profile-reward-day strong { display: -webkit-box; max-width: 100%; min-height: 24px; overflow: hidden; color: #d8dcdd; font-size: 8px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.profile-reward-day small { margin-top: 4px; color: var(--portal-green); font-size: 8px; }
.profile-reward-note { margin-top: 12px; color: #717a7f; font-size: 9px; }

.profile-detail-stack { display: grid; gap: 12px; margin-top: 12px; }
.profile-detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; }
.connection-row > div { min-width: 0; }
.connection-row strong { color: #d8dcdd; font-size: 10px; }
.connection-row small { display: block; margin-top: 3px; color: #6e787d; font-size: 8px; }
.connection-state { flex: 0 0 auto; color: #7a8489; font-size: 9px; font-weight: 800; text-align: right; }
.connection-state.ok { color: var(--portal-green); }
.connection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.admin-profile-panel { border-color: rgba(227, 169, 60, .44); }
.admin-action-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.profile-admin-stat { padding: 13px; border: 1px solid #283136; border-radius: 4px; background: rgba(0, 0, 0, .15); }
.profile-admin-stat span { display: block; color: #778186; font-size: 8px; text-transform: uppercase; }
.profile-admin-stat strong { display: block; margin-top: 5px; color: #e1e3e2; font-size: 18px; }
.profile-admin-stat small { display: block; margin-top: 2px; color: #697378; font-size: 8px; }

@media (max-width: 1180px) {
    :root { --portal-sidebar: 206px; }
    .profile-summary-card { grid-template-columns: minmax(290px, 1fr) minmax(330px, 1.2fr) 170px; }
    .profile-identity { padding: 19px; }
    .profile-avatar, .profile-avatar-fallback { width: 96px; height: 128px; flex-basis: 96px; }
    .profile-progress-zone { padding: 22px; }
    .profile-reward-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    body.user-portal { padding-left: 0; }
    .user-menu-toggle { display: grid; }
    .user-sidebar { width: min(82vw, 280px); transform: translateX(-105%); transition: transform .2s ease; }
    .user-menu-open .user-sidebar { transform: translateX(0); }
    .user-navbar { padding-left: 64px; }
    .user-top-home { display: block; }
    .user-top-links > a:not(.btn), .user-top-name { display: none; }
    .profile-summary-card { grid-template-columns: 1fr 1fr; }
    .profile-identity { border-right: 1px solid var(--portal-line); }
    .profile-vip-card { grid-column: 1 / -1; min-height: 130px; margin-top: 0; flex-direction: row; gap: 14px; }
    .profile-vip-card span, .profile-vip-card strong, .profile-vip-card small { margin-top: 0; }
    .profile-metrics-grid { grid-template-columns: 1fr 1fr; }
    .profile-main-grid, .profile-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .user-navbar { min-height: 60px; padding-right: 10px; }
    .user-top-links { gap: 8px; }
    .user-top-links .btn { min-height: 34px; padding: 0 12px; font-size: 9px; }
    .user-portal .container, .user-portal .shell, .profile-shell.profile-dashboard { width: calc(100% - 20px); margin-top: 12px; }
    .profile-summary-card { grid-template-columns: 1fr; }
    .profile-identity { border-right: 0; border-bottom: 1px solid var(--portal-line); }
    .profile-avatar, .profile-avatar-fallback { width: 84px; height: 108px; flex-basis: 84px; }
    .profile-progress-zone { padding: 20px 17px; }
    .profile-level-badge { width: 58px; height: 64px; flex-basis: 58px; font-size: 23px; }
    .profile-level-badge span { width: 49px; height: 55px; }
    .profile-progress-stat { padding-right: 8px; }
    .profile-progress-stat + .profile-progress-stat { padding-left: 8px; }
    .profile-progress-stat strong { font-size: 14px; }
    .profile-vip-card { grid-column: auto; margin: 0; border: 0; border-top: 1px solid var(--portal-line); border-radius: 0; }
    .profile-metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .profile-metric-card { min-height: 103px; padding: 15px; }
    .profile-metric-card strong { font-size: 20px; }
    .profile-panel { padding: 15px; }
    .profile-reward-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-admin-stats { grid-template-columns: 1fr 1fr; }
    .connection-row, .history-row { align-items: flex-start; flex-direction: column; }
    .connection-state { text-align: left; }
}

@media (max-width: 380px) {
    .profile-metrics-grid, .profile-admin-stats { grid-template-columns: 1fr; }
    .profile-identity { align-items: flex-start; }
    .profile-title { white-space: normal; }
}

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

/* Public activity-filtered leaderboards. */
.leaderboard-page {
    background:
        radial-gradient(circle at 50% -10%, rgba(217, 87, 50, .11), transparent 36rem),
        linear-gradient(rgba(255, 255, 255, .009) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .009) 1px, transparent 1px),
        #070a0c;
    background-size: auto, 44px 44px, 44px 44px, auto;
}
.leaderboard-shell { width: min(1480px, calc(100% - 46px)); margin: 28px auto 64px; }
.leaderboard-hero { position: relative; display: grid; grid-template-columns: 1fr 230px; align-items: center; gap: 28px; min-height: 230px; padding: 38px 42px; overflow: hidden; border: 1px solid #282f32; border-radius: 8px; background: linear-gradient(112deg, rgba(17, 23, 27, .98), rgba(9, 13, 16, .96)); box-shadow: 0 22px 65px rgba(0, 0, 0, .28); }
.leaderboard-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--portal-rust-bright), #7f2516); }
.leaderboard-hero::after { content: "#1"; position: absolute; right: 250px; bottom: -70px; color: rgba(255, 255, 255, .022); font-size: 230px; font-weight: 900; line-height: 1; pointer-events: none; }
.leaderboard-kicker { display: block; margin-bottom: 9px; color: var(--portal-rust-bright); font-size: 10px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.leaderboard-hero h1 { margin: 0; color: #f0eee9; font-size: clamp(34px, 5vw, 64px); letter-spacing: -.035em; text-transform: uppercase; }
.leaderboard-hero p { max-width: 720px; margin: 14px 0 0; color: #8e989d; font-size: 14px; line-height: 1.75; }
.leaderboard-activity-card { position: relative; z-index: 1; display: grid; justify-items: center; padding: 24px 18px; border: 1px solid rgba(227, 169, 60, .28); border-radius: 7px; background: rgba(227, 169, 60, .055); text-align: center; }
.leaderboard-activity-card span { color: #a9b0b3; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.leaderboard-activity-card strong { margin-top: 7px; color: var(--portal-gold); font-size: 40px; line-height: 1; }
.leaderboard-activity-card small { margin-top: 9px; color: #6f797e; font-size: 9px; line-height: 1.45; }
.leaderboard-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; margin: 34px auto 18px; max-width: 980px; padding-top: 22px; }
.podium-player { position: relative; display: flex; min-height: 205px; align-items: center; flex-direction: column; justify-content: center; padding: 25px 18px 20px; border: 1px solid #283137; border-radius: 7px; background: linear-gradient(180deg, #11171b, #0b1013); color: inherit; text-decoration: none; box-shadow: 0 18px 42px rgba(0, 0, 0, .22); transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.podium-player:hover { border-color: rgba(217, 87, 50, .62); background: linear-gradient(180deg, rgba(217, 87, 50, .09), #0b1013 72%); }
.podium-player.rank-1 { min-height: 232px; transform: translateY(-16px); border-color: rgba(227, 169, 60, .55); background: linear-gradient(180deg, rgba(227, 169, 60, .12), #0c1114 68%); }
.podium-player.rank-2 { border-color: rgba(183, 194, 201, .36); }
.podium-player.rank-3 { border-color: rgba(190, 111, 62, .38); }
.podium-rank { position: absolute; top: 12px; right: 14px; color: #5e686d; font-size: 15px; font-weight: 900; }
.rank-1 .podium-rank { color: var(--portal-gold); }
.leaderboard-avatar { display: grid; width: 68px; height: 68px; place-items: center; border: 2px solid #364147; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #384249, #141a1e 62%); color: #f0eee9; font-size: 25px; font-weight: 900; object-fit: cover; box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.rank-1 .leaderboard-avatar { border-color: var(--portal-gold); box-shadow: 0 0 0 5px rgba(227, 169, 60, .08), 0 12px 28px rgba(0, 0, 0, .35); }
.leaderboard-avatar.small { width: 35px; height: 35px; border-width: 1px; font-size: 12px; }
.leaderboard-avatar.mini { width: 24px; height: 24px; border-width: 1px; font-size: 8px; }
.podium-player > strong { max-width: 100%; margin-top: 12px; overflow: hidden; color: #e9e9e6; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.podium-level { margin-top: 5px; color: var(--portal-gold); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.podium-stats { display: flex; gap: 13px; margin-top: 12px; color: #8d979c; font-size: 9px; font-weight: 700; }
.leaderboard-online { display: flex; align-items: center; gap: 5px; margin-top: 12px; color: #697378; font-size: 8px; }
.leaderboard-online i { width: 6px; height: 6px; border-radius: 50%; background: #596268; }
.leaderboard-online.online { color: var(--portal-green); }
.leaderboard-online.online i { background: var(--portal-green); box-shadow: 0 0 8px rgba(101, 199, 103, .55); }
.podium-player.is-you, .leaderboard-main-row.is-you, .leaderboard-mini-list li.is-you { box-shadow: inset 0 0 0 1px rgba(88, 166, 231, .58); }
.leaderboard-layout { display: grid; grid-template-columns: minmax(560px, 1.12fr) minmax(490px, .88fr); align-items: start; gap: 18px; margin-top: 4px; }
.leaderboard-main-card, .leaderboard-mini-card { border: 1px solid #252e33; border-radius: 7px; background: rgba(12, 17, 21, .94); box-shadow: 0 16px 45px rgba(0, 0, 0, .18); }
.leaderboard-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 21px 22px 17px; border-bottom: 1px solid #20282d; }
.leaderboard-card-head span { color: var(--portal-rust-bright); font-size: 8px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.leaderboard-card-head h2 { margin: 4px 0 0; color: #e5e6e3; font-size: 20px; text-transform: uppercase; }
.leaderboard-card-head > small { color: #687278; font-size: 8px; text-transform: uppercase; }
.leaderboard-main-list { display: grid; }
.leaderboard-main-row { display: grid; grid-template-columns: 42px 36px minmax(150px, 1fr) 64px 95px 95px; align-items: center; gap: 10px; min-height: 67px; padding: 9px 17px; border-bottom: 1px solid #1d2529; color: inherit; text-decoration: none; }
.leaderboard-main-row:last-child { border-bottom: 0; }
.leaderboard-main-row:hover { background: rgba(255, 255, 255, .018); }
.leaderboard-row-rank { color: #717b80; font-size: 12px; font-weight: 900; }
.leaderboard-player-copy { min-width: 0; }
.leaderboard-player-copy strong { display: block; overflow: hidden; color: #dce0df; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-player-copy small { display: block; margin-top: 3px; color: #626d72; font-size: 8px; }
.leaderboard-main-row > span:not(.leaderboard-player-copy):not(.leaderboard-avatar):not(.leaderboard-row-rank) { text-align: right; }
.leaderboard-main-row > span > small { display: block; color: #5d676c; font-size: 7px; text-transform: uppercase; }
.leaderboard-main-row > span > strong { display: block; margin-top: 3px; color: #b8c0c3; font-size: 10px; }
.leaderboard-main-row > span:last-child > strong { color: var(--portal-gold); }
.leaderboard-list-empty { padding: 24px; color: #687278; font-size: 10px; text-align: center; }
.leaderboard-side-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.leaderboard-mini-card { min-height: 235px; overflow: hidden; }
.leaderboard-mini-head { display: grid; grid-template-columns: 37px 1fr; gap: 10px; align-items: center; min-height: 82px; padding: 14px 15px; border-bottom: 1px solid #20282d; background: linear-gradient(110deg, rgba(217, 87, 50, .045), transparent); }
.leaderboard-mini-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(227, 169, 60, .35); border-radius: 5px; background: rgba(227, 169, 60, .055); color: var(--portal-gold); font-size: 14px; font-weight: 900; }
.leaderboard-mini-head h3 { margin: 0; color: #dce0df; font-size: 11px; text-transform: uppercase; }
.leaderboard-mini-head p { margin: 4px 0 0; color: #657076; font-size: 7px; line-height: 1.45; }
.leaderboard-mini-list { margin: 0; padding: 0; list-style: none; }
.leaderboard-mini-list li { display: block; min-height: 30px; border-bottom: 1px solid #1b2327; }
.leaderboard-mini-list li:last-child { border-bottom: 0; }
.leaderboard-mini-link { display: grid; grid-template-columns: 20px 24px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 36px; padding: 5px 12px; color: inherit; text-decoration: none; }
.leaderboard-mini-link:hover { background: rgba(255, 255, 255, .025); }
.podium-player:focus-visible, .leaderboard-main-row:focus-visible, .leaderboard-mini-link:focus-visible { outline: 2px solid var(--portal-rust-bright); outline-offset: 2px; }
.mini-rank { color: #59656a; font-size: 9px; font-weight: 900; }
.leaderboard-mini-list li:first-child .mini-rank { color: var(--portal-gold); }
.mini-name { overflow: hidden; color: #aeb6b9; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-mini-list strong { color: #d8dcdb; font-size: 8px; text-align: right; }
.leaderboard-mini-empty { margin: 0; padding: 30px 18px; color: #687278; font-size: 9px; line-height: 1.6; text-align: center; }
.leaderboard-empty { margin-top: 24px; padding: 70px 25px; border: 1px solid #252e33; border-radius: 7px; background: #0c1115; text-align: center; }
.leaderboard-empty span { color: var(--portal-rust-bright); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.leaderboard-empty h2 { margin: 10px 0 0; color: #e3e5e2; font-size: 27px; text-transform: uppercase; }
.leaderboard-empty p { margin: 10px 0 0; color: #747f84; font-size: 11px; }

@media (max-width: 1180px) {
    .leaderboard-layout { grid-template-columns: 1fr; }
    .leaderboard-side-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
    .leaderboard-shell { width: calc(100% - 24px); margin-top: 14px; }
    .leaderboard-hero { grid-template-columns: 1fr; padding: 29px 25px; }
    .leaderboard-hero::after { right: -20px; }
    .leaderboard-activity-card { justify-self: stretch; }
    .leaderboard-podium { grid-template-columns: 1fr; padding-top: 0; }
    .podium-player.rank-1 { order: -1; min-height: 205px; transform: none; }
    .leaderboard-main-row { grid-template-columns: 35px 36px minmax(100px, 1fr) 55px 80px; }
    .leaderboard-main-row > span:last-child { display: none; }
    .leaderboard-side-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .leaderboard-hero h1 { font-size: 34px; }
    .leaderboard-main-row { grid-template-columns: 30px 34px minmax(90px, 1fr) 52px; padding-inline: 10px; }
    .leaderboard-main-row > span:nth-last-child(-n+2) { display: none; }
    .leaderboard-side-grid { grid-template-columns: 1fr; }
}
