/* ─── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #1a1c1d;
    --bg-card:    #181a1b;
    --bg-deeper:  #141618;
    --bg-filter:  #111315;
    --border:     rgba(255,255,255,0.06);
    --border-md:  rgba(255,255,255,0.08);
    --text:       #ffffff;
    --text-muted: rgba(255,255,255,0.45);
    --text-dim:   rgba(255,255,255,0.28);
    --accent:     #c4461a;
    --accent-glow:#ff6030;
    --font-display:'Teko', 'Arial Narrow', sans-serif;
    --font-body:   'Rajdhani', 'Segoe UI', sans-serif;
    /* Scrollbars — site-wide (dark track, flat rust thumb, square edges) */
    --scrollbar-track: #1a1a1a;
    --scrollbar-thumb: #b04a33;
    --scrollbar-thumb-hover: #c45642;
    --scrollbar-size: 8px;
}

/* ─── Scrollbars (Firefox + Chromium / Safari) ───────────────────────────── */
html {
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*,
*::before,
*::after {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border: none;
    border-radius: 0;
    box-shadow: none;
}

*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 500;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
/* Full-screen video pages: block layout so the bg layer is not a flex row
   above .site-page (video was stacking as a normal block at the top). */
body.site-has-bg-video {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    background: #0a0a0c;
}
/* Home — one viewport tall, no page scroll */
html:has(body.site-home),
body.site-home {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
body.site-home {
    display: flex;
    flex-direction: column;
}
body.site-home .site-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.site-home .site-nav {
    flex-shrink: 0;
}
/* App pages (play.php, etc.) — no bg video; lock to viewport height */
body.site-app-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background: #1a1c1d;
}
body.site-app-page .site-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
body.site-app-page .site-nav {
    flex-shrink: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* Full-screen background stack (includes/header.php .site-bg).
   Fixed wrapper + absolute video — avoids the video sitting in document
   flow as a block above the nav when position:fixed fails to apply. */
.site-bg {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.site-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
    display: block;
    border: 0;
}
.site-bg-dim {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.45);
}

/* Nav + page content — always painted above .site-bg (z-index 0). */
.site-page {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Home (index.php) layout — mirrors Tailwind flex utilities as fallback. */
.home-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    color: #fff;
}
.home-main__section {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    align-self: stretch;
    padding: 1.5rem 1.25rem 2rem;
    z-index: 1;
}
.home-main__top {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}
.home-main__bottom {
    display: flex;
    margin-top: auto;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    gap: 1.5rem;
}
@media (max-width: 1024px) {
    .home-main__section { padding: 1.25rem 1rem 2rem; }
    .home-main__bottom { flex-direction: column; align-items: stretch; }
}

/* Play page — fill all space below the nav (flex, not calc — avoids bottom gap). */
.play-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #1a1c1d;
    color: #fff;
}
.play-main #server-browser {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Link / store shells — scroll lives in .link-scroll / .store-scroll (see globals.css). */
.store-app {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #121314;
    color: #fff;
}

/* ─── Nav (Rust-style glass bar) ───────────────────────────────────────────── */
.site-nav {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(32, 36, 42, 0.48);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}
.nav-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 0.5rem;
    height: 64px;
    padding: 0 2rem;
    width: 100%;
}
.nav-start {
    display: flex;
    align-items: center;
    align-self: center;
    justify-self: start;
    min-width: 0;
}
.nav-end {
    display: flex;
    align-items: center;
    align-self: center;
    justify-self: end;
    min-width: 0;
}
.nav-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 0.35rem;
}
.nav-logo__glow {
    position: absolute;
    inset: -4px -8px -2px -8px;
    background: linear-gradient(
        0deg,
        rgba(220, 75, 45, 0.62) 0%,
        rgba(220, 75, 45, 0.28) 45%,
        rgba(220, 85, 50, 0.04) 100%
    );
    border-radius: 2px;
    pointer-events: none;
    z-index: 0;
}
.nav-logo img {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(220, 75, 45, 0.45));
}
.nav-menu {
    display: flex;
    align-items: stretch;
    justify-content: center;
    align-self: stretch;
    gap: 0;
    justify-self: center;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar { display: none; }

.nav-menu-toggle,
.nav-drawer-backdrop,
.nav-drawer {
	display: none;
}
.nav-menu-toggle {
	appearance: none;
	align-items: center;
	justify-content: center;
	gap: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	background: rgba(10, 11, 13, 0.72);
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
}
.nav-menu-toggle__bars {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 18px;
}
.nav-menu-toggle__bars span {
	display: block;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transition: transform 0.18s ease, opacity 0.18s ease;
}
.site-nav--menu-open .nav-menu-toggle__bars span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}
.site-nav--menu-open .nav-menu-toggle__bars span:nth-child(2) {
	opacity: 0;
}
.site-nav--menu-open .nav-menu-toggle__bars span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}
.nav-menu-toggle__label,
.a-mobile-nav-toggle__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.nav-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 98;
	border: 0;
	padding: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}
