/* Бронзовый закат — стиль «бронза, папирус, лазурит» */
:root {
  --bg: #15100b;
  --bg-2: #1e1610;
  --panel: #2a1f15;
  --panel-2: #33261a;
  --panel-3: #3d2e20;
  --line: #57422d;
  --line-soft: #3a2c1e;
  --bronze: #c29a5b;
  --bronze-2: #e3c084;
  --bronze-3: #f4dca6;
  --text: #f0e5cb;
  --text-dim: #bcab8b;
  --text-faint: #8c7b61;
  --ok: #7cb663;
  --warn: #e0a83f;
  --danger: #d8543b;
  --info: #72a6cc;
  --lapis: #2d5c8a;
  --ink-light: #f7eed8;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --radius: 10px;
  --font-body: 'PT Serif', Georgia, 'Times New Roman', serif;
  --font-head: 'Philosopher', 'PT Serif', Georgia, serif;
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12' viewBox='0 0 24 12'%3E%3Cpath d='M0 11h4V3h8v6H8V6' fill='none' stroke='%23c29a5b' stroke-width='1.3' stroke-opacity='.55'/%3E%3Cpath d='M12 11h4V3h8v6h-4V6' fill='none' stroke='%23c29a5b' stroke-width='1.3' stroke-opacity='.55'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(160, 90, 40, .16), transparent 70%),
    radial-gradient(ellipse at top, #2b1f14 0%, var(--bg) 62%) fixed, var(--bg);
  color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 700; margin: 0; letter-spacing: 0.01em; }
button, select, input { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--bronze-2); }
:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: 2px; }
::selection { background: rgba(194, 154, 91, .4); }
* { scrollbar-width: thin; scrollbar-color: #5a4530 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #4a3826; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #6a5034; background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Иконки ---------- */
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.inl { width: 14px; height: 14px; margin-top: -2px; }
.ic.bad { color: var(--danger); }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative;
  background: linear-gradient(#3d2e1f, #2a1f15); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; color: var(--text); transition: border-color .15s, transform .05s, background .15s, box-shadow .15s;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .08), 0 1px 2px rgba(0, 0, 0, .3);
}
.btn:hover:not(:disabled) { border-color: var(--bronze); background: linear-gradient(#463523, #2f2318); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(#dcb071 0%, #b8894a 45%, #8c6330 100%); border-color: #f0d49a; color: #1d140b; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, .6), inset 0 -2px 0 rgba(60, 30, 5, .3), 0 2px 6px rgba(0, 0, 0, .35); text-shadow: 0 1px 0 rgba(255, 235, 190, .4);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(#ecc384 0%, #c99a58 45%, #9c7038 100%); box-shadow: inset 0 1px 0 rgba(255, 245, 210, .6), 0 0 14px rgba(224, 170, 90, .35), 0 2px 6px rgba(0, 0, 0, .35); }
.btn.big { padding: 11px 22px; font-size: 16px; }
.btn.big small { font-weight: 400; opacity: .8; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn.tiny.on { border-color: var(--bronze-2); color: var(--bronze-3); background: linear-gradient(#5a4128, #3a2a1a); }
.btn.danger { border-color: #8a3a2c; }
.btn.danger:hover:not(:disabled) { border-color: var(--danger); }
.icon-btn { width: 32px; padding: 5px 0; font-family: var(--font-head); font-weight: 700; }
select, input[type=text] {
  background: #1a130d; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4);
}
select:hover, input[type=text]:hover { border-color: #7a5d3e; }
kbd { background: #120d08; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; font-family: inherit; }

/* Ползунки */
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 2px 0; }
input[type=range].rng::-webkit-slider-runnable-track {
  height: 7px; border-radius: 4px; border: 1px solid #3a2c1d;
  background: linear-gradient(90deg, var(--bronze) 0 var(--p, 50%), #120d08 var(--p, 50%));
}
input[type=range].rng.hot::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--bronze) 0 var(--m, 100%), var(--danger) var(--m, 100%) var(--p), #120d08 var(--p)); }
input[type=range].rng::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0c8, #d4a862 45%, #8a5f2a); border: 1px solid #2a1a0a; box-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
input[type=range].rng::-moz-range-track { height: 7px; border-radius: 4px; background: #120d08; border: 1px solid #3a2c1d; }
input[type=range].rng::-moz-range-progress { height: 7px; border-radius: 4px; background: var(--bronze); }
input[type=range].rng::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff0c8, #d4a862 45%, #8a5f2a); border: 1px solid #2a1a0a; }

/* Медальоны держав */
.medal {
  --s: 30px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: calc(var(--s) * .5); line-height: 1; color: #fff8e6; text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--kc) 60%, #fff), var(--kc) 55%, color-mix(in srgb, var(--kc) 60%, #000));
  box-shadow: 0 0 0 2px #1a120a, 0 0 0 3.5px var(--bronze), 0 0 0 5px #1a120a, 0 3px 8px rgba(0, 0, 0, .5), inset 0 -3px 5px rgba(0, 0, 0, .3);
  vertical-align: middle;
}
.medal.xs { --s: 18px; box-shadow: 0 0 0 1.5px var(--bronze), 0 1px 3px rgba(0, 0, 0, .5); margin-right: 3px; }
.medal.sm { --s: 28px; box-shadow: 0 0 0 1.5px #1a120a, 0 0 0 2.5px var(--bronze), 0 2px 5px rgba(0, 0, 0, .5); }
.medal.lg { --s: 50px; }
.medal.xl { --s: 54px; }

/* Орнамент-разделитель */
.ornament { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--bronze); margin: 6px auto 10px; max-width: 420px; }
.ornament span { flex: 1; height: 12px; background: var(--meander) repeat-x center / auto 12px; opacity: .9; }
.ornament i { font-style: normal; font-size: 12px; }

/* ---------- Титульный экран ---------- */
#title-screen { min-height: 100vh; position: relative; overflow-x: hidden; }
.hero { position: absolute; left: 0; right: 0; top: 0; height: min(620px, 72vh); overflow: hidden; pointer-events: none; }
.hero-svg { width: 100%; height: 100%; display: block; }
.hero-svg .sil path, .hero-svg .sil rect, .hero-svg .sil circle, .hero-svg .sil ellipse { fill: #0f0906; }
.hero-svg .sil.mid2 path, .hero-svg .sil.mid2 rect { fill: #3a1a18; }
.hero-svg .stroke { fill: none !important; stroke: #0f0906; }
.hero-svg .sail { fill: #2a1410 !important; }
.hero-svg .flame { fill: #f07a2a !important; opacity: .9; animation: flicker 1.3s ease-in-out infinite alternate; transform-origin: bottom; transform-box: fill-box; }
.hero-svg .bird { stroke: #1a0e0a; }
.hero-sun { animation: sunset 30s ease-in-out infinite alternate; }
.cloud { animation: drift linear infinite alternate; }
.hero-ships { animation: sail 40s ease-in-out infinite alternate; }
@keyframes sunset { from { transform: translateY(-6px); } to { transform: translateY(26px); } }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
@keyframes sail { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes flicker { from { transform: scaleY(.85); } to { transform: scaleY(1.12); } }
.hero-svg .refl { opacity: .28; }
.hero-svg .wake { fill: none; stroke: #e89656; opacity: .35; stroke-linecap: round; }
.hero-svg .lit-gate, .hero-svg .win { animation: glowpulse 2.2s ease-in-out infinite alternate; }
.hero-svg .win { fill: #ffb45a !important; }
.hero-svg .sil .lit-gate { fill: url(#hero-gate) !important; }
.hero-svg .fire-glow { animation: glowpulse 3s ease-in-out infinite alternate; }
.hero-svg .plume { transform-origin: bottom left; transform-box: fill-box; animation: plume 9s ease-in-out infinite alternate; }
.hero-svg .plume.p2 { animation-duration: 12s; animation-delay: -4s; }
.hero-svg .ember { fill: #ffc060; opacity: 0; animation: ember 6s linear infinite; }
.hero-birds { animation: birds 50s ease-in-out infinite alternate; }
@keyframes glowpulse { from { opacity: .7; } to { opacity: 1; } }
@keyframes plume { from { transform: skewX(-2deg) scaleY(.96); } to { transform: skewX(5deg) scaleY(1.04); } }
@keyframes ember { 0% { opacity: 0; transform: translate(0, 0); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 40px), -150px); } }
@keyframes birds { from { transform: translate(0, 0); } to { transform: translate(-70px, 14px); } }
.title-wrap { position: relative; max-width: 1220px; margin: 0 auto; padding: min(160px, 17vh) 16px 48px; }
.title-head { text-align: center; margin-bottom: 30px; position: relative; }
.title-head::before { content: ''; position: absolute; inset: 40px -60px -20px; background: radial-gradient(ellipse at center, rgba(14, 9, 6, .6), transparent 70%); z-index: -1; }
.title-kicker { font-family: var(--font-head); letter-spacing: .32em; text-transform: uppercase; font-size: 13px; color: var(--bronze-3); text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, .9); }
.title-head h1 {
  font-size: clamp(44px, 7.5vw, 88px); line-height: 1.02; margin-top: 6px;
  background: linear-gradient(180deg, #fff3cf 10%, #e8c07c 45%, #a87636 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1.2px rgba(45, 22, 6, .7);
  filter: drop-shadow(0 3px 0 #1a0e06) drop-shadow(0 0 18px rgba(0, 0, 0, .55));
}
.subtitle { display: inline-block; color: var(--bronze-3); margin: 0 0 16px; padding: 2px 14px; border-radius: 20px; font-style: italic; background: rgba(16, 10, 7, .72); text-shadow: 0 1px 3px #000; backdrop-filter: blur(4px); }
.intro {
  max-width: 820px; margin: 0 auto; padding: 16px 26px; color: var(--ink-light); font-size: 16.5px; line-height: 1.6; text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  background: linear-gradient(180deg, rgba(20, 13, 9, .82), rgba(14, 9, 6, .88)); border: 1px solid rgba(194, 154, 91, .35); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 230, 180, .08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.section-title { font-size: 24px; color: var(--bronze-2); text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, .9); margin: 30px 0 18px; text-align: center; display: flex; align-items: center; gap: 16px; }
.section-title::before, .section-title::after { content: ''; flex: 1; height: 12px; background: var(--meander) repeat-x center / auto 12px; }
.kingdom-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.kcard {
  text-align: left; background: linear-gradient(170deg, var(--panel-2), var(--panel) 60%, #231a11); border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; position: relative; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.kcard::after { content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 230, 180, .05); }
.kcard:hover { transform: translateY(-3px); border-color: var(--bronze); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.kcard.selected { border-color: var(--bronze-2); box-shadow: 0 0 0 2px var(--bronze), 0 0 30px color-mix(in srgb, var(--kc) 45%, transparent), var(--shadow); transform: translateY(-3px); }
.kc-map { position: relative; height: 112px; overflow: hidden; border-bottom: 1px solid var(--line); background: #cdb68a; }
.kc-map .minimap { width: 100%; height: 100%; display: block; filter: sepia(.25) saturate(.9); transition: transform .5s; }
.kcard:hover .minimap, .kcard.selected .minimap { transform: scale(1.06); }
.kc-map::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(35, 25, 16, .75)); pointer-events: none; }
.kcard > .medal { position: absolute; left: 16px; top: 86px; z-index: 3; }
.kcard > .medal + .kc-map + .kc-body { padding-top: 30px; }
.kc-diff { position: absolute; right: 10px; top: 8px; z-index: 2; font-size: 12px; letter-spacing: 1px; color: #ffd98a; background: rgba(20, 12, 6, .7); padding: 1px 7px; border-radius: 10px; }
.kc-diff span { color: #6a5a44; }
.kc-body { padding: 10px 14px 12px; flex: 1; display: flex; flex-direction: column; }
.kcard h3 { font-size: 19px; color: var(--ink-light); }
.kc-meta { font-size: 12.5px; color: var(--bronze); font-style: italic; margin-bottom: 6px; }
.kc-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--text-dim); margin-bottom: 7px; }
.kc-stats span { display: inline-flex; align-items: center; gap: 3px; }
.kc-stats .ic { width: 14px; height: 14px; color: var(--bronze); }
.kcard p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-dim); flex: 1; }
.kcard details { font-size: 13px; color: var(--text-dim); }
.kcard summary { cursor: pointer; color: var(--bronze); }
.kcard details[open] { background: rgba(0, 0, 0, .2); border-radius: 6px; padding: 4px 8px; margin: 0 -8px; }
.title-options {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; justify-content: center; margin-top: 26px; padding: 16px 20px;
  background: linear-gradient(180deg, rgba(42, 31, 21, .8), rgba(30, 22, 16, .8)); border: 1px solid var(--line); border-radius: 12px;
}
.title-options > label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-dim); }
.seed-row { display: flex; gap: 6px; }
.seed-row input { width: 150px; }
.title-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.title-foot { text-align: center; color: var(--text-faint); font-size: 13px; font-style: italic; margin-top: 18px; }

/* ---------- Основной экран ---------- */
#game-screen { height: 100vh; display: flex; flex-direction: column; min-height: 640px; }
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 7px 16px; position: relative;
  background: linear-gradient(#2e2115, #1c140d); flex-wrap: wrap; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); z-index: 3;
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: var(--meander) repeat-x 0 0 / auto 6px, #1c140d; border-top: 1px solid var(--line); border-bottom: 1px solid #0d0906; opacity: .9; }
.brand { font-family: var(--font-head); font-size: 20px; color: var(--bronze-2); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand-sun { color: #e8a24a; display: inline-flex; filter: drop-shadow(0 0 6px rgba(232, 162, 74, .5)); }
.brand-sun svg { width: 30px; height: 22px; }
.time { min-width: 250px; }
.time-row { display: flex; align-items: baseline; gap: 10px; }
.year { font-family: var(--font-head); font-size: 23px; color: var(--ink-light); line-height: 1.1; font-weight: 700; }
.year small { font-size: 13px; color: var(--text-dim); font-weight: 400; }
.era { font-size: 12.5px; color: var(--text-dim); }
.era span:first-child { color: var(--bronze-2); }
.timeline { position: relative; display: flex; gap: 2px; height: 13px; margin-top: 4px; }
.era-seg { position: relative; height: 100%; background: #120d08; border-radius: 2px; overflow: hidden; border: 1px solid #2c2117; }
.era-seg i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ec); opacity: .85; }
.era-seg span { position: relative; display: block; font-size: 8.5px; line-height: 11px; text-align: center; color: rgba(255, 240, 210, .7); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.era-seg.now { border-color: var(--bronze); }
.era-seg.e0 { --ec: linear-gradient(90deg, #5d8a3a, #8aa84a); } .era-seg.e1 { --ec: linear-gradient(90deg, #a8983a, #d09a3a); }
.era-seg.e2 { --ec: linear-gradient(90deg, #d0782a, #c8452a); } .era-seg.e3 { --ec: linear-gradient(90deg, #a8352a, #5a2a3a); }
.tl-mark { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; background: var(--bronze-3); border-radius: 2px; box-shadow: 0 0 6px var(--bronze-2); transition: left .5s; }
.indicators { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.ind { min-width: 128px; flex: 1; max-width: 190px; font-size: 12px; color: var(--text-dim); cursor: help; display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line-soft); }
.ind .ic { width: 20px; height: 20px; color: var(--c); }
.ind.hot { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 25%, transparent); }
.ind.hot .ic { animation: pulse-op 1.8s ease-in-out infinite; }
.ind-body { flex: 1; min-width: 0; }
.ind-top { display: flex; justify-content: space-between; gap: 6px; }
.ind b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ind .bar { height: 5px; border-radius: 3px; background: #120d08; margin-top: 3px; overflow: hidden; }
.ind .bar i { display: block; height: 100%; border-radius: 3px; transition: width .5s; background: var(--c); box-shadow: 0 0 6px var(--c); }
@keyframes pulse-op { 50% { opacity: .5; } }
.top-actions { display: flex; gap: 6px; }

.layout { flex: 1; display: grid; grid-template-columns: 300px minmax(0, 1fr) 430px; gap: 0; min-height: 0; padding-top: 6px; }
.panel { background: linear-gradient(180deg, #211811, var(--bg-2)); overflow-y: auto; min-height: 0; }
.panel.left { border-right: 1px solid var(--line); padding: 14px 14px 18px; }
.panel.right { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.map-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.map-wrap {
  position: relative; flex: 1; min-height: 0; container-type: size; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #2d2115, #120d08 78%);
}
.map-wrap::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 .6 0 0 0 0 .4 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); pointer-events: none; }
#map {
  width: min(100cqw - 20px, (100cqh - 20px) * 1.5625); height: min(100cqh - 20px, (100cqw - 20px) / 1.5625); display: block; position: relative;
  border-radius: 4px; cursor: grab; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 1px #0d0906, 0 0 0 3px #8a6a3e, 0 0 0 4px #0d0906, 0 0 0 7px #3a2a1a, 0 14px 40px rgba(0, 0, 0, .7);
}
#map.dragging { cursor: grabbing; }
.map-zoom { position: absolute; right: 16px; top: 14px; display: flex; flex-direction: column; gap: 4px; z-index: 4; }
.map-zoom button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: rgba(35, 25, 16, .88); color: var(--bronze-2);
  font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); font-family: var(--font-head);
}
.map-zoom button:hover { border-color: var(--bronze); color: var(--bronze-3); }
.map-legend {
  position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11.5px; align-items: center;
  background: rgba(23, 17, 12, .82); padding: 5px 11px; border-radius: 8px; color: var(--text-dim); max-width: calc(100% - 28px);
  border: 1px solid var(--line-soft); backdrop-filter: blur(3px); z-index: 4;
}
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend svg { width: 14px; height: 14px; }
.lgd { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; }
.lgd.ok { background: #5fa044; } .lgd.warn { background: #d89420; } .lgd.danger { background: #d0432a; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 6; background: linear-gradient(170deg, rgba(48, 35, 23, .98), rgba(30, 22, 15, .98)); border: 1px solid var(--bronze);
  border-top: 3px solid var(--kc, var(--bronze)); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; width: 250px; box-shadow: var(--shadow);
}
.tip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.tip-head .medal.xs { --s: 24px; }
.map-tip h4 { font-size: 15.5px; line-height: 1.15; color: var(--ink-light); }
.tip-owner { font-size: 12px; color: var(--kc); filter: brightness(1.6) saturate(.8); font-style: italic; }
.map-tip .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 1px 0; }
.map-tip .row > span:first-child { color: var(--text-dim); }
.map-tip .row .mbar { flex: 1; max-width: 70px; }
.map-tip .note { color: var(--text-faint); font-style: italic; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line-soft); }
.forts { letter-spacing: -1px; color: var(--bronze-2); font-size: 11px; }
.forts span { color: #4a3a28; }
.mbar { display: inline-block; width: 100%; min-width: 34px; height: 5px; background: #120d08; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.mbar i { display: block; height: 100%; border-radius: 3px; }

/* ---------- SVG-карта ---------- */
.fertile path { fill: none; stroke: #9aae62; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.desert-wash ellipse { fill: #e2c07e; opacity: .45; }
.stipple { stroke: #9a7a48; stroke-width: 1.3; stroke-linecap: round; opacity: .55; fill: none; }
.dunes { fill: none; stroke: #a8854e; stroke-width: .9; opacity: .6; }
.strait { fill: none; stroke: #5d8fa2; stroke-width: 3; stroke-linecap: round; }
.waterline path { fill: none; stroke: #d6ecec; stroke-linejoin: round; }
.sea-waves { fill: none; stroke: #c7e0e2; stroke-width: .8; opacity: .45; stroke-linecap: round; }
.islands path, .islands ellipse { fill: #dcc79a; stroke: #5b4327; stroke-width: .9; }
.coast path { fill: none; stroke: #4a3520; stroke-width: 1.1; stroke-linejoin: round; }
.salt { fill: #efe6d0; stroke: #8a7a5a; stroke-width: .7; stroke-dasharray: 2 1.5; }
.rivers path { fill: none; stroke: #4c86a0; stroke-linecap: round; stroke-linejoin: round; }
.mt-shade { fill: #8c6c42; opacity: .5; }
.mt-line { fill: none; stroke: #5e4222; stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; }
.cedars { fill: #5d6e3c; stroke: #3a4424; stroke-width: .6; }
.palms { fill: none; stroke: #5d6e3c; stroke-width: .95; stroke-linecap: round; }
.geo-labels text { font-family: var(--font-head); fill: #6a4a26; fill-opacity: .6; text-anchor: middle; font-style: italic; letter-spacing: .16em; pointer-events: none; }
.geo-labels .peak-label { font-size: 8.5px; letter-spacing: .05em; fill-opacity: .75; }
.sea-labels text { font-family: var(--font-head); fill: #e4f0ee; fill-opacity: .62; font-style: italic; letter-spacing: .2em; text-anchor: middle; pointer-events: none; }
.graticule line { stroke: #6a4a26; stroke-width: .6; stroke-dasharray: 2 5; opacity: .35; }
.compass .c-ring { fill: rgba(230, 240, 236, .1); stroke: #3a2a18; stroke-width: .8; }
.compass .c-ring.thin { fill: none; stroke-dasharray: 1.5 2; }
.compass .c-dark { fill: #3a2a18; }
.compass .c-light { fill: #efe2c0; stroke: #3a2a18; stroke-width: .4; }
.compass .c-n { font-family: var(--font-head); font-size: 11px; font-weight: 700; fill: #3a2a18; text-anchor: middle; }
.cartouche rect { fill: #ecdcb4; stroke: #4a3520; stroke-width: 1; }
.cartouche rect.inner { fill: none; stroke: #8a6a3e; stroke-width: .6; }
.cartouche .ct-title { font-family: var(--font-head); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; fill: #3a2a18; text-anchor: middle; }
.cartouche .ct-sub { font-family: var(--font-body); font-size: 8px; font-style: italic; fill: #5a4228; text-anchor: middle; }
.cartouche .sb-d { fill: #3a2a18; } .cartouche .sb-l { fill: #fff8e8; stroke: #3a2a18; stroke-width: .6; }
.frame .f-out { fill: none; stroke: #2a1a0c; stroke-width: 3; }
.frame .f-in { fill: none; stroke: #2a1a0c; stroke-width: 1; }
.frame .fk-d { fill: #2a1a0c; } .frame .fk-l { fill: #efe2c0; }
.frame .f-t { font-size: 8px; fill: #4a3520; text-anchor: middle; font-family: var(--font-body); font-style: italic; }
.mm-route { stroke: #6a4a26; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .5; }

.region { cursor: pointer; outline: none; }
.region .hit { fill: transparent; }
.region .node { stroke: none; transition: r .3s; }
.region .node-rim { fill: #f4e8c8; stroke: #2a1a0c; stroke-width: 1; filter: url(#shadow); }
.region .node-rim.mine { fill: #ffe29a; stroke: #6a3a08; stroke-width: 1.4; }
.region.dark .node { opacity: .8; }
.region.dark .node-rim { fill: #b8ad9a; }
.region .town { opacity: .85; }
.region .fort-ring { fill: none; stroke: #3b2a1a; opacity: .9; }
.region:hover .node-rim, .region:focus-visible .node-rim { stroke: #fff; stroke-width: 2; }
.region .sel-ring { fill: none; stroke: #fff2c8; stroke-width: 2; stroke-dasharray: 5 3; animation: spin 6s linear infinite; }
.region .sel-glow { fill: none; stroke: #ffd98a; stroke-width: 6; opacity: .35; filter: url(#glow); }
.region-label {
  font-family: var(--font-head); font-size: 11.5px; fill: #24180c; paint-order: stroke; stroke: rgba(242, 230, 200, .9); stroke-width: 3.2px; stroke-linejoin: round;
  pointer-events: none; font-weight: 700;
}
.region-label.cap { font-size: 13px; letter-spacing: .02em; }
.region.mine .region-label { fill: #3a1e04; }
.region.dark .region-label { fill: #5a5550; font-style: italic; }
.bob { animation: bob 1.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom; }
@keyframes bob { from { transform: scale(.92); } to { transform: scale(1.08) translateY(-1px); } }
.route { pointer-events: stroke; }
.route .route-case { fill: none; stroke: rgba(40, 25, 10, .28); stroke-linecap: round; }
.route .route-line { fill: none; stroke-linecap: round; opacity: .9; }
.route-sea .route-line { stroke-dasharray: 7 5; }
.route-land .route-line { stroke-dasharray: 1.5 3.5; }
.route-land .route-case { stroke-dasharray: 1.5 3.5; }
.route-river .route-line { opacity: .75; }
.route-active.route-sea .route-line { animation: flow 1.8s linear infinite; }
.route-cut { stroke: #b12b17; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.route-tok { fill: #fff6dc; stroke: #3a2a18; stroke-width: .7; }
.route-tok.ship { fill: #3a2a18; stroke: #fff6dc; stroke-width: .5; }
.route-tok.boat { fill: #e8f2f4; }
.pressure { pointer-events: all; cursor: help; }
.pressure.calm { opacity: .45; }
.p-halo { fill: #c0391f; }
.p-halo.sea { fill: #16283a; }
.p-spear { stroke: #3a2210; stroke-width: 1.6; stroke-linecap: round; }
.p-tip { fill: #b8b0a0; stroke: #3a2210; stroke-width: .6; }
.p-shield { fill: #8a3a1c; stroke: #f0dfb8; stroke-width: 1.1; }
.p-mark { stroke: #f0dfb8; stroke-width: 1.1; }
.p-waves { fill: none; stroke: #e6f0f2; stroke-width: 1.1; stroke-linecap: round; opacity: .8; }
.p-bar-bg { fill: rgba(30, 18, 8, .6); }
.p-bar { fill: #d8543b; } .p-bar.sea { fill: #8ec0dc; }
.pressure-label { font-family: var(--font-head); font-size: 10.5px; text-anchor: middle; fill: #4a2410; font-weight: 700; paint-order: stroke; stroke: rgba(242, 230, 200, .85); stroke-width: 3px; font-style: italic; }
.pressure-label.sea { fill: #10263a; }
.pulse { animation: pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.fleet { cursor: help; }
.ship-mast { stroke: #1c1008; stroke-width: 1; fill: none; }
.ship-sail { fill: #efe4c8; stroke: #1c1008; stroke-width: .6; }
.ship-brail { stroke: #9a3a1c; stroke-width: .8; fill: none; }
.ship-hull { fill: #2a1a0c; stroke: #0e0804; stroke-width: .5; }
.ship-oars { stroke: #2a1a0c; stroke-width: .9; }
.fleet-wake { fill: rgba(230, 245, 245, .35); }
.bob-ship { animation: rock 2.6s ease-in-out infinite alternate; transform-origin: 0 4px; }
@keyframes rock { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(1.5px); } }
.fleet-badge { fill: #a3281a; stroke: #fff2d6; stroke-width: 1.2; }
.fleet-str { font-family: var(--font-body); font-size: 9px; text-anchor: middle; fill: #fff; font-weight: 700; }
.fleet-intent { fill: none; stroke: #9e2a17; stroke-width: 1.4; stroke-dasharray: 5 4; opacity: .8; animation: flow 1.2s linear infinite; }
.marker .burst { stroke-width: 1; transform-origin: center; transform-box: fill-box; animation: burst-in .6s ease-out; }
.marker .burst.won { fill: rgba(95, 160, 68, .5); stroke: #2f6a1c; }
.marker .burst.lost { fill: rgba(216, 84, 59, .55); stroke: #7a1a0a; }
.marker .burst-ring { fill: none; stroke-width: 2.2; animation: burst 1.8s ease-out 3; transform-origin: center; transform-box: fill-box; }
.marker .burst-ring.won { stroke: #3f8a2c; } .marker .burst-ring.lost { stroke: #c0391f; }
.layer-markers .marker { pointer-events: none; }
.layer-markers .marker.has-battle { pointer-events: all; cursor: pointer; }
.ripple { fill: none; stroke: #7a3b12; stroke-width: 2; animation: ripple 1.8s ease-out 3; transform-origin: center; transform-box: fill-box; }
.ripple.r2 { animation-delay: .5s; } .ripple.r3 { animation-delay: 1s; }
.quake-crack { fill: none; stroke: #4a1a06; stroke-width: 1.6; stroke-linejoin: round; }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes spin { to { stroke-dashoffset: -40; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes burst { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes burst-in { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
@keyframes ripple { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(4.5); opacity: 0; } }

/* Лента */
.feed { height: 124px; overflow-y: auto; border-top: 1px solid var(--line); background: linear-gradient(#1c150e, #16100a); padding: 6px 12px; font-size: 13px; }
.feed .entry { display: flex; gap: 7px; align-items: baseline; padding: 2px 0; color: var(--text-dim); border-bottom: 1px dashed rgba(90, 69, 48, .25); }
.feed .entry .t-ic { width: 13px; height: 13px; align-self: center; opacity: .8; }
.feed .entry .yr { font-family: var(--font-head); color: var(--bronze); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 32px; }
.feed .entry.mine { color: var(--text); }
.feed .entry[data-battle]:hover { background: rgba(194, 154, 91, .08); }
.t-disaster .t-ic { color: var(--danger); } .t-collapse .t-ic { color: #ff8a70; } .t-good .t-ic { color: var(--ok); }
.t-war .t-ic { color: var(--warn); } .t-trade .t-ic { color: var(--info); } .t-info .t-ic { color: var(--bronze); }

/* ---------- Левая панель ---------- */
.k-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; padding-left: 4px; }
.k-title { min-width: 0; }
.k-head h2 { font-size: 19px; line-height: 1.15; color: var(--ink-light); }
.k-sub { font-size: 12.5px; color: var(--bronze); font-style: italic; }
.k-status { display: inline-block; font-size: 11.5px; padding: 0 9px; border-radius: 10px; margin-top: 3px; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent); }
.st-ok { color: var(--ok); } .st-warn { color: var(--warn); } .st-bad { color: var(--danger); } .st-dead { color: var(--text-faint); }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 12px; }
.res {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 7px;
  padding: 6px 8px 7px; border-radius: 8px; cursor: help; background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); overflow: hidden;
}
.res:hover { border-color: var(--line); }
.res .ico { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .25); color: var(--bronze-2); box-shadow: inset 0 0 0 1px rgba(194, 154, 91, .25); }
.res .ico .ic { width: 17px; height: 17px; }
.r-grain .ico { color: #e2b54a; } .r-silver .ico { color: #d8dde0; } .r-bronze .ico { color: #d0874a; } .r-copper .ico { color: #d67a4a; } .r-tin .ico { color: #b8c4c8; } .r-people .ico { color: #e8d4a8; }
.res .nm { color: var(--text-dim); font-size: 11.5px; grid-column: 2; grid-row: 1; line-height: 1.1; }
.res .val { font-weight: 700; font-variant-numeric: tabular-nums; grid-column: 2 / 4; grid-row: 2; font-size: 15px; white-space: nowrap; line-height: 1.2; }
.res .val small { font-weight: 400; font-size: 11px; color: var(--text-faint); }
.res .dl { grid-column: 3; grid-row: 1; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.res-bar { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px; background: rgba(0, 0, 0, .4); border-radius: 2px; overflow: hidden; }
.res-bar i { display: block; height: 100%; background: var(--bronze); }
.res-bar.grain i { background: #e2b54a; } .res-bar.pop i { background: var(--ok); } .res-bar.bronze i { background: #d0874a; }
.up { color: var(--ok); } .down { color: var(--danger); } .flat { color: var(--text-faint); }
.meters { display: grid; gap: 7px; margin-bottom: 4px; }
.meter { cursor: help; }
.meter .lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.meter .lbl .ic { width: 15px; height: 15px; color: var(--bronze); }
.meter .lbl span { flex: 1; }
.meter .lbl b { color: var(--text); font-variant-numeric: tabular-nums; }
.meter .bar { position: relative; height: 9px; background: #120d08; border-radius: 5px; overflow: hidden; margin-top: 3px; border: 1px solid #3a2c1d; }
.meter .bar i { display: block; height: 100%; transition: width .5s; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%); border-radius: 4px; }
.meter .bar em { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 240, 210, .35); }
.sec-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 13.5px; color: var(--bronze-2); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .1em; }
.sec-title::after { content: ''; flex: 1; height: 8px; background: var(--meander) repeat-x left center / auto 8px; opacity: .7; }
.alerts { display: grid; gap: 6px; }
.alert { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 7px 9px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--info); }
.alert .ic { width: 16px; height: 16px; color: var(--info); margin-top: 1px; }
.alert.warn { border-left-color: var(--warn); } .alert.warn .ic { color: var(--warn); }
.alert.bad { border-left-color: var(--danger); background: linear-gradient(90deg, #3a1a10, var(--panel)); } .alert.bad .ic { color: var(--danger); }
.alert.good { border-left-color: var(--ok); } .alert.good .ic { color: var(--ok); }
.army-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; font-size: 12.5px; }
.army { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line-soft); }
.army .ic { width: 16px; height: 16px; color: var(--bronze); }
.army span { color: var(--text-dim); flex: 1; }
.army b { font-variant-numeric: tabular-nums; }
.army small { color: #e08a8a; font-weight: 400; }
.power-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-dim); margin-top: 6px; padding: 0 2px; }
.power-row span { display: inline-flex; align-items: center; gap: 4px; }
.power-row .ic { width: 14px; height: 14px; color: var(--bronze); }
.power-row b { color: var(--bronze-3); }

/* ---------- Правая панель ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); background: #1c140d; }
.tabs button {
  display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid transparent; border-bottom: none; padding: 6px 9px; border-radius: 8px 8px 0 0;
  cursor: pointer; color: var(--text-dim); font-size: 13.5px; transition: color .15s, background .15s;
}
.tabs button .ic { width: 15px; height: 15px; opacity: .8; }
.tabs button.active { background: linear-gradient(#2c2116, #221912); border-color: var(--line); color: var(--bronze-3); position: relative; top: 1px; box-shadow: inset 0 2px 0 var(--bronze); }
.tabs button.active .ic { color: var(--bronze-2); opacity: 1; }
.tabs button:hover { color: var(--text); background: rgba(194, 154, 91, .06); }
.tab-body { flex: 1; overflow-y: auto; padding: 12px 14px 16px; min-height: 0; background: linear-gradient(#221912, transparent 120px); }
.endturn-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: linear-gradient(#241a11, #17110b); }
.points { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.points b { color: var(--bronze-3); font-variant-numeric: tabular-nums; }
.coins { display: inline-flex; gap: 4px; }
.coin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle;
  background: radial-gradient(circle at 35% 30%, #fff2c6, #e0b060 40%, #9a6a28 90%); box-shadow: 0 0 0 1px #3a2408, inset 0 -1.5px 0 rgba(80, 40, 5, .5), 0 0 6px rgba(240, 190, 90, .35);
}
.coin.used { background: radial-gradient(circle at 35% 30%, #4a3a28, #2a2016); box-shadow: 0 0 0 1px #3a2c1d, inset 0 1px 2px rgba(0, 0, 0, .6); }
.coin.sm { width: 11px; height: 11px; box-shadow: 0 0 0 1px #3a2408, inset 0 -1px 0 rgba(80, 40, 5, .5); }
.points.spent .coins { animation: jingle .45s ease-out; }
@keyframes jingle { 30% { transform: translateY(-3px); } 60% { transform: translateY(1px); } }
.btn.endturn kbd { background: rgba(0, 0, 0, .15); border-color: rgba(60, 30, 5, .4); color: #2a1a08; }
.btn.endturn.ready { animation: ready-glow 2.2s ease-in-out infinite; }
@keyframes ready-glow { 50% { box-shadow: inset 0 1px 0 rgba(255, 245, 210, .6), 0 0 22px rgba(240, 180, 90, .75), 0 2px 6px rgba(0, 0, 0, .35); } }

.policy { background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 4px; margin-bottom: 14px; box-shadow: inset 0 1px 0 rgba(255, 230, 180, .05); }
.policy-head { display: flex; align-items: center; gap: 7px; font-family: var(--font-head); color: var(--bronze-2); font-size: 14px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.policy .row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin-bottom: 10px; }
.policy .row label { font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.policy .row label .ic { width: 15px; height: 15px; color: var(--bronze); }
.policy .row output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bronze-3); font-family: var(--font-head); font-size: 15px; }
.policy .row .hint { grid-column: 1 / -1; font-size: 12px; color: var(--text-faint); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #1a130d; }
.seg button { background: none; border: none; padding: 4px 10px; cursor: pointer; color: var(--text-dim); font-size: 13px; }
.seg button.on { background: linear-gradient(#dcb071, #a87a3e); color: #1d140b; font-weight: 700; }
.policy-head { width: 100%; background: none; border: none; border-bottom: 1px solid var(--line-soft); cursor: pointer; text-align: left; }
.policy:not(.open) { padding-bottom: 0; }
.policy:not(.open) .policy-head { border-bottom: none; margin-bottom: 0; padding: 0 0 9px; }
.policy-head:hover { color: var(--bronze-3); }
.policy-head .ic { flex-shrink: 0; }
.policy-head .pol-chev { width: 14px; height: 14px; margin-left: auto; color: var(--text-faint); transform: rotate(90deg); transition: transform .2s; }
.policy.open .pol-chev { transform: rotate(-90deg); }
.policy-head > span:first-of-type { white-space: nowrap; }
.pol-sum { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; margin-left: 4px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.pol-sum i { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 12px; color: var(--text-dim); background: #1a130d; border: 1px solid var(--line-soft); border-radius: 20px; padding: 1px 7px 1px 5px; white-space: nowrap; }
.pol-sum i .ic { width: 12px; height: 12px; color: var(--bronze); }
.pol-sum i.hot { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* Печати групп указов */
.seals { display: flex; align-items: center; justify-content: space-between; gap: 3px; margin: 2px 0 10px; padding: 4px 5px 0 2px; }
.seal-sep { width: 1px; align-self: stretch; margin: 6px 1px; background: var(--line); }
.seal {
  position: relative; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; color: var(--gc);
  background: radial-gradient(circle at 35% 30%, #3d2e20, #1d150e 75%); border: 1.5px solid color-mix(in srgb, var(--gc) 40%, #3a2c1e);
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .08), inset 0 -3px 6px rgba(0, 0, 0, .35), 0 2px 4px rgba(0, 0, 0, .35); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.seal .ic { width: 18px; height: 18px; }
.seal b {
  position: absolute; right: -4px; top: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font: 700 10.5px/17px var(--font-body); text-align: center;
  background: var(--gc); color: #1a120a; box-shadow: 0 0 0 2px #1c140d;
}
.seal.empty { color: var(--text-faint); border-color: var(--line-soft); }
.seal.empty b { background: #3a2c1e; color: var(--text-faint); }
.seal:hover { transform: translateY(-2px); border-color: var(--gc); }
.seal.on {
  color: #1a120a; border-color: var(--gc); transform: translateY(-1px);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--gc) 60%, #fff4d8), var(--gc) 55%, color-mix(in srgb, var(--gc) 55%, #1a120a));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 22%, transparent), 0 0 16px color-mix(in srgb, var(--gc) 45%, transparent), inset 0 -3px 5px rgba(0, 0, 0, .25);
}
.seal.on b { background: #1c140d; color: var(--gc); box-shadow: 0 0 0 2px var(--gc); }
.seal:focus-visible { outline: 2px solid var(--bronze-3); outline-offset: 3px; }

.dhead { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gc); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 7px; }
.dhead .ic { width: 16px; height: 16px; }
.dhead::after { content: ''; order: 2; flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 50%, transparent), transparent); }
.dhead em { order: 3; font-style: normal; font-size: 11px; color: var(--text-faint); letter-spacing: 0; text-transform: none; }
.dhead .keys { order: 4; display: inline-flex; gap: 2px; opacity: .7; }
.dhead kbd { font-size: 10px; padding: 0 4px; }
.dempty { display: flex; gap: 8px; align-items: flex-start; padding: 14px 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--text-dim); font-size: 13px; }
.dempty .ic { color: var(--bronze); }

/* Плитки указов */
.price { display: inline-flex; align-items: center; gap: 1px; margin-left: 5px; color: var(--text-dim); }
.price .ic { width: 13px; height: 13px; color: var(--bronze); }
.dlist { display: flex; flex-direction: column; gap: 5px; }
.dtile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 8px; padding-right: 6px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); border-left: 3px solid var(--gc); border-radius: 8px; transition: border-color .15s, box-shadow .15s;
  animation: tile-in .22s ease-out backwards;
}
.dlist .dtile:nth-child(2) { animation-delay: .02s; } .dlist .dtile:nth-child(3) { animation-delay: .04s; } .dlist .dtile:nth-child(4) { animation-delay: .06s; }
.dlist .dtile:nth-child(5) { animation-delay: .08s; } .dlist .dtile:nth-child(n+6) { animation-delay: .1s; }
@keyframes tile-in { from { opacity: 0; transform: translateY(4px); } }
.dtile:hover { border-color: var(--line); border-left-color: var(--gc); }
.dtile.open { border-color: color-mix(in srgb, var(--gc) 45%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gc) 15%, transparent), 0 6px 18px rgba(0, 0, 0, .3); animation: none; }
.dtile.off { border-left-color: #4a3a28; }
.dtile.off .dt-nm, .dtile.off .cost { opacity: .6; }
.dt-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 6px; align-items: center; background: none; border: none; padding: 7px 0 7px 10px; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.dt-head:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: -2px; border-radius: 6px; }
.dt-nm { grid-column: 2; font-weight: 700; font-size: 13.5px; }
.dt-sub { grid-column: 2; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtile.off .dt-sub { color: color-mix(in srgb, var(--warn) 75%, var(--text-faint)); }
.dtile.open .dt-sub { display: none; }
.dt-lock { grid-row: 1 / 3; width: 13px; height: 13px; color: var(--text-faint); }
.dtile .cost { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--bronze-2); white-space: nowrap; }
.dt-go { padding: 3px 8px; }
.dt-chev { background: none; border: none; cursor: pointer; color: var(--text-faint); padding: 4px; display: grid; }
.dt-chev .ic { width: 14px; height: 14px; transition: transform .2s; }
.dtile.open .dt-chev .ic { transform: rotate(90deg); color: var(--gc); }
.dt-body { grid-column: 1 / -1; padding: 0 6px 10px 10px; animation: tile-in .2s ease-out; }
.dt-body p { margin: 0 0 8px; font-size: 12.5px; color: var(--text-dim); }
.dt-body .why { display: flex; gap: 5px; align-items: flex-start; font-size: 12px; color: var(--warn); }
.dt-body .why .ic { width: 13px; height: 13px; margin-top: 2px; }
.dt-issue { width: 100%; justify-content: center; display: flex; align-items: center; gap: 6px; }
.dt-issue .ic { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px 3px 5px; border-radius: 20px; cursor: pointer; font-size: 12.5px; color: var(--text-dim);
  background: #1a130d; border: 1px solid var(--line); transition: border-color .12s, background .12s, color .12s;
}
.chip:not([style]) { padding-left: 9px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .ic { width: 12px; height: 12px; flex-shrink: 0; }
.chip:hover:not(:disabled) { border-color: var(--gc); color: var(--text); }
.chip.sel { background: color-mix(in srgb, var(--gc) 22%, #1a130d); border-color: var(--gc); color: var(--ink-light); box-shadow: 0 0 8px color-mix(in srgb, var(--gc) 30%, transparent); }
.chip:disabled { cursor: not-allowed; opacity: .5; border-style: dashed; }
.dlist.grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; }
.dlist.grid .dtile { grid-column: 1 / -1; }
.dmini {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 7px 6px 8px; cursor: pointer; text-align: left; color: var(--text); font-size: 12.5px; line-height: 1.2;
  background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); border-left: 3px solid var(--gc); border-radius: 8px;
  transition: border-color .15s, transform .15s; animation: tile-in .22s ease-out backwards;
}
.dmini > .ic { width: 14px; height: 14px; color: var(--gc); flex-shrink: 0; }
.dmini span { flex: 1; min-width: 0; }
.dmini em { display: inline-flex; gap: 2px; flex-shrink: 0; }
.dmini:hover { border-color: var(--line); border-left-color: var(--gc); transform: translateY(-1px); }
.dmini:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .dtile, .dt-body, .dmini { animation: none; } .seal, .seal:hover { transition: none; transform: none; } }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 400; color: var(--text-faint); font-size: 12px; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 5px 4px; border-bottom: 1px solid #33271b; vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover td { background: rgba(194, 154, 91, .05); }
.tbl tr.me td { background: rgba(194, 154, 91, .1); }
.tbl tr.dead td { color: var(--text-faint); }
.tbl .num { text-align: right; }
.tbl.realm td:nth-child(4), .tbl.realm td:nth-child(5) { width: 54px; }
.capmark { color: var(--bronze-2); }
.region-card { margin-top: 14px; padding: 12px; border-radius: 10px; background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-top: 3px solid var(--kc); }
.rc-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.rc-head h3 { font-size: 17px; color: var(--ink-light); }
.relbar { width: 70px; height: 7px; background: #120d08; border-radius: 4px; position: relative; display: inline-block; vertical-align: middle; }
.relbar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.relbar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--text-faint); }
.dcards { display: grid; gap: 8px; }
.dcard { padding: 8px 10px; border-radius: 9px; background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); border-left: 3px solid var(--kc); }
.dcard.me { background: linear-gradient(170deg, #3d2e1c, var(--panel)); border-color: var(--line); border-left-color: var(--kc); }
.dcard.dead { opacity: .5; filter: grayscale(.7); }
.dc-head { display: flex; align-items: center; gap: 10px; }
.dc-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 88px; }
.dc-name span { font-size: 11.5px; }
.dc-flags { display: flex; gap: 3px; flex: 1; }
.treaty { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(114, 166, 204, .15); color: var(--info); cursor: help; }
.treaty .ic { width: 14px; height: 14px; }
.treaty.war { background: rgba(216, 84, 59, .18); color: var(--danger); }
.dc-rel { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dc-rel b { min-width: 26px; text-align: right; }
.dc-rel small { color: var(--text-faint); display: inline-flex; align-items: center; gap: 2px; }
.qa { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line-soft); }
.trade-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.trade-top > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 9px; background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); }
.trade-top .ic { width: 22px; height: 22px; color: var(--bronze-2); }
.trade-top b { font-size: 18px; font-family: var(--font-head); }
.trade-top span { font-size: 11.5px; color: var(--text-faint); }
.ledger-row { font-size: 12.5px; color: var(--text-dim); padding: 1px 0; }
.chron-filter { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.chron { position: relative; }
.chron-year { font-family: var(--font-head); color: var(--bronze-2); margin: 12px 0 5px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.chron-year::before { content: ''; width: 9px; height: 9px; transform: rotate(45deg); background: var(--bronze); box-shadow: 0 0 0 2px #1e1610, 0 0 0 3px var(--line); }
.chron-year::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.chron-entry { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; padding: 4px 6px 4px 8px; border-left: 2px solid var(--line); margin: 0 0 3px 3px; border-radius: 0 6px 6px 0; }
.chron-entry .t-ic { width: 14px; height: 14px; margin-top: 2px; }
.chron-entry.t-disaster { border-left-color: var(--danger); }
.chron-entry.t-collapse { border-left-color: #ff8a70; background: linear-gradient(90deg, rgba(216, 84, 59, .2), transparent); font-weight: 700; }
.chron-entry.t-good { border-left-color: var(--ok); }
.chron-entry.t-war { border-left-color: var(--warn); }
.chron-entry.t-trade { border-left-color: var(--info); }
.chron-entry .who { font-size: 12px; font-weight: 700; filter: brightness(1.45) saturate(.8); }
.chart { background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 10px 6px; margin-bottom: 12px; }
.chart h4 { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin-bottom: 2px; color: var(--bronze-3); }
.chart h4 .ic { width: 15px; height: 15px; color: var(--bronze); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.chart .legend i { display: inline-block; width: 11px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.chart .legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.axis { stroke: #4a3a28; stroke-width: 1; }
.axis-t { fill: var(--text-faint); font-size: 9.5px; }
.era-band { opacity: .07; } .era-band.e0 { fill: #8aa84a; } .era-band.e1 { fill: #d09a3a; } .era-band.e2 { fill: #d8543b; } .era-band.e3 { fill: #8a3a5a; }
.era-band.e1, .era-band.e3 { opacity: .1; }
.era-t { fill: var(--text-faint); font-size: 8.5px; text-anchor: middle; letter-spacing: .08em; text-transform: uppercase; font-family: var(--font-head); }
.ency-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.ency-list button { font-size: 12.5px; }
.article { padding: 14px 16px; border-radius: 10px; background: linear-gradient(170deg, #efe2c0, #e2cf9e); color: #2e2010; box-shadow: inset 0 0 30px rgba(120, 80, 30, .25), 0 3px 10px rgba(0, 0, 0, .4); }
.article h3 { display: flex; align-items: center; gap: 8px; font-size: 19px; color: #5a3410; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(90, 52, 16, .3); }
.article h3 .ic { color: #8a5a20; }
.article p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; }
.article p:first-of-type::first-letter { font-family: var(--font-head); font-size: 2.6em; float: left; line-height: .85; margin: 4px 6px 0 0; color: #8a3a10; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 13.5px; }
.kv span { color: var(--text-dim); } .kv b { font-variant-numeric: tabular-nums; text-align: right; }
.kv b.bad { color: var(--danger); }
.muted { color: var(--text-faint); font-size: 12.5px; }

/* ---------- Модальные окна ---------- */
.modal { position: fixed; inset: 0; background: radial-gradient(ellipse at center, rgba(20, 12, 5, .6), rgba(5, 3, 1, .85)); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative; background: linear-gradient(170deg, #3b2c1d, #261b11 60%, #20170f); border: 1px solid var(--bronze); border-radius: 14px;
  box-shadow: var(--shadow), 0 0 0 4px rgba(194, 154, 91, .1), 0 0 0 5px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 230, 180, .1);
  width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; animation: rise .3s cubic-bezier(.2, .8, .3, 1.1);
}
.modal-card.wide { width: min(920px, 100%); }
@keyframes rise { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ev-scene { position: relative; margin: -22px -24px 14px; height: 170px; overflow: hidden; border-radius: 13px 13px 0 0; border-bottom: 1px solid var(--bronze); }
.ev-scene.short { height: 120px; }
.ev-scene.tall { height: 200px; }
.ev-scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(38, 27, 17, .9)); pointer-events: none; }
.ev-scene .ev-kicker { position: absolute; left: 24px; bottom: 10px; z-index: 2; text-shadow: 0 1px 4px #000; color: var(--bronze-3); }
.scene { width: 100%; height: 100%; display: block; }
.scene .sil path, .scene .sil rect, .scene .sil circle, .scene .sil ellipse { fill: #140b06; }
.scene .sil.mid path, .scene .sil.mid rect { fill: #140b06; opacity: .72; }
.scene .sil.far-ships path, .scene .sil.far-ships rect { fill: #140b06; opacity: .8; }
.scene .stroke { fill: none !important; stroke: #140b06; }
.scene .sail { fill: #2a1a10 !important; }
.scene .lit { fill: #fff0c8 !important; opacity: .08 !important; }
.scene .sun { fill: #ffe8b0; }
.scene .ground { fill: #140b06; }
.scene .crack { fill: none; stroke: #f0a050; stroke-width: 1.4; opacity: .7; stroke-linejoin: round; }
.scene .flame { fill: #f07a2a !important; opacity: .95 !important; animation: flicker 1.1s ease-in-out infinite alternate; transform-origin: bottom; transform-box: fill-box; }
.scene .smoke, .hero-svg .smoke { animation: smoke 6s ease-in-out infinite alternate; transform-origin: bottom; transform-box: fill-box; }
.scene .scene-vig { fill: none; }
.star { fill: #fff6dc; animation: twinkle 3s ease-in-out infinite; }
.shimmer { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .25; } }
@keyframes smoke { from { transform: scaleX(.9) skewX(-3deg); } to { transform: scaleX(1.1) skewX(4deg); } }
.ev-kicker { font-size: 12px; color: var(--bronze); text-transform: uppercase; letter-spacing: .14em; font-family: var(--font-head); }
.modal-card h2 { font-size: 27px; color: var(--ink-light); margin: 4px 0 12px; }
.ev-text { font-size: 16px; line-height: 1.55; margin: 0 0 16px; padding: 12px 16px; background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .1)); border-left: 3px solid var(--bronze); border-radius: 6px; font-style: italic; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; padding: 10px 14px 10px 50px; display: block; width: 100%; }
.choice .num { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-size: 12px; font-weight: 700; color: var(--bronze-2); border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.choice:hover:not(:disabled) .num { border-color: var(--bronze-2); color: var(--bronze-3); }
.choice .lbl { font-weight: 700; font-size: 15px; display: block; }
.choice .hint { font-size: 12.5px; color: var(--text-dim); display: block; margin-top: 2px; }
.choice .req { font-size: 12px; color: var(--warn); }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.sum-cell { position: relative; background: rgba(0, 0, 0, .22); border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 10px 8px 40px; }
.sum-cell .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--bronze); }
.sum-cell .t { font-size: 12px; color: var(--text-dim); }
.sum-cell .v { font-size: 19px; font-weight: 700; font-family: var(--font-head); }
.sum-cell small { font-size: 12.5px; font-family: var(--font-body); }
.sum-list { max-height: 300px; overflow-y: auto; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.modal-actions .pending { align-self: center; display: inline-flex; align-items: center; gap: 5px; }
.end-title { font-size: 42px !important; text-align: center; margin-bottom: 0 !important; background: linear-gradient(180deg, #fff3cf, #d8a860); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.modal-card .chart svg { max-height: 210px; }
.end-score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.end-score > div { text-align: center; padding: 8px; border-radius: 9px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line-soft); }
.end-score b { display: block; font-family: var(--font-head); font-size: 22px; color: var(--bronze-3); }
.end-score span { font-size: 12px; color: var(--text-faint); }
.fates td { font-size: 12.5px; }
.menu-head { display: flex; gap: 16px; align-items: center; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: linear-gradient(#3a2b1c, #2a1f15); border: 1px solid var(--bronze);
  padding: 9px 16px; border-radius: 9px; z-index: 60; box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); font-size: 14px;
  display: flex; gap: 8px; align-items: center; animation: toast-in .25s ease-out;
}
.toast .ic { color: var(--bronze-2); }
.toast.bad { border-color: var(--danger); } .toast.bad .ic { color: var(--danger); }
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } }
.help h3 { display: flex; align-items: center; gap: 7px; color: var(--bronze-2); font-size: 16px; margin: 12px 0 4px; }
.help h3 .ic { width: 17px; height: 17px; }
.help p, .help li { font-size: 14px; }
.help ul { padding-left: 20px; margin: 4px 0; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }

/* ---------- Разбор боя ---------- */
.battle { background: rgba(0, 0, 0, .22); border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; }
.battle.win { border-left: 4px solid var(--ok); } .battle.loss { border-left: 4px solid var(--danger); } .battle.neutral { border-left: 4px solid var(--info); }
.battle > summary { cursor: pointer; list-style: none; }
.battle > summary::-webkit-details-marker { display: none; }
.battle .b-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.battle .b-title { font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.battle .b-title .ic { width: 16px; height: 16px; color: var(--bronze); }
.battle .b-res { font-size: 13px; font-weight: 700; }
.battle .b-res.win { color: var(--ok); } .battle .b-res.loss { color: var(--danger); }
.battle .b-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.battle .b-more { font-size: 12px; color: var(--bronze); }
.b-vs { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; margin: 8px 0 4px; font-size: 12.5px; }
.b-vs .bar { height: 10px; background: #120d08; border-radius: 5px; overflow: hidden; }
.b-vs .bar i { display: block; height: 100%; border-radius: 5px; }
.b-vs .who { grid-column: 1 / -1; color: var(--text-dim); margin-top: 4px; }
.b-vs b { font-variant-numeric: tabular-nums; }
.b-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.b-cols h5 { display: flex; align-items: center; gap: 5px; font-size: 13px; margin: 0 0 4px; color: var(--bronze-2); }
.b-cols h5 .ic { width: 14px; height: 14px; }
.b-parts { font-size: 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.b-parts span { color: var(--text-dim); } .b-parts b { font-variant-numeric: tabular-nums; text-align: right; }
.b-parts .neg { color: var(--danger); }
.b-parts .tot { border-top: 1px solid var(--line); padding-top: 2px; color: var(--text); }
.b-list { margin: 4px 0 6px; padding-left: 18px; font-size: 13px; }
.b-list li { margin-bottom: 2px; }
.b-h { font-family: var(--font-head); font-size: 13px; color: var(--bronze-2); margin-top: 6px; }
.chron-entry .blink { margin-left: 6px; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1400px) {
  .layout { grid-template-columns: 272px minmax(0, 1fr) 390px; }
  .indicators .ind { min-width: 112px; }
  .brand > span:last-child { display: none; }
}
@media (max-width: 1020px) {
  #game-screen { height: auto; min-height: 100vh; }
  .layout { grid-template-columns: 1fr; }
  .map-wrap { height: 66vw; min-height: 260px; flex: none; }
  .panel.left, .panel.right { border: none; border-top: 1px solid var(--line); }
  .panel.right { min-height: 520px; order: 3; }
  .map-col { order: 1; }
  .panel.left { order: 2; }
  .endturn-bar { position: sticky; bottom: 0; z-index: 4; }
  .indicators { flex-basis: 100%; }
  .ind { max-width: none; }
  .tab-body { max-height: none; }
  .brand { display: none; }
  .res-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 16px; gap: 10px; }
  .time { min-width: 0; flex: 1; }
  .ind { min-width: calc(50% - 8px); }
  .map-legend { display: none; }
  .map-zoom { right: 10px; top: 10px; }
  .res-grid { grid-template-columns: 1fr 1fr; }
  .modal-card { padding: 16px; }
  .ev-scene { margin: -16px -16px 12px; height: 130px; }
  .ev-scene .ev-kicker { left: 16px; }
  .modal-card h2 { font-size: 21px; }
  .b-cols, .help-grid { grid-template-columns: 1fr; }
  .end-score { grid-template-columns: 1fr 1fr; }
  .tabs button span { display: none; }
  .tabs button { padding: 7px 11px; }
  .title-wrap { padding-top: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
