
/* Century of Steel — UI styles */
:root{--bg:#0b0f14;--panel:#121820ee;--panel2:#18202bf2;--line:#2a3646;--gold:#d8b45a;--gold2:#f3d98a;--text:#e6e1d3;--mut:#9aa3ad;--red:#d0463b;--grn:#5fb36a;--blue:#5d8fd6;--fic:#b46ad8;--sea:#0f2233;--sea2:#123047;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;--sans:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif;--hud:78px}
*{box-sizing:border-box}html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;overflow:hidden;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
button{font:inherit;color:inherit;cursor:pointer}a{color:var(--gold2)}
.hidden{display:none!important}
.btn{background:linear-gradient(#263142,#1a2230);border:1px solid #3b4a60;border-radius:6px;padding:7px 12px;color:var(--text);transition:.15s;white-space:nowrap}
.btn:hover{border-color:var(--gold);color:var(--gold2)}.btn:disabled{opacity:.4;cursor:default;border-color:#3b4a60;color:var(--text)}
/* v2.1: every real button has a clear pressed state, so a tap always feels like a tap */
.btn:active{transform:translateY(1px);filter:brightness(1.25)}
.btn.gold{background:linear-gradient(#b8923b,#8a6a22);border-color:#e3c77a;color:#1b1406;font-weight:700}.btn.gold:hover{filter:brightness(1.1);color:#000}
.btn.red{background:linear-gradient(#a63a30,#6f2119);border-color:#e0786c}.btn.sm{padding:4px 8px;font-size:12px}
.tag{display:inline-block;font-size:10px;font-weight:800;letter-spacing:.12em;padding:2px 7px;border-radius:3px;vertical-align:middle}
.tag.hist{background:#3b3220;color:var(--gold2);border:1px solid #6d5a2c}.tag.fic{background:#3a2147;color:#e6c3f6;border:1px solid #7b4a94}
.tag.proj{background:#203a3a;color:#9ee0e0;border:1px solid #3c7474}.tag.alt{background:#402a20;color:#f0b48a;border:1px solid #7a4f37}
/* ---------- screens ---------- */
.screen{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:50;overflow:auto}
#menu{background:radial-gradient(ellipse at 50% 30%,#1d2a3a 0,#0b0f14 70%)}
#menuBg{position:absolute;inset:0;opacity:.35;pointer-events:none}
.title{font-family:var(--serif);font-size:clamp(40px,7vw,86px);letter-spacing:.04em;color:var(--gold2);text-shadow:0 0 40px #d8b45a55,0 3px 0 #000;margin:0;text-align:center;line-height:1}
.subtitle{font-family:var(--serif);font-size:clamp(15px,2vw,22px);color:var(--mut);letter-spacing:.3em;text-transform:uppercase;margin:10px 0 30px;text-align:center}
.v2badge{display:inline-block;font-size:.42em;vertical-align:super;letter-spacing:.1em;color:#1b1406;background:linear-gradient(#e3c77a,#b8923b);border-radius:6px;padding:.1em .35em;text-shadow:none;font-weight:800}
.menuBox{position:relative;display:flex;flex-direction:column;gap:10px;width:min(340px,86vw)}
.menuBox .btn{padding:12px;font-size:16px;font-family:var(--serif);letter-spacing:.05em}
.disclaimer{position:relative;max-width:640px;margin:26px 16px 10px;color:var(--mut);font-size:12px;text-align:center;line-height:1.5}
/* nation select */
#newgame{background:#0b0f14f7;justify-content:flex-start;padding:24px 14px 40px}
#newgame h2{font-family:var(--serif);color:var(--gold2);font-size:30px;margin:6px 0 4px}
.ngRow{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:8px 0;max-width:1100px}
.nCard{width:250px;background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:12px;cursor:pointer;transition:.15s;text-align:left}
.nCard:hover{border-color:#5a6a80}.nCard.sel{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold),0 0 24px #d8b45a33}
.nCard h3{margin:6px 0 4px;font-family:var(--serif);font-size:18px;display:flex;align-items:center;gap:8px}
.nCard p{margin:0;color:var(--mut);font-size:12px;line-height:1.45}
.chip{display:inline-block;padding:7px 12px;border:1px solid var(--line);border-radius:20px;cursor:pointer;background:#141b25;font-size:13px}
.chip:hover{border-color:var(--gold)}
.chip.sel{border-color:var(--gold);color:var(--gold2);background:#2a2414}
.ngOpts{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;max-width:1100px;width:100%;margin:10px 0}
.ngOpts .box{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:12px}
.ngOpts h4{margin:0 0 8px;color:var(--gold);font-weight:600;letter-spacing:.06em;text-transform:uppercase;font-size:12px}
.small{font-size:12px;color:var(--mut);line-height:1.45}
/* ---------- game ---------- */
#game{position:fixed;inset:0}
#mapWrap{position:absolute;inset:calc(var(--hud) + 22px) 0 30px 0;background:var(--sea);overflow:hidden;touch-action:none}
#map{width:100%;height:100%;display:block;cursor:grab}
#map.drag{cursor:grabbing}
.sea{fill:var(--sea2);stroke:#1b4462;stroke-width:.6}
.sea:hover{fill:#174060}.sea.tgt{fill:#1d5a3a;stroke:#5fb36a;stroke-width:1.6}.sea.sel{stroke:var(--gold);stroke-width:2.2}
.reg{stroke:#0b0f14;stroke-width:.7;stroke-linejoin:round;transition:fill .3s}
.reg:hover{filter:brightness(1.18)}.reg.sel{stroke:var(--gold2);stroke-width:2.6}
.reg.tgt-move{stroke:#8fd39a;stroke-width:2}.reg.tgt-attack,.reg.tgt-amph,.reg.tgt-drop,.reg.tgt-bomb{stroke:#ff6b5b;stroke-width:2.4;stroke-dasharray:5 3}
.reg.tgt-rebase{stroke:#8fc3ff;stroke-width:2}
.fall{fill:url(#hatch);pointer-events:none}
.lbl{font-family:var(--serif);fill:#f3ead0;paint-order:stroke;stroke:#000a;stroke-width:2.6px;pointer-events:none;text-anchor:middle;font-size:9px}
.lbl.cap{font-weight:700}.lbl.sealbl{fill:#6f9cc0;font-style:italic;stroke:none;font-size:8px;letter-spacing:.1em}
.ctr{pointer-events:none}.ctr rect{stroke:#000;stroke-width:.8}.ctr text{font-size:8px;font-weight:700;fill:#fff;text-anchor:middle;font-family:var(--sans)}
.capdot{fill:#ffe9a8;stroke:#000;stroke-width:.8;pointer-events:none}
.battleFx{pointer-events:none;animation:boom 1.4s ease-out forwards}
@keyframes boom{0%{opacity:1;transform:scale(.3)}100%{opacity:0;transform:scale(2.2)}}
.nukeFx{pointer-events:none;animation:nuke 3.5s ease-out forwards}
@keyframes nuke{0%{opacity:1;r:2}40%{opacity:.9}100%{opacity:0;r:90}}
/* HUD */
#hud{position:absolute;top:0;left:0;right:0;height:var(--hud);display:flex;align-items:center;gap:10px;padding:0 10px;background:linear-gradient(#141c27,#0e141c);border-bottom:1px solid #2c3a4d;z-index:10}
/* v2.1: "How am I doing?" strip — second HUD row, plain words, always visible.
   Absolutely positioned so the top row can never wrap and clip at medium widths. */
#progress{position:absolute;left:0;right:0;bottom:3px;display:flex;gap:4px 14px;align-items:center;justify-content:center;font-size:11.5px;color:var(--mut);white-space:nowrap;overflow:hidden}
#progress b{color:var(--text)}
#progress .prGap.good{color:#8fdc98}
#progress .prGap.bad{color:#ff8a7e}
/* v2.2: always-visible research/build status — one line under the HUD.
   Tapping a segment opens the matching panel. The game area below shifts
   down 22px to make room (see #mapWrap / #tools / #objBox / #side). */
#work{position:absolute;top:var(--hud);left:0;right:0;height:22px;display:flex;gap:6px 16px;align-items:center;justify-content:center;background:#0e141c;border-bottom:1px solid #2c3a4d;font-size:11.5px;color:var(--mut);white-space:nowrap;overflow:hidden;z-index:10;padding:0 8px}
#work b{color:var(--text)}
#work .wk{cursor:pointer;min-width:0;overflow:hidden;text-overflow:ellipsis}
#work .wk:hover{color:var(--gold2);text-decoration:underline}
#work .wk.idle{color:#6b7683}
.tag.done{background:#1c2f20;color:#8fdc98;border:1px solid #3f6a47}
/* v2.2: in-place research/build state — progress shown where the player tapped */
.techAct{display:flex;align-items:center;gap:8px;margin-top:6px}
.techAct span{color:var(--gold2);font-weight:700}
.techStat{font-size:11.5px;color:var(--gold2);margin-top:4px}
.techStat a{color:var(--mut)}
.buildStat{font-size:11.5px;color:var(--gold2);margin-top:3px}
.hudFlag{display:flex;align-items:center;gap:8px;min-width:0}
.hudFlag .nm{font-family:var(--serif);font-size:16px;color:var(--gold2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.hudFlag .fac{font-size:11px;color:var(--mut)}
.res{display:flex;gap:12px;align-items:center;margin-left:6px;overflow:hidden}
.res .r{display:flex;flex-direction:column;align-items:flex-start;line-height:1.05;min-width:44px}
.res .r b{font-size:14px}.res .r span{font-size:10px;color:var(--mut);letter-spacing:.06em;text-transform:uppercase}
/* v2.1: HUD stats are tappable (they explain themselves) — the dotted
   underline says so; plain info has no underline and no hover */
.res .r[data-a]{border-bottom:1px dotted #6b7a8c;border-radius:4px;padding:1px 3px}
.res .r[data-a]:hover{background:#ffffff12}
.r.warn b{color:var(--red)}
#date{margin-left:auto;text-align:right;line-height:1.1}
#date b{font-family:var(--serif);font-size:18px;color:var(--gold2);display:block;white-space:nowrap}
#date span{font-size:11px;color:var(--mut)}
#defcon{display:flex;flex-direction:column;align-items:center;justify-content:center;width:62px;height:40px;border-radius:6px;border:1px solid #444;font-weight:800;line-height:1}
/* v2.1: DEFCON is tappable too (tap for what it means) — it brightens on hover */
#defcon[data-a]:hover{filter:brightness(1.3)}
#defcon small{font-size:8px;letter-spacing:.15em;font-weight:600}
/* v2.4: before 1959 the gauge reads WORLD TENSION (two short lines) */
#defcon.tens{font-size:14px}#defcon.tens small{font-size:6.5px;letter-spacing:.08em;line-height:1.05;text-align:center;margin-bottom:1px}
.d5{background:#1d3b5c;color:#cfe3ff}.d4{background:#1f4d2b;color:#cdf5d1}.d3{background:#6b5a12;color:#fff2b0}.d2{background:#8a3a12;color:#ffd9c2}.d1{background:#a1150f;color:#fff;animation:pulse 1s infinite}
@keyframes pulse{50%{box-shadow:0 0 18px #ff2a1a}}
#endTurn{min-width:140px;height:46px;font-size:16px}
/* v2.3: Skip ahead — same gold family as End Turn, smaller, sits beside it */
#skipAhead{min-width:108px;height:40px;font-size:14px}
/* toolbar (left side buttons) */
#tools{position:absolute;left:8px;top:calc(var(--hud) + 30px);display:flex;flex-direction:column;gap:6px;z-index:15}
#tools .btn{width:46px;height:46px;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:9px;gap:2px;background:linear-gradient(#1f2a39,#141b25)}
#tools .btn.core{width:64px;height:60px;font-size:11px;border-color:#6b5a2c;background:linear-gradient(#2c3a4f,#1d2836)}
#tools .btn.core svg{width:24px;height:24px}
#toolsMore{position:absolute;left:calc(100% + 8px);top:0;display:flex;flex-direction:column;gap:6px;background:#141b25;border:1px solid var(--line);border-radius:10px;padding:6px;z-index:14;box-shadow:0 8px 24px #000a}
#tools .btn svg{width:20px;height:20px}
#tools .btn.on{border-color:var(--gold);color:var(--gold2)}
#tools .btn .badge{position:absolute;margin:-30px 0 0 30px;background:var(--red);color:#fff;border-radius:9px;font-size:9px;padding:0 4px}
/* side panel */
#side{position:absolute;right:0;top:calc(var(--hud) + 22px);bottom:30px;width:380px;background:var(--panel);border-left:1px solid var(--line);z-index:12;display:flex;flex-direction:column;backdrop-filter:blur(6px);transform:translateX(0);transition:transform .2s}
#side.closed{transform:translateX(100%)}
#sideHead{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line)}
#sideHead h3{margin:0;font-family:var(--serif);font-size:18px;color:var(--gold2);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sideBody{overflow-y:auto;padding:10px 12px 20px;flex:1}
.x{background:none;border:1px solid transparent;border-radius:6px;font-size:22px;color:var(--mut);line-height:1;padding:2px 6px}.x:hover{color:var(--gold2);background:#ffffff14;border-color:#3d4c62}
.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 10px;font-size:13px;margin:6px 0 10px}.kv span{color:var(--mut)}
.sec{margin:14px 0 6px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold)}
.uRow{display:flex;align-items:center;gap:8px;padding:6px;border:1px solid transparent;border-radius:6px;cursor:pointer;background:#ffffff06;margin:3px 0}
.uRow:hover{border-color:#3d4c62}.uRow.sel{border-color:var(--gold);background:#d8b45a14}
.uRow:active{transform:scale(.99)}
.uRow .sil{width:54px;height:26px;flex:none}.uRow .nm{flex:1;min-width:0;font-size:13px;line-height:1.2}.uRow .nm small{display:block;color:var(--mut);font-size:11px}
.hp{width:44px;height:5px;background:#333;border-radius:3px;overflow:hidden;flex:none}.hp i{display:block;height:100%;background:var(--grn)}
.mvdot{width:8px;height:8px;border-radius:50%;background:var(--grn);flex:none}.mvdot.no{background:#555}
.actions{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.hint{font-size:12px;color:var(--mut);background:#ffffff08;border-left:3px solid var(--gold);padding:6px 8px;margin:8px 0;border-radius:0 4px 4px 0}
/* unit card */
.ucard{background:linear-gradient(160deg,#1c2533,#121821);border:1px solid #3a4658;border-radius:10px;padding:12px;margin:8px 0}
.ucard .big{width:100%;height:96px;background:radial-gradient(ellipse at 50% 80%,#2b3a4f,#141b25 70%);border-radius:6px;margin-bottom:8px}
.ucard h4{margin:0;font-family:var(--serif);font-size:17px;color:var(--gold2)}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:8px 0}.stats div{background:#0006;border-radius:4px;padding:4px;text-align:center}.stats b{display:block;font-size:14px}.stats span{font-size:9px;color:var(--mut);text-transform:uppercase;letter-spacing:.08em}
/* production / research */
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin:4px 0 8px}.tabs .chip{padding:5px 10px;font-size:12px}
.pRow{display:flex;gap:8px;align-items:center;padding:6px;border-radius:6px;background:#ffffff06;margin:3px 0}
.pRow .sil{width:58px;height:26px;flex:none}.pRow .nm{flex:1;min-width:0;font-size:12.5px;line-height:1.2}.pRow .nm small{color:var(--mut);display:block;font-size:11px}
.cost{font-size:12px;color:var(--gold2);white-space:nowrap}
.tree{display:flex;flex-direction:column;gap:6px}
.tech{border:1px solid var(--line);border-radius:6px;padding:7px 8px;background:#ffffff05;font-size:12.5px;cursor:pointer}
.tech.have{border-color:#3f6a47;background:#1c2f20}.tech.avail{border-color:#6b5a2c}.tech.avail:hover{border-color:var(--gold)}.tech.lock{opacity:.5;cursor:default}.tech.res{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold) inset}
.tech .yr{float:right;color:var(--mut);font-size:11px}.tech small{display:block;color:var(--mut);margin-top:2px;line-height:1.35}
.bar{height:6px;background:#2a2a2a;border-radius:3px;overflow:hidden;margin-top:4px}.bar i{display:block;height:100%;background:var(--gold)}
/* ticker */
#ticker{position:absolute;left:0;right:0;bottom:0;height:30px;background:#0a0e13;border-top:1px solid #2c3a4d;display:flex;align-items:center;overflow:hidden;z-index:11;font-size:13px}
#ticker .lab{background:var(--red);color:#fff;font-weight:800;font-size:11px;letter-spacing:.1em;padding:0 10px;height:100%;display:flex;align-items:center;flex:none;z-index:1}
#tickTrack{white-space:nowrap;display:inline-block;padding-left:100%;animation:tick 60s linear infinite}
#tickTrack span{margin-right:42px}#tickTrack .fiction{color:#e3c4f2}#tickTrack .nuke{color:#ff8c7c;font-weight:700}#tickTrack .war{color:#f1d38a}
@keyframes tick{to{transform:translateX(-100%)}}
/* modal */
#modal{position:fixed;inset:0;background:#000b;z-index:60;display:flex;align-items:center;justify-content:center;padding:14px}
.card{width:min(640px,96vw);max-height:92vh;overflow:auto;background:linear-gradient(#1a2230,#10151d);border:1px solid #4a5a72;border-radius:12px;box-shadow:0 20px 80px #000c;animation:rise .25s ease-out}
@keyframes rise{from{transform:translateY(14px);opacity:0}}
.card .hero{height:130px;position:relative;overflow:hidden;border-radius:12px 12px 0 0;background:#0d1219}
.card .hero svg{width:100%;height:100%}
.card .hero .date{position:absolute;left:16px;bottom:10px;font-family:var(--serif);font-size:14px;color:var(--gold2);text-shadow:0 1px 3px #000}
.card .hero .tag{position:absolute;right:12px;top:12px}
.card .body{padding:14px 18px 18px}.card h2{font-family:var(--serif);color:var(--gold2);margin:0 0 8px;font-size:24px;line-height:1.15}
.card p{line-height:1.55;margin:8px 0}.card .note{font-size:12.5px;color:#b9c0c8;border-left:3px solid #5b4a22;padding:4px 10px;background:#ffffff06}
.card.fic{border-color:#7b4a94}.card.fic .note{border-color:#7b4a94}
.opt{display:block;width:100%;text-align:left;margin:8px 0;padding:10px 12px;border-radius:8px;border:1px solid #415069;background:#1b2432}
.opt:hover{border-color:var(--gold);background:#262f3e}.opt:active{transform:translateY(1px)}.opt b{display:block;font-size:14.5px}.opt small{color:var(--mut);display:block;margin-top:3px;line-height:1.35}
.opt.hist b::after{content:" ★";color:var(--gold)}
.ending{text-align:center}.ending h2{font-size:34px}.ranks{margin:10px auto;border-collapse:collapse;font-size:13px}.ranks td{padding:3px 10px;border-bottom:1px solid #2a3442}
/* toast */
#toasts{position:fixed;top:calc(var(--hud) + 8px);left:50%;transform:translateX(-50%);z-index:70;display:flex;flex-direction:column;gap:6px;align-items:center;pointer-events:none}
.toast{background:#1a2230f2;border:1px solid #4a5a72;border-radius:8px;padding:8px 14px;font-size:13px;animation:rise .2s;max-width:90vw}
.toast.bad{border-color:var(--red)}.toast.good{border-color:var(--grn)}
#busy{position:fixed;inset:0;background:#0008;z-index:80;display:flex;align-items:center;justify-content:center;font-family:var(--serif);font-size:20px;color:var(--gold2)}
/* charts */
.chart{width:100%;height:170px;background:#0006;border-radius:6px}
.legend{display:flex;flex-wrap:wrap;gap:8px;font-size:11px;margin:4px 0}.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:4px;vertical-align:-1px}
.gauge{height:10px;background:#222;border-radius:5px;overflow:hidden;margin:3px 0 8px}.gauge i{display:block;height:100%}
table.mini{width:100%;border-collapse:collapse;font-size:12px}table.mini td,table.mini th{padding:4px 5px;border-bottom:1px solid #263142;text-align:left}table.mini th{color:var(--mut);font-weight:600}
/* v2.1: tappable table rows (e.g. diplomacy list) highlight on hover — plain rows do not */
table.mini tr[data-a]{cursor:pointer}table.mini tr[data-a]:hover{background:#ffffff10}
.rel{display:inline-block;min-width:34px;text-align:right}.pos{color:var(--grn)}.neg{color:var(--red)}
/* ---------- mobile ---------- */
@media (max-width:760px){
  :root{--hud:110px}
  #hud{flex-wrap:wrap;height:var(--hud);padding:4px 6px;gap:2px 6px;align-content:center}
  .hudFlag{order:1}#date{order:2}#defcon{order:3}#endTurn{order:4}
  /* v2.3: on a phone the Skip button shares the second HUD row with the
     resource stats (row 1 is already full), so nothing overflows. */
  #skipAhead{order:5;height:32px;font-size:13px;padding:4px 10px;min-width:0}
  .res{order:6;flex:1;width:auto}
  #progress{position:static;order:7;flex:1 1 100%;justify-content:flex-start;flex-wrap:wrap;font-size:11px}
  #work{font-size:11px;justify-content:flex-start}
  #date span .tag{display:none}#date span{font-size:10px}
  .hudFlag .nm{font-size:13px;max-width:96px}.hudFlag .fac{display:none}
  .res{order:6;flex:1;margin:0;gap:10px;justify-content:space-between}.res .r{min-width:0}.res .r b{font-size:13px}
  #date b{font-size:15px}#defcon{width:50px;height:36px}#endTurn{min-width:110px;height:44px;font-size:15px;padding:4px 8px}
  #side{width:100%;top:auto;bottom:84px;height:52%;border-left:0;border-top:1px solid var(--line);border-radius:14px 14px 0 0}
  #side.closed{transform:translateY(105%)}
  #tools{flex-direction:row;top:auto;bottom:34px;left:4px;right:4px;justify-content:space-between;gap:3px;z-index:15}
  #tools .btn{width:auto;flex:1;height:46px;min-width:0;font-size:8.5px}
  #tools .btn.core{width:auto;flex:1.6;height:54px;font-size:11px}
  #toolsMore{left:0;right:0;top:auto;bottom:calc(100% + 6px);flex-direction:row}
  #toolsMore .btn{flex:1;width:auto}
  #mapWrap{bottom:30px}
  .card .hero{height:100px}.card h2{font-size:20px}
  .nCard{width:100%}
}

@media (max-width:420px){.hudFlag .nm{display:none}#date b{font-size:14px}}
/* ---- unit illustrations ---- */
.uart{display:block}
.uRow .sil{width:84px;height:34px;flex:none;background:#0d131b;border-radius:4px}
.pRow .thumb{flex:none;cursor:pointer}.pRow .sil{width:84px;height:34px;flex:none;background:#0d131b;border-radius:4px}
.pRow .sil.big{width:120px;height:48px}
.ucard .big{height:auto;aspect-ratio:5/2;overflow:hidden;background:#0d131b}
.ucard .big .uart{width:100%;height:100%}
.ucard .cap{font-size:10.5px;color:var(--mut);margin:-4px 0 6px;letter-spacing:.02em}
.unl{display:flex;gap:4px;flex-wrap:wrap;margin-top:5px}.uth{cursor:zoom-in;border:1px solid #3a4658;border-radius:4px;overflow:hidden;line-height:0}.uth .uart{width:100px;height:40px}
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px;margin-top:6px}
.gcard{background:#0d131b;border:1px solid #2c3746;border-radius:6px;overflow:hidden;cursor:pointer}.gcard:hover{border-color:var(--gold)}
.gcard .uart{width:100%;height:auto;aspect-ratio:5/2}.gcard b{display:block;font-size:11.5px;padding:3px 6px 0;line-height:1.2}.gcard small{display:block;color:var(--mut);font-size:10.5px;padding:0 6px 4px}
@media (max-width:760px){.pRow .sil.big{width:96px;height:38px}.uRow .sil{width:72px;height:29px}.gal{grid-template-columns:repeat(2,1fr)}.uth .uart{width:84px;height:34px}}
.pRow.prodC{flex-wrap:wrap;padding:6px 6px 8px;border:1px solid #233042}
.pRow.prodC .thumb{flex:1 1 100%;line-height:0;border-radius:5px;overflow:hidden}
.pRow.prodC .sil.big{width:100%;height:auto;aspect-ratio:5/2}
@media (max-width:760px){.pRow.prodC .sil.big{width:100%;height:auto;aspect-ratio:3/1}}
/* ---------- onboarding: objectives box, advisor, tutorial, End Turn highlight, sound settings ---------- */
#objBox{position:absolute;left:62px;top:calc(var(--hud) + 30px);width:290px;z-index:9;background:#111823ec;border:1px solid #3a4a60;border-radius:10px;padding:6px 9px 7px;font-size:12px;box-shadow:0 4px 16px #0008;backdrop-filter:blur(4px)}
#objBox:empty{display:none}
#objBox .obH{display:flex;align-items:center;gap:6px;cursor:pointer;color:var(--gold2);user-select:none;min-height:24px}
#objBox .obH:hover{background:#ffffff0d;border-radius:6px}
#objBox .obH b{font-size:12px;letter-spacing:.08em;text-transform:uppercase}
#objBox .obVp{margin-left:auto;background:#2a2412;border:1px solid #6b5a2a;border-radius:9px;padding:0 7px;font-weight:700;font-size:11.5px;color:#f3d98a}
#objBox .obC{color:var(--mut);font-size:11px;width:12px;text-align:center}
#objBox.min{width:auto;padding:4px 9px}
.obEra{color:var(--mut);font-size:11px;margin:1px 0 5px}
.obG{padding:4px 0 5px;border-top:1px solid #ffffff12;cursor:pointer}
.obG:hover{background:#ffffff08;border-radius:6px}
.obG:hover .obT span{color:var(--gold2)}
.obT{display:flex;gap:6px;align-items:baseline}.obT span{flex:1;font-weight:600;line-height:1.25}.obT em{font-style:normal;color:var(--gold);font-size:11px;white-space:nowrap}
i.ob{display:block;height:5px;background:#ffffff14;border-radius:3px;margin:3px 0 2px;overflow:hidden}i.ob>i{display:block;height:100%;background:linear-gradient(90deg,#b8923a,#f3d98a);border-radius:3px}
i.ob.ok>i{background:var(--grn)}i.ob.no>i{background:var(--red)}
.obD{color:var(--mut);font-size:11px;line-height:1.35}.obD .warn,.obSum .warn{color:#ff8a7e}.obSum .good{color:#8fdc98}
.obMore{color:var(--gold);font-size:11.5px;padding-top:5px;border-top:1px solid #ffffff12;cursor:pointer;text-align:right}
.obG.big{padding:8px 0}.obG.big .obT span{font-size:13.5px}.obG.big.rsv{opacity:.75}
.obSum{font-size:15px;margin:8px 0 4px}
#advisor{position:absolute;left:50%;transform:translateX(-50%);bottom:38px;z-index:8;display:flex;align-items:center;gap:8px;max-width:min(680px,calc(100% - 140px));background:#141c27f2;border:1px solid #5a4a22;border-radius:22px;padding:5px 6px 5px 12px;font-size:12.5px;box-shadow:0 4px 18px #000a;color:var(--text)}
#advisor svg{color:var(--gold2);flex:none}#advisor .advT{flex:1;line-height:1.3}#advisor .advT b{color:var(--gold2)}#advisor .btn{flex:none;white-space:nowrap}
#endTurn.ready{animation:etPulse 1.6s ease-in-out infinite;box-shadow:0 0 0 2px #f3d98a}
@keyframes etPulse{0%,100%{box-shadow:0 0 0 2px #f3d98a,0 0 4px 2px #f3d98a66}50%{box-shadow:0 0 0 3px #fff3c4,0 0 18px 8px #f3d98aaa}}
#res .r[data-a],#defcon[data-a]{cursor:help}
#tut{position:fixed;inset:0;z-index:60;pointer-events:none}
#tut.hidden{display:none}
#tut .tutHole{position:fixed;border-radius:10px;box-shadow:0 0 0 9999px #0009,0 0 0 3px var(--gold2) inset;transition:all .25s;pointer-events:none}
#tut .tutBub{position:fixed;pointer-events:auto;background:#18202c;border:1px solid var(--gold);border-radius:12px;padding:12px 14px;box-shadow:0 10px 30px #000c;font-size:13.5px;line-height:1.45;transition:top .2s,left .2s}
#tut .tutBub h4{margin:2px 0 4px;font-family:var(--serif);font-size:18px;color:var(--gold2)}#tut .tutBub p{margin:0 0 10px}
#tut .tutN{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--mut)}
#tut .tutA{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.sndRow{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid #ffffff14}.sndRow span{flex:1}.sndRow input[type=range]{flex:2;accent-color:var(--gold)}.sndRow b{width:44px;text-align:right}
.help ol{margin:4px 0 10px 18px;padding:0}.help li{margin:3px 0}
@media (max-width:760px){
  #objBox{left:6px;top:calc(var(--hud) + 28px);width:calc(100% - 12px);max-width:380px}
  #objBox.min{width:auto;max-width:none}
  #advisor{left:6px;right:6px;transform:none;max-width:none;bottom:86px;border-radius:14px;font-size:12px;padding:5px 6px 5px 10px}
  #tut .tutBub{font-size:13px}
}
@media (max-width:760px){#side.closed{transform:translateY(calc(105% + 96px))}}
/* v2: enemy-moves replay bar */
#replayBar{position:fixed;left:50%;transform:translateX(-50%);bottom:92px;z-index:70;display:flex;gap:10px;align-items:center;background:#1a2230f2;border:1px solid var(--red);border-radius:8px;padding:8px 12px;font-size:13px;box-shadow:0 6px 24px #000a;max-width:94vw}
#replayBar #rpTxt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:760px){#replayBar{bottom:140px}}
/* v2.1: regions that changed hands this turn keep a pulsing gold outline
   until the player taps the map or acts */
.chg{fill:none;stroke:#ffd24d;stroke-width:2.5;stroke-dasharray:6 4;pointer-events:none;animation:chgPulse 1.2s ease-in-out infinite}
@keyframes chgPulse{50%{opacity:.3}}
/* v2.1: "What changed" summary — plain-words list that stays up until closed */
#chgBox{position:fixed;left:50%;transform:translateX(-50%);bottom:96px;z-index:55;width:min(430px,94vw);background:#141c27f2;border:1px solid #6b5a2c;border-radius:10px;box-shadow:0 8px 30px #000c;padding:8px 10px;font-size:13px}
#chgBox .chgH{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:2px}
#chgBox .chgH b{font-family:var(--serif);color:var(--gold2);font-size:14px}
.chgRow{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:1px solid transparent;border-radius:6px;padding:5px 6px;color:var(--text);font-size:13px;cursor:pointer}
.chgRow:hover{background:#ffffff10;border-color:#3d4c62}
.chgRow .chgDot{width:8px;height:8px;border-radius:50%;background:#9aa3ad;flex:none}
.chgRow.good .chgDot{background:#5fb36a}
.chgRow.bad .chgDot{background:#d0463b}
#chgBox .chgF{color:var(--mut);font-size:11px;padding:4px 6px 0}
@media (max-width:760px){#chgBox{bottom:150px}}
/* PWA: install button + update bar */
#btnInstall{border-color:var(--gold)}
.pwaSteps{line-height:1.8;padding-left:22px;margin:10px 0}.pwaIco{display:inline-block;border:1px solid var(--line);border-radius:4px;padding:0 5px}
#pwaUpdate{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom));z-index:200;display:flex;gap:10px;align-items:center;background:var(--panel2);border:1px solid var(--gold);border-radius:8px;padding:8px 12px;box-shadow:0 6px 24px #000a;max-width:94vw;font-size:13px}

/* v2.4: dug-in tag on unit rows and the attack preview */
.entTag{color:#cbb683;white-space:nowrap;cursor:help}
/* v2.4: why a Build button is greyed out */
.pRow .whyNot{flex:1 1 100%;text-align:right;font-size:11px;color:#ff8a7e;margin-top:2px}
/* ---------- v2.4: phone layout (390×844 and similar) ----------
   - HUD rows start at the top so End Turn is never clipped; the "how am I doing"
     strip is a single line (region counts and trend hidden on phones).
   - Toolbar buttons are opaque so map labels never show through More / Menu.
   - Advisor, toolbar, objectives, toasts and the panel sheet never overlap:
     the advisor sits above the toolbar, the sheet sits above the toolbar, and
     while a sheet is open the advisor hides and objectives collapse to their header. */
@media (max-width:760px){
  #hud{align-content:flex-start;padding-top:3px;overflow:hidden}
  #progress{flex-wrap:nowrap;overflow:hidden;text-overflow:ellipsis;gap:0 10px;height:16px;line-height:16px}
  #progress .prR,#progress .prT{display:none}
  #advisor{bottom:94px}
  #side{bottom:92px;height:50%}
  #side.closed{transform:translateY(calc(100% + 100px))}
  body.sheetOpen #advisor{display:none}
  body.sheetOpen #objBox{width:auto;max-width:none}
  body.sheetOpen #objBox>:not(.obH){display:none}
  #toasts{top:auto;bottom:146px;width:calc(100% - 16px);max-width:380px}
  body.sheetOpen #toasts,body.chgOpen #toasts{bottom:auto;top:calc(var(--hud) + 22px + 48px)}
  #toasts .toast{max-width:100%;font-size:12.5px;padding:7px 11px}
  #toasts .toast:nth-last-child(n+3){display:none}
}
@media (min-width:761px){
  /* desktop: toasts start to the right of the objectives box */
  #toasts{left:calc(50% + 60px);max-width:min(520px,calc(100vw - 520px))}
}
/* v2.5.2: minimized sheet — slim strip when a unit is selected on phones.
   The region title stays in the header, the move/attack hint stays visible
   in the strip, and Details (or the strip itself) re-opens the full panel.
   Desktop is untouched: the strip and the toggle button are hidden there. */
#sideMini{display:none}
#sideMinBtn{display:none}
@media (max-width:760px){
  #side.canMin #sideMinBtn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex:none;border:1px solid var(--line);border-radius:6px;background:#141b25;color:var(--gold2);font-size:15px;cursor:pointer}
  #side.min{height:80px;transition:transform .2s,height .18s ease}
  #side.min #sideHead{padding:4px 12px}
  #side.min #sideBody{display:none}
  #side.min #sideMini{display:flex;align-items:center;gap:8px;padding:2px 10px 6px;cursor:pointer}
  #sideMini .miniHint{flex:1;min-width:0;font-size:12px;line-height:1.3;color:var(--mut)}
  #sideMini .miniHint b{color:#8fd39a}
  #sideMini .btn{flex:none}
}
/* v2.4: per-front supply chips (Forces panel) */
.supChip{flex:none;display:inline-block;min-width:74px;text-align:center;font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;padding:4px 7px;border-radius:10px;border:1px solid}
.supChip.green{background:#1c2f20;color:#8fdc98;border-color:#3f6a47}
.supChip.amber{background:#3a2f12;color:#f3d98a;border-color:#7a6326}
.supChip.red{background:#4a1712;color:#ffb3a8;border-color:#a23a2e}
.supChip.sm{min-width:0;font-size:9px;padding:1px 6px;vertical-align:middle}
.uRow.front .nm b{font-weight:700}
.warnT{color:#f3d98a}
/* v2.4: Decisions panel */
.opt.dec:disabled{opacity:.55;cursor:default}
.opt.dec.sugg{border-color:#6b5a2c;box-shadow:0 0 0 1px #6b5a2c55}
.opt.dec .whyD{color:#ff8a7e}
.decFx{font-size:12px;color:var(--gold2);padding:3px 0}
/* v2.5 prepare stance */
.prepTag{color:#e9a25b;white-space:nowrap;cursor:help}
.oddsCmp{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0 4px}
.oddsCmp>div{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:8px}
.oddsCmp small{display:block;color:#9aa4b1;font-size:11px;text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px}
.oddsCmp b{display:block;font-size:13px;line-height:1.25}
.oddsCmp i{display:block;font-style:normal;color:#9aa4b1;font-size:11px;margin-top:3px}
@media (max-width:520px){.oddsCmp{grid-template-columns:1fr}}
/* v2.5 national focus tree */
body.focusOpen #side{width:560px}
.fCur{background:rgba(212,175,85,.08);border:1px solid rgba(212,175,85,.35);border-radius:10px;padding:8px 10px;margin:8px 0 10px}
.fCur small{display:block;color:#9aa4b1;font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.fCur b{color:var(--gold2)}
.fCur em{display:block;font-style:normal;color:#b8c0ca;font-size:11.5px;margin-top:4px}
.fCur.none{background:rgba(233,162,91,.1);border-color:rgba(233,162,91,.55);color:#f0c9a0}
.fCur.none b{color:#ffcf96}
.fBar{display:block;height:4px;background:rgba(255,255,255,.1);border-radius:3px;overflow:hidden;margin-top:5px}
.fBar>i{display:block;height:100%;background:linear-gradient(90deg,#c9a24a,#f3d98a)}
.fTree{display:grid;grid-template-columns:repeat(3,minmax(108px,1fr));gap:8px;overflow-x:auto;padding-bottom:4px}
.fCol{display:flex;flex-direction:column;align-items:stretch;min-width:0}
.fBr{font-family:var(--serif);color:var(--gold2);font-size:13px;text-align:center;padding:4px 2px 6px;border-bottom:1px solid var(--line);margin-bottom:4px;min-height:34px;display:flex;align-items:center;justify-content:center;line-height:1.15}
.fTier{position:relative;padding-top:14px;display:flex;flex-direction:column}
.fTier::before{content:'';position:absolute;left:50%;top:0;height:14px;border-left:2px solid #3a4a5e}
.fTier.first{padding-top:4px}.fTier.first::before{display:none}
.fFork{display:flex;flex-direction:column;gap:2px;border:1px dashed #4a5a70;border-radius:9px;padding:4px}
.fOr{font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:#8a96a6;text-align:center}
.fNode{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;min-height:52px;padding:6px 5px 7px;border-radius:8px;border:1px solid #3a4a5e;background:#18212c;color:#c9d1db;font:inherit;font-size:11.5px;line-height:1.2;text-align:center;cursor:pointer}
.fNode .fN{font-weight:600}
.fNode .fT{font-size:10.5px;color:#8a96a6}
.fNode.done{background:linear-gradient(#2a3a26,#1f2c1c);border-color:#5f8a4f;color:#d7ecc9}
.fNode.done .fT{color:#9fd08a}
.fNode.act{background:linear-gradient(#3b3220,#2a2416);border-color:#d4af55;color:#ffe9b0;box-shadow:0 0 0 1px rgba(212,175,85,.4),0 0 12px rgba(212,175,85,.25)}
.fNode.act .fT{color:#f3d98a}
.fNode.av{background:linear-gradient(#22344a,#1a2838);border-color:#6f9ad0;color:#e6eef8}
.fNode.av:hover{border-color:#a8c8ef}
.fNode.lk{opacity:.55}
.fNode.x{opacity:.35;text-decoration:line-through}
.fNode .fBar{position:absolute;left:6px;right:6px;bottom:3px;margin:0;height:3px}
.fLeg .lg{display:inline-block;padding:0 6px;border-radius:5px;border:1px solid #3a4a5e;margin-right:2px}
.fLeg .lg.done{border-color:#5f8a4f;color:#9fd08a}.fLeg .lg.act{border-color:#d4af55;color:#f3d98a}.fLeg .lg.av{border-color:#6f9ad0;color:#cfe0f5}.fLeg .lg.lk{opacity:.6}
.fCard ul.fFx{margin:4px 0 8px 18px;padding:0}.fCard ul.fFx li{margin:2px 0}
.obFocus{font-size:12px;color:#d8c48f;padding:4px 2px 2px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.obFocus b{color:var(--gold2)}
.obFocus.warn{color:#ffb27a}
@media (max-width:520px){body.focusOpen #side{width:100%}.fTree{gap:5px;grid-template-columns:repeat(3,minmax(104px,1fr))}.fNode{font-size:11px;min-height:48px;padding:5px 3px 7px}.fBr{font-size:12px}#work{overflow-x:auto}}
/* v2.5: keep "What changed" clear of an open panel (and below modals) */
body.sheetOpen #chgBox{left:calc((100% - 380px) / 2);width:min(430px,calc(100% - 420px))}
body.focusOpen #chgBox{left:calc((100% - 560px) / 2);width:min(430px,calc(100% - 600px))}
@media (max-width:760px){
  body.sheetOpen #chgBox,body.focusOpen #chgBox{left:50%;width:94vw;bottom:auto;top:calc(var(--hud) + 58px);max-height:calc(50vh - var(--hud) - 160px);overflow:auto}
}
/* ---------- v2.6: easier start ---------- */
/* Main menu: two-line buttons; with no game to continue, Quick start is the big gold one. */
.menuBox .btn small{display:block;font-family:var(--sans);font-size:12px;letter-spacing:0;font-weight:400;opacity:.75;margin-top:3px;white-space:normal;line-height:1.35}
.menuBox .btn.big{padding:15px 12px 13px;font-size:20px}
.menuBox .btn.gold small{opacity:.8}
.btn:focus-visible,.chip:focus-visible,.nCard:focus-visible,.ngMore summary:focus-visible{outline:2px solid var(--gold2);outline-offset:2px}
/* New campaign: nation tiles, one detail panel, settings with visible descriptions,
   and a bar pinned to the bottom so Begin is always on screen. */
#newgame{padding:0;justify-content:flex-start}
.ngWrap{width:100%;max-width:1060px;flex:1 0 auto;display:flex;flex-direction:column;align-items:center;padding:20px 14px 16px}
#newgame h2{margin:4px 0 2px}
.ngLead{color:var(--mut);font-size:13px;margin:0 0 14px;text-align:center}
.ngGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;width:100%}
.ngGrid .nCard{width:auto;position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-height:100px;color:var(--text);font:inherit;padding:11px 12px}
.ngGrid .nCard.sel{background:#1d2633}
.nTop{display:flex;align-items:center;gap:8px;font-family:var(--serif);font-size:17px;line-height:1.15}
.nTop b{font-weight:600}
.nTag{font-size:12px;color:var(--mut);line-height:1.4}
.nDiff{margin-top:auto;font-size:11px;font-weight:600;padding:1px 8px;border-radius:9px;border:1px solid}
.nDiff.easy{color:#8fdc98;border-color:#3f6a47;background:#1c2f20}
.nDiff.medium{color:#f3d98a;border-color:#6b5a2a;background:#2a2412}
.nDiff.hard{color:#ffa79d;border-color:#7a3a33;background:#2f1a18}
.nRec{position:absolute;top:-9px;right:10px;background:linear-gradient(#e3c77a,#b8923b);color:#1b1406;font-size:10.5px;font-weight:700;padding:1px 8px;border-radius:9px;box-shadow:0 2px 6px #0008}
.ngPick{width:100%;margin:12px 0 0;background:#141b25;border:1px solid #6b5a2c;border-radius:10px;padding:10px 14px 12px}
.ngPickH{display:flex;align-items:center;gap:10px;font-family:var(--serif);font-size:19px;color:var(--gold2)}
.ngPickH b{font-weight:600}
.ngPick p{margin:6px 0 0;font-size:13px;line-height:1.55;max-width:80ch}
.ngWrap .ngOpts{margin:12px 0 0}
.ngChips{display:flex;flex-wrap:wrap;gap:6px}
.ngChips .chip{color:var(--text);font:inherit;font-size:13px}
.ngChips .chip.sel{color:var(--gold2)}
.ngDesc{font-size:12.5px;color:var(--mut);line-height:1.5;margin-top:8px}
.ngDesc b{color:var(--text);font-weight:600}
.ngWait{color:#6b7683}
.ngMore{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}
.ngMore summary{cursor:pointer;color:var(--gold2);font-size:13px;list-style:none;display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline;border-radius:4px}
.ngMore summary::-webkit-details-marker{display:none}
.ngMore summary::before{content:'▸';color:var(--gold);display:inline-block;transition:transform .15s}
.ngMore[open] summary::before{transform:rotate(90deg)}
.ngMore summary span{color:var(--mut);font-size:12px}
.ngMore h4{margin:14px 0 8px!important}
.ngBar{position:sticky;bottom:0;width:100%;display:flex;align-items:center;gap:12px;padding:10px max(14px,calc((100% - 1032px) / 2)) calc(10px + env(safe-area-inset-bottom,0px));background:#0e141cf5;border-top:1px solid #2c3a4d;box-shadow:0 -8px 24px #0009;z-index:2}
.ngSum{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-end;line-height:1.25}
.ngSum b{font-family:var(--serif);color:var(--gold2);font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.ngSum span{font-size:12px;color:var(--mut);white-space:nowrap}
#ngGo{min-width:190px;padding:12px 18px;font-size:16px}
#ngBack{padding:12px 16px}
@media (max-width:760px){
  #newgame h2{font-size:24px}
  .ngGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .ngGrid .nCard{min-height:0;padding:9px 10px;gap:4px}
  .nTop{font-size:15px}.nTag{font-size:11.5px}
  .ngSum{align-items:flex-start}
  #ngGo{min-width:0;padding:12px 14px}
  #ngBack{padding:12px}
}
/* Desktop: the v2 core toolbar buttons are 64px wide, so the objectives box
   starts after them instead of covering their right edge. */
@media (min-width:761px){#objBox{left:82px}}
/* v2.6: Skip ahead is a secondary button, so End Turn is the one obvious gold action. */
#skipAhead{border-color:#6b5a2c;color:var(--gold2)}