.nav-drawer {
	position: fixed;
	top: 56px;
	left: 0;
	right: 0;
	z-index: 99;
	max-height: calc(100dvh - 56px);
	overflow-y: auto;
	background: rgba(18, 20, 24, 0.98);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
	padding: 0.35rem 0 0.75rem;
}
.nav-drawer .nav-item {
	display: flex;
	align-self: auto;
	width: 100%;
	min-width: 0;
	min-height: 48px;
	padding: 0 1.15rem;
	justify-content: flex-start;
}
.nav-drawer .nav-item__label {
	display: inline;
	font-size: 0.78rem;
}
body.site-nav-open {
	overflow: hidden;
}

.nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    gap: 0.45rem;
    padding: 0 1.5rem;
    min-width: 6.25rem;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.12s ease;
    z-index: 0;
}
.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: transparent;
    pointer-events: none;
    transition: background 0.12s ease;
}
.nav-item__icon {
    flex-shrink: 0;
    display: block;
    width: 17px;
    height: 17px;
    transform: translateY(-0.12em);
    opacity: 0.85;
    transition: opacity 0.12s ease;
}
.nav-item__icon--store {
    width: 18px;
    height: 18px;
}
.nav-item__label {
    line-height: 1;
}
.nav-item:hover .nav-item__icon,
.nav-item--active .nav-item__icon {
    opacity: 1;
}
.nav-drawer .nav-item {
    gap: 0.7rem;
}
.nav-drawer .nav-item__icon {
    width: 18px;
    height: 18px;
}
.nav-drawer .nav-item__icon--store {
    width: 19px;
    height: 19px;
}
.nav-item:hover {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}
.nav-item:hover:not(.nav-item--active)::before {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.03) 50%,
        transparent 100%
    );
}
.nav-item--highlight {
    color: #2fde88;
}
.nav-item--highlight:hover {
    color: #4af0a0;
}
.nav-item--active {
    color: #fff;
}
.nav-item--active::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        0deg,
        rgba(220, 75, 45, 0.62) 0%,
        rgba(220, 75, 45, 0.28) 45%,
        rgba(220, 85, 50, 0.04) 100%
    );
    border-radius: 0;
    pointer-events: none;
}
.nav-item__badge,
.nav-chip__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e34d3e;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}
.nav-item .nav-item__badge {
    top: -2px;
    right: -4px;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    margin-left: auto;
}
.nav-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0;
    border: none;
    background: rgba(10, 11, 13, 0.82);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    flex-shrink: 0;
}
.nav-chip:hover {
    background: rgba(18, 20, 24, 0.95);
    color: #fff;
    text-decoration: none;
}
.nav-chip--icon {
    width: 40px;
}
.nav-chip--btn {
    padding: 0 0.95rem;
}
.nav-chip--btn .nav-item__icon {
    width: 18px;
    height: 18px;
}
.nav-profile-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-signin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    height: 40px;
    padding: 0 1.15rem;
    background: #212121;
    border: none;
    border-radius: 0;
    color: #b5b5b5;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.nav-signin__icon {
    flex-shrink: 0;
    display: block;
    width: 22px;
    height: 22px;
}
.nav-signin:hover {
    background: #2a2a2a;
    color: #c8c8c8;
    text-decoration: none;
}
button.nav-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    height: 40px;
    padding: 0 1rem 0 0.55rem;
    border: none;
    border-radius: 0;
    background: #212121;
    color: #b5b5b5;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.12s ease, color 0.12s ease;
}
button.nav-profile:hover {
    background: #2a2a2a;
    color: #c8c8c8;
}
button.nav-profile:hover .nav-profile-caret {
    color: #c8c8c8;
}
.nav-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}
.nav-profile-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(220, 75, 45, 0.35);
    font-weight: 700;
    font-size: 0.75rem;
}
.nav-profile-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 900px) {
    .nav-profile-name { display: none; }
    button.nav-profile {
        padding: 0 0.55rem;
        gap: 0.35rem;
    }
}
.nav-profile-caret {
    color: #8a8a8a;
    transition: transform 0.18s ease, color 0.18s;
    flex-shrink: 0;
}
.nav-profile-wrap[data-open="true"] .nav-profile-caret {
    transform: rotate(180deg);
    color: #c8c8c8;
}
.nav-profile-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--bg-deeper);
    border: 1px solid var(--border-md);
    border-radius: 0;
    padding: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    z-index: 120;
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}
.nav-profile-wrap[data-open="true"] .nav-profile-menu {
    display: block;
}
.nav-profile-wrap[data-open="true"] .nav-profile-menu.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.nav-profile-menu-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--border-md);
}
.nav-profile-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    height: 38px;
    padding: 0 12px;
    border-radius: 0;
    color: #b5b5b5;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.12s ease, background 0.12s ease;
    z-index: 0;
}
.nav-profile-menu-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: linear-gradient(
        0deg,
        rgba(220, 75, 45, 0.62) 0%,
        rgba(220, 75, 45, 0.28) 45%,
        rgba(220, 85, 50, 0.04) 100%
    );
    transition: opacity 0.12s ease;
    pointer-events: none;
}
.nav-profile-menu-item:hover {
    color: #fff;
    text-decoration: none;
}
.nav-profile-menu-item:hover::before {
    opacity: 1;
}
.nav-profile-menu-item > svg {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.9;
}
.nav-profile-menu-label {
    line-height: 1;
}
.nav-profile-menu-item--admin {
    color: #f5c842;
}
.nav-profile-menu-item--admin > svg {
    color: #f5c842;
}
.nav-profile-menu-item--admin::before {
    background: linear-gradient(
        0deg,
        rgba(245, 200, 66, 0.55) 0%,
        rgba(245, 200, 66, 0.22) 45%,
        rgba(245, 200, 66, 0.04) 100%
    );
}
.nav-profile-menu-item--admin:hover {
    color: #ffe97a;
}
.nav-profile-menu-item--admin:hover > svg {
    color: #ffe97a;
}
.nav-profile-menu-item--signout:hover {
    color: #ffb09a;
}
.nav-profile-menu-item--signout > svg {
    color: rgba(255, 120, 90, 0.85);
}
@media (max-width: 1100px) {
    .nav-item__label { font-size: 0.72rem; letter-spacing: 0.08em; }
    .nav-item { padding: 0 1rem; min-width: 5rem; gap: 0.35rem; }
    .nav-chip--btn span:not(.nav-chip__badge) { display: none; }
    .nav-chip--btn { width: 40px; padding: 0; }
}

