/* ============================================================
   ЮЗОВКА: УГОЛЬ, СТАЛЬ И СТЕПЬ
   Современный тёмный интерфейс экономической стратегии.
   Единый слой стилей (легаси-скины перенесены в game-legacy-backup.css).
   ============================================================ */

/* Локальная антиква эпохи */
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Renaissance — для заголовков, кнопок и подписей интерфейса */
@font-face {
  font-family: "Renaissance Grotesque";
  src: url("fonts/Renaissance Grotesque.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Renaissance Grotesque Wide";
  src: url("fonts/Renaissance Grotesque Wide.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Renaissance Narrow";
  src: url("fonts/Renaissance Narrow.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Design tokens ---------- */
:root {
  /* Игровое поле (используется app.js для расчёта масштаба) */
  --board-w: 1920px;
  --board-h: 1080px;

  /* Поверхности: нейтральный графит, без коричневого подмеса */
  --bg: #0d0c0b;
  --bg-glow: transparent;
  --panel: #151412;
  --panel-2: #171613;
  --panel-3: #1e1b15;
  --panel-raised: #211e18;
  --overlay: rgba(5, 5, 5, 0.78);
  --heading-texture: url("assets/texture_1.png");
  --heading-texture-size: auto;
  --surface-texture: url("assets/texture_2.png");
  --surface-texture-size: 40.8rem auto;
  --surface-texture-position: top left;
  --surface-texture-repeat: repeat;

  /* Линии: серо-ивори, едва тёплые */
  --line: rgba(214, 196, 150, 0.16);
  --line-strong: rgba(214, 196, 150, 0.32);
  --line-soft: rgba(214, 196, 150, 0.09);

  /* Текст: светлая слоновая кость, высокий контраст */
  --text: #d6cdb2;
  --text-strong: #efe6cb;
  --muted: #a3987e;
  --muted-2: #81775f;

  /* Акценты: старое золото точечно, олива и кирпич */
  --accent: #c9a86a;
  --accent-soft: rgba(201, 168, 106, 0.1);
  --gold: #d3b878;
  --gold-soft: rgba(211, 184, 120, 0.1);
  --good: #93b06e;
  --good-soft: rgba(147, 176, 110, 0.1);
  --bad: #b5533d;
  --bad-soft: rgba(181, 83, 61, 0.11);
  --warn: #c99f56;
  --warn-soft: rgba(201, 159, 86, 0.1);

  /* Шрифты: антиква для заголовков, гротеск для интерфейса */
  --font-display: "EB Garamond", "Palatino Linotype", "Times New Roman", serif;
  --font-body: var(--font-display);
  --font-heading: "Renaissance Grotesque", "EB Garamond", "Times New Roman", serif;
  --font-heading-wide: "Renaissance Grotesque Wide", "Renaissance Grotesque", "EB Garamond", serif;
  --font-italic: "EB Garamond", "Palatino Linotype", "Times New Roman", serif;
  --font-ui: "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

  /* Геометрия: почти прямые углы */
  --radius-lg: 3px;
  --radius: 2px;
  --radius-sm: 2px;
  --gap: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.22);

  /* Перекраска чёрных PNG-иконок */
  --icon-slate: brightness(0) saturate(100%) invert(78%) sepia(8%) saturate(180%) hue-rotate(15deg) brightness(94%) contrast(86%);
  --icon-good: brightness(0) saturate(100%) invert(66%) sepia(22%) saturate(480%) hue-rotate(55deg) brightness(89%) contrast(85%);
  --icon-bad: brightness(0) saturate(100%) invert(45%) sepia(32%) saturate(850%) hue-rotate(340deg) brightness(88%) contrast(86%);
  --icon-gold: brightness(0) saturate(100%) invert(74%) sepia(22%) saturate(420%) hue-rotate(4deg) brightness(96%) contrast(86%);
  --icon-muted: brightness(0) saturate(100%) invert(55%) sepia(6%) saturate(200%) hue-rotate(15deg) brightness(88%) contrast(84%);

  /* Совместимость со старыми переменными, если где-то остались ссылки */
  --active-gold: var(--gold);
  --active-good: var(--good);
  --active-bad: var(--bad);
  --active-muted: var(--muted);
}

/* ---------- 2. Base & board shell (фикс. 1920x1080, масштабируется app.js) ---------- */
* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: all;
  background: #000;
  opacity: 1;
  transition: opacity 720ms ease-out;
}

.boot-screen.is-ready {
  pointer-events: none;
  opacity: 0;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: radial-gradient(125% 105% at 50% 42%, transparent 58%, rgba(4, 3, 2, 0.5) 100%);
}

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 41;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  mix-blend-mode: overlay;
}

.page {
  position: relative;
  flex: none;
  width: 1920px;
  height: 1080px;
  margin: 0;
  padding: var(--gap);
  display: grid;
  grid-template-columns: 17.15% minmax(0, 1fr) 22.8%;
  grid-template-rows: 10.6% minmax(0, 1fr) 8.8%;
  grid-template-areas:
    "brand hud hud"
    "board board board"
    "forecast forecast menu";
  gap: var(--gap);
  font-size: 17px;
  /* Масштабирование через zoom вместо transform: scale() — браузер
     перерисовывает интерфейс и картинки в целевом размере (резко),
     а не растягивает готовый растр (что мылило текст и пикселило портреты). */
  zoom: var(--ui-scale, 1);
}

/* Общий вид панелей */
.masthead,
.strategy-hud,
.panel,
.turn-card,
.forecast-bar,
.game-menu-bar {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(240, 236, 220, 0.04), inset 0 0 26px rgba(0, 0, 0, 0.4);
}

.masthead,
.strategy-hud,
.panel,
.forecast-bar,
.game-menu-bar,
.notice {
  position: relative;
}

.masthead::after,
.strategy-hud::after,
.panel::after,
.forecast-bar::after,
.game-menu-bar::after,
.notice::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 7;
  pointer-events: none;
  border: 1px solid rgba(214, 196, 150, 0.09);
  border-radius: 2px;
}

/* ---------- 3. Masthead (бренд) ---------- */
.masthead {
  grid-area: brand;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  overflow: hidden;
  text-align: center;
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    var(--panel-2);
  background-blend-mode: normal, normal;
}

.masthead .brand-logo {
  display: block;
  width: min(88%, 15rem);
  max-height: 86%;
  object-fit: contain;
}

.brand-mark {
  flex: none;
  color: var(--gold);
  font-size: 1.9rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.masthead .brand-text {
  display: grid;
  justify-items: center;
  min-width: 0;
}

.masthead .brand-text::before {
  content: "";
  width: min(88%, 14rem);
  height: 1px;
  margin-bottom: 0.28rem;
  background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
}

.masthead .brand-text::after {
  content: "— 1869 — 1879 —";
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  line-height: 1;
}

.kicker {
  margin: 0 0 0.22rem;
  color: #8f8b7c;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

h1,
.masthead h1 {
  display: grid;
  gap: 0.12rem;
  justify-items: center;
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.7rem, 2.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.masthead h1 span,
.masthead h1 small {
  display: block;
  white-space: nowrap;
}

h1,
.masthead h1,
.event h2,
.notice h3,
.end-screen h2,
.glossary-toast b,
.advisors-panel .advisors b {
  font-family: var(--font-heading);
}

/* Заголовки, подписи и кнопки, наследующие базовый шрифт, — тоже на Renaissance */
.panel-title,
.choice-title,
.choice-action,
.notice-section h4,
.notice-head small,
.game-menu-head small,
.kicker,
.date-line,
.chapter-line,
.hud-cell small,
.menu-toggle,
.sound-btn,
.primary-btn,
.small-btn,
.menu-btn,
.journal-tabs button,
.internal-confirm-actions button {
  font-family: var(--font-heading);
}

.masthead h1 small {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.subtitle,
.stamp {
  display: none;
}

/* ---------- 4. Strategy HUD ---------- */
.strategy-hud {
  grid-area: hud;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 40%) 8.5% 9% minmax(0, 20%) 12.5% 10%;
  grid-template-rows: 70% 30%;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    var(--panel-2);
  background-blend-mode: normal, normal;
}

.hud-cell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: center;
  align-items: center;
  column-gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: center;
}

.strategy-hud > .hud-cell:not(.hud-chapter-cell):not(.hud-goal-cell) {
  grid-row: 1;
}

.hud-cell small {
  grid-column: 1 / -1;
  display: block;
  margin: 0 0 0.24rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.hud-cell strong,
.hud-cell span {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-icon {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
}

.strategy-hud > .hud-cell:not(.hud-chapter-cell):not(.hud-goal-cell) .hud-icon {
  grid-column: 1;
  grid-row: 2;
}

.strategy-hud > .hud-cell:not(.hud-chapter-cell):not(.hud-goal-cell) > span:not(.hud-icon),
.strategy-hud > .hud-cell:not(.hud-chapter-cell):not(.hud-goal-cell) > strong {
  grid-column: 2;
  grid-row: 2;
}

/* Ячейки «Дата» и «Ход»: подпись сверху, иконка + значение в строку */
.hud-metric-cell {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.16rem;
}

.hud-metric-cell > small {
  margin: 0;
}

.hud-metric-cell .hud-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-width: 0;
  overflow: visible;
}

.hud-metric-cell .hud-metric .hud-icon {
  width: 0.82rem;
  height: 0.82rem;
  font-size: 0.72rem;
  color: var(--text-strong);
}

/* PNG-иконки даты/хода: тон как у цифр (светлая кость) и поменьше */
.hud-metric-cell .hud-metric .hud-icon.png-icon.asset-loaded {
  width: 0.82rem !important;
  height: 0.82rem !important;
  min-width: 0.82rem !important;
  min-height: 0.82rem !important;
  --icon-filter: brightness(0) saturate(100%) invert(92%) sepia(9%) saturate(260%) hue-rotate(6deg) brightness(98%) contrast(88%);
}

#hudYear,
#hudTurn {
  color: var(--text-strong);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  font-size: 1.34rem !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#hudCapital {
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  font-size: 1.34rem !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Ячейка «Условия»: сезон и погода в одну строку.
   Селекторы намеренно повышенной специфичности — иначе общее правило
   .hud-cell span { display:block; overflow:hidden } ставит иконки столбиком. */
.hud-conditions-cell {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.26rem;
  overflow: visible;
}

.hud-conditions-cell > small {
  margin: 0;
}

.hud-conditions-cell .hud-conditions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-width: 0;
  overflow: visible;
}

.hud-conditions-cell .hud-cond {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  overflow: visible;
}

.hud-conditions-cell .hud-cond .hud-icon {
  width: 0.95rem;
  height: 0.95rem;
  font-size: 0.8rem;
}

.hud-conditions-cell .hud-cond > span:not(.hud-icon) {
  overflow: visible;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  text-overflow: clip;
}

/* Ячейка капитала: подпись сверху, крупное значение с ₽ снизу */
.hud-capital-cell {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
}

.hud-capital-cell > small {
  margin: 0;
}

/* Счётчик этапа в правом крае строки цели */
.hud-stage {
  flex: none;
  margin-left: auto;
  padding-left: 0.6rem;
  color: var(--muted-2);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

#hudSeason,
#hudAlert {
  color: var(--good);
  font-size: 0.92rem;
  font-weight: 700;
}

/* Стабильность читается как самостоятельная словесная оценка: без
   дублирующей пиктограммы и с единым центром для подписи и значения. */
#hudAlertBox {
  grid-template-columns: 1fr;
  justify-items: center;
}

#hudStabilityIcon,
#hudStabilityIcon.png-icon.asset-loaded {
  display: none !important;
}

#hudAlertBox > #hudAlert {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  text-align: center;
}

/* Сезонная палитра: весна — зелень, лето — солнце, осень — ржавчина, зима — лед */
:root {
  --season-spring: #93b06e;
  --season-summer: #d8b45c;
  --season-autumn: #c07a45;
  --season-winter: #9db4c6;
  --icon-summer: brightness(0) saturate(100%) invert(76%) sepia(38%) saturate(420%) hue-rotate(9deg) brightness(96%) contrast(88%);
  --icon-autumn: brightness(0) saturate(100%) invert(56%) sepia(38%) saturate(640%) hue-rotate(340deg) brightness(90%) contrast(86%);
  --icon-winter: brightness(0) saturate(100%) invert(75%) sepia(9%) saturate(520%) hue-rotate(165deg) brightness(96%) contrast(88%);
}

#hudSeason[data-season="season-spring"] { color: var(--season-spring); }
#hudSeason[data-season="season-summer"] { color: var(--season-summer); }
#hudSeason[data-season="season-autumn"] { color: var(--season-autumn); }
#hudSeason[data-season="season-winter"] { color: var(--season-winter); }

#hudSeasonIcon[data-icon-key="season-spring"] { color: var(--season-spring); }
#hudSeasonIcon[data-icon-key="season-summer"] { color: var(--season-summer); }
#hudSeasonIcon[data-icon-key="season-autumn"] { color: var(--season-autumn); }
#hudSeasonIcon[data-icon-key="season-winter"] { color: var(--season-winter); }

#hudSeasonIcon[data-icon-key="season-summer"].png-icon.asset-loaded { --icon-filter: var(--icon-summer); }
#hudSeasonIcon[data-icon-key="season-autumn"].png-icon.asset-loaded { --icon-filter: var(--icon-autumn); }
#hudSeasonIcon[data-icon-key="season-winter"].png-icon.asset-loaded { --icon-filter: var(--icon-winter); }

#hudWeather {
  color: var(--text);
}

.hud-alert {
  background: var(--bad-soft);
}

.hud-alert #hudAlert,
.hud-alert span {
  color: var(--bad);
}

/* Ячейка кампании + трек фаз */
.hud-chapter-cell {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-content: center;
  justify-items: stretch;
  padding: 0.5rem 1.5rem 0.5rem;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  text-align: center;
  /* visible — иначе нижние вершины ромбов трека фаз обрезаются */
  overflow: visible;
}

.hud-chapter-cell > small,
.hud-chapter-cell > .hud-icon {
  display: none;
}

.hud-chapter-cell > strong {
  display: none;
}

.phase-track {
  position: relative;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  width: 94%;
  margin: 0 auto;
  /* без нижнего padding — маркеры живут внутри самих подписей, поэтому
     линия и ромбы в одной системе координат и ничто не обрезается */
  padding: 0.2rem 0 0;
  border: 0;
  line-height: 1;
  overflow: visible;
}

.phase-track::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0.38rem;
  height: 2px;
  border-radius: 2px;
  /* мягкая линия с затуханием к краям, а не жёсткая полоса */
  background: linear-gradient(90deg, transparent, rgba(214, 196, 150, 0.18) 12%, rgba(214, 196, 150, 0.18) 88%, transparent);
}

/* Золотая «пройденная» часть шкалы — ширина по --phase-progress (0..1 из JS) */
.phase-track::after {
  content: "";
  position: absolute;
  left: 6%;
  bottom: 0.38rem;
  width: calc((100% - 12%) * var(--phase-progress, 0));
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(211, 184, 120, 0.5), var(--accent));
  box-shadow: 0 0 8px rgba(211, 184, 120, 0.5);
  transition: width 320ms ease;
}

.phase-track span {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0 0 0.72rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: color 220ms ease;
}

/* Будущие фазы — полый ромб (полностью внутри подписи, не обрезается) */
.phase-track span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.16rem;
  width: 0.44rem;
  height: 0.44rem;
  border: 1px solid rgba(214, 196, 150, 0.45);
  background: #14120f;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: none;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

/* Пройденные — залитый золотой ромб со свечением */
.phase-track span.passed {
  color: #c8b489;
}

.phase-track span.passed::before {
  border-color: var(--gold);
  background: var(--accent);
  box-shadow: 0 0 6px rgba(211, 184, 120, 0.4);
}

/* Активная — золотой «пик» со свечением и подсвеченной подписью */
.phase-track span.active {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(211, 184, 120, 0.4), 0 1px 0 rgba(0, 0, 0, 0.65);
}

