/* «Холодная война» — интерфейс в духе grand-strategy: тёмная рама, бронза, бумага */
:root {
  --bg: #16181b;
  --panel: #1e1d1b;
  --panel2: #262421;
  --panel3: #2e2b27;
  --line: #3d3934;
  --line2: #5a5046;
  --bronze: #a8844a;
  --bronze2: #d9b46a;
  --gold: #f1d48a;
  --text: #d8d2c4;
  --dim: #948c7e;
  --faint: #6c665c;
  --red: #c8402e;
  --red2: #e2644c;
  --blue: #4a72c4;
  --blue2: #7aa0ea;
  --green: #5d9b4f;
  --green2: #8ccf6c;
  --amber: #d8a13a;
  --paper: #e9e0c9;
  --ink: #221d16;
  --sea: #3a4550;
  --f-ui: 'PT Sans Narrow', 'Arial Narrow', sans-serif;
  --f-head: 'Oswald', 'PT Sans Narrow', sans-serif;
  --f-serif: 'PT Serif', Georgia, serif;
  --f-old: 'Old Standard TT', 'PT Serif', serif;
  --shadow: 0 6px 24px rgba(0, 0, 0, .55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--f-ui); font-size: 15px; user-select: none; }
button { font-family: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #151412; }
::-webkit-scrollbar-thumb { background: #4a443c; border-radius: 4px; border: 1px solid #151412; }
.hidden { display: none !important; }
svg.ic { width: 1em; height: 1em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.fill { fill: currentColor; stroke: none; }

/* ---------- карта ---------- */
#map { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: grab; background: var(--sea); }
#map.drag { cursor: grabbing; }
body.ingame::before, body.ingame::after { content: ''; position: fixed; left: 0; right: 0; pointer-events: none; z-index: 12; }
body.ingame::before { top: 0; height: 90px; background: linear-gradient(rgba(10,9,8,.55), rgba(10,9,8,0)); }
body.ingame::after { bottom: 0; height: 150px; background: linear-gradient(rgba(10,9,8,0), rgba(10,9,8,.62) 70%, rgba(10,9,8,.78)); }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 55%, rgba(0,0,0,.45) 100%); }

/* ---------- металлические элементы ---------- */
.metal { background: linear-gradient(#3b3732, #24211e 55%, #1b1917); border: 1px solid #55493b; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.6); }
.plate { background: linear-gradient(#2a2724, #1c1a18); border: 1px solid #4a4037; box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -1px 0 rgba(0,0,0,.4); }

/* ---------- верхняя панель ---------- */
#topbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 6px; z-index: 20; padding: 6px 14px 8px; border-radius: 0 0 14px 14px; }
#topbar .grp { display: flex; gap: 5px; }
#topbar::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(217,180,106,.55), transparent); }
.stat { position: relative; display: flex; align-items: center; gap: 8px; min-width: 112px; height: 38px; padding: 0 14px 0 11px; border-radius: 19px; font-family: var(--f-head); font-size: 16px; letter-spacing: .02em; color: #ece6d6; cursor: default; white-space: nowrap; overflow: hidden; }
.stat > .ic { color: #c9b98f; font-size: 17px; flex: none; filter: drop-shadow(0 1px 1px #000); }
.stat .sv { display: flex; flex-direction: column; line-height: 1; margin-top: -2px; }
.stat .sv .v { font-size: 16.5px; }
.stat .sv small { font-family: var(--f-ui); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8f8573; margin-top: 2px; }
.stat .d { font-size: 12.5px; color: var(--green2); }
.stat .d.neg { color: var(--red2); }
.stat .meter { position: absolute; left: 16px; right: 16px; bottom: 1px; height: 2px; background: rgba(0,0,0,.5); border-radius: 1px; overflow: hidden; }
.stat .meter i { display: block; height: 100%; }
.stat.warn .sv .v { color: #ffb070; }
.stat.bad .sv .v { color: #ff7a64; }
.stat.bad { animation: statPulse 1.6s ease-in-out infinite; }
@keyframes statPulse { 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 10px rgba(255,90,60,.55); } }
#timectl { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 6px; }
#timebtns { display: flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 6px; }
.tbtn { width: 28px; height: 24px; border-radius: 4px; border: 1px solid #4c4338; background: linear-gradient(#35312c, #211f1c); display: grid; place-items: center; cursor: pointer; color: #cfc6b3; font-size: 13px; }
.tbtn:hover { border-color: var(--bronze); color: var(--gold); }
.tbtn.on { background: linear-gradient(#3f6b35, #2a4a24); color: #b6f59a; border-color: #6aa55a; }
.tbtn.pause.on { background: linear-gradient(#6b5a2a, #4a3d1c); color: #ffe39a; border-color: #b39447; }
#speedbar { display: flex; gap: 2px; margin-left: 4px; }
#speedbar i { width: 6px; height: 18px; background: #2b2824; border: 1px solid #45403a; border-radius: 1px; }
#speedbar i.on { background: linear-gradient(#d9c07a, #8d7438); border-color: #b39447; }
#dateplate { padding: 3px 18px; border-radius: 5px; font-family: var(--f-head); font-weight: 600; font-size: 18px; letter-spacing: .08em; color: #2a2116; background: linear-gradient(#f3dfa6, #cfae62); border: 1px solid #7a6030; box-shadow: inset 0 1px 0 #fff4c9, 0 2px 4px rgba(0,0,0,.6); cursor: pointer; }
#defcon { display: flex; align-items: center; gap: 3px; font-family: var(--f-head); font-size: 11px; letter-spacing: .14em; color: var(--dim); margin-top: 2px; }
#defcon span { margin-right: 4px; }
#defcon i { font-style: normal; width: 17px; height: 14px; line-height: 14px; text-align: center; font-size: 10px; letter-spacing: 0; border-radius: 2px; background: #1c1a17; border: 1px solid #3d372f; color: #5d564b; }
#defcon i.on { color: #111; border-color: rgba(255,255,255,.35); box-shadow: 0 0 8px currentColor; font-weight: 600; }
#defcon i.l5.on { background: #6fae5c; color: #102008; box-shadow: 0 0 8px rgba(111,174,92,.8); }
#defcon i.l4.on { background: #5a8fd8; color: #0a1428; box-shadow: 0 0 8px rgba(90,143,216,.8); }
#defcon i.l3.on { background: #e2c04a; color: #2a2008; box-shadow: 0 0 8px rgba(226,192,74,.8); }
#defcon i.l2.on { background: #e0563a; color: #2a0a04; box-shadow: 0 0 10px rgba(224,86,58,.9); animation: statPulse 1s infinite; }
#defcon i.l1.on { background: #f4f0e8; color: #300; box-shadow: 0 0 14px rgba(255,255,255,.9); animation: statPulse .6s infinite; }

/* ---------- угловой чип выборов ---------- */
#elchip { position: fixed; top: 8px; left: 8px; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 6px; cursor: pointer; }
#elchip .flag { width: 44px; height: 30px; }
#elchip .t1 { font-family: var(--f-head); font-size: 14px; color: #efe8d6; }
#elchip .t2 { font-size: 13px; color: var(--dim); }
#agchip { position: fixed; top: 8px; right: 8px; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
#agchip .emb { width: 34px; height: 34px; }
#agchip .t1 { font-family: var(--f-head); font-size: 15px; letter-spacing: .06em; color: #efe8d6; }
#agchip .t2 { font-size: 12.5px; color: var(--dim); }

/* ---------- левая панель ---------- */
#left { position: fixed; left: 0; top: 84px; bottom: 112px; width: 440px; z-index: 15; display: flex; flex-direction: column; background: linear-gradient(90deg, #1b1a18, #22201d); border: 1px solid #4b4136; border-left: 0; border-radius: 0 8px 8px 0; box-shadow: var(--shadow); }
#left.closed { display: none; }
.phead { position: relative; display: flex; align-items: center; height: 34px; padding: 0 8px; background: linear-gradient(#34302b, #221f1c); border-bottom: 1px solid #4b4136; border-radius: 0 8px 0 0; }
.phead::after { content: ''; position: absolute; left: 30px; right: 30px; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(217,180,106,.6), transparent); }
.phead .nav { display: flex; gap: 2px; color: #7d7466; }
.phead .nav span { cursor: pointer; padding: 0 3px; font-size: 18px; line-height: 1; }
.phead .nav span:hover { color: var(--gold); }
.phead .ttl { flex: 1; text-align: center; font-family: var(--f-head); font-size: 17px; letter-spacing: .28em; text-transform: uppercase; color: #cfc8b8; }
.phead .x { cursor: pointer; font-size: 22px; color: #9d9483; padding: 0 4px; line-height: 1; }
.phead .x:hover { color: #fff; }
.pbody { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 8px; }
.sec { font-family: var(--f-head); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: #b3a893; padding: 10px 12px 5px; margin-top: 2px; border-top: 1px solid #332f2a; display: flex; align-items: center; gap: 8px; background: linear-gradient(90deg, rgba(168,132,74,.10), rgba(168,132,74,0) 55%); }
.sec::before { content: ''; flex: none; width: 5px; height: 5px; transform: rotate(45deg); background: var(--bronze); box-shadow: 0 0 4px rgba(217,180,106,.6); }
.sec small { margin-left: auto; letter-spacing: .05em; color: var(--dim); font-size: 12px; text-transform: none; }

/* плакат страны */
.poster { position: relative; margin: 8px; height: 170px; border-radius: 14px; overflow: hidden; border: 2px solid #4b4136; box-shadow: inset 0 0 40px rgba(0,0,0,.8); background: #111; }
.poster canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(.85) sepia(.35) contrast(1.15) brightness(.85); }
.poster .scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); pointer-events: none; }
.poster .lead { position: absolute; left: 12px; top: 10px; width: 92px; text-align: center; }
.poster .lead .por { width: 80px; height: 96px; margin: 0 auto; }
.poster .lead .nm { font-family: var(--f-head); font-size: 13px; line-height: 1.1; color: #f2ead8; text-shadow: 0 1px 3px #000; margin-top: 4px; padding: 3px 4px; background: rgba(14,13,11,.78); border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; }
.poster .flagbox { position: absolute; right: 12px; bottom: 12px; width: 60px; height: 40px; box-shadow: 0 2px 6px rgba(0,0,0,.8); }
.poster .regime { position: absolute; left: 112px; top: 12px; max-width: calc(100% - 124px); padding: 5px 10px 6px; border-radius: 4px; background: linear-gradient(90deg, rgba(14,13,11,.86), rgba(14,13,11,.72)); box-shadow: 0 2px 8px rgba(0,0,0,.5); font-family: var(--f-old); font-size: 15px; color: #f4ecd8; text-shadow: 0 1px 2px #000; }
.poster .regime small { display: block; font-family: var(--f-ui); font-size: 12.5px; color: #d8cdb4; margin-top: 2px; }
.nameline { display: flex; align-items: center; gap: 10px; padding: 4px 12px 8px; }
.nameline .flag { width: 70px; height: 46px; flex: none; }
.nameline .n1 { font-family: var(--f-head); font-size: 18px; color: #f0e8d4; line-height: 1.15; }
.nameline .n2 { font-size: 13px; color: var(--dim); }
.nameline .n3 { font-size: 13px; color: #b8ad98; margin-top: 2px; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 10px 8px; }
.kv > div { position: relative; background: linear-gradient(#2d2a25, #242220); border: 1px solid #3a352f; border-radius: 4px; padding: 4px 6px; text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.kv > div > .ic { position: absolute; left: 6px; top: 6px; font-size: 13px; color: #7d7263; }
.kv b { display: block; font-family: var(--f-head); font-size: 16px; font-weight: 400; color: #efe8d6; }
.kv b.good { color: #a9d98c; } .kv b.mid { color: #e6cf8a; } .kv b.bad { color: #ff9a82; }
.poster .stamp { position: absolute; left: 124px; bottom: 16px; padding: 2px 8px; border: 2px solid rgba(214,66,52,.9); border-radius: 3px; background: rgba(24,12,10,.72); color: #f08a74; font-family: var(--f-head); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; transform: rotate(-5deg); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.poster .stamp small { display: block; font-size: 9.5px; letter-spacing: .08em; color: #e8b4a4; text-align: center; }
.kv span { font-size: 11.5px; color: #aaa192; text-transform: uppercase; letter-spacing: .06em; }
.alignbar { position: relative; height: 10px; margin: 2px 12px 10px; border-radius: 5px; background: linear-gradient(90deg, #3d62b5, #6b7688 45%, #7a7870 50%, #8a6b62 55%, #c24a36); border: 1px solid #111; }
.alignbar i { position: absolute; top: -4px; width: 4px; height: 16px; background: #fff3c4; border: 1px solid #000; border-radius: 2px; transform: translateX(-50%); }
.alignlbl { display: flex; justify-content: space-between; padding: 0 12px; font-size: 12px; color: var(--dim); margin-top: -6px; margin-bottom: 4px; }

/* лента */
.feed { padding: 0 8px 6px; max-height: 150px; overflow-y: auto; }
.feed .it { display: flex; gap: 8px; align-items: baseline; padding: 3px 4px; border-bottom: 1px solid #2c2925; font-size: 14px; color: #cdc5b3; }
.feed .it .ic { color: #8c826f; flex: none; }
.feed .it .tx { flex: 1; line-height: 1.25; }
.feed .it .dt { flex: none; color: var(--faint); font-size: 12.5px; font-family: var(--f-head); }
.feed .it.mine .tx { color: #e8d9a8; }
.feed .it.imp3 .tx { color: #fff; }
.feed.big { max-height: none; }

/* партии */
.parties { padding: 2px 12px 8px; }
.party { display: grid; grid-template-columns: 10px 1fr 44px 120px; gap: 6px; align-items: center; font-size: 13.5px; padding: 2px 0; }
.party .sw { width: 10px; height: 10px; border-radius: 2px; }
.party .pn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party .pn.gov { color: var(--gold); }
.party .pn.ban { color: var(--faint); text-decoration: line-through; }
.party .pv { text-align: right; font-family: var(--f-head); }
.party .bar { height: 8px; background: #2a2723; border-radius: 3px; overflow: hidden; }
.party .bar i { display: block; height: 100%; }

/* акторы */
.actors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 4px 8px 10px; }
.actor { position: relative; background: #25231f; border: 1px solid #3b362f; border-radius: 4px; padding: 3px 3px 4px; text-align: center; cursor: pointer; }
.actor:hover { border-color: var(--bronze); background: #2d2a25; }
.actor.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.actor .pw { position: absolute; left: 4px; top: 1px; font-family: var(--f-head); font-size: 14px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; z-index: 2; }
.actor .img { width: 100%; aspect-ratio: 1/1.05; border-radius: 3px; overflow: hidden; }
.actor .img svg { width: 100%; height: 100%; display: block; }
.actor .an { font-size: 12.5px; color: #d4ccba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.actor .penb { position: absolute; left: 3px; right: 3px; bottom: 21px; height: 4px; background: rgba(0,0,0,.6); border-radius: 2px; overflow: hidden; }
.actor .penb i { display: block; height: 100%; }
.actor .ctrl { position: absolute; right: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; z-index: 2; box-shadow: 0 0 3px #000; }
.actor .dead { position: absolute; inset: 0; background: rgba(0,0,0,.6); }

/* карточка актора */
.acard { margin: 8px; padding: 10px; background: #26231f; border: 1px solid #4a4036; border-radius: 6px; display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.acard .img { width: 96px; height: 110px; border-radius: 4px; overflow: hidden; border: 1px solid #111; }
.acard .img svg { width: 100%; height: 100%; }
.acard .t1 { font-family: var(--f-head); font-size: 18px; color: #f1e9d6; line-height: 1.15; }
.acard .t2 { font-size: 13.5px; color: var(--dim); }
.acard .row { display: flex; justify-content: space-between; font-size: 13.5px; margin-top: 3px; }
.acard .row b { font-weight: 400; color: #efe7d3; font-family: var(--f-head); }
.penlist { padding: 4px 12px 8px; }
.penrow { display: grid; grid-template-columns: 60px 1fr 40px; gap: 8px; align-items: center; font-size: 13.5px; margin: 3px 0; }
.penrow .bar { height: 9px; background: #2a2723; border-radius: 3px; overflow: hidden; border: 1px solid #1a1816; }
.penrow .bar i { display: block; height: 100%; }
.penrow .v { text-align: right; font-family: var(--f-head); }

/* списки */
.list { padding: 2px 8px 8px; }
.li { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-bottom: 1px solid #2d2a26; font-size: 14px; cursor: pointer; }
.li:hover { background: #2a2723; }
.li .flag { width: 30px; height: 20px; flex: none; }
.li .grow { flex: 1; min-width: 0; }
.li .grow .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2dac8; }
.li .grow .b { font-size: 12.5px; color: var(--dim); }
.li .r { text-align: right; font-family: var(--f-head); color: #d9d0bc; flex: none; }
.li .r small { display: block; font-family: var(--f-ui); color: var(--faint); font-size: 12px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 12px; background: #3a352e; color: #d8cfb9; margin-left: 4px; }
.tag.ok { background: #2f4d27; color: #b6f59a; }
.tag.bad { background: #5a241c; color: #ffb3a4; }
.tag.run { background: #4d4020; color: #ffe39a; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 14px; border-radius: 4px; border: 1px solid #5a4d3c; background: linear-gradient(#3d3832, #26231f); color: #e9e0cb; font-family: var(--f-head); font-size: 14px; letter-spacing: .06em; cursor: pointer; text-transform: uppercase; }
.btn:hover { border-color: var(--bronze2); color: var(--gold); }
.btn:disabled, .btn.dis { opacity: .45; cursor: not-allowed; }
.btn.pri { background: linear-gradient(#6b5627, #3e3116); border-color: #b39447; color: #ffe8a8; }
.btn.red { background: linear-gradient(#6b2c22, #3e1812); border-color: #b3564a; color: #ffd0c4; }
.btn.small { padding: 3px 10px; font-size: 12.5px; }
.btnrow { display: flex; gap: 6px; padding: 8px 12px; flex-wrap: wrap; }
.note { padding: 6px 12px; font-size: 13.5px; color: var(--dim); line-height: 1.35; }
.bigbar { margin: 4px 12px 10px; height: 22px; border-radius: 4px; background: #121110; border: 1px solid #3b352e; position: relative; overflow: hidden; }
.bigbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#4f8a3f, #2b5a22); }
.bigbar span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-head); font-size: 14px; color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- нижние ряды кнопок ---------- */
.dock { position: fixed; bottom: 8px; z-index: 18; display: flex; gap: 6px; align-items: flex-end; }
#dockL { left: 8px; }
#dockR { right: 8px; }
#dockC { left: 50%; transform: translateX(-50%); }
.db { min-width: 64px; padding: 0 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.db .sq { width: 54px; height: 54px; border-radius: 6px; display: grid; place-items: center; font-size: 28px; color: #d8cdb4; background: linear-gradient(#45403a, #2a2723 60%, #1f1d1a); border: 1px solid #5d5143; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -2px 4px rgba(0,0,0,.5), 0 3px 8px rgba(0,0,0,.6); }
.db .lb { font-family: var(--f-head); font-size: 12.5px; letter-spacing: .08em; color: #e0d7c3; text-transform: uppercase; text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; }
.db .sq { transition: transform .12s, box-shadow .12s, border-color .12s; }
.db:hover .sq { border-color: var(--bronze2); color: var(--gold); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -2px 4px rgba(0,0,0,.5), 0 6px 12px rgba(0,0,0,.6), 0 0 12px rgba(217,180,106,.3); }
.db .sq .ic { filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)); }
.db.on .sq { background: linear-gradient(#8b6d33, #5a4520 60%, #3b2d15); border-color: #d9b46a; color: #fff0c0; }
.db.dis { opacity: .4; pointer-events: none; }
.db .badge { position: absolute; margin: -6px 0 0 44px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #b8392a; color: #fff; font-size: 12px; font-family: var(--f-head); display: grid; place-items: center; box-shadow: 0 1px 3px #000; }
#dockC .db .sq { width: 50px; height: 50px; font-size: 25px; border-radius: 50%; }
#mapmodes { display: grid; grid-template-columns: repeat(2, 24px); gap: 3px; margin-right: 4px; margin-bottom: 20px; }
#mapmodes span { width: 24px; height: 24px; border-radius: 3px; display: grid; place-items: center; font-size: 13px; background: linear-gradient(#3d3832, #24211e); border: 1px solid #52483b; cursor: pointer; color: #cbbf9f; }
#mapmodes span.on { background: linear-gradient(#8b6d33, #4a3a1b); color: #fff0c0; border-color: #d9b46a; }

/* ---------- правая колонка: операции ---------- */
#right { position: fixed; right: 8px; top: 64px; width: 360px; z-index: 14; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 300px); overflow: hidden; pointer-events: none; }
.opcard { pointer-events: auto; position: relative; height: 92px; border-radius: 6px; overflow: hidden; border: 1px solid #4d4336; box-shadow: var(--shadow); cursor: pointer; background: #181715; }
.opcard canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(.8) sepia(.45) contrast(1.15) brightness(.78); }
.opcard .ov { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,9,8,.2), rgba(10,9,8,.85) 38%); }
.opcard .c { position: absolute; left: 98px; right: 8px; top: 6px; }
.opcard .t { font-family: var(--f-head); font-size: 16px; color: #f4ecd8; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
.opcard .s { font-size: 13px; color: #d8cba8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opcard .l { font-size: 12.5px; color: #b5aa92; display: flex; justify-content: space-between; margin-top: 1px; }
.opcard .l.bad { color: #ffb08f; }
.opcard .l.good { color: #b6ea9a; }
.opcard .pr { position: absolute; left: 98px; right: 8px; bottom: 6px; height: 5px; background: rgba(0,0,0,.6); border-radius: 3px; overflow: hidden; }
.opcard .pr i { display: block; height: 100%; background: linear-gradient(90deg, #8d7438, #e6c775); }
.opcard .who { position: absolute; left: 8px; top: 8px; width: 80px; height: 76px; }
.opcard .who .por { width: 62px; height: 72px; }
.opcard .who .fl { position: absolute; left: 44px; top: 50px; width: 30px; height: 20px; box-shadow: 0 1px 3px #000; }
#minis { position: fixed; right: 8px; bottom: 96px; width: 300px; z-index: 14; }
.mini { background: rgba(26,25,23,.92); border: 1px solid #4a4036; border-radius: 5px; margin-top: 6px; box-shadow: var(--shadow); }
.mini .h { font-family: var(--f-head); font-size: 13px; letter-spacing: .22em; color: #b3a893; padding: 5px 10px 3px; text-transform: uppercase; }
.mini .r { display: flex; justify-content: space-between; gap: 8px; padding: 3px 10px; font-size: 14px; border-top: 1px solid #2d2a26; cursor: pointer; }
.mini .r:hover { background: #2a2723; }
.mini .r span:last-child { color: var(--dim); white-space: nowrap; }
.mini .r .ic { color: var(--bronze2); margin-right: 4px; }

/* ---------- подсказка ---------- */
#tip { position: fixed; z-index: 100; pointer-events: none; max-width: 340px; padding: 8px 10px; background: rgba(20,19,17,.97); border: 1px solid #6b5a42; border-radius: 4px; font-size: 13.5px; line-height: 1.35; box-shadow: var(--shadow); color: #ddd5c3; }
#tip b { color: var(--gold); font-weight: 400; font-family: var(--f-head); font-size: 15px; }
#tip .f { display: flex; justify-content: space-between; gap: 16px; }
#tip .f .p { color: var(--green2); } #tip .f .n { color: var(--red2); }
#tip hr { border: 0; border-top: 1px solid #3d3832; margin: 5px 0; }

/* ---------- окна ---------- */
#modals { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(8,8,10,.45); }
#modals.on { display: grid; }
.win { position: relative; width: 660px; max-width: calc(100vw - 40px); max-height: calc(100vh - 60px); display: flex; flex-direction: column; background: linear-gradient(#24221f, #1a1917); border: 1px solid #5c4f3e; border-radius: 6px; box-shadow: 0 16px 60px rgba(0,0,0,.8); animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.win .wh { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid #3e372f; }
.win .wh .flag { width: 42px; height: 28px; }
.win .wh .t { flex: 1; font-family: var(--f-head); font-size: 22px; letter-spacing: .06em; text-transform: uppercase; color: #efe6d0; }
.win .wh .x { font-size: 26px; cursor: pointer; color: #a79e8b; line-height: 1; padding: 0 6px; }
.win .wh .x:hover { color: #fff; }
.win .wb { overflow-y: auto; }
.win .wf { display: flex; gap: 8px; justify-content: center; padding: 10px 12px 14px; border-top: 1px solid #332e28; }
.win .wf .btn { min-width: 150px; }
.perf { position: absolute; top: 60px; bottom: 60px; width: 14px; background: radial-gradient(circle, #0b0a09 3px, transparent 3.5px) 0 0 / 14px 22px repeat-y; opacity: .9; }
.perf.l { left: 4px; } .perf.r { right: 4px; }
.scene { position: relative; height: 250px; margin: 0 24px; overflow: hidden; border-bottom: 1px solid #2f2a24; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(.85) sepia(.3) contrast(1.2) brightness(.8); }
.scene .big { position: absolute; right: 26px; bottom: 16px; font-size: 96px; color: rgba(255,240,200,.85); filter: drop-shadow(0 4px 10px #000); }
.scene .fade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0) 55%, rgba(26,25,23,1)); }
.res { display: flex; gap: 14px; align-items: center; padding: 14px 40px 4px; }
.res .ico { width: 58px; height: 58px; flex: none; border-radius: 4px; overflow: hidden; border: 1px solid #111; }
.res .ico svg { width: 100%; height: 100%; }
.res .tx1 { font-family: var(--f-serif); font-size: 16px; color: #f1e9d6; line-height: 1.35; }
.res .tx2 { font-size: 14.5px; color: #c4b9a2; margin-top: 3px; line-height: 1.35; }
.deltas { display: flex; justify-content: center; gap: 22px; padding: 12px 20px 16px; font-size: 15px; color: #d8d0bd; flex-wrap: wrap; }
.deltas .ic { color: var(--bronze2); }
.oplog { padding: 0 40px 10px; font-size: 13.5px; color: #b9ae98; }
.oplog div { display: flex; justify-content: space-between; border-bottom: 1px solid #2c2925; padding: 2px 0; }
.oplog .bad { color: #ffb08f; } .oplog .good { color: #b6ea9a; }
.win.ok .wh .t { color: #bff0a0; } .win.fail .wh .t { color: #ffb3a1; } .win.part .wh .t { color: #ffe39a; }

/* газета */
.paper { width: 700px; max-width: calc(100vw - 40px); max-height: calc(100vh - 50px); overflow-y: auto; color: var(--ink); padding: 18px 26px 18px; border-radius: 2px; box-shadow: 0 18px 60px rgba(0,0,0,.85); animation: paperIn .35s ease-out;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%), radial-gradient(ellipse at 80% 90%, rgba(120,90,40,.18), rgba(0,0,0,0) 55%), linear-gradient(#ece3cb, #dfd3b4);
  font-family: var(--f-old); position: relative; }
.paper::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: multiply; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .18  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes paperIn { from { transform: rotate(-8deg) scale(.6); opacity: 0; } to { transform: rotate(-0.6deg) scale(1); opacity: 1; } }
.paper .mast { text-align: center; border-bottom: 3px double #2b241a; padding-bottom: 4px; }
.paper .mast .nm { font-size: 58px; line-height: 1; letter-spacing: .02em; }
.paper .mast .nm.fraktur { font-family: 'UnifrakturMaguntia', var(--f-old); }
.paper .mast .nm.ruslan { font-family: 'Ruslan Display', var(--f-old); letter-spacing: .08em; }
.paper .mast .mt { display: flex; justify-content: space-between; font-size: 12.5px; border-top: 1px solid #2b241a; margin-top: 4px; padding-top: 3px; font-style: italic; }
.paper .hl { font-weight: 700; font-size: 34px; line-height: 1.05; text-align: center; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: -.01em; }
.paper .sh { font-size: 17px; text-align: center; font-style: italic; margin-bottom: 10px; }
.paper .body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.paper .ph { position: relative; height: 210px; border: 1px solid #2b241a; background: #bbb; overflow: hidden; }
.paper .ph canvas { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(1) contrast(1.5) brightness(.95); mix-blend-mode: multiply; }
.paper .ph .ic { position: absolute; right: 10px; bottom: 8px; font-size: 64px; color: rgba(20,16,10,.8); }
.paper .ph .cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11.5px; background: rgba(233,224,201,.85); padding: 2px 6px; font-style: italic; }
.paper .tx { font-family: var(--f-serif); font-size: 15px; line-height: 1.45; text-align: left; hyphens: auto; border-left: 1px solid rgba(43,36,26,.45); padding-left: 14px; margin-left: -2px; }
.paper .tx .by { font-family: var(--f-old); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; margin-bottom: 4px; }
.paper .ph .dots { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, rgba(20,16,10,.35) .8px, transparent 1.3px) 0 0 / 4px 4px; mix-blend-mode: multiply; }
.paper .ph::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 30px rgba(60,45,20,.45); pointer-events: none; }
.paper .ref { margin-top: 12px; border: 1px solid #2b241a; padding: 5px 8px 6px; font-size: 12.5px; line-height: 1.35; background: rgba(120,90,40,.07); }
.paper .ref .rt { font-family: var(--f-old); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 11.5px; border-bottom: 1px solid rgba(43,36,26,.5); margin-bottom: 3px; padding-bottom: 2px; text-align: center; }
.paper .ref div:not(.rt) { display: flex; justify-content: space-between; gap: 10px; }
.paper .ref span { font-style: italic; }
.paper .ref b { font-weight: 700; text-align: right; }
.paper .cols { margin-top: 12px; padding-top: 6px; border-top: 1px solid #2b241a; columns: 3; column-gap: 14px; column-rule: 1px solid rgba(43,36,26,.5); font-family: var(--f-serif); font-size: 12px; line-height: 1.3; }
.paper .cols p { margin: 0 0 5px; break-inside: avoid; }
.paper .cols b { font-family: var(--f-old); }
.paper .foot { display: flex; justify-content: flex-end; margin-top: 12px; gap: 8px; }
.paper .foot .btn { color: #f1e6c8; }

/* решения */
.choice { padding: 14px 24px; }
.choice .tx { font-family: var(--f-serif); font-size: 16px; line-height: 1.45; color: #eee5d0; }
.opt { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 10px 14px; border-radius: 4px; border: 1px solid #5a4d3c; background: linear-gradient(#34302b, #23201d); cursor: pointer; }
.opt:hover { border-color: var(--gold); background: linear-gradient(#433b30, #2a2621); }
.opt b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 16px; color: #f1e3b8; }
.opt small { color: var(--dim); font-size: 13.5px; }

/* запуск операции */
.oplaunch { width: 780px; }
.opgrid { display: grid; grid-template-columns: 250px 1fr; min-height: 380px; }
.oplist { border-right: 1px solid #3a342d; overflow-y: auto; max-height: 62vh; }
.opi { padding: 9px 12px; border-bottom: 1px solid #2c2925; cursor: pointer; }
.opi:hover { background: #2a2723; }
.opi.sel { background: linear-gradient(90deg, #4a3c1e, #2a2520); box-shadow: inset 3px 0 0 var(--gold); }
.opi .n { font-family: var(--f-head); font-size: 15px; color: #efe6d0; }
.opi .w { font-size: 12.5px; color: var(--dim); }
.opi.na .n { color: #7d7466; }
.opi.na .w { color: #a2584a; }
.opd { padding: 12px 16px; overflow-y: auto; max-height: 62vh; }
.opd .ds { font-family: var(--f-serif); font-size: 14.5px; line-height: 1.4; color: #d8cfbb; }
.opd .fld { margin-top: 12px; }
.opd .fld > label { display: block; font-family: var(--f-head); font-size: 12.5px; letter-spacing: .18em; color: #a79e8d; text-transform: uppercase; margin-bottom: 4px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; max-height: 190px; overflow-y: auto; }
.pk { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border: 1px solid #3b362f; border-radius: 4px; background: #24211e; cursor: pointer; font-size: 13.5px; }
.pk:hover { border-color: var(--bronze); }
.pk.sel { border-color: var(--gold); background: #3a3020; }
.pk.na { opacity: .45; }
.pk .por { width: 30px; height: 34px; flex: none; }
.pk .i { min-width: 0; }
.pk .i div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk .i small { color: var(--dim); font-size: 12px; }
.odds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.odds > div { background: #2a2723; border: 1px solid #3a352f; border-radius: 4px; padding: 6px; text-align: center; }
.odds b { display: block; font-family: var(--f-head); font-size: 22px; font-weight: 400; color: #f2ead6; }
.odds span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.odds .good b { color: var(--green2); } .odds .bad b { color: var(--red2); } .odds .mid b { color: var(--amber); }
.chk { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.chk input { accent-color: #b39447; width: 16px; height: 16px; }
.why { margin-top: 12px; color: #ff9f8a; font-size: 14px; }

/* экран старта */
#start { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, rgba(20,22,26,.55), rgba(8,8,10,.94) 75%); }
#start .logo { font-family: 'Ruslan Display', var(--f-old); font-size: 76px; letter-spacing: .06em; color: #e9dcc0; text-shadow: 0 4px 0 #3b1a14, 0 8px 30px rgba(0,0,0,.9); line-height: 1; }
#start .logo span { color: #d4533d; }
#start .sub { font-family: var(--f-old); font-style: italic; font-size: 20px; color: #bfb49c; margin: 8px 0 26px; }
#start .cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 1200px; }
.agc { position: relative; width: 280px; padding: 14px; border-radius: 8px; cursor: pointer; background: linear-gradient(#2a2724, #1a1917); border: 1px solid #54483a; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; overflow: hidden; }
.agc::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--ac), transparent); opacity: .8; }
.agc .top .fl { margin-left: auto; width: 36px; height: 24px; flex: none; align-self: flex-start; box-shadow: 0 1px 3px #000; opacity: .9; }
.agc .top .fl svg { width: 100%; height: 100%; display: block; }
.agc .hq { font-size: 12.5px; color: #8f8573; margin-top: 8px; font-style: italic; }
.agc .hq .ic { color: var(--bronze); }
.agc .bars { margin-top: 8px; display: grid; gap: 3px; }
.agc .bars > div { display: grid; grid-template-columns: 66px 1fr; align-items: center; font-size: 12px; color: #a89e89; }
.agc .bars > div > i { height: 5px; background: #121110; border: 1px solid #3a342d; border-radius: 3px; overflow: hidden; }
.agc .bars > div > i > i { display: block; height: 100%; background: linear-gradient(90deg, #8d7438, #e6c775); }
.agc .st em { font-style: normal; color: #e0563a; letter-spacing: 1px; font-size: 10px; } .agc .st em u { text-decoration: none; color: #4a443c; }
#start .grif { position: absolute; top: 34px; right: 46px; padding: 6px 16px; border: 3px double rgba(200,60,45,.7); color: rgba(220,80,60,.8); font-family: var(--f-head); font-size: 18px; letter-spacing: .24em; text-transform: uppercase; transform: rotate(6deg); text-align: center; }
#start .grif small { display: block; font-size: 11px; letter-spacing: .14em; color: rgba(220,120,100,.7); }
#start .rule { display: flex; align-items: center; gap: 14px; width: 560px; margin: -10px 0 18px; font-family: var(--f-head); font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: #8f8573; }
#start .rule i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #a8844a, transparent); }
.agc:hover { transform: translateY(-3px); border-color: var(--bronze2); }
.agc.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(241,212,138,.5), var(--shadow); }
.agc .top { display: flex; gap: 12px; align-items: center; }
.agc .emb { width: 56px; height: 56px; flex: none; }
.agc .n1 { font-family: var(--f-head); font-size: 22px; letter-spacing: .06em; color: #f1e8d3; }
.agc .n2 { font-size: 13px; color: var(--dim); line-height: 1.2; }
.agc .ds { font-family: var(--f-serif); font-size: 13.5px; color: #cdc3ad; line-height: 1.4; margin-top: 6px; min-height: 115px; }
.agc .st { display: flex; gap: 10px; margin-top: 8px; font-size: 12.5px; color: #a89e89; }
.agc .st b { color: #efe5cc; font-weight: 400; font-family: var(--f-head); }
#start .opts { display: flex; gap: 22px; align-items: center; margin-top: 22px; color: var(--dim); font-size: 14px; }
#start .opts label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
#start .opts input[type=text] { width: 110px; background: #1d1c1a; border: 1px solid #4a4036; color: #eee; padding: 4px 8px; border-radius: 3px; font-family: var(--f-head); }
#start .go { display: flex; gap: 12px; margin-top: 22px; }
#start .go .btn { min-width: 200px; padding: 10px 20px; font-size: 17px; }
#start .foot { position: absolute; bottom: 14px; font-size: 12.5px; color: #6b6458; }

/* графики */
.chart { padding: 4px 10px 10px; }
.chart svg { width: 100%; height: 140px; display: block; }
.shares { display: flex; height: 26px; margin: 4px 12px 4px; border-radius: 4px; overflow: hidden; border: 1px solid #111; font-family: var(--f-head); font-size: 13px; }
.shares div { display: grid; place-items: center; color: #fff; text-shadow: 0 1px 2px #000; }
.techrow { display: grid; grid-template-columns: 1fr 70px 70px; gap: 6px; padding: 3px 12px; font-size: 13.5px; align-items: center; }
.techrow .v { text-align: right; font-family: var(--f-head); }
.techrow .v.done { color: var(--gold); }

/* выноски на карте рендерятся в canvas; всплывающие тосты */
#toasts { position: fixed; left: 460px; bottom: 100px; z-index: 30; display: flex; flex-direction: column-reverse; gap: 5px; pointer-events: none; }
.toast { padding: 6px 12px; background: rgba(22,21,19,.94); border: 1px solid #5c4f3e; border-left: 3px solid var(--gold); border-radius: 3px; font-size: 14px; color: #e6dcc6; box-shadow: var(--shadow); animation: toastIn .25s ease-out; max-width: 420px; }
.toast.bad { border-left-color: var(--red2); }
@keyframes toastIn { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 1500px) {
  #left { width: 390px; }
  .actors { grid-template-columns: repeat(4, 1fr); }
  #right { width: 310px; }
  .db { min-width: 56px; } .db .sq { width: 48px; height: 48px; font-size: 24px; }
  #dockC .db .sq { width: 44px; height: 44px; }
  .stat { min-width: 90px; padding: 0 10px 0 8px; gap: 6px; } .stat .sv small { font-size: 9.5px; letter-spacing: .05em; }
  #toasts { left: 410px; }
  #agchip > div:last-child { display: none; }
  #elchip .t2 { display: none; }
}
@media (max-width: 1480px) {
  #dockC { bottom: 86px; }
  #dockC .db .lb { font-size: 11px; }
}
@media (max-width: 1250px) {
  #minis { display: none; }
}

/* ---------- идеологии и политика ---------- */
.igchip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 4px; border-radius: 3px; background: #2a2723; border: 1px solid #3a352f; font-size: 13px; cursor: pointer; white-space: nowrap; }
.igchip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.igchip:hover { border-color: var(--bronze2); }
.igsq { width: 14px; height: 14px; border-radius: 3px; flex: none; margin: 0 4px; }
.polrow { display: flex; justify-content: space-between; align-items: center; padding: 2px 12px 6px; font-size: 13.5px; color: var(--dim); }
.dembar { margin: 4px 12px 10px; border: 1px solid #111; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #9e2c22, #c9a85a 50%, #3f8a4a); position: relative; }
.dembar i { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: #f4ead0; border-radius: 2px; box-shadow: 0 0 3px #000; }
.parl { display: grid; grid-template-columns: 200px 1fr; gap: 8px; align-items: center; padding: 6px 12px 4px; }
.parl .hemi { width: 200px; height: 104px; filter: brightness(1.5) saturate(1.1); }
.parl .pinfo { font-size: 13px; color: #b8ad98; line-height: 1.45; }
.vbar { display: flex; height: 14px; margin: 4px 12px 4px; border-radius: 3px; overflow: hidden; border: 1px solid #3a352f; }
.vbar i { display: block; height: 100%; }
.vleg { display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 2px 12px 6px; font-size: 13px; color: #b8ad98; }
.vleg span { cursor: pointer; white-space: nowrap; }
.vleg b { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.risks { padding: 0 12px 6px; }
.risks .rk { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; padding: 3px 0; border-bottom: 1px dashed #332f2a; }
.risks .rk b { font-family: var(--f-head); font-weight: 400; color: #e6d6a8; }
.risks .rk.hot b { color: #ff9a82; }
.risks .rk .ic { width: 14px; height: 14px; vertical-align: -2px; }
.polls { margin: 2px 12px 4px; height: 70px; background: #1c1a17; border: 1px solid #332f2a; border-radius: 3px; }
.polls svg { width: 100%; height: 100%; display: block; }
.ighead { margin: 10px 12px 4px; padding: 4px 0 4px 10px; }
.ighead .t1 { font-family: var(--f-head); font-size: 20px; color: #efe8d6; }
.ighead .t2 { font-size: 13px; color: var(--dim); }
.views { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 12px 8px; }
.views span { background: #2a2723; border: 1px solid #3a352f; border-radius: 3px; padding: 1px 7px; font-size: 13px; }
#maplegend { position: fixed; left: 8px; bottom: 150px; z-index: 17; background: rgba(24, 22, 19, .92); border: 1px solid #4a4238; border-radius: 5px; padding: 6px 10px 8px; min-width: 180px; font-size: 12.5px; color: #d8cfb9; box-shadow: 0 3px 10px rgba(0,0,0,.6); }
#maplegend.hidden { display: none; }
#left:not(.closed) ~ #maplegend { left: 448px; }
#maplegend .t { font-family: var(--f-head); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: #a79e8d; margin-bottom: 4px; }
#maplegend .r { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
#maplegend .r b { width: 11px; height: 11px; border-radius: 2px; flex: none; }
#maplegend .r span { margin-left: auto; color: var(--faint); padding-left: 10px; }
#maplegend .grad { height: 10px; border-radius: 3px; background: linear-gradient(90deg, #9e2c22, #c9a85a 50%, #3f8a4a); }
#maplegend .gl { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; margin-top: 2px; gap: 14px; }

/* ---------- подсказка по стране ---------- */
#tip .th { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; min-width: 250px; }
#tip .th .fl { width: 42px; height: 28px; flex: none; box-shadow: 0 1px 4px #000; }
#tip .th .fl svg { width: 100%; height: 100%; display: block; }
#tip .th .s { font-size: 12.5px; color: var(--dim); }
#tip .al { position: relative; height: 6px; margin: 2px 0 2px; border-radius: 3px; background: linear-gradient(90deg, #3d62b5, #7a7870 50%, #c24a36); }
#tip .al i { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1.5px; background: #fff3c4; border-radius: 1px; box-shadow: 0 0 3px #000; }
#tip .al + .f { font-size: 11.5px; color: var(--faint); }
#tip .mb { height: 3px; background: #2a2723; border-radius: 2px; overflow: hidden; margin: 1px 0 3px; }
#tip .mb i { display: block; height: 100%; }
#tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* резиновые штампы в итогах */
.rstamp { position: absolute; left: 34px; top: 26px; padding: 4px 16px 3px; border: 4px double currentColor; border-radius: 4px; font-family: var(--f-head); font-size: 30px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; line-height: 1; text-align: center; transform: rotate(-9deg); opacity: .88; mix-blend-mode: screen; animation: stampIn .35s cubic-bezier(.2,1.6,.4,1) .15s both; }
.rstamp small { display: block; font-size: 11px; letter-spacing: .12em; margin-top: 3px; font-weight: 400; }
.rstamp.ok { color: #8fdc6a; } .rstamp.part { color: #f2c94c; } .rstamp.fail, .rstamp.abort { color: #ff6a4f; }
.rstamp.inline { position: relative; left: auto; top: auto; display: table; margin: 16px auto 0; font-size: 24px; }
@keyframes stampIn { from { transform: rotate(-9deg) scale(2.2); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: .88; } }

/* выборы: карточка партии, протокол итогов, прогноз */
.party { cursor: pointer; border-radius: 3px; }
.party:hover { background: #2a2723; }
.tag.elrep { cursor: pointer; background: #2d3a44; color: #bcd6ea; }
.tag.elrep:hover { background: #3a4d5a; }
.pcard { margin: 8px; padding: 10px; background: #26231f; border: 1px solid #4a4036; border-radius: 6px; display: flex; gap: 12px; }
.pcard .emb { width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 3px double rgba(0,0,0,.55); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 2px 6px rgba(0,0,0,.6); }
.pcard .emb span { font-family: var(--f-head); font-size: 17px; color: #fff; text-shadow: 0 1px 2px #000; letter-spacing: .03em; }
.pcard .grow { flex: 1; min-width: 0; }
.pcard .t1 { font-family: var(--f-head); font-size: 18px; color: #f1e9d6; line-height: 1.15; }
.pcard .t2 { font-size: 13.5px; color: var(--dim); margin-bottom: 2px; }
.pcard .row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; margin-top: 3px; }
.pcard .row b { font-weight: 400; color: #efe7d3; font-family: var(--f-head); }
.lnk { cursor: pointer; border-bottom: 1px dotted var(--bronze2); }
.elfc { padding: 2px 12px 4px; }
.elfc > div, .elsum > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 2px 0; border-bottom: 1px dashed #332f2a; }
.elfc span, .elsum span { color: var(--dim); }
.elfc b, .elsum b { font-weight: 400; font-family: var(--f-head); color: #efe7d3; text-align: right; }
.elsum .sw, .eltab .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 2px; }
.elsum .v { display: block; border: 0; color: #c4b9a2; font-family: var(--f-serif); font-size: 14px; padding-top: 6px; }
.prel { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 12px 8px; }
.prel em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.prel em.good { color: #a9d98c; } .prel em.bad { color: #ff9a82; } .prel em.mid { color: #e6cf8a; }
.elops { padding: 2px 8px 6px; }
.elop { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-bottom: 1px solid #2d2a26; font-size: 13.5px; }
.elop .i { font-size: 18px; color: var(--bronze2); flex: none; }
.elop .grow { flex: 1; min-width: 0; }
.elop .a { color: #e2dac8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elop .b { font-size: 12.5px; color: var(--dim); }
.elop.na .b { color: #a2584a; }
.elop .r { text-align: right; font-family: var(--f-head); color: #d9d0bc; flex: none; }
.elop .r small { display: block; font-family: var(--f-ui); color: var(--faint); font-size: 12px; }
.elop .btn[disabled] { opacity: .4; pointer-events: none; }
.elwin { width: 620px; }
.elwin .elintro { padding: 12px 20px 4px; font-family: var(--f-serif); font-size: 15px; color: #e6dcc4; line-height: 1.4; }
.elwin .elgrid { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: center; padding: 6px 20px 8px; }
.elwin .hemi { width: 260px; height: 135px; filter: brightness(1.5) saturate(1.1); }
.elwin .sec { margin-top: 4px; }
.eltab { width: calc(100% - 40px); margin: 4px 20px 12px; border-collapse: collapse; font-size: 13.5px; }
.eltab th { text-align: right; font-weight: 400; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 2px 6px; border-bottom: 1px solid #3a352f; }
.eltab th:nth-child(2) { text-align: left; }
.eltab td { padding: 3px 6px; border-bottom: 1px solid #2c2925; color: #d8d0bd; }
.eltab td:first-child { width: 14px; padding-right: 0; }
.eltab td.n { text-align: right; font-family: var(--f-head); white-space: nowrap; }
.eltab tr.gov .pn { color: var(--gold); }
.eltab tr[data-party] { cursor: pointer; }
.eltab tr[data-party]:hover td { background: #2a2723; }
@media (max-width: 700px) { .elwin .elgrid { grid-template-columns: 1fr; } .elwin .hemi { margin: 0 auto; } }
.party.closed { grid-template-columns: 10px 1fr auto 34px; }
.party.closed .tag { margin: 0; }

/* ======================= «Как играть»: учебное пособие ======================= */
#howto { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(6,6,8,.72); backdrop-filter: blur(2px); animation: pop .18s ease-out; }
.hn-folder { display: flex; width: 980px; max-width: calc(100vw - 24px); height: min(760px, calc(100vh - 32px)); filter: drop-shadow(0 20px 50px rgba(0,0,0,.85)); }
.hn-tabs { display: flex; flex-direction: column; gap: 4px; padding-top: 70px; flex: none; }
.hn-tabs .tab { display: flex; align-items: center; gap: 8px; width: 138px; padding: 9px 12px; margin-right: -6px; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, #6d5a3c, #8a7350); color: #2a2116; font-family: var(--f-head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; box-shadow: inset -6px 0 8px -6px rgba(0,0,0,.5); transition: transform .12s, background .12s; }
.hn-tabs .tab svg { font-size: 17px; flex: none; }
.hn-tabs .tab:hover { transform: translateX(-4px); background: linear-gradient(90deg, #86704c, #a48a60); }
.hn-tabs .tab.on { background: var(--paper); color: #7a2418; transform: translateX(-8px); box-shadow: none; z-index: 1; }
.hn-page { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--paper) radial-gradient(ellipse at 80% 0%, rgba(255,255,255,.35), transparent 60%); background-image: radial-gradient(ellipse at 80% 0%, rgba(255,255,255,.35), transparent 60%), repeating-linear-gradient(0deg, transparent 0 27px, rgba(80,110,160,.10) 27px 28px); color: var(--ink); border-radius: 3px 8px 8px 3px; border-left: 6px solid #b9ac8c; font-family: var(--f-serif); user-select: text; }
.hn-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 20px 0 30px; }
.hn-grif { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .22em; font-size: 13px; color: #9c2c1c; border: 2px solid rgba(156,44,28,.65); padding: 3px 10px; transform: rotate(-1.5deg); }
.hn-grif small { display: block; font-size: 10px; letter-spacing: .12em; color: #7b5b4a; }
.hn-head .x { font-size: 30px; line-height: 1; cursor: pointer; color: #6d6150; padding: 0 4px; font-family: var(--f-ui); }
.hn-head .x:hover { color: #9c2c1c; }
.hn-page h2 { margin: 10px 30px 4px; font-family: var(--f-old); font-weight: 700; font-size: 29px; color: #1e1912; border-bottom: 2px solid #1e1912; padding-bottom: 6px; }
.hn-body { flex: 1; overflow-y: auto; padding: 8px 30px 18px; font-size: 15.5px; line-height: 1.45; }
.hn-body.turn { animation: hnturn .25s ease-out; }
@keyframes hnturn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.hn-body p { margin: 8px 0; }
.hn-body b { color: #120e09; }
.hn-lead { font-size: 17px; font-style: italic; color: #3a3024; }
.hn-sec { margin: 18px 0 8px; font-family: var(--f-head); font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: #7a2418; display: flex; align-items: center; gap: 10px; }
.hn-sec::after { content: ''; flex: 1; height: 1px; background: rgba(122,36,24,.35); }
.hn-note { position: relative; margin: 18px 0 4px 40px; padding: 6px 12px; font-family: var(--f-ui); font-size: 16px; font-style: italic; color: #a52b1a; border-left: 3px solid rgba(165,43,26,.5); transform: rotate(-.6deg); }
.hn-note::before { content: '✎'; position: absolute; left: -30px; top: 2px; font-size: 22px; font-style: normal; }
.hn-big { display: flex; gap: 14px; align-items: center; padding: 12px 16px; margin: 12px 0; border: 2px dashed #8a7350; background: rgba(255,250,235,.55); font-size: 16px; }
.hn-big > svg { font-size: 40px; color: #7a2418; flex: none; }
.hn-big b { display: block; font-family: var(--f-head); text-transform: uppercase; letter-spacing: .1em; font-size: 14px; color: #7a2418; }
.hn-ends { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hn-ends > div { padding: 10px; background: rgba(255,250,235,.6); border: 1px solid #b9ac8c; border-top: 4px solid #8a7350; font-size: 13.5px; line-height: 1.3; }
.hn-ends > div.ok { border-top-color: #4f7d3a; } .hn-ends > div.bad { border-top-color: #9c2c1c; }
.hn-ends svg { font-size: 26px; display: block; margin-bottom: 4px; color: #4a3d2b; }
.hn-ends b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 15px; letter-spacing: .04em; }
.hn-ends span { color: #54493a; }
.hn-score { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.hn-score .f { flex: 1; min-width: 120px; padding: 8px 10px; text-align: center; background: #2a2520; color: #efe3c4; font-family: var(--f-head); font-size: 14px; letter-spacing: .04em; border-radius: 3px; }
.hn-score .f i { font-style: normal; color: var(--gold); }
.hn-score .f small { font-family: var(--f-ui); color: #b5a88c; font-size: 12px; }
.hn-ranks { display: flex; margin-top: 8px; font-family: var(--f-head); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.hn-ranks span { flex: 1; padding: 6px 4px; text-align: center; color: #3a3024; background: linear-gradient(90deg, rgba(156,44,28,.25), rgba(138,115,80,.25)); border-right: 1px solid var(--paper); }
.hn-ranks span:nth-child(3) { background: rgba(138,115,80,.3); } .hn-ranks span:nth-child(4) { background: rgba(79,125,58,.25); }
.hn-ranks span.top { background: #7a2418; color: #ffe8a8; }
.hn-hud { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 10px; background: #1a1917; border-radius: 4px; }
.hn-plate { display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: linear-gradient(#3a352f, #24211d); border: 1px solid #4f463a; border-radius: 3px; color: #e9e0cb; cursor: help; font-family: var(--f-head); transition: border-color .12s, transform .12s; }
.hn-plate svg { font-size: 22px; color: var(--bronze2); flex: none; }
.hn-plate b { color: #efe6d0; display: block; font-weight: 400; font-size: 17px; line-height: 1; }
.hn-plate small { font-family: var(--f-ui); font-size: 11.5px; color: #a79e8b; }
.hn-plate.on { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 12px rgba(241,212,138,.25); }
.hn-hudtx { min-height: 64px; margin-top: 8px; padding: 10px 14px; background: rgba(255,250,235,.6); border-left: 4px solid #8a7350; }
.hn-keys { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--f-ui); font-size: 15px; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 2px; text-align: center; background: linear-gradient(#fbf6e8, #d9ceb1); border: 1px solid #8a7b60; border-bottom-width: 3px; border-radius: 4px; font-family: var(--f-head); font-size: 13px; color: #2a2116; }
.hn-screen { display: grid; grid-template-columns: 1.1fr 2fr 1.1fr; grid-template-rows: auto 110px auto; gap: 4px; font-family: var(--f-ui); font-size: 13px; text-align: center; }
.hn-screen > div { padding: 6px; border: 1.5px dashed #8a7350; color: #3a3024; display: grid; place-items: center; }
.hn-screen .t { grid-column: 1 / 4; background: rgba(42,37,32,.12); }
.hn-screen .m { background: rgba(58,69,80,.18); font-family: var(--f-head); font-size: 17px; letter-spacing: .1em; text-transform: uppercase; }
.hn-screen .m small { font-family: var(--f-ui); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.hn-screen .b { grid-column: 1 / 4; background: rgba(122,36,24,.1); }
.hn-steps { display: flex; flex-direction: column; gap: 6px; counter-reset: s; }
.hn-step { display: grid; grid-template-columns: 34px 40px 1fr; gap: 10px; align-items: center; padding: 5px 12px; background: rgba(255,250,235,.6); border: 1px solid #c9bc9b; position: relative; }
.hn-step + .hn-step::before { content: ''; position: absolute; left: 28px; top: -9px; height: 9px; border-left: 2px dotted #8a7350; }
.hn-step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #7a2418; color: #ffe8a8; font-family: var(--f-head); font-size: 16px; }
.hn-step .i { font-size: 30px; color: #4a3d2b; }
.hn-step p { margin: 2px 0 0; font-size: 14.5px; color: #3a3024; }
.hn-odds { display: flex; gap: 6px; padding: 10px; background: #1f1d1a; border-radius: 4px; }
.hn-odds > div { flex: 1; text-align: center; padding: 6px; background: #2b2824; border-radius: 3px; color: #e9e0cb; }
.hn-odds b { color: #efe6d0; display: block; font-family: var(--f-head); font-weight: 400; font-size: 22px; }
.hn-odds span { font-family: var(--f-ui); font-size: 12px; color: #a79e8b; text-transform: uppercase; letter-spacing: .08em; }
.hn-odds .good b { color: #b6ea9a; } .hn-odds .mid b { color: #ffe39a; }
.hn-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; font-size: 14.5px; }
.hn-ars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hn-ars > div { display: flex; gap: 10px; padding: 10px; background: rgba(255,250,235,.6); border: 1px solid #c9bc9b; }
.hn-ars .i { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 26px; color: var(--gold); background: linear-gradient(#3d3832, #26231f); border: 1px solid #5a4d3c; border-radius: 4px; }
.hn-ars .g { flex: 1; }
.hn-ars p { margin: 2px 0 6px; font-size: 13.5px; line-height: 1.3; color: #3a3024; }
.hn-ars .noise { display: flex; gap: 3px; }
.hn-ars .noise::before { content: 'шум'; font-family: var(--f-ui); font-size: 11px; color: #7b6d57; margin-right: 4px; text-transform: uppercase; }
.hn-ars .noise i { width: 14px; height: 6px; margin-top: 4px; background: rgba(138,115,80,.25); }
.hn-ars .noise i.on { background: #9c2c1c; }
.hn-skills, .hn-progs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hn-progs { grid-template-columns: repeat(5, 1fr); }
.hn-skills > div, .hn-progs > div { padding: 8px 10px; background: rgba(255,250,235,.6); border: 1px solid #c9bc9b; font-size: 13px; line-height: 1.25; }
.hn-skills b, .hn-progs b { display: block; font-family: var(--f-head); font-weight: 400; font-size: 14.5px; }
.hn-skills span, .hn-progs span { color: #54493a; }
.hn-progs svg { font-size: 22px; color: #7a2418; margin-bottom: 3px; }
.hn-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.hn-feed > div { display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; }
.hn-feed svg { grid-row: 1 / 3; font-size: 26px; color: #7a2418; }
.hn-feed b { font-family: var(--f-head); font-weight: 400; font-size: 16px; letter-spacing: .04em; }
.hn-feed p { margin: 0; font-size: 14px; line-height: 1.35; color: #3a3024; }
.hn-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.hn-modes span { padding: 4px 10px; background: #2a2520; color: #e9e0cb; border-radius: 3px; font-family: var(--f-ui); font-size: 14px; }
.hn-modes svg { color: var(--bronze2); }
.hn-quiz { display: flex; flex-direction: column; gap: 12px; }
.hn-quiz .q > b { display: block; margin-bottom: 6px; font-size: 16px; }
.hn-quiz .a { display: flex; gap: 6px; flex-wrap: wrap; }
.hn-quiz button { padding: 6px 12px; background: rgba(255,250,235,.8); border: 1px solid #8a7350; border-radius: 3px; font-family: var(--f-serif); font-size: 14.5px; color: #2a2116; cursor: pointer; }
.hn-quiz button:hover:not(:disabled) { background: #fff8e2; border-color: #7a2418; }
.hn-quiz button:disabled { cursor: default; opacity: .55; }
.hn-quiz button.right { opacity: 1; background: #cfe3b8; border-color: #4f7d3a; }
.hn-quiz button.wrong { opacity: 1; background: #efc2b6; border-color: #9c2c1c; text-decoration: line-through; }
.hn-quiz .ex { margin-top: 4px; font-size: 14px; color: #3a3024; min-height: 1em; }
.hn-quiz .ex .ok { color: #3f6b2c; font-weight: 700; } .hn-quiz .ex .bad { color: #9c2c1c; font-weight: 700; }
.hn-verdict { display: flex; justify-content: center; min-height: 90px; margin-top: 10px; }
.hn-stamp { align-self: center; padding: 6px 22px; border: 4px double; font-family: var(--f-head); font-size: 30px; letter-spacing: .2em; text-transform: uppercase; text-align: center; transform: rotate(-9deg); animation: hnstamp .35s cubic-bezier(.2,1.6,.4,1); mix-blend-mode: multiply; }
.hn-stamp small { display: block; font-size: 13px; letter-spacing: .12em; }
.hn-stamp.ok { color: #2f6b2a; border-color: #2f6b2a; } .hn-stamp.bad { color: #9c2c1c; border-color: #9c2c1c; }
@keyframes hnstamp { from { transform: rotate(-9deg) scale(2.4); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: .9; } }
.hn-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 30px 14px; border-top: 1px solid #b9ac8c; }
.hn-foot .pg { font-family: var(--f-old); font-style: italic; color: #54493a; }
.hn-foot .btn { min-width: 130px; }
.hn-foot .btn:not(.pri) { color: #e9e0cb; }
@media (max-width: 820px) {
  .hn-folder { flex-direction: column; height: calc(100vh - 16px); }
  .hn-tabs { flex-direction: row; padding: 0; overflow-x: auto; gap: 2px; }
  .hn-tabs .tab { width: auto; margin: 0 0 -4px; border-radius: 6px 6px 0 0; font-size: 12px; padding: 7px 9px; }
  .hn-tabs .tab.on, .hn-tabs .tab:hover { transform: none; }
  .hn-tabs .tab span { display: none; } .hn-tabs .tab.on span { display: inline; }
  .hn-ends, .hn-skills, .hn-progs, .hn-hud { grid-template-columns: 1fr 1fr; }
  .hn-ars, .hn-two, .hn-feed { grid-template-columns: 1fr; }
  .hn-body, .hn-foot { padding-left: 16px; padding-right: 16px; } .hn-page h2 { margin: 8px 16px 4px; font-size: 23px; }
}
