:root {
    --bg: #090b0f;
    --bg-elevated: #131821;
    --panel: #171d27;
    --panel-strong: #202938;
    --panel-soft: rgba(18, 24, 33, 0.85);
    --border: #2b3445;
    --border-strong: #3a475f;
    --text: #f3f5f7;
    --text-muted: #a7b3c4;
    --accent: #ff8a1c;
    --accent-soft: rgba(255, 138, 28, 0.18);
    --secondary: #53a7ff;
    --secondary-soft: rgba(83, 167, 255, 0.16);
    --success: #3ddc84;
    --success-soft: rgba(61, 220, 132, 0.16);
    --muted-soft: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-sm: 12px;
    --container: 1180px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(255, 138, 28, 0.16), transparent 30%),
        radial-gradient(circle at top left, rgba(83, 167, 255, 0.12), transparent 25%),
        linear-gradient(180deg, #0b0e13 0%, #090b0f 100%);
    color: var(--text);
    font: 16px/1.5 'Trebuchet MS', 'Segoe UI', Tahoma, sans-serif;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 85%);
}
.page-shell {
    position: relative;
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
    padding: 24px 0 48px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.site-header, .site-footer, .panel, .hero-block, .stat-card, .mode-card { backdrop-filter: blur(10px); }
.site-header {
    margin-bottom: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(23, 29, 39, 0.96), rgba(14, 18, 25, 0.96));
    box-shadow: var(--shadow);
}
.site-header__inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 22px 24px;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.site-brand__logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 1px solid rgba(255, 138, 28, 0.22);
    background: linear-gradient(135deg, rgba(255, 138, 28, 0.18), rgba(83, 167, 255, 0.10));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.site-brand__text {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.site-kicker, .hero-block__eyebrow, .stat-card__label, .mode-chip {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.site-title, .hero-block__title, .panel__header h3, .panel__header h2, .mode-card__header h3 {
    margin: 0;
    line-height: 1.1;
}
.site-title { font-size: clamp(28px, 3vw, 40px); }
.site-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.site-nav a, .player-link, .button, .pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(83, 167, 255, 0.3);
    border-radius: 999px;
    background: rgba(83, 167, 255, 0.08);
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.site-nav a:hover, .player-link:hover, .button:hover, .pagination__page:hover {
    background: rgba(255, 138, 28, 0.14);
    border-color: rgba(255, 138, 28, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.site-nav a.is-active {
    background: linear-gradient(135deg, rgba(255,138,28,0.22), rgba(255,138,28,0.10));
    border-color: rgba(255,138,28,0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.button--primary {
    background: linear-gradient(135deg, rgba(255,138,28,0.22), rgba(255,138,28,0.10));
    border-color: rgba(255,138,28,0.35);
}
.button--ghost { background: rgba(83, 167, 255, 0.08); }
.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}
.site-main {
    display: grid;
    gap: 22px;
    flex: 1;
}
.hero-block, .panel, .stat-card, .mode-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(23, 29, 39, 0.96), rgba(16, 21, 29, 0.96));
    box-shadow: var(--shadow);
}
.hero-block {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    padding: 24px;
}
.hero-block--compact { align-items: start; }
.hero-block__title { font-size: clamp(28px, 3vw, 42px); }
.hero-block__text, .panel__header p, .site-footer p { margin: 8px 0 0; color: var(--text-muted); }
.hero-block__meta { display: flex; align-items: center; }
.hero-block__controls {
    display: grid;
    gap: 12px;
    width: min(100%, 360px);
}
.hero-block__controls--compact {
    width: min(100%, 320px);
    justify-items: end;
}
.search-form, .server-form {
    display: grid;
    gap: 12px;
    min-width: min(100%, 360px);
}
.search-form__field, .server-form__field { display: grid; gap: 8px; }
.search-form__field span, .server-form__field span { color: var(--text-muted); font-size: 14px; }
.search-form__field input, .server-form__field select {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-strong);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.search-form__field input:focus, .server-form__field select:focus {
    border-color: rgba(83, 167, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(83, 167, 255, 0.12);
}
.search-form__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}
.stat-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
}
.stat-card__icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 138, 28, 0.20), rgba(83, 167, 255, 0.08));
    border: 1px solid rgba(255, 138, 28, 0.18);
    border-radius: 14px;
}
.stat-card__icon svg { width: 26px; height: 26px; }
.stat-card__body { min-width: 0; }
.stat-card__value {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    word-break: break-word;
}
.panel { padding: 22px; }
.panel__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(9, 11, 15, 0.55);
}
.data-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}
.data-table--progress { min-width: 620px; }
.data-table th, .data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    white-space: nowrap;
}
.data-table thead th {
    position: sticky;
    top: 0;
    background: rgba(32, 41, 56, 0.98);
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.data-table tbody tr { transition: background-color 0.18s ease, transform 0.18s ease; }
.data-table tbody tr:hover { background: rgba(83, 167, 255, 0.08); }
.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}
.sort-link span { color: var(--accent); min-width: 12px; }
.player-name-cell { font-weight: 700; color: var(--text); }
.table-empty, .panel--empty { color: var(--text-muted); }
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}
.pagination__pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination__page {
    min-width: 42px;
    padding: 9px 12px;
}
.pagination__page.is-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 138, 28, 0.18);
    border: 1px solid rgba(255, 138, 28, 0.35);
    color: var(--text);
}
.pagination__ellipsis { color: var(--text-muted); padding: 0 6px; }
.mode-cards {
    display: grid;
    gap: 18px;
}
.mode-card {
    padding: 20px;
    background: linear-gradient(180deg, rgba(26, 33, 45, 0.96), rgba(16, 21, 29, 0.96));
}
.mode-card__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 14px;
}
.mode-card__stats, .mode-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.mode-card__stats span, .mode-meta span, .mode-chip, .multiplier-pill {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 138, 28, 0.22);
    background: var(--accent-soft);
    color: var(--text);
    letter-spacing: normal;
    font-size: 13px;
}
.multiplier--gray {
    color: #d3d8df;
    border-color: rgba(255,255,255,0.12);
    background: var(--muted-soft);
}
.multiplier--blue {
    color: #a8d1ff;
    border-color: rgba(83, 167, 255, 0.28);
    background: var(--secondary-soft);
}
.multiplier--orange {
    color: #ffcf9b;
    border-color: rgba(255, 138, 28, 0.35);
    background: var(--accent-soft);
}
.multiplier--green {
    color: #b9ffd8;
    border-color: rgba(61, 220, 132, 0.3);
    background: var(--success-soft);
}
.site-footer {
    margin-top: 22px;
    padding: 18px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(18, 23, 31, 0.96), rgba(12, 16, 22, 0.96));
}
@media (max-width: 860px) {
    .site-header__inner, .hero-block, .panel__header, .mode-card__header, .pagination {
        flex-direction: column;
        align-items: start;
    }
    .page-shell {
        width: min(calc(100% - 20px), var(--container));
        padding-top: 18px;
    }
    .panel, .hero-block, .site-header__inner, .site-footer, .mode-card {
        padding-left: 16px;
        padding-right: 16px;
    }
    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }
    .site-brand {
        width: 100%;
    }
    .site-brand__logo {
        width: 48px;
        height: 48px;
    }
    .hero-block__controls, .hero-block__controls--compact, .search-form, .server-form { width: 100%; }
    .hero-block__controls--compact { justify-items: stretch; }
    .search-form, .server-form { min-width: 100%; }
    .data-table { min-width: 760px; }
}
