:root {
  --bg: #0b1410; --panel: #12201a; --panel2: #182b22; --line: #2a4436;
  --text: #eef5f0; --muted: #8fa89a; --accent: #ffd23f; --accent2: #3ee08f; --nitro: #ffb13b; --danger: #ff5a5f;
  --zr: #3ee08f; --zc: #58a6ff; --zi: #ffd23f; --zo: #b48cff;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.h { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em; }
@keyframes fin { from { opacity: 0; transform: translateY(-4px); } }

/* ------------------------------------------------------------ HUD (phone portrait) */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud .pin, #hud .tray, #hud .panel, #hud .feed div, #hud .ovl { pointer-events: auto; }
.box { background: rgba(8, 14, 11, .86); border: 1px solid #ffffff22; border-radius: 12px; box-shadow: 0 6px 20px #0008; }
.money { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); padding: 5px 11px 7px; min-width: 124px; text-align: left; }
.money b { display: block; white-space: nowrap; font-size: 21px; font-weight: 900; font-style: italic; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums; }
.money b.neg { color: #ff8a8d; }
.money span { display: block; white-space: nowrap; font-size: 10.5px; font-weight: 900; color: var(--accent2); margin-top: 2px; }
.money span.bad { color: #ff8a8d; }
.date { position: absolute; top: calc(10px + var(--sat)); right: calc(60px + var(--sar)); padding: 5px 9px 6px; text-align: center; white-space: nowrap; }
.date b { display: block; font-size: 14px; font-weight: 900; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.spd { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.spd button { font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 6px; background: #ffffff12; color: var(--muted); min-width: 28px; }
.spd button.sel { background: var(--accent); color: #1a1400; }
.mbtn { position: absolute; top: calc(12px + var(--sat)); right: calc(12px + var(--sar)); width: 40px; height: 40px; border-radius: 11px; border: 1px solid #ffffff2a;
  background: rgba(8, 14, 11, .8); font-weight: 900; display: grid; place-items: center; font-size: 17px; }
.pop { position: absolute; top: calc(66px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); padding: 5px 10px 7px; }
.pop .t { display: flex; justify-content: space-between; align-items: baseline; font-size: 9.5px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.pop .t b { color: var(--text); font-size: 13px; letter-spacing: .02em; font-style: italic; margin-left: 6px; font-variant-numeric: tabular-nums; }
.pop .t em { font-style: normal; color: var(--accent); }
.pop .bar { position: relative; height: 8px; border-radius: 5px; background: #ffffff14; margin-top: 4px; overflow: hidden; }
.pop .bar div { height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #1fb46d, var(--accent2) 70%, var(--accent)); transition: width .4s; }
.rci { position: absolute; top: calc(114px + var(--sat)); left: calc(10px + var(--sal)); padding: 6px 8px 5px; display: flex; gap: 6px; align-items: flex-end; }
.rci .d { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rci .d .c { width: 11px; height: 30px; border-radius: 3px; background: #ffffff14; position: relative; overflow: hidden; }
.rci .d .c i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 3px; transition: height .5s; }
.rci .d .c i.neg { top: auto; opacity: .35; }
.rci .d span { font-size: 9px; font-weight: 900; }
.happy { position: absolute; top: calc(114px + var(--sat)); right: calc(10px + var(--sar)); padding: 5px 10px; font-size: 13px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.happy b { color: var(--accent2); font-style: italic; font-size: 15px; }
.happy b.mid { color: var(--accent); } .happy b.low { color: #ff8a8d; }
.feed { position: absolute; top: calc(170px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.feed div { background: rgba(8, 14, 11, .9); border: 1px solid #ffffff1c; border-radius: 999px; padding: 3px 11px 3px 4px; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; gap: 7px; max-width: 100%; animation: fin .25s ease-out; transition: opacity .6s; }
.feed div > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed div.hot { border-color: #ff5a5f88; }
.feed div.fade { opacity: 0; }
.feed i { color: var(--accent2); font-style: normal; font-weight: 900; }
.feed div.hot i { color: #ff8a8d; }
.av { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px; background: #9c978b; position: relative; border: 1.5px solid #6f6a60; }
.av::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 2px; border-left: 2.5px solid #ffd23f; border-right: 2.5px solid #ffd23f; }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(220px + var(--sab)); background: rgba(8, 14, 11, .94); border: 1px solid #ffffff22;
  border-left: 4px solid var(--danger); padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; width: max-content; max-width: min(92vw, 420px); line-height: 1.35; animation: fin .2s ease-out; pointer-events: none; }
.toast.ok { border-left-color: var(--accent2); }
.toast b { color: var(--accent); }

/* tray */
.tray { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px calc(8px + var(--sar)) calc(10px + var(--sab)) calc(8px + var(--sal));
  background: linear-gradient(180deg, rgba(11, 20, 16, 0), rgba(11, 20, 16, .9) 22px, rgba(11, 20, 16, .97)); }
.brush { display: flex; gap: 6px; margin: 0 2px 8px; align-items: center; min-height: 36px; }
.chips-row { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.bc { flex: 0 0 auto; background: rgba(18, 32, 26, .96); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 11px; font-weight: 900; letter-spacing: .03em; white-space: nowrap; }
.bc.sel { background: #2a2a10; border-color: var(--accent); color: var(--accent); }
.bc.info { border-style: dashed; color: var(--muted); }
.rnd { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: rgba(18, 32, 26, .96); border: 1px solid var(--line); display: grid; place-items: center; font-size: 17px; font-weight: 900; }
.rnd.sel { background: var(--danger); border-color: #fff8; }
.rnd:disabled { opacity: .35; }
.items { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: none; }
.items::-webkit-scrollbar { display: none; }
.it { flex: 0 0 82px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 5px 4px 6px; text-align: center; position: relative; }
.it .sw { height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; position: relative; overflow: hidden; background: #ffffff0d; }
.it .sw.z { border: 2px solid currentColor; background-image: repeating-linear-gradient(0deg, transparent 0 7px, #ffffff14 7px 8px), repeating-linear-gradient(90deg, transparent 0 7px, #ffffff14 7px 8px); }
.it .nm { font-size: 10px; font-weight: 900; margin-top: 4px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it .pr { font-size: 9.5px; font-weight: 800; color: var(--accent); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it .pr.g { color: var(--accent2); } .it .pr.m { color: var(--muted); } .it .pr.b { color: #ff8a8d; }
.it.sel { border-color: var(--accent); background: #2a2a10; }
.it.lock { opacity: .5; } .it.lock .pr { color: var(--muted); }
.it .k { position: absolute; top: -6px; right: -4px; background: #0b1410; color: var(--text); border: 1px solid #ffffff44; border-radius: 5px; font-size: 9.5px; font-weight: 900; padding: 0 5px; line-height: 16px; display: none; }
.cats { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.cat { background: rgba(18, 32, 26, .96); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0 5px; text-align: center; font-size: 17px; line-height: 1.1; position: relative; }
.cat small { display: block; font-size: 8px; font-weight: 900; letter-spacing: .04em; color: var(--muted); margin-top: 3px; text-transform: uppercase; white-space: nowrap; }
.cat.sel { background: var(--accent); border-color: var(--accent); } .cat.sel small { color: #1a1400; }
.cat .dot { position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.cat .kk { position: absolute; top: 3px; left: 5px; font-size: 9px; font-weight: 900; color: var(--muted); font-style: normal; display: none; }
.cat.sel .kk { color: #1a1400; }

/* map-pinned UI */
.pin { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: auto; }
.ghostchip { background: rgba(8, 14, 11, .93); border: 1.5px solid var(--zr); border-radius: 12px; padding: 5px 10px 6px; box-shadow: 0 8px 20px #0009; pointer-events: none; }
.ghostchip .a { font-size: 9.5px; font-weight: 900; letter-spacing: .14em; color: var(--zr); }
.ghostchip .b { font-size: 13px; font-weight: 900; margin-top: 1px; }
.ghostchip .b em { font-style: normal; color: var(--accent2); }
.ghostchip.bad { border-color: var(--danger); } .ghostchip.bad .a, .ghostchip.bad .b em { color: #ff8a8d; }
.okx { display: flex; gap: 12px; }
.okx button { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; font-weight: 900; border: 2px solid #ffffff55; box-shadow: 0 6px 16px #0009; }
.okx .ok { background: radial-gradient(circle at 35% 30%, #8ff7c1, #1fb46d); color: #002313; }
.okx .ok:disabled { filter: saturate(.2) brightness(.6); }
.okx .x { background: radial-gradient(circle at 35% 30%, #ff9a9d, #d8323a); color: #fff; }

/* overlay chips + legend */
.ovl { position: absolute; top: calc(114px + var(--sat)); left: 0; right: 0; display: flex; gap: 6px; padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
.ovl::-webkit-scrollbar { display: none; }
.ovl button { flex: 0 0 auto; background: rgba(8, 14, 11, .9); border: 1px solid #ffffff22; border-radius: 999px; padding: 6px 11px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.ovl button.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.legend { position: absolute; top: calc(152px + var(--sat)); left: calc(10px + var(--sal)); padding: 6px 10px; width: 190px; }
.legend .g { height: 7px; border-radius: 4px; background: linear-gradient(90deg, #3ee08f, #ffd23f 50%, #ff5a5f); }
.legend .l { display: flex; justify-content: space-between; font-size: 9px; font-weight: 900; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }
body.ov #h-rci, body.ov #h-happy { display: none; }
body.ov .feed { top: calc(196px + var(--sat)); }

/* sheet (inspect, budget, policies, land) */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; background: var(--panel); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 8px 14px calc(14px + var(--sab)); box-shadow: 0 -10px 30px #000a; z-index: 5; animation: up .2s ease-out; touch-action: pan-y; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: #ffffff30; margin: 0 auto 8px; }
.hd { display: flex; align-items: center; gap: 10px; }
.hd .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--panel2); display: grid; place-items: center; font-size: 20px; border: 1px solid #ffffff22; flex: 0 0 40px; }
.hd .nm { font-size: 18px; line-height: 1.05; }
.hd .ds { font-size: 11px; color: var(--muted); font-weight: 800; margin-top: 3px; }
.hd .x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 900; color: var(--muted); flex: 0 0 34px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 8px; }
.kpi { background: var(--panel2); border-radius: 10px; padding: 6px 9px; min-width: 0; }
.kpi span { display: block; font-size: 9px; font-weight: 900; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.kpi b { font-size: 17px; font-weight: 900; font-style: italic; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi b.bad { color: #ff8a8d; } .kpi b.good { color: var(--accent2); } .kpi b small { font-size: 10px; color: var(--muted); font-style: normal; margin-left: 2px; }
.probs { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 6px; }
.probs span { background: #ff5a5f22; border: 1px solid #ff5a5f66; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 800; }
.probs span.ok { background: #3ee08f18; border-color: #3ee08f55; }
.covs { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.covs span { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--panel2); color: var(--muted); }
.covs span.on { color: var(--text); background: #3ee08f22; }
.covs span.off { color: #ff8a8d; background: #ff5a5f18; }
.meterrow { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; margin-top: 5px; }
.meterrow span { width: 86px; color: var(--muted); white-space: nowrap; }
.meterrow .b { flex: 1; height: 8px; border-radius: 4px; background: #ffffff12; overflow: hidden; }
.meterrow .b i { display: block; height: 100%; border-radius: 4px; }
.meterrow em { font-style: normal; width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.acts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.acts2 button { background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; font-size: 12.5px; font-weight: 900; line-height: 1.2; text-align: left; }
.acts2 button small { display: block; font-size: 10px; color: var(--muted); font-weight: 800; margin-top: 2px; }
.acts2 button.y { background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; border: 0; } .acts2 button.y small { color: #5a4300; }
.acts2 button.r { border-color: #ff5a5f66; }
.acts2 button:disabled { opacity: .45; }
.blurb { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 8px; }
.blurb b { color: var(--accent); }
.sec { font-size: 9.5px; font-weight: 900; color: var(--muted); letter-spacing: .14em; margin: 12px 0 6px; display: flex; justify-content: space-between; }
.brow { display: grid; grid-template-columns: 22px 1fr 112px 58px; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; padding: 3px 0; }
.brow .ic { text-align: center; }
.brow .pc { font-size: 10px; color: var(--muted); font-weight: 900; }
.brow em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.brow em.p { color: var(--accent2); } .brow em.n { color: #ff8a8d; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: #ffffff1a; touch-action: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #eef5f0; box-shadow: 0 1px 4px #0008; border: 3px solid var(--accent2); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #eef5f0; border: 3px solid var(--accent2); }
.net { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid #ffffff1a; margin-top: 8px; padding-top: 8px; }
.net b { font-size: 24px; font-style: italic; color: var(--accent2); } .net b.neg { color: #ff8a8d; }
.loans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.loans button { background: var(--panel2); border: 1px dashed #ffffff2a; border-radius: 9px; padding: 6px 7px; font-size: 10px; font-weight: 800; color: var(--muted); text-align: left; }
.loans button b { display: block; color: var(--text); font-size: 12px; }
.loans button.on { border-style: solid; border-color: var(--accent); }
.pols { display: grid; gap: 6px; }
.pol { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; text-align: left; }
.pol .ic { font-size: 20px; }
.pol b { display: block; font-size: 13px; } .pol small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.pol .tg { margin-left: auto; width: 42px; height: 24px; border-radius: 12px; background: #ffffff1a; position: relative; flex: 0 0 42px; }
.pol .tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #8fa89a; transition: left .15s; }
.pol.on .tg { background: var(--accent2); } .pol.on .tg::after { left: 21px; background: #fff; }
.pol.lock { opacity: .45; }
.graph { width: 100%; height: 90px; display: block; background: var(--panel2); border-radius: 10px; margin-top: 6px; }
.posts .post { display: flex; gap: 8px; padding: 7px 6px; border-radius: 9px; background: #ffffff07; margin-bottom: 5px; font-size: 12px; line-height: 1.3; width: 100%; text-align: left; }
.post .av { width: 26px; height: 26px; flex: 0 0 26px; border-width: 2px; }
.post .av::after { left: 4px; right: 4px; top: 8px; height: 3px; }
.post b { font-size: 11px; } .post b span { color: var(--muted); font-weight: 700; margin-left: 3px; }
.post.hot { background: #ff5a5f1a; border: 1px solid #ff5a5f55; }

/* ------------------------------------------------------------ phone landscape */
body.land .money { top: calc(8px + var(--sat)); left: calc(84px + var(--sal)); padding: 4px 10px 5px; min-width: 0; }
body.land .money b { font-size: 18px; }
body.land .date { top: calc(8px + var(--sat)); right: calc(58px + var(--sar)); }
body.land .mbtn { top: calc(8px + var(--sat)); right: calc(10px + var(--sar)); width: 38px; height: 38px; }
body.land .pop { top: calc(8px + var(--sat)); left: calc(230px + var(--sal)); right: auto; width: min(250px, calc(100vw - 480px)); }
body.land .rci { top: calc(60px + var(--sat)); left: auto; right: calc(10px + var(--sar)); }
body.land .happy { top: calc(60px + var(--sat)); right: calc(100px + var(--sar)); }
body.land .feed { top: calc(60px + var(--sat)); left: calc(84px + var(--sal)); right: calc(180px + var(--sar)); }
body.land .ovl { top: calc(60px + var(--sat)); left: 76px; }
body.land .legend { top: calc(98px + var(--sat)); left: calc(84px + var(--sal)); }
body.land .tray { top: 0; right: auto; width: 100%; padding: 0; background: none; pointer-events: none; }
body.land .tray > * { pointer-events: auto; }
body.land .cats { position: absolute; left: 0; top: 0; bottom: 0; width: 74px; padding: calc(8px + var(--sat)) 7px calc(8px + var(--sab)) calc(7px + var(--sal)); display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  background: linear-gradient(90deg, rgba(11, 20, 16, .97), rgba(11, 20, 16, .9) 85%, rgba(11, 20, 16, 0)); }
body.land .cat { padding: 4px 0 3px; font-size: 15px; flex: 0 0 auto; }
body.land .items { position: absolute; left: 80px; right: 160px; bottom: calc(6px + var(--sab)); padding: 0; }
body.land .it { flex-basis: 76px; }
body.land .it .sw { height: 28px; }
body.land .brush { position: absolute; right: calc(10px + var(--sar)); bottom: calc(8px + var(--sab)); margin: 0; flex-direction: column-reverse; align-items: flex-end; }
body.land .chips-row { flex-direction: column; align-items: flex-end; overflow: visible; }
body.land .toast { bottom: calc(100px + var(--sab)); }
body.land .sheet { left: auto; right: 0; top: 0; width: min(380px, 60vw); max-height: none; border-radius: 18px 0 0 18px; border-top: 0; border-left: 1px solid var(--line); }

/* ------------------------------------------------------------ desktop */
body.desk .money { top: 10px; left: 10px; min-width: 150px; }
body.desk .pop { top: 10px; left: 172px; right: auto; width: 300px; padding: 6px 12px 8px; }
body.desk .rci { top: 10px; left: 484px; padding: 6px 10px 5px; }
body.desk .happy { top: 10px; left: 590px; right: auto; padding: 0 12px; height: 54px; }
body.desk .date { top: 10px; right: 62px; display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 54px; }
body.desk .date .spd { margin: 0; }
body.desk .date .spd button { font-size: 11px; padding: 3px 8px; }
body.desk .mbtn { top: 16px; }
body.desk .feed { display: none; }
body.desk .rumble { display: block; }
body.desk .ovl { top: 74px; left: 276px; right: 330px; }
body.desk .legend { top: 112px; left: 276px; }
body.desk.ov .feed { display: none; }
.panel { position: absolute; padding: 11px 12px; }
.panel .lbl { font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .16em; margin-bottom: 8px; display: flex; justify-content: space-between; }
.panel .lbl b { color: var(--accent); letter-spacing: .04em; }
.rumble { top: 74px; left: 10px; width: 256px; max-height: calc(100vh - 260px); overflow: hidden; }
.rumble .post { cursor: pointer; }
body.desk .tray { left: 50%; right: auto; bottom: 12px; transform: translateX(-50%); width: 680px; padding: 8px; border-radius: 14px;
  background: rgba(8, 14, 11, .9); border: 1px solid #ffffff22; box-shadow: 0 6px 20px #0008; }
body.desk .items { padding: 6px 2px 6px; }
body.desk .it .k, body.desk .cat .kk { display: block; }
body.desk .cat { font-size: 15px; padding: 5px 0 4px; }
body.desk .brush { margin-bottom: 4px; }
body.desk .mini { display: block; position: absolute; left: 10px; bottom: 12px; padding: 6px; pointer-events: auto; }
body.desk .mini canvas { display: block; width: 200px; height: 132px; border-radius: 7px; cursor: pointer; }
body.desk .keys { display: flex; position: absolute; right: 10px; bottom: 12px; flex-direction: column; gap: 4px; align-items: flex-end; }
.keys div { background: rgba(8, 14, 11, .86); border: 1px solid #ffffff22; border-radius: 8px; padding: 3px 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.keys b { color: var(--text); background: #ffffff14; border-radius: 4px; padding: 0 5px; margin-right: 4px; }
body.desk .sheet { left: auto; right: 10px; top: 74px; bottom: auto; width: 340px; max-height: calc(100vh - 100px); border-radius: 14px; border: 1px solid #ffffff22; }
body.desk .sheet .grab { display: none; }
body.desk .toast { bottom: 190px; }

/* ------------------------------------------------------------ menu */
.screen { position: fixed; inset: 0; overflow-y: auto; touch-action: pan-y; -webkit-user-select: none;
  background: radial-gradient(120% 60% at 50% 0%, #1e4a30 0%, var(--bg) 60%); z-index: 10; }
.screen .wrap { padding: calc(14px + var(--sat)) 16px calc(24px + var(--sab)); max-width: 520px; margin: 0 auto; }
.logo { text-align: center; margin: 0 0 10px; }
.logo svg { display: block; margin: 0 auto 2px; }
.logo .t1, .logo .t2 { font-size: 36px; line-height: .9; }
.logo .t2 { color: var(--accent); }
.logo .sub { color: var(--muted); font-size: 11px; letter-spacing: .3em; margin-top: 6px; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; display: block; width: 100%; text-align: left; }
.lbl { font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .14em; margin-bottom: 8px; text-transform: uppercase; display: flex; justify-content: space-between; }
.lbl b { color: var(--accent); letter-spacing: .06em; }
.city { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid transparent; border-radius: 12px; padding: 4px 6px 4px 4px; margin-bottom: 6px; width: 100%; text-align: left; }
.city:last-child { margin-bottom: 0; }
.city canvas { width: 76px; height: 52px; border-radius: 8px; flex: 0 0 76px; background: #000; }
.city .nm { font-weight: 900; font-size: 15px; font-style: italic; }
.city .ds { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 1px; }
.city .pp { font-size: 11px; font-weight: 900; margin-top: 3px; display: flex; gap: 10px; }
.city .pp span { color: var(--accent); }
.city .play { margin-left: auto; font-size: 13px; color: var(--accent); white-space: nowrap; padding: 8px 6px; }
.city .del { font-size: 14px; padding: 8px 6px; opacity: .55; }
.dist { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dist::-webkit-scrollbar { display: none; }
.dc { flex: 0 0 106px; background: var(--panel2); border: 2px solid transparent; border-radius: 12px; padding: 5px; text-align: left; }
.dc canvas { display: block; width: 92px; height: 62px; border-radius: 8px; background: #000; }
.dc .nm { font-size: 11px; font-weight: 900; margin-top: 5px; }
.dc .st { font-size: 10px; color: var(--muted); font-weight: 800; margin-top: 2px; }
.dc.sel { border-color: var(--accent); background: #2a2a10; } .dc.sel .st { color: var(--accent); }
.dc.lock { opacity: .45; }
.namerow { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.inp { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 15px; font-weight: 800; color: var(--text); -webkit-user-select: text; user-select: text; }
.dice { font-size: 18px; width: 40px; height: 40px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.chips { display: flex; gap: 6px; }
.chip { flex: 1; text-align: center; background: var(--panel2); border: 1px solid var(--line); padding: 10px 4px; border-radius: 10px; font-size: 13px; }
.chip.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.hint b { color: var(--accent); }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.set { background: var(--panel2); border-radius: 10px; padding: 9px 10px; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.set b { color: var(--accent); white-space: nowrap; }
.how summary { cursor: pointer; margin: 0; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how ul { margin: 8px 0 2px 16px; font-size: 12px; line-height: 1.45; color: #cfe0d6; }
.how li { margin-bottom: 5px; } .how b { color: var(--accent); }
.go { display: block; width: 100%; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #ffe066, #f0b400);
  color: #241900; font-size: 20px; border: 0; box-shadow: 0 8px 20px #f0b40044; text-align: center; margin-top: 4px; }
.foot { text-align: center; font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ------------------------------------------------------------ overlays: pause, milestone */
.overlay { position: fixed; inset: 0; background: rgba(6, 11, 8, .74); backdrop-filter: blur(3px); z-index: 8; overflow-y: auto; touch-action: pan-y; }
.panel2 { max-width: 380px; margin: 0 auto; padding: calc(60px + var(--sat)) 16px 30px; display: grid; gap: 8px; }
.ptitle { text-align: center; font-size: 38px; color: var(--accent); margin-bottom: 4px; }
.pstats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.btn { padding: 13px; border-radius: 12px; text-align: center; font-size: 15px; }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); }
.prow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.res { max-width: 430px; margin: 0 auto; padding: max(26px, 5vh) 16px 30px; }
.res .pre { text-align: center; font-size: 11px; font-weight: 900; letter-spacing: .3em; color: var(--accent2); }
.res .ttl { text-align: center; font-size: 56px; color: var(--accent); line-height: 1; margin-top: 4px; text-shadow: 0 0 30px #ffd23f55; animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }
.res .sub { text-align: center; color: var(--muted); font-weight: 800; font-size: 12px; letter-spacing: .14em; margin-top: 6px; }
.ladder { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 16px 0 14px; }
.ladder i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 900; background: #ffffff12; color: var(--muted); border: 2px solid #ffffff1a; }
.ladder i.done { background: #3ee08f33; color: var(--accent2); border-color: #3ee08f88; }
.ladder i.now { width: 38px; height: 38px; font-size: 16px; background: var(--accent); color: #1a1400; border-color: #fff; box-shadow: 0 0 20px #ffd23f88; }
.ladder s { width: 10px; height: 2px; background: #ffffff22; }
.grant { display: flex; justify-content: space-between; align-items: center; background: #ffd23f18; border: 1px solid #ffd23f66; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.grant span { font-size: 10px; font-weight: 900; letter-spacing: .14em; color: var(--accent); }
.grant b { font-size: 26px; font-style: italic; color: var(--accent); }
.unl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.un { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 7px 9px; min-width: 0; }
.un .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; flex: 0 0 32px; background: #ffffff10; }
.un b { display: block; font-size: 12.5px; line-height: 1.15; }
.un span { font-size: 10px; color: var(--muted); font-weight: 800; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 10px 0 12px; }
.stat { background: var(--panel2); border-radius: 10px; padding: 7px 9px; }
.stat span { display: block; font-size: 9px; font-weight: 900; letter-spacing: .12em; color: var(--muted); }
.stat b { font-size: 17px; font-weight: 900; font-style: italic; font-variant-numeric: tabular-nums; }
body.land .pop .t { letter-spacing: .05em; white-space: nowrap; }
body.land .pop .t b { font-size: 12px; }
body.land .bc.info { display: none; }

/* ------------------------------------------------------------ scenarios, disasters, gamepad */
.btn.wide { display: block; width: 100%; margin-top: 8px; }
.btn.link { display: block; margin: 10px auto 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.scns { display: grid; gap: 6px; }
.scn { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid transparent; border-radius: 12px; padding: 7px 10px; text-align: left; width: 100%; }
.scn.sel { border-color: var(--accent); background: #2a2a10; }
.scn .ic { font-size: 24px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #ffffff10; flex: 0 0 40px; }
.scn b { display: block; font-size: 14px; font-style: italic; }
.scn small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; line-height: 1.35; margin-top: 2px; }
.scn .st { margin-left: auto; font-size: 13px; letter-spacing: .05em; color: #ffffff30; white-space: nowrap; }
.scn .st em { font-style: normal; color: var(--accent); }
.goals { position: absolute; top: calc(114px + var(--sat)); left: calc(92px + var(--sal)); padding: 5px 10px; font-size: 12px; font-weight: 900; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.goals b { color: var(--accent); font-style: italic; font-size: 14px; }
.goals span { color: var(--muted); font-size: 10.5px; }
.goals.done b { color: var(--accent2); }
body.ov .goals { display: none; }
body.land .goals { top: calc(60px + var(--sat)); left: auto; right: calc(190px + var(--sar)); }
body.desk .goals { top: 10px; left: 690px; height: 54px; }
.banner { position: absolute; top: calc(236px + var(--sat)); left: 50%; transform: translateX(-50%); text-align: center; background: rgba(8, 14, 11, .9); border: 2px solid var(--danger);
  border-radius: 16px; padding: 10px 20px 12px; box-shadow: 0 10px 40px #ff5a5f44; animation: pop .4s ease-out; max-width: 92vw; }
.banner .big { display: block; font-size: 28px; color: #ff8a8d; white-space: nowrap; }
.banner .small { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); margin-top: 3px; }
.goallist { display: grid; gap: 6px; margin: 12px 0; }
.goal { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 800; }
.goal i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #ffffff14; color: var(--muted); font-size: 12px; flex: 0 0 22px; }
.goal.ok i { background: var(--accent2); color: #002313; }
.goal em { margin-left: auto; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bigstars { display: flex; justify-content: center; gap: 10px; margin: 14px 0 4px; }
.bigstars div { font-size: 52px; line-height: 1; color: #ffffff1f; }
.bigstars div.on { color: var(--accent); text-shadow: 0 0 22px #ffd23f88; }
.acts { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.busy { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 18px; color: var(--accent); }
.spin { width: 44px; height: 44px; border-radius: 50%; border: 5px solid #ffffff22; border-top-color: var(--accent); margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#padcur { position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #ffd23f; box-shadow: 0 0 0 2px #0b1410, 0 0 12px #ffd23f88; pointer-events: none; z-index: 50; }
#padcur::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ffd23f; }
#padcur.down { transform: scale(.8); background: #ffd23f33; }
.pad-focus { outline: 3px solid var(--accent) !important; outline-offset: 2px; }
body.desk .banner { top: 90px; } body.land .banner { top: calc(100px + var(--sat)); }

/* Studio credit and link back to the games page, the same on every Game Golem Studios title screen */
.ggs-foot { text-align: center; font-size: 11px; margin-top: 12px; }
.ggs-foot a { color: var(--muted); text-underline-offset: 2px; }

/* ------------------------------------------------------------ regions */
.rgchip { top: calc(114px + var(--sat)); }
body.land .rgchip { top: calc(60px + var(--sat)); }
.rghead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rghead .btn { padding: 8px 14px; font-size: 20px; line-height: 1; }
.rghead .t1 { font-size: 28px; color: var(--accent); }
.rghead .sub { color: var(--muted); font-size: 10.5px; letter-spacing: .14em; font-weight: 700; }
.hint.bad { color: #ff8a8d; }
#region .namerow { display: flex; gap: 8px; align-items: center; }
#region .namerow span { font-size: 12px; font-weight: 900; color: var(--muted); }
#region .code { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
#region .code i { font-style: normal; font-family: inherit; font-weight: 900; font-size: 30px; width: 42px; height: 50px; display: grid; place-items: center; background: var(--panel2); border: 2px solid var(--accent); border-radius: 10px; color: var(--accent); }
.city img { width: 76px; height: 52px; border-radius: 8px; flex: 0 0 76px; image-rendering: pixelated; background: #000; object-fit: cover; }
.city .nothumb { width: 76px; height: 52px; border-radius: 8px; flex: 0 0 76px; display: grid; place-items: center; background: #0006; font-size: 24px; }
.city.away { opacity: .6; }
.city .you { font-style: normal; font-size: 9.5px; letter-spacing: .1em; color: #1a1400; background: var(--accent); border-radius: 5px; padding: 1px 5px; vertical-align: 2px; }
.rgcities .city { margin-bottom: 5px; }
.rgside { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; margin-left: auto; font-size: 11px; font-weight: 900; }
.rgside em { font-style: normal; } .rgside em.p { color: var(--accent2); } .rgside em.n { color: #ff8a8d; }
.rgside .bc:disabled, .pol .bc:disabled { opacity: .4; }
.pol .bc { margin-left: auto; }
.rgsell { display: grid; gap: 6px; margin-top: 8px; }
.rgsell .chip { padding: 8px 4px; font-size: 12px; font-weight: 900; }
.rgsell .chip:disabled { opacity: .35; }
.rgsell .go { padding: 11px; font-size: 14px; }
.rgsell .go:disabled { opacity: .45; }
.rgprice { flex: 2; text-align: center; align-self: center; font-weight: 900; font-size: 13px; color: var(--accent); }
.rgbar { height: 6px; border-radius: 3px; background: #ffffff14; margin: 5px 0 3px; overflow: hidden; }
.rgbar i { display: block; height: 100%; background: linear-gradient(90deg, #1fb46d, var(--accent)); }
.rgwork.on .rgbar i { background: var(--accent2); }
.rgposts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rgposts .chip { flex: 0 0 auto; padding: 6px 9px; font-size: 11px; font-weight: 800; }

/* ------------------------------------------------------------ cloud saves */
.cloudrow { display: flex; align-items: center; gap: 10px; }
.cloudrow .hint { flex: 1; }
.cloudrow .btn { padding: 9px 14px; font-size: 13px; white-space: nowrap; }
#m-cloud a { color: var(--accent); }
.hint .bad, .bad { color: #ff8a8d; }
.cbadge { font-size: 10px; }
.pcloud { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.cxbody { font-size: 13px; line-height: 1.45; margin: 4px 0 12px; text-align: left; }
.cxrow { display: flex; justify-content: space-between; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.cxrow span { color: var(--muted); font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
#cloudx .btn { display: block; width: 100%; margin-top: 8px; }
#cloudx { z-index: 20; }
