/*
 * Базовая тема (D-43, D-56): тёмно-синяя, с боковым меню кабинета.
 * Значения переменных ниже по умолчанию; владелец меняет их в админке («Оформление»),
 * сайт подключает их файлом /theme/vars.css после этого файла.
 */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter/inter-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --color-bg: #151a2b;
    --color-bg2: #1f2a48;
    --color-surface: #1d2333;
    --color-surface2: #262d40;
    --color-border: #2f3850;
    --color-text: #e8eaf0;
    --color-muted: #9aa3b5;
    --color-primary: #2563eb;
    --color-primary-text: #ffffff;
    --color-accent: #3b82f6;
    --color-price: #60a5fa;
    --color-gold: #d4a94f;
    --color-danger: #e5383b;
    --color-success: #3fb950;
    --font-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius: 10px;
    --content-width: 1280px;
    --sidebar-width: 270px;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--color-bg2); }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Градиент на всю высоту страницы (без fixed: на длинных страницах и телефонах он обрывался) */
    /* Картинка фона из админки (--bg-image, D-92) под затемнением; без картинки только градиент */
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--color-bg) 35%, transparent) 0%, color-mix(in srgb, var(--color-bg2) 85%, transparent) 100%),
        var(--bg-image, none) center top / cover no-repeat,
        linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg2) 100%);
    background-color: var(--color-bg2);
    color: var(--color-text);
    font-family: var(--font-base);
    line-height: 1.5;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-text); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 16px; }
h2 { font-size: 1.3rem; margin: 28px 0 12px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--color-muted); }
.small { font-size: .9rem; }
.hint { color: var(--color-muted); font-size: .9rem; }
.right { text-align: right; }
.positive { color: var(--color-success); }
.negative { color: var(--color-danger); }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; z-index: 100; background: var(--color-surface); padding: 8px 12px; border-radius: var(--radius); }

.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }

/* --- Шапка и подвал --- */
.site-header {
    background: rgba(0, 0, 0, .18);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(6px);
}
.site-header .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.site-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.15rem; font-weight: 700; color: var(--color-text); text-decoration: none;
    white-space: nowrap;
}
.site-title img { height: 40px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.site-nav a, .site-nav .link-button {
    color: var(--color-text); text-decoration: none;
    padding: 8px 12px; border-radius: var(--radius);
}
.site-nav a:hover, .site-nav a.active { background: var(--color-surface2); color: var(--color-text); }
.site-nav-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.lang-switch { display: flex; gap: 2px; margin-left: 8px; }
.lang-switch a { color: var(--color-muted); padding: 6px 8px; font-size: .85rem; }
.lang-switch a.active { color: var(--color-text); font-weight: 700; }
.nav-toggle { display: none; }

.site-main { flex: 1; padding: 24px 0 48px; }

.site-footer {
    border-top: 1px solid var(--color-border);
    background: rgba(0, 0, 0, .18);
    color: var(--color-muted);
    padding: 24px 0;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--color-muted); text-decoration: none; }
.site-footer a:hover { color: var(--color-text); }
.site-footer .copyright { margin-left: auto; }