@media (max-width: 768px) {
    .nav-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        height: 56px;
        padding: 0 1.25rem;
    }
    .nav-start {
        gap: 0.35rem;
        min-width: 0;
    }
    .nav-menu-toggle {
        display: inline-flex;
    }
    .nav-menu--desktop {
        display: none;
    }
    .site-nav--menu-open .nav-drawer-backdrop {
        display: block;
    }
    .nav-drawer.is-open {
        display: block;
    }
    .nav-logo {
        width: 50px;
        height: 50px;
        margin-right: 0;
    }
    .nav-logo img {
        width: 46px;
        height: 46px;
    }
    .nav-signin__label {
        display: none;
    }
    .nav-signin {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .nav-inner { padding: 0 1rem; height: 56px; }
}

/* ─── Page shell ───────────────────────────────────────────────────────────── */
.page-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ─── Filter bar ───────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--bg-filter);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.filter-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.12);
    margin: 0 6px;
    flex-shrink: 0;
}
.pill {
    padding: 3px 11px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 2px;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.pill--inactive {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.55);
    border: 1px solid transparent;
}
.pill--inactive:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.80); }
.pill--active {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent-glow);
}
.pill--test { color: rgba(255,255,255,0.25); }

/* ─── Category tabs ────────────────────────────────────────────────────────── */
.cat-bar {
    display: flex;
    align-items: stretch;
    background: var(--bg-deeper);
    border-bottom: 1px solid var(--border-md);
    flex-shrink: 0;
    overflow-x: auto;
}
.cat-tab {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 18px;
    height: 46px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.34);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.12s, background 0.12s;
}
.cat-tab:hover { color: rgba(255,255,255,0.70); background: rgba(255,255,255,0.04); }
.cat-tab--active {
    color: rgba(255, 255, 255, 0.88);
    border-bottom-color: rgba(255, 255, 255, 0.35);
}
.cat-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* ─── Search bar ───────────────────────────────────────────────────────────── */
.search-wrap { display: flex; align-items: center; margin-left: auto; padding: 0 12px; }
.search-form { position: relative; }
.search-input {
    height: 30px;
    width: 220px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 0 12px 0 32px;
    font-size: 12px;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 500;
    outline: none;
    border-radius: 2px;
}
.search-input::placeholder { color: rgba(255,255,255,0.30); }
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: rgba(255,255,255,0.30);
}