.phase-track span.active::before {
  left: 50%;
  bottom: 0.2rem;
  width: 0;
  height: 0;
  border: 0;
  border-left: 0.42rem solid transparent;
  border-right: 0.42rem solid transparent;
  border-bottom: 0.44rem solid var(--gold);
  border-radius: 0;
  background: transparent;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 5px rgba(211, 184, 120, 0.6));
}

/* Цель хода */
.hud-goal-cell {
  grid-column: 2 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.32rem;
  min-width: 0;
  /* Нижний паддинг компенсирует декоративную рамку HUD (::after, inset 3px),
     чтобы строка оптически стояла по центру видимой полосы, а не грид-ячейки. */
  padding: 0 1rem 0.24rem;
  border-top: 1px solid var(--line-soft);
  border-right: 0;
  text-align: left;
  overflow: hidden;
}

.hud-goal-cell .hud-icon {
  display: none;
}

.hud-goal-cell small {
  flex: none;
  margin: 0;
  color: var(--muted-2);
}

.hud-goal-cell small::after {
  content: ":";
}

#hudObjective {
  min-width: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.sound-btn {
  display: none;
}

/* ---------- 5. Основная доска ---------- */
.layout {
  grid-area: board;
  display: grid;
  grid-template-columns: var(--layout-left-column, 11.45%) minmax(0, 1fr) var(--layout-right-column, 28.5%);
  grid-template-rows: minmax(0, var(--layout-top-row, 52fr)) minmax(0, var(--layout-bottom-row, 48fr));
  gap: var(--gap);
  min-height: 0;
  align-items: stretch;
}

[data-window-id="resources"] { grid-column: 1; grid-row: 1 / 3; }
[data-window-id="panorama"] { grid-column: 2; grid-row: 1 / 3; }
[data-window-id="journal"] { grid-column: 3; grid-row: 1; }
[data-window-id="advisors"] { grid-column: 3; grid-row: 2; }

.panel {
  color: var(--text);
}

.panel-title {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  min-height: 0;
  margin: 0;
  padding: 0.42rem 0.62rem;
  color: var(--gold);
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(214, 196, 150, 0.07), rgba(214, 196, 150, 0.02)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
  box-shadow: inset 0 1px 0 rgba(214, 196, 150, 0.14);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.panel-title::before,
.panel-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(214, 196, 150, 0.22);
}

