/* King of Dragonhall — интерфейс по UI-киту холста (art/design/UiKit.dc.html).
   Сцена 1280×720, все размеры — в её пикселях; под экран её масштабирует ui.fitStage(). */
:root {
  --navy: #1d2738; --navy-l: #34445e; --navy-d: #10141c;
  --bronze: #c08a3e; --bronze-l: #ecc478; --bronze-d: #5a4a30;
  --crimson: #a3262a; --crimson-l: #d65248;
  --steel: #3d6e9e; --steel-l: #5c8cbc;
  --parch: #efe2c4; --ink: #2c1e12;
  --green: #3f8f4f; --green-l: #7aba7a;
  --text: #faf6ec; --muted: #c9bfae; --bad: #ff9a8a; --good: #7fd08e; --gold: #ffe39a;
  --plate: rgba(16, 20, 28, 0.82);
  --title: 'Cormorant SC', Georgia, 'Times New Roman', serif;
  --sans: 'PT Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  /* цвета кнопок по смыслу (docs/UI_PLAN.md §2.3): синяя — сделать, идти; золотая — купить, главное; зелёная — забрать,
     помочь; алая — только отмена и удаление. Кнопки остаются на гладком CSS-градиенте */
  --blue: #3f7fc4; --blue-l: #72b0ea; --blue-d: #1f4f86;
  /* размеры (docs/UI_PLAN.md §2.1): лёжа — прежние, стоя крупнее — css/portrait.css body.vertical. Окна модулей берут
     эти переменные, а не свои числа: стоя растут сами */
  --fs-body: 16px; --fs-sub: 14px; --fs-min: 12px; --fs-list: 17px; --fs-num: 20px; --fs-title: 30px; --fs-tab: 17px;
  --fs-btn: 22px; --fs-btn-s: 15px; --fs-cta: 22px; --fs-hud: 12px;
  --h-head: 60px; --h-tab: 40px; --h-btn: 52px; --h-btn-s: 36px; --h-cta: 52px; --w-cta: 0px;
  --row: 56px; --ava: 48px; --ic-cell: 64px;
  --t-outline: 0 1px 2px rgba(0, 0, 0, 0.5); /* обводка светлых надписей (кнопки, вкладки, заголовки, HUD) */
  --es-ic: 132px; --es-art: 230px; /* пустое окно: медальон значка и нарисованная картинка (js/ui.js emptyHtml) */
  --tst-h: 46px; --fs-toast: 18px; /* сообщение: высота плашки в одну строку и текст (js/ui.js toast) */
}
/* лёжа на телефоне (сцена мельче 3/4 — экран ниже 540 css px; js/ui.js fitStage → body.phone-land): 720 в высоту там
   в масштабе около 0,57 — текст 16 выходил в 9 css px, ✕ и «назад» — 23, вкладки и маленькие кнопки — 21–23. Сцену не
   трогаем (HUD и окна лёжа рассчитаны на 720), растут переменные: текст — почти как стоя на том же телефоне, вкладки и
   маленькие кнопки — как стоя (64 и 52), обычные — чуть ниже (по высоте место лёжа дороже); поля касания ✕ и
   «назад» — ниже, у них. Отступление от docs/UI_PLAN.md §2.1 («лёжа — прежние значения»): на планшете и ПК лёжа
   всё как было */
body.phone-land {
  /* аудит графики 07.11: наименьший текст 20 (11,4 px экрана), подписи 22, основной 24 (13,7 px) */
  --fs-body: 24px; --fs-sub: 22px; --fs-min: 20px; --fs-list: 24px; --fs-num: 26px; --fs-tab: 22px;
  --fs-btn: 26px; --fs-btn-s: 21px; --fs-cta: 28px; --fs-hud: 18px;
  --h-tab: 64px; --h-btn: 60px; --h-btn-s: 52px; --h-cta: 64px;
  --es-ic: 150px; --es-art: 290px; --tst-h: 62px; --fs-toast: 24px;
}

html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f17; }
body { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app {
  position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden;
  background: var(--navy); font-family: var(--sans); font-size: 16px; color: var(--text);
}
button { font-family: inherit; color: inherit; }
input { -webkit-user-select: text; user-select: text; }
svg { flex-shrink: 0; }
img.ico-art { flex-shrink: 0; object-fit: contain; transform: scale(1.16); } /* своя картинка значка вместо линии (icons.js icon,
   js/art.js); предмет занимает 86 % своего квадрата, линия — весь: увеличение без сдвига раскладки, чтобы не выглядела мельче */
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

/* ——— кнопки (docs/UI_PLAN.md §2.3): цвет говорит, что будет; сочный градиент, объёмный низ (тень внутри — раскладка
   та же, что у плоской), шрифт игры жирный с обводкой. Обычная .btn — синяя (сделать, идти, искать), .gold — купить,
   главное (цена — на кнопке), .green — забрать, помочь, вступить, .red — только отмена и удаление, выключенная — плоская
   серая. .steel — та же синяя (прежнее имя). Кнопки остаются на гладком CSS-градиенте ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h-btn); padding: 0 22px;
  border-radius: 8px; border: 2px solid var(--blue-d); background: linear-gradient(var(--blue-l), var(--blue));
  color: #fff; font-family: var(--sans); font-weight: 700; font-size: var(--fs-btn); letter-spacing: 0; line-height: 1;
  text-shadow: var(--t-outline); box-shadow: inset 0 -4px 0 rgba(8, 24, 48, 0.32), 0 3px 0 rgba(0, 0, 0, 0.35); cursor: pointer;
  text-align: center; /* длинная надпись — в две строки по центру (две строки шрифта влезают в высоту) */
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 -1px 0 rgba(8, 24, 48, 0.32), 0 0 0 rgba(0, 0, 0, 0.35); }
.btn.steel { background: linear-gradient(var(--blue-l), var(--blue)); border-color: var(--blue-d); }
/* переходное, пока модули сами не расставили роли кнопок (§2.3): «да» окна-вопроса без своего цвета рядом с синей
   «Отмена» — алое, как было (Выйти, Сдаться, Снять, Исключить, Распустить, удаление учётной записи); главная кнопка
   входа и создания лорда — золотая. Цвета задаются теми же CSS-селекторами */