/* ─── Leaderboard header ───────────────────────────────────────────────────── */
.lb-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 6px;
}
.player-rank-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 5px 11px 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 3px solid rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    flex-shrink: 0;
}
.player-rank-chip__label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.36);
    line-height: 1.2;
}
.player-rank-chip__num {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.03em;
}
.lb-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
}
.lb-subtitle {
    margin: 0 0 36px;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 700px;
    line-height: 1.5;
}

/* ─── Podium ───────────────────────────────────────────────────────────────── */
.podium { display: flex; gap: 16px; margin-bottom: 40px; padding-top: 14px; }
.podium-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 22px 18px 20px;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
    display: block;
}
.podium-card--first { padding: 28px 20px 24px; transform: translateY(-10px); }
.podium-card:hover { border-color: rgba(255,255,255,0.15); }
.podium-rank {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.02em;
}
.podium-avatar { display: flex; justify-content: center; margin: 10px 0 14px; }
.podium-name {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.podium-server {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.30);
    margin-top: 4px;
}
.podium-stat-wrap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.podium-stat-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.02em;
}
.podium-card--first .podium-stat-value { font-size: 36px; }
.podium-stat-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.35);
    margin-top: 4px;
}

/* ─── Avatar ───────────────────────────────────────────────────────────────── */
.avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: var(--avatar-size, 40px);
    height: var(--avatar-size, 40px);
}
.avatar-wrap .avatar,
.avatar-wrap .avatar-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.avatar-placeholder {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: rgba(255,255,255,0.85);
    flex-shrink: 0;
}

