/* SIEGE LINE — retro DOS / C&C-era interface */
@font-face { font-family: 'Press Start 2P'; src: url(../fonts/press-start-2p.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url(../fonts/vt323.woff2) format('woff2'); font-display: swap; }

:root {
  --bg: #0b0d12; --bg2: #10141b; --panel: #151a22; --panel2: #1c222c; --line: #2b3441; --line2: #3c4858;
  --text: #dfe6d2; --dim: #8d998a; --gold: #f2c14e; --gold2: #b8862a; --red: #ff4a3a; --green: #6ad06a; --cyan: #5fcde4; --purple: #c8b4f4;
  --pixel: 'Press Start 2P', ui-monospace, monospace; --mono: 'VT323', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 20px; line-height: 1.15; -webkit-tap-highlight-color: transparent; }
body { overflow-x: hidden; background: radial-gradient(ellipse at 50% -10%, #1b2230 0%, var(--bg) 60%) fixed; }
button, input, select { font: inherit; color: inherit; }
img.pix, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
h1, h2, h3, h4, h5, b, button b, .tag, kbd, th { font-family: var(--pixel); font-weight: normal; letter-spacing: 0.02em; }
h2 { font-size: 16px; margin: 0; color: var(--gold); }
h3 { font-size: 12px; margin: 0 0 10px; color: var(--gold); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
h3 small { font-family: var(--mono); color: var(--dim); font-size: 18px; }
h4 { font-size: 10px; margin: 14px 0 6px; color: var(--cyan); }
h5 { font-size: 9px; margin: 0 0 6px; color: var(--dim); }
b { font-size: 11px; }
p { margin: 6px 0; }
.note { color: var(--dim); font-size: 18px; }
.small { font-size: 17px; color: var(--dim); }
.gold { color: var(--gold); } .red { color: var(--red); } .purple { color: var(--purple); }
.crt { pointer-events: none; position: fixed; inset: 0; z-index: 90; background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,0.13) 2px 3px); mix-blend-mode: multiply; }
.crt::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.35) 100%); }
body.nocrt .crt { display: none; }

