:root {
  --bg: #0f1419;
  --bg2: #161d25;
  --bg3: #1f2933;
  --line: #2b3844;
  --text: #e6edf3;
  --muted: #8b9bab;
  --accent: #f2b544;
  --good: #4ec58a;
  --warn: #f0a33a;
  --bad: #e5534b;
  --blue: #4a9eff;
  --top-h: 46px;
  --bar-h: 172px;
  --ticker-h: 22px;
  --panel-w: 440px;
  --sa-top: env(safe-area-inset-top, 0px);
  --sa-left: env(safe-area-inset-left, 0px);
  --sa-right: env(safe-area-inset-right, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif; font-size: 14px;
  overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
button:hover { background: #28343f; }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 600; }
button.big { font-size: 16px; padding: 10px 18px; }
button.active { background: var(--accent); color: #1a1200; border-color: var(--accent); }
button.danger { background: #4a1f1c; border-color: #7a2d28; }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.hidden { display: none !important; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); }
h1,h2,h3,h4 { margin: 0 0 6px; }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* rotate overlay */
#rotate-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: var(--bg); align-items: center; justify-content: center; text-align: center; }
@media (orientation: portrait) and (max-width: 900px) { #rotate-overlay { display: flex; } }
.rotate-icon { font-size: 56px; color: var(--accent); }

/* start screen */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 30% 20%, #1c2a36, var(--bg) 70%); z-index: 50; overflow: auto; }
.start-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 22px 28px; width: min(440px, 92vw); text-align: center; }
.start-card h1 { font-size: 40px; letter-spacing: 8px; color: var(--accent); }
.tagline { color: var(--muted); margin: 0 0 16px; }
.start-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.start-form label { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; }
.start-form input { width: 60%; }
.start-hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
#start-continue { margin-bottom: 8px; }
#continue-info { font-weight: 400; opacity: .8; font-size: 13px; }

/* layout */
#game { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: calc(var(--top-h) + var(--sa-top)) 1fr var(--ticker-h) auto; }
#topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: var(--sa-top) 8px 0 calc(8px + var(--sa-left)); padding-right: calc(8px + var(--sa-right)); background: var(--bg2); border-bottom: 1px solid var(--line); z-index: 5; }
.tb-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-city { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
#tb-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
#tb-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tb-gauges { display: flex; gap: 4px; flex: 1; justify-content: center; min-width: 0; overflow: hidden; }
.gauge { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 2px 6px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.gauge:hover { background: var(--bg3); }
.gauge .g-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.gauge .g-val { font-size: 13px; font-weight: 600; white-space: nowrap; }
.gauge .g-bar { width: 44px; height: 3px; background: var(--line); border-radius: 2px; margin-top: 2px; overflow: hidden; }
.gauge .g-bar i { display: block; height: 100%; background: var(--good); }
.gauge.warn .g-bar i { background: var(--warn); } .gauge.bad .g-bar i { background: var(--bad); }
.gauge.bad { border-color: #5a2a27; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,83,75,0); } 50% { box-shadow: 0 0 0 3px rgba(229,83,75,.35); } }
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-money { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.tb-money.neg { color: var(--bad); }
.speed { display: flex; gap: 2px; }
.speed .icon-btn { width: 32px; height: 30px; font-size: 11px; }

#map-wrap { position: relative; overflow: hidden; background: #0b1a24; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map.tool { cursor: crosshair; }
#map-hud { position: absolute; inset: 0; pointer-events: none; }
#map-hud > * { pointer-events: auto; }
#overlay-select { position: absolute; top: 6px; left: calc(6px + var(--sa-left)); display: flex; gap: 3px; flex-wrap: wrap; max-width: 60%; }
.chip { padding: 3px 8px; font-size: 11px; border-radius: 12px; background: rgba(22,29,37,.85); }
#zoom-ctl { position: absolute; right: calc(8px + var(--sa-right)); top: 8px; display: flex; flex-direction: column; gap: 4px; }
#zoom-ctl .icon-btn { background: rgba(22,29,37,.85); }
#tool-hint { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: rgba(22,29,37,.9); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; pointer-events: none; }
#tool-hint:empty { display: none; }

#inspector { position: absolute; z-index: 6; background: rgba(22,29,37,.96); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 250px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); pointer-events: auto; }
#inspector h4 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
#inspector .row { display: flex; justify-content: space-between; padding: 1px 0; }
#inspector .why { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--muted); }
#inspector .why b { color: var(--text); }
#inspector .actions { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
#inspector .actions button { padding: 3px 8px; font-size: 11px; }

#news-ticker { background: #0c1116; border-top: 1px solid var(--line); overflow: hidden; white-space: nowrap; font-size: 12px; line-height: var(--ticker-h); color: var(--muted); padding: 0 8px; }
#ticker-text { display: inline-block; }
#ticker-text b { color: var(--accent); }

#toolbar { background: var(--bg2); border-top: 1px solid var(--line); display: flex; flex-direction: column; padding: 0 calc(6px + var(--sa-left)) var(--sa-bottom) calc(6px + var(--sa-right)); z-index: 5; }
#tool-cats { display: flex; gap: 3px; padding: 4px 0 2px; overflow-x: auto; scrollbar-width: none; }
#tool-cats::-webkit-scrollbar { display: none; }
#tool-cats button { font-size: 12px; padding: 3px 9px; white-space: nowrap; flex-shrink: 0; border-radius: 6px; }
#tool-items { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
#tool-items::-webkit-scrollbar { display: none; }
#tool-items button { font-size: 11px; padding: 2px 8px; white-space: nowrap; flex-shrink: 0; border-radius: 6px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
#tool-items button small { color: var(--muted); font-size: 10px; }
#tool-items button.active small { color: #3a2a00; }
#tool-items button:disabled { opacity: .45; cursor: not-allowed; }
#tool-items .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

/* side panel */
#panel { position: absolute; top: calc(var(--top-h) + var(--sa-top)); right: 0; bottom: calc(var(--bar-h) + var(--ticker-h) + var(--sa-bottom)); width: var(--panel-w); max-width: 100%; background: rgba(22,29,37,.97); border-left: 1px solid var(--line); z-index: 8; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,.4); }
.panel-head { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 6px; gap: 4px; }
#panel-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
#panel-tabs::-webkit-scrollbar { display: none; }
#panel-tabs button { font-size: 12px; padding: 4px 9px; white-space: nowrap; }
#panel-body { flex: 1; overflow-y: auto; padding: 10px 12px; touch-action: pan-y; }
#panel-body h3 { font-size: 15px; margin: 10px 0 6px; color: var(--accent); }
#panel-body h3:first-child { margin-top: 0; }
#panel-body h4 { font-size: 13px; margin: 8px 0 4px; }
.advice { background: var(--bg3); border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 6px; margin-bottom: 8px; font-size: 13px; }
.advice.bad { border-color: var(--bad); } .advice.good { border-color: var(--good); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.stat { background: var(--bg3); border-radius: 8px; padding: 6px 8px; cursor: pointer; border: 1px solid transparent; }
.stat:hover { border-color: var(--line); }
.stat .s-label { font-size: 11px; color: var(--muted); }
.stat .s-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .s-sub { font-size: 11px; color: var(--muted); }
.lever { display: grid; grid-template-columns: 1fr 64px; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #1c2630; }
.lever .l-label { font-size: 13px; }
.lever .l-sub { font-size: 11px; color: var(--muted); }
.lever .l-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.lever input[type=range] { grid-column: 1 / -1; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #1c2630; gap: 8px; }
.toggle .t-main { flex: 1; }
.toggle .t-desc { font-size: 11px; color: var(--muted); }
.toggle button { min-width: 64px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 12px; }
.ledger td { padding: 3px 4px; border-bottom: 1px solid #1c2630; }
.ledger td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tr.total td { font-weight: 700; border-top: 1px solid var(--line); }
canvas.chart { width: 100%; height: 130px; display: block; background: var(--bg3); border-radius: 8px; margin: 4px 0 8px; }
.chart-row { display: flex; gap: 10px; font-size: 11px; margin-bottom: 2px; flex-wrap: wrap; }
.chart-row span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; background: var(--c); vertical-align: -1px; }
.bar-list .bl { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; }
.bar-list .bl i { display: block; height: 8px; border-radius: 4px; background: var(--blue); }
.bar-list .bl b { text-align: right; font-weight: 500; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.news-list .n { padding: 5px 0; border-bottom: 1px solid #1c2630; font-size: 12px; }
.news-list .n .n-date { color: var(--muted); font-size: 11px; }
.news-list .n .n-src { color: var(--blue); font-size: 11px; }
.hist .h { font-size: 12px; padding: 3px 0; border-bottom: 1px solid #1c2630; }
.hist .h .muted { font-size: 11px; }
.fac { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid #1c2630; font-size: 12px; }
.help p { font-size: 13px; line-height: 1.45; }
kbd { background: var(--bg3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 11px; }

/* modal */
#modal { position: fixed; inset: 0; background: rgba(5,8,12,.7); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 10px; }
#modal-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; width: min(560px, 96vw); max-height: 94vh; overflow-y: auto; padding: 16px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); touch-action: pan-y; }
#modal-card .ev-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); }
#modal-card h2 { font-size: 19px; margin: 4px 0 8px; }
#modal-card p { line-height: 1.45; font-size: 14px; margin: 0 0 10px; }
#modal-card .ev-src { color: var(--muted); font-size: 12px; font-style: italic; }
.choices { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.choice { text-align: left; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; border-radius: 10px; }
.choice .c-label { font-weight: 600; }
.choice .c-eff { font-size: 11px; color: var(--muted); }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.choice:not(:disabled):hover { border-color: var(--accent); }
.press-tag { display: inline-block; background: #3a2b10; color: var(--accent); border-radius: 6px; padding: 1px 7px; font-size: 11px; margin-left: 6px; }

#toasts { position: absolute; left: 50%; bottom: calc(var(--bar-h) + var(--ticker-h) + var(--sa-bottom) + 38px); transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 4px; pointer-events: none; align-items: center; }
.toast { background: rgba(22,29,37,.96); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 12px; animation: toastin .2s ease; }
.toast.bad { border-color: var(--bad); } .toast.good { border-color: var(--good); }
@keyframes toastin { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; transform: none; } }

/* compact phones in landscape */
@media (max-height: 460px) {
  :root { --top-h: 40px; --bar-h: 118px; --ticker-h: 18px; --panel-w: 100%; }
  .gauge { min-width: 46px; padding: 1px 4px; } .gauge .g-bar { width: 36px; } .gauge .g-val { font-size: 12px; }
  #tb-date { display: none; } #tb-name { max-width: 90px; }
  .speed .icon-btn { width: 28px; height: 26px; }
  #overlay-select { max-width: 70%; }
  .chip { padding: 2px 6px; font-size: 10px; }
  #panel-body { padding: 8px; }
  #inspector { width: 220px; }
}
@media (max-width: 760px) { :root { --panel-w: 100%; } .tb-gauges .gauge:nth-child(n+7) { display: none; } }
@media (max-width: 620px) { .tb-gauges .gauge:nth-child(n+5) { display: none; } }

#btn-panel { position: relative; }
#news-badge { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
#objective { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); background: rgba(58,43,16,.95); border: 1px solid var(--accent); color: #fde7b0; border-radius: 10px; padding: 5px 30px 5px 12px; font-size: 12px; max-width: min(52vw, 520px); line-height: 1.3; }
#objective b { color: var(--accent); }
#objective button { position: absolute; right: 2px; top: 2px; padding: 0 6px; font-size: 12px; background: transparent; border: none; color: #fde7b0; }
@media (max-width: 760px) { #objective { top: 56px; max-width: 70vw; } }
#load{height:8px;background:#222c36;border-radius:4px;margin:12px 0;overflow:hidden}#load.hidden{display:none}#load-bar{height:100%;width:0;background:#e0b44c;transition:width .2s}
#tool-cats button{display:flex;align-items:center;gap:5px;font-size:13px;padding:5px 11px}.ci{font-size:15px}
#tool-items{gap:6px;padding:4px 0 6px}
#tool-items button.card{width:92px;min-width:92px;padding:4px 4px 5px;white-space:normal;text-align:center;gap:1px;align-items:center;justify-content:flex-start}
#tool-items button.card canvas{display:block;margin:0 auto 2px;pointer-events:none}.cico{height:52px;display:flex;align-items:center;justify-content:center;font-size:30px}
#tool-items button.card b{font-size:11px;font-weight:600;line-height:1.1}#tool-items button.card small{font-size:11px}
#tool-detail{font-size:12px;padding:5px 4px 0}#tool-detail.hidden{display:none}
#tut{position:absolute;left:50%;top:54px;transform:translateX(-50%);max-width:min(520px,80%);background:#e0b44c;color:#2a1f00;border-radius:12px;padding:10px 14px;font-size:14px;display:flex;gap:10px;align-items:center;z-index:9;box-shadow:0 4px 16px #0008}
#tut.hidden,#tut-arrow.hidden{display:none}#tut button{background:#0003;border:0;color:#2a1f00;border-radius:8px;padding:4px 8px;font-size:12px}
#tut-arrow{position:fixed;font-size:34px;z-index:20;pointer-events:none;animation:bob .7s ease-in-out infinite alternate;transform:translate(-50%,-100%)}
@keyframes bob{to{margin-top:-10px}}
#tool-cats button.pulse,#tool-items button.pulse{box-shadow:0 0 0 3px #e0b44c}
#toolbar{min-width:0;overflow:hidden}#tool-items{flex:1;min-height:0}
@media (max-height:520px){#tool-items button.card{width:78px;min-width:78px}#tool-items button.card canvas{height:34px!important;width:auto!important;max-width:70px}.cico{height:34px;font-size:22px}#tool-cats button{padding:3px 9px;font-size:12px}#tool-detail{font-size:11px;padding-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
@media (max-height:520px){#tool-detail{display:none!important}}
#toolbar{min-height:0}#inspector{max-height:calc(100% - 60px);overflow-y:auto}
@media (max-height:520px){#tut{top:48px;font-size:12px;padding:6px 10px;max-width:60%}#tool-items{padding:3px 0 4px}}
.c-cost{float:right;font-size:12px;background:#0004;border-radius:6px;padding:1px 7px}.c-cost.free{color:#7bd88f}.choice{min-height:48px}
.fixbar{background:#1c2733;border:1px solid #2f4357;border-radius:10px;padding:8px 10px;margin:0 0 10px}
.fix-title{font-weight:700;font-size:13px;margin-bottom:6px;color:#f2b544}
.fix-btns{display:flex;flex-wrap:wrap;gap:6px}
button.fix{background:#27415a;border:1px solid #3d6283;color:#e6eef7;border-radius:8px;padding:6px 10px;font-size:12px;cursor:pointer}
button.fix:hover{background:#34597c}
.row{font-size:13px;padding:3px 0;border-bottom:1px solid #223}
#btn-layer.active,#btn-plan.active{outline:2px solid #f2b544}
.asset{background:#16212c;border:1px solid #2b3f52;border-radius:10px;padding:8px 10px;margin:6px 0}
.a-head{display:flex;justify-content:space-between;align-items:center}.a-risk{color:#f2b544;letter-spacing:2px;font-size:11px}
.a-nums{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;margin:4px 0}

/* ================= retro start screen ================= */
.retro { background: linear-gradient(#2b1055 0%, #7a2a9a 38%, #ff5e8a 66%, #ffb457 100%); overflow: auto; align-items: flex-start; touch-action: pan-y; user-select: none; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }
.retro .scene-bg { position: fixed; left: 0; right: 0; bottom: 0; height: 46%; background-size: cover; background-position: center bottom; opacity: .55; image-rendering: pixelated; -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); pointer-events: none; }
.retro .sun { position: fixed; top: 9%; right: 9%; width: 90px; height: 90px; border-radius: 50%; background: repeating-linear-gradient(#fff3a0 0 6px, #ffd23a 6px 11px); box-shadow: 0 0 0 4px #ff9b2f, 0 0 60px #ffb457; pointer-events: none; }
.retro .cloud { position: fixed; height: 18px; background: #fff; border-radius: 4px; box-shadow: 12px -10px 0 #fff, 28px -10px 0 #fff, 40px 0 0 #fff, 0 6px 0 #d7c8ff; opacity: .85; pointer-events: none; animation: drift 60s linear infinite; }
.retro .c1 { top: 14%; left: -80px; width: 56px; } .retro .c2 { top: 28%; left: -80px; width: 40px; animation-duration: 90s; animation-delay: -30s; } .retro .c3 { top: 6%; left: -80px; width: 48px; animation-duration: 120s; animation-delay: -70s; }
@keyframes drift { to { transform: translateX(calc(100vw + 200px)); } }
.retro .crt { position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(rgba(0,0,0,.14) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; z-index: 3; }
.start-wrap { position: relative; z-index: 2; display: flex; gap: 22px; align-items: center; justify-content: center; width: 100%; min-height: 100%; padding: 18px 22px; flex-wrap: wrap; }
.title-block { text-align: center; max-width: 480px; }
.title { display: flex; flex-direction: column; font-family: "Courier New", ui-monospace, monospace; font-weight: 900; line-height: .95; letter-spacing: 3px; text-transform: uppercase; }
.title .l1 { font-size: clamp(34px, 6vw, 62px); color: #ffe14a; text-shadow: 3px 3px 0 #ff4d8d, 6px 6px 0 #5b1a8c, 9px 9px 0 #1b0b3a; }
.title .l2 { font-size: clamp(30px, 5.4vw, 56px); color: #5ff0f0; text-shadow: 3px 3px 0 #2a7fe0, 6px 6px 0 #5b1a8c, 9px 9px 0 #1b0b3a; margin-top: 6px; animation: wob 2.4s steps(4) infinite; }
@keyframes wob { 50% { transform: translateY(-3px) rotate(-.6deg); } }
.retro .sub { margin: 14px 0 8px; font: 800 12px "Courier New", monospace; letter-spacing: 2px; color: #fff; text-shadow: 2px 2px 0 #1b0b3a; }
.skyline-strip { height: 38px; margin-top: 6px; background: repeating-linear-gradient(90deg, #1b0b3a 0 14px, transparent 14px 18px); -webkit-mask-image: linear-gradient(90deg, #000 0 100%); opacity: .0; }
.cabinet { background: #1b0b3a; border: 4px solid #ffe14a; border-radius: 6px; box-shadow: 6px 6px 0 #000, inset 0 0 0 3px #5b1a8c; padding: 14px 16px 12px; width: min(560px, 94vw); color: #fff; }
.cabinet .step { font: 900 12px "Courier New", monospace; letter-spacing: 2px; color: #5ff0f0; margin: 8px 0 6px; display: flex; align-items: center; gap: 8px; }
.cabinet .step i { font-style: normal; background: #ff4d8d; color: #fff; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; box-shadow: 2px 2px 0 #000; }
.scn-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.scn { border: 3px solid #5b1a8c; background: #2a1458; border-radius: 4px; padding: 0 0 5px; cursor: pointer; text-align: center; overflow: hidden; transition: transform .1s steps(2); font-size: 12px; font-weight: 800; color: #fff; }
.scn .pic { height: 54px; background-size: cover; background-position: center; image-rendering: pixelated; border-bottom: 3px solid #5b1a8c; }
.scn span { display: block; padding: 4px 2px 0; line-height: 1.1; }
.scn:hover { transform: translateY(-2px); background: #3a1c78; }
.scn.on { border-color: #ffe14a; box-shadow: 3px 3px 0 #ff4d8d; background: #4a2290; }
.start-hint { font-size: 12px; color: #e9ddff; min-height: 32px; margin: 6px 0 4px; line-height: 1.3; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.px-in { width: 100%; background: #0e0624; color: #ffe14a; border: 3px solid #5b1a8c; border-radius: 3px; padding: 6px 8px; font: 900 15px "Courier New", monospace; margin-bottom: 5px; user-select: text; }
.px-in.small { font-size: 12px; color: #5ff0f0; }
.px-in:focus { outline: none; border-color: #ffe14a; }
.diff-btns { display: flex; flex-direction: column; gap: 4px; }
.diff-btns button { background: #2a1458; border: 3px solid #5b1a8c; border-radius: 3px; color: #fff; font: 800 12px "Courier New", monospace; padding: 5px 6px; text-align: left; }
.diff-btns button.on { border-color: #5cf07a; background: #17503a; box-shadow: 2px 2px 0 #000; }
.arcade { display: block; width: 100%; border: 4px solid #000; border-radius: 4px; padding: 10px 12px; font: 900 18px "Courier New", monospace; letter-spacing: 2px; color: #1b0b3a; background: #ffe14a; box-shadow: 0 5px 0 #b8860b, 0 6px 0 #000; text-shadow: 1px 1px 0 rgba(255,255,255,.5); cursor: pointer; margin: 8px 0 6px; }
.arcade:hover { background: #fff07a; } .arcade:active { transform: translateY(4px); box-shadow: 0 1px 0 #b8860b, 0 2px 0 #000; }
.arcade.pink { background: #ff4d8d; color: #fff; box-shadow: 0 5px 0 #a3194f, 0 6px 0 #000; text-shadow: 2px 2px 0 #7a0e38; animation: blink 1.1s steps(2) infinite; }
.arcade.pink:hover { background: #ff77a8; animation: none; }
.arcade.green { background: #5cf07a; box-shadow: 0 5px 0 #1d8a3a, 0 6px 0 #000; font-size: 15px; }
.arcade.green span { font-weight: 700; font-size: 11px; opacity: .8; }
@keyframes blink { 50% { filter: brightness(1.18); } }
.start-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font: 700 11px "Courier New", monospace; color: #c9b8ff; }
.start-links .link { background: none; border: none; padding: 0; color: #5ff0f0; text-decoration: underline; font: inherit; }
.start-links .career { color: #ffb457; }
.retro #load { margin-top: 6px; } .retro #load-bar { background: #ff4d8d; }
@media (max-height: 560px) { .title .l1 { font-size: 30px; } .title .l2 { font-size: 26px; } .retro .sub { margin: 8px 0; } .start-wrap { gap: 10px; padding: 8px 14px; } .scn .pic { height: 34px; } .cabinet { padding: 8px 12px; } .arcade { padding: 6px 10px; font-size: 15px; } .retro .sun { display: none; } }
@media (max-width: 760px) { .scn-cards { grid-template-columns: repeat(2, 1fr); } }

/* ================= v3 UI: advisor, mayor, offers, misc ================= */
#adv-badge { position: absolute; top: -4px; right: -4px; background: #e5534b; color: #fff; border-radius: 9px; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; font-weight: 800; }
#btn-advisor, #btn-mayor { position: relative; }
.todo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.todo-row { display: flex; align-items: center; gap: 8px; background: var(--bg3); border-radius: 8px; padding: 6px 8px; }
.todo-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #1a1200; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.todo-t { flex: 1; font-size: 13px; }
.prob { background: var(--bg3); border-left: 4px solid var(--warn); border-radius: 8px; padding: 7px 9px; margin-bottom: 7px; }
.prob.sev3 { border-color: var(--bad); } .prob.sev1 { border-color: var(--blue); }
.prob-head { display: flex; align-items: center; gap: 8px; } .prob-head b { flex: 1; } .prob-i { font-size: 18px; }
.why-btn { padding: 3px 9px; font-size: 12px; background: #243447; }
.why-box { margin-top: 6px; font-size: 12.5px; color: #cfd9e3; } .why-box.hidden { display: none; }
.mayor-head { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #2c2150, #1c3550); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.mh-rank { font-size: 18px; font-weight: 800; color: var(--accent); }
.mh-grade { text-align: center; } .mh-grade b { display: block; font-size: 30px; line-height: 1; color: #5cf07a; } .mh-grade small { color: var(--muted); }
.promo-ready { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: #3a2d0f; border: 2px solid var(--accent); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.crit { margin-bottom: 6px; } .c-top { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; } .crit.ok .c-top span:first-child { color: var(--good); }
.c-bar { height: 6px; background: #1f2933; border-radius: 3px; overflow: hidden; margin-top: 2px; } .c-bar i { display: block; height: 100%; background: var(--accent); } .crit.ok .c-bar i { background: var(--good); }
.c-hint { font-size: 11px; color: var(--muted); margin-top: 1px; }
.citycard { display: flex; gap: 8px; background: var(--bg3); border-radius: 10px; overflow: hidden; margin-bottom: 7px; border: 2px solid transparent; } .citycard.here { border-color: var(--accent); }
.cc-pic { width: 84px; flex: none; background-size: cover; background-position: center; } .cc-body { padding: 6px 8px 6px 0; flex: 1; }
.tagpill { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 800; letter-spacing: .5px; background: #ff4d8d; color: #fff; padding: 1px 5px; border-radius: 3px; vertical-align: middle; } .tagpill.home { background: #3a8f5c; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.ach { background: var(--bg3); border-radius: 8px; padding: 6px; opacity: .55; text-align: center; font-size: 12px; } .ach small { display: block; color: var(--muted); font-size: 10.5px; } .ach.got { opacity: 1; border: 1px solid var(--accent); }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.offer { background: var(--bg3); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.of-pic { height: 70px; border-radius: 6px; background-size: cover; background-position: center; position: relative; margin-bottom: 4px; } .of-pic .tagpill { position: absolute; left: 4px; top: 4px; margin: 0; }
.of-goal { font-size: 12px; color: var(--accent); margin: 2px 0 6px; }
#loading-veil { position: absolute; inset: 0; background: rgba(8,12,18,.78); z-index: 60; display: flex; align-items: center; justify-content: center; } #loading-veil.hidden { display: none; }
.lv-box { background: var(--bg2); border: 2px solid var(--accent); border-radius: 10px; padding: 14px 20px; min-width: 240px; text-align: center; } .lv-bar { height: 8px; background: #1f2933; border-radius: 4px; margin-top: 8px; overflow: hidden; } .lv-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.cardwrap { position: relative; display: inline-block; } .delx { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; padding: 0; font-size: 10px; border-radius: 50%; background: #5a2630; line-height: 1; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); } .set-row small { display: block; color: var(--muted); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; } .seg button.on { background: var(--accent); color: #1a1200; border-color: var(--accent); }
@media (max-height: 560px) and (min-width: 700px) { .start-wrap { flex-wrap: nowrap; align-items: center; } .title-block { max-width: 290px; flex: none; } .title .l1 { font-size: 24px; } .title .l2 { font-size: 21px; } .cabinet { width: min(470px, 62vw); padding: 6px 10px; } .cabinet .step { margin: 4px 0 3px; } .start-hint { min-height: 0; font-size: 11px; margin: 3px 0; } .scn .pic { height: 28px; } .scn { font-size: 11px; } .px-in { padding: 3px 6px; font-size: 13px; margin-bottom: 3px; } .diff-btns button { padding: 3px 5px; } .arcade { margin: 4px 0 3px; padding: 5px 8px; } .start-links .career { display: none; } }

/* ---- v3.1: focus picker, focus panel, companies ---- */
.arch-btns{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.arch-btns button{padding:7px 10px;border-radius:10px;border:2px solid #3a4a5c;background:#16202b;color:#dfe9f3;font-weight:700;font-size:13px;cursor:pointer}
.arch-btns button.on{border-color:#f2b544;background:#2a2412;color:#ffe9b0}
.focus-card{border:2px solid #3a4a5c;border-left-width:6px;border-radius:10px;padding:8px 10px;margin:6px 0;background:#141c26}
.focus-card.here{background:#1b2a1f}
.fc-head{display:flex;align-items:center;gap:8px}.fc-ico{font-size:22px}
.focus-now{background:#1d2733;border-radius:10px;padding:10px;margin-bottom:8px}.focus-now b{font-size:20px;display:block}
.charter-card{border:2px solid #3a4a5c;border-radius:10px;padding:8px;margin:6px 0}
.chart-opts{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
.chart-opts button{padding:6px 9px;border-radius:9px;border:2px solid #3a4a5c;background:#16202b;color:#dfe9f3;font-weight:700;font-size:12px}
.chart-opts button.on{border-color:#f2b544;background:#2a2412}