/* ─── Player table ─────────────────────────────────────────────────────────── */
.lb-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.lb-stat-category-scroll {
    background: #1c1e20;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.lb-stat-category-scroll .lb-table-inner {
    width: 100%;
    min-width: max(100%, var(--lb-table-min-width, 920px));
}
.lb-stat-category-scroll .lb-table-header.lb-stat-category-header,
.lb-stat-category-scroll .lb-table-body {
    width: 100%;
    min-width: var(--lb-table-min-width, 920px);
    box-sizing: border-box;
}
.lb-stat-category-scroll .lb-table-header {
    background: var(--bg-deeper);
}
.lb-stat-category-scroll .lb-table-body {
    background: #1c1e20;
    border: none;
}
.lb-stat-category-scroll .lb-stat-category-row {
    background: #1c1e20;
    width: 100%;
    min-width: var(--lb-table-min-width, 920px);
    box-sizing: border-box;
}
.lb-stat-category-scroll .lb-stat-category-row:hover {
    background: #232527;
}
.lb-stat-category-scroll .lb-col-sticky {
    position: sticky;
    z-index: 2;
}
.lb-stat-category-scroll .lb-table-header .lb-col-sticky {
    z-index: 4;
    background: var(--bg-deeper);
}
.lb-stat-category-scroll .lb-col-sticky--rank {
    left: 0;
}
.lb-stat-category-scroll .lb-col-sticky--player {
    left: var(--lb-sticky-player-left, 52px);
}
.lb-stat-category-scroll .lb-col-sticky--server {
    left: var(--lb-sticky-server-left, 272px);
}
.lb-stat-category-scroll .lb-stat-category-row .lb-col-sticky {
    background: inherit;
}
.lb-table-header {
    display: grid;
    padding: 10px 18px;
    background: var(--bg-deeper);
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    min-width: 920px;
    align-items: stretch;
}
.lb-table-header > span:not(.lb-metric-head) {
    display: flex;
    align-items: center;
}
.lb-table-header.lb-table--all-servers,
.lb-row.lb-table--all-servers {
    grid-template-columns:
        52px minmax(160px, 1.4fr) minmax(100px, 130px)
        repeat(8, minmax(64px, 1fr));
}
.lb-table-header.lb-table--single-server,
.lb-row.lb-table--single-server {
    grid-template-columns:
        52px minmax(180px, 1.6fr)
        repeat(8, minmax(64px, 1fr));
}
.lb-table-header.lb-table--teams.lb-table--all-servers,
.lb-row.lb-table--teams.lb-table--all-servers {
    grid-template-columns:
        52px minmax(160px, 1.4fr) minmax(100px, 130px)
        repeat(8, minmax(64px, 1fr));
}
.lb-table-header.lb-table--teams.lb-table--single-server,
.lb-row.lb-table--teams.lb-table--single-server {
    grid-template-columns:
        52px minmax(180px, 1.6fr)
        repeat(8, minmax(64px, 1fr));
}
.lb-table-header.lb-table--member,
.lb-row.lb-table--member {
    grid-template-columns:
        minmax(180px, 1.6fr) 90px
        repeat(8, minmax(64px, 1fr));
    min-width: 880px;
}
.lb-metric-head,
.lb-metric-cell {
    text-align: right;
}
.lb-metric-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    min-height: 100%;
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.42);
    text-decoration: none;
    transition: color 0.12s;
}
.lb-metric-head:hover {
    color: rgba(255, 255, 255, 0.62);
}
.lb-metric-head.is-active {
    color: rgba(255, 255, 255, 0.78);
}
.lb-metric-head .lb-sort-arrow {
    font-size: 11px;
    opacity: 0.85;
}
.lb-metric-cell {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.02em;
}
.lb-stat-table-header {
    display: grid;
    padding: 10px 18px;
    background: var(--bg-deeper);
    border: 1px solid rgba(255,255,255,0.05);
    border-bottom: none;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
    min-width: 720px;
}
.lb-stat-table-header > span:first-child {
    text-align: left;
}
.lb-stat-table-body {
    min-width: 720px;
}
.lb-stat-table-row {
    display: grid;
    padding: 11px 18px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.10s;
    text-decoration: none;
    color: inherit;
}
.lb-stat-table-row:hover {
    background: rgba(255,255,255,0.04);
}
.lb-stat-table-row:last-child {
    border-bottom: none;
}
.lb-stat-table-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-table-header.lb-stat-category-header > span:not(.lb-metric-head) {
    display: flex;
    align-items: center;
}
.lb-stat-category-row {
    text-decoration: none;
    color: inherit;
}
.lb-clan-tag-badge {
    flex-shrink: 0;
    min-width: 40px;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}
