﻿/* ---------- Шрифты ---------- */
/* Лежат в проекте (wwwroot/fonts, лицензия OFL — рядом), а не тянутся с Google: игра не зависит
   от чужого сервера, и заставка не показывает запасной шрифт. Файлы переменные — одно на все
   начертания; разбиты по наборам символов, браузер качает только те, что есть на странице.
   Cinzel — block: заголовок лучше подождать мгновение, чем показать его чужим шрифтом. */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 500 700; font-display: block; src: url('fonts/cinzel-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 500 700; font-display: block; src: url('fonts/cinzel-latin.woff2') format('woff2'); 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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } /* cyrillic-ext */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } /* cyrillic */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } /* greek-ext */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; } /* greek */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-math.woff2') format('woff2'); unicode-range: U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A, U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346, U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6, U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043, U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C, U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121, U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2, U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319, U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1, U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB, U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE, U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF; } /* math */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-symbols.woff2') format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } /* symbols */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } /* vietnamese */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 500; font-display: swap; src: url('fonts/roboto-latin.woff2') format('woff2'); 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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
/* Летопись (docs/LIBRARY.md, 28.10.2026): книга — Kurale, старинная книжная антиква с кириллицей; записки и рецепты — Marck Script, рукописный (выбор автора). Оба — Google Fonts, OFL, файлы в fonts/ (fonts/Kurale-MarckScript-OFL.txt). */
@font-face { font-family: "Kurale"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/kurale-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } /* cyrillic-ext */
@font-face { font-family: "Kurale"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/kurale-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } /* cyrillic */
@font-face { font-family: "Kurale"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/kurale-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: "Kurale"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/kurale-latin.woff2') format('woff2'); 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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */
@font-face { font-family: "Marck Script"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/marckscript-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } /* cyrillic */
@font-face { font-family: "Marck Script"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/marckscript-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* latin-ext */
@font-face { font-family: "Marck Script"; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/marckscript-latin.woff2') format('woff2'); 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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } /* latin */

/* ---------- Тема: дарк фэнтези ---------- */
:root {
    --bg: #070707;
    --panel: rgba(18, 17, 17, 0.94);
    --panel-inner: rgba(0, 0, 0, 0.45);
    --border: #2e2c2a;
    --border-hover: #4b4744;
    --text: #b8b2aa;
    --text-muted: #7a746d;
    --heading: #d6c7a8;
    --gold: #b08d57;
    --gold-hover: #c9a468;
    --danger: #a03a32;
    --danger-text: #d0685e;
    --focus: #c9a468;
    --font-title: "Cinzel", Georgia, serif;
    --font-body: "Roboto", "Segoe UI", Arial, sans-serif;
    color-scheme: dark;
}

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

html, body { height: 100%; margin: 0; }

body {
    background: var(--bg) var(--art-background) top center / cover no-repeat fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }
a:hover { color: var(--gold-hover); }

h1, h2, h3 { font-family: var(--font-title); color: var(--heading); font-weight: 500; margin: 0 0 .5rem; }
h1:focus { outline: none; }

.page {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* Переключатель языка на страницах без верхней полосы — в углу, поверх всего. */
.page-lang { position: fixed; top: 12px; right: 12px; z-index: 10; }

.loading { color: var(--text-muted); text-align: center; padding: 2rem; }
.muted { color: var(--text-muted); margin: 0; }
.center { text-align: center; }
.hint { display: block; color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ---------- Заставка ---------- */
/* Видна с первого кадра, пока качаются игра и вся графика (см. splash.js). Фон тот же, что
   у страницы, поэтому уход заставки — просто растворение надписи, а не смена картинки. */
.splash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg) var(--art-background) top center / cover no-repeat fixed;
    transition: opacity 320ms ease, visibility 0s linear 320ms;
}
.splash.done { opacity: 0; visibility: hidden; }
.splash-inner { width: min(380px, 100%); text-align: center; }
.splash-title {
    font-family: var(--font-title);
    font-weight: 500;
    color: var(--heading);
    font-size: 34px;
    letter-spacing: .08em;
    text-shadow: 0 2px 10px #000, 0 0 24px rgba(0, 0, 0, .9);
    margin: 0 0 22px;
}

/* Полоса — кованая: тёмный желоб в рамке, на концах ромбы-заклёпки, внутри тлеющее золото. */
.splash-bar {
    position: relative;
    height: 12px;
    margin: 0 14px;
    border: 1px solid var(--border-hover);
    border-radius: 2px;
    background: linear-gradient(#050505, #121110);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .8), 0 4px 18px rgba(0, 0, 0, .7);
}
.splash-bar::before, .splash-bar::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    border: 1px solid var(--gold);
    background: linear-gradient(135deg, #7d6039, #2a2014);
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 0 0 6px rgba(0, 0, 0, .9);
}
.splash-bar::before { left: -15px; }
.splash-bar::after { right: -15px; }
.splash-fill {
    position: relative;
    width: 0;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(90deg, #4a361e, #8a6a3e 55%, var(--gold-hover));
    box-shadow: 0 0 10px rgba(201, 164, 104, .35);
    transition: width 220ms ease-out;
}
/* Блик, бегущий по золоту: видно, что загрузка жива, даже когда проценты стоят. */
.splash-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, rgba(255, 236, 196, .35), transparent);
    animation: splash-sheen 1.6s ease-in-out infinite;
}
@keyframes splash-sheen { from { transform: translateX(-60px); } to { transform: translateX(380px); } }
.splash-note {
    display: flex;
    justify-content: space-between;
    margin: 10px 14px 0;
    font-family: var(--font-title);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: lowercase;
    color: var(--text-muted);
}
.splash-pct { color: var(--gold); letter-spacing: .06em; }
/* Экран ожидания в игре (LoadingScreen) — та же заставка, только под игровыми окнами ошибок
   и без процентов: сколько ждать, неизвестно, поэтому по полосе ходит огонёк. */
.splash.waiting { z-index: 900; transition: none; }
.splash-note.single { justify-content: center; }
.splash-bar.roaming .splash-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 32%;
    background: linear-gradient(90deg, transparent, #8a6a3e 30%, var(--gold-hover) 50%, #8a6a3e 70%, transparent);
    box-shadow: none;
    transition: none;
    animation: splash-roam 1.5s ease-in-out infinite alternate;
}
.splash-bar.roaming .splash-fill::after { display: none; }
@keyframes splash-roam { from { left: 0; } to { left: 68%; } }
@media (prefers-reduced-motion: reduce) {
    .splash-fill::after { animation: none; display: none; }
    .splash-bar.roaming .splash-fill { animation: none; left: 34%; }
    .splash { transition: none; }
}

/* ---------- Подсказки ---------- */
/* Одна на всю игру (см. tips.js): всё с data-tip показывает её при наведении. Вид — как у
   подсказки гнезда в «Экипировке». Несколько строк — первая заголовком. */
.ui-tip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;
    max-width: 280px;
    padding: 8px 10px;
    border: 1px solid #3a3632;
    border-radius: 6px;
    background: #0e0d0c;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .85);
    color: #9a9188;
    font: 12px/1.35 var(--font-body);
    text-align: left;
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 120ms;
}
.ui-tip.shown { visibility: visible; opacity: 1; }
.ui-tip b { color: var(--heading); font-size: 13px; font-weight: 500; }
/* Единый вид подсказки (автор, 09.10.2026): заголовок, «название: значение», бледный совет в конце.
   Значение жирное; прибавка — зелёным, убыль — красным, качество и редкость — своим цветом. */
.ui-tip .tip-title { margin-bottom: 1px; }
.ui-tip .tip-key::after { content: ": "; }
/* Свойства амулета Короля Оленей — название светлее обычного (автор, 16.10.2026). */
.ui-tip .tip-key.light { color: #c9c1b5; }
.ui-tip .tip-val { color: #d6cfc4; font-size: 12px; font-weight: 500; }
.ui-tip .tip-val.up { color: #8fbf4a; }
.ui-tip .tip-val.down { color: #e07a6e; }
.ui-tip .tip-val.q-rusty { color: #b09a84; }
.ui-tip .tip-val.q-grey { color: #c8c2b8; }
.ui-tip .tip-val.q-blue { color: #8cc0ea; }
.ui-tip .tip-val.q-gold { color: #f2c457; }
.ui-tip .tip-val.q-white { color: #ffffff; text-shadow: 0 0 6px rgba(255, 255, 255, .45); }
.ui-tip .tip-val.r-common { color: #d6cfc4; }
.ui-tip .tip-val.r-rare { color: #8fd296; }
.ui-tip .tip-val.r-unique { color: #c3a0f0; }
.ui-tip .tip-hint { margin-top: 3px; font-size: 11px; color: #6b645c; }
@media (prefers-reduced-motion: reduce) { .ui-tip { transition: none; } }

/* ---------- Панели ---------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .03);
    padding: 28px;
    width: 100%;
}
.panel.narrow { max-width: 400px; }
.panel.wide-panel { max-width: 1000px; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}
.panel-header .title { margin: 0; text-align: left; }
.panel-header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Страница админа: статистика ---------- */
.stats-page h2, .admin-page h2 { font-size: 18px; margin: 26px 0 8px; }
.stats-page .muted, .admin-page .muted { margin-bottom: 10px; }

/* Админка: вкладки сверху, справа от них — отрезок времени для замеров; плитки и графики сеткой. */
.panel.admin-page { max-width: 1240px; }
.admin-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--border); }
.admin-tab { padding: 8px 14px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tab:hover { color: var(--text); }
.admin-tab.on { color: var(--heading); border-bottom-color: var(--gold); }
.admin-range { margin-left: auto; display: flex; gap: 2px; padding-bottom: 4px; }
.admin-range-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.admin-range-btn:hover { border-color: var(--border-hover); color: var(--text); }
.admin-range-btn.on { border-color: var(--gold); color: var(--heading); }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.admin-tile { background: var(--panel-inner); border: 1px solid var(--border); padding: 10px 12px 8px; min-width: 0; }
.admin-tile-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.admin-tile-value { color: var(--heading); font-size: 18px; line-height: 1.25; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.admin-tile-sub { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; }
.admin-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.admin-charts .chart-card { border-radius: 0; border-color: var(--border); background: var(--panel-inner); }
/* Пользователи в админке. */
.admin-users-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.admin-users-search input[type=search] { flex: 1 1 220px; max-width: 320px; }
.admin-users-wrap { overflow-x: auto; }
.admin-users td { vertical-align: top; font-size: 14px; }
.admin-users tr.banned td { opacity: .75; }
.admin-online { color: #7d9a4f; margin-right: 4px; }
.admin-badge { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; border: 1px solid var(--border-hover); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.admin-badge.owner { border-color: var(--gold); color: var(--gold); }
.admin-restriction { color: var(--danger-text); font-size: 13px; }
.admin-restriction.mute { color: var(--gold); }
.admin-actions { white-space: nowrap; text-align: right; }
.admin-actions .btn { margin: 0 0 4px 4px; }
.btn.small { padding: 3px 10px; font-size: 13px; min-height: 0; }
.admin-dialog-row td { background: var(--panel-inner); }
.admin-dialog { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-dialog input[type=text] { flex: 1 1 240px; }
/* Поддержка: уровень и дни — короткие поля в строку, а не во всю ширину. */
.admin-dialog select, .admin-dialog input.admin-days { width: auto; }
.admin-dialog input.admin-days { width: 6em; }
/* Временный пароль: показывается один раз — выделяется целиком одним щелчком, чтобы скопировать. */
.admin-password { font-size: 16px; letter-spacing: 1px; padding: 2px 8px; background: var(--panel); user-select: all; }
.admin-pager { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
/* Управление. */
.admin-announce { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.admin-announce textarea {
    flex: 1 1 360px; min-height: 52px; resize: vertical; padding: 8px 10px;
    background: #0e0d0d; border: 1px solid var(--border); border-radius: 4px; color: var(--text); font: inherit;
}
.admin-announce textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.admin-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-done { color: #9fb86f; }
.admin-restart-pending { color: var(--danger-text); }
.admin-logs { font-size: 13px; border-top: 1px solid var(--border); }
.admin-log { border-bottom: 1px solid var(--border); }
.admin-log-head { display: flex; gap: 10px; padding: 5px 4px; cursor: pointer; }
.admin-log-head:hover { background: var(--panel-inner); }
.admin-log time { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-log-level { width: 64px; flex-shrink: 0; color: var(--gold); }
.admin-log.error .admin-log-level, .admin-log.critical .admin-log-level { color: var(--danger-text); }
.admin-log-category { color: var(--text-muted); flex-shrink: 0; }
.admin-log-message { min-width: 0; overflow-wrap: anywhere; }
.admin-log pre { margin: 0 0 6px; padding: 6px 8px; background: var(--panel-inner); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.admin-charts .chart-title { font-family: var(--font-title); color: var(--heading); font-weight: 400; letter-spacing: .03em; }

/* Вкладка «Мир»: настройки поверх правил. Ячейка — число и под ним серым, во что оно выходит; правка до применения — золотая рамка, применённое не как в правилах — подчёркнуто золотом. */
.tune-sections { margin: 0 0 14px; }
.tune-table td { vertical-align: top; }
.tune-table td.num { white-space: nowrap; }
.tune-table input[type=number], .tune-fields input[type=number] { width: 72px; padding: 3px 6px; font: inherit; font-size: 14px; text-align: right; background: var(--panel-inner); color: var(--heading); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tune-table input[type=number]:focus-visible, .tune-fields input[type=number]:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tune-table input.changed, .tune-fields input.changed { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.tune-table input.tuned, .tune-fields input.tuned { border-bottom: 2px solid var(--gold); }
.tune-table input:disabled, .tune-fields input:disabled { opacity: .7; }
.tune-table small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.tune-skills td:first-child small { display: block; margin: 0; }
.tune-skills tr.chain-start td { border-top: 1px solid var(--border-hover); }
.tune-skills tbody tr:first-child td { border-top: none; }
.tune-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 18px; margin-bottom: 8px; }
.tune-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tune-fields label small { color: var(--text-muted); font-size: 12px; }
.tune-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 0; background: var(--panel); border-top: 1px solid var(--border); }
.tune-changes { color: var(--gold); }
.tune-upload { cursor: pointer; }
.tune-upload input[type=file] { display: none; }

/* Вкладка «Тексты» (docs/TEXTS.md): строка — пара полей на двух языках, пустое поле пунктиром, правленая строка — золотой край. */
.texts-help { margin: 0 0 14px; }
.texts-set { margin-bottom: 22px; }
.texts-set h2 { margin-bottom: 4px; }
.texts-hint { margin: 0 0 8px; font-size: 13px; }
.texts-line { padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--border); border-left: 3px solid var(--border); background: var(--panel-inner); }
.texts-line.changed { border-left-color: var(--gold); }
.texts-line.new { border-left-color: #9fb86f; }
.texts-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.texts-pair.dirty { margin-top: 6px; }
.texts-pair label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-muted); }
.texts-pair textarea { width: 100%; min-height: 4.5em; resize: vertical; padding: 5px 7px; font: inherit; font-size: 14px; line-height: 1.35; background: var(--panel); color: var(--text); border: 1px solid var(--border); box-sizing: border-box; }
.texts-pair textarea.empty { border-style: dashed; }
.texts-pair textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.texts-pair textarea:disabled { opacity: .7; }
.texts-line .field-error { display: block; margin: 4px 0 0; }
.texts-line .texts-remove { margin-top: 4px; }
.texts-set-bar { display: flex; gap: 8px; }
@media (max-width: 700px) { .texts-pair { grid-template-columns: 1fr; } }
.tune-tiers td:first-child { white-space: nowrap; }
.tune-tier-rule td { border-bottom: none; padding-bottom: 0; }
.tune-works select { padding: 3px 6px; font: inherit; font-size: 14px; background: var(--panel-inner); color: var(--heading); border: 1px solid var(--border); max-width: 180px; }
.tune-works select.changed { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.tune-works select.tuned { border-bottom: 2px solid var(--gold); }
.tune-works input[type=number] { width: 96px; }
.tune-works input::placeholder { color: var(--text-muted); opacity: .7; }
.tune-works small { white-space: nowrap; }
.tune-expand { margin-left: 8px; }
.tune-recipe td { background: var(--panel-inner); }
.tune-recipe td:first-child { padding-left: 28px; }
.tune-recipe td:first-child small { color: var(--text-muted); margin-left: 6px; }
.stats-downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 10px; }
.stats-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.stats-table th { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.stats-table .num { text-align: right; }

.title { font-size: 28px; letter-spacing: .06em; text-align: center; text-shadow: 0 2px 6px #000; }
.subtitle { text-align: center; color: var(--text-muted); margin: -4px 0 20px; text-transform: lowercase; letter-spacing: .15em; }
.switch { text-align: center; margin: 18px 0 0; color: var(--text-muted); }
.notice { text-align: center; margin: 14px 0 0; color: var(--text-muted); font-size: 12px; opacity: .8; }

/* ---------- Формы ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span, .auth-panel .field > label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text); }

input:not([type=checkbox]), select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    background: #0e0d0d;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font: inherit;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}
select:disabled { opacity: .7; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; cursor: pointer; font-size: 13px; }
.checkbox input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--gold); flex-shrink: 0; }

.field-error { color: var(--danger-text); font-size: 13px; margin: -8px 0 12px; }

.auth-panel .auth-intro { margin: -6px 0 18px; text-align: center; font-size: 13px; }
.auth-panel .field input { border-color: #796955; }
.auth-panel .field input:hover { border-color: var(--gold); }
.auth-panel .field input:focus { border-color: var(--focus); }
.auth-panel .field input[aria-invalid="true"] { border-color: var(--danger-text); }
.auth-panel .switch { color: var(--text); }
.auth-panel .switch a { color: var(--gold-hover); font-weight: 500; }
.auth-panel .switch a:hover { color: var(--heading); }
.auth-panel .hint { color: #a39a90; }
.auth-panel .checkbox input[aria-invalid="true"]:not(:focus-visible) { outline: 1px solid var(--danger-text); outline-offset: 1px; }

.auth-password { position: relative; }
.auth-password input { padding-inline-end: 3rem; }
.auth-password button {
    position: absolute;
    inset-block: 2px;
    inset-inline-end: 3px;
    inline-size: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--gold-hover);
    cursor: pointer;
}
.auth-password button:hover { color: var(--heading); background: var(--panel-inner); }

.warning { color: #cfa27a; background: rgba(160, 58, 50, .12); border: 1px solid rgba(160, 58, 50, .4); border-radius: 4px; padding: 10px 12px; }
.warning.small { font-size: 13px; padding: 8px 10px; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border: 1px solid var(--border-hover);
    border-radius: 4px;
    background: linear-gradient(#262422, #181716);
    color: var(--text);
    font: 500 14px var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--gold); color: var(--heading); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.primary { background: linear-gradient(#6b5231, #3f2f1b); border-color: var(--gold); color: #f0e2c4; font-family: var(--font-title); letter-spacing: .05em; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(#7d6039, #4b3820); }
.btn.danger { background: linear-gradient(#6e241f, #3e1411); border-color: var(--danger); color: #f3d2cd; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--border-hover); }
.btn.danger-text { color: var(--danger-text); }

/* ---------- Портрет ---------- */
/* Портрет лошади: тело, грива и хвост нарисованы заранее в каждом цвете и складываются
   слоями (см. HorsePortrait.razor и docs/ART.md). Какие именно — задаёт сам компонент. */
.horse-portrait { position: relative; display: block; width: 100%; }
.horse-portrait.full { aspect-ratio: 660 / 510; }
.horse-portrait.icon { aspect-ratio: 1; }
.horse-portrait .layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
/* Полный рост стоит на нижней грани: иначе при узкой колонке конь висит над линией земли. */
.horse-portrait.full .layer { background-position: center bottom; }
.horse-portrait .ground { background-image: var(--art-horse-ground); }
.horse-portrait .tail { background-image: var(--tail); }
.horse-portrait .body { background-image: var(--body); }
.horse-portrait .mane { background-image: var(--mane); }

/* Существа: мастей нет, поэтому на вид хватает одной готовой картинки. Путь к ней
   компонент строит сам по имени вида — новому виду хватит положить файлы в папку. */
.creature-portrait { display: block; width: 100%; background-repeat: no-repeat; background-size: contain; }
.creature-portrait.full { aspect-ratio: 600 / 450; background-position: center bottom; }
.creature-portrait.icon { aspect-ratio: 1; background-position: center; }

/* Конструктор человека (docs/HUMANS.md): пол — две кнопки, лицо — ряд портретов вместо образцов цвета. */
.choice-row { display: flex; gap: 8px; }
.face-row { display: grid; grid-template-columns: repeat(4, minmax(0, 72px)); gap: 8px; }
.face-swatch { padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-inner); cursor: pointer; }
.face-swatch:hover { border-color: var(--gold); }
.face-swatch.selected { border-color: var(--gold-hover); box-shadow: 0 0 0 1px var(--gold-hover); }

/* Уговор — звери нарисованы мордой вправо, как лошади: отражать никого не надо. */

/* ---------- Список персонажей ---------- */
.characters-panel { max-width: 850px; }
.characters-panel .panel-header, .character-heading { flex-wrap: wrap; }
.character-heading { display: flex; align-items: baseline; gap: 4px 14px; }
.character-count { color: #a39a90; font-size: 14px; white-space: nowrap; }
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
    gap: 14px;
}
.character-card {
    position: relative;
    background: var(--panel-inner);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 250px;
}
.character-card:hover { border-color: var(--border-hover); }
.character-card-portrait {
    display: grid;
    align-items: end;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 660 / 510;
    margin-inline: auto;
}
.character-card h2 { font-size: 18px; margin: 4px 0 0; overflow-wrap: anywhere; }
.character-details { color: #a39a90; margin: 0; }
.character-card .actions { margin-top: auto; }
.character-card.empty {
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    border-style: dashed;
}
.character-card.empty:only-child { width: 100%; max-width: 320px; justify-self: center; }
.character-card.empty:hover { color: var(--gold); border-color: var(--gold); }
.character-card.empty .plus { color: var(--gold-hover); font-size: 40px; line-height: 1; font-family: var(--font-title); }
.character-menu-backdrop { position: fixed; inset: 0; z-index: 1; }
.character-card-menu { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 1; }
.character-card-menu.open { z-index: 2; }
.character-menu-toggle.btn { width: 36px; height: 36px; padding: 0; background: var(--panel-inner); }
.character-menu-toggle .menu-icon { width: 20px; height: 20px; }
.character-menu-toggle[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-hover); }
.character-menu-actions {
    position: absolute;
    inset-block-start: calc(100% + 4px);
    inset-inline-end: 0;
    padding: 4px;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    background: #191715;
    box-shadow: 0 6px 18px #0009;
}
.character-menu-actions .btn:hover { color: var(--danger-text); }

/* ---------- Создание персонажа ---------- */
.creation-header, .creation-header .panel-header-actions { flex-wrap: wrap; }
.creation-step { color: #a39a90; font-size: 13px; white-space: nowrap; }
.species-heading { margin: 0; font-size: clamp(21px, 3vw, 28px); }
.species-heading:focus { outline: none; }
.species-picker { display: grid; justify-items: center; gap: 14px; text-align: center; }
.species-carousel {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 744px;
    touch-action: pan-y;
}
.species-carousel.single { grid-template-columns: minmax(0, 1fr); }
.species-track { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 18px); min-width: 0; }
.species-card {
    flex: 1 1 0;
    max-width: 240px;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    background: #1c1612;
    color: var(--heading);
    font: 500 clamp(14px, 2vw, 20px) var(--font-title);
    cursor: pointer;
}
.species-card img { display: block; width: 100%; height: auto; opacity: .78; }
.species-card:hover { border-color: var(--gold); }
.species-card[aria-pressed="true"] {
    flex-grow: 1.36;
    max-width: 326px;
    border-color: var(--gold-hover);
    box-shadow: 0 0 0 1px #b08d5750;
}
.species-card[aria-pressed="true"] img { opacity: 1; }
.species-card-name { display: block; padding: 10px 4px; overflow-wrap: anywhere; }
.species-card[aria-pressed="true"] .species-card-name { background: #302318; }
.species-arrow.btn { width: 44px; height: 44px; padding: 0; font-size: 25px; }
.species-arrow[aria-disabled="true"] { opacity: .42; cursor: default; }
.species-arrow[aria-disabled="true"]:hover { border-color: var(--border-hover); color: var(--text); }
.species-description { margin: 0; color: #a39a90; }
.species-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.creation-editor-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.create-form { display: flex; flex-direction: column; }
.create-actions { margin-top: auto; }
.create-actions .field-error { margin: 0 0 6px; }
.preview { background: var(--panel-inner); border: 1px solid var(--border); border-radius: 6px; padding: 18px; text-align: center; align-self: start; }
.preview-name { font-family: var(--font-title); font-size: 22px; color: var(--heading); margin-top: 8px; overflow-wrap: anywhere; }
.preview-detail { color: #a39a90; }
.create-form select { border-color: #796955; }
.create-form input[type="range"] { height: 24px; padding: 0; accent-color: var(--gold); background: transparent; border: 0; }

.color-picker { border: 0; padding: 0; margin: 0 0 14px; }
.color-picker legend { font-size: 13px; margin-bottom: 6px; padding: 0; }
.color-picker .picked { color: var(--heading); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: 0 0 0 1px var(--border-hover);
    cursor: pointer;
    padding: 0;
}
.swatch:hover { box-shadow: 0 0 0 1px var(--gold); }
.swatch.selected { box-shadow: 0 0 0 2px var(--gold-hover); transform: scale(1.1); }

/* ---------- Модальное окно ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}
.modal { max-width: 440px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 700px) {
    .panel { padding: 18px; }
    .create-layout { grid-template-columns: minmax(0, 1fr); }
    .species-carousel:not(.single) { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
    .species-track { grid-column: 1 / -1; grid-row: 1; }
    .species-arrow.previous { grid-column: 1; grid-row: 2; justify-self: start; }
    .species-arrow.next { grid-column: 2; grid-row: 2; justify-self: end; }
    .create-layout .preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 6px; padding: 10px; }
    .create-layout .preview-name { font-size: 17px; }
}

/* ---------- Ошибка Blazor ---------- */
#blazor-error-ui {
    background: #3e1411;
    color: #f3d2cd;
    bottom: 0;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .reload { color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.blazor-error-boundary { background: #6e241f; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Произошла ошибка."; }