/* --- Кнопки и формы --- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    background: var(--color-primary);
    color: var(--color-primary-text);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit; font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s;
}
.button:hover { filter: brightness(1.12); color: var(--color-primary-text); }
.button-secondary { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.button-secondary:hover { background: var(--color-surface2); color: var(--color-text); }
.button-small { padding: 7px 14px; font-size: .9rem; }
.cell-action { display: table; margin-top: 6px; white-space: nowrap; }
.button-block { width: 100%; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: none; padding: 0; cursor: pointer; color: var(--color-accent); font: inherit; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px);
    padding: 24px;
    margin: 0 0 20px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.form-card { max-width: 520px; margin: 16px auto; }
.cabinet-content .form-card { margin-left: 0; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea, .copy-field, input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, input[type="number"]:focus {
    outline: 2px solid var(--color-primary); outline-offset: 0; border-color: transparent;
}
.field .hint { display: block; margin-top: 4px; }
.field .error, .error { color: #ff7b72; margin-top: 4px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #ff7b72; }
.checkbox { display: block; margin-bottom: 16px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-primary); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 20px; }
.alert-success { background: rgba(63, 185, 80, .12); border: 1px solid rgba(63, 185, 80, .45); }
.alert-error { background: rgba(229, 56, 59, .12); border: 1px solid rgba(229, 56, 59, .5); }
.alert-info { background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .45); }

/* --- Таблицы --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; color: var(--color-text); font-weight: 600;
    padding: 12px 10px; border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.table .right { text-align: right; }
.empty { text-align: center; color: var(--color-muted); padding: 24px 0; }

/* --- Значки и вкладки --- */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.badge-up { background: rgba(63, 185, 80, .15); color: #7ee2a0; }
.badge-down { background: rgba(229, 56, 59, .15); color: #ff9b94; }
.badge-unknown { background: var(--color-surface2); color: var(--color-muted); }
.badge-server { background: color-mix(in srgb, var(--color-primary) 18%, transparent); color: var(--color-price); border: 1px solid color-mix(in srgb, var(--color-primary) 45%, transparent); }
.badge-test { background: color-mix(in srgb, var(--color-danger) 20%, transparent); color: #ffb3ae; border: 1px solid color-mix(in srgb, var(--color-danger) 50%, transparent); }
.product-flags { list-style: none; margin: 8px 0; padding: 0; font-size: .9rem; color: var(--color-muted); }
.product-flags li { margin: 4px 0; }
.badge-ticket-open { background: color-mix(in srgb, var(--color-gold) 16%, transparent); color: #f1cf86; }
.badge-ticket-answered { background: rgba(63, 185, 80, .15); color: #7ee2a0; }
.badge-ticket-closed { background: var(--color-surface2); color: var(--color-muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 20px; }
.tabs a { color: var(--color-text); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--color-price); }
.tabs a.active { color: var(--color-price); border-bottom-color: var(--color-price); }

.pagination { display: flex; gap: 16px; justify-content: center; margin: 20px 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; }
.lead { color: var(--color-muted); margin: -8px 0 20px; }

/* --- Главная: баннер, серверы, новости --- */
.hero {
    position: relative;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    min-height: 320px;
    display: flex; align-items: flex-end;
    background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--color-primary) 45%, transparent), transparent 60%), var(--color-surface);
    border: 1px solid var(--color-border);
    margin-bottom: 28px;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 14, 26, .9) 0%, rgba(10, 14, 26, .2) 70%); }
.hero-content { position: relative; z-index: 1; padding: 32px; max-width: 760px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 8px; }
.hero p { color: var(--color-text); opacity: .9; margin: 0 0 20px; font-size: 1.1rem; }

