* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0e11; color: #d8dde2; font-family: "Lucida Console", Consolas, "Courier New", monospace; font-size: 13px; overflow: hidden; }
button { font-family: inherit; background: linear-gradient(#3b4651, #232b33); color: #e8edf1; border: 1px solid #5a6873; border-bottom-color: #121a20; padding: 6px 12px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; }
button:hover { background: linear-gradient(#4b5863, #2b353e); }
button:active { background: #1c242b; }
button.primary { background: linear-gradient(#b8862a, #7a5410); border-color: #e0b050; color: #fff; }
button.small { padding: 3px 7px; font-size: 11px; }
select, input[type=text], input[type=number] { font-family: inherit; background: #10161b; color: #e8edf1; border: 1px solid #44525c; padding: 3px 5px; }
input[type=range] { width: 120px; vertical-align: middle; }
label { display: inline-flex; align-items: center; gap: 6px; margin: 3px 8px 3px 0; }
.hidden { display: none !important; }
.muted { color: #7f8c97; font-size: 11px; }
h1, h2, h3 { margin: 0 0 10px; font-weight: normal; letter-spacing: 1px; }
h2 { color: #e0b050; font-size: 16px; border-bottom: 1px solid #3a4650; padding-bottom: 4px; }
h3 { color: #9fc5ff; font-size: 13px; margin-top: 10px; }
ul { padding-left: 18px; margin: 4px 0; } li { margin: 2px 0; }

#app { width: 100%; height: 100%; position: relative; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }

/* ---------- menu ---------- */
#menubg { position: absolute; inset: 0; width: 100%; height: 100%; }
.menu-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(10,14,18,0.9); border: 2px solid #5a6873; padding: 30px 50px; text-align: center; min-width: 380px; box-shadow: 0 0 60px #000; }
.menu-box h1 { font-size: 44px; color: #e0b050; text-shadow: 3px 3px 0 #3a2a05; letter-spacing: 6px; }
.menu-box h1 span { display: block; font-size: 22px; color: #c8342c; letter-spacing: 14px; }
.menu-box .tag { color: #8fa; margin-top: -4px; }
.menu-box button.big { display: block; width: 100%; margin: 8px 0; padding: 12px; font-size: 15px; }
.menu-box .credits { font-size: 10px; color: #6a7680; margin-top: 16px; }

/* ---------- panels ---------- */
.panel { background: #141a20; border: 1px solid #3a4650; padding: 14px 18px; box-shadow: 0 0 30px #000; }
.panel.wide { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(960px, 95vw); max-height: 92vh; overflow: auto; }
#options .panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 420px; }
#options label { display: flex; justify-content: space-between; margin: 8px 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.row.end { justify-content: flex-end; margin-top: 12px; }

/* ---------- setup ---------- */
.setup-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px; padding: 14px; height: 100%; max-width: 1200px; margin: 0 auto; }
.map-panel { overflow: auto; }
#map-preview { width: 300px; height: 300px; image-rendering: pixelated; border: 1px solid #3a4650; background: #000; display: block; margin-bottom: 6px; }
#gen-params label { display: flex; justify-content: space-between; }
#gen-btn { width: 100%; margin-top: 6px; }
.players-panel { overflow: auto; }
#slots { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
#slots th { text-align: left; color: #7f8c97; font-weight: normal; font-size: 11px; padding: 2px 4px; }
#slots td { padding: 2px 4px; border-top: 1px solid #222a31; }
#slots select { width: 100%; }
.swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid #000; vertical-align: middle; }
.rules { display: grid; grid-template-columns: 1fr 1fr; }

/* ---------- game ---------- */
#game { display: none; grid-template-rows: 32px 1fr; grid-template-columns: 1fr 204px; }
#game.active { display: grid; }
#topbar { grid-column: 1 / 3; background: linear-gradient(#2a333b, #171d22); border-bottom: 2px solid #0a0d10; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; font-size: 13px; }
#topbar button { padding: 2px 8px; font-size: 11px; margin-left: 4px; }
.tb-left > span { margin-right: 18px; }
.tb-credits { color: #ffd34a; font-weight: bold; font-size: 15px; }
.powerbar { display: inline-block; width: 90px; height: 8px; background: #000; border: 1px solid #555; margin-left: 6px; vertical-align: middle; position: relative; }
.powerbar span { display: block; height: 100%; background: #3c3; width: 50%; }
#main { position: relative; overflow: hidden; background: #000; }
#view { display: block; cursor: crosshair; }
#msgs { position: absolute; left: 8px; bottom: 8px; pointer-events: none; font-size: 12px; text-shadow: 1px 1px 0 #000; }
#msgs div { margin-bottom: 2px; }
#tooltip { position: absolute; background: rgba(10,14,18,0.95); border: 1px solid #5a6873; padding: 6px 8px; font-size: 11px; max-width: 220px; pointer-events: none; z-index: 10; }
#tooltip b { color: #ffd34a; }
#gameover { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(10,14,18,0.95); border: 2px solid #e0b050; padding: 20px 30px; text-align: center; z-index: 20; }
#gameover h2 { font-size: 24px; }
#go-stats { text-align: left; margin: 10px 0; font-size: 12px; }
#go-stats table { border-collapse: collapse; } #go-stats td, #go-stats th { padding: 2px 10px; }

/* sidebar */
#sidebar { background: linear-gradient(90deg, #1b2228, #141a1f); border-left: 2px solid #0a0d10; display: flex; flex-direction: column; overflow: hidden; }
#radar { width: 200px; height: 200px; border-bottom: 2px solid #0a0d10; image-rendering: pixelated; cursor: pointer; }
.sb-btns { display: flex; } .sb-btns button { flex: 1; padding: 5px 0; font-size: 11px; }
.sb-btns button.on { background: #7a5410; border-color: #e0b050; }
.sb-tabs { display: flex; } .sb-tabs button { flex: 1; padding: 4px 0; font-size: 9px; border-radius: 0; letter-spacing: 0; }
.sb-tabs button.on, .z-tabs button.on { background: #3b4a56; border-bottom-color: #ffd34a; color: #ffd34a; }
#buildlist { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; align-content: start; }
.bicon { position: relative; height: 52px; border: 1px solid #4a5a66; background: #0f1418; cursor: pointer; overflow: hidden; user-select: none; }
.bicon canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.bicon .cost { position: absolute; left: 2px; bottom: 1px; font-size: 10px; color: #ffd34a; text-shadow: 1px 1px 0 #000; }
.bicon .name { position: absolute; left: 2px; top: 1px; font-size: 9px; color: #dfe; text-shadow: 1px 1px 0 #000; }
.bicon .cnt { position: absolute; right: 2px; top: 1px; font-size: 11px; color: #fff; background: rgba(0,0,0,0.6); padding: 0 3px; }
.bicon .prog { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,0.6); border-right: 2px solid #ffd34a; pointer-events: none; }
.bicon .status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: #ffd34a; background: rgba(0,0,0,0.35); text-shadow: 1px 1px 0 #000; }
.bicon.disabled { opacity: 0.35; cursor: not-allowed; }
.bicon:hover { border-color: #ffd34a; }
#selinfo { border-top: 2px solid #0a0d10; padding: 6px; font-size: 11px; min-height: 70px; max-height: 120px; overflow: auto; }
#selinfo b { color: #ffd34a; }

/* zeus */
#zeus { position: absolute; left: 8px; top: 30px; width: 300px; max-height: calc(100% - 50px); background: rgba(12,16,20,0.96); border: 2px solid #c8342c; display: flex; flex-direction: column; z-index: 15; }
.z-head { background: #c8342c; color: #fff; padding: 4px 8px; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.z-head .muted { color: #fdd; flex: 1; font-weight: normal; }
.z-head button { padding: 0 6px; }
.z-row { padding: 4px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.z-row input[type=range] { width: 70px; }
.z-tabs { display: flex; } .z-tabs button { flex: 1; padding: 4px 0; font-size: 10px; }
#z-body { overflow-y: auto; padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
#z-body button { font-size: 10px; padding: 5px 4px; text-transform: none; text-align: left; }
#z-body button.on { background: #7a2a20; border-color: #ff8a7a; }
#z-body .full { grid-column: 1 / 3; }
#z-body .ztitle { grid-column: 1 / 3; color: #ffd34a; font-size: 11px; margin-top: 4px; }
#z-body .zicon { display: flex; align-items: center; gap: 4px; }
#z-body .zicon canvas { width: 30px; height: 22px; image-rendering: pixelated; }
.z-foot { padding: 4px 8px; border-top: 1px solid #333; }

/* modal */
#modal { position: absolute; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #141a20; border: 2px solid #e0b050; padding: 16px 20px; min-width: 360px; max-width: 640px; box-shadow: 0 0 40px #000; }
.modal-box textarea { width: 100%; height: 160px; background: #0b0e11; color: #cde; border: 1px solid #44525c; font-family: inherit; font-size: 10px; }
.modal-box input[type=text] { width: 100%; }

#zeus.min { width: auto; min-width: 150px; opacity: 0.92; }
#zeus.min .z-row, #zeus.min .z-tabs, #zeus.min #z-body, #zeus.min .z-foot { display: none; }
#zeus.min .z-head .muted { display: none; }
#zeus.min .z-head::after { content: ''; }
.z-head { cursor: pointer; user-select: none; }

/* Multiplayer menu: same limited-color palette as the existing UI */
#multiplayer { background: #101820; }
.multiplayer-panel { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(90vw,560px); padding:28px; background:#111b22; border:2px solid #5a6873; }
.multiplayer-panel p { line-height:1.6; margin:14px 0; }
.multiplayer-actions { display:grid; gap:12px; margin:24px 0; }
.multiplayer-link { display:block; padding:15px; text-align:center; text-decoration:none;
  color:#f0d9a7; background:#304356; border:1px solid #687989; font-weight:bold; }
.multiplayer-link:hover { background:#40596f; }

#scenario { background:#121b23; overflow-y:auto; }
.scenario-panel { max-width:1150px; margin:28px auto; padding:24px; }
.scenario-layout { display:grid; grid-template-columns:minmax(300px,1fr) minmax(340px,1fr); gap:24px; }
.scenario-years { display:flex; justify-content:space-between; color:#b6ad91; font-size:12px; margin-bottom:18px; }
#scenario-year { width:100%; margin:14px 0 4px; accent-color:#c8a66b; }
.scenario-option { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:12px 0; }
.scenario-map-wrap { min-width:0; }
#scenario-map { width:100%; height:auto; background:#173b5b; border:2px solid #7d826d; image-rendering:pixelated; }
#scenario-factions { margin:16px 0; display:grid; gap:8px; }
.scenario-faction { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; border:1px solid #465761; background:#1a2831; }
.scenario-faction strong { font-size:13px; }
.scenario-summary { line-height:1.6; min-height:55px; }
@media(max-width:760px){.scenario-layout{grid-template-columns:1fr}.scenario-panel{margin:10px;padding:14px}}

/* ===========================================
   Readability pass: widescreen and short-height displays
   =========================================== */
#game { grid-template-columns: minmax(0, 1fr) clamp(270px, 19vw, 355px); grid-template-rows: 40px minmax(0,1fr); min-width: 0; }
#topbar { min-width:0; gap:8px; padding:0 12px; font-size:12px; }
.tb-left, .tb-right { display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap; }
.tb-left > span { margin-right:5px; }
#main { min-width:0; min-height:0; }
#view { image-rendering:pixelated; }
#sidebar { min-height:0; min-width:0; }
#radar { width:min(100%, 210px); height:auto; aspect-ratio:1 / 1; align-self:center; flex:0 0 auto; }
.sb-btns button { padding:8px 2px; font-size:12px; }
.sb-tabs button { padding:8px 2px; font-size:11px; font-weight:bold; }
#buildlist { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:8px; }
.bicon { height:76px; border:1px solid #566a75; border-radius:3px; }
.bicon .name { left:5px; top:4px; max-width:calc(100% - 9px); line-height:1.15; font-size:11px; font-weight:bold; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bicon .cost { left:5px; bottom:4px; font-size:12px; font-weight:bold; }
.bicon .status { font-size:12px; }
#selinfo { min-height:82px; max-height:128px; padding:9px; font-size:12px; }
#btn-zoom-in, #btn-zoom-out, #btn-zoom-reset { font-weight:bold; padding:3px 8px; }
#tb-zoom { display:inline-block; min-width:40px; text-align:center; color:#f1d393; font-weight:bold; }
@media(max-height:770px) {
  #radar { width:min(100%,140px); }
  .bicon { height:66px; }
  #selinfo { max-height:92px; min-height:58px; }
}
@media(max-width:1220px) {
  #game { grid-template-columns:minmax(0,1fr) 260px; }
  #topbar { font-size:11px; }
  .tb-left, .tb-right { gap:4px; }
  .tb-left > span { margin-right:1px; }
  .powerbar { width:50px; }
}

/* ---- menu / lobby styles from the live site ---- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0e11; color: #d8dde2; font-family: "Lucida Console", Consolas, "Courier New", monospace; font-size: 13px; overflow: hidden; }
button { font-family: inherit; background: linear-gradient(#3b4651, #232b33); color: #e8edf1; border: 1px solid #5a6873; border-bottom-color: #121a20; padding: 6px 12px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; }
button:hover { background: linear-gradient(#4b5863, #2b353e); }
button:active { background: #1c242b; }
button.primary { background: linear-gradient(#b8862a, #7a5410); border-color: #e0b050; color: #fff; }
button.small { padding: 3px 7px; font-size: 11px; }
select, input[type=text], input[type=number] { font-family: inherit; background: #10161b; color: #e8edf1; border: 1px solid #44525c; padding: 3px 5px; }
input[type=range] { width: 120px; vertical-align: middle; }
label { display: inline-flex; align-items: center; gap: 6px; margin: 3px 8px 3px 0; }
.hidden { display: none !important; }
.muted { color: #7f8c97; font-size: 11px; }
h1, h2, h3 { margin: 0 0 10px; font-weight: normal; letter-spacing: 1px; }
h2 { color: #e0b050; font-size: 16px; border-bottom: 1px solid #3a4650; padding-bottom: 4px; }
h3 { color: #9fc5ff; font-size: 13px; margin-top: 10px; }
ul { padding-left: 18px; margin: 4px 0; } li { margin: 2px 0; }

#app { width: 100%; height: 100%; position: relative; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }

/* ---------- menu ---------- */
#menubg { position: absolute; inset: 0; width: 100%; height: 100%; filter: brightness(.45) saturate(.9); }
#menu::after { content:''; position:absolute; inset:0; background: radial-gradient(circle at center, rgba(8,12,15,.18), rgba(5,8,10,.55) 65%, rgba(0,0,0,.72)); pointer-events:none; }
.menu-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 120px));
  background: rgba(6,10,14,0.84);
  border: 2px solid rgba(115,130,147,.78);
  padding: 34px 62px 42px;
  text-align: center;
  box-shadow: 0 18px 64px rgba(0,0,0,.72), inset 0 0 0 1px rgba(255,255,255,.04);
  z-index: 1;
}
.menu-box h1 { margin: 4px 0 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1; text-transform: uppercase; }
.menu-box h1 .wordmark { display:block; font-size: clamp(48px, 7vw, 66px); color:#d2a33d; letter-spacing: 12px; text-shadow: 0 2px 0 #6d4f11, 0 0 18px rgba(210,163,61,.12); }
.menu-box h1 .year { display:block; margin-top: 4px; font-size: clamp(18px, 3.4vw, 28px); color:#d24735; letter-spacing: 18px; text-shadow: 0 1px 0 #5e1711; }
.menu-box .tag { color: #87ffb8; margin: 8px 0 14px; font: 700 clamp(15px, 2vw, 18px)/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.menu-box button.big {
  display:block; width:100%; margin: 12px 0; padding: 16px 18px;
  font: 800 clamp(16px, 2.4vw, 19px)/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 1px; color:#e5e9ef;
  border: 1px solid rgba(145,157,170,.72);
  background: linear-gradient(180deg, rgba(58,70,86,.96), rgba(35,45,57,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 1px 0 rgba(0,0,0,.35);
}
.menu-box button.big:hover { filter: brightness(1.08); }
.menu-box button.big.primary {
  color: #f6f0e1;
  border-color: rgba(176,125,28,.9);
  background: linear-gradient(180deg, #b98922, #a77314);
  box-shadow: inset 0 1px 0 rgba(255,238,192,.25), 0 1px 0 rgba(0,0,0,.35);
}
.menu-box .credits { font-size: 11px; line-height:1.4; color: #7a8790; margin-top: 18px; }
.setup-tools { display:flex; justify-content:flex-end; margin: 18px 12px 0; }
.scenario-shortcut { background: linear-gradient(180deg,#b98922,#8c6213); border-color:#b07d1c; color:#f5eddc; font-weight:700; }
/* Multiplayer menu: same limited-color palette as the existing UI */
#multiplayer { background: #101820; }
.multiplayer-panel { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(90vw,560px); padding:28px; background:#111b22; border:2px solid #5a6873; }
.multiplayer-panel p { line-height:1.6; margin:14px 0; }
.multiplayer-actions { display:grid; gap:12px; margin:24px 0; }
.multiplayer-link { display:block; padding:15px; text-align:center; text-decoration:none;
  color:#f0d9a7; background:#304356; border:1px solid #687989; font-weight:bold; }
.multiplayer-link:hover { background:#40596f; }

#scenario { background:#121b23; overflow-y:auto; }
.scenario-panel { max-width:1150px; margin:28px auto; padding:24px; }
.scenario-layout { display:grid; grid-template-columns:minmax(300px,1fr) minmax(340px,1fr); gap:24px; }
.scenario-years { display:flex; justify-content:space-between; color:#b6ad91; font-size:12px; margin-bottom:18px; }
#scenario-year { width:100%; margin:14px 0 4px; accent-color:#c8a66b; }
.scenario-option { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:12px 0; }
.scenario-map-wrap { min-width:0; }
#scenario-map { width:100%; height:auto; background:#173b5b; border:2px solid #7d826d; image-rendering:pixelated; }
#scenario-factions { margin:16px 0; display:grid; gap:8px; }
.scenario-faction { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; border:1px solid #465761; background:#1a2831; }
.scenario-faction strong { font-size:13px; }
.scenario-summary { line-height:1.6; min-height:55px; }
@media(max-width:760px){.scenario-layout{grid-template-columns:1fr}.scenario-panel{margin:10px;padding:14px}}

/* ===========================================
   Readability pass: widescreen and short-height displays
   =========================================== */
#game { grid-template-columns: minmax(0, 1fr) clamp(270px, 19vw, 355px); grid-template-rows: 40px minmax(0,1fr); min-width: 0; }
#topbar { min-width:0; gap:8px; padding:0 12px; font-size:12px; }
.tb-left, .tb-right { display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap; }
.tb-left > span { margin-right:5px; }
#main { min-width:0; min-height:0; }
#view { image-rendering:pixelated; }
#sidebar { min-height:0; min-width:0; }
#radar { width:min(100%, 210px); height:auto; aspect-ratio:1 / 1; align-self:center; flex:0 0 auto; }
.sb-btns button { padding:8px 2px; font-size:12px; }
.sb-tabs button { padding:8px 2px; font-size:11px; font-weight:bold; }
#buildlist { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:8px; }
.bicon { height:76px; border:1px solid #566a75; border-radius:3px; }
.bicon .name { left:5px; top:4px; max-width:calc(100% - 9px); line-height:1.15; font-size:11px; font-weight:bold; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bicon .cost { left:5px; bottom:4px; font-size:12px; font-weight:bold; }
.bicon .status { font-size:12px; }
#selinfo { min-height:82px; max-height:128px; padding:9px; font-size:12px; }
#btn-zoom-in, #btn-zoom-out, #btn-zoom-reset { font-weight:bold; padding:3px 8px; }
#tb-zoom { display:inline-block; min-width:40px; text-align:center; color:#f1d393; font-weight:bold; }
@media(max-height:770px) {
  #radar { width:min(100%,140px); }
  .bicon { height:66px; }
  #selinfo { max-height:92px; min-height:58px; }
}
@media(max-width:1220px) {
  #game { grid-template-columns:minmax(0,1fr) 260px; }
  #topbar { font-size:11px; }
  .tb-left, .tb-right { gap:4px; }
  .tb-left > span { margin-right:1px; }
  .powerbar { width:50px; }
}

/* ---- Spectate panel v2 ---- */
#zeus { width: 340px; }
#z-body .ztitle { border-left: 3px solid var(--zc, #ffd34a); padding-left: 6px; margin-top: 8px; }
#z-body .ztitle.zfac { font-size: 12px; background: rgba(255,255,255,.05); padding: 3px 6px; }
#z-body .zsub { grid-column: 1 / 3; color: #9fb3be; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }
#z-body .zchips { grid-column: 1 / 3; display: flex; flex-wrap: wrap; gap: 3px; }
#z-body .zchips button { padding: 3px 7px; font-size: 10px; }
#z-body .zsearch { grid-column: 1 / 3; background: #0c1419; color: #e4dfc9; border: 1px solid #3b5666; padding: 4px 6px; font: 11px monospace; }
#z-body .zglyph { display: inline-flex; width: 22px; justify-content: center; font-size: 14px; flex: none; }
#z-body .zicon canvas { width: 44px; height: 32px; flex: none; }
#z-body .zicon { min-height: 36px; }
#z-body .zname { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
#z-body .zcost { color: #8fd; font-size: 9px; }
#zeus.min { width: auto; }
#btn-zeus.occupied { opacity: .6; border-color: #c8342c; }
#sound-panel { position: fixed; top: 38px; right: 8px; z-index: 70; width: 250px; padding: 10px 12px; background: rgba(12,16,20,.97); border: 2px solid #55707e; border-radius: 4px; font: 12px monospace; color: #e4dfc9; display: none; }
#sound-panel h4 { margin: 0 0 8px; color: #ffd34a; font-size: 12px; letter-spacing: 1px; }
#sound-panel label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; }
#sound-panel input[type=range] { width: 120px; }
#sound-panel select { background: #0c1419; color: #e4dfc9; border: 1px solid #3b5666; }
#sound-panel .muted { color: #8fa4ae; font-size: 10px; }

/* ---- Touch / iPad ---- */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, select { touch-action: manipulation; }
#view, #radar { touch-action: none; }
#touchbar { display: none; position: absolute; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); right: calc(clamp(270px, 19vw, 355px) + 8px); z-index: 40; gap: 6px; flex-wrap: wrap; align-items: flex-end; pointer-events: none; }
#touchbar > button { pointer-events: auto; width: 62px; height: 54px; padding: 2px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: rgba(18,26,32,.88); border: 2px solid #55707e; border-radius: 8px; font-size: 10px; letter-spacing: 0; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
#touchbar .ti { font-size: 20px; line-height: 20px; }
#touchbar .tl { font-size: 9px; font-weight: bold; letter-spacing: .5px; }
#touchbar > button.on { background: #b8861a; border-color: #ffd34a; color: #111; }
#touchbar > button.dim { opacity: .38; }
#touchbar #touchgrp { pointer-events: auto; display: none; flex-basis: 100%; gap: 6px; align-items: center; order: -1; }
#touchbar #touchgrp button { width: 54px; height: 46px; font-size: 18px; font-weight: bold; background: rgba(18,26,32,.92); border: 2px solid #55707e; border-radius: 8px; }
#touchbar .ghint { color: #c9d6dd; font-size: 11px; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 4px; }
#btn-touch.on { background: #b8861a; color: #111; }
@media (pointer: coarse) {
  #topbar button { min-width: 38px; min-height: 30px; font-size: 13px; }
  .sb-btns button, .sb-tabs button { min-height: 40px; }
  #z-body button { min-height: 38px; }
  #zeus .z-head button { min-width: 38px; min-height: 30px; }
  #sound-panel input[type=range] { height: 28px; }
  #sound-panel label { margin: 12px 0; }
  select, input[type=text], input[type=number] { font-size: 16px; }
}
@media (max-width: 900px) { #touchbar { right: 8px; } }

/* ---- Tactical map (expanded radar) ---- */
#radar-expand { position: absolute; top: 6px; right: 8px; z-index: 5; width: 30px; height: 28px; padding: 0; font-size: 18px; line-height: 1; background: rgba(10,16,20,.85); border: 1px solid #55707e; border-radius: 5px; color: #9fe8b8; }
#radar-expand:hover { background: #1c3a2a; color: #fff; }
/* ===== Tactical radar: war-room plotting table ===== */
#bigmap { position: fixed; inset: 0; z-index: 90; display: none; flex-direction: column; padding: 10px; box-sizing: border-box; background: radial-gradient(ellipse at 50% 30%, #2a2c22 0%, #15170f 70%, #0b0c07 100%); font-family: "Courier New", ui-monospace, monospace; color: #cfe8d6; }
#bigmap .bm-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 2px solid #5a5a40; border-radius: 10px; background: linear-gradient(#34362a, #22241a); box-shadow: inset 0 0 0 2px #14150e, inset 0 0 30px rgba(0,0,0,.6), 0 8px 40px rgba(0,0,0,.7); position: relative; }
#bigmap .bm-shell::before, #bigmap .bm-shell::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #b9b88e, #4b4a30 70%); box-shadow: 0 1px 2px #000; top: 6px; left: 6px; }
#bigmap .bm-shell::after { left: auto; right: 6px; }
#bigmap .bm-top { display: flex; align-items: center; gap: 18px; padding: 8px 26px; border-bottom: 2px solid #14150e; background: linear-gradient(#3b3d2d, #2a2c20); }
#bigmap .bm-plate { display: flex; align-items: center; gap: 10px; padding: 4px 14px; background: linear-gradient(#8b7a3c, #5f5328); border: 1px solid #c9b565; border-radius: 3px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 3px #000; color: #1b1708; }
#bigmap .bm-plate b { display: block; letter-spacing: 3px; font-size: 15px; } #bigmap .bm-plate small { display: block; font-size: 10px; letter-spacing: 1px; opacity: .85; }
#bigmap .bm-lamp { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #aaffc8, #1fa75a 70%); box-shadow: 0 0 8px #3f9; animation: bmlamp 2.4s infinite; }
@keyframes bmlamp { 50% { opacity: .55; } }
#bigmap .bm-netstat { font-size: 12px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; color: #bfe6cb; }
#bigmap .bm-netstat i, #bigmap .lamp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #888; flex: none; }
#bigmap .bm-netstat i.ok, #bigmap .lamp.ok { background: #3fdc7a; box-shadow: 0 0 7px #3fdc7a; } #bigmap .bm-netstat i.warn, #bigmap .lamp.warn { background: #ffb830; box-shadow: 0 0 7px #ffb830; } #bigmap .bm-netstat i.bad, #bigmap .lamp.bad { background: #ff4030; box-shadow: 0 0 7px #ff4030; }
#bigmap .bm-clock { margin-left: auto; font-size: 20px; letter-spacing: 3px; color: #8dffb0; background: #06100a; padding: 2px 12px; border: 1px solid #14150e; border-radius: 3px; text-shadow: 0 0 8px #3f9; }
#bigmap button { font: inherit; font-size: 11px; letter-spacing: .5px; padding: 5px 9px; min-height: 28px; cursor: pointer; color: #d8d9c0; background: linear-gradient(#4a4c38, #34362a); border: 1px solid #6f7152; border-bottom-color: #14150e; border-radius: 3px; text-transform: uppercase; position: relative; }
#bigmap button:hover { background: linear-gradient(#5a5d44, #40422f); color: #fff; }
#bigmap button.on { background: linear-gradient(#143b25, #0c2617); border-color: #4fcf86; color: #aaffc8; box-shadow: inset 0 0 8px rgba(80,255,150,.25), 0 0 6px rgba(80,255,150,.25); }
#bigmap button.locked { opacity: .45; background: #25261c; color: #8c8d78; border-style: dashed; }
#bigmap button.locked::after { content: "🔒 " attr(data-lock); position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font-size: 10px; background: #000; color: #ffd34a; border: 1px solid #6f7152; padding: 2px 6px; border-radius: 3px; display: none; z-index: 9; }
#bigmap button.locked:hover::after { display: block; }
#bigmap .bm-close { background: linear-gradient(#8a2b24, #5a1a16); border-color: #d9665c; color: #fff; }
#bigmap .bm-body { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 8px; }
#bigmap .bm-tools { width: 196px; flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
#bigmap .bm-grp { border: 1px solid #4b4d38; border-radius: 4px; background: rgba(0,0,0,.22); padding: 6px; display: block; }
#bigmap .bm-grp h4 { margin: 0 0 5px; font-size: 10px; letter-spacing: 2px; color: #a89a5a; font-weight: normal; border-bottom: 1px dotted #5a5a40; padding-bottom: 3px; }
#bigmap .bm-btns { display: flex; flex-wrap: wrap; gap: 4px; } #bigmap .bm-chip { flex: 1 1 calc(50% - 4px); font-size: 10px; padding: 4px 3px; }
#bigmap .bm-stage { position: relative; flex: 1; min-width: 0; min-height: 0; background: #020604; border: 3px solid #14150e; border-radius: 14px / 12px; box-shadow: 0 0 0 2px #6f7152, inset 0 0 40px rgba(0,0,0,.9); overflow: hidden; }
#bigmap canvas { display: block; cursor: crosshair; }
#bigmap .bm-crt { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%), repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px); box-shadow: inset 0 0 60px rgba(40,255,140,.06); }
#bigmap[data-tier="1"] .bm-crt { background: radial-gradient(ellipse at center, rgba(20,80,40,.08) 40%, rgba(0,0,0,.65) 100%), repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px); }
#bigmap.t1 canvas { filter: saturate(0) sepia(1) hue-rotate(70deg) saturate(2.2) brightness(.95); }
#bigmap .bm-hint { position: absolute; left: 22px; bottom: 6px; right: 170px; font-size: 10px; background: rgba(0,8,4,.55); padding: 1px 6px; border-radius: 2px; width: fit-content; max-width: calc(100% - 200px); color: rgba(190,235,205,.55); pointer-events: none; z-index: 3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bigmap #bm-read:empty { display: none; }
#bigmap #bm-read { position: absolute; left: 22px; top: 22px; z-index: 3; font-size: 11px; color: #8dffb0; background: rgba(0,10,5,.7); padding: 2px 8px; border: 1px solid #1f5a3a; border-radius: 3px; pointer-events: none; letter-spacing: 1px; }
#bigmap #bm-tip { display: none; position: absolute; z-index: 4; pointer-events: none; background: rgba(8,12,8,.94); border: 1px solid #4fcf86; border-radius: 3px; padding: 5px 8px; font-size: 11px; color: #e8f4ec; min-width: 130px; box-shadow: 0 2px 10px #000; }
#bigmap #bm-tip b { color: #ffe6a0; } #bigmap #bm-tip .enemy { color: #ff6b60; font-weight: bold; } #bigmap #bm-tip .mine { color: #6fe3a0; } #bigmap #bm-tip .ally { color: #8fd0ff; }
#bigmap .bm-side { width: 300px; max-width: 38vw; flex: none; display: flex; flex-direction: column; min-height: 0; border: 1px solid #4b4d38; border-radius: 4px; background: rgba(0,0,0,.25); }
#bigmap .bm-tabs { display: flex; gap: 2px; padding: 4px 4px 0; border-bottom: 1px solid #4b4d38; } #bigmap .bm-tabs button { flex: 1; border-radius: 3px 3px 0 0; border-bottom: 0; }
#bigmap .bm-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; } #bigmap .bm-pane[hidden] { display: none; }
#bigmap .bm-sec { margin-bottom: 10px; }
#bigmap .bm-sech { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: 2px; color: #a89a5a; border-bottom: 1px dotted #5a5a40; margin: 2px 0 5px; padding-bottom: 3px; }
#bigmap .bm-cyc button { padding: 1px 9px; min-height: 22px; }
#bigmap .bm-list { max-height: 30vh; overflow-y: auto; }
#bigmap .bm-row { display: flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 5px; border-radius: 3px; cursor: pointer; }
#bigmap .bm-row:hover, #bigmap .bm-row.sel { background: rgba(80,255,150,.12); }
#bigmap .bm-row i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
#bigmap .bm-row span { margin-left: auto; color: #8fa49a; white-space: nowrap; font-size: 10px; } #bigmap .bm-row b { font-weight: normal; color: #ffe6b0; }
#bigmap .bm-empty, #bigmap .bm-note { color: #8fa49a; font-size: 11px; padding: 6px; line-height: 1.4; } #bigmap .bm-note { border-top: 1px dotted #5a5a40; margin-top: 8px; padding-top: 8px; }
#bigmap .bm-nrow { display: flex; align-items: center; gap: 8px; padding: 6px; margin-bottom: 4px; border: 1px solid #3f4130; border-left-width: 3px; border-radius: 3px; background: rgba(0,0,0,.22); cursor: pointer; }
#bigmap .bm-nrow.on { border-left-color: #3fdc7a; } #bigmap .bm-nrow.weak { border-left-color: #ffb830; } #bigmap .bm-nrow.blackout, #bigmap .bm-nrow.nopower { border-left-color: #ff4030; opacity: .8; } #bigmap .bm-nrow:hover { background: rgba(80,255,150,.1); }
#bigmap .bm-nrow b { display: block; font-size: 12px; color: #ffe6b0; font-weight: normal; } #bigmap .bm-nrow small { display: block; font-size: 10px; color: #98ab9f; } #bigmap .bm-nrow > div { flex: 1; min-width: 0; }
#bigmap .hpb { width: 38px; height: 6px; background: #000; border: 1px solid #4b4d38; flex: none; } #bigmap .hpb u { display: block; height: 100%; background: linear-gradient(90deg, #ff4030, #ffb830 40%, #3fdc7a); }
#bigmap .bm-leg p, #bigmap .bm-tiers p { margin: 0 0 6px; font-size: 11px; line-height: 1.4; display: flex; align-items: center; gap: 8px; } #bigmap .bm-tiers p { display: block; color: #b6c9bd; } #bigmap .bm-tiers b { color: #ffe6b0; }
#bigmap .bm-leg i { display: inline-block; width: 14px; height: 12px; flex: none; border: 1px solid #8dffb0; } #bigmap .bm-leg .tri { border: 0; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid #ff5030; } #bigmap .bm-leg .dia { transform: rotate(45deg) scale(.75); background: #ffb020; border-color: #ffb020; } #bigmap .bm-leg .dot { border-radius: 50%; width: 10px; height: 10px; background: #d6f4dc; } #bigmap .bm-leg .ring { border-radius: 50%; border-color: rgba(80,255,140,.6); } #bigmap .bm-leg .dash { border: 0; border-top: 2px dashed #8dffb0; height: 0; } #bigmap .bm-leg .x { border: 0; color: #ff4030; font-style: normal; text-align: center; line-height: 12px; } #bigmap .bm-leg .x::before { content: "✕"; }
#bigmap .bm-leg .sq { background: #2f8bff; }
#bigmap .bm-sw { flex: 1 1 100%; text-align: left; line-height: 1.25; } #bigmap .bm-sw small { display: block; font-size: 9px; opacity: .85; letter-spacing: .5px; } #bigmap .bm-sw.ok { border-color: #d98a3a; color: #ffd9a0; } #bigmap .bm-sw.bad, #bigmap .bm-sw.wait { opacity: .6; } #bigmap .bm-sw.on { background: linear-gradient(#6a1a12, #3d0e09); border-color: #ff6a50; color: #fff; box-shadow: 0 0 10px rgba(255,90,60,.5); } #bigmap .bm-swnote { font-size: 9px; color: #98ab9f; margin-top: 4px; }
@media (max-width: 900px) { #bigmap { padding: 4px; } #bigmap .bm-body { flex-direction: column; } #bigmap .bm-tools { width: auto; flex-direction: row; overflow-x: auto; max-height: 22vh; } #bigmap .bm-grp { min-width: 170px; } #bigmap .bm-side { width: auto; max-width: none; max-height: 30vh; } #bigmap .bm-top { gap: 8px; padding: 6px 14px; } #bigmap .bm-netstat { display: none; } }

/* multiplayer boot / initializing screen */
#boot{position:fixed;inset:0;z-index:9999;align-items:center;justify-content:center;background:radial-gradient(ellipse at 50% 40%,#1c2a34 0%,#0a1015 70%);transition:opacity .45s;color:#cfd8dc;font-family:'Courier New',monospace}
#boot.done{opacity:0;pointer-events:none}
#boot .boot-in{text-align:center;width:min(520px,86vw)}
#boot .boot-title{font:700 34px Georgia,serif;letter-spacing:5px;color:#e0b95a;text-shadow:0 2px 0 #000}
#boot .boot-sub{margin:6px 0 22px;letter-spacing:6px;font-size:12px;color:#7f98a6}
#boot .boot-bar{height:8px;border:1px solid #3a505e;background:#0b1319;border-radius:4px;overflow:hidden}
#boot .boot-bar i{display:block;height:100%;width:3%;background:linear-gradient(90deg,#b8862b,#ffd34a);transition:width .35s;box-shadow:0 0 10px #ffd34a88}
#boot #boot-msg{margin-top:14px;font-size:14px;min-height:20px;color:#cfe3ee}
#boot .boot-tip{margin-top:26px;font-size:11px;color:#667c89}

/* ================================================================
   LAST OFFENSIVE V18 — modern Spectate / Game Master workspace.
   Styling only: original tool IDs, editor commands and keybinds stay.
   ================================================================ */
#zeus:not(.min) {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100% - 48px);
  border: 1px solid rgba(148,174,155,.52);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(155deg,rgba(22,32,34,.985),rgba(15,24,26,.985));
  box-shadow: 0 16px 55px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.065);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #e5ede6;
}
#zeus .z-head { cursor: move; padding: 11px 13px; font-size: 15px;
  background: linear-gradient(100deg,#254539,#1b3635 62%,#202e30);
  letter-spacing: 1.7px; border-bottom: 1px solid rgba(174,199,184,.20); }
#zeus .z-head .muted { font-size: 11px; letter-spacing: .35px; color: #afc7b8; margin-left: 4px; }
#zeus .z-head button { min-width: 28px; height: 27px; border-radius: 6px;
  border: 1px solid #668474; background: #263b37; color: #ecf5ec; }
#zeus .z-head button:hover { background: #3d5950; }
#zeus .z-row { gap: 9px; padding: 10px 12px; background: #1c2929;
  border-bottom: 1px solid rgba(180,200,181,.12); }
#zeus .z-row label { display:flex; align-items:center; gap:7px; color:#c2d4c8; font-size:12px; }
#zeus .z-row label:first-child { flex: 1 1 240px; }
#zeus .z-row select { flex:1; min-width:100px; max-width:100%; background:#111e1b;
  border: 1px solid #567261; border-radius:6px; padding:6px; color:#cce8d7; }
#zeus .z-row input[type=range] { accent-color:#70d69b; width:110px; }
#zeus .z-tabs { padding: 7px 8px; gap: 4px; background:#172426; }
#zeus .z-tabs button { font: 600 11px system-ui,sans-serif; letter-spacing:.4px;
  border:1px solid transparent; border-radius:6px; background:#273636;
  color:#aec7bb; min-height:33px; padding:7px 3px; text-transform:uppercase; }
#zeus .z-tabs button.on { color:#dcffe8; background:#205342;
  border-color:#5bb889; box-shadow: inset 0 0 0 1px rgba(85,207,140,.17); }
#zeus .z-tabs button:hover { color:#fff; background:#315448; }
#zeus #z-body { padding: 10px; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap: 7px; scrollbar-color:#557567 #182825; }
#zeus #z-body button { border:1px solid #42564e; border-radius:8px;
  min-width:0; min-height:51px; padding:6px 7px; background:linear-gradient(155deg,#283832,#1f2b2c);
  color:#e0e6dd; transition: background .14s ease,border-color .14s ease; }
#zeus #z-body button:hover { background:#30483d; border-color:#6caa88; }
#zeus #z-body button.on { background:#275841; border-color:#7ae3a5; }
#zeus #z-body .ztitle { font-size:12px; letter-spacing:.55px; font-weight:700;
  margin:10px 0 3px; padding:5px 8px; border:0; border-left:3px solid var(--zc,#88ca9d);
  background:rgba(130,180,148,.085); border-radius:3px; }
#zeus #z-body .zsub { font-size:10px; letter-spacing:1.15px; padding:5px 1px;
  color:#adc9b6; border-bottom:1px solid rgba(150,180,160,.15); }
#zeus #z-body .zchips button { min-height:29px; flex:1 0 auto; padding:4px 7px; font-size:11px; }
#zeus #z-body .zsearch { min-height:36px; border-radius:7px; border:1px solid #526d61;
  padding:8px 10px; background:#0f1b1b; color:#eef5f2; font:12px system-ui,sans-serif; }
#zeus #z-body .zicon { gap:8px; min-height:55px; }
#zeus #z-body .zicon canvas { width:67px; height:48px; object-fit:contain; border-radius:5px;
  border:1px solid #6b766e; background:#1b282a; image-rendering:auto; }
#zeus #z-body .zname { font-size:12px; line-height:1.24; overflow-wrap:anywhere; }
#zeus #z-body .zcost { font-size:11px; color:#8fe4c2; margin-top:2px; }
#zeus .z-foot { padding:8px 12px; font-size:11px; background:#152423;
  color:#9bb3a8; border-top:1px solid #3b5148; }
#zeus.min { border-radius:8px; overflow:hidden; border:1px solid #557c65;
  box-shadow:0 8px 30px rgba(0,0,0,.6); }
@media(max-width:620px){#zeus:not(.min){left:5px;top:28px;width:calc(100vw - 10px);max-height:calc(100% - 37px)}
#zeus #z-body{gap:5px;padding:6px}#zeus #z-body .zicon canvas{width:53px;height:39px}
#zeus #z-body .zname{font-size:11px}}