/* ---------- buttons ---------- */
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.big { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; min-height: 52px; background: var(--panel2); border: 2px solid var(--line2);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.06), inset -2px -2px 0 rgba(0,0,0,0.4); text-align: left; transition: border-color .12s, transform .05s; }
.big b { font-size: 12px; color: var(--text); }
.big small { color: var(--dim); font-size: 17px; }
.big:hover:not(:disabled) { border-color: var(--gold); }
.big:active:not(:disabled) { transform: translateY(1px); }
.big.gold { background: linear-gradient(#f5cd62, #d9a23a); border-color: #fff0b0; }
.big.gold b { color: #1a1206; } .big.gold small { color: #4a3510; }
.big.dim { background: transparent; }
.big:disabled { opacity: 0.45; }
.link { background: none; border: 0; color: var(--cyan); font-family: var(--pixel); font-size: 9px; padding: 8px; text-decoration: underline; text-underline-offset: 4px; }
.back { background: none; border: 2px solid var(--line2); font-family: var(--pixel); font-size: 9px; padding: 8px 10px; color: var(--dim); }
.back:hover { color: var(--text); border-color: var(--gold); }
.icon { background: var(--panel2); border: 2px solid var(--line2); font-family: var(--pixel); font-size: 9px; min-width: 36px; height: 34px; padding: 0 8px; }
.icon:hover { border-color: var(--gold); }
.x { background: none; border: 0; color: var(--dim); font-size: 22px; line-height: 1; padding: 4px 8px; }
kbd { position: absolute; bottom: 3px; right: 4px; font-size: 7px; color: var(--dim); opacity: 0.7; }
.act .cost { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.act .cost i { width: 6px; height: 6px; background: var(--gold); box-shadow: inset -1px -1px 0 #a8791f; border: 1px solid #000; }
.act .cost.free { font-family: var(--pixel); font-size: 6px; color: var(--green); }
.act:disabled .cost { display: none; }
input, select { background: #0c0f14; border: 2px solid var(--line2); padding: 8px 10px; font-family: var(--mono); font-size: 20px; color: var(--text); border-radius: 0; }
input:focus, select:focus { outline: none; border-color: var(--gold); }
label { display: flex; flex-direction: column; gap: 6px; font-family: var(--pixel); font-size: 9px; color: var(--dim); margin: 10px 0; }
label.inline { flex-direction: row; align-items: center; gap: 10px; }
label.tog { flex-direction: row; align-items: center; gap: 12px; font-size: 10px; color: var(--text); cursor: pointer; }
label.tog input { width: 22px; height: 22px; accent-color: var(--gold); }

/* ---------- title ---------- */
.title { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 30px 16px; }
.logo { text-align: center; }
.logo h1 { font-size: clamp(30px, 8vw, 64px); margin: 0; color: var(--gold); letter-spacing: 0.04em;
  text-shadow: 4px 4px 0 #6b3d10, 8px 8px 0 rgba(0,0,0,0.5); }
.logo .tag { font-family: var(--pixel); font-size: clamp(8px, 1.6vw, 11px); color: var(--cyan); margin-top: 18px; }
.tpilots { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.tp { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tp img { width: 88px; height: 88px; border: 3px solid #000; box-shadow: 0 0 0 2px var(--line2); }
.tp span { font-family: var(--pixel); font-size: 8px; color: var(--dim); }
.title .menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; width: min(820px, 100%); }
.title .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ver { font-family: var(--pixel); font-size: 8px; color: var(--line2); }
.finale .logo h1 { font-size: clamp(22px, 5vw, 44px); }

/* ---------- pages ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 16px 16px 60px; display: flex; flex-direction: column; gap: 14px; }
.page.narrow { max-width: 520px; }
.pagehead { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.panel { background: var(--panel); border: 2px solid var(--line); box-shadow: inset 0 2px 0 rgba(255,255,255,0.03); padding: 14px; }
.panel.slim { padding: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.roomcode { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 2px solid var(--gold2); padding: 14px 18px; }
.roomcode > div { display: flex; flex-direction: column; gap: 6px; }
.roomcode small { font-family: var(--pixel); font-size: 8px; color: var(--dim); }
.roomcode b { font-size: 34px; color: var(--gold); letter-spacing: 0.15em; }
.roomcode code { font-family: var(--mono); font-size: 24px; color: var(--cyan); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 2px solid var(--line); border-left: 6px solid var(--pc, var(--line2)); padding: 10px; }
.slot > img { width: 64px; height: 64px; border: 2px solid #000; }
.slot.add { justify-content: center; flex-direction: column; border-style: dashed; min-height: 88px; background: transparent; }
.slot.add b { color: var(--gold); }
.sinfo { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sinfo span { color: var(--dim); }
.sinfo .cls { display: flex; align-items: center; gap: 6px; color: var(--text); }
img.tk { width: 45px; height: 36px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 7px; padding: 3px 5px; background: var(--line); color: var(--text); }
.tag.me { background: var(--cyan); color: #04212a; } .tag.ok { background: var(--green); color: #06240a; } .tag.bad { background: var(--red); color: #fff; }
.slotctl { display: flex; gap: 6px; width: 100%; }
.slotctl select { flex: 1; font-size: 18px; padding: 4px 6px; min-width: 0; }
.picks { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--panel2); border: 2px solid var(--line2); padding: 8px; }
.pick img { width: 64px; height: 64px; }
.pick span { font-family: var(--pixel); font-size: 7px; }
.pick.on { border-color: var(--pc); box-shadow: 0 0 0 2px var(--pc); }
.pick.taken { opacity: 0.35; }
.clspicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.clspick { position: relative; display: flex; gap: 10px; align-items: center; text-align: left; background: var(--panel2); border: 2px solid var(--line2); padding: 10px; }
.clspick img { width: 60px; height: 48px; flex: none; }
.clspick div { display: flex; flex-direction: column; gap: 4px; }
.clspick small { color: var(--dim); }
.clspick .stats { font-size: 16px; color: var(--cyan); }
.clspick .sig { color: var(--gold); font-size: 8px; }
.clspick.on { border-color: var(--gold); background: #2a2616; }
.clspick .full { position: absolute; top: 6px; right: 8px; font-family: var(--pixel); font-size: 8px; color: var(--red); }
.clspick:disabled { opacity: 0.4; }
.settings { display: flex; gap: 18px; flex-wrap: wrap; }
.readylist { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--pixel); font-size: 8px; color: var(--dim); }
.readylist span { display: flex; align-items: center; gap: 6px; } .readylist .ok { color: var(--green); }
img.mini { width: 28px; height: 28px; vertical-align: middle; margin-right: 6px; }

/* briefing */
.mission .mhead small { font-family: var(--pixel); font-size: 8px; color: var(--cyan); }
.mission .mhead h2 { font-size: 22px; margin: 8px 0 4px; }
.mission .mhead p { color: var(--dim); margin: 0 0 10px; }
.mbody { display: flex; gap: 16px; flex-wrap: wrap; }
.minimap img { width: 192px; height: auto; border: 2px solid #000; }
.minimap .legend { display: flex; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-top: 4px; }
.legend .r { color: #e8483a; } .legend .c { color: #5fcde4; } .legend .b { color: #b8c0ca; } .legend .g { color: #c8b878; } .legend .o { color: #f0a030; }
.mtext { flex: 1; min-width: 240px; }
.intro { font-size: 22px; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; }
.facts span { font-family: var(--pixel); font-size: 8px; padding: 5px 7px; background: var(--panel2); border: 1px solid var(--line2); }
.objs { margin: 0; padding-left: 18px; }
.objs li { margin: 3px 0; }
.objs.small { font-size: 17px; padding-left: 14px; }
.objs .ok { color: var(--green); list-style: none; margin-left: -14px; } .objs .no { color: var(--dim); list-style: none; margin-left: -14px; }
.enemies { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.enemy { display: flex; gap: 10px; align-items: center; background: var(--panel2); padding: 8px; border: 1px solid var(--line); }
.enemy img { width: 54px; flex: none; }
.enemy div { display: flex; flex-direction: column; }
.enemy b { color: var(--red); }
.enemy small { color: var(--text); font-size: 17px; } .enemy .ans { color: var(--green); }
.hist { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-family: var(--pixel); font-size: 8px; }
.hist .win { color: var(--green); } .hist .loss { color: var(--red); }
.loadout { border: 2px solid var(--line); margin-bottom: 8px; border-left: 6px solid var(--pc); }
.lohead { width: 100%; display: flex; align-items: center; gap: 12px; background: var(--panel2); border: 0; padding: 8px 12px; text-align: left; }
.lohead img { width: 40px; height: 40px; }
.lohead b { color: var(--pc); }
.lohead .salv { margin-left: auto; font-family: var(--pixel); font-size: 8px; color: var(--gold); }
.loadout.open > div { padding: 10px; }
.upg h3 .salv { margin-left: auto; font-family: var(--pixel); font-size: 9px; color: var(--gold); }
.branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.branch { display: flex; flex-direction: column; gap: 6px; }
.node { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px 10px; background: var(--panel2); border: 2px solid var(--line2); }
.node small { color: var(--dim); font-size: 17px; }
.node .cost { font-family: var(--pixel); font-size: 7px; color: var(--gold); }
.node.owned { border-color: var(--green); background: #16261a; } .node.owned .cost { color: var(--green); }
.node.buy { border-color: var(--gold); } .node.buy:hover { background: #2a2616; }
.node.locked { opacity: 0.55; }

/* debrief */
.result { text-align: center; padding: 20px; border: 2px solid var(--line); background: var(--panel); }
.result h1 { font-size: clamp(28px, 6vw, 48px); margin: 6px 0; }
.result.win h1 { color: var(--green); text-shadow: 4px 4px 0 #0e3a14; } .result.loss h1 { color: var(--red); text-shadow: 4px 4px 0 #4a0e0a; }
.tablewrap { overflow-x: auto; }
table.stats { border-collapse: collapse; width: 100%; font-size: 19px; }
table.stats th { font-size: 7px; color: var(--dim); text-align: left; padding: 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.stats td { padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.route { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; background: var(--panel2); border: 2px solid var(--gold2); }
.route b { color: var(--gold); font-size: 12px; } .route small { color: var(--text); font-size: 19px; }
.route:hover:not(:disabled) { background: #2a2616; }
.route:disabled { opacity: 0.7; border-color: var(--line2); }

/* dossier */
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pcard { display: flex; gap: 14px; background: var(--panel); border: 2px solid var(--pc); padding: 14px; }
.pcard img.big { width: 128px; height: 128px; border: 3px solid #000; flex: none; }
.pcard h3 { color: var(--pc); font-size: 14px; margin-bottom: 8px; }
.pcard .sig { font-family: var(--pixel); font-size: 7px; line-height: 1.7; color: var(--cyan); }
.pcard .q { color: var(--pc); }

/* ---------- battle ---------- */
#app { min-height: 100%; }
#app.screen-battle { height: 100%; overflow: hidden; }
#app.screen-title, #app.screen-finale { height: 100%; }
.battle { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 6px 10px; background: #0d1117; border-bottom: 2px solid var(--line); min-width: 0; }
.tb-mission { display: flex; flex-direction: column; gap: 3px; }
.tb-mission b { font-size: 10px; color: var(--gold); }
.tb-mission span { font-family: var(--pixel); font-size: 8px; color: var(--dim); }
.tb-base { display: flex; align-items: center; gap: 8px; }
.tb-base small { font-family: var(--pixel); font-size: 8px; color: var(--dim); }
.bar { position: relative; height: 10px; background: #2a1618; border: 2px solid #000; min-width: 60px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); transition: width .25s; }
.tb-base .bar { width: 140px; height: 14px; }
.tb-base .bar i.low { background: var(--red); animation: blink .6s steps(2) infinite; }
.tb-base span { font-family: var(--pixel); font-size: 9px; }
.tb-init { display: flex; gap: 4px; }
.init img { width: 26px; height: 26px; border: 2px solid #000; opacity: 0.8; display: block; }
.init.on img { border-color: var(--pc); opacity: 1; box-shadow: 0 0 0 2px var(--pc); }
.init.done img { opacity: 0.3; filter: grayscale(1); }
.tb-turn { display: flex; gap: 8px; align-items: center; margin-left: auto; min-width: 0; }
.tb-turn img { width: 34px; height: 34px; border: 2px solid #000; }
.tb-turn div { display: flex; flex-direction: column; gap: 2px; }
.tb-turn b { font-size: 10px; } .tb-turn small { color: var(--dim); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.timer { font-family: var(--pixel); font-size: 9px; color: var(--cyan); } .timer.low { color: var(--red); animation: blink .5s steps(2) infinite; }
.tb-tools { display: flex; gap: 6px; }
.main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.boardwrap { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at center, #1a2014 0%, #0b0d10 75%); }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hint { position: absolute; left: 10px; top: 8px; font-size: 18px; color: var(--text); text-shadow: 2px 2px 0 #000; pointer-events: none; max-width: 70%; }
.netstate { position: absolute; right: 10px; top: 8px; font-family: var(--pixel); font-size: 8px; color: var(--red); }
.infocard { position: absolute; left: 10px; bottom: 10px; max-width: min(460px, calc(100% - 20px)); background: rgba(13,16,22,0.96); border: 2px solid var(--line2); padding: 10px 34px 10px 12px; font-size: 18px; z-index: 5; }
.infocard.hidden { display: none; }
.infocard .x { position: absolute; top: 2px; right: 2px; }
.infocard .ic { display: flex; gap: 10px; }
.infocard .ic img { width: 60px; height: auto; flex: none; align-self: flex-start; }
.infocard .stats { color: var(--cyan); font-size: 17px; }
.infocard p { margin: 4px 0; }
.side { overflow-y: auto; border-left: 2px solid var(--line); background: #0f1319; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.squad { display: flex; flex-direction: column; gap: 6px; }
.sq { display: flex; gap: 8px; padding: 6px; background: var(--panel); border: 2px solid var(--line); border-left: 5px solid var(--pc); cursor: pointer; }
.sq.on { background: #202634; border-color: var(--pc); }
.sq.ko { opacity: 0.5; }
.sq > img { width: 44px; height: 44px; border: 2px solid #000; flex: none; }
.sqi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sqh { display: flex; justify-content: space-between; gap: 6px; }
.sqh b { font-size: 8px; color: var(--pc); } .sqh span { font-family: var(--pixel); font-size: 7px; color: var(--dim); }
.bar.hp { height: 8px; } .bar.hp i { background: var(--pc); }
.bar.hm { height: 6px; background: #1c1a10; } .bar.hm i { background: var(--gold); }
.bar.hm.ready i { animation: glow .5s steps(2) infinite; }
.sqs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 15px; color: var(--dim); }
.sqs .ok { color: var(--green); }
.log { font-size: 16px; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.log .r { color: var(--line2); }
.log .bad { color: #ff8a7a; } .log .good { color: #9aeaa0; } .log .hm { color: var(--gold); }
.actionbar { display: flex; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #0d1117; border-top: 2px solid var(--line); overflow-x: auto; align-items: stretch; min-height: 78px; }
.who { display: flex; gap: 8px; align-items: center; padding-right: 6px; border-right: 2px solid var(--line); }
.who img { width: 44px; height: 44px; border: 2px solid var(--pc); }
.who div { display: flex; flex-direction: column; gap: 3px; } .who b { color: var(--pc); font-size: 9px; } .who small { color: var(--dim); font-size: 15px; white-space: nowrap; }
.ap { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 6px; }
.ap small { font-family: var(--pixel); font-size: 7px; color: var(--dim); }
.pips { display: flex; gap: 4px; } .pips i { width: 14px; height: 14px; border: 2px solid #000; background: #2a2e36; } .pips i.on { background: var(--gold); box-shadow: inset -2px -2px 0 #a8791f; }
.act { position: relative; flex: 1 0 86px; max-width: 150px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; background: var(--panel2); border: 2px solid var(--line2);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.06), inset -2px -2px 0 rgba(0,0,0,0.45); text-align: left; }
.act b { font-size: 9px; } .act small { color: var(--dim); font-size: 15px; white-space: nowrap; }
.act:hover:not(:disabled) { border-color: var(--gold); }
.act.on { border-color: var(--gold); background: #2a2616; }
.act:disabled { opacity: 0.38; }
.act.hmready { border-color: var(--gold); animation: glowb .6s steps(2) infinite; } .act.hmready b { color: var(--gold); }
.act.end { background: #1d1515; border-color: #5a2a26; }
.act.confirm { background: linear-gradient(#f5cd62, #d9a23a); border-color: #fff0b0; } .act.confirm b { color: #1a1206; } .act.confirm small { color: #4a3510; }
.act.skip { flex: 0 0 auto; }
.act.again:not(:disabled) { border-color: var(--cyan); }
.act.again:not(:disabled) b { color: var(--cyan); }
.act.set { border-color: var(--green); } .act.set b { color: var(--green); } .act.set:disabled { opacity: 0.85; }
.apleft { color: var(--gold); }
.chips { position: absolute; right: 10px; top: 26px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; z-index: 4; }
.chip { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding: 7px 10px; background: rgba(13,16,22,0.92); border: 2px solid var(--cyan); box-shadow: 2px 2px 0 #000; }
.chip b { font-size: 9px; color: var(--cyan); } .chip small { font-size: 15px; color: var(--dim); }
.chip:hover { background: #10222a; }
.pausebox { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(5,7,10,0.72); }
.pausebox.hidden { display: none; }
.pbox { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 28px; background: var(--panel); border: 3px solid var(--gold); box-shadow: 6px 6px 0 rgba(0,0,0,0.5); }
.pbox > b { font-size: 22px; color: var(--gold); letter-spacing: 0.1em; }
.pbox > small { color: var(--dim); font-size: 19px; }
.pbox .big { align-items: center; min-width: 180px; }
.icon.on { border-color: var(--gold); color: var(--gold); }
.settings.compact { margin-top: 8px; } .settings.compact label { margin: 4px 0; }
.cyan { color: var(--cyan); }
ul.rules { margin: 6px 0; padding-left: 18px; } ul.rules li { margin: 3px 0; font-size: 18px; } ul.rules b { font-size: 9px; color: var(--gold); }
/* after-action report */
.contrib { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ccard { background: var(--panel2); border: 2px solid var(--line); border-left: 6px solid var(--pc); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.chead { display: flex; align-items: center; gap: 8px; }
.chead img { width: 36px; height: 36px; border: 2px solid #000; }
.chead div { display: flex; flex-direction: column; gap: 2px; flex: 1; } .chead small { color: var(--dim); font-size: 16px; }
.chead .salv { font-family: var(--pixel); font-size: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-family: var(--pixel); font-size: 7px; padding: 3px 5px; background: #2a2616; color: var(--gold); border: 1px solid var(--gold2); }
.badge.photo { display: inline-block; font-size: 9px; margin-top: 8px; }
.cstats { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cstats span { display: flex; flex-direction: column; } .cstats small { font-family: var(--pixel); font-size: 6px; color: var(--dim); } .cstats b { font-family: var(--mono); font-size: 20px; }
.payout { margin: 10px 0 0; color: var(--text); font-size: 18px; } .payout b { font-size: 10px; margin-left: 4px; }
.waiting { display: flex; flex-direction: column; justify-content: center; gap: 4px; font-family: var(--pixel); font-size: 10px; color: var(--dim); padding: 0 10px; flex: 1; }
.waiting small { font-family: var(--mono); font-size: 17px; }

/* ---------- overlays ---------- */
#overlay { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
#overlay > * { pointer-events: auto; }
#overlay > .banner, #overlay > .cutin { pointer-events: none; }
.banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); text-align: center; background: rgba(8,10,14,0.9); border: 3px solid var(--gold); padding: 16px 28px; min-width: 260px; animation: pop .25s steps(4); }
.banner b { font-size: clamp(16px, 4vw, 26px); color: var(--gold); display: block; }
.banner small { display: block; margin-top: 8px; color: var(--text); font-size: 20px; }
.banner.win b { color: var(--green); } .banner.loss b { color: var(--red); } .banner.loss { border-color: var(--red); } .banner.win { border-color: var(--green); }
.banner .border { display: flex; gap: 6px; justify-content: center; margin-top: 10px; } .banner .border img { width: 30px; height: 30px; border: 2px solid #000; }
.banner.out, .cutin.out, .toast.out { opacity: 0; transition: opacity .35s; }
.cutin { position: absolute; left: 0; right: 0; top: 36%; transform: translateY(-50%); height: 150px; background: repeating-linear-gradient(-45deg, var(--pd) 0 14px, #000 14px 18px); border-top: 4px solid var(--pc); border-bottom: 4px solid var(--pc); overflow: hidden; }
.cband { position: absolute; inset: 0; display: flex; align-items: center; gap: 20px; padding: 0 6vw; animation: slidein .35s steps(6); }
.cband img { width: 128px; height: 128px; border: 4px solid #000; box-shadow: 6px 6px 0 rgba(0,0,0,0.5); }
.ctext { display: flex; flex-direction: column; gap: 8px; }
.ctext small { font-family: var(--pixel); font-size: 9px; color: #fff; }
.ctext b { font-size: clamp(18px, 4.5vw, 36px); color: var(--pc); text-shadow: 4px 4px 0 #000; }
.ctext i { font-style: normal; font-size: 24px; color: #fff; }
#toasts { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(560px, 94vw); }
.toast { background: rgba(10,12,16,0.95); border: 2px solid var(--line2); padding: 8px 14px; font-size: 19px; animation: pop .2s steps(3); }
.toast.bad { border-color: var(--red); } .toast.good { border-color: var(--green); } .toast.hm { border-color: var(--gold); color: var(--gold); }
.modal { position: absolute; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mbox { width: min(760px, 100%); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 3px solid var(--gold2); padding: 14px 18px 18px; }
.mbox > .mhead { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -14px; background: var(--panel); padding: 4px 0 8px; }
.mbox .menu { display: flex; flex-direction: column; gap: 8px; }
.helptabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.helptabs button { font-family: var(--pixel); font-size: 8px; padding: 8px 10px; background: var(--panel2); border: 2px solid var(--line2); }
.helptabs button.on { border-color: var(--gold); color: var(--gold); }
.help section h4 { margin-top: 10px; }
.hc { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hc img { width: 64px; height: auto; flex: none; align-self: flex-start; }
.hc p { margin: 3px 0; font-size: 18px; }
.setlist { display: flex; flex-direction: column; gap: 6px; }

@keyframes blink { 50% { opacity: 0.35; } }
@keyframes glow { 50% { background: #fff6c8; } }
@keyframes glowb { 50% { box-shadow: 0 0 0 2px var(--gold); } }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.8); } }
.toast { animation: none; }
@keyframes slidein { from { transform: translateX(-60%); } }

/* ---------- phones & small screens ---------- */
@media (max-width: 900px) {
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .side { border-left: 0; border-top: 2px solid var(--line); max-height: 124px; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px; }
  .side .panel { display: none; }
  .squad { flex-direction: row; }
  .sq { min-width: 190px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .tb-turn { margin-left: 0; }
  .tb-base .bar { width: 90px; }
}
@media (max-width: 600px) {
  html, body { font-size: 18px; }
  .topbar { padding: 4px 6px; }
  .tb-init { display: none; }
  .tb-mission b { font-size: 8px; }
  .tb-turn small { max-width: 120px; }
  .actionbar { flex-wrap: wrap; overflow-x: hidden; }
  .who { display: none; }
  .ap { flex: 0 0 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 2px; }
  .pips i { width: 12px; height: 12px; }
  .act { flex: 1 0 calc(25% - 6px); min-width: 0; max-width: none; min-height: 50px; padding: 6px; }
  .act small { overflow: hidden; text-overflow: ellipsis; }
  .chips { top: 6px; right: 6px; } .chip { padding: 5px 8px; } .chip small { display: none; }
  .act b { font-size: 8px; } .act small { font-size: 14px; }
  kbd { display: none; }
  .sq { min-width: 170px; } .sq > img { width: 36px; height: 36px; }
  .cband img { width: 88px; height: 88px; } .cutin { height: 120px; }
  .hint { font-size: 16px; max-width: calc(100% - 118px); }
  .title .menu { grid-template-columns: 1fr; }
  .tp img { width: 64px; height: 64px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .side { display: none; }
  .main { grid-template-rows: minmax(0, 1fr); }
  .actionbar { min-height: 60px; padding-top: 4px; padding-bottom: 4px; }
  .act { min-height: 44px; }
  .topbar { padding: 2px 8px; }
}
@media (prefers-reduced-motion: reduce) { .cband, .banner, .toast { animation: none; } }

/* ---------- v0.4: camera controls ---------- */
.zoomctl { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; z-index: 4; }
.zoomctl .icon { min-width: 34px; height: 30px; padding: 0 6px; background: rgba(21,26,34,0.85); }
.cyan { color: var(--cyan); }