.lb-table-rank-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lb-table-rank {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.lb-table-rank--1 { color: #e8c96a; }
.lb-table-rank--2 { color: #d4d4d4; }
.lb-table-rank--3 { color: #d4a574; }
.lb-table-rank--muted {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.22);
}

.lb-table-body {
    background: #1c1e20;
    border: 1px solid rgba(255,255,255,0.05);
    border-top: none;
    min-width: 920px;
}
.lb-row {
    display: grid;
    padding: 12px 18px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.10s;
}
.lb-row:hover { background: rgba(255,255,255,0.04); }
.lb-row:last-child { border-bottom: none; }
.lb-row--static {
    cursor: default;
    pointer-events: auto;
}
.lb-row--static:hover { background: transparent; }
.player-hero-wrap { margin-bottom: 32px; }
.player-hero.lb-row {
    grid-template-columns: minmax(0, 1fr) auto;
}
.player-hero { padding: 16px 18px; align-items: center; }
.player-hero .lb-player-cell { flex: 1 1 auto; }
.player-hero-kd { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.player-hero-kd .player-kd-value { font-size: 42px; }
.lb-rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: #000;
}
.lb-rank-num {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.38);
    padding-left: 4px;
}
.lb-player-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-player-name {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-player-sub {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.28);
    margin-top: 2px;
}
.lb-server-cell {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.50);
}
.lb-stat-cell {
    text-align: right;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}
.player-hero .lb-stat-cell,
.player-hero-kd .player-kd-value {
    font-family: var(--font-display);
}
.lb-empty {
    padding: 60px 0;
    text-align: center;
    color: rgba(255,255,255,0.25);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.lb-footnote {
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    font-size: 11px;
    color: rgba(255,255,255,0.40);
    line-height: 1.6;
}

/* ─── Stat cards ───────────────────────────────────────────────────────────── */
.stat-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 12px;
}
.stat-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.stat-grid-resources {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.stat-grid-weapons {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.expandable-stat-grid-wrap {
    position: relative;
}
.expandable-stat-grid-wrap.is-collapsed .stat-grid-resources,
.expandable-stat-grid-wrap.is-collapsed .stat-grid-weapons {
    overflow: hidden;
}
.expandable-stat-grid-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 92px;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10, 12, 16, 0.75) 45%,
        rgba(10, 12, 16, 0.96) 100%
    );
}
.expandable-stat-grid-toggle {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}
.expandable-stat-grid-toggle.is-below {
    position: static;
    transform: none;
    display: flex;
    margin: 14px auto 0;
    box-shadow: none;
}
.expandable-stat-grid-wrap.is-collapsed {
    padding-bottom: 8px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.stat-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.stat-card-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.40);
}
.stat-card-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    letter-spacing: 0.02em;
    margin-top: 4px;
}
.stat-card-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Icon cards ───────────────────────────────────────────────────────────── */
.icon-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}
.icon-card--dim { opacity: 0.42; }
button.icon-card {
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.icon-card--clickable:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}
.icon-card-hint {
    color: rgba(255, 255, 255, 0.28);
}
.icon-card-img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.icon-card-img img { width: 100%; height: 100%; object-fit: contain; }
.icon-card-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.40);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.icon-card-value-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 3px;
}
.icon-card-value-row--solo .icon-card-value {
    margin-top: 0;
}
.icon-card-value-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.34);
    line-height: 1;
    flex-shrink: 0;
}
.icon-card-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    letter-spacing: 0.02em;
}
.icon-card-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
    line-height: 1.35;
}

/* ─── Section title ────────────────────────────────────────────────────────── */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    margin-top: 32px;
    justify-content: space-between;
}
.section-title-text {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
}
.section-title-right {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

/* ─── Player header ────────────────────────────────────────────────────────── */
.player-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(208,80,40,0.08) 0%, var(--bg-card) 60%);
    border: 1px solid var(--border-md);
    margin-bottom: 30px;
}
.player-header-avatar {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0;
}
.player-header-avatar-ph {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0;
    background: #2a2c2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: rgba(255,255,255,0.6);
}
.player-name {
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1;
    text-transform: uppercase;
}
.player-steam-name { font-size: 13px; color: rgba(255,255,255,0.45); margin-top: 4px; }
.player-badges { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 5px 11px;
}
.badge--server  { background: rgba(208,80,40,0.20); color: #f08040; }
.badge--wipe    { background: rgba(80,200,120,0.15); color: #6ecc8a; }
.badge--overall { background: rgba(100,140,255,0.15); color: #88aaff; }
.badge--dim     { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55); }
.badge--mono    { background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.40); font-family: monospace; }
.player-kd-wrap { text-align: right; flex-shrink: 0; margin-left: auto; }
.player-kd-value {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 0 24px rgba(208,80,40,0.35);
}
.player-kd-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.20em;
    color: rgba(255,255,255,0.40);
    margin-top: 4px;
}

