/* ====================================================================
   KOSTIK.SITE — общие стили. Редизайн «Досье» (design_handoff_kostik_dossier).
   Тёмный нуар, золото — акцент и валюта «Слава», штампы «Дело №»,
   уровни достижений — металлы (медь→алмаз). Без скруглений и теней,
   кроме выпадающих панелей.
   ==================================================================== */

/* --- 1. Токены --- */
:root {
    color-scheme: dark;
    --bg: #0C0B0E;
    --paper: #15131A;
    --surface: var(--paper);
    --surface-2: var(--paper);
    --fg: #EDE8E0;
    --fg-2: #CFCAD8;
    --muted: #9B948A;
    --muted-2: #5E5862;
    --line: rgba(237, 232, 224, .12);
    --line-2: rgba(237, 232, 224, .2);
    --line-3: rgba(237, 232, 224, .3);

    --gold: #D9A441;
    --gold-hover: #F0C76A;
    --accent: var(--gold);
    --accent-hover: var(--gold-hover);

    --town: #7FB2D9;
    --mafia: #E23D5A;
    --neutral: #B9A6FF;
    --silver: #C9CDD6;
    --bronze: #C08A55;
    --ok: #3FB57A;
    --bad: #E23D5A;
    --vk: #0077FF;

    /* Металлы уровней достижений: I медь … V алмаз */
    --m1: linear-gradient(135deg, #CD8F62, #8E5633); --m1-text: #CD8F62; --m1-line: rgba(205, 143, 98, .5);
    --m2: linear-gradient(135deg, #DCDFE6, #9DA3AE); --m2-text: #C9CDD6; --m2-line: rgba(201, 205, 214, .5);
    --m3: linear-gradient(135deg, #F0C96A, #C9922E); --m3-text: #D9A441; --m3-line: rgba(217, 164, 65, .6);
    --m4: linear-gradient(135deg, #F4F7FA, #B8C4D2); --m4-text: #E6EEF5; --m4-line: rgba(230, 238, 245, .55);
    --m5: linear-gradient(135deg, #E6FAFF, #7FC8DE); --m5-text: #A9E4F2; --m5-line: rgba(169, 228, 242, .6);

    --f-head: 'Oswald', sans-serif;
    --f-body: 'Inter', sans-serif;
    --f-mono: ui-monospace, Menlo, monospace;
    --r: 0;
    --r-lg: 0;
    --ease: .2s ease;
}

/* --- 2. База --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.6 var(--f-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 48px 48px;
}
main { flex: 1; }
a { color: var(--gold); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--gold-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.15; text-wrap: balance; font-weight: 600; }
h2 { font-size: 18px; }
code { font-family: var(--f-mono); font-size: .88em; background: var(--paper); border: 1px solid var(--line); padding: 1px 6px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 40px 24px 72px; display: flex; flex-direction: column; gap: 40px; }
.wrap--narrow { max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lbl { font: 600 12px var(--f-mono); color: var(--muted); letter-spacing: .04em; }
.eyebrow { font: 500 12px var(--f-head); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.eyebrow--accent { color: var(--gold); }
.display { font: 600 clamp(36px, 5.5vw, 64px)/.95 var(--f-head); text-transform: uppercase; letter-spacing: .01em; }
.display--md { font-size: clamp(28px, 4.5vw, 44px); }
.display--sm { font-size: clamp(24px, 3.5vw, 32px); }
.lead { font-size: 16px; color: var(--muted); max-width: 56ch; line-height: 1.55; }
.date { font: 600 12px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.big-num { font: 600 32px var(--f-head); font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.num { font-variant-numeric: tabular-nums; }

/* --- 3. Кнопки, фильтры, штамп, метки --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 14px var(--f-head); letter-spacing: .12em; text-transform: uppercase;
    color: var(--bg); background: var(--gold); border: 1px solid var(--gold);
    padding: 14px 24px; cursor: pointer;
    transition: background var(--ease), border-color var(--ease);
}
.btn:hover { color: var(--bg); background: var(--gold-hover); border-color: var(--gold-hover); }
.btn--ghost { background: transparent; border-color: var(--line-3); color: var(--fg); }
.btn--ghost:hover { background: var(--paper); border-color: var(--line-3); color: var(--fg); }
.btn--vk { background: var(--vk); border-color: var(--vk); color: #fff; }
.btn--vk:hover { background: #1a85ff; border-color: #1a85ff; color: #fff; }
.btn--sm { padding: 9px 16px; font-size: 12px; }
.btn--block { width: 100%; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Простой переключатель раздела (Новости/Обновления) — не подписанный фильтр */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: 500 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); padding: 8px 14px; transition: color var(--ease), border-color var(--ease); }
.chip small { font-weight: 500; opacity: .7; margin-left: 2px; }
.chip:hover { color: var(--fg); }
.chip.on { color: var(--bg); border-color: var(--fg); background: var(--fg); }

/* Подписанные фильтры: слева .lbl в 96px, справа сегменты или подчёркнутые табы */
.filters { display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; }
.segments { display: flex; font: 500 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; flex-wrap: wrap; }
.segments button, .segments a, .segments span { padding: 8px 14px; border: 1px solid var(--line-2); border-left: 0; color: var(--muted); background: transparent; white-space: nowrap; display: inline-block; }
.segments button:first-child, .segments a:first-child, .segments span:first-child { border-left: 1px solid var(--line-2); }
.segments button:hover, .segments a:hover { color: var(--fg); }
.segments button.on, .segments a.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.segments button.on--gold, .segments a.on--gold { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.ach-dropdown { position: relative; display: inline-block; }
.ach-dropdown button { font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 8px 14px; border: 1px solid var(--line-2); color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap; }
.ach-dropdown button:hover { color: var(--fg); }
.ach-dropdown button.on--gold { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.ach-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 520px; max-width: calc(100vw - 32px); background: var(--paper); border: 1px solid var(--line-2); padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ach-panel[hidden] { display: none; }
.ach-panel-col { display: flex; flex-direction: column; gap: 2px; }
.ach-panel-col .lbl { margin-bottom: 6px; }
.ach-panel-col a { padding: 5px 0; color: var(--muted); font-size: 13px; text-transform: none; letter-spacing: normal; font-family: var(--f-body); }
.ach-panel-col a:hover { color: var(--fg); }
.ach-panel-col a.on { color: var(--gold); font-weight: 600; }
@media (max-width: 600px) {
    .ach-panel { grid-template-columns: 1fr; width: 320px; }
}
.tabs-underline { display: flex; gap: 18px; font: 500 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs-underline button, .tabs-underline a { padding: 8px 2px; color: var(--muted); white-space: nowrap; }
.tabs-underline button.on, .tabs-underline a.on { color: var(--fg); box-shadow: inset 0 -2px 0 var(--fg); }

/* Штамп «Дело №» — угол карточки/фигуры */
.stamp { position: absolute; top: -1px; left: -1px; font: 500 10px var(--f-head); letter-spacing: .2em; text-transform: uppercase; background: var(--gold); color: var(--bg); padding: 4px 10px; z-index: 1; }

.team { display: inline-block; font: 600 10px var(--f-head); letter-spacing: .08em; text-transform: uppercase; }
.team--town { color: var(--town); }
.team--maf { color: var(--mafia); }
.team--neu { color: var(--neutral); }
.badge { font: 600 10px var(--f-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(217, 164, 65, .5); padding: 1px 5px; vertical-align: 2px; }
.price { font: 600 11px var(--f-mono); color: var(--muted); letter-spacing: .02em; }
.price em { font-style: normal; color: var(--fg); }
.diff { display: inline-flex; gap: 2px; }
.diff i { width: 7px; height: 7px; background: var(--line-2); }
.diff i.on { background: var(--gold); }
.p1 { color: var(--gold); } .p2 { color: var(--silver); } .p3 { color: var(--bronze); }

.kind { flex: none; align-self: start; margin-top: 3px; font: 600 10px var(--f-head); text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; }
.kind--new { color: var(--bg); background: var(--gold); }
.kind--fix { color: var(--fg); border: 1px solid var(--line-3); }
.kind--improve { color: var(--fg); border: 1px solid var(--line-3); }

/* --- 4. Карточки и общие блоки --- */
.card { background: var(--paper); border: 1px solid var(--line); padding: 22px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.stack > * { max-width: 100%; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: 22px; letter-spacing: .06em; text-transform: uppercase; }
.sec-head a { font: 600 12px var(--f-head); letter-spacing: .14em; text-transform: uppercase; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.split--wide { grid-template-columns: 1.5fr 1fr; }
.page-head { display: flex; flex-direction: column; gap: 12px; }
.page-head--row { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; margin-bottom: -24px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--fg); }
.notice { color: var(--fg-2); background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 14px 16px; font-size: 14px; }
.empty { color: var(--muted); padding: 32px 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 40px 20px; }
.center-page { align-items: center; justify-content: center; min-height: 60vh; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; flex-direction: column; gap: 3px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--fg); }
.list-item:first-child { padding-top: 0; }
.list-item b { font: 600 16px var(--f-head); text-transform: uppercase; }
.list-item:hover b { color: var(--gold-hover); }
.list-item .muted { font-size: 14px; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.pills li { font-size: 13px; background: var(--paper); border: 1px solid var(--line); padding: 5px 12px; }
.pills b { color: var(--gold); }
.pills .pill--locked { opacity: .4; }
.pills .pill--locked b { color: inherit; }

.achievements { display: grid; gap: 16px; }
.achievement { padding: 14px 0; border-top: 1px solid var(--line); }
.achievement:first-child { padding-top: 0; border-top: none; }
.achievement h3 { font: 600 16px var(--f-head); margin: 0 0 4px; text-transform: uppercase; }
.ticks { list-style: none; display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 14px; color: var(--fg-2); }
.ticks li::before { content: '✓'; color: var(--gold); font-weight: 700; margin-right: 10px; }

.flash { max-width: 1180px; margin: 16px auto 0; width: calc(100% - 48px); padding: 12px 16px; font-size: 14px; border: 1px solid; }
.flash--success { color: #A7F3D0; background: rgba(63, 181, 122, .12); border-color: rgba(63, 181, 122, .35); }
.flash--error { color: #FECACA; background: rgba(226, 61, 90, .12); border-color: rgba(226, 61, 90, .35); }

.ava { width: 40px; height: 40px; object-fit: cover; flex: none; display: inline-block; background: linear-gradient(135deg, #6E3AA8, #2A1E3A); }
.ava--sm { width: 32px; height: 32px; }
.ava--me { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- 5. Шапка и подвал --- */
.hdr { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px; padding: 0 32px; height: 64px; background: var(--bg); border-bottom: 1px solid var(--line); }
.hdr-logo { display: flex; align-items: center; gap: 12px; color: var(--fg); }
.hdr-logo:hover { color: var(--fg); }
.logo-mark { width: 30px; height: 30px; background: var(--gold); display: grid; place-items: center; flex: none; font: 700 16px var(--f-head); color: var(--bg); }
.logo-mark--lg { width: 48px; height: 48px; font-size: 24px; }
.logo-text { font: 600 18px/1 var(--f-head); letter-spacing: .12em; text-transform: uppercase; }
.logo-text small { display: block; font: 600 10px var(--f-head); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.hdr-nav { display: flex; gap: 26px; }
.hdr-nav a { font: 500 14px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 0; }
.hdr-nav a:hover, .hdr-nav a.on { color: var(--fg); }
.hdr-nav a.on { box-shadow: 0 2px 0 var(--gold); }
.hdr-nav-login { display: none; }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 16px; flex: none; }
.hdr-currency { display: flex; align-items: center; gap: 6px; font: 600 14px var(--f-head); letter-spacing: .04em; white-space: nowrap; }
.hdr-currency--glory { color: var(--gold); }
.hdr-currency i { width: 10px; height: 10px; display: inline-block; background: currentColor; }
.hdr-currency .i-glory { transform: rotate(45deg); }
.hdr-currency .i-calcium { background: var(--fg); border-radius: 50%; }
.hdr-me { display: flex; align-items: center; gap: 10px; color: var(--fg); font: 500 14px var(--f-head); letter-spacing: .06em; text-transform: uppercase; padding-left: 16px; border-left: 1px solid var(--line-2); }
.hdr-me:hover, .hdr-me.on { color: var(--fg); }

.hamburger { display: none; width: 36px; height: 36px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.hamburger span { width: 18px; height: 2px; background: var(--fg); transition: transform var(--ease), opacity var(--ease); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ftr { border-top: 1px solid var(--line); padding: 28px 32px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ftr-info p + p { margin-top: 4px; }
.ftr-links { display: flex; gap: 10px 26px; flex-wrap: wrap; }
.ftr-links a { color: var(--muted); }
.ftr-links a:hover { color: var(--fg); }

/* --- 6. Главная игры --- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 22px; }
.hero-art { position: relative; border: 1px solid var(--line-2); padding: 14px; background: var(--paper); }
.hero-art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 20%; display: block; filter: contrast(1.05) saturate(.9); }
.hero-art figcaption { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }
.hero-art figcaption b { font: 600 20px var(--f-head); text-transform: uppercase; }
.kpis { display: flex; gap: 40px; margin-top: 10px; padding-top: 22px; border-top: 1px dashed var(--line-2); }
.kpis div { display: flex; flex-direction: column-reverse; }
.kpis dd { font: 600 34px var(--f-head); font-variant-numeric: tabular-nums; line-height: 1; }
.kpis dt { font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-2); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border-right: 1px solid var(--line-2); color: var(--fg); transition: background var(--ease); }
.tile:last-child { border-right: 0; }
.tile:hover { color: var(--fg); background: rgba(217, 164, 65, .07); }
.tile b { font: 600 22px var(--f-head); text-transform: uppercase; }
.tile span { font-size: 13px; color: var(--muted); }
.cl-ver { font: 600 30px var(--f-head); margin-bottom: 0; display: flex; gap: 12px; align-items: baseline; }
.cl-items { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cl-items li { display: flex; gap: 10px; font-size: 14px; color: var(--fg-2); }

/* --- 7. Роли --- */
.roles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.role-card { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--paper); color: var(--fg); position: relative; transition: border-color var(--ease); }
.role-card:hover { color: var(--fg); border-color: rgba(217, 164, 65, .7); }
.role-card .stamp { background: var(--bg); color: var(--muted); border: 1px solid var(--line); font-size: 9px; }
.role-card__img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.role-card__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.role-card__meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.role-card__meta b { font: 600 20px var(--f-head); text-transform: uppercase; line-height: 1; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.role-page { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 40px; align-items: start; }
.role-page__art { position: sticky; top: 90px; border: 1px solid var(--line); overflow: hidden; aspect-ratio: 3 / 4; }
.role-page__art img { width: 100%; height: 100%; object-fit: cover; }
.role-page__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; align-items: flex-start; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; width: 100%; }
.facts div { border: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column-reverse; gap: 2px; }
.facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.facts dd { font: 600 14px var(--f-head); }
.mini-roles { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.mini-role { flex: none; width: 120px; display: flex; flex-direction: column; gap: 6px; color: var(--fg); font: 600 13px var(--f-head); }
.mini-role img { width: 120px; height: 90px; object-fit: cover; object-position: center 20%; border: 1px solid var(--line); }

/* --- 8. Талисманы (вне редизайна экранов — только токены) --- */
.tal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.tal { display: grid; grid-template-columns: 84px 1fr; gap: 18px; padding: 20px; border: 1px solid var(--line); background: var(--paper); scroll-margin-top: 90px; }
.tal__coin { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .6)); }
.tal__coin--blank { display: grid; place-items: center; font: 600 18px var(--f-head); color: #3A2615; background: radial-gradient(circle at 35% 30%, #E9C79C, #9A6A3C 60%, #4E3420); }
.tal__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tal__head h2 { font-size: 18px; }
.tal__body > p { font-size: 14px; color: var(--fg-2); }
.tal__facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; }
.tal__facts div { display: flex; gap: 6px; }
.tal__facts dt { color: var(--muted); }
details summary { cursor: pointer; font: 600 13px var(--f-head); color: var(--gold); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ' ↓'; }
details[open] summary::after { content: ' ↑'; }
details .prose { margin-top: 10px; }

/* --- 9. Текст статей (Markdown) --- */
.prose { color: var(--fg-2); font-size: 15.5px; line-height: 1.7; max-width: 70ch; min-width: 0; }
.prose > * + * { margin-top: 14px; }
.prose h1 { display: none; }
.prose h2 { font-size: 21px; color: var(--fg); margin-top: 34px; text-transform: uppercase; }
.prose h3 { font-size: 17px; color: var(--fg); margin-top: 26px; }
.prose h4 { font-size: 15px; color: var(--fg); margin-top: 20px; }
.prose strong { color: var(--fg); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--gold); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose blockquote { border-left: 3px solid var(--gold); background: var(--paper); padding: 12px 16px; }
.prose img { border: 1px solid var(--line); }
.prose pre { background: var(--paper); border: 1px solid var(--line); padding: 14px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose th { font: 600 11px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prose--sm { font-size: 14px; }
.prose--sm h2 { font-size: 16px; margin-top: 20px; }
.article-cover { border: 1px solid var(--line); width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }

.guide { flex-direction: row; align-items: flex-start; gap: 48px; }
.guide__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.guide__side { width: 300px; flex: none; position: sticky; top: 90px; display: flex; flex-direction: column; gap: 8px; }
.side-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); color: var(--fg); }
.side-link:hover { color: var(--fg); border-color: rgba(217, 164, 65, .5); }
.side-link b { font: 600 14px var(--f-head); }
.side-link span { font-size: 12.5px; color: var(--muted); }

/* --- 10. Новости и обновления --- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.news-card { display: flex; flex-direction: column; gap: 6px; color: var(--fg); padding: 16px; border: 1px solid var(--line); background: var(--paper); }
.news-card:hover { color: var(--fg); border-color: rgba(217, 164, 65, .5); }
.news-card__img { aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 6px; }
.news-card__img img { width: 100%; height: 100%; object-fit: cover; }
.news-card b { font: 600 17px var(--f-head); text-transform: uppercase; }
.news-card .muted { font-size: 14px; }
.news-card--big { grid-column: span 2; grid-row: span 2; }
.news-card--big b { font-size: 22px; }
.cl { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.cl__ver { display: flex; flex-direction: column; gap: 2px; }
.cl__ver b { font: 600 22px var(--f-head); }

/* --- 11. Вход --- */
.login-card { max-width: 420px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 36px; }

/* --- 12. Кабинет --- */
.cab { flex-direction: row; align-items: flex-start; gap: 40px; }
.cab-side { width: 300px; flex: none; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 28px; }
.cab-card { border: 1px solid var(--line); padding: 24px; position: relative; background: var(--paper); }
.cab-card__art { width: 100%; aspect-ratio: 1; background: linear-gradient(135deg, #6E3AA8, #1A1420); margin: 16px 0 18px; }
.cab-card h1 { font-size: 36px; text-transform: uppercase; }
.cab-card .muted { font-size: 13px; margin-top: 6px; }
.cab-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.cab-stats dd { font: 600 28px var(--f-head); line-height: 1.1; }
.cab-stats dd.gold { color: var(--gold); }
.cab-stamps-row { display: flex; gap: 4px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-2); align-items: center; flex-wrap: wrap; }
.cab-stamps-row span { display: flex; align-items: center; gap: 4px; margin-right: 8px; }
.cab-stamps-row i { width: 12px; height: 12px; display: inline-block; }
.cab-stamps-row b { font: 600 13px var(--f-head); }
.cab-rank { margin-top: 14px; font: 500 12px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cab-rank b { color: var(--fg); font-size: 16px; }
.cab-me { display: none; }
.cab-nav { display: flex; flex-direction: column; font: 500 14px var(--f-head); letter-spacing: .1em; text-transform: uppercase; }
.cab-nav a { color: var(--muted); padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.cab-nav__game { display: none; }
.cab-nav a:hover { color: var(--fg); }
.cab-nav a.on { color: var(--gold); }
.cab-nav a.on::after { content: '→'; }
.cab-logout { margin-top: -6px; }
.cab-logout button { color: var(--muted-2); font: 500 12px var(--f-head); padding: 12px 0 0; }
.cab-logout button:hover { color: var(--bad); }
.cab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.cab-main .crumbs { margin-bottom: -10px; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); background: var(--paper); }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font: 600 28px var(--f-head); font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }
.inv { display: grid; grid-template-columns: 1.4fr 1.4fr .6fr; gap: 22px; }
.inv .eyebrow { margin-bottom: 10px; }
.inv .muted { font-size: 14px; }

.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-row { display: grid; grid-template-columns: 44px 1fr repeat(3, 90px); gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--fg); }
.chat-row:hover { color: var(--fg); background: rgba(217, 164, 65, .04); }
.chat-ava { width: 44px; height: 44px; display: grid; place-items: center; font: 600 14px var(--f-head); background: var(--paper); border: 1px solid var(--line-2); }
.chat-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-row__main b { font: 600 17px var(--f-head); text-transform: uppercase; }
.chat-row__main .muted { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row__num { display: flex; flex-direction: column; text-align: right; }
.chat-row__num b { font: 600 18px var(--f-head); font-variant-numeric: tabular-nums; }
.chat-row__num small { font-size: 11px; color: var(--muted); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { font: 600 11px var(--f-mono); letter-spacing: .04em; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl th.glory { color: var(--gold); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); }
.tbl .r { text-align: right; }
.tbl tr.me td { background: rgba(217, 164, 65, .08); }
.tbl .stamps-cell { display: flex; justify-content: flex-end; gap: 3px; }
.tbl .stamps-cell i { width: 10px; height: 10px; display: inline-block; }
.tbl .glory-cell { font: 600 17px var(--f-head); color: var(--gold); }
.place { font: 600 15px var(--f-head); display: inline-block; min-width: 28px; color: var(--muted); }
.status { font: 600 11px var(--f-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.status--ok { color: var(--ok); } .status--bad { color: var(--bad); }

.podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; align-items: end; max-width: 820px; width: 100%; margin: 0 auto; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 22px 16px; border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.pod-ava { width: 56px; height: 56px; display: block; }
.pod b { font: 600 18px var(--f-head); text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .muted { font-size: 13px; }
.pod .glory { font: 600 24px var(--f-head); color: var(--gold); }
.pod--1 { padding: 32px 16px; border-color: var(--gold); background: linear-gradient(180deg, rgba(217, 164, 65, .14), transparent); }
.pod--1 .pod-ava { width: 72px; height: 72px; outline: 2px solid var(--gold); outline-offset: 4px; }
.pod--1 b { font-size: 22px; }
.pod--1 .glory { font-size: 34px; }

/* --- 13. Формы --- */
.form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; width: 100%; }
.form--inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.settings { gap: 18px; align-items: stretch; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font: 600 13px var(--f-head); color: var(--fg-2); }
.field small { font-size: 12px; color: var(--muted); }
.field input { font: 15px var(--f-body); color: var(--fg); background: var(--bg); border: 1px solid var(--line-2); padding: 12px 14px; width: 100%; min-width: 0; max-width: 340px; transition: border-color var(--ease); }
.field input:focus { outline: none; border-color: var(--gold); }
.fields-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks--col { flex-direction: column; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check span { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--f-head); color: var(--muted); border: 1px solid var(--line-2); padding: 7px 14px; transition: all var(--ease); }
.check input:checked + span { color: var(--bg); border-color: var(--gold); background: var(--gold); }
.check input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.check--danger input:checked + span { border-color: var(--bad); background: rgba(226, 61, 90, .2); text-decoration: line-through; }
.check small { font-weight: 500; opacity: .6; }

/* Роли: два списка (включены/доступны), порядок внутри "включены" — драгом */
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .role-picker { grid-template-columns: 1fr; } }
.role-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 36px; }
.role-list li { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line-2); padding: 7px 10px; font: 600 13px var(--f-head); }
.role-list li span:not(.role-handle) { flex: 1; }
.role-handle { cursor: grab; opacity: .5; }
.role-list[data-role-list="enabled"] li.sortable-ghost { opacity: .3; }
.role-move { border: none; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.role-move:hover { background: var(--line-2); color: var(--fg); }
.switch { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 23px; height: 23px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-3); border-radius: 4px; flex: none; transition: background var(--ease), border-color var(--ease); }
.switch span::after { content: ''; width: 6px; height: 11px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); opacity: 0; }
.switch input:checked + span { background: var(--gold); border-color: var(--gold); }
.switch input:checked + span::after { opacity: 1; }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.switch:has(input:disabled) { cursor: not-allowed; }
.form-actions { display: flex; gap: 10px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* --- 14. Документы --- */
.doc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; max-width: 1180px; }
.doc-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 24px; }
.doc-nav__list { display: flex; flex-direction: column; font: 500 13px var(--f-head); letter-spacing: .1em; text-transform: uppercase; }
.doc-nav__list a { padding: 11px 0; border-top: 1px solid var(--line); color: var(--muted); }
.doc-nav__list a:last-child { border-bottom: 1px solid var(--line); }
.doc-nav__list a.on { color: var(--gold); display: flex; justify-content: space-between; }
.doc-toc { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); padding: 0; margin: 0; list-style: none; }
.doc-toc li { display: flex; gap: 10px; }
.doc-toc li.on { color: var(--fg); }
.doc-toc span:first-child { width: 18px; flex: none; }
.doc-seller { border: 1px solid var(--line); padding: 14px 16px; background: var(--paper); display: flex; flex-direction: column; gap: 6px; }
.doc-seller b { font: 600 14px var(--f-head); text-transform: uppercase; }
.doc-article { max-width: 720px; min-width: 0; }
.doc-brief { border: 1px dashed var(--line-2); padding: 14px 18px; margin-top: 28px; display: flex; gap: 16px; align-items: flex-start; font-size: 13.5px; color: var(--fg-2); line-height: 1.55; }
.doc-brief .lbl { flex: none; padding-top: 2px; }
.doc-section { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.doc-section h2 { font-size: 22px; letter-spacing: .04em; text-transform: uppercase; display: flex; gap: 14px; align-items: baseline; }
.doc-section h2 .lbl { font-size: 12px; }
.doc-point { display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 15px; color: var(--fg-2); line-height: 1.65; }
.doc-point b { font-weight: 600; color: var(--muted); font-size: 13px; padding-top: 3px; }
.doc-accordion { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.doc-accordion summary { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); font: 500 13px var(--f-head); letter-spacing: .06em; text-transform: uppercase; color: var(--fg); list-style: none; }
.doc-accordion summary::after { content: '▾'; color: var(--muted); }
.doc-accordion[open] summary::after { content: '▴'; color: var(--gold); }

/* Сам текст документов — оферта/политика/соглашение, без перестройки разметки */
.legal-content { color: var(--fg-2); font-size: 15px; line-height: 1.7; }
.legal-content > * + * { margin-top: 14px; }
.legal-content h2 { font-size: 22px; color: var(--fg); margin-top: 34px; text-transform: uppercase; letter-spacing: .03em; }
.legal-content p strong { color: var(--fg); font-weight: 600; }
.legal-content ul { padding-left: 22px; }
.legal-content li + li { margin-top: 6px; }
.legal-content li::marker { color: var(--gold); }
.legal-content table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.legal-content th, .legal-content td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-content th { font: 600 11px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-card { border: 1px solid var(--line); background: var(--paper); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.contact-card h3 { font-size: 16px; text-transform: uppercase; }
.contact-card ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--fg-2); }
.contact-email, .contact-vk { font: 600 16px var(--f-head); }
.doc-accordion .doc-point { padding: 0 0 16px; }

/* --- 15. Тосты и cookies --- */
.toast-container { position: fixed; bottom: 24px; left: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 14px 20px; font: 500 14px var(--f-body); color: #fff; animation: toastIn .3s ease forwards; max-width: 380px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast--error { background: var(--bad); }
.toast--warn { background: #F59E0B; }
.toast--success { background: var(--ok); }
.toast--removing { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

#cookie_note {
    display: none; position: fixed; left: 32px; bottom: 24px;
    width: min(560px, calc(100% - 64px)); padding: 18px 20px; gap: 20px; align-items: center; z-index: 50;
    background: var(--paper); border: 1px solid var(--line-3);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9);
}
#cookie_note.show { display: grid; grid-template-columns: 1fr auto; }
#cookie_note p { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
#cookie_note a { color: var(--fg); text-decoration: underline; }
.cookie_actions { display: flex; flex-direction: column; gap: 6px; }
.cookie_accept, .cookie_necessary { padding: 10px 18px; font: 600 12px var(--f-head); letter-spacing: .12em; text-transform: uppercase; text-align: center; white-space: nowrap; }
.cookie_accept { background: var(--gold); color: var(--bg); }
.cookie_necessary { border: 1px solid var(--line-3); color: var(--fg); }

/* --- 16. Касса (кальций и купоны) --- */
.shop { display: grid; grid-template-columns: 1fr 460px; gap: 48px; align-items: start; }
.shop-intro { display: flex; flex-direction: column; gap: 32px; }
.shop-cashier { position: relative; border: 1px solid var(--line-2); padding: 14px; background: var(--paper); display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; }
.shop-cashier img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 15%; }
.ladder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; list-style: none; }
.ladder li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ladder li.on { color: var(--fg); }
.ladder li b { font-weight: 600; color: var(--muted); }
.ladder li.on b { color: var(--gold); }
.shop-card { border: 1px solid var(--line-2); background: var(--paper); display: flex; flex-direction: column; }
.shop-tabs { display: grid; grid-template-columns: 1fr 1fr; font: 600 13px var(--f-head); letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid var(--line-2); }
.shop-tabs button, .shop-tabs a, .shop-tabs span { padding: 16px; text-align: center; color: var(--muted); border-left: 1px solid var(--line-2); background: transparent; font: inherit; cursor: pointer; }
.shop-tabs button:first-child, .shop-tabs a:first-child, .shop-tabs span:first-child { border-left: 0; }
.shop-tabs button.active, .shop-tabs a.active, .shop-tabs span.on { background: var(--fg); color: var(--bg); }
/* Переключатель табов/вьюх — классы, которые реально ставит app.js.
   Специфичность выше, чем у .shop-body (display:flex), иначе он её перекрывает
   независимо от .active — это и было багом "обе вкладки видны сразу". */
.view.view { display: none; }
.view.active { display: block; }
.form-section.form-section { display: none; }
.form-section.active { display: flex; flex-direction: column; gap: 18px; }
#calc-result { display: none; }
#calc-result.visible { display: flex; flex-direction: column; gap: 8px; }
input.error { border-color: var(--bad); }
.shop-amount:has(input.error), .coupon-input:has(input.error) { border-color: var(--bad); }
.shop-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.shop-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-preset { padding: 7px 12px; font: 500 12px var(--f-head); letter-spacing: .08em; background: transparent; color: var(--muted); border: 1px solid var(--line-2); cursor: pointer; }
.shop-preset.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.shop-amount { display: flex; align-items: center; border: 1px solid var(--line-2); background: var(--bg); }
.shop-amount input { flex: 1; min-width: 0; font: 600 28px var(--f-head); color: var(--fg); background: transparent; border: 0; padding: 10px 14px; outline: none; }
.shop-amount span { padding-right: 14px; }
.shop-summary { border: 1px dashed var(--line-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.shop-summary .row-line { display: flex; justify-content: space-between; font-size: 14px; }
.shop-summary .row-line dt { color: var(--muted); }
.shop-summary .row-line dd { font: 600 14px var(--f-head); }
.shop-summary .row-total { padding-top: 8px; border-top: 1px solid var(--line); }
.shop-summary .row-price { display: flex; justify-content: space-between; align-items: baseline; }
.shop-summary .row-price dt { font: 500 12px var(--f-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.shop-summary .row-price dd { font: 600 34px var(--f-head); line-height: 1; color: var(--gold); }
.shop-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.5; }
.shop-consent input { margin-top: 3px; accent-color: var(--gold); flex: none; }
.coupon-input { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line-2); padding: 12px 14px; }
.coupon-input input { flex: 1; font: 600 24px var(--f-head); letter-spacing: .14em; color: var(--fg); background: transparent; border: 0; outline: none; text-transform: uppercase; }
.coupon-input:focus-within { border-color: var(--gold); }
.coupon-hint { border: 1px dashed var(--line-2); padding: 14px 16px; display: flex; gap: 14px; align-items: center; }
.coupon-hint .ic-box { width: 40px; height: 40px; border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; padding: 8px; box-sizing: border-box; flex: none; }
.coupon-hint p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.receipt { width: 560px; max-width: 100%; border: 1px solid var(--line-2); background: var(--paper); position: relative; }
.receipt-body { padding: 40px 28px 28px; display: flex; flex-direction: column; }
.receipt-body h1 { font-size: 40px; margin-bottom: 22px; text-transform: uppercase; }
.receipt-row { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px dashed var(--line-2); font-size: 14px; }
.receipt-row dt, .receipt-row span:first-child { color: var(--muted); }
.receipt-total { padding: 16px 0 0; border-top: 1px solid var(--line-3); margin-top: 6px; display: flex; justify-content: space-between; align-items: baseline; }
.receipt-price { padding: 8px 0 0; display: flex; justify-content: space-between; align-items: baseline; }
.receipt-actions { display: grid; grid-template-columns: 1fr 1.6fr; border-top: 1px solid var(--line-2); }
.receipt-actions button { padding: 18px; font: 600 14px var(--f-head); letter-spacing: .14em; text-transform: uppercase; border: 0; cursor: pointer; }
.receipt-actions button:first-child { background: transparent; color: var(--fg); border-right: 1px solid var(--line-2); }
.receipt-actions button:last-child { background: var(--gold); color: var(--bg); }
.result-card { border: 1px solid rgba(217, 164, 65, .6); background: linear-gradient(160deg, rgba(217, 164, 65, .1), transparent 60%) var(--paper); position: relative; padding: 40px 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.result-icon { width: 64px; height: 64px; background: var(--gold); color: var(--bg); display: grid; place-items: center; padding: 14px; box-sizing: border-box; }
.result-card h1 { font-size: 36px; text-transform: uppercase; }
.result-card .muted { font-size: 14px; margin-top: 8px; line-height: 1.5; }
.result-list { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--line-2); }

/* --- 17. Топ --- */
.top-head { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.ach-dropdown-wrap { position: relative; }

.ach-dropdown p.lbl { margin-bottom: 8px; }
.ach-dropdown ul { display: flex; flex-direction: column; gap: 6px; font-size: 13px; list-style: none; }
.ach-dropdown .note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line-2); padding-top: 10px; }

/* --- 18. Моё дело: витрина/почти готово/инвентарь --- */
.showcase-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.showcase-cell { aspect-ratio: 1; border: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; justify-content: space-between; padding: 12px; position: relative; }
.showcase-cell .ic-box { width: 48px; height: 48px; display: grid; place-items: center; padding: 10px; box-sizing: border-box; }
.showcase-cell .name { font: 500 11px var(--f-head); line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; }
.showcase-cell .roman { position: absolute; top: 10px; right: 10px; font: 600 11px var(--f-head); letter-spacing: .1em; }
.showcase-empty { aspect-ratio: 1; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font: 500 11px var(--f-head); letter-spacing: .12em; text-transform: uppercase; text-align: center; padding: 12px; }
.almost-list { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.almost-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; }
.almost-item .ic-box { width: 36px; height: 36px; display: grid; place-items: center; padding: 7px; box-sizing: border-box; border: 1px solid var(--line); }
.almost-item .body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.almost-item .top-line { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.almost-item .top-line b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.almost-item .glory { font: 600 12px var(--f-head); color: var(--gold); white-space: nowrap; }
.bar-track { height: 3px; background: var(--line); display: block; }
.bar-fill { height: 3px; display: block; }
.inv-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.inv-pill { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 8px 12px 8px 8px; }
.inv-pill img { width: 36px; height: 36px; object-fit: contain; }

/* --- 19. Достижения --- */
.ach-page { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.ach-sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 24px; }
.ach-sections { display: flex; flex-direction: column; gap: 2px; font: 500 13px var(--f-head); letter-spacing: .06em; text-transform: uppercase; list-style: none; }
.ach-sections li { display: flex; justify-content: space-between; padding: 7px 0; }
.ach-cat-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.ach-cat-head h2 { font-size: 22px; letter-spacing: .06em; text-transform: uppercase; }
.ach-cat-head .rule { flex: 1; height: 1px; background: var(--line); min-width: 24px; }
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ach-card { border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--paper); min-height: 208px; }
.ach-card.is-open { background: linear-gradient(160deg, rgba(255, 255, 255, .045), transparent 55%) var(--paper); }
.ach-card.is-secret { border-style: dashed; border-color: var(--line-3); opacity: .65; }
.ach-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ach-glyph { width: 48px; height: 48px; display: grid; place-items: center; padding: 10px; box-sizing: border-box; border: 1px solid var(--line-2); color: var(--muted); }
.ach-card.is-open .ach-glyph { color: var(--bg); border-color: transparent; }
.ach-glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ach-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; white-space: nowrap; }
.ach-roman { font: 600 14px var(--f-head); letter-spacing: .12em; }
.ach-glory-tag { font: 600 12px var(--f-head); letter-spacing: .1em; color: var(--gold); }
.ach-rarity { font-size: 10px; color: var(--muted); }
.ach-card h3 { font-size: 17px; line-height: 1.15; text-transform: uppercase; letter-spacing: .03em; }
.ach-card .desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.ach-progress { margin-top: auto; }
.ach-progress-line { display: flex; justify-content: space-between; font: 500 11px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; gap: 8px; }
.ach-progress-line .lvl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-progress-line .cnt { color: var(--fg); white-space: nowrap; }
.ach-tiers-strip { display: flex; gap: 3px; margin-top: 6px; }
.ach-tiers-strip span { height: 4px; flex: 1; background: var(--line); display: block; }

/* --- 20. Адаптив --- */
@media (max-width: 1000px) {
    .hdr { gap: 16px; padding: 0 16px; height: 58px; }
    .hamburger { display: flex; }
    .hdr-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
    .hdr-nav.open { display: flex; }
    .hdr-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
    .hdr-nav a.on { box-shadow: none; color: var(--gold); }
    .hdr-nav-login { display: block; }
    .hdr-login { display: none; }

    .cab, .guide, .ach-page, .doc-layout { flex-direction: column; align-items: stretch; }
    .cab-side, .guide__side { width: auto; position: static; }
    .cab-nav { flex-direction: row; overflow-x: auto; }
    .cab-nav a { white-space: nowrap; }
    .ach-page, .doc-layout { grid-template-columns: 1fr; }
    .ach-sidebar, .doc-nav { position: static; }
}

@media (max-width: 820px) {
    .wrap { padding: 28px 16px 56px; gap: 32px; }
    .hero, .split, .split--wide, .role-page, .shop, .cab-stats { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
    .role-page__art { position: static; max-width: 340px; }
    .tiles, .stat-tiles, .roles-grid, .ach-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid { grid-template-columns: 1fr; }
    .news-card--big { grid-column: auto; grid-row: auto; }
    .inv { grid-template-columns: 1fr; }
    .fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cl { grid-template-columns: 1fr; gap: 8px; }
    .chat-row { grid-template-columns: 44px 1fr 64px; }
    .hide-sm { display: none; }
    .tal-grid { grid-template-columns: 1fr; }
    .crumbs { margin-bottom: -16px; }
    .ftr { flex-direction: column; padding: 28px 16px; }
    .flash { width: calc(100% - 32px); }
    .showcase-grid { grid-template-columns: repeat(3, 1fr); }
    /* В мобильном макете кассы прейскуранта/кассира нет вообще (см. хендофф) —
       их grid 200px 1fr + 1fr 1fr внутри не сжимался на узких экранах и
       раздувал страницу шире вьюпорта (эффект "страница приближена/прижата вправо"). */
    .shop-cashier { display: none; }
    #cookie_note { left: 16px; right: 16px; width: auto; }
    #cookie_note.show { grid-template-columns: 1fr; }
    .cookie_actions { flex-direction: row; }
    .cookie_actions > * { flex: 1; }
}

@media (max-width: 480px) {
    .tal { grid-template-columns: 60px 1fr; gap: 14px; padding: 16px; }
    .tal__coin { width: 60px; height: 60px; }
    .podium { gap: 6px; }
    .pod { padding: 14px 6px; }
    .kpis { gap: 24px; }
    .hdr-me-name { display: none; }
    .roles-grid, .ach-grid { grid-template-columns: repeat(2, 1fr); }
    .showcase-grid { grid-template-columns: repeat(3, 1fr); }
}

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

/* Legendary King and earned glory */
.legendary-badge{display:inline-flex;align-items:center;gap:6px;width:fit-content;border:1px solid #b88d45;border-radius:4px;padding:5px 9px;color:#e6c784;background:#b88d4514;font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase}
.role-card--legendary{border:1px solid #b88d45;background:linear-gradient(145deg,#b88d451a,transparent 65%);box-shadow:inset 0 0 40px #b88d4508}
.role-card--legendary .role-card__meta{gap:10px}.role-card--legendary:hover{border-color:#e6c784;box-shadow:0 8px 40px #b88d451c}.role-page--legendary .role-page__art{border:1px solid #b88d45;box-shadow:0 0 65px #b88d4515}.role-page--legendary .display{color:#e6c784}
.glory-hero{display:grid;grid-template-columns:1.15fr .85fr;gap:32px;padding:28px;border:1px solid #b88d4566;background:linear-gradient(135deg,#b88d4514,transparent);border-radius:8px;overflow:hidden}.glory-hero .display{margin-top:16px}.glory-hero .lead{font-size:18px}.glory-hero .btn{margin-top:14px}.glory-king-art{display:block;min-width:0;align-self:stretch}.glory-king-art img{width:100%;height:100%;max-height:390px;object-fit:cover;object-position:center top;border-radius:5px}.glory-numbers{display:flex;gap:32px;margin:25px 0 18px}.glory-numbers>div{display:grid;gap:8px}.glory-numbers strong{font-size:30px;color:#e6c784}.glory-numbers small{font-size:18px;color:var(--muted)}.glory-progress{height:8px;overflow:hidden;background:#b88d4520;border-radius:4px;margin-bottom:12px}.glory-progress span{display:block;height:100%;background:linear-gradient(90deg,#9f7938,#e6c784)}.glory-levels{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:16px 0 36px}.glory-level{display:grid;gap:10px;padding:16px 12px;border:1px solid var(--line,#ffffff20);border-radius:5px}.glory-level.is-earned{border-color:#b88d4580;background:#b88d4510}.glory-level.is-earned b{color:#e6c784}.glory-history td small{display:block;margin-top:5px}.glory-history td:first-child{white-space:nowrap}.glory-profile-card{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px;border:1px solid #b88d4566;border-radius:6px;background:#b88d450a;margin-bottom:30px}.glory-profile-card h2{margin:8px 0}.glory-profile-card h2 small{font-size:15px;color:var(--muted)}
@media(max-width:700px){.glory-hero{grid-template-columns:1fr;padding:20px;gap:22px}.glory-king-art{order:-1;height:230px}.glory-king-art img{object-position:center 28%}.glory-levels{grid-template-columns:repeat(2,minmax(0,1fr))}.glory-level:last-child{grid-column:1/-1}.glory-profile-card{align-items:flex-start;flex-direction:column}.glory-numbers{gap:25px}.glory-numbers strong{font-size:26px}}
@media(max-width:700px){.cab-nav{gap:20px;padding-bottom:4px}.cab-nav a{flex:none;gap:6px}}

/* Achievement selector stays inside the statistic filter row. */
.segments > .ach-dropdown{position:relative;inset:auto;display:inline-flex;width:auto;padding:0;border:0;background:transparent;box-shadow:none;gap:0}.segments > .ach-dropdown > button{height:100%}.ach-panel{left:auto;right:0;max-height:65vh;overflow:auto}.ach-panel a{border:0;white-space:normal}.top-head .filters{min-width:0}.top-head .filter-row{min-width:0}
@media(max-width:1050px){.top-head{grid-template-columns:1fr;gap:24px}.top-head .filters{justify-self:start;width:100%}.top-head .segments{row-gap:6px}.ach-panel{max-width:calc(100vw - 40px)}}

.role-crest{display:grid;place-items:center;width:100%;height:100%;min-height:180px;background:radial-gradient(ellipse at 50% 25%,#c3a15d24,transparent 65%),var(--paper);color:var(--gold);font-size:80px}.role-page__art>.role-crest{min-height:440px;font-size:140px}

.publication-form{margin-top:20px;display:grid;gap:16px}.publication-form>label:not(.publication-check){display:grid;gap:8px}.publication-check{display:flex;align-items:flex-start;gap:10px;font-size:14px;line-height:1.6}.publication-check input{flex:none;margin-top:5px;accent-color:var(--gold)}.publication-document{border:1px solid var(--line);padding:18px;max-height:330px;overflow:auto;font-size:13px;line-height:1.75}.publication-document p{margin-top:12px}

.pod b{white-space:normal;overflow-wrap:anywhere;line-height:1.15;min-height:2.3em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.publication-form>label:not(.publication-check){width:100%}

/* Описание талисмана поверх каталога, без изменения размеров карточек. */
.tal__more { align-self: flex-start; margin-top: auto; padding: 6px 0; border: 0; background: none; color: var(--gold, #d9a735); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.tal-dialog { box-sizing: border-box; width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); background: var(--paper); color: var(--fg); overflow: auto; overscroll-behavior: contain; }
.tal-dialog::backdrop { background: rgba(0, 0, 0, .8); }
.tal-dialog__bar { display: flex; justify-content: flex-end; margin: 0 0 16px; }
.tal-dialog__close { padding: 8px 12px; border: 1px solid var(--line); background: transparent; color: var(--fg); font: inherit; cursor: pointer; }
.tal-dialog__heading { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.tal-dialog__heading img { width: 72px; height: 72px; object-fit: contain; }
.tal-dialog__heading h2 { margin: 0 0 8px; font-size: clamp(22px, 5vw, 30px); }
html:has(.tal-dialog[open]) { overflow: hidden; }

/* Player portraits: public nickname monograms and an anonymous Mafia silhouette. */
.player-avatar { --avatar-color: #574b39; width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%; border: 1px solid #ffffff24; background: radial-gradient(circle at 30% 15%, #ffffff17, transparent 65%), var(--avatar-color); color: #fff6e5; font: 600 15px var(--f-head); letter-spacing: .04em; box-shadow: inset 0 0 0 3px #00000016; vertical-align: middle; }
.player-avatar > svg { width: 76%; height: 76%; opacity: .8; }
.player-avatar > img { width: 100%; height: 100%; object-fit: cover; }
.player-avatar--row, .player-avatar--small { width: 32px; height: 32px; font-size: 12px; }
.player-avatar--large { width: 88px; height: 88px; font-size: 28px; }
.player-avatar--me { border-color: var(--gold); }
.pod-ava.player-avatar { width: 56px; height: 56px; font-size: 22px; }
.pod--1 .pod-ava.player-avatar { width: 72px; height: 72px; font-size: 28px; }
.cab-card__identity { margin: 22px 0 18px; }
.public-player-head { justify-content: flex-start; align-items: center; gap: 22px; }

.publication-form input[type="text"], .publication-form input[type="email"] { box-sizing: border-box; width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: 15px var(--f-body); }
.publication-form input:focus { outline: 1px solid var(--gold); outline-offset: 2px; }
.publication-check > span { min-width: 0; }