.panel-title span {
  padding: 0.1rem 0.4rem;
  color: var(--good);
  border: 1px solid rgba(147, 176, 110, 0.3);
  border-radius: 3px;
  background: var(--good-soft);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

/* ---------- 6. Ресурсы (левая колонка) ---------- */
.panel.resources {
  display: grid;
  /* В панели два реальных дочерних блока: список и нижнее действие. Раньше
     трёхстрочная сетка отдавала торговле растянутую промежуточную строку,
     поэтому её рамка выпадала из внутренней декоративной сетки. */
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    var(--panel-2);
  background-blend-mode: normal, normal;
}

.panel.resources .panel-title {
  padding: 0.46rem 0.42rem;
  font-size: 0.66rem;
}

.stat-list {
  display: grid;
  gap: 0;
  align-content: start;
  min-height: 0;
  /* Слева паддинг чуть больше на величину правого inset скроллбара, чтобы
     полосы прогресса шли симметрично и тянулись ближе к правой границе блока. */
  padding: 0.5rem 0.5rem 0.7rem 0.82rem;
  border-right: 0.32rem solid transparent;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.stat-group-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.5rem 0 0.14rem;
  padding: 0.14rem 0;
  color: var(--accent);
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.stat-group-title::before,
.stat-group-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(214, 196, 150, 0.18);
}

.stat {
  min-height: 0;
  padding: 0.34rem 0.2rem 0.4rem;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.stat:last-child {
  border-bottom: 0;
}

.stat.preview {
  background: rgba(214, 196, 150, 0.05);
  box-shadow: none;
  transform: none;
}

.stat.preview .stat-value {
  color: var(--gold);
}

.stat.stat-changing {
  animation: statValueFlash 560ms ease-out both;
}

.stat.stat-changing.good .stat-value,
.value-counting.good {
  color: var(--good);
}

.stat.stat-changing.bad .stat-value,
.value-counting.bad {
  color: var(--bad);
}

.value-counting {
  font-variant-numeric: tabular-nums;
  animation: statNumberTick 180ms ease-out both;
}

.stat-head {
  position: relative;
  display: grid;
  grid-template-columns: 1.05rem minmax(0, 1fr) auto;
  gap: 0.18rem;
  align-items: center;
  font-size: 0.82rem;
}

.stat-head:has(.delta:not(:empty)) {
  grid-template-columns: 1.05rem minmax(0, 1fr) max-content max-content;
}

.stat-icon {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 0.78rem;
  line-height: 1;
}

.stat-name {
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.05;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  justify-self: end;
  min-width: 2.1rem;
  color: var(--text-strong);
  font-size: 1.04rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.delta {
  position: static;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.delta:empty {
  display: none;
}

.delta.good {
  color: var(--good);
}

.delta.bad {
  color: var(--bad);
}

.meter {
  height: 0.3rem;
  margin-top: 0.26rem;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
}

.meter-fill {
  height: 100%;
  width: var(--w);
  border-radius: 3px;
  background: var(--accent);
  transition: width 200ms ease, background 200ms ease;
}

.meter-fill.warn {
  background: var(--warn);
}

.meter-fill.low {
  background: var(--bad);
}

.meter-fill.good {
  background: var(--good);
}

.meter-fill.bad {
  background: var(--bad);
}

.stat-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  column-gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  min-height: 1rem;
  margin-top: 0.22rem;
  overflow: visible;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.18;
}

.stat-state-text {
  min-width: 0;
  font-style: italic;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

/* Прибыль/убыль показателя за ход (курс + строения). Компактно, символом ⟳,
   всегда целиком видно — усечётся описание, а не поток. */
.stat-flow {
  align-self: start;
  color: var(--muted-2);
  font-family: var(--font-display), "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-flow.good {
  color: var(--good);
}

.stat-flow.bad {
  color: var(--bad);
}

.hud-capital-flow {
  color: var(--muted-2);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hud-capital-flow.good {
  color: var(--good);
}

.hud-capital-flow.bad {
  color: var(--bad);
}

.hud-capital-flow:empty {
  display: none;
}

/* ---------- Торговля: кнопка внизу левого столбца ---------- */
.resources-footer {
  position: relative;
  z-index: 1;
  align-self: end;
  margin: 0 0.3rem 0.3rem;
  padding: 0.48rem 1.06rem 0.34rem;
  border-top: 1px solid var(--line-soft);
  background: transparent;
}

.trade-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--gold);
  border: 1px solid rgba(214, 196, 150, 0.4);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(240, 236, 220, 0.05), 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.trade-btn:hover:not(:disabled),
.trade-btn:focus-visible:not(:disabled) {
  color: var(--text-strong);
  border-color: rgba(228, 197, 122, 0.65);
  background: var(--gold-soft);
  outline: none;
  transform: translateY(-1px);
}

.trade-btn:disabled {
  cursor: default;
  color: var(--muted-2);
  border-color: var(--line-soft);
  opacity: 0.6;
}

/* Заблокированная торговля остаётся фокусируемой: условие открытия нельзя прятать
   за disabled-кнопкой, которая не получает наведение. */
.trade-btn.is-locked {
  cursor: help;
  color: var(--muted);
  border-color: rgba(214, 196, 150, 0.3);
  opacity: 0.82;
}

.trade-btn.is-locked:hover,
.trade-btn.is-locked:focus-visible {
  color: var(--gold);
  border-color: rgba(228, 197, 122, 0.76);
  background: var(--gold-soft);
  box-shadow: inset 0 1px 0 rgba(240, 236, 220, 0.08), 0 0 0.7rem rgba(211, 184, 120, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.trade-lock-details {
  position: fixed;
  z-index: 320;
  width: min(17.4rem, calc(100vw - 1.25rem));
  padding: 0.46rem 0.56rem;
  color: var(--text-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(15, 13, 10, 0.97);
  box-shadow: 0 0.45rem 1.4rem rgba(0, 0, 0, 0.62);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.18;
  text-align: left;
  text-transform: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-0.46rem);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.trade-lock-details::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.62rem;
  height: 0.62rem;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: rgba(15, 13, 10, 0.97);
  transform: translateY(-50%) rotate(-45deg);
}

.trade-lock-details[data-side="right"]::after {
  left: -0.36rem;
}

.trade-lock-details[data-side="left"] {
  transform: translateX(0.46rem);
}

.trade-lock-details[data-side="left"]::after {
  right: -0.36rem;
  border-top: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-left: 0;
  transform: translateY(-50%) rotate(-45deg);
}

.trade-lock-details.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.trade-btn-icon,
.trade-btn-icon.png-icon.asset-loaded {
  width: 1.05rem !important;
  height: 1.05rem !important;
  min-width: 1.05rem !important;
  min-height: 1.05rem !important;
  --icon-filter: var(--icon-gold);
}

/* ---------- Торговля: панель сбыта ---------- */
.trade-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 160ms ease;
}

.trade-overlay.show {
  opacity: 1;
}

.trade-dialog {
  position: relative;
  width: min(30rem, calc(100vw - 3rem));
  height: min(38rem, calc(100vh - 2.8rem));
  max-height: min(38rem, calc(100vh - 2.8rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #181613;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  color: var(--text);
  overflow: hidden;
  /* Внешние окна используют тот же масштаб, что и доска 1920x1080. */
  zoom: var(--ui-scale, 1);
}

.trade-head {
  position: relative;
  padding: 0.85rem 1.2rem 0.82rem;
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(214, 196, 150, 0.08), rgba(214, 196, 150, 0.025)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
}

.trade-kicker {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.trade-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.08;
}

.trade-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  font-size: 1.2rem;
  line-height: 1;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.trade-close:hover,
.trade-close:focus-visible {
  color: #ffe0d5;
  border-color: var(--bad);
  background: var(--bad-soft);
  outline: none;
}

.trade-body {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.2rem 0.4rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.trade-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.24;
}

.trade-capital {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.045);
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trade-capital b {
  color: var(--gold);
  font-size: 1.16rem;
  font-variant-numeric: tabular-nums;
}

.trade-rows {
  display: grid;
  gap: 0.6rem;
}

.trade-row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.trade-row-icon,
.trade-row-icon.png-icon.asset-loaded {
  width: 1.35rem !important;
  height: 1.35rem !important;
  min-width: 1.35rem !important;
  min-height: 1.35rem !important;
  grid-row: 1 / span 2;
  --icon-filter: var(--icon-slate);
}

.trade-row-info b {
  display: block;
  color: var(--text-strong);
  font-size: 0.98rem;
  line-height: 1.1;
}

.trade-row-info small {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.trade-row-info small b {
  display: inline;
  color: var(--gold);
  font-weight: 700;
}

.trade-row-buttons {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.15rem;
}

.trade-row-buttons button {
  min-width: 2.6rem;
  min-height: 1.7rem;
  padding: 0.12rem 0.5rem;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.trade-row-buttons button:hover:not(:disabled),
.trade-row-buttons button:focus-visible:not(:disabled) {
  color: var(--good);
  border-color: rgba(147, 176, 110, 0.55);
  background: var(--good-soft);
  outline: none;
}

.trade-row-buttons button:disabled {
  cursor: default;
  color: var(--muted-2);
  opacity: 0.5;
}

.trade-section {
  display: grid;
  gap: 0.5rem;
}

.trade-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.trade-row.buy {
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
}

.trade-row.buy .trade-row-icon,
.trade-row.buy .trade-row-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-gold);
  grid-row: 1 / span 2;
}

.trade-row.buy .trade-row-buttons {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  margin-top: 0;
}

.trade-row.buy .trade-row-buttons button {
  min-width: 0;
  color: var(--gold);
  border-color: rgba(214, 196, 150, 0.45);
  white-space: nowrap;
}

.trade-row.buy .trade-row-buttons button:hover:not(:disabled),
.trade-row.buy .trade-row-buttons button:focus-visible:not(:disabled) {
  color: var(--text-strong);
  border-color: rgba(228, 197, 122, 0.7);
  background: var(--gold-soft);
}

.trade-eff {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
  margin-top: 0.34rem;
}

.trade-eff .metric-chip {
  min-height: 1.38rem;
  padding: 0.12rem 0.3rem;
  font-size: 0.76rem;
}

.trade-eff .metric-icon,
.trade-eff .metric-icon.png-icon.asset-loaded {
  width: 0.76rem !important;
  height: 0.76rem !important;
  min-width: 0.76rem !important;
  min-height: 0.76rem !important;
}

.trade-row.locked {
  opacity: 0.72;
}

.trade-row.tutorial-target {
  border-color: rgba(228, 197, 122, 0.8);
  background: linear-gradient(125deg, rgba(214, 196, 150, 0.14), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 0 0 1px rgba(228, 197, 122, 0.22), 0 0 16px rgba(214, 196, 150, 0.1);
}

.trade-row.tutorial-muted {
  opacity: 0.38;
  filter: saturate(0.55);
}

.trade-onboarding .trade-row.tutorial-muted {
  pointer-events: none;
}

.trade-onboarding-note {
  margin: -0.1rem 0 0;
  padding: 0.42rem 0.58rem;
  color: var(--gold);
  border-left: 2px solid var(--accent);
  background: rgba(214, 196, 150, 0.075);
  font-size: 0.86rem;
  line-height: 1.2;
}

.trade-row-lock {
  grid-column: 2;
  align-self: center;
  color: var(--muted-2);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.2;
}

.trade-row.buy .trade-row-lock {
  grid-column: 2 / -1;
}

/* Продажа: степпер + сумма + подтверждение */
.trade-row.sell .trade-row-icon,
.trade-row.sell .trade-row-icon.png-icon.asset-loaded {
  grid-row: 1 / span 2;
}

.trade-controls {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.trade-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel-3);
}

.trade-step {
  width: 1.9rem;
  cursor: pointer;
  color: var(--text);
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.trade-step:hover,
.trade-step:focus-visible {
  color: var(--gold);
  background: var(--gold-soft);
  outline: none;
}

.trade-qty-input {
  width: 3.6rem;
  padding: 0.24rem 0.3rem;
  text-align: center;
  color: var(--text-strong);
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trade-qty-input:focus-visible {
  outline: none;
  background: rgba(0, 0, 0, 0.34);
}

.trade-qty-input::-webkit-outer-spin-button,
.trade-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.trade-qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

.trade-max {
  min-height: 1.95rem;
  padding: 0.1rem 0.55rem;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 140ms ease, border-color 140ms ease;
}

.trade-max:hover,
.trade-max:focus-visible {
  color: var(--gold);
  border-color: rgba(214, 196, 150, 0.5);
  outline: none;
}

.trade-line-sum {
  margin-left: auto;
  color: var(--gold);
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trade-sell-confirm {
  min-height: 1.95rem;
  padding: 0.2rem 0.85rem;
  cursor: pointer;
  color: var(--good);
  border: 1px solid rgba(147, 176, 110, 0.5);
  border-radius: var(--radius-sm);
  background: var(--good-soft);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.trade-sell-confirm:hover:not(:disabled),
.trade-sell-confirm:focus-visible:not(:disabled) {
  color: var(--text-strong);
  border-color: rgba(147, 176, 110, 0.85);
  outline: none;
}

.trade-sell-confirm:disabled {
  cursor: default;
  color: var(--muted-2);
  border-color: var(--line-soft);
  background: transparent;
  opacity: 0.6;
}

.trade-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.8rem 1.2rem 1rem;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.1);
}

.trade-done {
  min-height: 2.15rem;
  padding: 0.28rem 1.1rem;
  cursor: pointer;
  color: #ddd6c0;
  border: 1px solid rgba(214, 196, 150, 0.55);
  border-radius: var(--radius-sm);
  background: #232016;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.trade-done:hover,
.trade-done:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

/* ---------- 7. Центральная карта хода ---------- */
.turn-card {
  display: grid;
  grid-template-rows: calc(63% - 15px) minmax(0, 1fr);
  overflow: hidden;
}

.scene {
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: #11100e;
}

.scene::before {
  content: none;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(135% 105% at 50% 34%, transparent 52%, rgba(5, 4, 2, 0.55) 100%);
}

.scene-asset-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  min-width: 0;
  min-height: 0;
  pointer-events: none;
  border: 0;
  background: #11100e;
  background-position: 50% 50% !important;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
  filter: none !important;
}

.scene-map-image,
.scene-progression-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50% !important;
  transform: none;
  filter: none !important;
}

.scene-map-image {
  display: none;
}

.scene-asset-layer.asset-loaded .scene-map-image {
  display: block;
  opacity: 1 !important;
}

.scene-asset-layer.asset-loaded {
  background-position: 50% 50% !important;
}

.scene-progression-layers {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.scene-progression-layer {
  max-width: none;
  opacity: 0;
  transition: opacity 280ms ease-out;
}

/* Явный порядок наложения: дорога, завод, посёлок. */
.scene-progression-layer[data-progression-node="railway"] {
  z-index: 3;
}

.scene-progression-layer[data-progression-node="factory"] {
  z-index: 2;
}

.scene-progression-layer[data-progression-node="settlement"] {
  z-index: 1;
}

.scene-progression-layer.is-loaded {
  opacity: 1;
}

.scene.ending-scene::after {
  content: none;
}

.scene.ending-scene .scene-progression-layers,
.scene.ending-scene .scene-fallback-graphic,
.scene.ending-scene .map-markers,
.scene.ending-scene .scene-weather-banner {
  display: none !important;
}

.scene-asset-layer.asset-missing {
  display: grid;
  place-items: center;
  opacity: 1;
  border: 1px dashed var(--line-strong) !important;
  background: #171512 !important;
}

.scene-asset-layer.asset-missing::after {
  inset: 0.65rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(20, 18, 14, 0.7);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.05;
}

.scene-fallback-graphic {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #151310;
  filter: none;
  opacity: 0.9;
}

.scene.has-map-asset .scene-fallback-graphic,
.scene.has-map-placeholder .scene-fallback-graphic {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  opacity: 0;
}

/* Маркеры на карте */
.map-markers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8.6rem;
  padding: 0.42rem 0.62rem 0.46rem 0.42rem;
  color: var(--text);
  border: 1px solid rgba(211, 184, 120, 0.42);
  border-radius: 4px;
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(160deg, rgba(46, 41, 31, 0.96), rgba(22, 20, 16, 0.94) 55%, rgba(14, 13, 11, 0.96));
  background-blend-mode: normal, normal;
  backdrop-filter: blur(6px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px rgba(211, 184, 120, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.55);
  text-align: left;
  font-size: 0.7rem;
}

/* уголки-заклепки как на латунной табличке */
.map-marker::before {
  content: "";
  position: absolute;
  inset: 0.18rem;
  pointer-events: none;
  border-radius: 3px;
  background:
    radial-gradient(circle 2px at 2px 2px, rgba(211, 184, 120, 0.75) 0 1.2px, transparent 1.6px),
    radial-gradient(circle 2px at calc(100% - 2px) 2px, rgba(211, 184, 120, 0.75) 0 1.2px, transparent 1.6px),
    radial-gradient(circle 2px at 2px calc(100% - 2px), rgba(211, 184, 120, 0.75) 0 1.2px, transparent 1.6px),
    radial-gradient(circle 2px at calc(100% - 2px) calc(100% - 2px), rgba(211, 184, 120, 0.75) 0 1.2px, transparent 1.6px);
}

/* ножка-указатель к точке на карте */
.map-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.34rem;
  width: 0.6rem;
  height: 0.6rem;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(211, 184, 120, 0.42);
  border-bottom: 1px solid rgba(211, 184, 120, 0.42);
  background: linear-gradient(315deg, rgba(14, 13, 11, 0.96), rgba(26, 23, 18, 0.96));
}

.marker-stem {
  position: absolute;
  left: 50%;
  bottom: -0.92rem;
  width: 5px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 0 2px rgba(14, 13, 11, 0.85),
    0 0 8px rgba(211, 184, 120, 0.65);
}

/* эмблема с кольцом прогресса */
.marker-emblem {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(64, 57, 42, 0.95), rgba(20, 18, 14, 0.98) 72%);
  box-shadow:
    inset 0 0 0 1px rgba(211, 184, 120, 0.28),
    inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.marker-ring {
  position: absolute;
  inset: -0.16rem;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    var(--gold) calc(var(--ring, 0) * 1%),
    rgba(211, 184, 120, 0.16) 0
  );
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(closest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  transition: background 0.35s ease;
}

.marker-icon {
  display: inline-grid;
  place-items: center;
  width: 1.42rem;
  height: 1.42rem;
  color: var(--accent);
  border: 0;
  font-size: 0.95rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.marker-plate {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
}

.marker-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-marker b {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.map-marker strong {
  color: var(--text-strong);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* пипсы уровней */
.marker-pips {
  display: flex;
  gap: 0.22rem;
  align-items: center;
}

.marker-pips i {
  width: 0.42rem;
  height: 0.42rem;
  transform: rotate(45deg);
  border: 1px solid rgba(211, 184, 120, 0.45);
  background: rgba(211, 184, 120, 0.08);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.6);
}

.marker-pips i.filled {
  border-color: var(--gold);
  background: linear-gradient(135deg, #e8d49a, var(--gold) 60%, #9a8149);
  box-shadow: 0 0 5px rgba(211, 184, 120, 0.55);
}

/* Координаты заданы от центров табличек в процентах сцены: при увеличении
   панорамы узлы расходятся от её центра пропорционально, а не остаются на
   прежних пиксельных высотах. */
.map-marker { transform: translate(-50%, -50%); }
.marker-mines { left: 14%; top: 27%; }
.marker-factory { left: 24%; top: 37%; }
.marker-rail { left: 84%; top: 53%; }
.marker-settlement { left: 56%; top: 30%; }

/* Подпись сцены и погода */
.scene-caption {
  position: absolute;
  left: 0.72rem;
  bottom: 0.62rem;
  z-index: 4;
  max-width: 30%;
  padding: 0.4rem 0.58rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 3px solid rgba(214, 196, 150, 0.5);
  border-radius: var(--radius);
  background: rgba(24, 22, 17, 0.88);
  backdrop-filter: blur(8px);
  text-align: left;
}

.scene-caption strong {
  display: block;
  margin-bottom: 0.16rem;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-caption span {
  display: block;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.32;
}

.weather-banner {
  font-weight: 700;
}

.weather-banner:empty {
  display: none;
}

.scene-weather-banner {
  position: absolute;
  z-index: 5;
  top: 0.66rem;
  right: 0.7rem;
  width: auto;
  max-width: 32%;
  margin: 0;
  padding: 0.32rem 0.66rem;
  color: var(--warn);
  border: 1px solid rgba(201, 159, 86, 0.35);
  border-radius: 3px;
  background: rgba(30, 28, 22, 0.8);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Прогресс-полоса (легаси, скрыта) */
.progress-strip {
  display: none;
}

/* ---------- 8. Событие ---------- */
#gameArea {
  display: block;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

#gameArea > .choices {
  height: 100%;
}

.event {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  align-content: start;
  row-gap: 0.32rem;
  min-height: 0;
  padding: 0.78rem 2.4rem 0.7rem;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0;
  border-right: 0.5rem solid transparent;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    linear-gradient(180deg, rgba(22, 20, 16, 0.34), rgba(10, 9, 7, 0.12));
  background-blend-mode: normal, normal;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  /* Плавное затухание скроллящегося текста у нижнего края, чтобы
     переход к ряду карточек не был резким. Маска привязана к нижней
     кромке блока, поэтому текст затеняется, уходя вниз при прокрутке. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.9rem), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.9rem), transparent 100%);
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.06rem;
  color: var(--muted-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* Разделитель между датой и номером хода */
.date-line .date-sep {
  color: var(--accent);
  font-size: 0.52rem;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.85;
}

.chapter-line {
  display: none;
}

.event h2 {
  margin: 0.04rem 0 0.2rem;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
  font-size: 1.74rem;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

#eventLead,
.event p {
  margin: 0;
  padding-inline: 0.3rem;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.24;
  text-indent: 1.6em;
  max-width: none;
}

.event-background {
  position: relative;
  align-self: start;
  width: auto;
  min-height: 0;
  margin: 0.4rem 0.25rem 0;
  padding: 0.62rem 1.35rem 0.64rem 1.5rem;
  color: var(--muted);
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.055);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.32;
  overflow: visible;
}

.event-background::before {
  content: "\201C";
  position: absolute;
  left: 0.34rem;
  top: -0.1rem;
  color: rgba(211, 184, 120, 0.5);
  font-size: 2rem;
  line-height: 1;
}

.event-background::after {
  content: "\201D";
  position: absolute;
  right: 0.45rem;
  bottom: -0.45rem;
  color: rgba(211, 184, 120, 0.3);
  font-size: 2rem;
  line-height: 1;
}

/* ---------- 9. Карточки решений ---------- */
.choices {
  position: relative;
  display: grid;
  /* Ровно три одинаковых трека: содержимое карточки не участвует в
     расчёте ширины и не может раздвинуть соседние распоряжения. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.46rem;
  width: 100%;
  min-height: 0;
  padding: 0.5rem;
  box-sizing: border-box;
  /* overflow видимый, чтобы подпись рекомендации могла заходить
     на затенённую полосу над карточками (в низ блока описания). */
  overflow: visible;
  background: transparent;
}

/* Обёртка карточки. Подпись рекомендации накладывается поверх области
   НАД карточкой (не занимает высоту), поэтому карточки не ужимаются. */
.choice-slot {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
}

.choice-slot > .choice {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 100%;
}

.choices.course-locked .choice,
.choices.trade-onboarding-locked .choice {
  cursor: not-allowed;
  filter: blur(4px) saturate(0.65) brightness(0.82);
  transition: filter 220ms ease;
}

.choices.course-locked .choice:hover,
.choices.course-locked .choice:focus-visible,
.choices.trade-onboarding-locked .choice:hover,
.choices.trade-onboarding-locked .choice:focus-visible {
  transform: none;
  box-shadow: var(--shadow-soft);
}

.choices.course-locked::after,
.choices.trade-onboarding-locked::after {
  content: attr(data-lock-message);
  position: absolute;
  inset: 0.5rem;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: none;
}

.choice {
  --mode-color: var(--accent);
  --mode-border: rgba(201, 168, 106, 0.42);
  --mode-bg: var(--accent-soft);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Заголовок и описание — фиксированной высоты (по 2 строки), чтобы блок
     эффектов на всех карточках начинался на одном уровне даже при малом
     объёме текста. Заголовок прижат к низу — описание идёт сразу за ним. */
  grid-template-rows: 1.46rem 2.55rem 2.6rem minmax(3.05rem, 1fr) auto;
  gap: 0.34rem;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding: 0.66rem 0.7rem 0.62rem;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-top: 3px solid var(--mode-color);
  border-radius: var(--radius);
  background: var(--panel-3);
  box-shadow: var(--shadow-soft);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.choice::before,
.choice::after {
  content: none;
}

.choice:hover,
.choice:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: var(--mode-border);
  border-top-color: var(--mode-color);
  background: linear-gradient(180deg, var(--mode-bg), var(--panel-3) 42%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.choice.locked-choice {
  cursor: not-allowed;
  border-top-color: rgba(214, 196, 150, 0.28);
  filter: saturate(0.7);
  transition: filter 200ms ease;
}

/* легкая вуаль поверх карточки, пока курс не выбран */
.choice.locked-choice::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(10, 9, 7, 0.12);
}

/* содержимое заблокированной карточки размывается, кроме строки-подсказки */
.choice.locked-choice > *:not(.choice-action) {
  filter: blur(3px);
  transition: filter 200ms ease;
}

.choice.locked-choice .choice-action {
  position: relative;
  z-index: 3;
  color: var(--muted);
  border-color: rgba(214, 196, 150, 0.22);
}

.choice.locked-choice:hover,
.choice.locked-choice:focus-visible {
  transform: none;
  background: var(--panel-3);
  box-shadow: var(--shadow-soft);
}

.choice.blocked-choice {
  cursor: not-allowed;
  opacity: 0.62;
  border-top-color: rgba(181, 83, 61, 0.75);
  filter: saturate(0.55);
}

.choice.blocked-choice:hover,
.choice.blocked-choice:focus-visible {
  transform: none;
  background: var(--panel-3);
  box-shadow: var(--shadow-soft);
}

.choice.blocked-choice .choice-action {
  border-color: rgba(181, 83, 61, 0.5);
  color: var(--bad);
  letter-spacing: 0.06em;
}

/* Цвет карточки зависит ТОЛЬКО от риска (не от режима решения).
   Значения берутся из палитры (--good/--warn/--bad), поэтому цвет
   автоматически подстраивается под выбранный пресет палитры. */
.choice.risk-low {
  --mode-color: var(--good);
  --mode-border: color-mix(in srgb, var(--good) 45%, transparent);
  --mode-bg: var(--good-soft);
}

.choice.risk-medium {
  --mode-color: var(--warn);
  --mode-border: color-mix(in srgb, var(--warn) 45%, transparent);
  --mode-bg: var(--warn-soft);
}

.choice.risk-high,
.choice.is-risky {
  --mode-color: var(--bad);
  --mode-border: color-mix(in srgb, var(--bad) 45%, transparent);
  --mode-bg: var(--bad-soft);
}

/* Верхняя строка: риск */
.choice-top-row {
  grid-row: 1;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  min-height: 1.4rem;
}

.choice-risk-row {
  min-height: 1.28rem;
}

.choice-risk-badge {
  display: inline-grid;
  place-items: center;
  min-width: 3.6rem;
  min-height: 1.42rem;
  padding: 0.16rem 0.55rem;
  border: 0;
  border-radius: 2px;
  background: var(--bad);
  color: #1a120e;
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.choice.risk-low .choice-risk-badge {
  background: var(--good);
  color: #131609;
}

.choice.risk-medium .choice-risk-badge {
  background: var(--warn);
  color: #1c1409;
}

/* Заголовок + бейдж предпочтения */
.choice-title-row {
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  min-width: 0;
  padding-right: 2.4rem;
}

.choice-title {
  display: -webkit-box;
  min-width: 0;
  max-height: 2.55rem;
  margin: 0;
  padding-bottom: 0.06rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-strong);
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-align: left;
}

.choice strong {
  color: var(--text-strong);
}

.choice .choice-pref-badge.icon-slot {
  position: absolute !important;
  top: 0.58rem !important;
  right: 0.58rem !important;
  left: auto !important;
  z-index: 6 !important;
  display: inline-grid;
  place-items: center;
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  min-height: 2rem !important;
  place-self: auto !important;
  /* Иконка предпочтения — цветом шрифта заголовка, а не по риску. */
  color: var(--text-strong);
  border: 0;
  border-radius: 0;
  background: transparent;
  background-size: contain;
  opacity: 0.85;
}

.choice-pref-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 1.1rem;
  line-height: 1;
}

.choice .choice-pref-badge.asset-missing::after {
  inset: 0.14rem;
  font-size: 0.36rem;
  line-height: 0.88;
}

/* Описание */
.choice .choice-copy {
  grid-row: 3;
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
}

.choice .choice-copy > p {
  display: -webkit-box;
  min-height: 0;
  max-height: 2.6rem;
  margin: 0;
  padding: 0 0.3rem 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.1;
}

.choice p {
  color: var(--muted);
}

.choice .choice-copy > .choice-mode {
  display: none;
}

/* Экономические блоки: требования / эффект.
   Прижаты к низу своей области, чтобы отступ до кнопки был постоянным,
   а свободное место (в т.ч. освободившееся от уменьшенного заголовка)
   уходило выше блока, а не в зазор между эффектами и кнопкой. */
.choice .choice-bottom-grid {
  grid-row: 4;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.44rem;
  min-width: 0;
  padding-top: 0.48rem;
  border-top: 1px solid var(--line-soft);
}

.choice .choice-bottom-grid > .choice-requirements {
  grid-column: 1;
  grid-row: 1;
}

.choice .choice-bottom-grid > .effect-list {
  grid-column: 2;
  grid-row: 1;
}

.choice .choice-requirements,
.choice .effect-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.28rem 0.3rem;
  align-content: start;
  min-width: 0;
  width: 100%;
  margin: 0;
  overflow: visible;
}

.choice .choice-requirements b,
.choice .effect-list b {
  grid-column: 1 / -1;
  margin-bottom: 0.04rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

/* Кнопка действия */
.choice-action {
  grid-row: 5;
  display: grid;
  place-items: center;
  height: 1.62rem;
  min-height: 1.62rem;
  /* Отступ до кнопки не меньше вертикального интервала между строками
     эффектов (0.34rem grid-gap + 0.2rem = заведомо больше, чем 0.28rem
     между чипами эффектов). */
  margin: 0.2rem 0 0;
  padding: 0;
  color: var(--accent);
  border: 1px solid rgba(214, 196, 150, 0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.choice.risk-low .choice-action {
  border-color: rgba(147, 176, 110, 0.42);
  color: #a9bd85;
}

.choice.risk-medium .choice-action {
  border-color: rgba(201, 159, 86, 0.42);
  color: #c8a869;
}

.choice.risk-high .choice-action {
  border-color: rgba(193, 96, 74, 0.46);
  color: #c98871;
}

.choice:hover .choice-action,
.choice:focus-visible .choice-action {
  background: rgba(214, 196, 150, 0.08);
  border-color: rgba(214, 196, 150, 0.55);
}

/* Легаси-элементы карточек */
.choice .choice-art,
.choice-meta,
.choice > .choice-risk,
.choice > .tag-list,
.choice-mode {
  display: none !important;
}

/* ---------- 10. Чипы метрик ---------- */
.requirement,
.effect,
.metric-chip {
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.metric-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  min-width: 2.9rem;
  min-height: 1.25rem;
  padding: 0.14rem 0.32rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.metric-chip .metric-icon {
  display: inline-grid;
  place-items: center;
  width: 0.95rem;
  height: 0.95rem;
  border: 0;
  color: currentColor;
  font-size: 0.64rem;
  line-height: 1;
}

.metric-chip em {
  color: currentColor;
  font-style: normal;
}

.metric-chip.good,
.effect.good,
.effect.pos {
  border-color: rgba(147, 176, 110, 0.35);
  background: var(--good-soft);
  color: var(--good);
}

.metric-chip.bad,
.metric-chip.shortage,
.effect.bad,
.effect.neg {
  border-color: rgba(193, 96, 74, 0.4);
  background: var(--bad-soft);
  color: var(--bad);
}

.metric-chip.muted,
.effect.muted,
.requirement.muted {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-2);
}

.requirement {
  padding: 0.14rem 0.32rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.requirement.shortage {
  color: var(--bad);
  border-color: rgba(193, 96, 74, 0.4);
  background: var(--bad-soft);
}

.choice .requirement,
.choice .effect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 1.2rem;
  padding: 0.14rem 0.3rem;
  font-size: 0.84rem;
}

.effect {
  padding: 0.14rem 0.32rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
  min-height: 0;
}

.tag {
  padding: 0.16rem 0.36rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Тултип чипа */
.metric-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.42rem);
  z-index: 20;
  min-width: max-content;
  max-width: 13rem;
  padding: 0.36rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #181613;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.metric-chip:hover::after,
.metric-chip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.trend-up,
.forecast-delta.pos {
  color: var(--good);
}

.trend-down,
.forecast-delta.neg {
  color: var(--bad);
}

/* ---------- 11. Правая колонка: советники + хроника ---------- */
.advisors-panel {
  position: relative;
  z-index: 8;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: visible;
}

.advisors-panel .panel-title,
.journal .panel-title {
  min-height: 0;
  padding: 0.36rem 0.6rem;
}

.advisors-panel .advisors {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: stretch;
  align-items: stretch;
  gap: 0.44rem;
  height: 100%;
  margin: 0;
  padding: 0.46rem 0.55rem 0.55rem;
  overflow: visible;
}

.advisors-panel .advisors::before {
  content: none;
}

.advisors-panel .advisors article {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  align-items: start;
  justify-items: center;
  gap: 0.2rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0.4rem 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-3);
  text-align: center;
  overflow: visible;
  transition: border-color 160ms ease;
}

.advisors-panel .advisors article:hover,
.advisors-panel .advisors article:focus-within {
  z-index: 20;
}

.advisors-panel .advisors article.support {
  border-color: rgba(147, 176, 110, 0.45);
  box-shadow: 0 0 0 1px rgba(147, 176, 110, 0.12);
}

.advisors-panel .advisors article.warn {
  border-color: rgba(193, 96, 74, 0.45);
  box-shadow: 0 0 0 1px rgba(193, 96, 74, 0.12);
}

.advisor-portrait {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #191713;
  font-size: 0.62rem;
  text-transform: uppercase;
  overflow: hidden;
  filter: none !important;
}

.advisors-panel .advisor-portrait {
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: min(100%, 7.6rem);
  height: auto;
  max-height: 100%;
  aspect-ratio: 4 / 5;
  background-position: center top;
  background-size: cover;
}

.advisors-panel .advisor-profile-portrait {
  position: relative;
  display: block;
  isolation: isolate;
}

.advisors-panel .advisor-identity {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: grid;
  gap: 0.08rem;
  padding: 0.72rem 0.38rem 0.1rem;
  background: none;
  text-align: center;
}

/* Общая логика ассетов прячет дочерние узлы загруженной иконки.
   Для карточки советника подпись должна оставаться поверх портрета. */
.advisors-panel .advisor-profile-portrait.asset-loaded > .advisor-identity,
.advisors-panel .advisor-profile-portrait.asset-missing > .advisor-identity {
  opacity: 1 !important;
}

.advisors-panel .advisor-identity b {
  display: block;
  max-width: 100%;
  color: var(--text-strong);
  font-size: 1.0rem;
  font-weight: 700;
  line-height: 1.06;
  text-align: center;
  white-space: normal;
  text-shadow: 0 1px 2px #000, 0 0 6px #000, 0 0 10px rgba(0, 0, 0, 0.92);
}

.advisors-panel .advisor-identity small {
  display: block;
  max-width: 100%;
  margin: 0.14rem 0 0.18rem;
  color: #e2c67f;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 0.94;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  text-shadow: 0 1px 2px #000, 0 0 6px #000, 0 0 10px rgba(0, 0, 0, 0.92);
}

.advisor-course-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  max-width: 100%;
  min-height: 1.5rem;
  padding: 0.14rem 0.4rem;
  border: 1px solid rgba(214, 196, 150, 0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.advisor-course-button:hover,
.advisor-course-button:focus-visible {
  color: var(--text-strong);
  border-color: rgba(228, 197, 122, 0.62);
  background: var(--gold-soft);
  outline: none;
}

.advisor-course-button:disabled {
  cursor: default;
}

.advisor-course-button.active {
  border-color: rgba(147, 176, 110, 0.55);
  background: var(--good-soft);
  color: var(--good);
}

.advisor-course-button.locked {
  border-color: rgba(214, 196, 150, 0.16);
  color: var(--muted-2);
}

.advisor-course-button.cooldown {
  border-color: color-mix(in srgb, var(--warn) 52%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
  cursor: help;
}

.advisor-course-button.cooldown:hover,
.advisor-course-button.cooldown:focus-visible {
  border-color: color-mix(in srgb, var(--warn) 82%, transparent);
  background: color-mix(in srgb, var(--warn-soft) 74%, transparent);
  color: var(--text-strong);
}

.advisor-course-icon,
.advisor-course-icon.png-icon.asset-loaded {
  display: inline-grid;
  place-items: center;
  width: 0.84rem !important;
  height: 0.84rem !important;
  min-width: 0.84rem !important;
  min-height: 0.84rem !important;
  flex: 0 0 0.84rem;
  color: currentColor;
  --icon-color: currentColor;
  --icon-filter: var(--icon-gold);
}

.advisor-course-button.active .advisor-course-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-good);
}

.advisor-course-button.locked .advisor-course-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-muted);
}

.advisors-panel .advisors p {
  align-self: center;
  display: block;
  min-height: 0;
  margin: 0.08rem 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1.0rem;
  font-style: italic;
  line-height: 1.02;
  text-align: center;
}

.advisor-course-details {
  position: absolute;
  top: 50%;
  right: calc(100% + 0.58rem);
  bottom: auto;
  z-index: 30;
  display: grid;
  align-content: start;
  gap: 0.42rem;
  width: 17.4rem;
  max-height: 24rem;
  padding: 0.62rem 0.66rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(15, 13, 10, 0.97);
  box-shadow: 0 0.45rem 1.4rem rgba(0, 0, 0, 0.62);
  opacity: 0;
  visibility: hidden;
  transform: translate(0.46rem, -50%);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}

.advisor-course-details::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.36rem;
  width: 0.62rem;
  height: 0.62rem;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: rgba(15, 13, 10, 0.97);
  transform: translateY(-50%) rotate(45deg);
}

/* В зеркальной раскладке столбец советников стоит слева: выводим карточку в поле игры. */
.layout[data-stack-side="left"] .advisor-course-details {
  right: auto;
  left: calc(100% + 0.58rem);
  transform: translate(-0.46rem, -50%);
}

.layout[data-stack-side="left"] .advisor-course-details::after {
  right: auto;
  left: -0.36rem;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.layout[data-stack-side="left"] .advisors-panel .advisors article:hover .advisor-course-details,
.layout[data-stack-side="left"] .advisors-panel .advisors article:focus-within .advisor-course-details {
  transform: translate(0, -50%);
}

.advisors-panel .advisors article:hover .advisor-course-details,
.advisors-panel .advisors article:focus-within .advisor-course-details {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.advisor-course-details-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.advisor-course-details-head > strong {
  justify-self: start;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 1.16rem;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: left;
  text-transform: uppercase;
}

.advisor-course-details-head > span {
  padding: 0.18rem 0.34rem;
  color: var(--good);
  border: 1px solid rgba(147, 176, 110, 0.42);
  border-radius: var(--radius-sm);
  background: var(--good-soft);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.advisor-course-details-head > span.projected {
  color: var(--muted);
  border-color: var(--line-soft);
  background: rgba(214, 196, 150, 0.035);
}

.advisors-panel .advisors .advisor-course-timing {
  align-self: auto;
  margin: 0;
  overflow: visible;
  color: var(--muted);
  font-size: 1.08rem;
  font-style: normal;
  line-height: 1.1;
  text-align: left;
}

.advisors-panel .advisors .advisor-course-context {
  align-self: auto;
  margin: 0;
  padding: 0.34rem 0.42rem;
  overflow: visible;
  color: var(--text);
  border-left: 2px solid var(--accent-dim);
  background: rgba(214, 196, 150, 0.04);
  font-size: 1.08rem;
  font-style: normal;
  line-height: 1.1;
  text-align: left;
}

/* Затраты и профиты — как в карточках выбора: два столбца рядом,
   нейтральные (не крашеные) подписи-заголовки и те же чипы good/bad. */
.advisor-course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.44rem;
  padding-top: 0.48rem;
  border-top: 1px solid var(--line-soft);
}

.advisor-course-rule {
  display: grid;
  align-content: start;
  gap: 0.28rem;
  min-width: 0;
}

.advisor-course-rule > b {
  color: var(--muted);
  font-family: var(--font-display), "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.05;
  text-transform: uppercase;
}

.advisor-course-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.3rem;
}

/* Тот же чип, что и в карточках выбора: те же размеры шрифта и иконки. */
.advisor-course-rule .metric-chip {
  min-width: 0;
  min-height: 1.2rem;
  padding: 0.14rem 0.3rem;
  font-size: 0.84rem;
}

/* Хроника */
.journal {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.journal-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
}

.journal-tabs button {
  min-width: 0;
  min-height: 1.7rem;
  padding: 0.18rem 0.24rem;
  cursor: pointer;
  border: 0;
  border-right: 1px solid var(--line-soft);
  color: var(--muted-2);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 140ms ease, background 140ms ease;
}

.journal-tabs button:last-child {
  border-right: 0;
}

.journal-tabs button:hover {
  color: var(--text);
}

.journal-tabs button.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.journal-today {
  min-height: 0;
  overflow: hidden;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    linear-gradient(180deg, rgba(22, 20, 16, 0.34), rgba(10, 9, 7, 0.12));
  background-blend-mode: normal, normal;
}

.journal-today[hidden],
.journal-list[hidden] {
  display: none !important;
}

.journal-today .event {
  height: 100%;
}

.journal-today.is-turn-leaving {
  opacity: 0;
  transform: translateY(-0.32rem);
  transition: opacity 340ms ease-in, transform 340ms ease-in;
}

.journal-today.is-turn-entering {
  animation: journalTodayReturn 480ms ease-out both;
}

.journal-list {
  min-height: 0;
  padding: 0.7rem 0.8rem;
  /* Прозрачная правая рамка уводит полосу прокрутки внутрь, от декоративной
     рамки панели. Скроллбар рисуется внутри border, а фон элемента заходит
     под прозрачную рамку (background-clip: border-box), поэтому щели нет. */
  border-right: 0.5rem solid transparent;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    var(--panel-2);
  background-blend-mode: normal, normal;
  font-size: 1.08rem;
  line-height: 1.36;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.log-entry {
  position: relative;
  margin-bottom: 0.72rem;
  padding: 0 0 0.72rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.36;
  color: var(--text);
  font-size: 1.02rem;
}

.log-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.4rem;
  height: 0.4rem;
  border: 1px solid var(--accent);
  background: var(--panel);
  transform: rotate(45deg);
}

.log-entry::after {
  content: "";
  position: absolute;
  left: 0.18rem;
  top: 0.95rem;
  bottom: -0.7rem;
  width: 1px;
  background: var(--line-soft);
}

.log-entry:last-child::after {
  display: none;
}

.log-entry time {
  display: block;
  margin-bottom: 0.16rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.log-entry b {
  color: var(--text-strong);
}

.log-entry h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.14rem;
  line-height: 1.14;
}

.log-entry p {
  margin: 0.28rem 0 0;
}

.log-result {
  color: var(--muted);
}

.log-advisor {
  color: var(--muted-2);
  font-style: italic;
}

.log-effects {
  margin-top: 0.36rem;
}

.journal-reactions {
  display: grid;
  gap: 0.3rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.journal-reactions li {
  padding-left: 0.6rem;
  border-left: 2px solid rgba(201, 168, 106, 0.45);
  color: var(--muted);
  font-size: 1.0rem;
  line-height: 1.3;
}

/* Неблокирующая подсказка следующего действия. Это облегчённая версия
   обучения: подсвечивает только нужный блок, не затемняя игровое поле. */
.action-nudge-target {
  outline: 1px solid rgba(228, 197, 122, 0.76);
  outline-offset: 3px;
  box-shadow: 0 0 0.8rem rgba(211, 184, 120, 0.18);
}

.action-nudge {
  position: fixed;
  z-index: 330;
  width: min(21rem, calc(100vw - 1.5rem));
  padding: 0.7rem 2rem 0.74rem 0.92rem;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(211, 184, 120, 0.1), rgba(211, 184, 120, 0.02)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
  box-shadow: 0 0.65rem 1.8rem rgba(0, 0, 0, 0.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.35rem);
  transition: opacity 170ms ease, transform 170ms ease, visibility 170ms ease;
}

.action-nudge::after {
  content: "";
  position: absolute;
  width: 0.64rem;
  height: 0.64rem;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  transform: rotate(45deg);
}

.action-nudge[data-side="left"]::after {
  right: -0.38rem;
  top: 50%;
  border-top: 0;
  border-left: 0;
  transform: translateY(-50%) rotate(-45deg);
}

.action-nudge[data-side="right"]::after {
  left: -0.38rem;
  top: 50%;
  border-right: 0;
  border-bottom: 0;
  transform: translateY(-50%) rotate(-45deg);
}

.action-nudge[data-side="above"]::after {
  left: 50%;
  bottom: -0.38rem;
  border-top: 0;
  border-left: 0;
  transform: translateX(-50%) rotate(45deg);
}

.action-nudge[data-side="below"]::after {
  left: 50%;
  top: -0.38rem;
  border-right: 0;
  border-bottom: 0;
  transform: translateX(-50%) rotate(45deg);
}

.action-nudge.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.action-nudge-kicker {
  display: block;
  margin-bottom: 0.14rem;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.action-nudge-title {
  display: block;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.06;
  text-transform: uppercase;
}

.action-nudge-text {
  margin: 0.3rem 0 0;
  color: var(--text);
  font-size: 1.06rem;
  line-height: 1.2;
}

.action-nudge-close {
  position: absolute;
  top: 0.45rem;
  right: 0.48rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1;
}

.action-nudge-close:hover,
.action-nudge-close:focus-visible {
  color: var(--text-strong);
  border-color: var(--line);
  background: rgba(214, 196, 150, 0.06);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .action-nudge {
    transition: none;
  }
}

.journal-list:has(> .empty-log:only-child) {
  display: grid;
  place-items: center;
}

.empty-log {
  max-width: 22rem;
  margin: 0;
  padding: 0 1rem;
  color: var(--muted-2);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.25;
  text-align: center;
}

/* чернильный росчерк над текстом-затычкой */
.empty-log::before {
  content: "❧";
  display: block;
  margin-bottom: 0.55rem;
  color: rgba(211, 184, 120, 0.45);
  font-size: 1.5rem;
  font-style: normal;
  line-height: 1;
}

.footer-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem;
  border-top: 1px solid var(--line-soft);
}

/* ---------- 12. Нижняя панель прогноза ---------- */
.forecast-bar {
  grid-column: 1 / -1;
  grid-row: 3;
  z-index: 1;
  min-height: 0;
  margin-right: calc(11.4% + var(--gap));
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  overflow: hidden;
  font-size: 0.9rem;
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    var(--panel-2);
  background-blend-mode: normal, normal;
}

.forecast-title {
  display: none;
}

.forecast-empty {
  align-self: center;
  padding: 0.6rem 1rem;
  color: var(--muted);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.25;
}

.forecast-empty::before {
  content: "◈";
  margin-right: 0.5rem;
  color: var(--accent);
  font-style: normal;
}

.forecast-items {
  display: flex;
  align-items: stretch;
  gap: 0.34rem;
  height: 100%;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  overflow: hidden;
}

.forecast-metrics-window {
  --forecast-scroll-x: 0px;
  --forecast-scroll-duration: 12s;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.forecast-metrics-track {
  display: flex;
  align-items: stretch;
  gap: 0.34rem;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  height: 100%;
  padding-right: 0.08rem;
  transform: translateX(0);
  will-change: transform;
}

.forecast-metrics-window.scroll-metrics .forecast-metrics-track {
  animation: forecastMetricsScroll var(--forecast-scroll-duration) ease-in-out infinite;
}

@keyframes forecastMetricsScroll {
  0%,
  8% {
    transform: translateX(0);
  }
  50%,
  62% {
    transform: translateX(var(--forecast-scroll-x));
  }
  100% {
    transform: translateX(0);
  }
}

.forecast-metrics-track > .forecast-empty {
  align-self: center;
}

.forecast-item {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  min-height: 0;
  display: grid;
  gap: 0.18rem;
  align-content: center;
  padding: 0.42rem 0.55rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  overflow: visible;
}

.forecast-item.good {
  border-color: rgba(147, 176, 110, 0.3);
  background: var(--good-soft);
}

.forecast-item.bad {
  border-color: rgba(193, 96, 74, 0.32);
  background: var(--bad-soft);
}

.forecast-item.forecast-capital {
  min-width: 13rem;
}

.forecast-item b {
  display: flex;
  gap: 0.26rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.forecast-item > span {
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  white-space: nowrap;
}

.forecast-item em {
  display: inline-block;
  margin-left: 0.16rem;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.forecast-item .good,
.forecast-item em.good {
  color: var(--good);
}

.forecast-item .bad,
.forecast-item em.bad {
  color: var(--bad);
}

.forecast-icon {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--muted);
  border: 0;
  font-size: 0.72rem;
  line-height: 1;
}

/* Советник в прогнозе */
.forecast-advisor {
  --forecast-scroll-y: 0px;
  position: relative;
  /* Фиксированная ширина: блок не должен «гулять» в зависимости от того,
     сколько чипов-изменений стоит рядом. */
  flex: 0 0 21.6rem;
  width: 21.6rem;
  min-width: 21.6rem;
  max-width: 21.6rem;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  align-self: stretch;
  gap: 0.5rem;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  box-sizing: border-box;
  overflow: hidden;
}

.forecast-advisor.support {
  border-color: rgba(147, 176, 110, 0.4);
}

.forecast-advisor.warn {
  border-color: rgba(193, 96, 74, 0.4);
}

.forecast-advisor .advisor-portrait {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
}

.forecast-advisor > .forecast-advice-window {
  position: absolute;
  inset: 0.28rem 0.5rem 0.28rem 4.2rem;
  grid-column: 1 / -1;
  grid-row: 1;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  text-align: left;
  box-sizing: border-box;
}

.forecast-advisor-name {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--text-strong);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.05;
  white-space: normal;
  text-align: left;
}

.forecast-advice-text {
  display: grid;
  justify-items: start;
  gap: 0.12rem;
  min-width: 0;
  min-height: 0;
  padding: 0.02rem 0 0.24rem;
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
  text-align: left;
  transform: translateY(0);
  will-change: transform;
}

.forecast-advice-text b,
.forecast-advice-text em {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
  text-align: left;
  justify-self: start;
}

.forecast-advice-text em {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.16;
}

.forecast-course-effects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.18rem;
  max-width: 100%;
  margin-top: 0.08rem;
}

.forecast-course-effects .metric-chip {
  min-width: 2.4rem;
  min-height: 1.18rem;
  padding: 0.08rem 0.2rem;
}

.forecast-course-effects .metric-icon,
.forecast-course-effects .metric-icon.png-icon.asset-loaded {
  width: 0.78rem !important;
  height: 0.78rem !important;
  min-width: 0.78rem !important;
  min-height: 0.78rem !important;
}

.forecast-course-effects .metric-chip em {
  display: inline;
  color: currentColor;
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1;
}

.forecast-advisor.scroll-advice .forecast-advice-text {
  animation: forecastAdviceScroll 9s ease-in-out infinite;
}

@keyframes forecastAdviceScroll {
  0%,
  18% {
    transform: translateY(0);
  }
  50%,
  68% {
    transform: translateY(var(--forecast-scroll-y));
  }
  100% {
    transform: translateY(0);
  }
}

/* ---------- 13. Меню ---------- */
.game-menu-bar {
  grid-column: 3;
  grid-row: 3;
  z-index: 2;
  position: relative;
  width: 50%;
  justify-self: end;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  place-items: stretch;
  overflow: hidden;
}

.menu-toggle {
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(214, 196, 150, 0.18);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  border-radius: 0;
  color: var(--gold);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(41, 35, 25, 0.98), var(--panel-raised));
  background-blend-mode: normal, normal;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 140ms ease, box-shadow 140ms ease;
}

.game-menu-bar .menu-toggle:first-child {
  border-bottom: 1px solid rgba(214, 196, 150, 0.18);
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  color: var(--accent);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.game-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background: rgba(5, 4, 3, 0.8);
  backdrop-filter: blur(7px);
}

.game-menu-overlay[hidden] {
  display: none;
}

.game-menu-dialog {
  position: relative;
  width: min(42rem, calc(100vw - 3rem));
  max-height: min(42rem, calc(100vh - 3rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(240, 236, 220, 0.04);
  /* Меню находится вне .page, поэтому наследуем масштаб доски явно. */
  zoom: var(--ui-scale, 1);
}

.game-menu-dialog::after {
  content: "";
  position: absolute;
  inset: 0.28rem;
  z-index: 2;
  pointer-events: none;
  border: 1px solid rgba(214, 196, 150, 0.1);
  border-radius: 2px;
}

.game-menu-head {
  position: relative;
  z-index: 1;
  padding: 1.2rem 1.45rem 1.05rem;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(214, 196, 150, 0.07), rgba(214, 196, 150, 0.016)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
}

.game-menu-head small {
  display: block;
  margin-bottom: 0.36rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.game-menu-head h2 {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.06;
}

.game-menu-head p {
  max-width: 31rem;
  margin: 0.52rem auto 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.35;
}

.game-menu-views {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 1.1rem 1.45rem 1.35rem;
  overflow-y: auto;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    var(--panel-2);
  background-blend-mode: normal, normal;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.game-menu-view {
  display: grid;
  gap: 0.62rem;
}

.game-menu-view[hidden] {
  display: none;
}

.game-setting-layout {
  display: grid;
  gap: 0.62rem;
  padding: 0.28rem 0 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}

.game-setting-layout > .game-setting {
  padding: 0;
  border-bottom: 0;
}

.window-layout-editor {
  display: grid;
  grid-template-columns: var(--editor-left-column, 23%) minmax(0, 1fr) var(--editor-right-column, 31%);
  grid-template-rows: repeat(2, minmax(6.25rem, 1fr));
  grid-template-areas:
    "resources panorama journal"
    "resources panorama advisors";
  gap: 0.48rem;
  min-height: 11.8rem;
}

.window-layout-module {
  display: grid;
  place-content: center;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.7rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  text-align: center;
  cursor: default;
}

.window-layout-module b {
  font-size: 1.04rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.window-layout-module small {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.1;
}

.game-menu-action,
.game-menu-back,
.game-menu-admin-link {
  min-height: 2.8rem;
  padding: 0.52rem 0.85rem;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.game-menu-action:hover,
.game-menu-action:focus-visible,
.game-menu-back:hover,
.game-menu-back:focus-visible,
.game-menu-admin-link:hover,
.game-menu-admin-link:focus-visible {
  color: var(--text-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.game-menu-action.primary {
  color: #ece1c4;
  border-color: rgba(214, 196, 150, 0.56);
  background:
    linear-gradient(180deg, rgba(94, 69, 30, 0.72), rgba(47, 37, 20, 0.92));
}

.game-menu-action.primary:hover,
.game-menu-action.primary:focus-visible {
  color: #fff4d5;
  background:
    linear-gradient(180deg, rgba(118, 88, 39, 0.78), rgba(56, 43, 22, 0.94));
}

.game-menu-action.danger {
  color: #efc7b7;
  border-color: rgba(178, 75, 45, 0.62);
  background: linear-gradient(180deg, rgba(96, 39, 24, 0.72), rgba(48, 22, 17, 0.92));
}

.game-menu-action.danger:hover,
.game-menu-action.danger:focus-visible {
  color: #ffe0d5;
  border-color: var(--bad);
  background: linear-gradient(180deg, rgba(120, 48, 29, 0.78), rgba(59, 25, 19, 0.94));
}

.game-menu-action:disabled {
  cursor: not-allowed;
  color: var(--muted-2);
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.game-menu-action.compact {
  min-width: 12rem;
  min-height: 2.35rem;
  font-size: 0.9rem;
}

.language-setting select {
  min-width: 12rem;
  min-height: 2.35rem;
  padding: 0.45rem 2.1rem 0.45rem 0.75rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--panel-3);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.language-setting select:hover,
.language-setting select:focus-visible {
  color: var(--text-strong);
  border-color: var(--accent);
  outline: none;
}

.language-setting option {
  color: var(--text);
  background: var(--panel-2);
}

html[data-locale="zh-CN"] {
  --font-display: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", SimSun, "Microsoft YaHei", serif;
  --font-heading: "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-heading-wide: var(--font-heading);
  --font-italic: var(--font-display);
  --font-body: var(--font-display);
  --font-ui: "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

html[data-locale="ja"] {
  --font-display: "Noto Serif CJK JP", "Source Han Serif JP", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --font-heading: "Noto Sans CJK JP", "Source Han Sans JP", "Yu Gothic", "YuGothic", Meiryo, sans-serif;
  --font-heading-wide: var(--font-heading);
  --font-italic: var(--font-display);
  --font-body: var(--font-display);
  --font-ui: "Noto Sans CJK JP", "Source Han Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

html[data-locale="ko"] {
  --font-display: "Noto Serif CJK KR", "Source Han Serif KR", Batang, "BatangChe", "Nanum Myeongjo", serif;
  --font-heading: "Noto Sans CJK KR", "Source Han Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-heading-wide: var(--font-heading);
  --font-italic: var(--font-display);
  --font-body: var(--font-display);
  --font-ui: "Noto Sans CJK KR", "Source Han Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

html[data-script="cjk"] body {
  line-break: strict;
  word-break: normal;
}

html[data-script="cjk"] :is(.panel-title, .phase-title, button, .tab, .event-title, .choice-title, .advisor-name) {
  letter-spacing: 0;
}

html[data-script="cjk"] :is(em, i, .historical-context, .advisor-quote, .stat-note) {
  font-style: normal;
}

html[data-locale="de"] :is(button, .tab, .game-menu-action),
html[data-locale="fr"] :is(button, .tab, .game-menu-action),
html[data-locale="pt-BR"] :is(button, .tab, .game-menu-action) {
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.game-menu-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.game-menu-back {
  justify-self: start;
  min-height: 2.3rem;
  min-width: 7.2rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
}

.game-menu-status {
  position: relative;
  display: grid;
  gap: 0.3rem;
  min-height: 4.1rem;
  padding: 0.8rem 0.9rem;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  background: rgba(214, 196, 150, 0.045);
  font-size: 0.95rem;
  line-height: 1.34;
}

/* Подсказка над карточкой сохранения */
.game-menu-hint {
  margin: 0 0 0.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.game-save-slots {
  display: grid;
  gap: 0.58rem;
}

/* Карточка сохранения кликабельна (загрузка), крестик — удаление */
.game-menu-status.has-save {
  padding-right: 2.7rem;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.game-menu-status.has-save:hover {
  border-color: var(--accent);
  background: rgba(214, 196, 150, 0.08);
}

.game-save-delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-ui);
  font-size: 1.25rem;
  line-height: 1;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.game-save-delete:hover,
.game-save-delete:focus-visible {
  color: #ffe0d5;
  border-color: var(--bad);
  background: var(--bad-soft);
  outline: none;
  transform: translateY(-1px);
}

.game-menu-status b {
  color: var(--text-strong);
  font-size: 1rem;
}

.game-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.76rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.game-setting b,
.game-setting small {
  display: block;
}

.game-setting b {
  color: var(--text-strong);
  font-size: 1.02rem;
  line-height: 1.15;
}

.game-setting small {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.25;
}

.volume-setting {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 45%);
  cursor: default;
}

.volume-setting input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.game-menu-admin-link {
  display: grid;
  place-items: center;
  margin-top: 0.18rem;
}

/* Главное меню: узкая колонка слева, справа остаётся место под фоновый визуал */
.game-menu-overlay.main-menu {
  place-items: center;
  padding: 1.4rem;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
  backdrop-filter: none;
}

.game-menu-overlay.main-menu::before,
.game-menu-overlay.main-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.game-menu-overlay.main-menu::before {
  background: url("assets/menu/menu_bg.jpg") center / cover no-repeat;
  opacity: 1;
  filter: none;
  transform: none;
}

.game-menu-overlay.main-menu::after {
  display: none;
}

.game-menu-overlay.main-menu .game-menu-dialog {
  width: min(27rem, calc(100vw - 4rem));
  z-index: 1;
}

/* В под-разделах (Сохранения, Настройки) возвращаем привычное
   центрированное расположение. :has — «если корневой раздел скрыт». */
.game-menu-overlay.main-menu:has([data-menu-view="root"][hidden]) {
  place-items: center;
  padding: 1.4rem;
}

.game-menu-overlay.main-menu:has([data-menu-view="root"][hidden]) .game-menu-dialog {
  width: min(42rem, calc(100vw - 3rem));
}

.game-menu-overlay.main-menu .game-menu-head {
  padding-top: 1.55rem;
  padding-bottom: 1.32rem;
}

.game-menu-overlay.main-menu .game-menu-head h2 {
  font-size: 2.1rem;
}

/* Логотип как в шапке игры — показываем только в главном меню */
.menu-brand {
  display: none;
}

.game-menu-overlay.main-menu .menu-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.game-menu-overlay.main-menu .menu-brand .brand-logo {
  display: block;
  width: min(100%, 17rem);
  max-height: 7rem;
  object-fit: contain;
}

.game-menu-overlay.main-menu .menu-brand .brand-mark {
  color: var(--gold);
  font-size: 2.4rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.game-menu-overlay.main-menu .menu-brand .brand-text {
  display: grid;
  justify-items: center;
  gap: 0.16rem;
}

.game-menu-overlay.main-menu .menu-brand .brand-text b {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.game-menu-overlay.main-menu .menu-brand .brand-text small {
  display: block;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.game-menu-overlay.main-menu .menu-brand .brand-text small::before,
.game-menu-overlay.main-menu .menu-brand .brand-text small::after {
  display: none;
}

/* Даты уже несёт логотип — отдельный кикер в главном меню скрываем.
   Заголовок «Главное меню» тоже не нужен: логотип говорит сам за себя. */
.game-menu-overlay.main-menu #gameMenuKicker,
.game-menu-overlay.main-menu #gameMenuTitle {
  display: none;
}

/* В главном меню список не прокручивается — убираем правый inset скроллбара,
   иначе кнопки смещаются на 0.5rem влево относительно центрированной шапки. */
.game-menu-overlay.main-menu .game-menu-views {
  border-right: 0;
}

/* Описание главного меню — крупнее и плотнее */
.game-menu-overlay.main-menu .game-menu-head p {
  max-width: 27rem;
  font-size: 1.12rem;
  line-height: 1.24;
}

/* Выбор сложности — только в главном меню, над кнопками */
.difficulty-pick {
  display: none;
}

.game-menu-overlay.main-menu .difficulty-pick {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  padding: 0.7rem 0.7rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.03);
  text-align: center;
}

.difficulty-pick-label {
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.difficulty-pick-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.32rem;
}

.difficulty-option {
  min-height: 2.1rem;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.difficulty-option:hover,
.difficulty-option:focus-visible {
  color: var(--text-strong);
  border-color: rgba(228, 197, 122, 0.5);
  outline: none;
}

.difficulty-option.active {
  color: #1c1509;
  border-color: var(--gold);
  background: linear-gradient(180deg, #e8d49a, var(--gold) 62%, #b7954f);
  box-shadow: inset 0 1px 0 rgba(255, 244, 213, 0.4);
}

.difficulty-pick-note {
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.2;
}

/* ---------- Выбор сложности при старте новой игры ---------- */
.difficulty-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background: rgba(5, 4, 3, 0.82);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 160ms ease;
}

.difficulty-overlay.show {
  opacity: 1;
}

.difficulty-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(66rem, calc(100vw - 3rem));
  max-height: calc(100vh - 3rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #181613;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  color: var(--text);
  overflow: hidden;
  zoom: 1;
}

.difficulty-dialog-head {
  padding: 1.55rem 1.8rem 1.4rem;
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(214, 196, 150, 0.08), rgba(214, 196, 150, 0.025)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
}

.difficulty-dialog-kicker {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.difficulty-dialog-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.08;
}

.difficulty-dialog-head p {
  max-width: 54rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.36;
}

.difficulty-dialog-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  min-height: 0;
  padding: 1.35rem 1.8rem 0.7rem;
  overflow-y: auto;
}

.difficulty-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 0.65rem;
  min-height: 13.5rem;
  padding: 1.25rem 1.3rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.difficulty-card:hover,
.difficulty-card:focus-visible {
  border-color: rgba(228, 197, 122, 0.6);
  background: var(--gold-soft);
  outline: none;
  transform: translateY(-1px);
}

.difficulty-card-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.difficulty-card-tag {
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
}

.difficulty-card-note {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.38;
}

.difficulty-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.8rem 1.3rem;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.1);
}

.difficulty-dialog-cancel {
  min-height: 2.85rem;
  padding: 0.42rem 1.4rem;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.difficulty-dialog-cancel:hover,
.difficulty-dialog-cancel:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

@media (max-width: 760px), (max-height: 640px) {
  .difficulty-overlay {
    align-items: center;
    padding: 0.75rem;
  }

  .difficulty-dialog {
    width: min(38rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 1.5rem);
  }

  .difficulty-dialog-head {
    padding: 1.1rem 1.2rem 1rem;
  }

  .difficulty-dialog-head h2 {
    font-size: 1.8rem;
  }

  .difficulty-dialog-head p {
    font-size: 1.05rem;
  }

  .difficulty-dialog-body {
    grid-template-columns: 1fr;
    padding: 1rem 1.2rem 0.5rem;
  }

  .difficulty-card {
    min-height: 0;
    padding: 0.9rem 1rem;
  }

  .difficulty-dialog-actions {
    padding: 0.8rem 1.2rem 1rem;
  }
}

/* ---------- Отделка меню под общий стиль игры ---------- */

/* Уголки-заклёпки, как на модалке хроники и маркерах панорамы */
.game-menu-dialog::before {
  content: "";
  position: absolute;
  inset: 0.3rem;
  z-index: 3;
  pointer-events: none;
  border-radius: 3px;
  background:
    radial-gradient(circle 2.4px at 2.4px 2.4px, rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px),
    radial-gradient(circle 2.4px at calc(100% - 2.4px) 2.4px, rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px),
    radial-gradient(circle 2.4px at 2.4px calc(100% - 2.4px), rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px),
    radial-gradient(circle 2.4px at calc(100% - 2.4px) calc(100% - 2.4px), rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px);
}

/* Декоративные линии по бокам кикера, как в шапке модалки */
.game-menu-head small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.game-menu-head small::before,
.game-menu-head small::after {
  content: "";
  width: 2.8rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 184, 120, 0.55));
}

.game-menu-head small::after {
  background: linear-gradient(90deg, rgba(211, 184, 120, 0.55), transparent);
}

/* Полоса прокрутки списка меню — отодвинута от рамки (скроллбар внутри
   прозрачной рамки, фон заходит под неё). */
.game-menu-views {
  border-right: 0.5rem solid transparent;
}

/* Кнопки: тактильная отделка — внутренний блик, тень и лёгкий подъём */
.game-menu-action {
  box-shadow: inset 0 1px 0 rgba(240, 236, 220, 0.05), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.game-menu-action:hover,
.game-menu-action:focus-visible {
  transform: translateY(-1px);
}

.game-menu-action.primary {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 213, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

.game-menu-action.primary:hover,
.game-menu-action.primary:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 213, 0.26),
    0 0 10px rgba(211, 184, 120, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

.game-menu-action.danger {
  box-shadow: inset 0 1px 0 rgba(255, 220, 205, 0.12), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.game-menu-action:disabled {
  transform: none;
  box-shadow: none;
}

/* Кнопка «Назад» — со стрелкой, как отдельный тихий элемент */
.game-menu-back::before {
  content: "‹ ";
  color: var(--accent);
}

.game-menu-back:hover,
.game-menu-back:focus-visible {
  color: var(--text-strong);
}

/* Главное меню — крупнее и торжественнее */
.game-menu-overlay.main-menu .game-menu-dialog {
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.82), inset 0 0 0 1px rgba(240, 236, 220, 0.05);
}

.game-menu-overlay.main-menu .game-menu-head {
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(211, 184, 120, 0.1), rgba(211, 184, 120, 0.02)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
}

.game-menu-overlay.main-menu .game-menu-head small {
  color: var(--gold);
  letter-spacing: 0.24em;
}

.game-menu-overlay.main-menu .game-menu-head h2 {
  letter-spacing: 0.02em;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* Общие кнопки */
.small-btn,
.primary-btn,
.menu-btn {
  min-height: 2.1rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  font-weight: 700;
}

.primary-btn {
  color: #ddd6c0;
  border: 1px solid rgba(214, 196, 150, 0.55);
  background: #232016;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.small-btn:hover,
.primary-btn:hover {
  filter: brightness(1.08);
}

/* ---------- 14. Пошаговое обучение ---------- */
.tutorial-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  pointer-events: auto;
}

.tutorial-layer[hidden] {
  display: none !important;
}

.tutorial-spotlight {
  position: fixed;
  z-index: 0;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow:
    0 0 0 2px rgba(4, 3, 2, 0.72),
    0 0 0 100vmax rgba(3, 3, 2, 0.82),
    0 0 1.25rem rgba(201, 168, 106, 0.32);
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
  pointer-events: none;
}

.tutorial-card {
  position: fixed;
  z-index: 1;
  width: min(27rem, calc(100vw - 2rem));
  max-height: min(31rem, calc(100vh - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  box-shadow: 0 1.35rem 4rem rgba(0, 0, 0, 0.76), inset 0 0 0 1px rgba(240, 236, 220, 0.04);
  transition: left 180ms ease, top 180ms ease;
}

.tutorial-card::after {
  content: "";
  position: absolute;
  inset: 0.28rem;
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(214, 196, 150, 0.1);
  border-radius: 2px;
}

.tutorial-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.68rem 1.05rem;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(211, 184, 120, 0.09), rgba(211, 184, 120, 0.02)),
    var(--panel-2);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.tutorial-card-head span:last-child {
  color: var(--muted);
  letter-spacing: 0;
}

.tutorial-card-body {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 1rem 1.15rem 1.1rem;
  overflow-y: auto;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    var(--panel-2);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.tutorial-step-dots {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  margin-bottom: 0.72rem;
}

.tutorial-step-dots span {
  width: 0.48rem;
  height: 0.48rem;
  border: 1px solid var(--line-strong);
  background: rgba(214, 196, 150, 0.04);
  transform: rotate(45deg);
}

.tutorial-step-dots span.done {
  border-color: var(--muted);
  background: var(--muted-2);
}

.tutorial-step-dots span.active {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0.6rem rgba(211, 184, 120, 0.48);
}

.tutorial-card h2 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: uppercase;
}

.tutorial-card-body p {
  margin: 0.65rem 0 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.24;
}

.tutorial-card-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 1rem 0.82rem;
  border-top: 1px solid var(--line);
  background: var(--panel-3);
}

.tutorial-card-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 0.42rem;
}

.tutorial-quiet-action,
.tutorial-nav-action {
  min-height: 2.38rem;
  padding: 0.48rem 0.76rem;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.035);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.tutorial-quiet-action {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.tutorial-quiet-action:hover,
.tutorial-quiet-action:focus-visible,
.tutorial-nav-action:hover,
.tutorial-nav-action:focus-visible {
  color: var(--text-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.tutorial-nav-action.primary {
  min-width: 4.55rem;
  color: #ece1c4;
  border-color: rgba(214, 196, 150, 0.56);
  background: linear-gradient(180deg, rgba(94, 69, 30, 0.72), rgba(47, 37, 20, 0.92));
}

.tutorial-nav-action:disabled {
  cursor: default;
  opacity: 0.34;
}

.tutorial-start-action {
  margin-top: 0.08rem;
}

@media (max-width: 720px), (max-height: 620px) {
  .tutorial-card {
    width: min(23rem, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
  }

  .tutorial-card-actions {
    grid-template-columns: 1fr;
  }

  .tutorial-card-actions > div {
    justify-content: stretch;
  }

  .tutorial-card-actions > div button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-spotlight,
  .tutorial-card {
    transition: none;
  }
}

/* ---------- 15. Глоссарий-тост ---------- */
.glossary-toast {
  position: absolute;
  right: 0.56rem;
  bottom: 6.6rem;
  z-index: 18;
  width: 28.6rem;
  max-width: 33rem;
  padding: 0.78rem 2.3rem 0.82rem 0.95rem;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    #181613;
  background-blend-mode: normal, normal;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.55rem);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.glossary-toast::before {
  content: "";
  position: absolute;
  left: 0.72rem;
  top: -0.26rem;
  width: 0.46rem;
  height: 0.46rem;
  border: 1px solid rgba(214, 196, 150, 0.85);
  background: #1d1b17;
  transform: rotate(45deg);
}

.glossary-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.glossary-toast[hidden] {
  display: none !important;
}

.glossary-kicker {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.glossary-toast b {
  display: block;
  color: var(--text-strong);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.12;
}

.glossary-toast p {
  margin: 0.3rem 0 0;
  color: var(--text);
  font-size: 1.16rem;
  line-height: 1.2;
}

.upgrade-toast-list {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.62rem;
}

.upgrade-toast-row {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.48rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.045);
}

.upgrade-toast-node,
.upgrade-toast-node.png-icon.asset-loaded {
  width: 1.55rem !important;
  height: 1.55rem !important;
  min-width: 1.55rem !important;
  min-height: 1.55rem !important;
  --icon-filter: var(--icon-gold);
}

.upgrade-toast-copy {
  display: grid;
  min-width: 0;
  gap: 0.04rem;
}

.upgrade-toast-copy strong {
  color: var(--text-strong);
  font-size: 0.92rem;
  line-height: 1.06;
}

.upgrade-toast-copy small {
  color: var(--muted-2);
  font-size: 0.74rem;
  line-height: 1;
}

.upgrade-toast-cost {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.26rem;
  max-width: 12.5rem;
}

.upgrade-toast-cost .metric-chip {
  min-width: 0;
  min-height: 1.2rem;
  padding: 0.12rem 0.28rem;
  font-size: 0.82rem;
}

/* Итог принятого курса в уведомлении — два столбца (как в подсказке
   советника и в карточках): нейтральные подписи + красные/зелёные чипы. */
.course-toast-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.62rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
}

.course-toast-row {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
}

.course-toast-row > b {
  color: var(--muted);
  font-family: var(--font-display), "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.course-toast-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.course-toast-chips .metric-chip {
  min-width: 0;
  min-height: 1.2rem;
  padding: 0.12rem 0.28rem;
  font-size: 0.82rem;
}

.glossary-close {
  position: absolute;
  right: 0.44rem;
  top: 0.4rem;
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 0.95rem;
  line-height: 1;
}

.glossary-close:hover,
.glossary-close:focus-visible {
  color: var(--text-strong);
  border-color: var(--accent);
  outline: none;
}

/* ---------- 15. Модальное окно (итог хода) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 1.4rem;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.modal.show {
  display: grid;
}

.notice {
  position: relative;
  width: min(46rem, calc(100vw - 3rem));
  max-height: min(88vh, 58rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--text);
  border: 1px solid rgba(211, 184, 120, 0.42);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(175deg, rgba(38, 34, 26, 0.98), #181613 30%, #14120f 92%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px rgba(211, 184, 120, 0.12),
    0 24px 70px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  /* Сводки и сюжетные окна совпадают по масштабу с игровой доской. */
  zoom: var(--ui-scale, 1);
}

/* уголки-заклепки, как на маркерах панорамы */
.notice::before {
  content: "";
  position: absolute;
  inset: 0.3rem;
  z-index: 1;
  pointer-events: none;
  border-radius: 3px;
  background:
    radial-gradient(circle 2.4px at 2.4px 2.4px, rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px),
    radial-gradient(circle 2.4px at calc(100% - 2.4px) 2.4px, rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px),
    radial-gradient(circle 2.4px at 2.4px calc(100% - 2.4px), rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px),
    radial-gradient(circle 2.4px at calc(100% - 2.4px) calc(100% - 2.4px), rgba(211, 184, 120, 0.7) 0 1.4px, transparent 1.9px);
}

.notice-head {
  position: relative;
  padding: 1rem 1.3rem 0.9rem;
  color: var(--text-strong);
  text-align: center;
  border-bottom: 1px solid rgba(211, 184, 120, 0.28);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(211, 184, 120, 0.09), rgba(214, 196, 150, 0.03));
  background-blend-mode: normal, normal;
  box-shadow: inset 0 1px 0 rgba(214, 196, 150, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

.notice-head small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.34rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1;
  text-transform: uppercase;
}

.notice-head small::before,
.notice-head small::after {
  content: "";
  width: 2.6rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211, 184, 120, 0.55));
}

.notice-head small::after {
  background: linear-gradient(90deg, rgba(211, 184, 120, 0.55), transparent);
}

.notice h3 {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.08;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.notice-body {
  min-height: 0;
  padding: 0.95rem 1.3rem 1.05rem;
  border-right: 0.5rem solid transparent;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    rgba(10, 9, 7, 0.18);
  background-blend-mode: normal, normal;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.notice-body p,
.notice-body li {
  margin: 0 0 0.7rem;
  color: var(--text);
  font-size: 1.42rem;
  line-height: 1.18;
}

.notice-body li {
  margin-bottom: 0;
}

.notice-section {
  margin-bottom: 0.95rem;
}

.notice-section h4 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.05;
  text-transform: uppercase;
}

.notice-section h4::before {
  content: "◆";
  color: rgba(211, 184, 120, 0.55);
  font-size: 0.5rem;
}

.notice-section h4::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(211, 184, 120, 0.3), transparent 82%);
}

.notice-body .verdict,
.reaction-list {
  padding: 0.66rem 0.85rem;
  border: 1px solid rgba(214, 196, 150, 0.12);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.055);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.25);
}

.notice-body .verdict {
  font-family: var(--font-display);
  font-style: italic;
}

/* Обычный отчет решения: основные смысловые блоки читаются плотнее,
   а оценка и историчность не мельче перечня «Что изменилось». */
.notice:not(.story-briefing) .notice-result-section > p,
.notice:not(.story-briefing) .notice-fact-section > p {
  line-height: 1.18;
}

.notice:not(.story-briefing) .notice-verdict-section .verdict,
.notice:not(.story-briefing) .notice-historicity-section .verdict {
  font-size: 1.42rem;
  line-height: 1.18;
}

/* Второстепенные подписи сохраняют EB Garamond, но без наклона. */
.stat-state,
.event-background,
.advisors-panel .advisors p,
.log-advisor,
.empty-log,
.forecast-empty,
.forecast-advice-text em,
.notice-body .verdict {
  font-family: var(--font-italic);
  font-style: normal;
}

/* Второстепенные подписи чуть компактнее основного текста, но не мельче читаемого. */
.log-advisor,
.notice-body .verdict {
  font-size: 0.92em;
}

.reaction-list {
  display: grid;
  gap: 0.34rem;
  margin: 0;
  list-style: none;
}

.reaction-list li {
  position: relative;
  padding-left: 1rem;
  line-height: 1.14;
}

/* Каждый пункт «Что изменилось» — отдельной строкой с маркером. */
.reaction-list li::before {
  content: "◆";
  position: absolute;
  left: 0.02rem;
  top: 0.02rem;
  color: var(--accent);
  font-size: 0.6rem;
  line-height: 1.5;
}

/* Голоса советников в модалке */
.advisor-voices-section {
  margin: 0.9rem 0 1rem;
}

.advisor-voices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.advisor-voice {
  display: grid;
  grid-template-columns: 4.15rem minmax(0, 1fr);
  gap: 0.76rem;
  min-height: 5.35rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.advisor-voice.support {
  border-color: rgba(147, 176, 110, 0.4);
  background: var(--good-soft);
}

.advisor-voice.warn {
  border-color: rgba(193, 96, 74, 0.4);
  background: var(--bad-soft);
}

.advisor-voice .advisor-portrait {
  width: 4.15rem;
  height: 5.2rem;
  align-self: stretch;
  aspect-ratio: 4 / 5;
}

.advisor-voice small {
  display: block;
  color: var(--muted-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.advisor-voice b {
  display: block;
  margin-top: 0.06rem;
  color: var(--text-strong);
  font-size: 1.16rem;
  line-height: 1.1;
}

.advisor-voice p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1.18;
}

.notice.consequence-briefing {
  width: min(56rem, calc(100vw - 3.5rem));
  max-height: min(88vh, 54rem);
}

.notice.consequence-briefing .notice-head {
  padding: 1.2rem 1.6rem 1.08rem;
}

.notice.consequence-briefing .notice-head small {
  color: var(--bad);
  margin-bottom: 0.42rem;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
}

.notice.consequence-briefing .notice-head small::before,
.notice.consequence-briefing .notice-head small::after {
  width: 4.2rem;
}

.notice.consequence-briefing .notice-head h3 {
  font-size: 2.3rem;
  line-height: 1;
}

.notice.consequence-briefing .notice-body {
  padding: 1.15rem 1.55rem 1.25rem;
}

.notice.consequence-briefing .notice-section {
  margin-bottom: 1.05rem;
}

.notice.consequence-briefing .notice-section h4 {
  gap: 0.65rem;
  margin-bottom: 0.58rem;
  font-size: 0.98rem;
  letter-spacing: 0.2em;
}

.notice.consequence-briefing .notice-result-section p,
.notice.consequence-briefing .notice-fact-section p,
.notice.consequence-briefing .notice-verdict-section p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.24;
}

.notice.consequence-briefing .reaction-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  padding: 0;
}

.notice.consequence-briefing .reaction-list li {
  padding: 0.55rem 0.7rem;
  border-left: 2px solid rgba(193, 96, 74, 0.65);
  background: rgba(193, 96, 74, 0.055);
}

.notice.consequence-briefing .advisor-voices {
  gap: 0;
}

.notice.consequence-briefing .narrative-advisor {
  grid-template-columns: 11.25rem minmax(0, 1fr);
  gap: 1.2rem;
  min-height: 14.35rem;
  padding: 0.82rem;
  border-color: rgba(193, 96, 74, 0.46);
  background:
    var(--surface-texture) var(--surface-texture-position) / var(--surface-texture-size) var(--surface-texture-repeat),
    rgba(193, 96, 74, 0.06);
  background-blend-mode: normal, normal;
}

.notice.consequence-briefing .narrative-advisor-portrait {
  width: 11.25rem;
  height: 14.0625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: #100f0c;
  background-size: cover !important;
  filter: none !important;
}

.notice.consequence-briefing .narrative-advisor-portrait.asset-missing::after {
  inset: 0.72rem;
  font-size: 0.88rem;
  line-height: 1.02;
}

.notice.consequence-briefing .narrative-advisor > div {
  align-self: center;
  min-width: 0;
  padding: 0.2rem 0.45rem 0.2rem 0;
}

.notice.consequence-briefing .narrative-advisor small {
  margin-top: 0;
  color: var(--accent);
  font-size: 0.86rem;
  letter-spacing: 0.13em;
}

.notice.consequence-briefing .narrative-advisor b {
  margin-top: 0.16rem;
  font-size: 1.82rem;
  line-height: 1;
}

.notice.consequence-briefing .narrative-advisor p {
  margin: 0.72rem 0 0;
  color: var(--text-strong);
  font-size: 1.14rem;
  line-height: 1.22;
}

.notice.consequence-briefing .notice-fact-section {
  padding: 0.8rem 0.95rem 0.86rem;
  border: 1px solid rgba(214, 196, 150, 0.12);
  border-left: 2px solid rgba(211, 184, 120, 0.72);
  background: rgba(214, 196, 150, 0.035);
}

.notice.consequence-briefing .notice-fact-section h4,
.notice.consequence-briefing .notice-verdict-section h4 {
  margin-bottom: 0.42rem;
}

.notice.consequence-briefing .notice-verdict-section .verdict {
  padding: 0.7rem 0.88rem;
  border-left-color: var(--bad);
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.18;
}

.notice.consequence-briefing .notice-footer {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.7rem 1.55rem 0.76rem;
}

.notice.consequence-briefing #noticeEffects {
  flex: 1 1 auto;
}

.notice.consequence-briefing .notice-actions {
  flex: 0 0 auto;
}

.notice.consequence-briefing .notice-actions .primary-btn {
  min-width: 10.8rem;
  min-height: 2.55rem;
  font-size: 1rem;
}

/* Нижний блок отчёта закреплён статично: эффекты хода и кнопка
   «Продолжить» всегда видны, а описание прокручивается в отдельной
   области между заголовком и этим блоком. */
.notice-footer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1.3rem 0.9rem;
  border-top: 1px solid rgba(211, 184, 120, 0.28);
  background:
    linear-gradient(0deg, rgba(20, 18, 14, 0.55), rgba(28, 25, 19, 0.2));
  box-shadow: inset 0 1px 0 rgba(214, 196, 150, 0.12), inset 0 8px 12px -10px rgba(0, 0, 0, 0.6);
}

#noticeEffects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

#noticeEffects:empty {
  display: none;
}

#noticeEffects .effect {
  min-height: 1.55rem;
  padding: 0.2rem 0.48rem;
  font-size: 0.92rem;
}

.notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.notice-actions .primary-btn {
  min-height: 2.3rem;
  padding: 0.36rem 1.4rem;
  border: 1px solid rgba(214, 196, 150, 0.55);
  background: linear-gradient(180deg, #2a2519, #232016 60%, #1d1a12);
  box-shadow:
    inset 0 1px 0 rgba(214, 196, 150, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.4);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  line-height: 1;
}

.notice-actions .primary-btn:hover,
.notice-actions .primary-btn:focus-visible {
  border-color: rgba(232, 212, 154, 0.8);
  background: linear-gradient(180deg, #322c1d, #282416 60%, #211d14);
  box-shadow:
    inset 0 1px 0 rgba(214, 196, 150, 0.26),
    0 0 10px rgba(211, 184, 120, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.4);
  outline: none;
}

/* Сюжетный брифинг */
.story-briefing-media {
  display: none;
}

.notice.story-briefing {
  width: min(58rem, calc(100vw - 3rem));
  max-height: min(88vh, 61rem);
}

.notice.story-briefing .notice-head {
  padding: 1.05rem 1.45rem 0.95rem;
  text-align: center;
}

.notice.story-briefing .notice-head small {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
}

.notice.story-briefing h3 {
  font-size: 2.05rem;
  line-height: 1.02;
}

.notice.story-briefing .notice-body {
  padding: 1.05rem 1.45rem 1.1rem;
}

.notice.story-briefing .story-briefing-media {
  display: block;
  height: 14.6rem;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: #0e0d0a;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover !important;
  box-shadow: none;
  overflow: hidden;
}

.notice.story-briefing .story-briefing-media.asset-loaded {
  filter: none !important;
  opacity: 1;
  mix-blend-mode: normal;
}

.notice.story-briefing .story-briefing-media.asset-missing::after {
  inset: 0.8rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.05;
}

.notice.story-briefing .notice-result-section p {
  max-width: 52rem;
  margin: 0 auto 1rem;
  color: var(--text);
  font-size: 1.32rem;
  line-height: 1.22;
  text-align: center;
}

.notice.story-briefing .notice-section h4 {
  text-align: center;
}

.notice.story-briefing .reaction-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: none;
}

.notice.story-briefing .reaction-list li {
  position: relative;
  min-height: 5.4rem;
  padding: 0.78rem 0.9rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-3);
  font-size: 1.08rem;
  line-height: 1.16;
}

.notice.story-briefing .reaction-list li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--line-strong);
}

.notice.story-briefing .notice-fact-section,
.notice.story-briefing .notice-verdict-section {
  margin-top: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.055);
}

.notice.story-briefing .notice-fact-section p,
.notice.story-briefing .notice-verdict-section p {
  margin: 0;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.38;
}

.notice.story-briefing .advisor-voices-section,
.notice.story-briefing .notice-historicity-section,
.notice.story-briefing #noticeEffects {
  display: none !important;
}

.notice.story-briefing .notice-actions {
  justify-content: center;
  padding-top: 1rem;
}

.notice.story-briefing .notice-actions .primary-btn {
  min-width: 12rem;
  min-height: 2.6rem;
  font-size: 1.05rem;
}

.notice.intro-briefing .notice-head {
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(201, 168, 106, 0.12), rgba(201, 168, 106, 0.04));
  background-blend-mode: normal, normal;
}

.notice.milestone-briefing .notice-head {
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(211, 184, 120, 0.12), rgba(211, 184, 120, 0.035));
  background-blend-mode: normal, normal;
}

.notice.milestone-briefing .notice-head small {
  color: var(--gold);
}

.notice.history-briefing .notice-head {
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(147, 176, 110, 0.11), rgba(147, 176, 110, 0.035));
  background-blend-mode: normal, normal;
}

.notice.history-briefing .notice-head small {
  color: var(--good);
}

/* ---------- 16. Экран финала ---------- */
.end-screen {
  grid-row: 2;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 1.05rem 1.3rem 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.end-screen.hidden {
  display: none !important;
}

.ending-asset.asset-loaded {
  filter: sepia(0.36) hue-rotate(-8deg) saturate(0.84) contrast(1.18) brightness(0.9);
}

.ending-asset {
  min-height: 10.5rem;
  margin: 0 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.end-screen h2 {
  margin: 0 0 0.65rem;
  color: var(--text-strong);
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.05;
}

.end-screen h3 {
  margin: 1rem 0 0.5rem;
  color: var(--accent);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.end-screen p,
.end-screen .reaction-list {
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.36;
  max-width: none;
}

.end-screen .score-grid,
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.score {
  min-height: 4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.score span {
  display: block;
  margin-top: 0.24rem;
  color: var(--gold);
  font-size: 1.36rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------- 17. Ассеты и PNG-иконки ---------- */
.icon-slot.asset-bound,
.asset-slot.asset-bound {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.icon-slot.asset-loaded,
.asset-slot.asset-loaded {
  color: transparent !important;
  text-shadow: none !important;
  border-style: solid !important;
}

.icon-slot.asset-loaded > *,
.asset-slot.asset-loaded > *,
.icon-slot.asset-missing > *,
.asset-slot.asset-missing > * {
  opacity: 0 !important;
}

.icon-slot.asset-missing,
.asset-slot.asset-missing {
  color: transparent !important;
  border: 1px dashed var(--line-strong) !important;
  background: var(--panel-3) !important;
}

.icon-slot.asset-missing::after,
.asset-slot.asset-missing::after {
  content: attr(data-asset-name);
  position: absolute;
  inset: 0.08rem;
  display: grid;
  place-items: center;
  padding: 0.08rem;
  color: var(--muted);
  font-size: 0.34rem;
  font-weight: 700;
  line-height: 0.95;
  text-align: center;
  text-transform: none;
  word-break: break-word;
  opacity: 0.9;
}

.advisor-portrait.asset-loaded,
.choice-art.asset-loaded,
.scene-asset-layer.asset-loaded,
.ending-asset.asset-loaded {
  border-style: solid !important;
  background-size: cover;
}

.advisor-portrait.asset-missing::after {
  font-size: 0.42rem;
}

.choice-art.asset-missing::after {
  inset: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.02;
}

.ending-asset.asset-missing::after {
  font-size: 1rem;
}

.icon-slot.asset-loaded.asset-missing,
.asset-slot.asset-loaded.asset-missing {
  border-style: solid !important;
}

/* PNG-иконки: перекраска через CSS-фильтры */
.icon-slot.png-icon.asset-loaded {
  display: inline-grid !important;
  place-items: center !important;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  overflow: visible !important;
  color: var(--icon-color, var(--muted)) !important;
  border: 0 !important;
  outline: 0 !important;
  background-image: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  image-rendering: auto !important;
  --icon-filter: var(--icon-slate);
}

.icon-slot.png-icon.asset-loaded::after {
  content: none !important;
}

.icon-slot.png-icon.asset-loaded > .png-icon-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  opacity: 1 !important;
  pointer-events: none !important;
  filter: var(--icon-filter);
  image-rendering: auto !important;
}

.stat-icon.png-icon.asset-loaded {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  min-height: 1rem !important;
}

.resources .stat-icon,
.resources .stat-icon.png-icon.asset-loaded {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  min-height: 1rem !important;
  font-size: 0.8rem !important;
}

.metric-chip .metric-icon.png-icon.asset-loaded {
  width: 1rem !important;
  height: 1rem !important;
}

.metric-chip.good .metric-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-good);
}

.metric-chip.bad .metric-icon.png-icon.asset-loaded,
.metric-chip.shortage .metric-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-bad);
}

.metric-chip.muted .metric-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-muted);
}

.forecast-icon.png-icon.asset-loaded,
.forecast-item .forecast-icon,
.forecast-item .forecast-icon.png-icon.asset-loaded {
  width: 1.05rem !important;
  height: 1.05rem !important;
  min-width: 1.05rem !important;
  min-height: 1.05rem !important;
  font-size: 0.74rem !important;
  --icon-filter: var(--icon-slate);
}

.forecast-item.good .forecast-icon.png-icon.asset-loaded,
.forecast-item.bad .forecast-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-slate);
}

.strategy-hud .hud-icon.png-icon.asset-loaded {
  width: 1.1rem !important;
  height: 1.1rem !important;
}

.strategy-hud .hud-icon[data-icon-key="year"].png-icon.asset-loaded,
.strategy-hud .hud-icon[data-icon-key="turn"].png-icon.asset-loaded {
  display: inline-grid !important;
  grid-column: 1 !important;
  grid-row: 2 !important;
  align-self: center !important;
  justify-self: end !important;
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  min-height: 1rem !important;
}

.strategy-hud #hudYear,
.strategy-hud #hudTurn {
  grid-column: 2 !important;
  grid-row: 2 !important;
  justify-self: start !important;
  padding-left: 0 !important;
}

#hudSeasonIcon.png-icon.asset-loaded,
#hudStabilityIcon.png-icon.asset-loaded {
  --icon-filter: var(--icon-good);
}

.hud-alert #hudStabilityIcon.png-icon.asset-loaded {
  --icon-filter: var(--icon-bad);
}

.hud-chapter-cell > .hud-icon.png-icon.asset-loaded,
.hud-goal-cell .hud-icon.png-icon.asset-loaded,
.hud-icon[data-icon-key="chapter"].png-icon.asset-loaded {
  display: none !important;
}

.marker-icon.png-icon.asset-loaded {
  width: 1.5rem !important;
  height: 1.5rem !important;
}

.choice .choice-pref-badge.icon-slot.png-icon.asset-loaded {
  top: 0.58rem !important;
  right: 0.58rem !important;
  width: 2.1rem !important;
  height: 2.1rem !important;
  min-width: 2.1rem !important;
  min-height: 2.1rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  opacity: 0.9;
  /* Нейтральная перекраска «как текст», не по риску/режиму. */
  --icon-filter: var(--icon-slate) !important;
}

/* Режим отладки ассетов */
body.debug-assets .icon-slot.asset-missing,
body.debug-assets .asset-slot.asset-missing {
  cursor: copy;
  outline: 1px solid rgba(147, 176, 110, 0.7);
  outline-offset: -2px;
}

body.debug-assets .scene-asset-layer.asset-missing {
  pointer-events: auto;
}

.icon-slot.asset-copied::before,
.asset-slot.asset-copied::before {
  content: attr(data-copied-label);
  position: absolute;
  left: 50%;
  bottom: 0.22rem;
  z-index: 5;
  padding: 0.14rem 0.34rem;
  border: 1px solid rgba(147, 176, 110, 0.7);
  border-radius: var(--radius-sm);
  background: rgba(18, 26, 14, 0.92);
  color: var(--good);
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  transform: translateX(-50%);
}

img,
.asset-loaded,
.advisor-portrait.asset-loaded,
.scene-map-image,
.ending-asset.asset-loaded {
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic;
}

/* ---------- 18. Скроллбары (WebKit) ---------- */
.journal-list::-webkit-scrollbar,
.trade-body::-webkit-scrollbar,
.event::-webkit-scrollbar,
.notice-body::-webkit-scrollbar,
.end-screen::-webkit-scrollbar,
.stat-list::-webkit-scrollbar {
  width: 0.5rem;
}

.journal-list::-webkit-scrollbar-track,
.trade-body::-webkit-scrollbar-track,
.event::-webkit-scrollbar-track,
.notice-body::-webkit-scrollbar-track,
.end-screen::-webkit-scrollbar-track,
.stat-list::-webkit-scrollbar-track {
  background: transparent;
}

.journal-list::-webkit-scrollbar-thumb,
.trade-body::-webkit-scrollbar-thumb,
.event::-webkit-scrollbar-thumb,
.notice-body::-webkit-scrollbar-thumb,
.end-screen::-webkit-scrollbar-thumb,
.stat-list::-webkit-scrollbar-thumb {
  min-height: 3rem;
  border: 2px solid transparent;
  border-radius: 99px;
  background-color: var(--line-strong);
  background-clip: content-box;
}

.journal-list::-webkit-scrollbar-thumb:hover,
.trade-body::-webkit-scrollbar-thumb:hover,
.event::-webkit-scrollbar-thumb:hover,
.notice-body::-webkit-scrollbar-thumb:hover,
.end-screen::-webkit-scrollbar-thumb:hover,
.stat-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(200, 196, 182, 0.55);
}


/* ---------- 19. Плавность появления меню, модалок и списков ---------- */
@keyframes uiFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes uiRiseIn {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes journalTodayReturn {
  from {
    opacity: 0;
    transform: translateY(0.28rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes statValueFlash {
  0% { background: rgba(214, 196, 150, 0); }
  32% { background: rgba(214, 196, 150, 0.1); }
  100% { background: rgba(214, 196, 150, 0); }
}

@keyframes statNumberTick {
  from { transform: translateY(0.08rem); opacity: 0.62; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes uiNoticeIn {
  from {
    opacity: 0;
    transform: translateY(0.9rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes uiMenuIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Меню паузы и отдельный стартовый экран */
.game-menu-overlay:not([hidden]) .game-menu-dialog {
  animation: uiMenuIn 260ms ease-out both;
  transform-origin: center;
}

/* Модальное окно: затемнение + карточка */
.modal.show {
  animation: uiFadeIn 300ms ease-out both;
}

.modal.show .notice {
  animation: uiNoticeIn 380ms cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

/* Карточки решений: лёгкий подъём с каскадом на каждом ходу */
#choices .choice {
  animation: uiRiseIn 420ms cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

#choices .choice:nth-child(2) {
  animation-delay: 110ms;
}

#choices .choice:nth-child(3) {
  animation-delay: 220ms;
}

/* Прогноз внизу: один слитный мягкий подъём всей полосы */
.forecast-items,
.forecast-bar > .forecast-empty {
  animation: uiRiseIn 280ms ease-out both;
}

/* Свежая запись хроники */
.journal-list .log-entry:first-child {
  animation: uiRiseIn 340ms ease-out both;
}

/* Событие хода: заголовок и текст мягко проявляются */
#journalToday .event {
  animation: uiFadeIn 340ms ease-out both;
}

/* Финальный экран */
.end-screen:not(.hidden) {
  animation: uiFadeIn 460ms ease-out both;
}

/* Уважение к настройке ОС «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  .game-menu-overlay:not([hidden]) .game-menu-dialog,
  .modal.show,
  .modal.show .notice,
  #choices .choice,
  .forecast-items,
  .forecast-bar > .forecast-empty,
  .journal-list .log-entry:first-child,
  #journalToday .event,
  .end-screen:not(.hidden) {
    animation: none;
  }

  .forecast-advisor.scroll-advice .forecast-advice-text {
    animation: none;
  }

  .forecast-metrics-window.scroll-metrics .forecast-metrics-track {
    animation: none;
  }
}

/* ---------- 20. Current mechanics compatibility ----------
   The visual donor build did not include clickable panorama upgrades,
   debt endings, or iconized upgrade costs. Keep this layer small and explicit. */
.map-marker.upgrade-marker {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  min-width: 10.6rem;
  max-width: 14rem;
  color: var(--text);
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.map-marker.upgrade-marker:hover:not(:disabled),
.map-marker.upgrade-marker:focus-visible:not(:disabled) {
  color: var(--text-strong);
  border-color: rgba(232, 212, 154, 0.85);
  transform: translate(-50%, -50%) translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px rgba(211, 184, 120, 0.22),
    0 0 14px rgba(211, 184, 120, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.6);
}

.map-marker.upgrade-marker:disabled {
  cursor: not-allowed;
}

.map-marker.upgrade-marker.locked {
  color: var(--muted-2);
  border-color: rgba(214, 196, 150, 0.2);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(160deg, rgba(30, 27, 22, 0.94), rgba(15, 14, 12, 0.92));
  background-blend-mode: normal, normal;
}

.map-marker.upgrade-marker.locked .marker-emblem {
  box-shadow:
    inset 0 0 0 1px rgba(214, 196, 150, 0.14),
    inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.map-marker.upgrade-marker.locked .marker-stem {
  background: var(--muted-2);
  box-shadow: 0 0 0 2px rgba(14, 13, 11, 0.85);
}

.map-marker.upgrade-marker.ready {
  border-color: rgba(168, 196, 128, 0.75);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px rgba(147, 176, 110, 0.2),
    0 0 12px rgba(147, 176, 110, 0.3),
    0 4px 14px rgba(0, 0, 0, 0.55);
  animation: markerReadyPulse 2.2s ease-in-out infinite;
}

.map-marker.upgrade-marker.ready .marker-ring {
  background: conic-gradient(
    from -90deg,
    var(--good) calc(var(--ring, 0) * 1%),
    rgba(147, 176, 110, 0.2) 0
  );
}

.map-marker.upgrade-marker.ready .marker-stem {
  background: var(--good);
  box-shadow:
    0 0 0 2px rgba(14, 13, 11, 0.85),
    0 0 8px rgba(147, 176, 110, 0.7);
}

@keyframes markerReadyPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.55),
      inset 0 0 0 2px rgba(147, 176, 110, 0.2),
      0 0 8px rgba(147, 176, 110, 0.22),
      0 4px 14px rgba(0, 0, 0, 0.55);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.55),
      inset 0 0 0 2px rgba(147, 176, 110, 0.3),
      0 0 16px rgba(147, 176, 110, 0.42),
      0 4px 14px rgba(0, 0, 0, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-marker.upgrade-marker.ready {
    animation: none;
  }
}

.map-marker.upgrade-marker.complete {
  color: var(--good);
  border-color: rgba(147, 176, 110, 0.55);
}

.map-marker.upgrade-marker.complete .marker-pips i.filled {
  border-color: var(--good);
  background: linear-gradient(135deg, #c4d8a4, var(--good) 60%, #5f7a42);
  box-shadow: 0 0 5px rgba(147, 176, 110, 0.55);
}

.map-marker.upgrade-marker small,
.map-marker.upgrade-marker em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  line-height: 1;
}

.map-marker.upgrade-marker small {
  display: block;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.map-marker.upgrade-marker em {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
  margin-top: 0.1rem;
  padding-top: 0.16rem;
  border-top: 1px solid rgba(211, 184, 120, 0.18);
  color: var(--warn);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.map-marker.upgrade-marker.ready em {
  color: var(--good);
}

.map-marker.upgrade-marker .marker-icon {
  border: 0;
  color: currentColor;
  --icon-color: currentColor;
  --icon-filter: var(--icon-gold);
}

.map-marker.upgrade-marker.locked .marker-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-muted);
}

.map-marker.upgrade-marker.ready .marker-icon.png-icon.asset-loaded,
.map-marker.upgrade-marker.complete .marker-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-good);
}

.marker-factory.upgrade-marker {
  left: 24%;
  top: 37%;
}

.marker-settlement.upgrade-marker {
  left: 56%;
  top: 30%;
  bottom: auto;
}

.marker-rail.upgrade-marker {
  left: 84%;
  right: auto;
  top: 53%;
}

.upgrade-cost-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  min-width: 0;
  line-height: 1;
  white-space: nowrap;
}

.upgrade-cost-icon,
.upgrade-cost-icon.png-icon.asset-loaded {
  width: 0.72rem !important;
  height: 0.72rem !important;
  min-width: 0.72rem !important;
  min-height: 0.72rem !important;
  flex: 0 0 0.72rem;
  color: currentColor;
  --icon-color: currentColor;
  --icon-filter: var(--icon-gold);
}

.map-marker.upgrade-marker.ready .upgrade-cost-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-good);
}

.map-marker.upgrade-marker.locked .upgrade-cost-icon.png-icon.asset-loaded {
  --icon-filter: var(--icon-muted);
}

.upgrade-cost-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-confirm {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 160ms ease;
}

.internal-confirm.show {
  opacity: 1;
}

.internal-confirm-dialog {
  position: relative;
  width: min(32rem, calc(100vw - 3rem));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #181613;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  padding: 0;
  color: var(--text);
  overflow: hidden;
  /* Окно живёт вне .page и повторяет масштаб доски без дополнительной надбавки. */
  zoom: var(--ui-scale, 1);
}

.internal-confirm-dialog::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(214, 196, 150, 0.09);
  border-radius: 2px;
}

/* Единая, однородная шапка — как у заголовка меню и модалок-отчётов:
   текстура и градиент лежат на всём блоке, без «полос» между кикером и заголовком. */
.internal-confirm-head {
  padding: 0.85rem 1.2rem 0.82rem;
  border-bottom: 1px solid var(--line-soft);
  background:
    var(--heading-texture) center / var(--heading-texture-size) no-repeat,
    linear-gradient(180deg, rgba(214, 196, 150, 0.08), rgba(214, 196, 150, 0.025)),
    var(--panel-2);
  background-blend-mode: normal, normal, normal;
}

.internal-confirm-kicker {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.internal-confirm-dialog h2 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-heading);
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.08;
}

.internal-confirm-body {
  display: grid;
  gap: 0.82rem;
  padding: 1.05rem 1.2rem 0.4rem;
}

.internal-confirm-message {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.24;
}

.internal-confirm-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin: 0;
}

.internal-confirm-level {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin: 0;
  color: var(--text-strong);
  font-size: 1rem;
}

.internal-confirm-level-icon,
.internal-confirm-level-icon.png-icon.asset-loaded {
  width: 1.35rem !important;
  height: 1.35rem !important;
  min-width: 1.35rem !important;
  min-height: 1.35rem !important;
  --icon-filter: var(--icon-gold);
}

.internal-confirm-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.internal-confirm-ledger section {
  min-width: 0;
  padding: 0.62rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.045);
}

.internal-confirm-ledger h3 {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.internal-confirm-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.internal-confirm-cost .metric-chip,
.internal-confirm-effects .metric-chip {
  min-width: 0;
  min-height: 1.25rem;
  padding: 0.14rem 0.32rem;
  font-size: 0.84rem;
}

.internal-confirm-perturn {
  display: grid;
  gap: 0.5rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(214, 196, 150, 0.05);
}

.internal-confirm-perturn h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.perturn-mark {
  color: var(--gold);
  font-family: var(--font-display), "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
  font-size: 1rem;
  line-height: 1;
}

.internal-confirm-note {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--muted-2) !important;
  font-size: 0.9rem !important;
  line-height: 1.2 !important;
}

.internal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.85rem 1.2rem 1rem;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.1);
}