.btn.gold, .login-box .btn[type="submit"]:not(.steel):not(.red):not(.green):not(:disabled),
.create-box .btn:not(.steel):not(.red):not(.green):not(:disabled) {
  background: linear-gradient(#ffd25e, #ec9a1e); border-color: #9a5a08; color: #fff;
  text-shadow: 0 1px 0 rgba(110, 56, 0, 0.85), 0 0 3px rgba(110, 56, 0, 0.7);
}
.btn.green { background: linear-gradient(#8fd060, #4c9a2e); border-color: #2f6a1c; }
.btn.red, .modal.ui-confirm .btn[data-yes]:not(.steel):not(.gold):not(.green):not(:disabled) {
  background: linear-gradient(var(--crimson-l), var(--crimson)); border-color: #5e1214;
}
.btn:disabled, .btn.gold:disabled, .btn.green:disabled, .btn.red:disabled {
  background: linear-gradient(#a7b0bb, #86909c); border-color: #6d7783; color: #eef2f6; text-shadow: none; box-shadow: none;
  filter: none; cursor: default; transform: none;
}
.btn.small { height: var(--h-btn-s); padding: 0 16px; border-width: 1px; border-radius: 6px; font-size: var(--fs-btn-s); }
/* квадратная кнопка со значком или знаком (±, ›): без наименьшей ширины маленькой кнопки */
.btn.sq { width: var(--h-btn-s); min-width: 0 !important; padding: 0; }
.btn:not(.small).sq { width: var(--h-btn); }
/* главная кнопка окна (В бой, Искать, Начать штурм): стоя — не уже --w-cta и выше обычной */
.btn.cta { min-width: var(--w-cta); height: var(--h-cta); font-size: var(--fs-cta); }
.btn.two { flex-direction: column; gap: 3px; width: 230px; height: auto; min-height: 62px; border-radius: 10px; } /* надпись в две строки — кнопка выше */
.btn.two .sub { display: flex; align-items: center; gap: 5px; font-family: var(--sans); font-size: 15px; letter-spacing: 0; }
body.phone-land .btn.two .sub { font-size: var(--fs-btn-s); } /* лёжа на телефоне: цена и время второй строкой — 18, а не 15 (8,6 css px) */
/* цена или время внутри кнопки: не хватает — число красное (.short) */
.btn .sub .short, .btn .short { color: #ffb4a8; text-shadow: 0 1px 0 #5e1214, 0 0 2px #5e1214; }
/* на золотой кнопке бледно-красное не читается — красное число на белой плашке */
.btn.gold .short { padding: 1px 6px; border-radius: 8px; background: #fff; color: #c0221c; text-shadow: none; }
/* длинные надписи на всех языках (план 10.9, docs/LANG.md §6): не влезла и после переноса — шрифт мельче на 12 и 24 %
   (js/ui.js fitText ставит data-fit="s" / "xs" и размер в style); не влезла и так — перенос посреди слова и подсказка
   title; ряд вкладок — на вторую строку. Короткие надписи не меняются */
[data-fit="cut"] { white-space: normal !important; overflow-wrap: anywhere !important; hyphens: auto; }
[data-fit="wrap"] { flex-wrap: wrap !important; row-gap: 6px; }

.plate { background: var(--plate); border: 1px solid var(--bronze); border-radius: 8px; }
.h-title { font-family: var(--title); font-weight: 700; color: var(--w-accent, var(--bronze-l)); }
.sect { font-family: var(--title); font-weight: 700; font-size: 22px; color: var(--w-accent, var(--bronze-l)); border-bottom: 1px solid var(--w-line, var(--bronze-d)); padding-bottom: 4px; }
/* главные кнопки окна — внизу под большим пальцем (docs/UI_PLAN.md §2.3): полоса прилипает к низу прокрутки, фон
   уходит в цвет окна; платное и обычное — две равные кнопки (золотая «Сразу · N» слева, синяя справа) */
.act-bar {
  position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: center; align-items: flex-end; gap: 16px;
  margin: 12px -6px 0; padding: 12px 16px; /* вырез и полоса жестов — уже отступом окна (.modal.full, .modal.sheet) */
  background: linear-gradient(rgba(198, 207, 218, 0), var(--w-panel, #c6cfda) 38%);
}
.act-bar .btn { flex: 1 1 0; max-width: 330px; }
/* окно во весь экран с полосой кнопок: короткое содержимое — полоса всё равно у низа окна. Тело тогда — колонка: прямые
   дети — блоки (строчное — кнопку, текст — обернуть в div), поля между ними не схлопываются. Всплывающее окно и нижняя
   панель — по содержимому: там полоса просто идёт последней и прилипает к низу прокрутки */
.modal.full > .modal-body:has(> .act-bar) { display: flex; flex-direction: column; }
.modal.full > .modal-body:has(> .act-bar) > * { flex-shrink: 0; }
.modal.full > .modal-body > .act-bar { margin-top: auto; }
.act-bar .btn.small { flex: 0 1 auto; }
.act-bar .act-note { flex-basis: 100%; text-align: center; font-size: var(--fs-sub); color: var(--muted); } /* «Время: 2ч» над кнопками */
.act-bar:has(.act-note) { flex-wrap: wrap; row-gap: 6px; }
/* пусто и загрузка (§2.5; аудит 07.11 soyuz-11): по центру, крупно, надпись — не строчка в углу. ui.js
   emptyHtml(icon, text, {title, art, btn}): значок — на тёплом медальоне (пергамент и бронза, без бледности), картинка
   (art) — крупно с тёплым светом позади; заголовок — бронзой, строка, кнопка. Размеры — --es-ic, --es-art (лёжа 132 и
   230, стоя 176 и 340, лёжа на телефоне 150 и 290). Появление — js/ui.js enterWin (при открытии окна и смене вкладки) */
.empty-state {
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; min-height: calc(var(--app-h, 720px) * 0.4); padding: 28px 18px; box-sizing: border-box; text-align: center;
  color: var(--w-muted, var(--muted)); font-size: var(--fs-body);
}
.empty-state .es-ic {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: var(--es-ic); height: var(--es-ic);
  border-radius: 50%; color: #6b4a1c;
  background: radial-gradient(circle at 50% 36%, #fff8e6 0%, #f3e1b8 42%, #dcbc80 74%, #b8894a 100%);
  box-shadow: 0 0 0 calc(var(--es-ic) * 0.025) #fff3d6, 0 0 0 calc(var(--es-ic) * 0.05) #a8762f, 0 calc(var(--es-ic) * 0.06) calc(var(--es-ic) * 0.14) rgba(70, 44, 12, 0.35),
    inset 0 calc(var(--es-ic) * -0.05) calc(var(--es-ic) * 0.1) rgba(120, 78, 26, 0.35), inset 0 calc(var(--es-ic) * 0.04) calc(var(--es-ic) * 0.06) rgba(255, 255, 255, 0.7);
}
/* тёплый свет позади медальона и картинки */
.empty-state .es-ic::before, .empty-state .es-pic::before {
  content: ''; position: absolute; z-index: -1; inset: -34%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 222, 150, 0.6), rgba(255, 214, 140, 0.22) 55%, rgba(255, 214, 140, 0));
}
.empty-state .es-ic > svg, .empty-state .es-ic > img { width: 60%; height: 60%; }
.modal-body .empty-state .es-ic > svg { filter: drop-shadow(0 2px 2px rgba(70, 44, 12, 0.4)); }
.empty-state .es-ic > img.ico-art { transform: none; filter: drop-shadow(0 4px 4px rgba(70, 44, 12, 0.45)); }
.empty-state .es-pic { position: relative; flex: none; display: flex; align-items: flex-end; justify-content: center; max-width: 100%; }
.empty-state .es-pic::before { inset: -8% -12%; }
.empty-state .es-pic > img {
  display: block; width: auto; height: var(--es-art); max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(40, 26, 8, 0.35));
}
.empty-state .es-pic.n2 > img, .empty-state .es-pic.n3 > img { height: calc(var(--es-art) * 0.8); max-width: 44%; margin-inline: -3%; }
.empty-state .es-pic.n3 > img { max-width: 38%; }
.empty-state .es-pic.n3 > img:nth-child(2) { position: relative; z-index: 1; height: calc(var(--es-art) * 0.94); }
/* афиша (портреты по пояс): низ тает, ровный срез картинок не виден */
.empty-state .es-pic.n2 > img, .empty-state .es-pic.n3 > img {
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent);
}
.empty-state > b { font-size: var(--fs-num); line-height: 1.15; color: var(--w-accent, var(--bronze-l)); }
.empty-state.es-big > b { font-family: var(--title); font-size: calc(var(--fs-num) * 1.15); letter-spacing: 0.5px; }
.empty-state > p { margin: 0; max-width: 560px; line-height: 1.35; }
.empty-state .es-btn { min-width: min(300px, 100%); margin-top: 4px; }
/* пустое окно прямо в теле окна во весь экран — на всё оставшееся место, по центру (как .act-bar выше) */
.modal.full > .modal-body:has(> .empty-state) { display: flex; flex-direction: column; }
.modal.full > .modal-body:has(> .empty-state) > * { flex-shrink: 0; }
.modal.full > .modal-body > .empty-state { flex: 1 0 auto; }
.empty-state .spinner { width: 64px; height: 64px; border-width: 6px; }
/* аватар лорда (js/ui.js avatarHtml): нажимается везде и открывает окно лорда; портрет или буква на цвете, уровень замка
   в углу; сторона — --ava (48 лёжа, 80 стоя) или своя (size → --ava-s) */
.ava {
  --ava-s: var(--ava); position: relative; flex: none; width: var(--ava-s); height: var(--ava-s); padding: 0; box-sizing: border-box;
  border: 3px solid #e8eef6; border-radius: 12px; background: #34445e; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); cursor: pointer;
}
.ava-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 9px;
  background: center / cover no-repeat; color: #fff; font: 700 calc(var(--ava-s) * 0.42)/1 var(--sans); text-shadow: var(--t-outline);
}
.ava .lv {
  position: absolute; inset-inline-start: -6px; bottom: -6px; min-width: max(22px, calc(var(--ava-s) * 0.36)); height: max(22px, calc(var(--ava-s) * 0.32));
  padding: 0 4px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: radial-gradient(circle at 50% 35%, #f3a24e, #b9541a 72%); border: 2px solid #fff; color: #fff; font: 700 max(12px, calc(var(--ava-s) * 0.22))/1 var(--sans); font-style: normal;
}
.ava.f-gold { border-color: #f1c45a; box-shadow: 0 0 0 2px #8a5a00, 0 2px 4px rgba(0, 0, 0, 0.4); }
.ava.f-silver { border-color: #e2e8ef; box-shadow: 0 0 0 2px #6d7783, 0 2px 4px rgba(0, 0, 0, 0.4); }
.ava.f-bronze { border-color: #e0a066; box-shadow: 0 0 0 2px #7a4a1e, 0 2px 4px rgba(0, 0, 0, 0.4); }
.ava.f-me { border-color: #9fe0a8; }
.ava:active { transform: scale(0.96); }

/* ——— поля ——— */
.field { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-sub); color: var(--w-hi, #d8cbb0); }
.input {
  height: 44px; padding: 0 12px; font-size: 18px; font-family: var(--sans); color: var(--text);
  background-color: var(--w-field, var(--navy-d)); background-image: none;
  border: 2px solid var(--w-line, var(--bronze-d)); border-radius: 6px; outline: none; box-sizing: border-box; width: 100%;
  box-shadow: inset 0 1px 2px rgba(30, 42, 58, 0.08);
}
.input:focus { border-color: var(--bronze-l); }
.input::placeholder { color: #8f9bb0; }
input.input:-webkit-autofill, input.input:-webkit-autofill:hover, input.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); -webkit-box-shadow: inset 0 0 0 1000px var(--w-field, #f3f6fa); box-shadow: inset 0 1px 2px rgba(30, 42, 58, 0.08);
}

/* ——— вход ——— (screens/login.js). Окно входа (.login-box) — в колонке .login-main; в браузере Android под ним (лёжа —
   справа) карточка «Игра для Android» (.app-get), на компьютере — скромная ссылка в строке версии (.app-link). В
   приложении — большая «Играть» (гость этого телефона, js/guest.js; .login-box.lg-quick прячет поля .lg-f) и «У меня есть
   аккаунт» — обычная форма (.lg-q прячется). Стоя (телефон) — крупно: поля 76 и текст 28, кнопки 84, «Играть» 120 */
.login-bg { position: absolute; inset: 0; background: #1d2738 url(../img/login_bg.jpg) center / cover no-repeat; }
body.vertical .login-bg { background-image: var(--login-port, url(../img/login_bg.jpg)); } /* brand.login_port — main.js */
.login-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(10, 14, 24, 0.75) 100%); }
/* искры экрана загрузки (css/loading.css .ld-embers, js/loading.js embersHtml) — и на входе и создании лорда: сцена живая.
   Экран — в сцене (720/1280, js/ui.js fitStage), поэтому искры крупнее и путь — в пикселях сцены, а не vh */
.lg-embers i { width: calc(var(--s) * 1.7); height: calc(var(--s) * 1.7); animation-name: lg-ember; }
@keyframes lg-ember {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; }
  12% { opacity: 0.95; }
  55% { transform: translate3d(calc(var(--s) * 8), -640px, 0) scale(0.85); opacity: 0.7; }
  100% { transform: translate3d(calc(var(--s) * -6), -1240px, 0) scale(0.45); opacity: 0; }
}
.login-logo { position: absolute; left: 50%; top: 14px; width: 600px; transform: translateX(-50%); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.login-logo img { display: block; width: 100%; }
/* название — на пустой ленте своего логотипа (brand.logo — эмблема без надписей), как на экране загрузки (css/loading.css
   .ld-name): лента — 44…87 % ширины, 52…78 % высоты картинки (высота — 0,41 ширины 600) */
.login-logo .login-name { /* середина красного полотна ленты — 61,7 % ширины (было 44…87 % — на 4 % правее, владелец 08.11) */
  position: absolute; left: 36.4%; right: 13%; top: 128px; height: 64px; display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant SC', Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 28px; line-height: 1;
  letter-spacing: 0.02em; white-space: nowrap; color: #fff0c8;
  text-shadow: 0 1px 0 #4a0a0a, 0 0 5px rgba(50, 0, 0, 0.95), 0 2px 7px rgba(0, 0, 0, 0.55);
}
/* девиз под логотипом (screens/login.js): на заглушке логотипа он нарисован по-русски (у img/logo.png 800×328 — строки
   252–282, при ширине 600 — с 189 px). Другие языки (.cut): картинка обрезана над девизом, низ когтя под золотой
   чертой тает, девиз — текстом в его виде: светлые прописные с тёмной обводкой. Своя графика без надписей (.text) — девиз
   текстом под картинкой */
.login-slogan {
  display: none; font-family: var(--sans); font-weight: 700; font-size: 20px; line-height: 1.1; letter-spacing: 1.5px;
  text-transform: uppercase; text-align: center; color: #f2e6c8;
  text-shadow: 0 0 2px #22120a, 1px 1px 0 #22120a, -1px -1px 0 #22120a, 1px -1px 0 #22120a, -1px 1px 0 #22120a,
    0 2px 0 #22120a, 0 -2px 0 #22120a, 2px 0 0 #22120a, -2px 0 0 #22120a;
}
.login-logo.cut img { height: 188px; object-fit: cover; object-position: top;
  -webkit-mask-image: linear-gradient(#000 178px, transparent 188px); mask-image: linear-gradient(#000 178px, transparent 188px); }
.login-logo.cut .login-slogan { display: block; position: absolute; left: 0; right: 0; top: 190px; }
.login-logo.text .login-slogan { display: block; margin-top: 2px; }
.login-main { position: absolute; left: 50%; top: 286px; width: 400px; transform: translateX(-50%); }
.login-box {
  position: relative; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; padding: 22px 28px 20px;
  background: rgba(29, 39, 56, 0.94); border: 3px solid var(--bronze); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.login-box.lg-quick .lg-f, .login-box:not(.lg-quick) .lg-q { display: none; }
.login-box .h-title { font-size: 30px; text-align: center; line-height: 1; }
.lg-q { display: flex; flex-direction: column; gap: 12px; }
.login-play { height: 88px; gap: 14px; font-size: 36px; border-radius: 14px; animation: kod-play 2.4s ease-in-out infinite; }
/* «Играть» дышит — зовёт нажать (уменьшить движение и «Эконом» — без этого) */
@keyframes kod-play { 50% { transform: scale(1.035); filter: brightness(1.08); } }
html.kod-still .login-play, html.kod-lo .login-play, .login-play:disabled { animation: none; }
.login-play svg { flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.login-note { margin: -4px 0 2px; text-align: center; font-size: 15px; line-height: 1.3; color: var(--muted); }
.login-back { align-self: center; padding: 4px 8px; font-size: 15px; color: var(--w-accent, var(--bronze-l)); text-decoration: underline; cursor: pointer; }
.login-box .row { display: flex; gap: 12px; margin-top: 4px; }
.login-box .row .btn { flex: 1; }
/* поля входа: подпись — значком в поле (логин, ключ; vhod-03 — меньше строк, окно ниже), текст подписи — только для
   чтения с экрана */
.lg-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lg-wrap { position: relative; display: block; }
.lg-fic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); display: flex; pointer-events: none; opacity: 0.85; }
.lg-fic :is(svg, img) { width: 24px; height: 24px; }
.lg-wrap > .input { padding-inline-start: 46px; }
.pass-eye :is(svg, img) { width: 22px; height: 22px; }
.pass-eye { display: flex; align-items: center; justify-content: center; padding: 0; }
.pass-eye .eye-off, .pass-eye.shown .eye-on { display: none; } /* login.js EYE: скрыт — глаз, виден — перечёркнутый */
.pass-eye.shown .eye-off { display: block; }
/* выбор языка до входа (vhod-12): глобус с кодом языка в правом верхнем углу; окно — языки своими именами */
.lg-lang {
  position: absolute; top: calc(14px + var(--sat, 0px)); inset-inline-end: calc(14px + var(--sar, 0px)); z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; padding: 0;
  border-radius: 50%; border: 2px solid var(--bronze-l); background: rgba(16, 22, 34, 0.74); color: #f3e6c8; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: transparent;
}
.lg-lang svg { width: 30px; height: 30px; }
.lg-lang b { font: 700 12px/1 var(--sans); letter-spacing: 0.04em; margin-top: 1px; }
.lg-lang:active { transform: scale(0.94); }
.lg-langs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lg-l {
  min-height: 52px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--w-line, #8a9bb0); cursor: pointer;
  background: linear-gradient(#f6f9fd, #dfe7f1); color: var(--w-hi, #1f2a38); font: 700 18px/1.15 var(--sans);
}
.lg-l.on { border-color: #c9963f; background: linear-gradient(#fff4d2, #f3d88e); box-shadow: 0 0 0 3px rgba(201, 150, 63, 0.35); }
.lg-l:active { transform: scale(0.97); }
.login-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.login-foot a { color: var(--w-accent, var(--bronze-l)); cursor: pointer; text-decoration: underline; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; background: var(--green); margin-right: 6px; vertical-align: -1px; }
.dot.off { background: var(--crimson-l); }
.dot.wait { background: var(--bronze); }
.form-msg { min-height: 18px; font-size: 14px; color: var(--bad); text-align: center; }
body.phone-land .form-msg { font-size: var(--fs-sub); } /* лёжа на телефоне: ошибка формы — 17 */
.version { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; color: var(--muted); text-shadow: 0 1px 2px #000; }
.pass-wrap { position: relative; }
.pass-eye { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; background: none; color: #8f9bb0; cursor: pointer; font-size: 18px; }
.pass-wrap .input { padding-inline-end: 44px; } /* текст пароля не уходит под «глаз» */
/* поля входа и создания лорда — светлые, текст тёмный. Рамка-картинка поля (ui.input, js/ui.js uiSkins) светлая и
   ставит тёмный текст, а заливки у неё нет: вне окон поле оставалось тёмным, и набранные логин, пароль и имя лорда было
   не видно (жалоба владельца 04.11 «ввод регистрации и логина с багами»). Автозаполнение браузера — тем же текстом */
.screen.login .input, .screen.create .input { background-color: #eef3f9; color: #1f2a38; }
.screen.login .input::placeholder, .screen.create .input::placeholder { color: #7a889b; }
.screen.login input.input:-webkit-autofill, .screen.create input.input:-webkit-autofill {
  -webkit-text-fill-color: #1f2a38; -webkit-box-shadow: inset 0 0 0 1000px #eef3f9;
}
.screen.login .pass-eye { color: #5d6b7e; }
body.phone-land .screen.login .input { font-size: 20px; }
/* лёжа на телефоне (аудит 07.11 vhod-11): подвал входа, строка версии, подписи полей и пояснения — 7–9 px экрана
   выходило; теперь не мельче --fs-min (20). «Забыли пароль?» и «Конфиденциальность» — поле касания выше строки */
body.phone-land .login-foot, body.phone-land .screen.login .version { font-size: var(--fs-min); }
body.phone-land .login-box .field, body.phone-land .login-note, body.phone-land .login-back { font-size: var(--fs-sub); }
body.phone-land .app-get .ag-t i, body.phone-land .lore { font-size: var(--fs-sub); }
:is(body.vertical, body.phone-land) .login-foot a { display: inline-block; padding: 12px 6px; margin: -12px -6px; }
body.phone-land .modal .input:not(select) { font-size: var(--fs-sub); } /* поля в окнах (поиск, письмо, имя) — 22 */
/* «Игра для Android» (браузер на телефоне Android): лёжа — справа от окна входа, стоя — под ним, во всю его ширину */
.app-get {
  position: absolute; left: calc(100% + 28px); top: 50%; width: 300px; transform: translateY(-50%); box-sizing: border-box;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 14px; padding: 16px;
  background: rgba(29, 39, 56, 0.94); border: 3px solid var(--green-l); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: var(--text); text-decoration: none; cursor: pointer;
}
.app-get img { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.app-get .ag-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-get .ag-t b { font-size: 22px; line-height: 1.15; }
.app-get .ag-t i { font-style: normal; font-size: 15px; line-height: 1.25; color: var(--muted); }
.app-get .ag-btn { grid-column: 1 / -1; width: 100%; box-sizing: border-box; pointer-events: none; }
.app-link { color: inherit; text-decoration: underline; cursor: pointer; padding: 8px 4px; white-space: nowrap; }
.app-link svg { width: 14px; height: 14px; margin-inline-end: 3px; vertical-align: -2px; }
/* лёжа (аудит 07.11 vhod-24): логотип и окно входа — левая колонка (середина — 340 от края), справа видны замок и
   дракон заставки; фон — от верха: на телефоне 2,2 : 1 картинка 16 : 9 режется снизу (лес), а не по крыльям дракона.
   Строка версии — справа внизу: под окном её больше не накрывает подвал формы */
body:not(.vertical) .screen.login .login-bg, body:not(.vertical) .screen.create .login-bg { background-position: 50% 0; }
body:not(.vertical) .screen.login .login-logo { left: calc(340px + var(--sal, 0px)); }
body:not(.vertical) .screen.login .login-main { left: calc(340px + var(--sal, 0px)); top: 284px; width: 440px; }
body:not(.vertical) .screen.login .version { left: auto; right: calc(18px + var(--sar, 0px)); text-align: right; }
body:not(.vertical) .lg-langs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.phone-land .screen.login .input { height: 54px; }
body.phone-land .screen.login .lg-wrap > .input { padding-inline-start: 54px; }
body.phone-land .screen.login .pass-wrap .input { padding-inline-end: 58px; }
body.phone-land .lg-fic :is(svg, img) { width: 30px; height: 30px; }
body.phone-land .pass-eye { top: 4px; right: 4px; width: 46px; height: 46px; }
body.phone-land .pass-eye :is(svg, img) { width: 30px; height: 30px; }
body.phone-land .login-box .row .btn { height: 60px; }
body.phone-land .lg-lang { width: 76px; height: 76px; }
body.phone-land .lg-lang svg { width: 38px; height: 38px; }
body.phone-land .lg-lang b { font-size: 16px; }
body.phone-land .lg-l { min-height: 64px; font-size: var(--fs-sub); }
/* стоя — крупно: экран телефона, палец. Окно входа — у низа (vhod-03): между логотипом и окном — дракон над башней
   и замок заставки, как у образца; карточка Android — одной узкой строкой */
/* логотип стоя — крупнее: 680 из 720 (было 600; владелец 08.11 — значок и логотип крупно), весь блок одним масштабом —
   название на ленте и девиз растут вместе с картинкой; верх на месте. Глобус языка — над пустым углом картинки, выше
   ленты. Экран загрузки — того же размера (css/loading.css --lw стоя): смена без скачка */
body.vertical .login-logo { top: calc(14px + var(--sat)); transform: translateX(-50%) scale(1.1333); transform-origin: 50% 0; }
body.vertical .login-main { top: auto; bottom: calc(66px + var(--sab)); width: 620px; }
body.vertical .lg-lang { top: calc(16px + var(--sat)); width: 84px; height: 84px; }
body.vertical .lg-lang svg { width: 42px; height: 42px; }
body.vertical .lg-lang b { font-size: 18px; }
body.vertical .lg-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body.vertical .lg-l { min-height: 76px; font-size: var(--fs-body); }
body.vertical .lg-fic { inset-inline-start: 18px; }
body.vertical .lg-fic :is(svg, img) { width: 36px; height: 36px; }
body.vertical .screen.login .lg-wrap > .input { padding-inline-start: 68px; }
body.vertical .login-box { gap: 18px; padding: 28px 34px 24px; border-radius: 16px; }
body.vertical .login-box .h-title { font-size: 40px; }
body.vertical .login-box .field { font-size: 22px; }
body.vertical .screen.login .input { height: 76px; padding: 0 20px; font-size: 28px; border-radius: 12px; }
body.vertical .screen.login .pass-wrap .input { padding-inline-end: 76px; }
body.vertical .login-box .row { gap: 16px; }
body.vertical .login-box .row .btn { height: 84px; font-size: 30px; }
body.vertical .pass-eye { top: 8px; right: 8px; width: 60px; height: 60px; }
body.vertical .pass-eye :is(svg, img) { width: 34px; height: 34px; } /* глаз — и нарисованный (img.ico-art), аудит 07.11 vhod-10 */
body.vertical .login-play { height: 120px; font-size: 48px; border-radius: 20px; }
body.vertical .login-play svg { width: 52px; height: 52px; }
body.vertical .login-have { height: 76px; font-size: 28px; }
body.vertical .login-note, body.vertical .login-back, body.vertical .screen.login .form-msg { font-size: 22px; }
/* новый лорд стоя (vhod-13): окно у низа — над ним дракон и замок заставки; медальон 300, шесть миниатюр по 94 */
body.vertical .create-box { width: 680px; top: auto; bottom: calc(36px + var(--sab)); transform: translateX(-50%); padding-bottom: 26px;
  border-radius: 16px; max-height: calc(100% - 60px - var(--sat) - var(--sab)); overflow-y: auto; }
body.vertical .create-box .modal-title { min-height: 72px; font-size: 32px; border-radius: 12px 12px 0 0; }
body.vertical .cr-step { gap: 18px; padding: 0 30px; }
body.vertical .cr-hero { width: 300px; height: 300px; }
body.vertical .cr-glow { inset: -30px; }
body.vertical .lords { gap: 10px; }
body.vertical .lord-pick { width: 94px; height: 94px; border-radius: 14px; }
body.vertical .cr-step .name-row .input { height: 76px; font-size: 30px; }
body.vertical .cr-step .dice { width: 76px; height: 76px; border-radius: 12px; }
body.vertical .cr-step .dice :is(svg, img) { width: 42px; height: 42px; }
body.vertical .cr-step > .btn { height: 84px; font-size: 32px; border-radius: 16px; }
/* лёжа: медальон слева, облик, имя и «Основать замок» — справа */
body:not(.vertical) .create-box { width: 860px; max-height: calc(100% - 24px); overflow-y: auto; }
body:not(.vertical) .cr-step { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: center; gap: 14px 26px; }
body:not(.vertical) .cr-step > .cr-hero { grid-column: 1; grid-row: 1 / span 5; width: 236px; height: 236px; }
body:not(.vertical) .cr-step > :not(.cr-hero) { grid-column: 2; }
body:not(.vertical) .cr-step .lords { justify-content: flex-start; flex-wrap: wrap; }
body.phone-land .cr-step .lord-pick { width: 92px; height: 92px; }
body.phone-land .cr-step .name-row .input { height: 60px; font-size: var(--fs-body); }
body.phone-land .cr-step .dice { width: 60px; height: 60px; }
body.phone-land .cr-step > .btn { height: 64px; }
/* «Код друга» (шаг «Пять королевств», css/kingdom.css): подсказка в поле — целиком (аудит 07.11 vhod-14: прописные и
   разрядка обрезали её до «КОД ДРУГА — ЕСЛИ»); набранный код — как был, прописными */
body.vertical .app-get {
  position: relative; left: auto; top: auto; width: auto; transform: none; margin-top: 14px; padding: 10px 14px;
  grid-template-columns: auto 1fr auto; gap: 14px; border-radius: 16px;
}
body.vertical .app-get img { width: 64px; height: 64px; border-radius: 14px; }
body.vertical .app-get .ag-t b { font-size: 28px; }
body.vertical .app-get .ag-t i { display: none; } /* одной строкой (vhod-03): «Игра для Android» и «Скачать» */
body.vertical .app-get .ag-btn { grid-column: auto; width: auto; height: 64px; padding: 0 22px; font-size: 26px; }
/* гость приложения не привязал аккаунт (js/guest.js, body.kod-guest): красная «!» у портрета лорда в HUD замка —
   окно лорда → «Привязать аккаунт» (screens/password.js); дышит, пока не привяжут */
body.kod-guest .screen.city .lord .portrait::after {
  content: '!'; position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #d63a34;
  border: 2px solid var(--text); color: #fff; font: 900 16px/1 var(--sans); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  animation: kod-guest-dot 1.6s ease-in-out infinite;
}
body.vertical.kod-guest .screen.city .lord .portrait::after { top: -12px; right: -12px; width: 34px; height: 34px; font-size: 22px; }
html.kod-still body.kod-guest .screen.city .lord .portrait::after { animation: none; }
@keyframes kod-guest-dot { 50% { transform: scale(1.18); } }

/* ——— новый лорд ——— */
.create-box {
  position: absolute; left: 50%; top: 50%; width: 620px; transform: translate(-50%, -50%); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 16px; padding: 0 0 22px;
  background: linear-gradient(var(--navy-l), var(--navy)); border: 4px solid var(--bronze); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}
.create-box .modal-title { border-radius: 6px 6px 0 0; }
.create-box .inner { display: flex; flex-direction: column; gap: 16px; padding: 0 28px; }
.lords { display: flex; gap: 12px; justify-content: center; }
.lord-pick {
  width: 84px; height: 84px; padding: 0; border-radius: 10px; border: 3px solid var(--w-line, var(--bronze-d)); background: var(--navy-l) center / cover no-repeat;
  cursor: pointer; opacity: 0.75; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.2s, box-shadow 0.2s;
}
.lord-pick.on { border-color: var(--bronze-l); opacity: 1; transform: translateY(-6px) scale(1.1); box-shadow: 0 0 14px rgba(236, 196, 120, 0.6); }
/* выбранный облик крупно (screens/create.js, аудит 07.11 vhod-13): золотой медальон со светом за ним; новый портрет
   въезжает снизу, прежний гаснет; кубик крутится, новое имя проявляется (vhod-21) */
.cr-hero { position: relative; align-self: center; flex: none; width: 210px; height: 210px; margin: 4px 0; }
.cr-glow { position: absolute; inset: -22px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 130, 0.6) 0%, rgba(255, 190, 90, 0.2) 46%, rgba(255, 180, 80, 0) 70%); }
.cr-big { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 32%, #4a6a94, #16223a 76%);
  border: 5px solid #e3b259; box-shadow: 0 0 0 3px #6a430f, 0 10px 24px rgba(0, 0, 0, 0.55), inset 0 0 18px rgba(0, 0, 0, 0.5); }
.cr-pic { position: absolute; left: 0; top: 7%; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.cr-pic.in { animation: cr-in 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.cr-pic.out { animation: cr-out 0.32s ease-in forwards; }
@keyframes cr-in { from { opacity: 0; transform: translateY(30px) scale(0.9); } }
@keyframes cr-out { to { opacity: 0; transform: scale(1.08); } }
.dice.spin :is(svg, img) { animation: cr-spin 0.5s cubic-bezier(0.3, 0.8, 0.3, 1.2); }
@keyframes cr-spin { 50% { transform: rotate(200deg) scale(1.25); } 100% { transform: rotate(360deg); } }
.input.cr-roll { animation: cr-roll 0.38s ease-out; }
@keyframes cr-roll { from { color: transparent; text-shadow: 0 0 8px rgba(31, 42, 56, 0.6); } }
html.kod-still .cr-pic, html.kod-still .dice :is(svg, img), html.kod-still .input.cr-roll { animation: none; }
html.kod-still .lord-pick { transition: none; }
.name-row { display: flex; gap: 10px; }
.dice { width: 44px; height: 44px; border-radius: 6px; border: 2px solid var(--bronze); background: var(--navy-l); color: var(--w-accent, var(--bronze-l)); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lore { font-size: 15px; line-height: 1.45; color: var(--w-hi, #e2d6bd); text-align: center; margin: 0; }

/* ——— окна ———
   Светлые, как у образца (решение владельца 15.10): тёмная сланцевая шапка с белым заголовком, светлая холодная
   серо-голубая подложка, голубоватые плашки строк, тёмный текст. Цвета внутри окна — переменные --w-* (в правилах
   модулей у них запасное значение — прежний тёмный вид, поэтому вне окон, на сцене и в HUD, ничего не меняется) */
.modal-wrap { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 16, 0.62); }
/* всплывающее окно (docs/UI_PLAN.md §2.2): экран позади размыт, но узнаётся. Без backdrop-filter, при «уменьшить
   движение» (html.kod-still) и на ступени «Эконом» (html.kod-lo, js/ui.js) — прежнее ровное затемнение; под выбором армии
   с путём похода (.mv-route, css/map.css) — без размытия: путь должен быть виден */
@supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
  .modal-wrap:not(.full):not(.sheet):not(.mv-route) { background: rgba(8, 10, 16, 0.4); -webkit-backdrop-filter: blur(6px) saturate(0.85); backdrop-filter: blur(6px) saturate(0.85); }
  html.kod-still .modal-wrap:not(.full):not(.sheet):not(.mv-route), html.kod-lo .modal-wrap:not(.full):not(.sheet):not(.mv-route) {
    background: rgba(8, 10, 16, 0.62); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
/* нижняя панель (modal(…, {sheet: true}), §2.2): выбор и настройка поверх живой сцены — без затемнения, сцена над
   панелью видна и листается (касания проходят мимо обёртки); ✕ в углу, «назад», смахнуть вниз */
.modal-wrap.sheet { background: none; align-items: flex-end; pointer-events: none; }
.modal.sheet {
  pointer-events: auto; position: relative; width: 100% !important; max-width: none !important; height: auto !important;
  max-height: 48% !important; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: var(--sab, 0px); animation: none;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.modal.sheet > .modal-title { border-radius: 14px 14px 0 0; touch-action: none; cursor: grab; }
.modal.sheet .sheet-grab {
  position: absolute; left: 50%; top: 6px; width: 64px; height: 6px; margin-left: -32px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.55); pointer-events: none;
}
.modal {
  --text: #1f2a38; --muted: #566274; --good: #23803e; --bad: #c0392b; --gold: #8a5a00; --plate: rgba(255, 255, 255, 0.55);
  --w-hi: #16202c; --w-muted: #566274; --w-good: #23803e; --w-bad: #c0392b; --w-gold: #8a5a00; --w-accent: #7a4c14;
  --w-well: #d4e0ef; --w-track: rgba(30, 48, 76, 0.2); --w-field: #f3f6fa; --w-line: #a5b6cc;
  width: 640px; max-height: 660px; display: flex; flex-direction: column; box-sizing: border-box; color: var(--text);
  background: #c6cfda; border: 4px solid #2a3442; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  animation: pop 0.16s ease-out;
}
.modal.wide { width: 900px; height: 580px; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
/* окно-раздел во весь экран (план 3.6, docs/GAMEPLAY.md §3.4; js/ui.js modal → full): закрывает сцену и HUD целиком,
   без затемнения, внешней рамки и скруглений; шапка сверху — «назад» слева (свой шаг окна или закрыть), крестик справа;
   вырез, скругления и полоса жестов — отступами --sat/--sab/--sal/--sar (шапка заходит под вырез своим фоном). Размеры
   окон модулей (.modal.wide.hz-win 1180×660 и т. п.) здесь не действуют. Въезд — css/life.css */
.modal-wrap.full { background: none; }
.modal.full {
  width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
  padding: 0 var(--sar, 0px) var(--sab, 0px) var(--sal, 0px); border: 0 solid transparent; border-radius: 0;
  background: linear-gradient(#ccd5e0, #bcc6d3); box-shadow: none; animation: none;
}
.modal.full > .modal-title {
  z-index: 2; height: calc(60px + var(--sat, 0px)); padding: var(--sat, 0px) calc(64px + var(--sar, 0px)) 0 calc(64px + var(--sal, 0px));
  margin: 0 calc(-1 * var(--sar, 0px)) 0 calc(-1 * var(--sal, 0px)); box-sizing: border-box; border-radius: 0;
  box-shadow: 0 2px 8px rgba(8, 12, 20, 0.45);
}
.modal.full > .modal-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal.full > .modal-title .btn-back { top: calc(8px + var(--sat, 0px)); left: calc(12px + var(--sal, 0px)); }
.modal.full > .modal-title .btn-close { top: calc(8px + var(--sat, 0px)); right: calc(12px + var(--sar, 0px)); }
.modal.full > .modal-title .mt-right { top: var(--sat, 0px); inset-inline-end: calc(64px + var(--sar, 0px)); }
/* тело раздела листается только вверх-вниз: жест вбок — свайп вкладок (js/ui.js swipeTab), а не прокрутка и не «назад»
   браузера; ленты, что листаются вбок, — сами прокрутки, у них вбок можно, как раньше */
.modal.full > .modal-body { touch-action: pan-y; }
.modal-title {
  height: 60px; flex-shrink: 0; position: relative; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#405065, #2a3442); border-bottom: 2px solid #1b232e; border-radius: 8px 8px 0 0;
  font-family: var(--title); font-weight: 700; font-size: 30px; letter-spacing: 2px; color: #fff;
  text-shadow: 0 2px 0 #121820, 0 0 3px #121820;
}
.btn-close {
  position: absolute; right: 12px; top: 8px; width: 40px; height: 40px; border-radius: 20px; padding: 0;
  background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.6); color: #fff; font-size: 18px; font-weight: 700;
  cursor: pointer; text-shadow: 0 1px 0 #121820;
}
/* «назад» слева в шапке, как крестик справа: свой шаг окна (письмо → список; ui.js modal → back), у окна во весь
   экран — всегда (нет шага — закрыть окно). Значок — стрелка (icons.js back); справа налево кнопку зеркалит css/lang.css */
.btn-back {
  position: absolute; left: 12px; top: 8px; width: 40px; height: 40px; border-radius: 20px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.6); color: #fff; font-size: 28px; line-height: 1;
  font-weight: 700; cursor: pointer; text-shadow: 0 1px 0 #121820;
}
.btn-back svg { width: 24px; height: 24px; }
/* лёжа на телефоне (body.phone-land): кружок 48 в шапке 60, поле касания 72 (около 40 css px) — невидимой рамкой;
   «!» после заголовка — кружок 40, поле касания 64 */
body.phone-land .btn-close, body.phone-land .btn-back { width: 48px; height: 48px; border-radius: 24px; font-size: 22px; }
body.phone-land .btn-back svg { width: 30px; height: 30px; }
body.phone-land .btn-close::before, body.phone-land .btn-back::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; }
body.phone-land .btn-help { position: relative; width: 40px; height: 40px; border-radius: 20px; font-size: 26px; }
body.phone-land .btn-help::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; }
body.phone-land .modal-title .mt-right { inset-inline-end: 72px; } /* валюта шапки — не вплотную к кружку ✕ */
body.phone-land .modal.full > .modal-title .mt-right { inset-inline-end: calc(72px + var(--sar, 0px)); }
body.phone-land .modal.full > .modal-title { padding-left: calc(72px + var(--sal, 0px)); padding-right: calc(72px + var(--sar, 0px)); }
/* «!» после заголовка — как устроено (modal(…, {help})); правый край шапки — валюта и кнопки окна (modal(…, {head})) */
.btn-help {
  flex: none; width: 34px; height: 34px; margin-inline-start: 10px; padding: 0; border-radius: 17px; border: 2px solid #fff;
  background: radial-gradient(circle at 50% 35%, #ffd25e, #e08a10); color: #fff; font: 700 22px/1 var(--sans); cursor: pointer;
  text-shadow: 0 1px 0 rgba(110, 56, 0, 0.85); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); letter-spacing: 0;
}
.modal-title .mt-right {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 64px; display: flex; align-items: center; gap: 8px;
  font: 700 var(--fs-num, 20px)/1 var(--sans); letter-spacing: 0; text-shadow: var(--t-outline);
}
.modal-title .mt-right:empty { display: none; }
.modal-title .mt-right > * { unicode-bidi: isolate; } /* число валюты справа налево не переставляется с соседями */
.modal-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px; font-size: var(--fs-body); }
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: #8a99ad; border-radius: 4px; }
.modal p { margin: 0 0 10px; line-height: 1.45; }
/* значки и цветной текст, чей цвет задан прямо в разметке (светлое золото, белый), — тонкая тёмная обводка: на
   светлом они читаются, как у образца белые надписи с обводкой */
.modal-body svg { filter: drop-shadow(0 0 1px rgba(14, 20, 30, 0.85)); }
.modal-body .btn svg, .modal-body .btn-close svg { filter: none; }
.modal-body [style^="color:"], .modal-body [style*=";color:"], .modal-body [style*="; color:"],
.modal .hz-odd .nm, .modal .hz-rar { filter: brightness(0.62) saturate(1.5); } /* цвет редкости — темнее, тот же оттенок */
/* вкладки в окне — ярлыки папок: выбранная светлая, остальные — тёмный сланец со светлой надписью */
.modal .q-tab, .modal .un-tab, .modal .rd-tabs .tab, .modal .rd-chips .chip {
  background: linear-gradient(#4a586d, #36424f); border-color: #232c38; color: #e8eef6;
}
.modal .q-tab.on, .modal .un-tab.on, .modal .rd-tabs .tab.on, .modal .rd-chips .chip.on {
  background: #f0f4f9; border-color: #8a9bb1; color: #16202c; box-shadow: 0 2px 0 rgba(20, 30, 45, 0.25);
}
/* бейджи и ленты на цветном фоне (уровень, номер армии, роль места, «выгода») — светлый текст, как и был */
.modal .hz-lv, .modal .hz-army, .modal .hz-chip.on, .modal .ar-x { color: #fff; }
.modal .ar-hero .role { color: #ffe8b0; }
.modal .ar-hero.main .role { color: var(--ink); }
.modal .ar-hero.lock .role { color: #c9d2de; }
.modal .ar-hero.main { background: linear-gradient(rgba(236, 196, 120, 0.45), var(--w-well) 55%); }
.modal .sh-ratio { color: #ffe39a; }
.modal .dg-stars i { color: rgba(30, 42, 60, 0.22); }
.modal .hz-stars { color: #7d6638; }
.modal .hz-card .hz-stars { color: #a08454; }
.modal .hz-card.sel { background: rgba(78, 58, 22, 0.92); }
.modal .hz-card.picked { background: rgba(110, 24, 28, 0.9); }
/* тёмные «островки» в светлом окне (ячейки вещей, медальоны, уровни, кнопки ±) — на них прежние светлые цвета */
.modal .gr-face, .modal .up-lv span, .modal .hz-step button, .modal .hz-card {
  --text: #faf6ec; --muted: #c9bfae; --w-hi: #fff3d0; --w-muted: #c9bfae; --w-good: #9fe0a8; --w-bad: #ff9a8a;
  --w-gold: #ffe39a; --w-accent: #ecc478; color: var(--text);
}

/* ——— сообщения ——— */
#toasts {
  position: absolute; left: calc(12px + var(--sal, 0px)); right: calc(12px + var(--sar, 0px)); top: calc(96px + var(--sat, 0px)); z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
/* открыто окно — сообщения внизу, над полосой кнопок окна (.act-bar): шапку, заголовок письма и вкладки не закрывают.
   Нижняя панель (.modal.sheet, не выше 48 %) — над ней. Стоя отступы — css/portrait.css */
/* открыто окно — тосты выше (#app.has-modal / .has-sheet ставит js/ui.js appMarks; не #app:has(> .modal-wrap): с ним
   любая вставка узла на экране пересчитывала стили всей страницы, замер 05.11 «замок лагает») */
#app.has-modal > #toasts { top: auto; bottom: calc(96px + var(--sab, 0px)); }
#app.has-sheet > #toasts { bottom: calc(48% + 16px); }
/* сообщение (js/ui.js toast, itemcell.js toastLoot; аудит 07.11 vhod-16): тёмная плашка-пилюля со значком слева —
   нарисованная ui.toast_ok / _err / _info (9-slice, правила uiSkins: только в одну строку — в две и больше значок
   рамки растянулся бы, там плашка по CSS того же вида), значок — .tst-ic (ставит наблюдатель #toasts в ui.js).
   Высота в одну строку — --tst-h (лёжа 46, стоя 66, лёжа на телефоне 62), текст — --fs-toast (18 / 26 / 24).
   Выезжает сверху (при открытом окне — снизу), значок вспыхивает; уходит вверх, гаснет, место схлопывается */
.toast {
  position: relative; box-sizing: border-box; max-width: min(680px, 100%); min-height: var(--tst-h);
  padding: calc((var(--tst-h) - 1.25em) / 2 - 2px) calc(var(--tst-h) * 0.5) calc((var(--tst-h) - 1.25em) / 2 - 2px) calc(var(--tst-h) * 0.98);
  border: 2px solid var(--tst-c, #b8913f); border-radius: calc(var(--tst-h) / 2);
  background: linear-gradient(#323b48, #1a2029 55%, #141920); color: #f6f1e4;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 10px var(--tst-glow, rgba(0, 0, 0, 0));
  text-align: center; font-size: var(--fs-toast); line-height: 1.25; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  overflow-wrap: anywhere; pointer-events: none;
  animation: kod-toast-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.25) backwards;
  transition: opacity 0.3s ease-in, transform 0.3s ease-in, margin 0.3s ease-in;
}
.toast.ok { --tst-c: #6ccf5a; --tst-glow: rgba(108, 207, 90, 0.35); color: #e8ffe2; }
.toast.err { --tst-c: #e0483c; --tst-glow: rgba(224, 72, 60, 0.4); color: #ffe4de; }
.toast.out { opacity: 0; transform: translateY(-14px) scale(0.94); }
#app.has-modal > #toasts > .toast { animation-name: kod-toast-up; }
#app.has-modal > #toasts > .toast.out { transform: translateY(12px) scale(0.94); }
/* значок слева: по центру левого края плашки (там же, где нарисованный значок рамки) */
.toast .tst-ic {
  position: absolute; left: calc(var(--tst-h) * 0.44 - 2px); top: calc(var(--tst-h) / 2 - 2px); width: calc(var(--tst-h) * 0.62);
  height: calc(var(--tst-h) * 0.62); margin: calc(var(--tst-h) * -0.31) 0 0 calc(var(--tst-h) * -0.31); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; border-radius: 50%; font: 900 calc(var(--tst-h) * 0.44)/1 var(--sans);
  font-style: normal; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 0 3px rgba(0, 0, 0, 0.5);
  animation: kod-toast-ic 0.5s 0.1s cubic-bezier(0.3, 1.6, 0.5, 1) backwards;
}
.toast .tst-ic > svg, .toast .tst-ic > img { width: 100%; height: 100%; }
.toast .tst-ic > img.ico-art { transform: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
.toast.err .tst-ic { background: radial-gradient(circle at 50% 35%, #ff7a68, #c4231b 62%, #7a0f0a); box-shadow: 0 0 0 2px #ffb4a8, 0 0 8px rgba(255, 70, 50, 0.6); }
.toast.tall .tst-ic { top: 50%; } /* в две строки и больше — значок по середине высоты */
/* мини-значки наград в строке («Получено: …», itemcell.js toastLoot) — под крупный текст */
.toast .ic-inl .it-pic { width: 1.25em; height: 1.25em; }
.toast .ic-inl { gap: 0.15em; }
@keyframes kod-toast-in { 0% { opacity: 0; transform: translateY(-26px) scale(0.92); } 60% { opacity: 1; } }
@keyframes kod-toast-up { 0% { opacity: 0; transform: translateY(26px) scale(0.92); } 60% { opacity: 1; } }
@keyframes kod-toast-ic { 0% { opacity: 0; transform: scale(0.3) rotate(-25deg); } 60% { opacity: 1; } }
html.kod-still .toast, html.kod-still .toast .tst-ic { animation: none; transition: opacity 0.2s; }
html.kod-still .toast.out { transform: none; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }
/* обновление скачалось в игре (js/main.js offerRestart) */
.upd-bar {
  position: absolute; left: 50%; top: calc(64px + var(--sat)); transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 18px; border-radius: 10px; background: rgba(16, 20, 28, 0.94); border: 1px solid var(--bronze); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  color: var(--w-accent, var(--bronze-l)); font-size: max(17px, var(--fs-sub)); font-weight: 700; white-space: nowrap; animation: tin 0.22s ease-out;
}
.upd-bar .upd-x { padding: 4px 8px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
/* затемнение ui.js veil() — по id: класс veil у подписи экрана загрузки (js/loading.js .ld-cap.veil) растягивал её
   плашкой на весь низ, поверх совета и полосы (аудит 07.11 vhod-01) */
#veil { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: rgba(8, 10, 16, 0.72); font-family: var(--title); font-size: 28px; color: var(--w-accent, var(--bronze-l)); }
#veil .veil-act { margin-top: 6px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--w-line, var(--bronze-d)); border-top-color: var(--bronze-l); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ——— замок: сцена ——— */
.viewport { position: absolute; inset: 0; overflow: hidden; background: #4f6d3c; cursor: grab; touch-action: none; }
.viewport.drag { cursor: grabbing; }
.scene { position: absolute; left: 0; top: 0; width: 2000px; height: 1300px; transform-origin: 0 0; will-change: transform; }
.scene.anim { transition: transform 0.35s ease; }
.scene > .bg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }
/* дороги, лес и дымка за забором — в холсте земли (js/screens/city.js compose) */
.scene .piece { position: absolute; pointer-events: none; }
.scene > .pb, .scene > .po { position: absolute; width: 0; height: 0; } /* якоря мест замка — только в сцене: полоса похода .pb на карте (map.js) не сжимается в 0 (аудит 07.11 karta-10) */
.pb .bld { position: absolute; pointer-events: none; transition: filter 0.15s; }
.pb .hit { position: absolute; cursor: pointer; border-radius: 40%; }
.pb.ghost .bld { opacity: 0.5; filter: grayscale(0.75) brightness(1.08); }
/* пустое место — бледный образ постройки, без мерцания: мерцали все пустые места разом (9–12 слоёв в сцене замка, у
   каждого — пересчёт на каждом кадре; замер 05.11, «замок лагает»). Живыми остались пузыри добычи, стрелки «можно
   улучшить» и дым */
.pb.empty .bld { opacity: 0.4; }
.pb.outside .bld { opacity: 0.8; filter: saturate(0.55) contrast(0.85) brightness(1.04); } /* за забором — как в дымке */
.pb.sel .bld { filter: drop-shadow(0 0 4px #ffe39a) drop-shadow(0 0 12px rgba(255, 214, 120, 0.85)) brightness(1.1); }
.pb.sel.ghost .bld { opacity: 0.85; }
.po .name { position: absolute; left: 0; top: 30px; transform: translateX(-50%); display: flex; align-items: center; white-space: nowrap; pointer-events: none; }
.po .name .lv {
  position: relative; z-index: 1; min-width: 26px; height: 26px; padding: 0 3px; box-sizing: border-box; border-radius: 13px;
  background: radial-gradient(circle at 50% 35%, #f3a24e, #b9541a 72%); border: 2px solid var(--bronze-l); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.po .name .nm { margin-left: -8px; padding: 2px 10px 2px 13px; background: rgba(16, 20, 28, 0.8); border: 1px solid var(--bronze); border-radius: 0 6px 6px 0; font-size: 14px; font-weight: 700; }
.po.outside { opacity: 0.6; }
.po .badge { position: absolute; left: 34px; top: -138px; width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.po .badge.up { background: radial-gradient(circle at 50% 35%, #8fd08f, #2f7a3b); border: 2px solid var(--gold); animation: bob 1.2s ease-in-out infinite; }
.po .badge.lock { background: var(--navy); border: 2px solid var(--bronze); }
.po .badge.foe { background: radial-gradient(circle at 50% 35%, var(--crimson-l), #6a1418); border: 2px solid var(--gold); } /* без качания — см. .pb.empty .bld */
@keyframes bob { 50% { transform: translateY(-7px); } }
.po .timer { position: absolute; left: 0; top: -176px; transform: translateX(-50%); width: 160px; pointer-events: none; display: flex; align-items: center; gap: 4px; }
.po .timer .ico { width: 30px; height: 30px; border-radius: 15px; background: var(--steel); border: 2px solid var(--bronze-l); display: flex; align-items: center; justify-content: center; z-index: 1; }
.po .timer .bar { flex: 1; margin-left: -10px; height: 22px; position: relative; background: var(--w-field, var(--navy-d)); border: 1px solid var(--bronze); border-radius: 0 11px 11px 0; overflow: hidden; }
.po .timer .fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#6aa0d4, var(--steel)); }
.po .timer .t { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; }

/* кольцо действий у постройки */
.ring { position: absolute; z-index: 20; width: 0; height: 0; }
.ring .title {
  position: absolute; left: 0; top: -232px; transform: translateX(-50%); white-space: nowrap; padding: 4px 16px;
  background: rgba(16, 20, 28, 0.88); border: 1px solid var(--bronze); border-radius: 6px; font-family: var(--title); font-weight: 700; font-size: 21px; color: var(--w-accent, var(--bronze-l));
}
/* кнопка кольца шириной с самую длинную подпись (92 px), но нажимается только кружок и сама подпись: пустые углы
   коробки не перекрывают соседнюю кнопку на маленьком кольце */
.rbtn {
  position: absolute; width: 92px; margin-left: -46px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0;
  background: none; border: none; color: var(--text); cursor: pointer; animation: pop 0.16s ease-out; pointer-events: none;
}
.rbtn > * { pointer-events: auto; }
.ring.opening .rbtn > * { pointer-events: none; } /* кнопки вылетают из-под пальца (citylife.js ringOpen): щелчок того же касания мимо */
.rbtn .c { width: 56px; height: 56px; border-radius: 28px; background: var(--navy); border: 3px solid var(--bronze); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.rbtn.main .c { width: 62px; height: 62px; border-radius: 31px; background: radial-gradient(circle at 50% 35%, var(--crimson-l), var(--crimson)); border-color: var(--bronze-l); }
.rbtn.off .c { filter: grayscale(0.8) brightness(0.75); }
/* подпись кольца — до 92 px (во всю кнопку): длинное слово («Geheimgeschäfte») мельчает на 12 %, а не на 24 % (10 px на
   телефоне не прочесть) */
.rbtn span:last-child { max-width: 100%; text-align: center; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.rbtn:hover .c { filter: brightness(1.15); }

/* ——— замок: HUD (по Main.dc.html) ——— */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.lord { position: absolute; left: 14px; top: 10px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.portrait { position: relative; width: 84px; height: 84px; box-sizing: border-box; border: 4px solid var(--bronze); border-radius: 10px; background: var(--navy-l) center / cover no-repeat; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.portrait .lvl { position: absolute; left: -12px; bottom: -14px; width: 30px; height: 30px; border-radius: 15px; background: radial-gradient(circle at 50% 35%, #f3a24e, #b9541a 72%); border: 2px solid var(--bronze-l); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
/* уровень замка у портрета и на местах построек — на нарисованном щитке ui.hud_level_badge (main.js: --art-lvl и класс
   art-lvl у <html>; аудит 07.11 vhod-23 — красный кружок в игре значит «есть что сделать», а уровень им путал); без
   картинки — оранжевый кружок. :root — сильнее правил размера стоя (hud.css), их скругление обрезало бы щиток */
:root.art-lvl .portrait .lvl, :root.art-lvl .po .name .lv, :root.art-lvl .ava .lv {
  box-sizing: border-box; background: var(--art-lvl) center / 100% 100% no-repeat; border: 0; border-radius: 0; padding-bottom: 2px; color: #fff;
  text-shadow: 0 1px 0 #5a2200, 1px 0 0 #5a2200, -1px 0 0 #5a2200, 0 -1px 0 #5a2200, 0 0 3px rgba(60, 20, 0, 0.8);
}
:root.art-lvl body.vertical .portrait .lvl { width: 42px; height: 42px; left: -14px; bottom: -16px; font-size: 21px; }
:root.art-lvl .ava .lv { height: max(24px, calc(var(--ava-s) * 0.36)); } /* аватар: щиток квадратный — не сплющен */
/* плашки лорда: мощь, имя и щит — столбцом, пожар при щите — правее щита. Лёжа справа ресурсы: второй столбец со
   щитом при длинном имени (16 знаков) налезал на первый ресурс. Стоя ресурсы выше — там щит и пожар вторым столбцом
   (portrait.css); левый столбец HUD (.lcol) — ниже плашек */
.lord .col { display: grid; grid-template-rows: auto auto auto; grid-auto-flow: column; justify-items: start; gap: 6px; padding-top: 2px; }
.lord .pill.shield, .lord .pill.fire { height: 28px; }
.lord .pill.fire { grid-row: 3; } /* при щите — правее щита, ниже ресурсов */
.pill { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 8px; background: var(--plate); border: 1px solid var(--bronze); border-radius: 8px; box-sizing: border-box; }
.pill.power b { font-size: 19px; letter-spacing: 0.5px; }
.pill.who { height: 28px; font-size: 15px; font-weight: 700; color: var(--w-accent, var(--bronze-l)); }
.res { position: absolute; right: 14px; top: 10px; display: flex; gap: 6px; align-items: center; }
.res .r { height: 40px; min-width: 96px; gap: 6px; cursor: pointer; font-weight: 700; font-size: 16px; }
.res .r > img.ico-art { width: 30px; height: 30px; margin: -4px 0; }
.res .r.full b { color: var(--bad); }
.res .r.gold { background: linear-gradient(#5a3a12, #3a240a); border-color: var(--bronze-l); padding-right: 4px; }
.res .r.gold b { color: var(--gold); }
.plus { width: 32px; height: 32px; border-radius: 16px; border: 2px solid var(--bronze-l); background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
/* подпись — не шире кнопки (+1 px с боков); длиннее — в две строки по пробелу (ряд сетки растёт, кнопку ниже не
   задевает), длинное слово — мельче (js/ui.js fitText) */
.hbtn { position: relative; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; background: none; border: none; color: var(--text); cursor: pointer; }
.hbtn .c > img.ico-art { width: 74%; height: 74%; } /* картинка на всю кнопку, как у образца (размер линии — под линию) */
.hbtn .c { width: 56px; height: 56px; border-radius: 28px; background: radial-gradient(circle at 50% 35%, var(--navy-l), var(--navy)); border: 3px solid var(--bronze); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.hbtn span:last-child { max-width: calc(100% + 2px); text-align: center; font-size: var(--fs-hud); font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.hbtn:hover .c { filter: brightness(1.15); }
.hbtn .cnt { position: absolute; right: 4px; top: -2px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; background: #d63a34; border: 2px solid var(--text); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bq { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; background: var(--plate); border: 1px solid var(--bronze); border-radius: 10px; cursor: pointer; }
.bq .ic { width: 36px; height: 36px; border-radius: 18px; background: var(--crimson); border: 2px solid var(--bronze-l); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bq.idle .ic { background: var(--green); }
.bq.locked { background: var(--w-well, rgba(16, 20, 28, 0.7)); border: 1px dashed #8a6a3a; cursor: default; }
.bq.locked .ic { background: var(--navy-l); border-color: #8a6a3a; }
.bq .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.bq .tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq .bar { height: 8px; background: var(--w-field, var(--navy-d)); border-radius: 4px; overflow: hidden; }
.bq .bar i { display: block; height: 100%; background: var(--steel); }
.bq .tm { color: var(--w-accent, var(--bronze-l)); font-size: 12px; }
/* ——— HUD замка по зонам (план 3.2–3.5, docs/GAMEPLAY.md §3.1): лёжа сцена 1280×720, стоя — portrait.css ———
   сверху — лорд, ресурсы, «Казна»; слева — очереди и быстрые кнопки; справа — карусель событий и «Слава, Альянс, Почта,
   Сумка»; над нижней строкой — главное задание; внизу — «Герои» (и «Армии») в левом углу, чат из трёх строк, «Мир»
   (и «Тронный зал») в правом. Пустые места столбцов касания не ловят — камера под ними работает */
.screen.city .res { right: calc(80px + var(--sar)); } /* правее — «Казна» */
.shopb { position: absolute; right: calc(10px + var(--sar)); top: 2px; width: 64px; }
.shopb .c { width: 46px; height: 46px; border-radius: 23px; }
/* подпись «Казны» не влезла и в --fs-min (js/ui.js fitText: data-fit="cut", две строки — Schatzkammer, Perbendaharaan):
   заходит на низ значка, как стоя, — не налезает на правый столбец под кнопкой (.rcol, top 78) */
body:not(.vertical) .shopb > span:last-child[data-fit="cut"] { position: relative; margin-top: -14px; line-height: 1.05; }
.lcol { position: absolute; left: calc(14px + var(--sal)); top: 124px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.lcol > *, .quick > *, .gen > *, .evc > *, .qwrap > * { pointer-events: auto; }
.qwrap { position: relative; pointer-events: none; }
.queues { display: flex; flex-direction: column; gap: 6px; width: 150px; }
.qrow { position: relative; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 2px; box-sizing: border-box; background: var(--plate);
  border: 1px solid var(--bronze); border-radius: 17px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
/* касание ловит и половина зазора над рядом и под ним: ряд невысок (сцена телефона — в полмасштаба) */
.qrow::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; bottom: -3px; }
.qrow .qi { width: 28px; height: 28px; border-radius: 14px; background: var(--crimson); border: 1px solid var(--bronze-l); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qrow b { font-weight: 700; }
.qrow .qt { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--w-accent, var(--bronze-l)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qrow.idle .qi { background: var(--green); }
.qrow.idle .qt { color: #9fe0a8; }
.qrow .qbar { position: absolute; left: 34px; right: 10px; bottom: 3px; height: 3px; border-radius: 2px; background: var(--w-field, var(--navy-d)); overflow: hidden; }
.qrow .qbar i { display: block; height: 100%; width: 0; background: var(--steel-l, #8fb0d0); }
.qrow.open { border-color: var(--bronze-l); box-shadow: 0 0 0 1px var(--bronze-l); }
.qrow.vip { background: linear-gradient(#e8c66a, #b88a3a); border-color: #fff0c0; color: #2c1e12; width: 100px; }
.qrow.vip .qi { background: none; border: 0; }
.qrow.vip.off { filter: grayscale(0.9) brightness(0.85); }
/* карточки строителей — у ряда «Строители», пока он раскрыт */
.builders { position: absolute; left: calc(100% + 8px); top: 0; z-index: 2; width: 220px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.assist { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.assist > * { pointer-events: auto; }
.quick { display: grid; grid-template-columns: repeat(3, 70px); gap: 4px 2px; align-items: start; justify-items: center; pointer-events: none; }
.quick .hbtn .c, .gen .hbtn .c { width: 50px; height: 50px; border-radius: 25px; }
.rcol { position: absolute; right: calc(8px + var(--sar)); top: 78px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.evc { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; pointer-events: none; }
.gen { display: grid; grid-template-columns: repeat(2, 70px); gap: 4px 2px; align-items: start; justify-items: center; pointer-events: none; }
.chapter {
  position: absolute; left: 0; right: 0; margin: 0 auto; bottom: calc(106px + var(--sab)); width: 560px; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; box-sizing: border-box;
  background: linear-gradient(90deg, rgba(239, 226, 196, 0.96), rgba(222, 204, 166, 0.96)); border: 2px solid var(--bronze); border-radius: 8px; color: var(--ink);
}
.chapter .ch-q { position: relative; width: 40px; height: 40px; border-radius: 20px; padding: 0; background: radial-gradient(circle at 50% 35%, var(--crimson-l), var(--crimson)); border: 2px solid var(--bronze-l); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
.chapter .ch-q .cnt { position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; padding: 0 4px; box-sizing: border-box; border-radius: 10px; background: #d63a34; border: 2px solid var(--text); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chapter .tx { flex: 1; display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.chapter .tx b { font-family: var(--title); font-weight: 700; font-size: 17px; line-height: 1.15; }
.chapter .tx span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter .ch-go { flex-shrink: 0; }
.nav { position: absolute; left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); bottom: calc(6px + var(--sab)); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; pointer-events: none; }
.nav > *, .nav .nl > *, .nav .nr > * { pointer-events: auto; }
.nav .nl, .nav .nr { display: flex; align-items: flex-end; gap: 4px; pointer-events: none; }
.nav .hbtn { gap: 3px; }
.nav .hbtn.sub { width: 70px; margin-bottom: 2px; }
.nav .hbtn.sub .c { width: 52px; height: 52px; border-radius: 26px; }
.nav .hbtn.map, .nav .hbtn.corner { width: 96px; }
.nav .hbtn.map .c, .nav .hbtn.corner .c { width: 82px; height: 82px; border-radius: 41px; background: radial-gradient(circle at 50% 35%, var(--crimson-l), #7a1a1e); border: 4px solid var(--bronze-l); }
.nav .hbtn.corner.heroes .c { background: radial-gradient(circle at 50% 35%, #4a5a7a, #161e2c); }
.nav .hbtn.map span:last-child, .nav .hbtn.corner span:last-child { font-size: 14px; }
.chat {
  flex: 0 1 560px; min-width: 0; height: 74px; margin-bottom: 18px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 8px;
  background: var(--plate); border: 1px solid var(--w-line, var(--bronze-d)); border-radius: 8px; font-size: 13px; cursor: pointer;
}
.chat .ci { flex-shrink: 0; display: flex; }
.chat .cls { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.chat .cl { line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat .who { color: #7fb6e6; font-weight: 700; }
/* лёжа на телефоне (body.phone-land, js/ui.js fitStage): подписи HUD --fs-hud (16), кнопки столбцов шире под них,
   плашки лорда, ресурсы, очереди, задание и чат — крупнее; раскладка по высоте та же (720) */
body.phone-land :where(.quick, .gen, .hdrawer, .evc) > .hbtn { width: 84px; }
body.phone-land .quick { grid-template-columns: repeat(3, 84px); }
body.phone-land .gen { grid-template-columns: repeat(2, 84px); }
body.phone-land .evc { min-width: 84px; }
body.phone-land .shopb { width: 80px; }
body.phone-land .screen.city .res { right: calc(94px + var(--sar)); }
body.phone-land .res .r { height: 44px; font-size: 20px; }
body.phone-land .hbtn .cnt { min-width: 26px; height: 26px; border-radius: 13px; font-size: 16px; }
body.phone-land .pill.power b { font-size: 22px; }
body.phone-land .pill.who { height: 32px; font-size: 18px; }
body.phone-land .lord .pill.shield, body.phone-land .lord .pill.fire { height: 32px; font-size: 16px; }
body.phone-land .portrait .lvl { font-size: 16px; }
body.phone-land .queues { width: 170px; }
body.phone-land .qrow { height: 38px; font-size: 16px; }
body.phone-land .qrow .qt { font-size: 16px; }
body.phone-land .qrow.vip { width: 116px; }
body.phone-land .bq .tx, body.phone-land .bq .tm { font-size: 16px; }
body.phone-land .chapter { width: 620px; }
body.phone-land .chapter .tx b { font-size: 20px; }
body.phone-land .chapter .tx span { font-size: 17px; }
body.phone-land .chapter .ch-q .cnt { min-width: 24px; height: 24px; border-radius: 12px; font-size: 14px; }
body.phone-land .nav .hbtn.map span:last-child, body.phone-land .nav .hbtn.corner span:last-child { font-size: 18px; }
body.phone-land .chat { flex-basis: 620px; font-size: 16px; }
body.phone-land .rbtn span:last-child { font-size: var(--fs-hud); }
body.phone-land .po .name .nm, body.phone-land .po .name .lv { font-size: 16px; }
/* кольцо постройки открыто — HUD прячется (план 3.5, docs/GAMEPLAY.md §3.3): видны ресурсы и само кольцо */
.hud > * { transition: opacity 0.18s ease-out, visibility 0s; }
.hud.ring-on > :not(.ring):not(.res) { opacity: 0; visibility: hidden; transition: opacity 0.18s ease-out, visibility 0s linear 0.18s; }
html.kod-still .hud > *, html.kod-still .hud.ring-on > * { transition: none; }

/* ——— окно улучшения (по Upgrade.dc.html) ——— */
.up { display: flex; flex-direction: column; height: 100%; }
.up-main { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 18px 22px 0; }
.up-left { width: 300px; display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.up-pic { height: 200px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 60%, rgba(236, 196, 120, 0.25), rgba(0, 0, 0, 0)); border: 1px solid var(--w-line, var(--bronze-d)); border-radius: 8px; }
.up-pic img { width: 270px; height: 190px; object-fit: contain; }
.up-lv { display: flex; align-items: center; justify-content: center; gap: 14px; }
.up-lv span { width: 54px; height: 54px; box-sizing: border-box; border-radius: 8px; background: var(--navy); border: 2px solid var(--bronze); display: flex; align-items: center; justify-content: center; font-family: var(--title); font-weight: 700; font-size: 30px; }
.up-lv span.next { background: #3a2a10; border-color: var(--bronze-l); color: var(--gold); }
.up-stats { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--w-well, rgba(16, 20, 28, 0.6)); border-radius: 8px; font-size: max(15px, var(--fs-sub)); }
.up-stats div { display: flex; justify-content: space-between; gap: 8px; }
.up-stats .plusv { color: var(--good); }
.up-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; padding-right: 4px; }
.req { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 7px 10px; box-sizing: border-box; background: var(--w-well, rgba(16, 20, 28, 0.5)); border: 1px solid var(--w-line, #3a4658); border-radius: 8px; font-size: var(--fs-body); }
.req.no { background: rgba(163, 38, 42, 0.18); border-color: #8a3a3a; }
.req .t { flex: 1; }
.req.no .t { color: var(--bad); }
.req b.lack { color: var(--bad); }
.rewards { display: flex; gap: 12px; }
.rewards div { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--w-well, rgba(16, 20, 28, 0.5)); border-radius: 8px; font-size: max(16px, var(--fs-sub)); }
.rewards b { margin-left: auto; }
.up-foot { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 14px 22px 18px; }
.up-foot .why { flex: 1; font-size: max(15px, var(--fs-sub)); color: var(--bad); }
.up-foot .why.wait { color: var(--w-accent, var(--bronze-l)); }

/* таблицы и списки в окнах */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
body.phone-land .tbl { font-size: var(--fs-min); } /* лёжа на телефоне: таблицы (ранги, VIP, награды) — 20 */
.tbl th { text-align: left; font-weight: 700; color: var(--w-accent, var(--bronze-l)); padding: 6px 8px; border-bottom: 1px solid var(--w-line, var(--bronze-d)); }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--w-line, rgba(90, 74, 48, 0.4)); }
.tbl tr.cur td { background: rgba(236, 196, 120, 0.12); }
.tbl tr.next td { color: var(--gold); }
/* окно «Шансы» (js/odds.js, docs/ODDS.md): таблица шансов, под строкой — шанс каждого варианта */
.od-body { display: flex; flex-direction: column; gap: 6px; }
.od-lead, .od-note, .od-src { margin: 0; font-size: var(--fs-sub); line-height: 1.35; }
.od-note, .od-src { color: var(--muted); }
.od-tbl td { vertical-align: top; }
.od-tbl .od-p { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.od-nm { font-weight: 700; color: var(--oc, inherit); }
.od-more summary { cursor: pointer; font-size: max(13px, var(--fs-min)); color: var(--w-accent, var(--bronze-l)); margin-top: 2px; }
.od-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; margin: 4px 0 2px; font-size: max(13px, var(--fs-min)); }
.od-items span { display: flex; justify-content: space-between; gap: 8px; }
.od-items i { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-rules { margin: 0; padding-inline-start: 20px; font-size: var(--fs-sub); line-height: 1.4; }
.od-btn svg { vertical-align: -3px; margin-right: 4px; }
/* «Шансы» в строке текста (oddsBtn(…, 'od-link')): маленькая кнопка, а не подчёркнутое слово — поле касания не ниже
   40 лёжа и --h-btn-s стоя (52); синяя, как «Шансы» в Кузнице */
.od-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: max(40px, var(--h-btn-s)); padding: 0 14px;
  box-sizing: border-box; vertical-align: middle; border-radius: 8px; border: 1px solid var(--blue-d); background: linear-gradient(var(--blue-l), var(--blue));
  color: #fff; font: 700 var(--fs-btn-s)/1 var(--sans); letter-spacing: 0; text-shadow: var(--t-outline); text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(8, 24, 48, 0.32), 0 2px 0 rgba(0, 0, 0, 0.3);
}
.od-link:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(8, 24, 48, 0.32); }
.modal-body .od-link svg { filter: none; }
body.vertical .od-link { border-radius: 12px; padding: 0 18px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
/* список во весь экран лёжа («Постройки замка», план 3.6): строки в две колонки (не уже 520 px), а не через весь экран */
body:not(.vertical) .modal.full .pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 8px 12px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; background: var(--w-well, rgba(16, 20, 28, 0.5)); border: 1px solid var(--w-line, #3a4658); border-radius: 8px; cursor: pointer; text-align: left; }
.pick:hover { border-color: var(--bronze); }
.pick img { width: 84px; height: 64px; object-fit: contain; }
.pick .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pick .t b { font-size: var(--fs-list); }
.pick .t span { font-size: var(--fs-sub); color: var(--muted); }
.goal { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--w-well, rgba(16, 20, 28, 0.5)); margin-bottom: 6px; }
.goal .t { flex: 1; }
.goal.done { opacity: 0.6; }
.goal.cur { border: 1px solid var(--bronze-l); }
.kv { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; font-size: var(--fs-body); }
.kv .v { text-align: right; font-weight: 700; }
.kv .s { color: var(--muted); font-size: var(--fs-sub); text-align: right; }
.soon { text-align: center; padding: 10px 6px 4px; }
.soon .big { font-family: var(--title); font-size: 26px; color: var(--w-accent, var(--bronze-l)); margin-bottom: 8px; }

/* рынок: обмен ресурсов */
.mk-row { display: flex; align-items: flex-end; gap: 14px; }
.mk-row .field { flex: 1; }
.mk-arrow { padding-bottom: 8px; }
.mk-range { width: 100%; margin-top: 8px; accent-color: var(--bronze); }
select.input { appearance: auto; }

/* задания (city.js openQuests): вкладки, очки активности с сундуками, ежедневные, награды глав */
.q-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.q-tab { position: relative; padding: 8px 18px; border-radius: 8px; border: 1px solid var(--w-line, rgba(192,138,62,.35)); background: var(--w-well, rgba(0,0,0,.25));
  color: var(--muted); font: inherit; font-size: var(--fs-tab); cursor: pointer; }
.q-tab.on { color: var(--w-hi, #fff3d0); border-color: var(--bronze-l); background: rgba(192,138,62,.2); }
.q-tab .hz-badge { position: absolute; top: -8px; right: -8px; }
/* лёжа на телефоне (body.phone-land): вкладки не ниже --h-tab (64), ярлык --fs-tab (20); в две строки — можно */
body.phone-land .q-tab, body.phone-land .un-tab, body.phone-land .cht-tab, body.phone-land .rd-tabs .tab {
  min-height: var(--h-tab); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: var(--fs-tab);
}
.q-act { margin: 4px 0 18px; }
.q-act > span { display: block; margin-bottom: 18px; font-size: max(16px, var(--fs-sub)); color: var(--muted); }
.q-act > span b { color: var(--w-hi, #fff3d0); font-size: 20px; }
.q-track { position: relative; height: 14px; border-radius: 7px; background: var(--w-track, rgba(0,0,0,.45)); margin: 0 18px 22px; }
.q-fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, #a3262a, #e8c66a); }
.q-chest { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--bronze); background: var(--navy-d, #1d2738); display: grid; place-items: center; cursor: pointer; padding: 0; }
.q-chest i { position: absolute; top: 40px; font-style: normal; font-size: max(13px, var(--fs-min)); color: var(--muted); }
.q-chest.ready { background: #e8c66a; border-color: #fff3d0; box-shadow: 0 0 12px rgba(232,198,106,.8); }
.q-chest.claimed { opacity: .55; }
.q-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; padding: 10px 12px; border-radius: 8px;
  background: rgba(232,198,106,.12); border: 1px solid rgba(232,198,106,.4); }
.q-ready .btn { margin-left: auto; }
.q-loot b { color: var(--w-good, #9fe0a8); }
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-task { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.22)); }
.q-task .t { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.q-task .t b { font-weight: 600; font-size: max(15px, calc(var(--fs-list) - 2px)); }
.q-task .bar { height: 7px; border-radius: 4px; background: var(--w-track, rgba(0,0,0,.45)); overflow: hidden; }
.q-task .bar i { display: block; height: 100%; background: #e8c66a; }
.q-task.done .bar i { background: #7fd08e; }
.q-task .n { font-size: var(--fs-sub); color: var(--muted); min-width: 92px; text-align: right; }
.q-task .p { font-weight: 700; color: var(--w-gold, #e8c66a); min-width: 36px; text-align: right; }
.q-note, .q-wait { color: var(--muted); font-size: var(--fs-sub); margin: 12px 0 0; }
.q-ch-reward { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.2)); }
.q-ch-reward .btn, .q-ch-reward .q-got { margin-left: auto; }
.q-got { display: flex; align-items: center; gap: 6px; color: var(--w-good, #7fd08e); }

/* академия (research.js): вкладки ветвей, идущее исследование, карточки исследований */
.rs-tabs { display: flex; align-items: center; gap: 6px 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rs-acad { margin-left: auto; color: var(--muted); font-size: max(15px, var(--fs-sub)); }
.rs-cur { margin-bottom: 10px; }
.rs-free { display: flex; align-items: center; gap: 8px; color: var(--w-good, #9fd0a6); margin: 0; }
.rs-run { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; background: rgba(192,138,62,.15); border: 1px solid rgba(192,138,62,.4); }
.rs-run .bar { flex: 1; height: 10px; border-radius: 5px; background: var(--w-track, rgba(0,0,0,.45)); overflow: hidden; }
.rs-run .bar i { display: block; height: 100%; background: linear-gradient(90deg, #c08a3e, #e8c66a); }
.rs-run .tm { font-weight: 700; min-width: 64px; text-align: right; }
.rs-des { color: var(--muted); font-size: max(14px, var(--fs-sub)); margin: 0 0 8px; }
.rs-list { display: flex; flex-direction: column; gap: 4px; }
.rs-list .rs-des { grid-column: 1 / -1; }
.rs-node { padding: 10px 12px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.22)); border: 1px solid var(--w-line, rgba(192,138,62,.2)); display: flex; flex-direction: column; gap: 6px; }
.rs-node.run { border-color: var(--bronze-l); }
.rs-node.max { opacity: .7; }
.rs-node .hd { display: flex; justify-content: space-between; align-items: baseline; }
.rs-node .hd b { font-size: var(--fs-list); color: var(--w-hi, #fff3d0); }
.rs-node .lv { color: var(--w-accent, var(--bronze-l)); font-weight: 700; }
.rs-node .ef { font-size: var(--fs-sub); color: var(--w-good, #9fe0a8); }
.rs-node .req { display: flex; align-items: center; gap: 6px; font-size: max(13px, var(--fs-min)); color: var(--w-bad, #e0705f); }
.rs-node .done { font-size: var(--fs-sub); color: var(--w-good, #7fd08e); }
.rs-node .ft { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: max(13px, var(--fs-min)); }
.rs-node .cost { display: flex; flex-wrap: wrap; gap: 4px 10px; flex: 1; }
.rs-node .cost .lack b { color: var(--w-bad, #e0705f); }
.rs-node .time { display: flex; align-items: center; gap: 4px; color: var(--muted); }

/* дракон (dragon.js) */
.dg-egg, .dg-head { display: flex; gap: 18px; align-items: center; }
.dg-egg img, .dg-head img { width: 200px; height: 200px; object-fit: contain; flex: none; }
.dg-egg > div, .dg-head > div { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dg-egg b, .dg-head .nm { font-family: var(--title); font-size: 28px; color: var(--w-accent, var(--bronze-l)); }
.dg-egg p { margin: 0; color: var(--muted); line-height: 1.45; }
.dg-left { display: flex; align-items: center; gap: 8px; font-size: 20px; color: var(--w-hi, #fff3d0) !important; }
.dg-need { display: flex; align-items: center; gap: 6px; color: var(--w-bad, #e0705f) !important; }
.dg-exp { display: flex; align-items: center; gap: 10px; }
.dg-exp .bar { flex: 1; height: 10px; border-radius: 5px; background: var(--w-track, rgba(0,0,0,.45)); overflow: hidden; }
.dg-exp .bar i { display: block; height: 100%; background: linear-gradient(90deg, #a3262a, #e8a060); }
.dg-exp span { font-size: max(14px, var(--fs-sub)); color: var(--muted); }
.dg-note { margin: 0; font-size: max(13px, var(--fs-min)); color: var(--muted); }
.dg-body .sect { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 8px; }
.dg-body .sect span { font-family: inherit; font-size: max(15px, var(--fs-sub)); font-weight: 400; color: var(--muted); }
.dg-skills { display: flex; flex-direction: column; gap: 6px; }
.dg-skill { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.22)); }
.dg-skill .t { flex: 1; display: flex; flex-direction: column; }
.dg-skill .t span { font-size: max(13px, var(--fs-min)); color: var(--muted); }
.dg-skill .v { min-width: 56px; text-align: right; font-weight: 700; color: var(--w-good, #9fe0a8); }
.dg-army { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dg-army span { flex: 1; min-width: 240px; color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.dg-army select { width: auto; }
.ar-drg { font-style: normal; vertical-align: middle; }

/* ускорение (speedup.js) */
.sp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sp-head b { flex: 1; font-family: var(--title); font-size: 24px; color: var(--w-accent, var(--bronze-l)); }
.sp-left { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 700; color: var(--w-hi, #fff3d0); }
.sp-free { width: 100%; margin-bottom: 10px; }
.sp-list, .it-list { display: flex; flex-direction: column; gap: 6px; }
.sp-item, .it-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.22)); }
.sp-item .t, .it-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-item .t span, .it-row .t span { font-size: max(13px, var(--fs-min)); color: var(--muted); }
.it-row .n { font-weight: 700; color: var(--w-hi, #fff3d0); min-width: 40px; text-align: right; }
.sp-none, .it-note { margin: 4px 0 8px; color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.sp-gold { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--w-line, var(--bronze-d)); }
.sp-gold span { color: var(--muted); }
.sp-body .sect, .it-body .sect { margin: 12px 0 8px; }
.it-empty, .ml-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 10px; color: var(--muted); text-align: center; }
.it-empty b, .ml-empty b { color: var(--w-accent, var(--bronze-l)); font-size: max(18px, var(--fs-list)); }
/* письма (mail.js) */
.ml-modal .modal-body { display: flex; flex-direction: column; }
.ml-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ml-bar .n { flex: 1; color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.ml-list { display: flex; flex-direction: column; gap: 8px; }
.ml-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; cursor: pointer; text-align: left;
  background: linear-gradient(#efe2c4, #e2d0aa); border: 2px solid #c4aa7c; color: var(--ink); font: inherit; }
.ml-card:hover { border-color: var(--bronze-l); }
.ml-card.read { filter: saturate(0.65) brightness(0.88); }
.ml-card .ic { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: #2c3a52; flex: none; }
.ml-card .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ml-card .t b { font-size: max(17px, var(--fs-list)); }
.ml-card .t span { font-size: max(13px, var(--fs-min)); color: #6a5a40; }
.ml-card .dot { width: 12px; height: 12px; border-radius: 6px; background: #a3262a; flex: none; }
.ml-letter { padding: 14px 18px; border-radius: 8px; background: linear-gradient(#efe2c4, #e2d0aa); color: var(--ink); }
.ml-letter h3 { margin: 0 0 10px; font-family: var(--title); font-size: 26px; color: #5a3a12; }
.ml-letter p { margin: 0 0 8px; line-height: 1.5; }
.ml-reward { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ml-reward .sect { color: #5a3a12; border-color: #c4aa7c; width: 100%; }
.ml-loot { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ml-letter .q-loot b { color: #2f6f3a; }
.rs-run .btn { margin-left: 10px; }

/* щит замка (city.js), перенос замка (map.js) */
.pill.shield { color: #a8d0f0; gap: 6px; }
.pill.shield b { font-size: 14px; }
/* пожар замка (js/fire.js, docs/ALLIANCE.md §4): плашка в шапке, пламя над постройками и алая дымка над сценой —
   заглушка до своей графики; окно пожара */
.pill.fire { color: #ffd2a8; gap: 6px; cursor: pointer; background: linear-gradient(#a3262a, #5a1214); border-color: #ffb070;
  animation: fire-pulse 1.4s ease-in-out infinite; }
.pill.fire b { font-size: 14px; }
@keyframes fire-pulse { 50% { box-shadow: 0 0 10px 2px rgba(255, 120, 50, 0.75); } }
.scene.burning::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 99000; /* над постройками, под подписями и пламенем */
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 90, 30, 0.16), rgba(120, 20, 10, 0.24) 70%);
  animation: fire-haze 3s ease-in-out infinite; }
@keyframes fire-haze { 50% { opacity: 0.6; } }
.fire-fx { position: absolute; left: 0; width: 120px; height: 120px; transform: translateX(-50%); pointer-events: none; }
.fire-fx.small { width: 80px; height: 80px; }
.fire-fx i { position: absolute; bottom: 0; width: 42%; height: 80%; border-radius: 50% 50% 35% 35% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 85%, #fff2b0 0%, #ffb340 30%, #f05a1e 62%, rgba(200, 40, 20, 0) 75%);
  filter: blur(1px); transform-origin: 50% 100%; animation: flame 0.9s ease-in-out infinite alternate; mix-blend-mode: screen; }
.fire-fx i:nth-child(1) { left: 6%; height: 62%; animation-delay: -0.3s; }
.fire-fx i:nth-child(2) { left: 29%; height: 92%; animation-duration: 0.7s; }
.fire-fx i:nth-child(3) { left: 52%; height: 70%; animation-delay: -0.55s; }
@keyframes flame { 0% { transform: scale(1, 1) skewX(-4deg); opacity: 0.85; } 100% { transform: scale(0.88, 1.14) skewX(5deg); opacity: 1; } }
.fr-head { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 10px; }
.tr-bar.fr-bar { height: 22px; margin-bottom: 12px; }
.tr-bar.fr-bar i { background: linear-gradient(90deg, #c0392b, #ff9a4a); }
.tr-bar.fr-bar span { font-size: 13px; line-height: 22px; font-weight: 700; }
.fr-bad { color: var(--w-bad, #ff9a8a); }
.fr-calm { display: flex; align-items: center; gap: 8px; }
.hp-row.fire { border-left: 4px solid #e8602c; }
.hp-row .t .fire-t { color: var(--w-bad, #ff9a8a); }
.tp-body p { margin: 0 0 10px; line-height: 1.45; }
.tp-need { color: var(--muted); }
.cell-note { margin: 6px 0; color: #a8d0f0; font-size: max(14px, var(--fs-sub)); }
body.phone-land .cell-note { font-size: var(--fs-sub); } /* лёжа на телефоне: пояснение под клетками — 17 */

/* альянс: «Помочь всем», «Ралли» (city.js), окно ралли (rally.js), просьба о помощи (speedup.js) */
.asst { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; border: 2px solid #f3e3c0;
  color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.asst.help { background: linear-gradient(#3f8a4a, #245a2c); }
.asst.rally { background: linear-gradient(#c2453f, #7a1a1e); }
.asst b { min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--w-well, rgba(0,0,0,.3)); text-align: center; }
/* «Сбор войска альянса» (js/rallyflag.js, docs/ALLIANCE.md §3): знамя с черепом и таймер сбора ралли соратника —
   в замке справа, левее столбца кнопок; на карте — map.css */
.rally-flag { position: absolute; right: 170px; top: 64px; /* левее двух колонок правых кнопок */ width: 70px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 0; background: none; border: none; color: #fff; font: inherit; cursor: pointer; }
.rally-flag .c { width: 56px; height: 56px; border-radius: 28px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #7a2a24, #2a0e0c); border: 3px solid #ffe39a; animation: rally-pulse 1.6s ease-out infinite; }
.rally-flag .tm { min-width: 56px; padding: 1px 6px; box-sizing: border-box; border-radius: 10px; background: #a3262a; border: 1px solid #ffe39a;
  font-size: 13px; font-weight: 700; text-align: center; text-shadow: 0 1px 2px #000; }
.rally-flag .n { position: absolute; right: 2px; top: -4px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px;
  background: #d63a34; border: 2px solid var(--text); font-size: 12px; font-style: normal; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@keyframes rally-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 120, 90, 0.7), 0 3px 8px rgba(0, 0, 0, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(255, 120, 90, 0), 0 3px 8px rgba(0, 0, 0, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(255, 120, 90, 0), 0 3px 8px rgba(0, 0, 0, 0.5); }
}
.rl-body p { margin: 0 0 10px; line-height: 1.45; }
.rl-list { display: flex; flex-direction: column; gap: 10px; }
.rl-card { padding: 10px 14px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.25)); border: 1px solid var(--w-line, var(--bronze-d)); }
.rl-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rl-hd b { font-family: var(--title); font-size: 22px; color: var(--w-accent, var(--bronze-l)); }
.rl-hd > span { color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.rl-hd .tm { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--w-hi, #fff3d0); font-weight: 700; font-size: 18px; }
.rl-hd .gt { color: var(--w-bad, #ff9a8a); font-weight: 700; } /* «сбор ещё 04:12» — конец сбора ралли (docs/ALLIANCE.md §3) */
.rl-arm { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: max(14px, var(--fs-sub)); }
.rl-ft { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rl-ft > span:first-child { flex: 1; color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.rl-in { color: var(--w-good, #9fe0a8); font-size: max(14px, var(--fs-sub)); }
.sp-help { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.sp-help span { color: var(--muted); font-size: max(14px, var(--fs-sub)); }

/* события: мировой босс (events.js, map.js) */
.ev-boss { display: flex; gap: 18px; align-items: flex-start; }
.ev-boss img { width: 180px; height: 180px; object-fit: contain; flex: none; }
.ev-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ev-main .nm { font-family: var(--title); font-size: 28px; color: var(--w-accent, var(--bronze-l)); }
.ev-des { margin: 0; color: var(--muted); line-height: 1.45; font-size: var(--fs-sub); }
.ev-where, .ev-my { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev-top { display: flex; flex-direction: column; gap: 4px; }
.ev-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 6px; background: var(--w-well, rgba(0,0,0,.22)); }
.ev-row .n { width: 22px; color: var(--muted); }
.ev-row .t { flex: 1; }
.ev-row b { color: var(--w-hi, #fff3d0); }
.ev-none { color: var(--muted); }

/* казна, лавка чести, помощь (ally.js) */
.tr-des { margin: 0 0 10px; color: var(--muted); line-height: 1.45; font-size: var(--fs-sub); }
.tr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tr-head span { display: flex; align-items: center; gap: 6px; }
.tr-list, .sh-list { display: flex; flex-direction: column; gap: 8px; }
.tr-node { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 12px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.22)); }
.tr-node .t { display: flex; flex-direction: column; }
.tr-node .t span { font-size: max(13px, var(--fs-min)); color: var(--muted); }
.tr-node .lv { font-weight: 700; color: var(--w-hi, #fff3d0); }
.tr-bar { grid-column: 1 / -1; position: relative; height: 16px; border-radius: 8px; background: var(--w-track, rgba(0,0,0,.45)); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6a5020, #ecc478); }
.tr-bar span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 16px; color: var(--w-hi, #fff3d0); }
.tr-don { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.tr-max { color: var(--w-good, #9fe0a8); font-size: max(14px, var(--fs-sub)); }
.sh-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.22)); }
.sh-item b { flex: 1; }
.sh-item .have { color: var(--muted); font-size: max(13px, var(--fs-min)); }
.hp-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; background: var(--w-well, rgba(0,0,0,.22)); margin-bottom: 6px; }
.hp-row .t { flex: 1; display: flex; flex-direction: column; }
.hp-row .t span { font-size: max(13px, var(--fs-min)); color: var(--muted); }
.hp-row .ok { color: var(--w-good, #9fe0a8); font-size: max(13px, var(--fs-min)); }

/* «Испытание королевства» (events.js) */
.ev-stage { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ev-stage > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.ev-stage .nm { font-family: var(--title); font-size: 24px; color: var(--w-accent, var(--bronze-l)); }
.ev-stage span { color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.ev-pts { font-family: var(--title); font-size: 34px; color: var(--w-hi, #fff3d0); text-align: right; line-height: 1; }
.ev-pts span { display: block; font-family: inherit; font-size: max(13px, var(--fs-min)); color: var(--muted); }
.ev-bar { position: relative; height: 14px; border-radius: 7px; background: var(--w-track, rgba(0,0,0,.45)); margin: 6px 0 12px; }
.ev-bar i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, #6a5020, #ecc478); }
.ev-bar em { position: absolute; top: -3px; width: 4px; height: 20px; margin-left: -2px; background: #fff3d0; border-radius: 2px; }
.ev-tiers { display: flex; flex-direction: column; gap: 6px; }
.ev-tier { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 6px; background: var(--w-well, rgba(0,0,0,.22)); }
.ev-tier b { min-width: 56px; color: var(--w-hi, #fff3d0); }
.ev-tier .lt { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ev-tier.ready { box-shadow: inset 0 0 0 2px var(--bronze-l); }
.ev-tier.got { opacity: .6; }
.ev-prizes { color: var(--muted); font-size: max(13px, var(--fs-min)); display: flex; flex-direction: column; gap: 2px; }

/* Драконий трон (events.js) */
.ev-row.bad b { color: var(--w-bad, #e0705f); }
.ev-row i { color: var(--muted); }
.ev-notice { display: flex; gap: 8px; }
.ev-notice .input { flex: 1; }

/* обучение новичка (tutorial.js; аудит 07.11 vhod-08, vhod-09, vhod-20): подсветка цели, окно советника — его портрет
   над углом окна (npc.advisor), рамка ui.tutor_bubble (js: art.skin), вокруг круглой кнопки — кольцо ui.tutor_ring.
   Каждый шаг — картинки и одна строка. Окно лежит поверх всей игры (body, не сцена) — размеры в px экрана. Окно
   переезжает к новой цели плавно; кольцо дышит (маленький узел), «уменьшить движение» — без движения */
.tut-wrap { position: fixed; inset: 0; z-index: 9000; }
.tut-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8, 10, 16, 0.66); border: 3px solid #ecc478;
  transition: left .3s, top .3s, width .3s, height .3s, border-radius .3s; pointer-events: none; }
.tut-wrap.round .tut-hole { border-radius: 50%; border-color: transparent; }
.tut-ring { position: fixed; display: none; pointer-events: none; filter: drop-shadow(0 0 8px rgba(255, 200, 80, 0.85));
  transition: left .3s, top .3s, width .3s, height .3s; }
.tut-wrap.round .tut-ring { display: block; animation: tut-ring 1.6s ease-in-out infinite; }
.tut-ring.go { animation: tut-ring-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3), tut-ring 1.6s ease-in-out 0.4s infinite; }
@keyframes tut-ring { 50% { transform: scale(1.07); opacity: 0.85; } }
@keyframes tut-ring-in { from { transform: scale(1.6); opacity: 0; } }
.tut-bubble {
  position: fixed; box-sizing: border-box; width: min(440px, calc(100vw - 24px)); padding: 14px 18px 12px 18px; border-radius: 14px;
  background: linear-gradient(#e8eef6, #c9d5e3); border: 3px solid #34465e; color: #1f2a38; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: left .3s cubic-bezier(0.3, 0.8, 0.3, 1), top .3s cubic-bezier(0.3, 0.8, 0.3, 1);
}
/* советник: портрет над левым углом окна, золотое кольцо; новый шаг — кивок */
.tut-face {
  position: absolute; left: -10px; top: -44px; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: flex;
  align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #a3262a, #3a0c0e);
  border: 3px solid #e8b84a; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55); color: #fff3d0; font: 700 30px/1 var(--title);
}
.tut-face .tut-fpic { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.tut-face.go { animation: tut-nod 0.42s ease-out; }
@keyframes tut-nod { 30% { transform: translateY(-5px) rotate(-4deg); } 65% { transform: translateY(1px) rotate(2deg); } }
.tut-in.go > * { animation: tut-up 0.32s ease-out both; }
.tut-in.go > :nth-child(2) { animation-delay: 0.06s; }
.tut-in.go > :nth-child(3) { animation-delay: 0.12s; }
.tut-in.go > :nth-child(4) { animation-delay: 0.16s; }
.tut-in.go .tut-p { animation: tut-pop 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }
.tut-in.go .tut-p:nth-child(2) { animation-delay: 0.1s; }
.tut-in.go .tut-p:nth-child(3) { animation-delay: 0.17s; }
.tut-in.go .tut-p:nth-child(4) { animation-delay: 0.24s; }
.tut-in.go .tut-p:nth-child(5) { animation-delay: 0.31s; }
@keyframes tut-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes tut-pop { from { opacity: 0; transform: scale(0.4); } }
.tut-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px 62px; min-height: 30px; }
.tut-head b { flex: 1; font-family: var(--title); font-size: 22px; line-height: 1.1; color: #7a3a10; }
.tut-n { color: #566274; font: 700 13px/1 var(--sans); }
/* картинки шага: значки и своя графика в ряд, по середине */
.tut-pics { display: flex; align-items: flex-end; justify-content: center; gap: 12px; min-height: 56px; margin: 4px 0 8px; }
.tut-pics:empty { display: none; }
.tut-p { display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 3px 4px rgba(20, 30, 50, 0.35)); }
.tut-p.ic :is(svg, img) { width: 48px; height: 48px; }
.tut-p .tut-ap { width: auto; height: 64px; max-width: 96px; object-fit: contain; }
.tut-p .tut-ap[src*="/heroes/"] { height: 78px; border-radius: 10px; border: 2px solid #c9963f; }
.tut-p .tut-ap[src*="/castle/"] { height: 110px; max-width: 150px; }
.tut-p.face { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; position: relative; border: 2px solid #c9963f; background: #6a5030; }
.tut-p.face .tut-fp { position: absolute; left: 50%; top: 0; width: 190%; height: auto; max-width: none; transform: translateX(-50%); }
.tut-p.wide { width: 100%; }
.tut-p.wide .tut-wp { width: 100%; height: auto; max-height: 120px; object-fit: cover; border-radius: 10px; border: 2px solid #34465e; }
.tut-bubble p { margin: 0 0 10px; font-size: 16px; line-height: 1.4; text-align: center; }
.tut-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tut-skip { margin-inline-end: auto; min-height: 40px; padding: 0 8px; margin-inline-start: -8px; border: 0; background: none;
  color: #566274; font: 700 14px/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
html.kod-still .tut-wrap *, html.kod-still .tut-bubble { animation: none !important; transition: none !important; }

/* ——— Казна (screens/shop.js) ——— */
.sh-modal .modal-body { display: flex; flex-direction: column; }
.sh-tabs { align-items: center; }
.sh-goldnow { margin-left: auto; display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gold); }
.sh-body { flex: 1; }
.sh-hint { color: var(--muted); font-size: max(14px, var(--fs-sub)); margin: 4px 0 10px; }
.sh-note { color: var(--muted); font-size: max(13px, var(--fs-min)); }
.sh-done { color: var(--good); font-size: max(14px, var(--fs-sub)); }
.sh-test { margin-top: 14px; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--bronze); color: var(--w-accent, var(--bronze-l)); font-size: max(13px, var(--fs-min)); }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.sh-grid.three { grid-template-columns: repeat(3, 1fr); }
.sh-grid.four { grid-template-columns: repeat(4, 1fr); }
.sh-card { position: relative; padding: 10px 12px; border-radius: 10px; background: var(--w-well, rgba(0,0,0,.25)); border: 1px solid var(--w-line, rgba(192,138,62,.35)); display: flex; flex-direction: column; gap: 6px; }
.sh-card.locked { opacity: .55; }
.sh-card .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sh-card .hd b { font-size: max(17px, var(--fs-list)); color: var(--w-hi, #fff3d0); }
.sh-card p { margin: 0; font-size: var(--fs-sub); color: var(--muted); }
.sh-card .ft { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.sh-big { border-color: var(--bronze-l); background: linear-gradient(rgba(192,138,62,.16), rgba(0,0,0,.25)); }
.sh-ratio { padding: 2px 8px; border-radius: 10px; background: var(--crimson); border: 1px solid var(--bronze-l); color: var(--gold); font-weight: 700; font-size: 13px; white-space: nowrap; }
.sh-loot { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: max(14px, var(--fs-sub)); }
.sh-first { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; border: 2px solid var(--bronze-l);
  background: linear-gradient(90deg, rgba(163,38,42,.55), rgba(29,39,56,.6)); }
.sh-first.ready { box-shadow: 0 0 16px rgba(255,227,154,.45); }
.sh-first .t { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sh-first .t b { font-size: 19px; color: var(--gold); font-family: var(--title); }
.sh-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-step { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: var(--w-well, rgba(0,0,0,.25)); font-size: max(13px, var(--fs-min)); }
.sh-step b { color: var(--gold); }
.sh-step.got { opacity: .6; }
.sh-step.ready { border: 1px solid var(--good); }
.sh-gold { align-items: center; text-align: center; }
.sh-gold b { color: var(--w-hi, #fff3d0); }
.sh-amount { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold); font-size: max(17px, var(--fs-list)); }
.sh-x2 { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 10px; background: var(--green); border: 1px solid var(--gold); font-weight: 700; color: #fff; }
.sh-item { align-items: center; text-align: center; }
.sh-item b { font-size: max(14px, var(--fs-sub)); color: var(--w-hi, #fff3d0); }
.sh-vip { display: flex; align-items: center; gap: 16px; padding: 12px; margin-bottom: 12px; border-radius: 10px; background: var(--w-well, rgba(0,0,0,.25)); border: 1px solid var(--bronze-l); }
.sh-vipbadge { width: 86px; height: 86px; border-radius: 43px; display: flex; align-items: center; justify-content: center; font-family: var(--title);
  font-weight: 700; font-size: 24px; color: var(--ink); background: radial-gradient(circle at 50% 35%, #ffe39a, #c08a3e); border: 3px solid #5a3a12; flex-shrink: 0; }
.sh-vip .t { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sh-vip .t b { font-size: max(18px, var(--fs-list)); color: var(--w-hi, #fff3d0); }
.sh-vip .bar { height: 10px; border-radius: 5px; background: var(--w-track, rgba(0,0,0,.45)); overflow: hidden; }
.sh-vip .bar i { display: block; height: 100%; background: linear-gradient(90deg, #c08a3e, #ffe39a); }
.sh-vipchest { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; max-width: 260px; }
.sh-viptbl td { font-size: max(13px, var(--fs-min)); }
.sh-viptbl tr.cur td { background: rgba(192,138,62,.22); }
.sh-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 14px; }
.sh-day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 10px; background: var(--w-well, rgba(0,0,0,.25));
  border: 1px solid var(--w-line, rgba(192,138,62,.3)); text-align: center; font-size: max(13px, var(--fs-min)); }
.sh-day.cur { border: 2px solid var(--gold); background: rgba(192,138,62,.2); }
.sh-day.got { opacity: .6; }
.sh-day .sh-loot { justify-content: center; }
.sh-center { justify-content: center; }
.hbtn.alert .c { position: relative; }
.hbtn.alert .c::after { content: ''; position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 7px; background: #e0453a; border: 2px solid #fff3d0; }
.bq-note { font-size: 12px; color: var(--w-accent, var(--bronze-l)); padding-left: 8px; }
.rs-q2 { color: var(--muted) !important; cursor: pointer; text-decoration: underline dotted; }
.rs-cur { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) {
  .sh-grid, .sh-grid.three, .sh-grid.four { grid-template-columns: 1fr 1fr; }
  .sh-week { grid-template-columns: repeat(4, 1fr); }
}

/* окно лорда: музыка и звуки (js/sound.js) */
.snd-row { display: flex; gap: 22px; margin-top: 16px; font-size: 16px; }
.snd-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.snd-row input { width: 20px; height: 20px; accent-color: var(--bronze); }
.snd-row .snd-lang { margin-inline-start: auto; } /* язык интерфейса (js/i18n.js) */
.snd-row select.input { width: auto; height: 36px; padding: 0 8px; font-size: 16px; }
/* окно лорда во весь экран (screens/city.js openProfile, план 3.6): лёжа — портрет и сведения слева, настройки и кнопки
   справа; стоя — одно под другим */
.lp {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; align-items: stretch; align-content: center;
  min-height: 100%; max-width: 1240px; margin: 0 auto;
}
.lp-who, .lp-set {
  box-sizing: border-box; padding: 20px 22px; border-radius: 10px; background: rgba(255, 255, 255, 0.32);
  border: 1px solid var(--w-line, var(--bronze-d)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.lp-who { display: flex; gap: 24px; align-items: center; }
.lp-set { display: flex; flex-direction: column; justify-content: center; }
.portrait.lp-pic { width: 180px; height: 180px; flex: none; }
.kv.lp-kv { flex: 1; min-width: 0; grid-template-columns: auto 1fr; }
.lp-set > .snd-row:first-child { margin-top: 0; }
.lp-set .snd-row { flex-wrap: wrap; row-gap: 12px; }
.lp-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
body.vertical .lp { grid-template-columns: minmax(0, 1fr); align-content: start; }
body.vertical .portrait.lp-pic { width: 140px; height: 140px; }
/* стоя настройки — не мельче основного текста, галочки 36 в строке высотой 56 (поле касания §2.1) */
body.vertical .snd-row { gap: 8px 28px; font-size: var(--fs-body); }
body.vertical .snd-row label { min-height: 56px; gap: 12px; }
body.vertical .snd-row input[type="checkbox"] { width: 36px; height: 36px; margin: 0; flex: none; }
body.vertical .snd-row select.input { height: 56px; padding: 0 12px; font-size: var(--fs-sub); }
/* лёжа на телефоне (body.phone-land): настройки лорда — текст 20, галочки 32 в строке 52 (вся подпись нажимается —
   галочка внутри label), выбор языка и графики — 52; прежде галочки 20, строки и выбор 36 (около 20 css px) */
body.phone-land .snd-row { gap: 4px 26px; font-size: var(--fs-body); }
body.phone-land .snd-row label { min-height: var(--h-btn-s); gap: 12px; }
body.phone-land .snd-row input[type="checkbox"] { width: 32px; height: 32px; margin: 0; flex: none; }
body.phone-land .snd-row select.input { height: var(--h-btn-s); padding: 0 12px; font-size: var(--fs-sub); }

/* корм дракона (план 5.8.1) */
.dg-feed { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-feed > span { flex: 1 1 220px; color: var(--muted); font-size: max(14px, var(--fs-sub)); }
/* звёзды навыков и снаряжение дракона (план 5.8.2) */
.dg-skill { flex-wrap: wrap; }
.dg-stars { margin-left: 6px; font-size: 14px; letter-spacing: 1px; color: var(--w-gold, #ffd75e); white-space: nowrap; }
.dg-stars i { font-style: normal; color: rgba(255, 255, 255, 0.18); }
.btn.dg-star { gap: 4px; min-width: 96px; }
.dg-max, .dg-lock { display: inline-flex; align-items: center; gap: 4px; min-width: 96px; justify-content: center; font-size: max(13px, var(--fs-min)); color: var(--muted); white-space: nowrap; }
.dg-lock { color: var(--w-bad, #e0a090); }
.dg-gears { display: flex; flex-direction: column; gap: 8px; }
.dg-gear {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--w-well, rgba(0, 0, 0, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid color-mix(in srgb, var(--rc, #7d8794) 55%, transparent);
}
.dg-gear .ic { width: 46px; height: 46px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, #34445e, #10141c); border: 2px solid var(--rc, #7d8794); }
.dg-gear .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dg-gear .t > b { font-size: max(16px, calc(var(--fs-list) - 1px)); }
.dg-gear .t em { font-style: normal; font-size: max(13px, var(--fs-min)); color: var(--muted); }
.dg-gear .t > span { font-size: max(13px, var(--fs-min)); color: var(--muted); }
.dg-gear .t > span b { color: var(--w-hi, #e8dcc0); }
.dg-gear .t > span b.up { color: var(--w-good, #9fe0a8); }
.dg-cost { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-cost i { display: inline-flex; align-items: center; gap: 3px; font-style: normal; color: var(--w-hi, #e8dcc0); }
.dg-cost i.bad { color: var(--bad); }
.dg-gear .btn, .dg-gear .dg-max, .dg-gear .dg-lock { min-width: 0; flex: none; }

/* академия — сетка веток (план 5.9): плитки узлов по ярусам, точки уровней, карточка «было → станет» */
.rs-tabs .q-tab .pct { margin-left: 6px; font-size: max(12px, var(--fs-min)); color: var(--muted); }
.rs-tier { margin: 8px 0 12px; }
.rs-tier-h { font-family: var(--serif, serif); color: var(--w-accent, #f0d79a); font-size: max(16px, var(--fs-sub)); margin: 0 0 6px; }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.rs-tile { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto auto; column-gap: 8px; text-align: left;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; color: inherit; font: inherit;
  background: var(--w-well, rgba(16, 20, 28, 0.6)); border: 1px solid var(--w-line, var(--bronze-d)); }
.rs-tile .ic { grid-row: span 3; display: flex; align-items: center; justify-content: center; }
.rs-tile b { font-size: max(15px, calc(var(--fs-list) - 2px)); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } /* длинное название — в две строки */
.rs-tile .ef { font-size: max(13px, var(--fs-min)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-tile.max { border-color: #7fd08e; }
.rs-tile.run { border-color: var(--bronze); box-shadow: 0 0 10px rgba(236, 196, 120, 0.4); }
.rs-tile.locked { opacity: 0.6; }
.pips { display: inline-flex; gap: 3px; margin: 2px 0; }
.pips i { width: 14px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); }
.pips i.on { background: #ecc478; }
.rs-card-h { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.rs-card-h > div { display: flex; flex-direction: column; gap: 2px; }
.rs-card-h b { font-size: max(18px, var(--fs-list)); }
.rs-card-h .lv { color: var(--muted); font-size: max(14px, var(--fs-sub)); }
.rs-was { display: flex; align-items: center; gap: 10px; font-size: max(17px, var(--fs-body)); margin: 6px 0 10px; flex-wrap: wrap; }
.rs-was .nx { color: var(--w-good, #9fe0a8); font-weight: 700; }
.rs-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: max(15px, var(--fs-sub)); margin-bottom: 8px; }
.rs-kv > span:nth-child(odd) { color: var(--muted); }
.rs-kv s { color: var(--muted); }
.rs-kv em { color: var(--w-good, #9fe0a8); font-style: normal; font-size: max(13px, var(--fs-min)); }
.rs-card .cost .c { margin-right: 10px; }
.rs-card .cost .c.lack b { color: var(--bad); }