/* ─── Per-server breakdown table ───────────────────────────────────────────── */
.breakdown-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.breakdown-header {
    display: grid;
    grid-template-columns: minmax(0,1fr) 100px 100px 100px 100px 100px;
    padding: 10px 18px;
    background: var(--bg-deeper);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.30);
}
.breakdown-header span:not(:first-child),
.breakdown-row span:not(:first-child) { text-align: right; }
.breakdown-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) 100px 100px 100px 100px 100px;
    padding: 10px 18px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
    color: rgba(255,255,255,0.80);
}
.breakdown-row span:first-child { font-weight: 700; }

/* ─── Recent combat ────────────────────────────────────────────────────────── */
.combat-table { background: var(--bg-card); border: 1px solid var(--border); }
.combat-row {
    display: grid;
    grid-template-columns: 80px 80px minmax(0,1fr) 120px 100px 80px;
    padding: 10px 18px;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.combat-row:first-child { border-top: none; }
.badge-kill   { font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.14em;padding:4px 8px;text-align:center;background:rgba(125,201,84,.16);color:#7dc954; }
.badge-death  { font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.14em;padding:4px 8px;text-align:center;background:rgba(224,90,64,.16);color:#e05a40; }
.combat-time  { color:rgba(255,255,255,.40);font-size:11px; }
.combat-weapon{ color:rgba(255,255,255,.60); }
.combat-hit   { color:rgba(255,255,255,.50); }
.combat-dist  { text-align:right;color:rgba(255,255,255,.50); }

/* ─── Back link ────────────────────────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 20px;
    transition: color 0.12s;
}
.back-link:hover { color: rgba(255,255,255,0.80); }

/* ─── Hit rate panel ───────────────────────────────────────────────────────── */
.hit-rate-wrap {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    width: 100%;
    padding-inline: 12px;
    box-sizing: border-box;
}
.hit-panel {
    background: #151618;
    border: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
    max-width: 620px;
}
.hit-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: linear-gradient(90deg, #c4461a 0%, #8a2810 100%);
    border-left: 4px solid #ff6030;
}
.hit-panel-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
}
.hit-panel-total {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.88);
}
.hit-panel-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 40%) minmax(0, 1fr);
    align-items: stretch;
    padding: 20px 12px 10px;
    position: relative;
    height: clamp(300px, 48vw, 435px);
    min-height: 300px;
}
.hit-lines-svg {
    position: absolute;
    inset: 20px 12px 10px;
    width: calc(100% - 24px);
    height: calc(100% - 30px);
    pointer-events: none;
    z-index: 1;
}
.hit-label-col {
    position: relative;
    height: 100%;
    z-index: 2;
    min-width: 0;
}
.hit-label-item {
    position: absolute;
    background: #151618;
    padding-inline: 4px;
    z-index: 2;
    transform: translateY(-50%);
    max-width: 100%;
}
.hit-label-item--left  { left: 0; padding-right: 8px; }
.hit-label-item--right { right: 0; padding-left: 8px; }
.hit-label-name  { font-size: clamp(10px, 2.2vw, 12px); font-weight: 600; color: rgba(255,255,255,0.70); }
.hit-label-pct   { font-size: clamp(10px, 2.2vw, 12px); font-weight: 800; margin-left: 4px; }
.hit-label-hits  { font-size: clamp(9px, 1.8vw, 10px); font-weight: 600; color: rgba(255,255,255,0.38); letter-spacing: 0.05em; margin-top: 2px; }
.hit-silhouette-wrap {
    position: relative;
    width: 100%;
    max-width: 240px;
    height: 100%;
    margin-inline: auto;
    z-index: 2;
}
.hit-silhouette-img  {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    filter: drop-shadow(0 4px 18px rgba(0,0,0,0.6));
}
.hit-dot {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.75);
    z-index: 3;
    pointer-events: none;
    transform: translate(-50%, -50%);
}
.hit-legend {
    display: flex;
    gap: 18px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: #141618;
    flex-wrap: wrap;
}
.hit-legend-item { display: flex; align-items: center; gap: 6px; }
.hit-legend-dot  {
    width: 12px; height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}