.internal-confirm-actions button {
  min-height: 2.15rem;
  padding: 0.28rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.internal-confirm-actions button:hover,
.internal-confirm-actions button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.internal-confirm-actions .confirm-primary {
  color: #ddd6c0;
  border-color: rgba(214, 196, 150, 0.55);
  background: #232016;
}

.internal-confirm-actions .confirm-primary.danger {
  color: #f2d1c2;
  border-color: rgba(178, 75, 45, 0.72);
  background: linear-gradient(180deg, rgba(100, 41, 25, 0.9), rgba(52, 23, 17, 0.96));
}

.internal-confirm-actions .confirm-primary.danger:hover,
.internal-confirm-actions .confirm-primary.danger:focus-visible {
  color: #fff0e8;
  border-color: var(--bad);
  background: linear-gradient(180deg, rgba(130, 51, 29, 0.94), rgba(65, 27, 19, 0.98));
}

.debt-warning {
  border-left: 0.14rem solid var(--bad);
  margin: 0.75rem 0 0;
  padding: 0.35rem 0.75rem;
  color: var(--text-strong);
  background: var(--bad-soft);
}

/* Focused decision report adjustments; preserve the restored theme. */
.notice:not(.story-briefing):not(.consequence-briefing) .notice-head h3 {
  font-size: 2.35rem;
  line-height: 1.1;
}
.notice-course-effects {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  vertical-align: middle;
  margin: 0.25rem 0 0.15rem 0.35rem;
}
.notice-course-effects .metric-chip {
  font-size: 0.95rem;
  line-height: 1;
}
