:root {
  --bg: #090a09;
  --panel: rgba(16, 19, 16, 0.9);
  --panel2: rgba(24, 28, 24, 0.95);
  --line: #2b352b;
  --line2: #3d4a3d;
  --text: #e9ece6;
  --dim: #8f9b8f;
  --gold: #ffd54f;
  --blood: #c62828;
  --bad: #ff5252;
  --good: #69f0ae;
  --ice: #81d4fa;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --body: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --hs-auto: 1;                /* set by ui.js fitHud() from the window size (never below 0.85 in landscape) */
  --hs: var(--hs-auto);        /* field HUD scale (big view raises it) */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 500 16px/1.3 var(--body); overflow: hidden; }
body { background: radial-gradient(ellipse at 50% 40%, #151a15 0%, #070807 70%); }
html.overlay, html.overlay body { background: transparent; }
button { font: 600 15px var(--body); letter-spacing: 0.03em; color: var(--text); background: #1f281f; border: 1px solid var(--line2); border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
button:hover { background: #2a372a; border-color: #5a6e5a; }
button:active { transform: translateY(1px); }
button.primary { background: var(--blood); border-color: #ff6f6f; font-size: 18px; padding: 8px 22px; }
button.primary:hover { background: #e53935; }
kbd { font: 600 13px var(--body); background: #1a1d1a; border: 1px solid #444; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
h2, h3 { font-family: var(--display); letter-spacing: 0.06em; font-weight: 400; }

/* ------------------------------------------------------------ layout */
#app { display: flex; height: 100vh; }
#field { position: relative; flex: 1; min-width: 0; overflow: hidden; }
#board { width: 100%; height: 100%; display: block; cursor: crosshair; }
/* two info panels either side of the board (left = the battle, right = your visit). Each collapses to its
   slim tab strip (prefs.hudL / hudR, keys [ and ]); the board canvas refits through its ResizeObserver. */
.hud { flex: none; display: flex; height: 100vh; width: calc(var(--hudw, 290px) + 14px); }
.hud-body { flex: 1; min-width: 0; overflow-y: auto; padding: 8px 6px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: #2e3a2e transparent; }
.side-l .hud-body { padding-left: 8px; }
.side-r .hud-body { padding-right: 8px; }
.hud-tab { flex: none; width: 14px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #4f5f4f; font: 400 18px/1 var(--display); display: flex; align-items: center; justify-content: center; }
.hud-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--gold); }
.hud-tab:active { transform: none; }
.hud.collapsed { width: 22px; }
.hud.collapsed .hud-body { display: none; }
.hud.collapsed .hud-tab { width: 22px; background: rgba(255, 255, 255, 0.03); color: #8f9b8f; }
.hud-tab { flex-direction: column; gap: 8px; }
.hud-tab span { display: inline-block; }
.hud-tab em { display: none; font: 400 14px var(--display); font-style: normal; letter-spacing: 0.22em; writing-mode: vertical-rl; }
.side-l .hud-tab em { transform: rotate(180deg); }
.hud.collapsed .hud-tab em { display: block; }
.hud.collapsed .hud-tab span { transform: scaleX(-1); }
body.ov-compact .hud { display: none; }
/* denser cards by default: everything should fit without scrolling at 1366x768 and up */
.hud .card { padding: 7px 10px; border-radius: 10px; font-size: 15px; }
.hud .card h3 { font-size: 15px; margin-bottom: 4px; }
.hud .score { font-size: 32px; }
.hud .small { font-size: 13px; }
.hud .pk-card .pk { font-size: 14.5px; padding: 3px 6px; margin: 4px 0; }
.hud .pk-card .pk b { font-size: 20px; }
.hud .pk-card .pk .emb { width: 30px; height: 30px; }
.hud .card:empty { display: none; }
body.lowres #siege .dim, body.big #siege .dim { display: none; }
.logcard { flex: 1; min-height: 3.6em; display: flex; flex-direction: column; }
.logcard #log { flex: 1; max-height: none; min-height: 0; }
/* compact info columns (small windows, big view): denser still, long blurbs hidden */
body.lowres .hud-body, body.big .hud-body { padding-top: 5px; padding-bottom: 5px; gap: 5px; }
body.lowres .hud .card, body.big .hud .card { padding: 5px 8px; border-radius: 9px; font-size: 14px; }
body.lowres .hud .card h3, body.big .hud .card h3 { font-size: 14px; margin-bottom: 3px; }
body.lowres .hud .score, body.big .hud .score { font-size: 28px; }
body.lowres .hud .small, body.big .hud .small { font-size: 12.5px; }
body.lowres .hud #darts .dim, body.lowres .hud #checkout .dim,
body.big .hud #darts .dim, body.big .hud #checkout .dim { display: none; }
/* power-up / weapon-mod descriptions always show (the panels have room for them) */
.hud .pk .small, .hud .mod .small { line-height: 1.25; margin-top: 2px; }
body.lowres #log, body.big #log { font-size: 13px; }
/* low-res: brighter secondary text, the dim grey is unreadable on small / cheap screens at distance */
body.lowres { --dim: #b9c4b9; }
body.lowres .fh-card { background: linear-gradient(180deg, rgba(4, 6, 4, 0.9), rgba(4, 6, 4, 0.8)); }

/* ------------------------------------------------------------ field HUD */
#fieldhud { position: absolute; inset: 0; pointer-events: none; font-family: var(--display); }
.fh-card { position: absolute; background: linear-gradient(180deg, rgba(8, 10, 8, 0.78), rgba(8, 10, 8, 0.62)); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: calc(8px * var(--hs)) calc(12px * var(--hs)); backdrop-filter: blur(3px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.fh-card:empty { display: none; }
.fh-label { font-size: calc(14px * var(--hs)); letter-spacing: 0.12em; color: var(--dim); line-height: 1; }
#fh-bunker { left: 12px; top: 12px; min-width: calc(170px * var(--hs)); }
.hp-big { display: flex; align-items: center; gap: 6px; line-height: 0.95; }
.hp-big .ico { width: calc(34px * var(--hs)); height: calc(34px * var(--hs)); }
.hp-big b { font-size: calc(58px * var(--hs)); font-weight: 400; }
.hp-big span { font-size: calc(24px * var(--hs)); color: var(--dim); align-self: flex-end; padding-bottom: 6px; }
.hp-big.ok { color: var(--good); } .hp-big.warn { color: #ffd740; } .hp-big.crit { color: #ff1744; animation: crit 0.8s infinite alternate; }
@keyframes crit { from { opacity: 0.6; } to { opacity: 1; text-shadow: 0 0 18px #ff1744; } }
.hpbar { height: calc(9px * var(--hs)); background: #2a0d0d; border-radius: 5px; overflow: hidden; margin: 4px 0 6px; box-shadow: inset 0 1px 3px #000; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #00c853, #69f0ae); transition: width 0.4s; }
.hpbar.warn i { background: linear-gradient(90deg, #ff9100, #ffd740); }
.hpbar.crit i { background: linear-gradient(90deg, #b71c1c, #ff1744); }
.turnline { font-size: calc(20px * var(--hs)); letter-spacing: 0.06em; color: #cfd8cf; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.turnline b { font-weight: 400; color: #fff; }
.wavepips { display: inline-flex; gap: 3px; }
.wavepips i { width: calc(9px * var(--hs)); height: calc(9px * var(--hs)); border-radius: 2px; background: #2c332c; transform: rotate(45deg); }
.wavepips i.on { background: #cfd8cf; }
.wavepips i.surge { box-shadow: 0 0 0 1px #ff5252; }
.wavepips i.surge.on { background: #ff5252; }

#fh-checkout { right: 12px; top: 62px; text-align: right; min-width: calc(130px * var(--hs)); }
.co-big { font-size: calc(56px * var(--hs)); line-height: 0.95; color: var(--gold); text-shadow: 0 0 20px rgba(255, 213, 79, 0.35); }
.co-big.done { color: var(--good); font-size: calc(40px * var(--hs)); }
.route { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; margin-top: 2px; }
.route span { font-size: calc(19px * var(--hs)); background: rgba(255, 213, 79, 0.13); border: 1px solid rgba(255, 213, 79, 0.55); color: var(--gold); border-radius: 6px; padding: 0 6px 0 3px; letter-spacing: 0.04em; }
.route em { font-style: normal; display: inline-block; background: var(--gold); color: #000; border-radius: 50%; width: 1.05em; height: 1.05em; line-height: 1.1em; text-align: center; margin-right: 4px; font-size: 0.8em; vertical-align: 1px; }
.co-left { font-size: calc(18px * var(--hs)); color: #fff; margin-top: 2px; }
.co-left.bust { color: var(--bad); }

#fh-phase { position: absolute; bottom: calc(78px * var(--hs) + 24px); left: 50%; transform: translateX(-50%); }
#fh-phase span { display: inline-block; font-size: calc(24px * var(--hs)); letter-spacing: 0.12em; padding: 3px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.12); color: #e0e0e0; white-space: nowrap; }
#fh-phase .bad { color: #ff5252; border-color: #ff5252; }
#fh-phase .gold { color: var(--gold); border-color: var(--gold); }
#fh-phase .pulse { animation: pulse 0.55s infinite alternate; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

#visit { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: calc(8px * var(--hs)); align-items: stretch; }
.vd { position: relative; width: calc(104px * var(--hs)); height: calc(78px * var(--hs)); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(10, 12, 10, 0.72); border: 2px dashed rgba(255, 255, 255, 0.16); color: #fff; line-height: 1; transition: transform 0.2s; }
.vd .vi { position: absolute; left: 7px; top: 5px; font-size: calc(15px * var(--hs)); color: rgba(255, 255, 255, 0.4); }
.vd b { font-size: calc(54px * var(--hs)); font-weight: 400; }
.vd i { font-style: normal; font-size: calc(30px * var(--hs)); margin-right: 1px; align-self: center; opacity: 0.9; }
.vd small { position: absolute; right: 7px; bottom: 4px; font-size: calc(17px * var(--hs)); color: rgba(255, 255, 255, 0.65); }
.vd.cur { border-color: rgba(255, 255, 255, 0.7); border-style: solid; animation: curpulse 1.1s infinite; }
@keyframes curpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); } 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }
.vd:not(.empty) { border-style: solid; animation: land 0.35s ease-out; }
@keyframes land { from { transform: scale(1.35); } to { transform: scale(1); } }
.vd.sgl { background: linear-gradient(180deg, #33403a, #1e2622); border-color: #78909c; }
.vd.dbl { background: linear-gradient(180deg, #1f7a3a, #0f3f1d); border-color: #69f0ae; }
.vd.tre { background: linear-gradient(180deg, #a02020, #4e0d0d); border-color: #ff5252; }
.vd.obull { background: linear-gradient(180deg, #1f7a3a, #0f3f1d); border-color: #69f0ae; }
.vd.bull { background: linear-gradient(180deg, #b8860b, #5d4300); border-color: var(--gold); }
.vd.miss { background: rgba(30, 30, 30, 0.8); border-color: #555; color: #888; }
.vd.miss b { font-size: calc(38px * var(--hs)); text-decoration: line-through; }
.vt { min-width: calc(96px * var(--hs)); border-radius: 12px; background: rgba(0, 0, 0, 0.78); border: 2px solid rgba(255, 255, 255, 0.2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 0.9; padding: 0 10px; }
.vt b { font-size: calc(56px * var(--hs)); font-weight: 400; }
.vt small { font-size: calc(17px * var(--hs)); color: var(--dim); letter-spacing: 0.08em; }
.vt.ton { border-color: var(--gold); color: var(--gold); } .vt.ton small { color: var(--gold); }
.vt.big { border-color: #ff9100; color: #ffab40; box-shadow: 0 0 22px rgba(255, 145, 0, 0.5); } .vt.big small { color: #ffab40; }
.vt.max { border-color: #ff4081; color: #ff4081; box-shadow: 0 0 30px rgba(255, 64, 129, 0.7); animation: pulse 0.3s infinite alternate; }
body.pending #visit { filter: saturate(0.6); }

body.big { --hs: calc(var(--hs-auto) * 1.5); }
body.big #fh-checkout { top: 70px; }

.status { position: absolute; left: 12px; bottom: 12px; font: 600 13px var(--body); padding: 3px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); letter-spacing: 0.03em; max-width: 30%; }
.status.on { color: var(--good); }
.status.off { color: #ffb74d; }
.status.wait { color: var(--dim); }
.ad-hint { margin: 4px 0 6px; font-size: 14px; color: #ffb74d; }
#typed { position: absolute; left: 12px; bottom: 40px; font: 400 32px var(--display); color: var(--gold); letter-spacing: 0.06em; text-shadow: 0 2px 6px #000; }
#fieldbtns { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; }
#fieldbtns button { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: rgba(12, 15, 12, 0.75); border-color: rgba(255, 255, 255, 0.12); backdrop-filter: blur(3px); font-size: 14px; }
#fieldbtns button:hover { background: rgba(40, 50, 40, 0.9); }
#fieldbtns button.on { border-color: var(--gold); color: var(--gold); }
#fieldbtns button.off { color: #ff8a80; }
#fieldbtns svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------ side panel */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); }
.card h3 { margin: 0 0 6px; font-size: 17px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.card h3.sub { margin-top: 10px; }
html.overlay .hud .card { background: rgba(8, 10, 8, 0.72); }
.gold-card { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 213, 79, 0.28); }
.gold-card h3 { color: var(--gold); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dim { color: var(--dim); }
.small { font-size: 13.5px; }
.gold { color: var(--gold); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.ice { color: var(--ice); }
.big { font: 400 44px/1 var(--display); letter-spacing: 0.03em; }
.score { font: 400 38px/1 var(--display); color: var(--gold); letter-spacing: 0.04em; }
.threat { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 400 16px var(--display); letter-spacing: 0.1em; color: var(--dim); }
.threat b { font-weight: 400; color: #fff; min-width: 28px; text-align: right; }
.tbar { flex: 1; height: 8px; border-radius: 4px; background: #1d221d; overflow: hidden; }
.tbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd740, #ff9100 50%, #ff1744); transition: width 0.4s; }
.tag-bad { font-size: 13px; color: #fff; background: #c62828; border-radius: 4px; padding: 0 6px; letter-spacing: 0.08em; }
.vbar { position: relative; height: 10px; background: #1d221d; border-radius: 5px; margin: 16px 0 6px; }
.vbar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #607d8b, var(--gold)); transition: width 0.3s; }
.vbar span { position: absolute; top: -17px; transform: translateX(-50%); font: 400 14px var(--display); color: var(--dim); letter-spacing: 0.05em; }
.vbar span::after { content: ''; position: absolute; left: 50%; top: 16px; width: 2px; height: 12px; background: #445044; }
.vbar span.hit { color: var(--gold); }
.opt { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #3a3a20; }
.opt .lane, .diff .lane { display: inline-block; min-width: 38px; text-align: center; font: 400 26px/1.1 var(--display); color: #000; background: var(--gold); border-radius: 7px; padding: 2px 4px; }
.opt div { flex: 1; }
.mod { border-left: 3px solid var(--c); padding-left: 8px; margin: 4px 0; }
.ups, .syns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ups span { font-size: 13px; background: #2c2a14; border: 1px solid #5a5220; border-radius: 5px; padding: 1px 6px; color: var(--gold); }
.syns span { font-size: 13px; background: rgba(128, 203, 196, 0.12); border: 1px solid #80cbc4; color: #b2dfdb; border-radius: 5px; padding: 1px 6px; }
.pk { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
/* power-ups: the most actionable card, so entries are big and the pick-up/mod cards read as one block */
.pk-card { border-color: #4a6a4a; }
.pk-card .pk { align-items: center; background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 4px 6px; font-size: 15.5px; }
.pk-card .pk b { color: var(--gold); font: 400 22px/1 var(--display); letter-spacing: 0.04em; margin-right: 4px; }
.pk-card .pk .emb { width: 34px; height: 34px; flex: none; }
.pk-card .pk.trap b { color: var(--bad); }
.pk-card .pk .left { float: right; margin-left: 6px; font: 400 15px var(--display); color: #fff; background: #333c33; border-radius: 5px; padding: 0 6px; }
.pk-card .pk .left.soon { background: #8a2a2a; }
.mods-card { border-color: #4a6a4a; }
.co-num { font: 400 26px/1 var(--display); color: var(--gold); }
.co-num.done { color: var(--good); }
.co-route { font: 400 15px var(--display); color: #cfd8cf; letter-spacing: 0.04em; }
body.lowres .hud .none, body.big .hud .none { display: none; }
body.lowres .hud #checkout h3, body.big .hud #checkout h3 { flex-wrap: wrap; margin: 0; }
.mods-card:empty { display: none; }
.pk.trap b { color: var(--bad); }
.glyph { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #000; font: 400 16px var(--display); background: var(--c, #ccc); box-shadow: 0 0 0 2px #fff, 0 0 10px var(--c, transparent); margin-top: 2px; }
.zlist { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0; }
.z { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; white-space: nowrap; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 2px solid var(--c); border-radius: 6px; padding: 1px 6px 1px 2px; }
.z img { width: 24px; height: 24px; }
.lanes { color: #ff8a80; font-weight: 700; }
.brow { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.bchips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.bchip { font-size: 12.5px; background: #1b211b; border: 1px solid #3a463a; border-radius: 5px; padding: 0 5px; box-shadow: inset 0 -2px 0 var(--v, transparent); }
.bchip i { font-style: normal; color: var(--gold); margin-left: 3px; font-size: 9px; vertical-align: 1px; letter-spacing: -1px; }
.bchip.hurt { border-color: #ff7043; }
#log { list-style: none; margin: 0; padding: 0; font-size: 13.5px; overflow: hidden; }
#log li { padding: 2px 0 2px 8px; color: #b8c0b8; border-left: 2px solid transparent; }
#log li.fresh { animation: fresh 0.6s ease-out; }
@keyframes fresh { from { background: rgba(255, 255, 255, 0.12); } to { background: transparent; } }
#log li.good { color: var(--good); border-color: var(--good); }
#log li.bad { color: var(--bad); border-color: var(--bad); }
#log li.warn { color: #ffb74d; border-color: #ffb74d; }
#log li.gold { color: var(--gold); border-color: var(--gold); }

/* ------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.88) 75%); z-index: 10; padding: 16px; }
.screen[hidden], .card[hidden] { display: none; }
.panel { background: linear-gradient(180deg, rgba(20, 24, 20, 0.96), rgba(10, 12, 10, 0.96)); border: 1px solid var(--line2); border-radius: 16px; padding: 24px 30px; max-width: 760px; width: 100%; max-height: 94vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(198, 40, 40, 0.15); }
.panel.wide { max-width: 1160px; }
.panel h2 { font-size: 34px; margin: 0 0 8px; color: #ef5350; }
.panel h3 { font-size: 22px; margin: 16px 0 6px; color: var(--gold); }

.title-screen { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.85) 70%); }
.title-panel { text-align: center; background: linear-gradient(180deg, rgba(14, 16, 14, 0.88), rgba(8, 9, 8, 0.92)); backdrop-filter: blur(2px); }
.logo { margin: 0 0 6px; font: 400 92px/0.9 'Creepster', var(--display); letter-spacing: 0.04em; color: #d32f2f; text-shadow: 0 4px 0 #2a0000, 0 0 40px rgba(211, 47, 47, 0.55); display: flex; align-items: baseline; justify-content: center; gap: 14px; flex-wrap: wrap; }
.logo small { font: 400 28px var(--display); color: #e0e0e0; letter-spacing: 0.2em; text-shadow: none; }
.logo .l2 { animation: flicker 6s infinite; }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: 0.4; } 94% { opacity: 1; } 96% { opacity: 0.6; } }
.tag { font-size: 18px; color: #cfd8cf; margin: 4px 0 14px; }
#modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
#modes:empty { display: none; }
#modes button.mode { text-align: left; padding: 12px 16px; border-radius: 12px; background: rgba(30, 36, 30, 0.85); border: 2px solid var(--line2); font: 400 30px/1 var(--display); letter-spacing: 0.08em; display: flex; flex-direction: column; gap: 4px; }
#modes button.mode small, #modes button.mode span { font: 500 14px/1.25 var(--body); letter-spacing: 0.01em; color: var(--dim); }
#modes button.mode.sel { border-color: #ef5350; background: linear-gradient(180deg, rgba(120, 20, 20, 0.55), rgba(40, 10, 10, 0.7)); box-shadow: 0 0 24px rgba(239, 83, 80, 0.35); }
#modes button.mode.sel small, #modes button.mode.sel span { color: #ffcdd2; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin: 10px 0; font-size: 15px; text-align: left; }
.legend b { color: var(--gold); display: inline-block; min-width: 92px; font-weight: 700; }
.legend-fortress { display: none; }
.title-screen:has(.mode.sel[data-mode="fortress"]) .legend-fortress { display: grid; }
.title-screen:has(.mode.sel[data-mode="fortress"]) .legend-horde { display: none; }
.throwhint { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; font-size: 15px; color: #cfd8cf; margin: 10px 0; }
.throwhint span { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; padding: 3px 12px; }
.throwhint b { color: var(--gold); }
.throwhint.nudge span { animation: hint-nudge 0.9s ease-out 2; }
@keyframes hint-nudge { 0%, 60% { background: rgba(255, 200, 60, 0.35); border-color: var(--gold); transform: scale(1.08); } 100% { transform: none; } }
#diffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.diff { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 12px; background: rgba(26, 32, 26, 0.9); }
.diff b { font: 400 26px var(--display); letter-spacing: 0.06em; }
.diff:hover { border-color: var(--gold); transform: translateY(-2px); }
.diff.sel { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 213, 79, 0.25); }
.link { background: none; border: none; color: var(--gold); text-decoration: underline; padding: 0; }
.link:hover { background: none; }
.close { position: absolute; right: 14px; top: 14px; }
.cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; }
.cols ul { padding-left: 18px; }
.cols li { margin: 3px 0; }
label { display: block; margin: 8px 0; }
label input[type=text], select { width: 100%; padding: 6px 8px; background: #0c0f0c; color: var(--text); border: 1px solid var(--line2); border-radius: 6px; margin-top: 4px; font: inherit; }
label input[type=range] { width: 100%; accent-color: var(--gold); }
label.chk { display: flex; align-items: center; gap: 8px; }
label.chk input { width: 18px; height: 18px; accent-color: var(--gold); }
.setgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
.btnrow.center { justify-content: center; }
#roster .z, #pickroster .pk { white-space: normal; margin: 5px 0; }
#roster .z { display: block; border: none; background: none; padding: 0; }
#roster .z i, #pickroster .glyph { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; color: #000; font-style: normal; font-weight: 900; font-size: 12px; margin-right: 4px; }
#pickroster .glyph { box-shadow: none; }

/* game over */
.over-logo { font-size: 84px; }
.sum-head { display: flex; align-items: center; gap: 18px; justify-content: center; margin: 4px 0 12px; }
.grade { font: 400 96px/1 'Creepster', var(--display); width: 110px; height: 110px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #1a1a1a; border: 3px solid currentColor; }
.g-S { color: #ffd740; box-shadow: 0 0 30px rgba(255, 215, 64, 0.5); } .g-A { color: #69f0ae; } .g-B { color: #40c4ff; } .g-C { color: #ffab40; } .g-D { color: #ff5252; }
.newbest { font: 400 22px var(--display); background: var(--gold); color: #000; border-radius: 6px; padding: 2px 8px; vertical-align: middle; animation: pulse 0.5s infinite alternate; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line2); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.tile span { color: var(--dim); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.tile b { font: 400 36px/1.05 var(--display); }
.tile small { color: var(--dim); }
.runchart { width: 100%; height: 130px; margin: 12px 0 4px; background: rgba(0, 0, 0, 0.3); border-radius: 8px; }
.runchart text { font: 600 12px var(--body); }
.statgrid { display: grid; grid-template-columns: repeat(3, auto auto); gap: 3px 14px; margin: 10px 0; justify-content: center; font-size: 15px; }
.statgrid span { color: var(--dim); text-align: right; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) and (orientation: portrait) {
  #app { flex-wrap: wrap; align-content: flex-start; overflow-y: auto; }
  #field { height: 64vh; flex: none; width: 100%; order: 0; }
  .hud, .hud.collapsed { width: 50%; height: auto; order: 1; }
  .hud.collapsed .hud-body { display: flex; }
  .hud-tab { display: none; }
  .cols, .setgrid { grid-template-columns: 1fr; }
  #diffs { grid-template-columns: repeat(2, 1fr); }
  .logo { font-size: 58px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .statgrid { grid-template-columns: auto auto; }
  #fieldbtns span { display: none; }
  #fh-checkout { top: 56px; }
  .status { display: none; }
}
@media (max-width: 520px) {
  .legend { grid-template-columns: 1fr; }
  #modes { grid-template-columns: 1fr; }
  #fh-bunker { top: 54px; left: 8px; }
  #fh-checkout { top: 54px; right: 8px; }
  #fieldbtns { gap: 4px; right: 8px; top: 8px; }
  #fieldbtns button { padding: 6px 8px; }
  .panel { padding: 18px 16px; }
}


/* ---------------------------------------------------------------- advisor */
#fh-danger { left: 12px; top: calc(12px + 132px * var(--hs)); min-width: calc(170px * var(--hs)); }
#fh-danger .dg-big { font-size: calc(34px * var(--hs)); line-height: 1.05; letter-spacing: 0.03em; }
#fh-danger .dg-lanes { font: 600 calc(14px * var(--hs)) var(--body); color: #ffcdd2; }
#fh-danger .dg-lanes b { font-family: var(--display); font-size: 1.3em; margin: 0 2px; color: #fff; }
#fh-danger.safe .dg-big { color: #69f0ae; }
#fh-danger.hurt { border-color: rgba(255, 82, 82, 0.6); }
#fh-danger.hurt .dg-big { color: #ff5252; }
#fh-danger.fatal { border-color: #ff1744; box-shadow: 0 0 24px rgba(255, 23, 68, 0.55); animation: pulse 0.6s infinite alternate; }
#fh-danger.fatal .dg-big { color: #ff1744; }
/* both side panels open: the field is narrow, so the field cards that repeat the right panel
   (next turn, aim, checkout) would sit on the board. Hide them; the panel shows the same info. */
body.both-panels #fh-danger, body.both-panels #fh-aim, body.both-panels #fh-checkout { display: none; }
body.both-panels #fh-bunker { left: 6px; top: 6px; min-width: 0; padding: 5px 9px; }
body.both-panels #fh-bunker .hp-big b { font-size: calc(40px * var(--hs)); }
body.both-panels #fh-bunker .hp-big span { font-size: calc(18px * var(--hs)); padding-bottom: 3px; }
body.both-panels #fh-bunker .hp-big .ico { width: calc(24px * var(--hs)); height: calc(24px * var(--hs)); }
body.both-panels #fh-bunker .turnline { font-size: calc(17px * var(--hs)); }
body.both-panels #fh-bunker .fh-label { font-size: calc(12px * var(--hs)); }
#fh-aim { right: 12px; top: calc(70px + 118px * var(--hs)); text-align: right; min-width: calc(130px * var(--hs)); border-color: rgba(64, 196, 255, 0.45); }
#fh-aim .fh-label { color: #80d8ff; }
#fh-aim .aim-big { font-size: calc(40px * var(--hs)); line-height: 1; color: #40c4ff; text-shadow: 0 0 14px rgba(64, 196, 255, 0.5); }
#fh-aim .aim-why { font: 600 calc(13px * var(--hs)) var(--body); color: #e1f5fe; max-width: calc(220px * var(--hs)); margin-left: auto; }
#fh-aim .aim-alt { font: 500 calc(12px * var(--hs)) var(--body); color: var(--dim); margin-top: 2px; }
#fh-aim .aim-alt b { color: #b3e5fc; font-family: var(--display); font-size: 1.2em; letter-spacing: 0.04em; }
#fh-key { position: absolute; left: 12px; bottom: 64px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
#fh-key .k { font: 600 calc(12px * var(--hs)) var(--body); color: #cfd8dc; background: rgba(0, 0, 0, 0.55); border-radius: 6px; padding: 1px 8px 1px 2px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#fh-key .k b { font: 400 calc(14px * var(--hs)) var(--display); min-width: calc(40px * var(--hs)); text-align: center; border-radius: 4px; padding: 0 4px; color: #111; letter-spacing: 0.04em; }
#fh-key .tre b { background: #ff5252; } #fh-key .dbl b { background: #69f0ae; } #fh-key .sgl b { background: #eceff1; }
#fh-key .obull b { background: #66bb6a; } #fh-key .bull b { background: #ffd740; }
.advice-card { border-color: rgba(64, 196, 255, 0.35); }
.adv-danger, .adv-safe { display: flex; align-items: baseline; gap: 8px; }
.adv-danger b, .adv-safe b { font: 400 28px var(--display); letter-spacing: 0.03em; }
.adv-danger b { color: #ff5252; } .adv-danger.fatal b { color: #ff1744; } .adv-safe b { color: #69f0ae; }
.adv-danger span, .adv-safe span { color: var(--dim); font-size: 12px; }
.adv-list { list-style: none; margin: 4px 0; padding: 0; font-size: 13px; }
.adv-list li { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
.adv-list .ln { font: 400 18px var(--display); min-width: 28px; text-align: center; background: rgba(255, 82, 82, 0.2); border-radius: 4px; color: #fff; }
.adv-list em { color: #ff8a80; font-style: normal; font-weight: 700; }
.adv-lost { color: #ffb74d; font-size: 12px; margin: 2px 0; }
.adv-aim { list-style: none; margin: 4px 0 0; padding: 0; }
.adv-aim li { display: grid; grid-template-columns: 22px auto 1fr; gap: 6px; align-items: baseline; padding: 2px 0; font-size: 12px; }
.adv-aim .rk { font: 400 15px var(--display); color: #111; background: #40c4ff; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; text-align: center; }
.adv-aim b { font: 400 20px var(--display); color: #40c4ff; letter-spacing: 0.04em; }
.adv-wait { color: #ff8a80; font: 400 20px var(--display); letter-spacing: 0.06em; }
body.big #fh-key { display: none; }
@media (max-width: 900px) { #fh-key { display: none; } #fh-danger { top: calc(54px + 120px * var(--hs)); left: 8px; } #fh-aim { top: calc(54px + 110px * var(--hs)); right: 8px; } }

/* ---------------------------------------------------------------- beginner explainers */
#explain:empty { display: none; }
.ex-card { position: absolute; left: 12px; bottom: calc(96px * var(--hs) + 22px); width: min(360px, 42%); pointer-events: auto; cursor: pointer;
  background: linear-gradient(180deg, rgba(20, 22, 16, 0.96), rgba(12, 14, 10, 0.94)); border: 2px solid #fff176; border-radius: 14px;
  padding: 12px 14px 10px; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 241, 118, 0.25);
  font: 500 calc(14px * var(--hs)) var(--body); color: #eceff1; animation: exIn 0.35s cubic-bezier(.2, 1.4, .4, 1); overflow: hidden; }
.ex-card.ex-pickup { border-color: #69f0ae; }
.ex-card.ex-zombie { border-color: #ff8a80; }
@keyframes exIn { from { transform: translateY(20px) scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.ex-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.ex-head img { width: calc(68px * var(--hs)); height: calc(68px * var(--hs)); flex: none; background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%); border-radius: 50%; }
.ex-head img.ex-emblem { background: none; }
.ex-kind { font: 400 calc(14px * var(--hs)) var(--display); letter-spacing: 0.16em; color: #fff176; }
.ex-name { font: 400 calc(30px * var(--hs)) var(--display); letter-spacing: 0.04em; line-height: 1; color: #fff; }
.ex-stats { font-size: 0.85em; color: #b0bec5; margin-top: 2px; }
.ex-card p { margin: 4px 0; line-height: 1.3; }
.ex-card ul { margin: 6px 0 2px; padding-left: 18px; line-height: 1.35; }
.ex-card li { margin: 3px 0; }
.ex-tip { background: rgba(255, 255, 255, 0.06); border-left: 3px solid #fff176; padding: 4px 8px; border-radius: 4px; }
.ex-blue { color: #40c4ff; font-weight: 700; } .ex-red { color: #ff5252 !important; font-weight: 700; } .ex-gold { color: var(--gold); }
.ex-foot { display: flex; justify-content: space-between; font-size: 0.75em; color: #78909c; margin-top: 6px; }
.ex-foot em { font-style: normal; margin-left: auto; }
.ex-time { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #fff176; transform-origin: left; animation: exTime linear forwards; }
@keyframes exTime { from { transform: scaleX(1); } to { transform: scaleX(0); } }
body.explaining #fh-key { display: none; }
.beginner { display: flex; gap: 18px; justify-content: center; margin: 6px 0 2px; font-size: 14px; }
.emb { width: 26px; height: 26px; vertical-align: middle; flex: none; }
@media (max-width: 900px) { .ex-card { width: auto; right: 8px; left: 8px; bottom: 8px; } }
body.ex-right .ex-card { left: auto; right: 12px; }
@media (max-width: 900px) { body.ex-right .ex-card { left: 8px; right: 8px; } }
.shapekey { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 4px 0 10px; font-size: 12px; color: #cfd8dc; }
.shapekey span { display: flex; align-items: center; gap: 6px; }

/* ===== Mode fantasy: visit tracker (Horde = magazine rounds, Fortress = build-order bricks) ===== */
.vd .rd { position: absolute; right: 8px; top: 6px; pointer-events: none; display: block; }
/* Horde: each dart is a round. Loaded = brass case + copper tip; spent = empty casing outline */
#visit.mag .vd .rd { width: calc(11px * var(--hs)); height: calc(26px * var(--hs)); border-radius: 55% 55% 2px 2px / 40% 40% 2px 2px; }
#visit.mag .vd .rd.live { background: linear-gradient(90deg, #8a5a14, #ffd36b 45%, #8a5a14); box-shadow: 0 0 6px rgba(255, 200, 80, 0.55); clip-path: none; position: absolute; }
#visit.mag .vd .rd.live::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 42%; border-radius: 55% 55% 0 0 / 80% 80% 0 0; background: linear-gradient(90deg, #7a3a12, #e08a3c 45%, #7a3a12); }
#visit.mag .vd .rd.spent { background: transparent; border: 2px solid rgba(255, 211, 107, 0.4); border-top: 0; border-radius: 2px 2px 2px 2px; height: calc(18px * var(--hs)); top: calc(14px * var(--hs)); opacity: 0.6; }
#visit.mag.reload .vd .rd.spent { border-color: #ffd36b; opacity: 1; animation: rd-reload 0.7s steps(2, jump-none) infinite; }
#visit.mag.reload .vt small { color: #ffd36b; }
@keyframes rd-reload { 50% { opacity: 0.25; } }
/* Fortress: each dart is a build order. Pending = blueprint-blue dashed brick, placed = laid brick */
#visit.bricks .vd .rd { width: calc(30px * var(--hs)); height: calc(14px * var(--hs)); border-radius: 2px; top: calc(9px * var(--hs)); }
#visit.bricks .vd .rd.live { border: 2px dashed #4fc3f7; background: rgba(33, 150, 243, 0.2); }
#visit.bricks .vd .rd.spent { background: linear-gradient(180deg, #d9763f, #9a4a22); border: 1px solid #5a2a12; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), inset 8px 0 0 -7px rgba(255, 255, 255, 0.4); }
#visit.bricks .vd.cur .rd.live { animation: rd-blueprint 1s linear infinite; }
@keyframes rd-blueprint { 50% { background: rgba(79, 195, 247, 0.4); } }
#visit.bricks.reload .vd .rd.spent { filter: brightness(1.25); }

/* ======================================================================================
   SIEGE mode (Fortress builds + Horde shooting; solo or 2 players). Appended block.
   Body class `mode-siege` (+ `siege-2p` / `siege-solo`, set by hud.js renderSiege).
   ====================================================================================== */
#modes { grid-template-columns: repeat(3, 1fr); }
#modes button.mode span { font-size: 13px; }
#siege-opts { display: none; align-items: center; gap: 10px; margin: -4px 0 12px; }
.title-screen:has(.mode.sel[data-mode="siege"]) #siege-opts { display: flex; }
#siege-opts .so-label { font: 400 20px/1 var(--display); letter-spacing: 0.12em; color: var(--gold); white-space: nowrap; }
#siege-opts kbd { font: 700 12px var(--body); background: #222; border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; color: #ddd; letter-spacing: 0; }
#siege-opts button.mode-sub { flex: 1; text-align: left; padding: 8px 12px; border-radius: 10px; background: rgba(30, 36, 30, 0.85); border: 2px solid var(--line2); display: flex; flex-direction: column; gap: 2px; font: 400 22px/1 var(--display); letter-spacing: 0.08em; }
#siege-opts button.mode-sub span { font: 500 12px/1.25 var(--body); letter-spacing: 0.01em; color: var(--dim); }
#siege-opts button.mode-sub.sel { border-color: #ff7043; background: linear-gradient(180deg, rgba(110, 50, 20, 0.55), rgba(40, 18, 8, 0.7)); box-shadow: 0 0 18px rgba(255, 112, 67, 0.3); }
#siege-opts button.mode-sub.sel span { color: #ffe0b2; }
.legend-siege { display: none; }
.title-screen:has(.mode.sel[data-mode="siege"]) .legend-siege { display: grid; }
.title-screen:has(.mode.sel[data-mode="siege"]) .legend-horde,
.title-screen:has(.mode.sel[data-mode="siege"]) .legend-fortress { display: none; }

/* whose visit is it: big, top centre of the field, readable from the oche */
#fh-player { position: absolute; top: 52px; /* below the button row so narrow fields never overlap it */ left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
#fh-player:empty { display: none; }
#fh-player .sp-role { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: calc(6px * var(--hs)) calc(26px * var(--hs)) calc(8px * var(--hs)); border-radius: 14px; background: rgba(6, 8, 6, 0.82); border: 3px solid var(--c, #fff); box-shadow: 0 0 calc(28px * var(--hs)) var(--c, #fff), inset 0 0 18px rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
#fh-player .sp-role b { font: 400 calc(40px * var(--hs)) / 1 var(--display); letter-spacing: 0.1em; color: var(--c, #fff); text-shadow: 0 0 14px var(--c, #fff); white-space: nowrap; }
#fh-player .sp-role small { font: 600 calc(14px * var(--hs)) / 1.1 var(--body); letter-spacing: 0.04em; color: #e0e0e0; white-space: nowrap; }
#fh-player .sp-role.builder { --c: #4dd0e1; }
#fh-player .sp-role.shooter { --c: #ff7043; }
#fh-player .sp-role.solo { --c: #ffd54f; }
#fh-player .sp-role.handover { animation: pulse 0.55s infinite alternate; }
#fh-player .sp-next { display: block; margin-top: 4px; font: 400 calc(20px * var(--hs)) / 1 var(--display); letter-spacing: 0.1em; color: var(--c, #fff); text-shadow: 0 2px 8px #000; }
body.mode-siege #fh-bunker .fh-label { color: #ffcc80; }
body.mode-siege .siege-card h3 .dim { font-weight: 400; }
.siege-card .sg-row { display: flex; gap: 8px; align-items: baseline; margin: 3px 0; font: 600 14px var(--body); }
.siege-card .sg-row b { font: 400 18px var(--display); letter-spacing: 0.06em; min-width: 118px; }
.siege-card .sg-row.builder b { color: #4dd0e1; }
.siege-card .sg-row.shooter b { color: #ff7043; }
.siege-card .sg-row.on { background: rgba(255, 255, 255, 0.07); border-radius: 6px; }
.siege-card .sg-dmg { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.siege-card .sg-dmg span { font: 600 12px var(--body); background: rgba(255, 255, 255, 0.07); border-radius: 6px; padding: 1px 7px; color: #ddd; }
.siege-card .sg-dmg span b { font: 400 14px var(--display); color: #ff7043; margin-right: 4px; letter-spacing: 0.04em; }
@media (max-width: 900px) { #fh-player { top: 50px; } #modes { grid-template-columns: 1fr; } }

/* ---- power-up grabbed: the token flies to its side card, which flashes in the power-up colour (js/ui/spectacle.js) */
.card.grab-flash { animation: grabFlash 0.9s ease-out; }
@keyframes grabFlash {
  0% { box-shadow: 0 0 0 3px var(--grab, #fff), 0 0 28px 6px var(--grab, #fff); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; transform: scale(1); }
}

/* ---------------------------------------------------------------- armory popup (centre of the board) */
#armory-pop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; width: min(calc(500px * var(--hs)), 86%);
  background: linear-gradient(180deg, rgba(26, 22, 8, 0.95), rgba(12, 10, 4, 0.94)); border: 2px solid var(--gold); border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7), 0 0 34px rgba(255, 213, 79, 0.35); padding: calc(12px * var(--hs)) calc(16px * var(--hs)) calc(10px * var(--hs));
  animation: armIn 0.35s cubic-bezier(.2, 1.4, .4, 1); backdrop-filter: blur(4px); }
#armory-pop[hidden], #armory-pill[hidden] { display: none; }
@keyframes armIn { from { transform: translate(-50%, -46%) scale(0.9); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
#armory-pop .arm-head { display: flex; align-items: baseline; gap: 10px; font: 400 calc(30px * var(--hs))/1 var(--display); letter-spacing: 0.08em; color: var(--gold); margin-bottom: 4px; }
#armory-pop .arm-head small { font: 600 calc(14px * var(--hs)) var(--body); letter-spacing: 0.02em; color: #e8dcb0; }
#armory-pop .arm-x { margin-left: auto; padding: 2px 10px; font-size: calc(15px * var(--hs)); background: rgba(0, 0, 0, 0.4); border-color: rgba(255, 213, 79, 0.4); color: #e8dcb0; }
#armory-pop .opt { cursor: pointer; border-radius: 10px; padding: calc(7px * var(--hs)) 8px; border-top: 1px solid rgba(255, 213, 79, 0.18); font-size: calc(15px * var(--hs)); }
#armory-pop .opt:hover { background: rgba(255, 213, 79, 0.1); }
#armory-pop .opt .lane { min-width: calc(54px * var(--hs)); font-size: calc(36px * var(--hs)); }
#armory-pop .opt b { font: 400 calc(22px * var(--hs))/1.1 var(--display); letter-spacing: 0.05em; color: #fff; }
#armory-pop .opt .dim { color: #cfc8a8; }
#armory-pop .arm-foot { font-size: calc(13px * var(--hs)); color: #b8b090; margin-top: 4px; }
#armory-pill { position: absolute; left: 50%; bottom: calc(78px * var(--hs) + 66px); transform: translateX(-50%); z-index: 4; font: 400 calc(20px * var(--hs)) var(--display); letter-spacing: 0.1em;
  color: #000; background: var(--gold); border: 0; border-radius: 999px; padding: 3px 16px; box-shadow: 0 0 18px rgba(255, 213, 79, 0.5); }
#armory-pill:hover { background: #ffe082; }

/* ---------------------------------------------------------------- progression (level > wave > turn) */
#fh-bunker .lvline { font-size: calc(17px * var(--hs)); letter-spacing: 0.08em; color: var(--gold); line-height: 1.1; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(300px * var(--hs)); }
#fh-bunker .lvline b { font-weight: 400; color: #fff; }
#fh-bunker .lvline em { font-style: normal; color: #ffe9a8; }
.turnline .dim2 { color: var(--dim); }
.wavepips i.cur { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 0 8px #fff; }
.wavepips i.surge.cur { background: #ff5252; box-shadow: 0 0 0 2px rgba(255, 82, 82, 0.5), 0 0 10px #ff5252; }
.nextline { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 4px; }
.nextline .nx { font-size: calc(16px * var(--hs)); letter-spacing: 0.08em; line-height: 1; padding: 3px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: #cfd8cf; white-space: nowrap; }
.nextline .nx.gold { color: #111; background: var(--gold); }
.nextline .nx.dimgold { color: var(--gold); background: rgba(255, 213, 79, 0.1); }
.nextline .nx.bad { color: #fff; background: #c62828; }
.nextline .nx.warn { color: #ffcc80; background: rgba(255, 152, 0, 0.16); }
.nextline .nx.urgent { animation: pulse 0.7s infinite alternate; }
body.both-panels #fh-bunker .lvline { font-size: calc(14px * var(--hs)); max-width: calc(220px * var(--hs)); }
body.both-panels #fh-bunker .nextline .nx { font-size: calc(15px * var(--hs)); padding: 2px 6px; }
/* run type toggle on the title (styled like the Siege Solo/2P sub-toggle, always visible) */
#run-opts { display: flex; align-items: center; gap: 10px; margin: -4px 0 10px; }
#run-opts:empty { display: none; }
#run-opts .so-label { font: 400 20px/1 var(--display); letter-spacing: 0.12em; color: var(--gold); white-space: nowrap; }
#run-opts kbd { font: 700 12px var(--body); background: #222; border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; color: #ddd; letter-spacing: 0; }
#run-opts button.mode-sub { flex: 1; text-align: left; padding: 8px 12px; border-radius: 10px; background: rgba(30, 36, 30, 0.85); border: 2px solid var(--line2); display: flex; flex-direction: column; gap: 2px; font: 400 22px/1 var(--display); letter-spacing: 0.08em; }
#run-opts button.mode-sub span { font: 500 12px/1.25 var(--body); letter-spacing: 0.01em; color: var(--dim); }
#run-opts button.mode-sub.sel { border-color: var(--gold); background: linear-gradient(180deg, rgba(110, 86, 20, 0.5), rgba(40, 30, 8, 0.7)); box-shadow: 0 0 18px rgba(255, 213, 79, 0.25); }
#run-opts button.mode-sub.sel span { color: #fff3c4; }
/* short screens: the title must fit without scrolling at 1280x720 */
@media (max-height: 820px) and (orientation: landscape) {
  .title-panel { padding: 14px 24px; max-height: 98vh; }
  .title-panel .logo { font-size: 64px; margin-bottom: 0; }
  .title-panel .logo small { font-size: 22px; }
  .title-panel .tag { font-size: 15px; margin: 2px 0 8px; }
  #modes { margin: 4px 0 8px; gap: 8px; }
  #modes button.mode { padding: 7px 12px; font-size: 25px; }
  #modes button.mode span { font-size: 12.5px; }
  #run-opts, #siege-opts { margin: -2px 0 7px; }
  #run-opts button.mode-sub, #siege-opts button.mode-sub { padding: 5px 10px; font-size: 20px; }
  .title-panel .legend { font-size: 13.5px; gap: 1px 14px; margin: 5px 0; }
  .title-panel .throwhint { font-size: 13px; gap: 6px; margin: 6px 0; }
  .title-panel .throwhint span { padding: 2px 9px; }
  .title-panel .beginner { margin: 4px 0; }
  #diffs { margin: 6px 0; gap: 8px; }
  .diff { padding: 7px 6px; gap: 2px; }
  .diff b { font-size: 23px; }
}
/* side-panel power-up rank / campaign loadout strip */
.rk { display: inline-block; font: 400 13px/1.25 var(--display); letter-spacing: 0.06em; color: #111; background: var(--gold); border-radius: 4px; padding: 0 5px; vertical-align: 2px; }
.rk.rare { background: #fff; box-shadow: 0 0 8px #fff; }
.hud .pk.rare { border-color: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.35); }
.loadstrip { display: flex; align-items: center; gap: 4px; margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line2); flex-wrap: wrap; }
.loadstrip span { position: relative; display: inline-flex; }
.loadstrip img { width: 22px; height: 22px; }
.loadstrip i { position: absolute; right: -4px; bottom: -3px; font: 400 10px/1.1 var(--display); font-style: normal; color: #111; background: var(--gold); border-radius: 3px; padding: 0 2px; }
.loadstrip em { font-style: normal; font-size: 11.5px; color: var(--dim); margin-left: 2px; }

/* ---------------------------------------------------------------- campaign camp (phase 'camp') */
#camp { --hs: var(--hs-auto); position: fixed; inset: 0; z-index: 6; display: grid; grid-template-columns: var(--campw) 1fr var(--campw); pointer-events: none;
  --campw: max(230px, calc(var(--hudw, 290px) + 14px)); }
#camp[hidden] { display: none; }
#camp > * { pointer-events: auto; }
.camp-side { background: linear-gradient(180deg, #0c0e0c, #070807); border-right: 1px solid var(--line2); padding: 14px 14px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.camp-r { border-right: 0; border-left: 1px solid var(--line2); }
.camp-side h4 { margin: 8px 0 0; font: 400 17px var(--display); letter-spacing: 0.1em; color: var(--gold); }
.camp-side h4 small { font: 500 12px var(--body); letter-spacing: 0.02em; color: var(--dim); margin-left: 4px; }
.camp-kicker { font: 400 15px/1 var(--display); letter-spacing: 0.16em; color: var(--dim); }
.brief-name { font: 400 38px/0.95 var(--display); letter-spacing: 0.04em; color: #fff; }
.brief-tag { font-style: italic; color: #cfd8cf; font-size: 14px; line-height: 1.25; }
.brief-shape { font-size: 13.5px; color: #e0e6e0; background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 5px 8px; line-height: 1.3; }
.brief-shape b { color: var(--gold); }
.brief-shape .bad { color: #ff8a80; font-weight: 700; }
.bz { display: flex; gap: 8px; align-items: flex-start; border-left: 4px solid var(--c); background: rgba(255, 255, 255, 0.04); border-radius: 0 8px 8px 0; padding: 5px 8px; }
.bz img { width: 46px; height: 46px; flex: none; image-rendering: auto; }
.bz-name { font: 400 22px/1 var(--display); letter-spacing: 0.05em; color: var(--c); }
.bz-name small { display: block; font: 600 12px/1.3 var(--body); letter-spacing: 0.01em; color: #cfd8cf; }
.bz-tip { font-size: 13px; line-height: 1.25; color: #e8ece8; margin-top: 2px; }
.brief-known { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--dim); align-items: center; }
.brief-known span { display: inline-flex; align-items: center; gap: 2px; color: var(--c); }
.brief-known img { width: 20px; height: 20px; }
.bt { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; line-height: 1.28; color: #dfe5df; }
.bt b { display: block; font: 400 16px/1.1 var(--display); letter-spacing: 0.06em; color: #fff; }
.bt span b { display: inline; font: 700 12.5px var(--body); letter-spacing: 0; color: var(--gold); }
.cintro { font-size: 14px; line-height: 1.35; color: #dfe5df; }
.cintro b { color: var(--gold); }
.cstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cstats span { display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.cstats b { font: 400 26px/1.05 var(--display); color: #fff; letter-spacing: 0.03em; }
.clo { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 15px; }
.clo img { width: 30px; height: 30px; }
.clo b { flex: 1; font-weight: 700; }
.ctrack { display: flex; gap: 5px; flex-wrap: wrap; }
.ctrack span { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font: 400 18px var(--display); background: rgba(255, 255, 255, 0.06); color: var(--dim); border: 1px solid var(--line2); }
.ctrack span.done { background: #2e7d32; color: #fff; border-color: #69f0ae; }
.ctrack span.next { background: var(--gold); color: #111; border-color: #fff; animation: pulse 0.8s infinite alternate; }
.cscore { margin-top: auto; font-size: 14px; color: var(--dim); }
.cscore b { color: #fff; font-family: var(--display); font-size: 20px; font-weight: 400; letter-spacing: 0.04em; }
.camp-mid { display: flex; align-items: center; justify-content: center; pointer-events: none !important; padding: 0 10px; }
.camp-card { pointer-events: auto; width: min(calc(560px * var(--hs)), 100%); background: linear-gradient(180deg, rgba(18, 16, 8, 0.95), rgba(8, 8, 6, 0.93)); border: 2px solid rgba(255, 213, 79, 0.65); border-radius: 16px; padding: calc(12px * var(--hs)) calc(16px * var(--hs)); box-shadow: 0 12px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(255, 213, 79, 0.18); }
.camp-card .camp-kicker { color: #e8dcb0; font-size: calc(15px * var(--hs)); }
.camp-title { font: 400 calc(34px * var(--hs))/1 var(--display); letter-spacing: 0.06em; color: var(--gold); margin: 2px 0 6px; }
.copts { display: flex; flex-direction: column; gap: calc(6px * var(--hs)); }
.copt { display: flex; align-items: center; gap: calc(10px * var(--hs)); cursor: pointer; border-radius: 12px; padding: calc(7px * var(--hs)) 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 213, 79, 0.22); transition: background 0.15s, opacity 0.2s, transform 0.1s; }
.copt:hover { background: rgba(255, 213, 79, 0.12); }
.copt .lane { min-width: calc(58px * var(--hs)); font: 400 calc(40px * var(--hs))/1.05 var(--display); color: #000; background: var(--gold); border-radius: 8px; text-align: center; padding: 2px 4px; }
.copt .emb { width: calc(54px * var(--hs)); height: calc(54px * var(--hs)); flex: none; }
.copt .cbody { flex: 1; min-width: 0; }
.cname { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cname b { font: 400 calc(25px * var(--hs))/1.05 var(--display); letter-spacing: 0.05em; color: #fff; }
.cname .rk { font-size: calc(14px * var(--hs)); }
.ctag { font: 700 calc(11px * var(--hs)) var(--body); letter-spacing: 0.1em; padding: 1px 6px; border-radius: 4px; background: rgba(105, 240, 174, 0.15); color: #69f0ae; }
.ctag.rank { background: rgba(255, 213, 79, 0.16); color: var(--gold); }
.ctag.heal { background: rgba(255, 82, 82, 0.16); color: #ff8a80; }
.cdesc { font-size: calc(14.5px * var(--hs)); line-height: 1.25; color: #e3dcc0; }
.copt kbd { font-size: calc(15px * var(--hs)); }
.copt.picked { background: rgba(105, 240, 174, 0.14); border-color: #69f0ae; box-shadow: 0 0 18px rgba(105, 240, 174, 0.3); }
.copt.picked .lane { background: #69f0ae; }
.copt.faded { opacity: 0.35; }
/* campaign level objectives (campaign.js goalStatus): briefing / camp / run summary */
.copt.bonus { border-color: rgba(255, 213, 79, 0.7); background: rgba(255, 213, 79, 0.08); }
.ctag.bonus { background: var(--gold); color: #111; margin-left: 4px; }
.bgoal { display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; border-radius: 8px; border: 1px dashed rgba(255, 213, 79, 0.5); background: rgba(255, 213, 79, 0.06); margin: 4px 0; }
.bgoal b { color: var(--gold); letter-spacing: 0.04em; }
.bgoal span { color: var(--dim); font-size: 0.92em; }
.bgoal.done { border-style: solid; border-color: var(--gold); }
.bgoal.miss { opacity: 0.6; border-color: var(--line2); }
.bgoal.miss b { color: var(--dim); }
.ctrack span.star { background: #8d6e00; border-color: var(--gold); color: #fff59d; }
.sum-loadout { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 6px auto; font-size: 13px; }
.sum-loadout > span { color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.sum-loadout em { font-style: normal; display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 2px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.sum-loadout img { width: 20px; height: 20px; }
.sum-loadout small { color: var(--gold); }
.camp-foot { margin-top: calc(8px * var(--hs)); font-size: calc(15px * var(--hs)); color: #e8dcb0; text-align: center; border-radius: 999px; padding: 4px 10px; background: rgba(255, 255, 255, 0.04); }
.camp-foot b { color: var(--gold); }
.camp-foot.go { background: rgba(105, 240, 174, 0.14); color: #c8ffe0; animation: pulse 0.8s infinite alternate; }
.camp-foot.nudge { animation: hint-nudge 0.9s ease-out 2; }
body.camping #fh-danger, body.camping #fh-aim, body.camping #fh-checkout, body.camping #visit, body.camping #fh-key, body.camping #armory-pop, body.camping #armory-pill, body.camping #explain { display: none; }
body.camping #fh-phase { z-index: 7; }
@media (max-width: 900px) and (orientation: portrait) {
  #camp { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; position: fixed; }
  .camp-mid { order: -1; padding: 10px; }
}
/* run summary: levels cleared */
.levlog { display: grid; gap: 2px; margin: 8px auto; max-width: 620px; font-size: 14px; }
.levlog div { display: grid; grid-template-columns: 30px 1fr repeat(3, auto); gap: 8px; padding: 1px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); text-align: right; align-items: baseline; }
.levlog.two { grid-template-columns: 1fr 1fr; column-gap: 8px; max-width: 760px; font-size: 13px; }
.levlog b { color: var(--gold); text-align: left; font-family: var(--display); font-weight: 400; font-size: 17px; }
.levlog span:nth-child(2) { text-align: left; color: #fff; }
.over-logo.won { color: var(--gold); text-shadow: 0 4px 0 #3a2a00, 0 0 40px rgba(255, 213, 79, 0.55); }

/* Keyboard focus is visible (buttons, settings); mouse clicks don't show the ring. */
:focus-visible { outline: 2px solid #4fc3f7; outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
/* Reduced motion: no looping CSS animations (pulses, nudges); the canvas reads prefs.shake (0 by default here). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
