/* ==========================================================================
   ТипоРалли — базовая тема, каркас, общие компоненты
   ========================================================================== */

:root {
    --bg: #050912;
    --bg-soft: #0a1120;
    --surface: rgba(17, 26, 46, 0.82);
    --surface-solid: #101a2d;
    --surface-2: #0b1322;
    --line: rgba(148, 170, 220, 0.14);
    --line-soft: rgba(148, 170, 220, 0.08);
    --text: #edf3ff;
    --muted: #93a2c4;
    --muted-2: #6f7f9f;
    --accent: #ffb020;
    --accent-soft: rgba(255, 176, 32, 0.12);
    --accent-2: #ff6a3d;
    --teal: #5af0c9;
    --danger: #ff5470;
    --success: #58e6a2;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --header-height: 74px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 560px at 12% -12%, rgba(255, 176, 32, 0.1), transparent 62%),
        radial-gradient(900px 500px at 92% 0%, rgba(73, 110, 255, 0.1), transparent 58%),
        radial-gradient(900px 600px at 50% 110%, rgba(255, 91, 61, 0.05), transparent 65%),
        linear-gradient(rgba(148, 170, 220, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 170, 220, 0.022) 1px, transparent 1px);
    background-size: auto, auto, auto, 72px 72px, 72px 72px;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

img,
svg,
canvas {
    display: block;
    max-width: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover {
    color: #ffd27a;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    line-height: 1.12;
    letter-spacing: -0.025em;
    font-weight: 800;
}

ul,
ol {
    padding-left: 1.2em;
}

code,
kbd {
    font-family: var(--font-mono);
}

::selection {
    background: rgba(255, 176, 32, 0.3);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 0 0 10px 10px;
    background: var(--accent);
    color: #14100a;
    font-weight: 800;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    color: #14100a;
}

.container {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

.site-main {
    position: relative;
    z-index: 1;
    padding-top: 40px;
}

.muted {
    color: var(--muted);
}

.text-gradient {
    background: linear-gradient(115deg, #ffd36b 0%, #ff9a3d 45%, #ff5f3d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Шапка ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 9, 18, 0.76);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 26px;
    min-height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    flex: none;
}

.brand:hover {
    color: var(--text);
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: var(--accent);
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 214, 130, 0.2), transparent 55%),
        linear-gradient(135deg, rgba(255, 176, 32, 0.18), rgba(255, 90, 61, 0.08));
    border: 1px solid rgba(255, 176, 32, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 26px rgba(255, 140, 40, 0.12);
}

.brand__mark svg {
    width: 27px;
    height: 27px;
}

.brand__text strong {
    display: block;
    font-size: 1.04rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

.brand__text small {
    display: block;
    margin-top: 2px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.site-nav__link {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.site-nav__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
}

.site-nav__link.is-active {
    color: var(--accent);
    background: rgba(255, 176, 32, 0.08);
    border-color: rgba(255, 176, 32, 0.18);
}

.site-nav__link--mobile {
    display: none;
}

.site-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.account-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    max-width: 220px;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.account-link:hover {
    color: var(--text);
    border-color: rgba(255, 176, 32, 0.3);
    background: rgba(255, 176, 32, 0.06);
}

.account-link.is-active {
    border-color: rgba(255, 176, 32, 0.38);
}

.account-link__nick {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 700;
}

.logout-form {
    display: flex;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nav-toggle span {
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn--primary {
    color: #1b1105;
    background: linear-gradient(135deg, #ffd15c 0%, #ffa134 42%, #ff7240 100%);
    box-shadow: 0 12px 28px rgba(255, 128, 45, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--primary:hover {
    color: #1b1105;
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 16px 34px rgba(255, 128, 45, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--ghost {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.032);
    color: #dbe5f8;
}

.btn--ghost:hover {
    color: #fff;
    border-color: rgba(255, 176, 32, 0.32);
    background: rgba(255, 176, 32, 0.07);
}

.btn--danger-ghost {
    border-color: rgba(255, 84, 112, 0.24);
    background: rgba(255, 84, 112, 0.06);
    color: #ff97a6;
}

.btn--danger-ghost:hover {
    color: #ffc0c8;
    border-color: rgba(255, 84, 112, 0.42);
    background: rgba(255, 84, 112, 0.1);
}

.btn--sm {
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 0.78rem;
}

.btn--lg {
    min-height: 50px;
    padding: 14px 24px;
    border-radius: 13px;
    font-size: 0.98rem;
}

.btn--block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    color: var(--accent);
    border-color: rgba(255, 176, 32, 0.3);
    background: rgba(255, 176, 32, 0.07);
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.icon-btn--subtle {
    width: 34px;
    height: 34px;
    border-color: transparent;
    background: transparent;
}

.icon-btn--subtle:hover {
    border-color: var(--line);
}

.text-link {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.text-link:hover {
    color: #ffd27a;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-size: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Формы ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c9d4ea;
    font-size: 0.79rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.field__error {
    margin: 0;
    color: #ff98a6;
    font-size: 0.74rem;
    line-height: 1.4;
}

.input {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    color: var(--text);
    background: #0a1220;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.92rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input::placeholder {
    color: #5a6884;
}

.input:hover {
    border-color: rgba(148, 170, 220, 0.24);
}

.input:focus {
    outline: none;
    border-color: rgba(255, 176, 32, 0.6);
    box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.09);
    background: #0b1424;
}

.input[aria-invalid="true"] {
    border-color: rgba(255, 84, 112, 0.65);
    box-shadow: 0 0 0 4px rgba(255, 84, 112, 0.08);
}

.input--readonly,
.input--readonly:hover {
    display: flex;
    align-items: center;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.028);
    color: var(--accent);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    cursor: default;
}

textarea.input {
    resize: vertical;
    min-height: 110px;
    line-height: 1.55;
}

select.input {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 13px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
    cursor: pointer;
}

.input-wrap {
    position: relative;
}

.input-wrap .input {
    padding-right: 78px;
}

.input-wrap__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 7px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.input-wrap__toggle:hover {
    background: rgba(255, 176, 32, 0.08);
}

.input-suffix {
    position: relative;
}

.input-suffix .input {
    padding-right: 58px;
}

.input-suffix > span {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--muted-2);
    font-size: 0.78rem;
    font-weight: 700;
    pointer-events: none;
}

.range {
    width: 100%;
    height: 8px;
    margin: 5px 0 2px;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, rgba(255, 176, 32, 0.85), rgba(255, 106, 61, 0.85));
    cursor: pointer;
}

.range::-webkit-slider-thumb {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    background: #fff7e8;
    border: 4px solid #ff9d2f;
    box-shadow: 0 0 0 4px rgba(255, 157, 47, 0.14), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff7e8;
    border: 4px solid #ff9d2f;
    box-shadow: 0 0 0 4px rgba(255, 157, 47, 0.14);
}

.range:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px;
}

.range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--muted-2);
    font-size: 0.65rem;
    font-weight: 700;
}

.damage-options {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.damage-option {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.damage-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.damage-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.018);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.damage-option:hover span {
    border-color: rgba(255, 176, 32, 0.3);
    background: rgba(255, 176, 32, 0.045);
    color: var(--text);
}

.damage-option input:checked + span {
    border-color: transparent;
    background: linear-gradient(135deg, #ffd15c, #ffa134 58%, #ff7240);
    box-shadow: 0 8px 18px rgba(255, 128, 45, 0.2);
    color: #1b1105;
}

.damage-option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.damage-options--compact .damage-option {
    flex: 0 0 auto;
}

.damage-options--compact .damage-option span {
    min-width: 44px;
    min-height: 34px;
    padding-inline: 12px;
    font-size: 0.8rem;
}

.setting-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    background: rgba(255, 176, 32, 0.1);
    border: 1px solid rgba(255, 176, 32, 0.2);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hint {
    color: var(--muted-2);
    font-size: 0.72rem;
    line-height: 1.5;
}

.hint--center {
    text-align: center;
}

.alert {
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    line-height: 1.45;
}

.alert--error {
    color: #ffb3be;
    background: rgba(255, 84, 112, 0.08);
    border-color: rgba(255, 84, 112, 0.24);
}

.alert--success {
    color: #9cffd0;
    background: rgba(88, 230, 162, 0.07);
    border-color: rgba(88, 230, 162, 0.22);
}

/* ---------- Бейджи и аватары ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--lang {
    color: #ffd27a;
    border-color: rgba(255, 176, 32, 0.24);
    background: rgba(255, 176, 32, 0.08);
}

.badge--lang-en {
    color: #8bd8ff;
    border-color: rgba(104, 194, 255, 0.22);
    background: rgba(104, 194, 255, 0.08);
}

.badge--damage {
    color: #ffc46b;
    border-color: rgba(255, 176, 32, 0.26);
    background: rgba(255, 176, 32, 0.09);
}

.badge--diff-easy {
    color: #85f3c7;
    border-color: rgba(88, 230, 162, 0.22);
    background: rgba(88, 230, 162, 0.07);
}

.badge--diff-medium {
    color: #ffd27a;
    border-color: rgba(255, 176, 32, 0.22);
    background: rgba(255, 176, 32, 0.07);
}

.badge--diff-hard {
    color: #ff9cad;
    border-color: rgba(255, 84, 112, 0.22);
    background: rgba(255, 84, 112, 0.07);
}

.badge--success {
    color: #8bf0c5;
    border-color: rgba(88, 230, 162, 0.22);
    background: rgba(88, 230, 162, 0.08);
}

.badge--danger {
    color: #ff9aab;
    border-color: rgba(255, 84, 112, 0.22);
    background: rgba(255, 84, 112, 0.08);
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #172138;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    object-fit: cover;
}

.avatar--fallback {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 50%),
        linear-gradient(135deg, hsl(var(--avatar-hue, 30) 68% 46%), hsl(calc(var(--avatar-hue, 30) + 42) 66% 29%));
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.avatar--xs {
    width: 24px;
    height: 24px;
    font-size: 0.58rem;
}

.avatar--sm {
    width: 34px;
    height: 34px;
    font-size: 0.72rem;
}

.avatar--lg {
    width: 76px;
    height: 76px;
    font-size: 1.4rem;
    border-width: 2px;
}

.avatar--xl {
    width: 118px;
    height: 118px;
    font-size: 2rem;
    border-width: 3px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
}

/* ---------- Карточки, заголовки страниц ---------- */

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(700px 220px at 12% -10%, rgba(255, 176, 32, 0.045), transparent 65%),
        linear-gradient(180deg, rgba(22, 32, 56, 0.82), rgba(10, 16, 30, 0.94));
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(255, 176, 32, 0.9);
}

.page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 30px;
}

.page-hero h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.1rem, 4.3vw, 3.4rem);
}

.page-hero p {
    max-width: 650px;
    color: var(--muted);
    font-size: 0.98rem;
}

.page-hero__stats {
    display: flex;
    gap: 12px;
    flex: none;
}

.hero-stat {
    min-width: 118px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.hero-stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.hero-stat span {
    display: block;
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 0.7rem;
    line-height: 1.35;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.section-head h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.section-head p {
    color: var(--muted);
    font-size: 0.82rem;
}

/* ---------- Таблицы ---------- */

.table-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.022);
}

.data-table tr.is-me {
    background: rgba(255, 176, 32, 0.055);
}

.data-table tr.is-me:hover {
    background: rgba(255, 176, 32, 0.08);
}

.table-number {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.table-link {
    color: var(--text);
    font-weight: 600;
}

.table-link:hover {
    color: var(--accent);
}

.table-player {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 150px;
    font-weight: 600;
}

.table-rank {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.you-label {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 176, 32, 0.14);
    color: var(--accent);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ---------- Пустые состояния ---------- */

.empty-state {
    padding: 46px 28px;
    border: 1px dashed rgba(148, 170, 220, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.014);
    text-align: center;
}

.empty-state__icon {
    display: block;
    margin-bottom: 10px;
    font-size: 2.1rem;
    filter: grayscale(0.15);
}

.empty-state h2,
.empty-state h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.empty-state p {
    max-width: 520px;
    margin: 0 auto 20px;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ---------- Тосты ---------- */

.flash-stack {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 20px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(12, 19, 34, 0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
    color: var(--text);
    font-size: 0.79rem;
    line-height: 1.45;
    pointer-events: auto;
    animation: toast-in 0.25s ease both;
}

.toast.is-leaving {
    animation: toast-out 0.2s ease both;
}

.toast__dot {
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 176, 32, 0.7);
}

.toast--success .toast__dot {
    background: var(--success);
    box-shadow: 0 0 10px rgba(88, 230, 162, 0.7);
}

.toast--error .toast__dot {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(255, 84, 112, 0.7);
}

.toast--warning .toast__dot {
    background: #ffcf5c;
    box-shadow: 0 0 10px rgba(255, 207, 92, 0.7);
}

.toast__text {
    flex: 1;
}

.toast__close {
    flex: none;
    width: 22px;
    height: 22px;
    margin: -3px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.toast__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(18px);
    }
}

/* ---------- Подвал ---------- */

.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 72px;
    padding: 30px 0;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 0.75rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 30px;
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}

.site-footer__brand strong {
    color: var(--text);
}

.site-footer__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 176, 32, 0.7);
}

.site-footer__links {
    display: flex;
    gap: 18px;
}

.site-footer__links a {
    color: var(--muted);
}

.site-footer__links a:hover {
    color: var(--accent);
}

.site-footer__copy {
    flex-basis: 100%;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

/* ---------- Ошибка 404 ---------- */

.error-page {
    max-width: 680px;
    margin: 80px auto;
    text-align: center;
}

.error-page__code {
    color: transparent;
    font-family: var(--font-display);
    font-size: clamp(6rem, 16vw, 11rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.06em;
    background: linear-gradient(120deg, rgba(255, 176, 32, 0.9), rgba(255, 95, 61, 0.7));
    -webkit-background-clip: text;
    background-clip: text;
}

.error-page h1 {
    margin: 20px 0 12px;
    font-size: 2rem;
}

.error-page p {
    color: var(--muted);
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1080px) {
    .site-header__inner {
        gap: 16px;
    }

    .site-nav__link {
        padding: 9px 10px;
    }

    .brand__text small {
        display: none;
    }

    .account-link__nick {
        max-width: 90px;
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 64px;
    }

    .container {
        width: min(1240px, calc(100% - 32px));
    }

    .site-main {
        padding-top: 28px;
    }

    .site-header__inner {
        flex-wrap: wrap;
    }

    .brand {
        order: 1;
    }

    .site-account {
        order: 2;
        margin-left: auto;
    }

    .nav-toggle {
        display: flex;
        order: 3;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 8px);
        left: 16px;
        right: 16px;
        z-index: 70;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: rgba(9, 15, 28, 0.98);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav__link {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .site-nav__link--mobile {
        display: block;
    }

    .site-header {
        position: sticky;
    }

    .page-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
    }

    .page-hero__stats {
        align-self: flex-start;
    }

    .flash-stack {
        top: calc(var(--header-height) + 12px);
        right: 16px;
        left: 16px;
        width: auto;
    }
}

@media (max-width: 620px) {
    .site-main {
        padding-top: 22px;
    }

    .brand__mark {
        width: 38px;
        height: 38px;
    }

    .brand__text strong {
        font-size: 0.95rem;
    }

    .site-account__login {
        display: none;
    }

    .account-link__nick {
        display: none;
    }

    .account-link {
        padding-right: 4px;
    }

    .logout-form {
        display: none;
    }

    .page-hero h1 {
        font-size: clamp(1.9rem, 9vw, 2.8rem);
    }

    .page-hero__stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .hero-stat:last-child {
        grid-column: 1 / -1;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer__links {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
