/* Оперативная карта на тёмном сукне: малиновый пиджак и золотая цепь как два акцента */
:root {
  color-scheme: dark;
  --bg: #15121a; --panel: #1e1a25; --raise: #282331; --line: #3a3446;
  --fg: #efe8dc; --dim: #a39bad;
  --crimson: #c5284e; --crimson-hi: #e23d66; --gold: #dbb45c;
  --good: #6cc08a; --bad: #ee6a5f; --neutral: #3a3547;
  --display: 'Russo One', 'Arial Black', Impact, sans-serif;
  --body: 'PT Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'PT Mono', 'Courier New', monospace;
}
html, body { height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.4 var(--body); overflow: hidden; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
h2 { font-size: 22px; } h3 { font-size: 15px; margin-top: 18px; letter-spacing: .02em; }
p { margin: 8px 0; }
.muted { color: var(--dim); font-size: 13px; } h3 .muted { font-family: var(--body); }
.good { color: var(--good); } .bad { color: var(--bad); }

#app { height: 100%; display: flex; flex-direction: column; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px; gap: 10px; }
#top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font: 400 22px var(--display); color: var(--crimson-hi); letter-spacing: .04em; text-transform: uppercase; }
.brand span { font: 13px var(--mono); color: var(--gold); }
#stats { display: flex; flex: 1; flex-wrap: wrap; gap: 6px 16px; min-width: 0; }
.st { display: flex; align-items: center; gap: 7px; min-width: 54px; }
button.st { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 4px; text-align: left; color: inherit; font: inherit; }
button.st:hover { background: var(--raise); } button.st:hover span { color: var(--fg); }
.st > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.st > .ico { width: 24px; height: 24px; flex: none; color: var(--dim); }
.s-money .ico { color: var(--good); } .st.bad .ico { color: var(--bad); }
.s-men .ico { color: #d8cdbd; } .s-gun .ico { color: #a9b2c3; } .s-car .ico { color: var(--crimson-hi); }
.s-rep .ico { color: var(--gold); } .s-conn .ico { color: #7fa8d8; }
.heat .ico { color: var(--good); } .heat.l1 .ico { color: var(--gold); } .heat.l2 .ico { color: #e58a3c; } .heat.l3 .ico, .heat.l4 .ico { color: var(--bad); }
.st span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.st b { font: 400 18px var(--mono); font-variant-numeric: tabular-nums; }
.st i { font: normal 11px var(--mono); color: var(--dim); white-space: nowrap; }
.st.bad b { color: var(--bad); }
.st.heat { min-width: 170px; flex: 0 1 220px; }
.meter { position: relative; height: 10px; background: var(--neutral); margin: 6px 0 3px; border-radius: 2px; overflow: hidden; }
.meter em { position: absolute; inset: 0 auto 0 0; background: var(--good); }
.heat.l1 em { background: var(--gold); } .heat.l2 em { background: #e58a3c; } .heat.l3 em, .heat.l4 em { background: var(--bad); }
.meter s { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--bg); }
.pips { display: flex; gap: 4px; margin-top: 8px; }
.pips u { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); }
.pips u.on { background: var(--gold); }

.btn { background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 9px 14px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { opacity: .45; }
.btn small { font-size: 11px; color: var(--dim); }
.btn.primary { background: var(--crimson); border-color: var(--crimson); font-family: var(--display); letter-spacing: .03em; }
.btn.primary:hover:not(:disabled) { background: var(--crimson-hi); border-color: var(--crimson-hi); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.ghost { background: none; color: var(--dim); }
.btn.sm { padding: 4px 8px; font-size: 12px; }

main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 12px; }
#stage { position: relative; background: #100e15; border: 1px solid var(--line); border-radius: 6px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#mapview { position: relative; flex: 1; min-height: 0; }
#map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; }
.cell { fill: var(--neutral); stroke: #100e15; stroke-width: 1; fill-opacity: .7; transition: fill-opacity .15s; }
.cell.foe { fill-opacity: .7; }
.cell.mine { fill-opacity: .95; }
.cell.target { stroke: var(--fg); stroke-width: 1.3; stroke-dasharray: 3 2.5; }
.cell:hover { fill-opacity: .88; }
.cell.sel { stroke: var(--gold); stroke-width: 2.6; stroke-dasharray: none; }
#okb line { stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; opacity: .75; pointer-events: none; }
#rim { fill: none; stroke: var(--gold); stroke-width: 2.4; opacity: .75; pointer-events: none; }
.ent { fill: none; stroke: var(--fg); stroke-width: 1.1; pointer-events: none; opacity: .8; }
.ent.got { fill: var(--gold); stroke: var(--gold); opacity: 1; }
#labels text, #oklab text { text-anchor: middle; pointer-events: none; font-family: var(--body); }
#labels text { font-size: 5.6px; fill: var(--fg); paint-order: stroke; stroke: #100e15; stroke-width: 1.6px; display: none; font-weight: 700; }
#oklab text { font: 400 22px var(--display); fill: var(--fg); opacity: .32; }
#map.zoomed #labels text { display: block; }
#map.zoomed #oklab text { display: none; }
#map:not(.zoomed) .ent { display: none; }
#zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
#zoom button { width: 36px; height: 36px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; font-size: 18px; }
#legend { position: absolute; left: 10px; bottom: 8px; margin: 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--dim); pointer-events: none; }
#legend span { display: flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; display: inline-block; }
.lg.mine { background: var(--fg); } .lg.target { border: 1.5px dashed var(--fg); } .lg.ent { border: 1.5px solid var(--fg); transform: rotate(45deg) scale(.75); }

#side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
#pane { flex: 1; overflow-y: auto; padding: 14px; min-height: 0; }
.sub { color: var(--gold); font-size: 13px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; font-family: var(--mono); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.box { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; margin-top: 12px; }
.box h3 { margin-top: 0; }
.box.live { border-color: var(--good); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.card:hover:not(:disabled) { border-color: var(--gold); }
.card:disabled { opacity: .5; }
.card b { font-weight: 700; } .card span { font: 12px var(--mono); color: var(--dim); } .card small { font-size: 11px; color: var(--gold); }
.card em { position: absolute; right: 8px; top: 8px; font: normal 11px var(--mono); color: var(--dim); }
.card.atk:hover:not(:disabled) { border-color: var(--crimson-hi); }
.tag { font: 10px var(--mono); padding: 1px 5px; border-radius: 2px; border: 1px solid; align-self: flex-start; text-transform: uppercase; letter-spacing: .05em; vertical-align: middle; }
.tag.w { color: var(--fg); } .tag.g { color: var(--dim); } .tag.b { color: var(--crimson-hi); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips span { background: var(--raise); padding: 2px 8px; border-radius: 3px; font-size: 13px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.tbl td, .tbl th { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 400; }
.tbl td:last-child { text-align: right; font-family: var(--mono); white-space: nowrap; }
.tbl .sum td { font-weight: 700; border-bottom: 0; } .tbl .dead { opacity: .4; } .tbl .link { cursor: pointer; }
.clans td:nth-child(2), .clans td:nth-child(3) { font-family: var(--mono); }
.ladder, .steps { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.ladder li { padding: 6px 10px; border-left: 3px solid var(--line); display: flex; flex-direction: column; }
.ladder li span { font-size: 12px; color: var(--dim); }
.ladder li.past { border-color: var(--gold); } .ladder li.cur { border-color: var(--bad); background: var(--raise); }
.steps { counter-reset: s; }
.steps li { counter-increment: s; font-size: 13px; color: var(--dim); }
.steps li::before { content: counter(s) '. '; font-family: var(--mono); }
.steps li.done { color: var(--good); } .steps li.cur { color: var(--fg); font-weight: 700; }
.log { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.log time { display: block; font: 11px var(--mono); color: var(--dim); }
.log .good { color: var(--good); } .log .bad, .log .law { color: var(--bad); } .log .big { color: var(--gold); }

#modal { position: fixed; inset: 0; background: rgba(8, 6, 12, .78); display: flex; align-items: center; justify-content: center; padding: 16px; padding-top: max(16px, env(safe-area-inset-top, 0px)); padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 20; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--crimson); border-radius: 6px; padding: 22px; width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; }
.sheet.start { max-width: 760px; }
.sheet h1 { font-size: clamp(38px, 9vw, 64px); color: var(--crimson-hi); text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.eyebrow { font: 12px var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; }
.lead { font-size: 16px; max-width: 62ch; }
.report { display: flex; flex-direction: column; gap: 4px; font-size: 13px; border-left: 3px solid var(--line); padding-left: 10px; margin-bottom: 14px; color: var(--dim); }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.opt { background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; text-align: left; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.opt span { flex: 1; min-width: 60%; } .opt em { font: normal 12px var(--mono); color: var(--gold); } .opt small { width: 100%; font-size: 11px; color: var(--bad); }
.opt:hover:not(:disabled) { border-color: var(--gold); } .opt:disabled { opacity: .5; }
.deltas { display: flex; flex-wrap: wrap; gap: 8px; font: 14px var(--mono); }
.deltas span { background: var(--raise); padding: 3px 8px; border-radius: 3px; }
.factions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 10px; }
.fac { background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px 10px 20px; text-align: left; display: flex; flex-direction: column; gap: 2px; position: relative; }
.fac i { position: absolute; left: 8px; top: 13px; width: 8px; height: 8px; border-radius: 50%; }
.fac b { font-family: var(--display); font-weight: 400; } .fac span { font: 12px var(--mono); color: var(--gold); } .fac small { font-size: 12px; color: var(--dim); }
.fac:hover { border-color: var(--gold); }
#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 4px; font-weight: 700; max-width: calc(100% - 32px); z-index: 30; text-align: center; }
#toast.bad { background: var(--bad); }

@media (max-width: 860px) {
  body { font-size: 14px; }
  main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 50fr) minmax(0, 50fr); gap: 8px; }
  main.wide { grid-template-rows: minmax(0, 1fr); }
  .node { width: calc(50% - 4px); }
  .node.boss { width: 100%; }
  #org { padding: 10px; }
  #app { gap: 8px; padding-block: 8px; }
  #top { gap: 8px 12px; }
  .brand b { font-size: 17px; }
  #stats { order: 3; flex-basis: 100%; gap: 4px 12px; }
  .st { min-width: 0; gap: 5px; } .st b { font-size: 15px; } .st span { font-size: 10px; }
  .st > .ico { width: 18px; height: 18px; }
  .st:not(.heat):not(.ap) span { display: none; } /* на телефоне подпись заменяет значок */
  .st.heat { flex: 1 1 150px; min-width: 150px; }
  #end { margin-left: auto; padding: 7px 12px; }
  #menu button { padding: 8px 12px; font-size: 14px; }
  #page { padding: 14px 12px 24px; }
  .sheet { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* меню и лобби онлайна */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 28px; margin-top: 6px; }
.modes section { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; margin-top: 8px; }
.field span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.field input { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; min-width: 0; width: 100%; }
.field input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
h3 .btn.sm { float: right; font-family: var(--body); }
code { font-family: var(--mono); color: var(--gold); }
.fac.slot { cursor: default; }
.fac.slot:hover { border-color: var(--line); }
.fac.slot em { font: normal 12px var(--mono); color: var(--fg); margin-top: 4px; }
.fac.slot .row { margin-top: 6px; min-height: 26px; }
.fac.slot.off { opacity: .45; }
.fac.slot.human { border-color: var(--gold); }
.fac.slot.mine { border-color: var(--crimson-hi); background: #2f1f2c; }
.btn.primary.waiting { background: var(--raise); border-color: var(--gold); font-family: var(--body); font-size: 13px; }

/* бизнес: список районов */
.dlist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.drow { border: 1px solid var(--line); border-radius: 4px; }
.drow.open { border-color: var(--gold); }
.dhead { width: 100%; background: none; border: 0; padding: 9px 12px; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; }
.dhead b { font-weight: 700; } .dhead span { grid-column: 1; font-size: 12px; color: var(--dim); }
.dhead em { grid-column: 2; grid-row: 1; font: normal 14px var(--mono); color: var(--good); text-align: right; }
.dhead i { grid-column: 2; grid-row: 2; font: normal 11px var(--mono); color: var(--gold); text-align: right; }
.dhead:hover b { color: var(--gold); }
.dbody { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.dbody h3 { margin-top: 12px; }
.pts td { vertical-align: middle; } .lv { font: 400 12px var(--mono); color: var(--gold); }
#music, #mnext { padding: 9px 12px; font-size: 13px; color: var(--dim); flex-direction: row; gap: 6px; }
#music .ico, #mnext .ico { width: 15px; height: 15px; flex: none; }
/* у плеера постоянная ширина: название трека не двигает шапку */
#music { width: 172px; justify-content: flex-start; }
#music span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mnext.off { visibility: hidden; }
#music[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
#mnext { padding-inline: 10px; margin-left: -8px; }
@media (max-width: 860px) { #music, #mnext { padding: 7px 10px; } #music { margin-left: auto; } #music ~ #end { margin-left: 0; } #music { width: auto; } #music span { display: none; } }

/* главный экран: схема бригады */
#org { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; }
.tlabel { text-align: center; font: 11px var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .12em; margin: 0; padding: 22px 0 10px; position: relative; }
.tlabel::before { content: ""; position: absolute; left: 50%; top: 0; height: 16px; border-left: 1px solid var(--gold); opacity: .5; }
.tier { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.node { width: 196px; background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px 9px; text-align: left; display: flex; flex-direction: column; gap: 1px; position: relative; min-width: 0; }
.node:hover { border-color: var(--gold); }
.node.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); background: #2f2a1f; }
.node .role { font: 10px var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.node b { font: 400 15px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node small { font-size: 12px; color: var(--dim); }
.node .zv { font: 11px var(--mono); color: var(--fg); }
.node.boss { width: 300px; border-color: var(--crimson); border-top-width: 3px; }
.node.boss:hover { border-color: var(--crimson-hi); }
.node.boss.sel { border-color: var(--crimson-hi); box-shadow: 0 0 0 1px var(--crimson-hi); background: #2f1d25; }
/* основание схемы: рядовые, арсенал, гараж */
.unit { width: 196px; background: #1b1822; border: 1px solid var(--line); border-bottom: 3px solid var(--gold); border-radius: 4px; padding: 10px; text-align: left; display: flex; gap: 10px; align-items: center; min-width: 0; }
.unit:hover { border-color: var(--gold); }
.unit.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); background: #2f2a1f; }
.unit .ico { width: 34px; height: 34px; flex: none; color: var(--gold); }
.unit .nb { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.unit .role { font: 10px var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.unit b { font: 400 16px var(--display); white-space: nowrap; }
.unit small { font-size: 12px; color: var(--dim); }
.unit small.bad { color: var(--bad); }
.back { margin: 0 0 10px; padding-left: 0; }
.node.boss b { font-size: 20px; color: var(--crimson-hi); }
.bossline { font: 12px var(--mono); color: var(--fg); margin-top: 4px; }
.node.vacant { background: none; border-style: dashed; }
.node.vacant b { color: var(--dim); }
.node.vacant small { color: var(--gold); }
.node.out { opacity: .6; }
.badge { position: absolute; right: 8px; top: 7px; font: normal 10px var(--mono); color: var(--bad); border: 1px solid var(--bad); border-radius: 2px; padding: 0 4px; text-transform: uppercase; }
.mini { display: grid; grid-template-columns: auto 1fr 16px; align-items: center; gap: 2px 6px; margin-top: 6px; font-size: 11px; }
.mini i { font-style: normal; color: var(--dim); }
.mini u, .stat u { display: block; height: 4px; background: var(--neutral); border-radius: 2px; overflow: hidden; text-decoration: none; }
.mini s, .stat s { display: block; height: 100%; background: var(--gold); }
.mini b { font: 11px var(--mono); color: var(--fg); text-align: right; white-space: normal; }
/* досье */
.pnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font: 12px var(--mono); color: var(--dim); }
.lead2 { font-size: 15px; }
.stats { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.stat { display: grid; grid-template-columns: 80px 24px 1fr; align-items: center; gap: 8px; }
.stat i { font-style: normal; color: var(--dim); font-size: 13px; }
.stat b { font: 15px var(--mono); }
.stat u { height: 6px; }
select.pick { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin: 6px 0 10px; }
.cand { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin-top: 8px; }
.cand > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cand small { font-size: 12px; color: var(--dim); }
.cand p { margin: 6px 0 0; font-size: 13px; }
.cbtn { display: flex; flex-direction: column; gap: 6px; }
button.link { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 2px; font: inherit; text-align: left; }
/* польза точек */
.perk { display: block; font: normal 11px var(--body); color: var(--gold); margin-top: 2px; }
.card i.perk { font-style: normal; }

/* меню разделов под шапкой */
#bar { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); margin-top: -2px; }
#menu { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
/* ходы — сразу после вкладок */
#ap { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; border-left: 1px solid var(--line); }
#ap:empty { display: none; }
#ap span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
#ap .pips { margin-top: 0; }
#ap b { font: 400 13px var(--mono); color: var(--dim); }
@media (max-width: 860px) { #ap { padding: 0 2px 0 10px; } #ap span, #ap b { display: none; } }
.info { width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--gold); background: none; color: var(--gold); font: italic 700 12px/18px Georgia, serif; padding: 0; vertical-align: 1px; }
.info:hover { background: var(--gold); color: var(--bg); }
#menu button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 18px 9px; color: var(--dim); font: 400 16px var(--display); letter-spacing: .03em; white-space: nowrap; }
#menu button:hover { color: var(--fg); }
#menu button.on { color: var(--fg); border-bottom-color: var(--crimson-hi); }
main.wide { grid-template-columns: minmax(0, 1fr); }
#side[hidden] { display: none; }
#page { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 32px; background: var(--panel); }
#page .inner { max-width: 760px; margin: 0 auto; }
#page .inner.wide { max-width: 1240px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px 32px; align-items: start; }
.cols > section { min-width: 0; }
@media (max-width: 420px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { #menu button { padding: 7px 10px 8px; font-size: 14px; } #page { padding: 14px 12px 24px; } }

/* картинки: здания, лица, арсенал, гараж */
svg.art { display: block; width: 100%; height: auto; }
svg.art.bld { aspect-ratio: 120 / 72; }
svg.art.arm, svg.art.car { aspect-ratio: 120 / 48; }
svg.art.face { aspect-ratio: 1; }
.ava { display: block; width: 46px; height: 46px; border-radius: 4px; overflow: hidden; flex: none; background: var(--raise); }
.ava svg { width: 100%; height: 100%; }
.ava.big { width: 104px; height: 104px; border: 1px solid var(--line); }
.ava.xs { display: inline-block; width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; border-radius: 3px; }
.node { flex-direction: row; gap: 9px; align-items: flex-start; }
.node .nb { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.node.boss .ava { width: 64px; height: 64px; }
.node.vacant .ava { opacity: .6; }
.node.legend { border-color: #6b5a2e; }
.node.legend .role { color: #ffcf5a; }
.dhero { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.dhero > div { min-width: 0; }
.cand { align-items: flex-start; }
.card.offc { padding-left: 62px; min-height: 66px; }
.card.offc .ava { position: absolute; left: 8px; top: 8px; width: 46px; height: 46px; }
.fac { padding-right: 58px; }
.fac .ava { position: absolute; right: 8px; top: 8px; width: 42px; height: 42px; }
.evwho { display: flex; gap: 12px; align-items: center; margin: 10px 0 4px; padding: 8px; background: var(--raise); border-radius: 4px; border-left: 3px solid var(--gold); }
.evwho .ava { width: 64px; height: 64px; }
.evwho b { font: 400 17px var(--display); display: block; color: var(--gold); }
.evwho small { font-size: 13px; color: var(--dim); display: block; }
/* точки района */
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.ptile { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; background: var(--raise); }
.pimg { position: relative; }
.lvb { position: absolute; left: 6px; top: 6px; font: 400 13px var(--mono); color: var(--bg); background: var(--gold); padding: 0 6px; border-radius: 2px; }
.pinfo { padding: 7px 10px 4px; display: flex; flex-direction: column; gap: 1px; }
.pinfo span { font: 13px var(--mono); }
.pmax { margin: 0; padding: 4px 10px 9px; }
.btn.pup { margin: 4px 8px 8px; flex-direction: row; gap: 8px; text-align: left; padding: 5px 8px; }
.btn.pup small { display: block; font-size: 11px; color: var(--good); }
.pnext { width: 52px; flex: none; border-radius: 2px; overflow: hidden; opacity: .9; }
.card.bcard { padding: 0 0 8px; overflow: hidden; }
.card.bcard > :not(svg) { margin-left: 10px; margin-right: 10px; }
.card.bcard svg { margin-bottom: 6px; }
.card.bcard .tag { margin-left: 10px; }
/* арсенал и гараж */
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.item { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--raise); display: flex; flex-direction: column; }
.item.locked { opacity: .5; }
.ii { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ii small { font-size: 12px; color: var(--gold); }
.ii span { font: 12px var(--mono); color: var(--fg); }
.ii i { font-style: normal; font-size: 12px; color: var(--dim); flex: 1; }
.ii .row { margin-top: 6px; gap: 6px; }
.ii .row .btn { flex: 1; }
@media (max-width: 860px) { .node .ava { width: 38px; height: 38px; } .unit { width: calc(50% - 4px); padding: 8px; gap: 8px; } .unit .ico { width: 26px; height: 26px; } .unit b { font-size: 14px; } .node.boss { width: 100%; } .ptiles, .shop { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.dhero h2 { font-size: 21px; }
.node small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* выбор сложности */
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.seg > span { font: 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
.seg button { background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; font-size: 14px; }
.seg button.on { border-color: var(--gold); color: var(--gold); }
.seg small { flex-basis: 100%; font-size: 12px; color: var(--dim); }
/* районы по группам */
.dgroup { margin-top: 22px; }
.dgroup > h3 .muted, .dgh h3 .muted { font-size: 13px; }
.dgroup > p.muted { margin: 4px 0 0; }
.dgroup .dlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.dgroup .drow.open { grid-column: 1 / -1; }
.dgh { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; text-align: left; }
.dgh i { font: normal 12px var(--mono); color: var(--gold); }
.dgh:hover h3 { color: var(--gold); }
.dgroup.done .drow { opacity: .85; }
@media (max-width: 420px) { .dgroup .dlist { grid-template-columns: minmax(0, 1fr); } }
.fxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-top: 8px; }
.fxgrid div { background: var(--raise); border-radius: 3px; padding: 5px 9px; display: flex; flex-direction: column; }
.fxgrid span { font-size: 12px; color: var(--dim); }
.fxgrid b { font: 400 14px var(--mono); }
@media (max-width: 420px) { .fxgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* смотрящие на схеме */
.wchip { display: flex; gap: 8px; align-items: center; background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 5px 10px 5px 5px; text-align: left; min-width: 0; max-width: 200px; }
.wchip:hover, .wchip.sel { border-color: var(--gold); }
.wchip.out { opacity: .6; }
.wchip .ava { width: 32px; height: 32px; }
.wchip span:last-child { display: flex; flex-direction: column; min-width: 0; }
.wchip b { font: 400 13px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wchip small { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tier.promo { margin-top: 10px; }
/* перестрелка */
.sheet.battle { max-width: 640px; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; margin: 12px 0 6px; }
.vs > i { font: 400 22px var(--display); color: var(--crimson-hi); font-style: normal; align-self: center; }
.vs > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--raise); border-radius: 4px; padding: 10px; }
.vs .ava { width: 56px; height: 56px; }
.vs b { font: 400 15px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs small { font: 12px var(--mono); color: var(--dim); }
.bbar { position: relative; height: 10px; background: var(--neutral); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.bbar em { position: absolute; inset: 0 auto 0 0; transition: width .3s; }
.bbar.our em { background: var(--good); } .bbar.their em { background: var(--crimson-hi); }
.bbar s { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); }
.blog { margin: 8px 0; padding-left: 20px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.blog span { float: right; font: 12px var(--mono); } .blog em { font-style: normal; margin-left: 8px; }
.tacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.tacts .card span { font-family: var(--body); }
.tacts .card.ghost { background: none; }
/* стрелка */
.relm { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin: 12px 0; font-size: 13px; }
.relm > span { color: var(--dim); }
.relm > div { position: relative; height: 8px; background: var(--neutral); border-radius: 2px; overflow: hidden; }
.relm em { position: absolute; top: 0; bottom: 0; } .relm em.pos { background: var(--good); } .relm em.neg { background: var(--bad); }
.relm s { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--fg); }
.relm b { font: 13px var(--mono); }
.clans small { font: 11px var(--mono); margin-left: 34px; }
@media (max-width: 520px) { .vs { grid-template-columns: 1fr; } .vs > i { display: none; } }
@media (max-width: 520px) {
  .vs > div { display: block; }
  .vs .ava { float: left; width: 44px; height: 44px; margin-right: 10px; }
  .vs b, .vs small { display: block; }
  .vs .bbar { clear: both; }
  .tacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* крупные дела: картинка вылета на делюгу */
.dpic { position: relative; margin: -2px 0 10px; border-radius: 4px; overflow: hidden; aspect-ratio: 240 / 96; background: #1d1a24; }
.dpic .art { display: block; width: 100%; height: 100%; }
.dpic em { position: absolute; left: 8px; top: 7px; font: normal 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #f3ede0; background: rgba(21, 18, 26, .72); padding: 2px 7px; border-radius: 3px; }
.proj.live .dpic em { color: var(--good); }
.proj.locked .dpic .art { filter: grayscale(.6) brightness(.8); }
.projs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; align-items: start; margin-top: 12px; }
.projs .box.proj { margin: 0; }

/* Власть: люди во власти строками, «занести» отдельной кнопкой */
.lawhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bribe { display: flex; align-items: center; gap: 10px; background: #2b2316; border: 1px solid var(--gold); border-radius: 6px; padding: 10px 16px 10px 12px; text-align: left; color: var(--fg); }
.bribe:hover:not(:disabled) { background: #3a2f1a; }
.bribe:disabled { opacity: .5; border-color: var(--line); background: var(--raise); }
.bribe .ico { width: 30px; height: 30px; color: var(--good); flex: none; }
.bribe span { display: flex; flex-direction: column; }
.bribe b { font: 400 16px var(--display); color: var(--gold); }
.bribe small { font: 12px var(--mono); color: var(--dim); }
.bribe i { font-style: normal; font-size: 11px; color: var(--bad); }
.offs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.offrow { display: grid; grid-template-columns: 230px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 6px; background: var(--raise); overflow: hidden; }
.offrow.have { border-color: #5a4a2a; }
.offrow.soon { opacity: .55; }
.offwho { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: #1d1a24; border-right: 1px solid var(--line); }
.offwho .ava { width: 56px; height: 56px; }
.offwho > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.offwho b { font: 400 15px var(--display); }
.offwho small { font-size: 12px; color: var(--dim); }
.offwho .pips { margin-top: 0; } .offwho .pips u { width: 10px; height: 10px; }
.offwhat { padding: 10px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.offwhat p { margin: 0; }
.offwhat .fx { font: 12px var(--mono); color: var(--dim); }
@media (max-width: 600px) {
  .offrow { grid-template-columns: minmax(0, 1fr); }
  .offwho { border-right: 0; border-bottom: 1px solid var(--line); }
  .bribe { width: 100%; }
}

/* строка под меню: плюшки империи и кто у власти */
#strip { display: flex; align-items: center; gap: 8px 16px; margin-top: -4px; min-height: 26px; font-size: 12px; }
#strip:empty, #perks:empty { display: none; }
/* все плюшки перед глазами: переносятся на новую строку, без прокрутки */
#perks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; flex: 1; min-width: 0; }
#perks .slabel { color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
#perks .perk { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 1px 8px; color: var(--dim); white-space: nowrap; }
#perks .perk b { color: var(--good); font: 400 12px var(--mono); }
#perks .perk.max { border-color: var(--gold); }
@media (max-width: 860px) { #strip { flex-wrap: wrap; gap: 4px 12px; } #perks { flex-basis: 100%; } }
/* районы: особенности и стройка */
.traits { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.trait { font-size: 12px; padding: 2px 9px; border-radius: 12px; background: #2f2a1f; border: 1px solid #5a4a2a; color: var(--gold); cursor: help; }
.card.bcard .btag { position: absolute; top: 6px; left: 6px; right: auto; margin: 0; font: normal 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 3px; background: var(--crimson); color: #fff; }
.card.bcard .btag.fit { background: #2e5a3a; }
.card.bcard.special { border-color: var(--crimson); }
.card.bcard.fit { border-color: #3d6b45; }
/* Власть: кто наверху — просто для атмосферы */
.rulers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px; margin-top: 14px; }
.ruler { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(90deg, #232030, var(--raise)); }
.ruler .ava { width: 64px; height: 64px; }
.ruler .eyebrow { margin: 0 0 2px; font-size: 10px; }
.ruler b { font: 400 16px var(--display); }
.ruler b i { font: normal 12px var(--mono); color: var(--gold); }
.ruler small { display: block; font: 11px var(--mono); color: var(--dim); margin-top: 2px; }
.ruler p { margin: 6px 0 0; font-size: 13px; color: var(--dim); }
/* фото снаряжения и машин: рамка как у рисунков, подпись автора поверх */
.photo { position: relative; margin: 0; aspect-ratio: 2 / 1; background: #1d1a24; overflow: hidden; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 1px 6px; background: rgba(21, 18, 26, .72); border-top-left-radius: 3px; font: 9px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo figcaption a { color: var(--dim); text-decoration: none; }
.photo figcaption a:hover { color: var(--fg); text-decoration: underline; }
.item.locked .photo img { filter: grayscale(.8); }
/* «Путь наверх»: задание наставника */
.quest { border: 1px solid #5a4a2a; border-left: 3px solid var(--gold); border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; background: linear-gradient(180deg, #2b2418, var(--panel)); }
.quest.done { border-color: var(--good); border-left-color: var(--good); }
.qhead { display: flex; gap: 10px; align-items: center; }
.qhead .ava { width: 44px; height: 44px; }
.qhead .eyebrow { margin: 0; font-size: 10px; }
.qhead b { font: 400 16px var(--display); display: block; }
.qhead small { font-size: 11px; color: var(--dim); }
.quest p { font-size: 13px; margin: 8px 0 0; }
.quest .qhow { color: var(--gold); }
.quest.done .qhow { color: var(--good); }
.quest .row { margin-top: 8px; gap: 6px; flex-wrap: wrap; }

/* ================= телефон ================= */
#tabbar, #apm, #sheethead, #mylist, .mquest, .st .hnum { display: none; }
#strip .slabel { background: none; border: 0; padding: 0; font: inherit; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; cursor: default; }
#strip .slabel i { display: none; }
@media (max-width: 860px) {
  #app { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); gap: 6px; padding-top: 6px; }
  /* шапка: строка с датой, ходами, музыкой и кнопкой месяца; ниже показатели в одну строку */
  #top { gap: 6px 8px; flex-wrap: wrap; }
  .brand b { font-size: 15px; } .brand span { font-size: 12px; }
  #apm { display: flex; align-items: center; } #apm .pips { margin: 0; gap: 3px; } #apm .pips u { width: 10px; height: 10px; border-width: 2px; }
  #music, #mnext { padding: 6px 8px; } #music { margin-left: auto; } #mnext.off { display: none; }
  #end { margin-left: 0; padding: 7px 12px; font-size: 14px; }
  #stats { order: 3; flex-basis: 100%; display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 2px; }
  #stats .st { flex: 0 1 auto; min-width: 0; gap: 3px; padding: 4px 3px; margin: 0; }
  #stats .st > div span, #stats .st > div i { display: none; }
  #stats .st b { font-size: 14px; }
  #stats .st.heat > div { display: none; }
  #stats .st > .ico { width: 17px; height: 17px; }
  #stats .st.heat { flex: 0 1 auto; min-width: 0; }
  #stats .st .hnum { display: block; }
  /* меню разделов — внизу экрана */
  #bar { display: none; }
  #tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #120f17; border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  #tabbar button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px; color: var(--dim); font-size: 10px; min-width: 0; border-radius: 6px; }
  #tabbar .ico { width: 22px; height: 22px; }
  #tabbar button.on { color: var(--fg); background: var(--raise); }
  #tabbar button.on .ico { color: var(--crimson-hi); }
  #tabbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* плюшки свёрнуты в одну строку, раскрываются по нажатию */
  #strip { margin-top: 0; min-height: 0; }
  #strip .slabel { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 2px 0; }
  #strip .slabel i { display: inline; font-style: normal; color: var(--gold); }
  #strip:not(.open) .perk, #strip:not(.open) #perks .muted { display: none; }
  /* схема и карта — на весь экран, подробности выезжают снизу */
  main, main.wide { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0; }
  #side, #side[hidden] { display: flex; position: fixed; z-index: 45; left: 0; right: 0; top: 8vh; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); border-radius: 14px 14px 0 0; border-bottom: 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .65); transform: translateY(110%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
  main.msheet #side { transform: none; visibility: visible; transition: transform .22s ease; }
  main.wide #side { display: none; }
  #sheethead { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  #sheethead b { font: 400 16px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #pane { padding: 12px 14px 24px; }
  #pane .quest { display: none; }
  .mquest { display: block; } .mquest:empty { display: none; }
  #org { padding: 10px 8px 24px; }
  /* карта: без легенды, кнопка списка районов */
  #legend { display: none; }
  #mylist { display: inline-flex; position: absolute; left: 10px; bottom: 10px; flex-direction: row; background: var(--panel); }
  #zoom button { width: 40px; height: 40px; }
  /* кнопки удобнее для пальца */
  .btn.sm { padding: 7px 10px; font-size: 13px; }
  .opt { padding: 12px; }
}
@media (max-width: 860px) {
  #modal { z-index: 60; }
  #toast { z-index: 70; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

/* ================= анимация событий ================= */
.sheet { animation: sheetIn .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.opts .opt { animation: optIn .35s both; }
.opts .opt:nth-child(2) { animation-delay: .06s; } .opts .opt:nth-child(3) { animation-delay: .12s; } .opts .opt:nth-child(4) { animation-delay: .18s; } .opts .opt:nth-child(5) { animation-delay: .24s; }
@keyframes optIn { from { opacity: 0; transform: translateX(-10px); } }
.deltas span { animation: popIn .4s both; }
.deltas span:nth-child(2) { animation-delay: .08s; } .deltas span:nth-child(3) { animation-delay: .16s; } .deltas span:nth-child(4) { animation-delay: .24s; } .deltas span:nth-child(n+5) { animation-delay: .32s; }
@keyframes popIn { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } }
.evscene { margin: -22px -22px 14px; height: 96px; overflow: hidden; border-bottom: 1px solid var(--line); background: #0d0b10; }
.evscene .evsc { display: block; width: 100%; height: 100%; }
@media (max-width: 860px) { .evscene { margin: -16px -16px 12px; height: 84px; } }
.an-snow, .an-rain { animation: fall 6s linear infinite; }
.an-rain { animation-duration: .9s; }
.an-snow.an-d2 { animation-delay: -3s; } .an-rain.an-d2 { animation-delay: -.45s; }
@keyframes fall { from { transform: translateY(-80px); } to { transform: translateY(0); } }
.an-scan { animation: scan .18s steps(2) infinite; }
@keyframes scan { 50% { opacity: .4; transform: translateY(1px); } }
.an-glow { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .35; } }
.an-blink-r, .an-beam-r { animation: blink .6s steps(1) infinite; }
.an-blink-b, .an-beam-b { animation: blink .6s steps(1) infinite; animation-delay: -.3s; }
@keyframes blink { 50% { opacity: .1; } }
.an-sway { transform-box: view-box; transform-origin: 120px 0; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.an-smoke { transform-box: fill-box; transform-origin: 50% 100%; animation: smoke 2.6s ease-in-out infinite; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(4px) scaleX(.8); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px) scaleX(1.3); } }
.an-flicker { animation: flicker 4s linear infinite; }
@keyframes flicker { 0%, 18%, 22%, 60%, 64%, 100% { opacity: 1; } 20%, 62% { opacity: .2; } }
.an-drive { animation: drive 5.5s linear infinite; }
@keyframes drive { from { transform: translateX(-60px); } to { transform: translateX(300px); } }
.cashrain { position: absolute; inset: 0 0 auto 0; height: 60%; pointer-events: none; overflow: hidden; }
.sheet { position: relative; }
.cashrain .cash { width: 100%; height: 100%; }
.an-fall { animation: cashfall 1.6s ease-in both; }
@keyframes cashfall { from { transform: translate(var(--x), -10px) rotate(-20deg); opacity: 1; } to { transform: translate(var(--x), 70px) rotate(25deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .opts .opt, .deltas span, [class*="an-"] { animation: none !important; } .cashrain { display: none; } }
/* донат в конце игры */
.donate { margin-top: 16px; padding: 12px 14px; border: 1px solid #5a4a2a; border-radius: 6px; background: #2b2418; }
.donate p { margin: 0 0 10px; font-size: 14px; }
.donate .drow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.donate .drow span { display: flex; flex-direction: column; } .donate .drow b { font: 400 17px var(--display); color: #ffdd2d; } .donate .drow small { font-size: 12px; color: var(--dim); }
.donate .btn { font: 400 18px var(--mono); color: var(--gold); border-color: var(--gold); }
.donate .btn small { font: 11px var(--body); color: var(--dim); }
.box.rec { margin: 8px 0 14px; } .box.rec p { margin: 0 0 4px; font-size: 13px; color: var(--dim); }

/* статус */
.sth { margin-top: 28px; }
.stgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; margin-top: 10px; }
.box.stat { margin: 0; display: flex; flex-direction: column; }
.box.stat h3 { margin-top: 2px; }
.box.stat p { font-size: 13px; margin: 6px 0 0; }
.box.stat .btn { margin-top: auto; } .box.stat p.good { margin-bottom: 10px; }
.box.stat.own { border-color: var(--gold); background: #2b2418; }
.box.stat .owned { color: var(--gold); font: 400 15px var(--display); margin-top: auto; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; } .seg .btn.on { border-color: var(--gold); color: var(--gold); background: #2b2418; }

/* достижения и рекорды */
.achg { font: 11px var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 6px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 6px; }
.ach { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; opacity: .55; display: flex; flex-direction: column; gap: 2px; }
.ach b { font-size: 13px; } .ach small { font-size: 11px; color: var(--dim); }
.ach.got { opacity: .9; border-color: #5a4a2a; }
.ach.now { opacity: 1; border-color: var(--gold); background: #2b2418; }
.recs td small { font-size: 11px; }
#sfx { padding: 9px 10px; color: var(--dim); } #sfx .ico { width: 16px; height: 16px; } #sfx[aria-pressed="true"] { color: var(--gold); } #sfx.off .w { opacity: .15; }
@media (max-width: 860px) { #sfx { padding: 6px 8px; } }
.box.install { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; border-color: #5a4a2a; } .box.install p { margin: 0 0 6px; }
.box.cloud .code { font: 400 20px var(--mono); color: var(--gold); letter-spacing: .08em; }
.cloadrow { margin: 6px 0 12px; } .cloadrow .field { flex: 1; } .cloadrow input { text-transform: uppercase; font-family: var(--mono); }

/* кубики в перестрелке */
.units { font: 12px var(--mono); color: var(--dim); margin: 4px 0 8px; } .units b { color: var(--fg); font-weight: 400; }
.blog .dice { display: block; font: 12px var(--mono); color: var(--dim); margin-top: 2px; }
.blog .dice i { font-style: normal; font-size: 18px; color: var(--gold); letter-spacing: 1px; vertical-align: -2px; }
/* Telegram: свой заголовок у Телеграма, отступы под его панели */
html.tg #app { padding-top: 4px; }