.hit-legend-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

body.gambling-modal-open { overflow: hidden; }
.gambling-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}
.gambling-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: min(80vh, 640px);
    display: flex;
    flex-direction: column;
    background: #151618;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.gambling-modal-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}
.gambling-modal-refresh,
.gambling-modal-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.gambling-modal-refresh {
    font-size: 20px;
}
.gambling-modal-refresh:disabled {
    opacity: 0.35;
    cursor: default;
}
.gambling-modal-close {
    font-size: 28px;
}
.gambling-modal-refresh:hover:not(:disabled),
.gambling-modal-close:hover {
    color: #fff;
}
.gambling-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 48px 14px 18px;
    background: linear-gradient(90deg, #c4461a 0%, #8a2810 100%);
    border-left: 4px solid #ff6030;
}
.gambling-modal-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gambling-modal-icon img { width: 100%; height: 100%; object-fit: contain; }
.gambling-modal-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.1;
}
.gambling-modal-sub {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.04em;
}
.gambling-modal-body {
    padding: 14px 16px 16px;
    overflow: auto;
    flex: 1;
    min-height: 0;
}
.gambling-modal-status {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}
.gambling-modal-status--error { color: #f08080; }
.gambling-sessions-table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #1c1e20;
}
.gambling-sessions-table {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) minmax(80px, 1.2fr) 72px 72px 80px;
    font-size: 12px;
}
.gambling-sessions-head,
.gambling-sessions-row {
    display: contents;
}
.gambling-sessions-head > span {
    padding: 10px 10px 8px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    background: var(--bg-deeper);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gambling-sessions-row > span {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.88);
    font-variant-numeric: tabular-nums;
}
.gambling-sessions-row:last-child > span { border-bottom: none; }
.gambling-sessions-server {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gambling-sessions-profit--pos { color: #7dd87a; font-weight: 700; }
.gambling-sessions-profit--neg { color: #f08080; font-weight: 700; }
@media (max-width: 520px) {
    .gambling-sessions-table {
        grid-template-columns: minmax(64px, 1fr) 64px 64px 72px;
    }
    .gambling-sessions-head > span:nth-child(2),
    .gambling-sessions-row > span:nth-child(2) {
        display: none;
    }
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    padding: 20px 24px;
    background: var(--bg-deeper);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .player-hero.lb-row { grid-template-columns: minmax(0, 1fr) auto; }
    .podium { flex-direction: column; gap: 30px; }
    .podium-card--first { transform: none; }
    .player-header { flex-wrap: wrap; }
    .combat-row { grid-template-columns: 64px minmax(0,1fr) 80px; }
    .combat-row .combat-weapon,
    .combat-row .combat-hit { display: none; }
    .hit-panel-body {
        height: clamp(280px, 55vw, 380px);
        grid-template-columns: minmax(0, 1fr) minmax(100px, 38%) minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .container { padding: 24px 12px 40px; }
    .stat-grid-5 { grid-template-columns: 1fr; }
    .breakdown-header,
    .breakdown-row {
        grid-template-columns: minmax(0,1fr) 80px 80px;
    }
    .breakdown-header span:nth-child(n+4),
    .breakdown-row   span:nth-child(n+4) { display: none; }
    .hit-panel-body {
        height: clamp(260px, 72vw, 320px);
        padding-inline: 8px;
        grid-template-columns: minmax(0, 1fr) minmax(88px, 36%) minmax(0, 1fr);
    }
    .hit-lines-svg {
        inset: 20px 8px 10px;
        width: calc(100% - 16px);
    }
    .hit-label-pct { margin-left: 3px; }
    .page-panel {
        margin: 1rem 0.75rem;
        padding: 1.25rem;
    }
    .articles-grid {
        grid-template-columns: 1fr;
        padding: 1rem 0.75rem;
    }
}