.servers {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px; padding: 0; margin: 0; list-style: none;
}
/* Карточка сервера (D-93): слева название и статусы, справа квадратный логотип; вся карточка кликабельна */
.server-card {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; align-items: center;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px); padding: 16px 16px 16px 20px;
    transition: border-color .15s, transform .15s;
}
.server-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.server-card:focus-within { border-color: var(--color-accent); }
.server-link { color: inherit; text-decoration: none; }
.server-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.server-link:focus-visible { outline: none; }
.server-link:focus-visible::after { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.server-logo {
    width: 96px; height: 96px; aspect-ratio: 1; object-fit: cover;
    border-radius: var(--radius); border: 1px solid var(--color-gold);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-gold) 15%, transparent);
    background: var(--color-bg);
}
.theme-preview-bar {
    display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center;
    padding: 8px 16px; background: var(--color-gold); color: #1a1406; font-weight: 600;
}
.theme-preview-bar a, .theme-preview-bar .link-button { color: #1a1406; text-decoration: underline; }
.theme-preview-bar form { margin: 0; }
.server-title { display: block; font-size: 1.15rem; margin-bottom: 12px; }
.status-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; align-items: center; }
.status-list dt { color: var(--color-muted); white-space: nowrap; }
.status-list dd { margin: 0; min-width: 0; }
/* Онлайн «X / Y»: цифры одной ширины, строка не прыгает при смене чисел */
.online-split { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.online-count { font-size: 1.3rem; color: var(--color-price); }
.online-sep { color: var(--color-muted); }
.online-traders { color: var(--color-muted); font-size: 1.05rem; }

/* Страница сервера (D-93) */
.server-head { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 24px; align-items: start; }
.server-head h1 { margin: 0 0 4px; }
.server-head-main { display: grid; gap: 14px; min-width: 0; }
.server-head-main > p { margin: 0; }
.server-logo-lg { width: 128px; height: 128px; }
.status-inline { grid-template-columns: auto auto; justify-content: start; }
.server-rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.rate { display: grid; gap: 2px; text-align: center; padding: 14px; }
.rate-label { color: var(--color-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.rate-value { font-size: 1.5rem; color: var(--color-gold); font-variant-numeric: tabular-nums; }
.server-description { max-width: none; margin-top: 20px; }
@media (max-width: 600px) {
    .server-head { grid-template-columns: 1fr; justify-items: start; }
    .server-logo-lg { width: 96px; height: 96px; }
}

.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.news-card {
    display: flex; flex-direction: column;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px); overflow: hidden;
    color: var(--color-text); text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.news-card:hover { border-color: var(--color-primary); color: var(--color-text); transform: translateY(-2px); }
.news-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.news-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.news-card h3 { margin: 0; font-size: 1.1rem; }
.news-date { color: var(--color-muted); font-size: .85rem; }
.pin { color: var(--color-gold); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Ролик о серверах на главной (D-89): 16:9 на любой ширине */
.home-video { margin: 28px 0; }
.video-frame {
    position: relative; width: 100%; max-width: 960px; aspect-ratio: 16 / 9;
    border-radius: var(--radius); overflow: hidden; background: #000;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- Текст страниц и новостей (Markdown, D-58) --- */
.prose { max-width: 820px; }
.prose img { border-radius: var(--radius); }
.prose h2 { margin-top: 32px; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.prose th, .prose td { border: 1px solid var(--color-border); padding: 8px 10px; text-align: left; }
.prose blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--color-gold); background: var(--color-surface); border-radius: 0 var(--radius) var(--radius) 0; }
.prose code { background: var(--color-surface2); padding: 1px 6px; border-radius: 6px; }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: calc(var(--radius) + 2px); margin-bottom: 20px; }
.downloads { display: grid; gap: 12px; margin-top: 24px; }
.download-file h2 { margin: 0 0 4px; font-size: 1.2rem; }
.download-mirrors { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.checksum { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: .85rem; }
.checksum dt { color: var(--color-muted); }
.checksum dd { margin: 0; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

/* --- Кабинет: боковое меню (D-32, ориентиры владельца) --- */
.cabinet { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: 32px; align-items: start; }
.cabinet-menu { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }
.cabinet-menu .menu-body { display: flex; flex-direction: column; gap: 16px; }
.cabinet-content { min-width: 0; }

.server-picker { position: relative; }
.server-picker select {
    width: 100%; appearance: none;
    padding: 14px 40px 14px 44px;
    background: var(--color-surface); color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: var(--radius);
    font: inherit; font-weight: 700; cursor: pointer;
}
.server-picker .icon { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--color-muted); }
.server-picker .icon-start { left: 14px; }
.server-picker .icon-end { right: 14px; width: 16px; height: 16px; }

.menu-balance {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 12px 16px;
}
.menu-balance strong { font-size: 1.15rem; color: var(--color-price); }

.menu-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); padding: 0 14px; }
.menu-links { display: flex; flex-direction: column; gap: 4px; }
.menu-links a, .menu-group > summary {
    display: flex; align-items: center; gap: 12px;
    color: var(--color-text); text-decoration: none;
    padding: 11px 14px; border-radius: var(--radius);
    cursor: pointer; list-style: none;
}
.menu-group > summary::-webkit-details-marker { display: none; }
.menu-links a:hover, .menu-group > summary:hover { background: var(--color-surface); color: var(--color-text); }
.menu-links a.active { background: var(--color-primary); color: var(--color-primary-text); }
.menu-links a.active .icon { color: var(--color-primary-text); }
.menu-links .icon { color: var(--color-muted); }
.menu-group > summary .chevron { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; }
.menu-group[open] > summary { background: var(--color-surface); }
.menu-group[open] > summary .chevron { transform: rotate(180deg); }
.menu-group .menu-sub { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 0 20px; }
.menu-group .menu-sub a { padding: 9px 14px; }
.menu-soon { margin-left: auto; font-size: .7rem; color: var(--color-muted); border: 1px solid var(--color-border); border-radius: 999px; padding: 0 8px; }
.menu-toggle { display: none; }
.menu-toggle-server { margin-left: auto; }
.noscript-submit { margin-top: 8px; }

/* --- Кабинет: аккаунты и персонажи --- */
.account { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.account:last-child { border-bottom: none; padding-bottom: 0; }
.account-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.right-link { margin-left: auto; }

/* --- Магазин (D-37, D-59) --- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.product-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px); padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.product-card:hover { border-color: var(--color-primary); box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent), 0 8px 24px rgba(0, 0, 0, .25); }
.product-card.sold-out { opacity: .55; }
.product-card h3 { margin: 4px 0 0; font-size: 1rem; line-height: 1.3; }
.product-card h3 a { color: var(--color-text); text-decoration: none; }
.product-image {
    position: relative; aspect-ratio: 1 / 1;
    background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--color-primary) 35%, transparent), transparent 65%), #0e1424;
    border: 1px solid color-mix(in srgb, var(--color-gold) 45%, transparent);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { color: var(--color-muted); font-size: 1.3rem; font-weight: 600; }
.product-card > a { text-decoration: none; }
.product-badge {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    background: var(--color-primary); color: var(--color-primary-text);
}
.product-badge.badge-sale { background: var(--color-danger); color: #fff; }
.product-badge.badge-new { background: var(--color-success); color: #0b1a10; }
.product-badge.badge-hot { background: var(--color-gold); color: #1a1406; }
.product-description {
    margin: 0; color: var(--color-muted); font-size: .9rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stock { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--color-muted); }
.stock-bar { height: 4px; background: var(--color-surface2); border-radius: 999px; overflow: hidden; }
.stock-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--color-gold), #f5c451); }
.stock-bar .w-0 { width: 0%; }
.stock-bar .w-5 { width: 5%; }
.stock-bar .w-10 { width: 10%; }
.stock-bar .w-15 { width: 15%; }
.stock-bar .w-20 { width: 20%; }
.stock-bar .w-25 { width: 25%; }
.stock-bar .w-30 { width: 30%; }
.stock-bar .w-35 { width: 35%; }
.stock-bar .w-40 { width: 40%; }
.stock-bar .w-45 { width: 45%; }
.stock-bar .w-50 { width: 50%; }
.stock-bar .w-55 { width: 55%; }
.stock-bar .w-60 { width: 60%; }
.stock-bar .w-65 { width: 65%; }
.stock-bar .w-70 { width: 70%; }
.stock-bar .w-75 { width: 75%; }
.stock-bar .w-80 { width: 80%; }
.stock-bar .w-85 { width: 85%; }
.stock-bar .w-90 { width: 90%; }
.stock-bar .w-95 { width: 95%; }
.stock-bar .w-100 { width: 100%; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.price { font-size: 1.15rem; font-weight: 700; color: var(--color-price); white-space: nowrap; }
.price s { font-size: .85rem; font-weight: 400; color: var(--color-muted); margin-right: 6px; }

.product-page { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 32px; align-items: start; }
.product-page .product-image { aspect-ratio: 1 / 1; }
.product-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0; }
.product-facts dt { color: var(--color-muted); }
.product-facts dd { margin: 0; }
.buy-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 20px; }
.buy-form .field { margin: 0; width: 140px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; text-decoration: none; }

/* --- Склад --- */
.qty-input { width: 100px; }

/* --- Поддержка (D-39, ориентир 1) --- */
.tickets { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; min-height: 520px; }
.tickets-list, .tickets-view {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px);
    display: flex; flex-direction: column; min-height: 0;
}
.tickets-search { padding: 16px; border-bottom: 1px solid var(--color-border); }
.tickets-search .field { margin: 0; }
.tickets-items { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.tickets-items a {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px; border-radius: var(--radius);
    color: var(--color-text); text-decoration: none;
}
.tickets-items a:hover { background: var(--color-surface2); }
.tickets-items a.active { background: color-mix(in srgb, var(--color-primary) 20%, transparent); outline: 1px solid color-mix(in srgb, var(--color-primary) 50%, transparent); }
.tickets-items .ticket-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--color-muted); }
.tickets-foot { padding: 16px; border-top: 1px solid var(--color-border); }
.tickets-view { padding: 24px; }
.tickets-view.empty-view { align-items: center; justify-content: center; color: var(--color-muted); }
.ticket-messages { display: grid; gap: 12px; margin: 16px 0; }
.ticket-message { background: var(--color-surface2); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--color-border); }
.ticket-message header { margin-bottom: 6px; font-size: .9rem; }
.ticket-message-staff { border-left: 3px solid var(--color-primary); }
.ticket-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Рефералы и счётчики --- */
.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row .copy-field { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 0 0 20px; }
.stat { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.stat strong { font-size: 1.5rem; }

/* --- Телефон и планшет --- */
@media (max-width: 1100px) {
    .tickets { grid-template-columns: 1fr; }
    .tickets.has-ticket .tickets-list { display: none; }
    .tickets:not(.has-ticket) .tickets-view.empty-view { display: none; }
    .layout-aside { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex; margin-left: auto;
        background: none; border: 1px solid var(--color-border); color: var(--color-text);
        border-radius: var(--radius); padding: 8px; cursor: pointer;
    }
    .site-header .container { flex-wrap: wrap; }
    .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
    .site-nav.open { display: flex; }
    .site-nav-end { margin-left: 0; flex-wrap: wrap; }

    .cabinet { grid-template-columns: 1fr; gap: 16px; }
    .cabinet-menu { position: static; }
    .menu-toggle {
        display: flex; align-items: center; gap: 10px; width: 100%;
        background: var(--color-surface); color: var(--color-text);
        border: 1px solid var(--color-border); border-radius: var(--radius);
        padding: 12px 14px; font: inherit; cursor: pointer;
    }
    .cabinet-menu .menu-body { display: none; }
    .cabinet-menu.open .menu-body { display: flex; }

    .product-page { grid-template-columns: 1fr; }
    .hero { min-height: 240px; }
    .hero h1 { font-size: 1.6rem; }
    .card { padding: 18px; }
}

@media (max-width: 520px) {
    .container { padding: 0 12px; }
    .server-card { grid-template-columns: minmax(0, 1fr) 72px; gap: 12px; padding: 14px; }
    .server-logo { width: 72px; height: 72px; }
    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .product-foot { flex-direction: column; align-items: stretch; }
    .site-footer .copyright { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* --- Пополнение (Этап 5, ориентиры 5–6) --- */
.topup { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.topup-amount { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: end; }
.topup-amount input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.range-labels { display: flex; justify-content: space-between; }
.prices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.price-cell { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.price-cell strong { font-size: 1.05rem; }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.method { position: relative; cursor: pointer; }
.method input { position: absolute; opacity: 0; }
.method-body {
    display: flex; flex-direction: column; gap: 4px; min-height: 84px; justify-content: center;
    padding: 14px; border-radius: var(--radius);
    background: var(--color-surface2); border: 1px solid var(--color-border);
}
.method-body img { max-height: 32px; width: auto; align-self: flex-start; }
.method input:checked + .method-body { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 25%, var(--color-surface2)); }
.method input:focus-visible + .method-body { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.terms-check { display: flex; gap: 10px; align-items: flex-start; }
.terms-check input { flex: none; margin-top: 3px; }
.manual-card { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.manual-card h3 { margin: 0 0 4px; }
.manual-card p { margin: 0; }
.topup-bonuses { position: sticky; top: 88px; }
.bonus { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.bonus-promo { border-color: color-mix(in srgb, var(--color-primary) 55%, transparent); }
.bonus.is-active { border-color: var(--color-gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-gold) 45%, transparent); }
.bonus-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bonus-percent { background: color-mix(in srgb, var(--color-gold) 18%, transparent); color: var(--color-gold); border: 1px solid color-mix(in srgb, var(--color-gold) 45%, transparent); }
.bonus-until { margin: 8px 0 0; padding: 6px 10px; border-radius: var(--radius); background: color-mix(in srgb, var(--color-gold) 10%, transparent); color: var(--color-gold); font-size: .85rem; }
.bonus-items { margin: 10px 0 0; padding-left: 18px; }
.bonus-mark { display: none; margin-top: 8px; color: var(--color-gold); font-weight: 600; }
.bonus.is-active .bonus-mark { display: block; }
.payment-pending { background: color-mix(in srgb, var(--color-gold) 16%, transparent); color: var(--color-gold); }
.payment-paid { background: rgba(63, 185, 80, .15); color: #7ee2a0; }
.payment-expired, .payment-failed { background: var(--color-surface2); color: var(--color-muted); }
.payment-review { background: rgba(229, 56, 59, .15); color: #ff9b94; }
@media (max-width: 1100px) {
    .topup { grid-template-columns: 1fr; }
    .topup-bonuses { position: static; }
}
@media (max-width: 600px) {
    .topup-amount { grid-template-columns: 1fr; }
}

/* Скриншоты в обращениях (D-80) */
.ticket-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ticket-attachments img { display: block; width: auto; height: auto; max-width: 160px; max-height: 120px; border-radius: var(--radius); border: 1px solid var(--color-border); object-fit: cover; }

/* 2FA (D-84): QR-код на белом фоне (иначе телефон не читает его на тёмной теме), коды восстановления */
.steps { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.qr { background: #fff; display: inline-block; padding: 8px; border-radius: var(--radius); margin: 10px 0; line-height: 0; }
.qr svg { width: 200px; height: 200px; max-width: 100%; }
.secret-key, .recovery-codes code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--color-surface2); padding: 4px 8px; border-radius: 6px; word-break: break-all; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.inline-form { display: inline; }

/* Фон-картинка: на ПК стоит на месте при прокрутке, на телефоне по ширине экрана сверху (D-92) */
@media (min-width: 900px) {
    body { background-attachment: scroll, fixed, scroll; }
}
@media (max-width: 899px) {
    body { background-size: auto, 100% auto, auto; }
}

/* Биржа персонажей (D-98) */
.market-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.market-filters .field { margin: 0; min-width: 140px; flex: 1 1 140px; }
.market-filters .button { flex: 0 0 auto; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.details dt { color: var(--color-muted); }
.details dd { margin: 0; }
.blockers { margin: 0; padding-left: 20px; }
.blockers li { margin: 4px 0; }
