/* eotw.css — HUD + overlays for the Edge of the World demo. System fonts only. */
:root {
  --fg: #eef3f6; --dim: #9fb0bd; --acc: #ffd27a; --acc2: #ffb13b; --t0: #e8392e; --t1: #2f80ff; --t2: #9aa3a8; --ally: #4ade80; --warn: #ffb347; --bad: #ff5a4f; --ok: #6be38f;
  --panel: rgba(8, 12, 18, 0.6); --line: rgba(255, 220, 160, 0.26);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --hud: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f17; color: var(--fg); font: 14px/1.4 var(--sans); }
#stage, #stage canvas { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 0.35em; margin: 0 1px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  font: 600 12px/1.6 var(--mono); color: var(--acc); background: rgba(255, 210, 122, 0.06); text-align: center; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.k { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.s { color: var(--dim); font-size: 12px; margin-top: 10px; }
.eyebrow { font: 600 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc2); }

/* screens */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20;
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 30, 20, 0.8), rgba(0, 0, 0, 0.93)); }
.card { width: min(560px, 92vw); padding: 28px 32px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 10, 12, 0.8);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.card.wide { width: min(940px, 94vw); max-height: 94vh; overflow: auto; }
.card h1 { margin: 10px 0 4px; font-size: 34px; letter-spacing: 0.02em; font-weight: 700; }
.card .sub { color: var(--dim); }
.card .wt { font-size: 12px; opacity: 0.7; }
.card .lede { color: #d8dee4; font-size: 15px; max-width: 76ch; }
.card h3, .ctl-group h3 { margin: 14px 0 4px; font: 600 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); }
.card p { margin: 4px 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 22px; }
.progress { height: 6px; margin: 22px 0 12px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc2), var(--acc)); transition: width 0.2s; }
#start-btn { margin-top: 18px; padding: 12px 26px; font: 600 14px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: #1a1000;
  background: linear-gradient(180deg, #ffe0a0, #ffb13b); border: 0; border-radius: 8px; cursor: pointer; box-shadow: 0 6px 30px rgba(255, 177, 59, 0.35); }
#start-btn:hover { filter: brightness(1.08); }
#error pre { white-space: pre-wrap; color: var(--bad); font: 12px/1.5 var(--mono); max-height: 40vh; overflow: auto; }
.jump a { color: var(--acc); }
.ctl-row { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
.ctl-keys { min-width: 96px; white-space: nowrap; }
.ctl-keys .alt { color: var(--dim); font-size: 11px; }
.ctl-label { color: #d8dee4; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--sans); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); transform-origin: center; }
#hud-top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 14px; }
#compass { width: min(560px, 44vw); height: 48px; display: block; }
.team { width: 150px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; }
.team .name { font: 700 10px/1 var(--mono); letter-spacing: 0.18em; }
.team .num { font-size: 22px; font-weight: 700; grid-row: 1 / span 2; }
.team .held { font: 600 10px/1 var(--mono); color: var(--dim); }
.team .sbar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.team .sbar i { display: block; height: 100%; width: 0; }
.team.t0 { border-color: rgba(232, 57, 46, 0.55); } .team.t0 .name, .team.t0 .num { color: var(--t0); } .team.t0 .sbar i { background: var(--t0); }
.team.t1 { border-color: rgba(47, 128, 255, 0.55); } .team.t1 .name, .team.t1 .num { color: var(--t1); } .team.t1 .sbar i { background: var(--t1); }
#hud-time { position: absolute; top: 14px; left: 18px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
#hud-time .num { font-weight: 700; }
#hud-clock { position: absolute; top: 52px; left: 18px; padding: 4px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
#hud-clock .num { font-weight: 700; }
#feed { position: absolute; top: 14px; right: 18px; font: 600 12px/1.6 var(--mono); text-align: right; }
#feed .kf i { color: var(--dim); font-style: normal; }
.panel { position: absolute; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(3px); }
#vitals { left: 18px; bottom: 18px; min-width: 300px; }
.row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.row.big { gap: 6px; align-items: baseline; }
.row.big .num { font-size: 34px; font-weight: 700; color: #fff; }
.row.big .num + .u + .num { margin-left: 14px; }
.u { color: var(--dim); font-size: 11px; }
.bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width 0.08s linear; }
.bar i.low { background: var(--bad); }
.bar i.fuel { background: linear-gradient(90deg, #8ff0c8, #dafff0); }
.bar i.fuel.low { background: linear-gradient(90deg, #ff5a4f, #ff8a7a); }
.bar i.heat { background: linear-gradient(90deg, #ffb13b, #ff5a4f); width: 0; }
.bar i.heat.hot { filter: brightness(1.3); }
.chip { font: 600 10px/1 var(--mono); letter-spacing: 0.12em; padding: 3px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--acc); }
.chip.bad { color: var(--bad); border-color: rgba(255, 90, 79, 0.5); }
.chipk { min-width: 34px; }
.chipk.on { color: var(--acc); } .chipk.bad { color: var(--bad); }
#pos-val { margin-top: 4px; }
.intro-weapon { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; } .intro-weapon .seg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; } .intro-weapon .seg button small { font: 500 10px var(--sans); color: var(--dim); letter-spacing: 0; }
.rs-weapon { display: flex; gap: 6px; justify-content: center; margin: 8px 0 4px; } .rs-weapon span { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--dim); font-size: 11px; letter-spacing: 0.06em; } .rs-weapon span.sel { color: var(--fg); border-color: var(--acc); background: rgba(255, 210, 122, 0.12); } .rs-weapon kbd { margin-right: 4px; }
#weapon { display: flex; gap: 10px; align-items: baseline; margin-top: 2px; position: relative; } #weapon b { color: var(--fg); letter-spacing: 0.08em; font-size: 12px; } #weapon .k { font-size: 10px; } #weapon.zoomed b { color: var(--acc); }
/* BF-1009: the magazine | the spares; a quarter left turns it amber, none left red, the change fills a hairline under the row */
#wpn-ammo { font-size: 18px; letter-spacing: 0.02em; min-width: 64px; font-variant-numeric: tabular-nums; } #weapon.low #wpn-ammo { color: var(--acc); } #weapon.empty #wpn-ammo, #weapon.empty #wpn-name { color: var(--bad); }
/* BF-1213: a spare round regenerating: the count lifts for a moment */
#wpn-ammo { transition: opacity 0.2s; } #weapon.regen #wpn-ammo { opacity: 0.72; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
#wpn-reload { position: absolute; left: 0; bottom: -3px; height: 2px; width: 0; background: var(--acc); border-radius: 1px; transition: width 0.1s linear; } #weapon.reloading #wpn-name { color: var(--acc); }
/* BF-1011: a guard up reads cool, a blow taken on it flashes */
#weapon.guard #wpn-name { color: var(--ally); } #weapon.blocked #wpn-name { color: #fff; text-shadow: 0 0 8px var(--ally); }
.intro-theme { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; } .intro-theme .seg { flex-wrap: wrap; } .intro-theme .seg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; max-width: 230px; } .intro-theme .seg button small { font: 500 10px var(--sans); color: var(--dim); letter-spacing: 0; white-space: normal; text-align: left; }
#prompt { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); padding: 4px 10px; border-radius: 6px; background: rgba(10, 14, 20, 0.7); color: var(--fg); font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; pointer-events: none; }
#prompt b { color: var(--ally); font-weight: 600; }
#prompt.warn b { color: var(--warn); }
/* BF-1008: the sights at the eye — the crosshair becomes the gun's own reticle while aiming; the sniper rifle's scope is an overlay */
#crosshair.dot i { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #ff3b30; box-shadow: 0 0 6px 2px rgba(255, 59, 48, 0.55); }
#crosshair.dot::before, #crosshair.dot::after { opacity: 0.18; }
#crosshair.reflex i { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #7cff8a; box-shadow: 0 0 6px 2px rgba(124, 255, 138, 0.5); }
#crosshair.reflex::before, #crosshair.reflex::after { opacity: 0.18; }
#crosshair.iron { width: 34px; height: 14px; } #crosshair.iron i { width: 3px; height: 10px; margin: -5px 0 0 -1.5px; border-radius: 1px; background: #e8ecef; }
#crosshair.iron::before { display: none; } #crosshair.iron::after { display: none; }
#crosshair.iron { border-left: 3px solid rgba(232, 236, 239, 0.9); border-right: 3px solid rgba(232, 236, 239, 0.9); box-sizing: border-box; }
#scope { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at calc(50% + var(--ebx, 0vh)) calc(50% + var(--eby, 0vh)), rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 31vh, rgba(0, 0, 0, 0.97) 33vh, #000 100%); }
#scope .ring { position: absolute; left: 50%; top: 50%; width: 64vh; height: 64vh; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(20, 24, 28, 0.9); box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6); }
#scope .h, #scope .v { position: absolute; background: rgba(10, 12, 14, 0.95); } #scope .h { left: calc(50% - 32vh); width: 64vh; top: 50%; height: 1px; } #scope .v { top: calc(50% - 32vh); height: 64vh; left: 50%; width: 1px; }
#scope .mil { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1px solid rgba(10, 12, 14, 0.9); }
#scope .mil::before, #scope .mil::after { content: ""; position: absolute; background: rgba(10, 12, 14, 0.9); }
#scope .mil::before { left: -6px; right: -6px; top: 50%; height: 1px; } #scope .mil::after { top: -6px; bottom: -6px; left: 50%; width: 1px; }
/* BF-1221: the optics — each magnified optic's own reticle in its overlay (SVG, the aim point at the centre; the eyebox above drifts, the reticle does not), the holographic's ring, the reticle colour */
#scope .ret { position: absolute; left: 50%; top: 50%; width: 64vh; height: 64vh; transform: translate(-50%, -50%); }
#scope .ret svg { display: block; width: 100%; height: 100%; overflow: visible; }
#scope.k-chevron .h, #scope.k-chevron .v, #scope.k-chevron .mil, #scope.k-circledot .h, #scope.k-circledot .v, #scope.k-circledot .mil, #scope.k-duplex .h, #scope.k-duplex .v, #scope.k-duplex .mil { display: none; }
#crosshair.holo { width: 30px; height: 30px; border: 1.5px solid var(--ret, #ff3b30); border-radius: 50%; box-sizing: border-box; opacity: var(--reta, 0.9); }
#crosshair.holo::before, #crosshair.holo::after { display: none; }
#crosshair.holo i, #crosshair.prism i, #crosshair.lpvo i { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--ret, #ff3b30); box-shadow: 0 0 5px 1px var(--ret, #ff3b30); }
#crosshair.prism::before, #crosshair.prism::after, #crosshair.lpvo::before, #crosshair.lpvo::after { opacity: 0.18; }
#crosshair.tinted.dot i, #crosshair.tinted.reflex i { background: var(--ret); box-shadow: 0 0 6px 2px var(--ret); opacity: var(--reta, 1); }
#crosshair { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); }
#crosshair i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.8); }
#crosshair::before { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-50%); }
#crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); }
#hitmark { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; transition: opacity 0.15s; }
#hitmark::before, #hitmark::after { content: ""; position: absolute; background: #fff; }
#hitmark::before { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
#hitmark::after { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
#hitmark.on { opacity: 1; transition: none; }
#damage { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; border-radius: 50%; opacity: 0; transform: translate(-50%, -50%);
  background: conic-gradient(from -20deg, rgba(255, 90, 79, 0.75) 0deg, rgba(255, 90, 79, 0.75) 40deg, transparent 40deg); -webkit-mask: radial-gradient(circle, transparent 92px, #000 94px, #000 104px, transparent 106px); mask: radial-gradient(circle, transparent 92px, #000 94px, #000 104px, transparent 106px); }
#damage.on { opacity: 1; }
#capture { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 280px; }
#capture b { font-size: 30px; font-weight: 800; }
#capture > div { flex: 1; }
#cap-name { font-weight: 600; }
.cbar { height: 6px; margin: 4px 0; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.cbar i { display: block; height: 100%; width: 0; background: var(--t0); }
#toasts { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { padding: 6px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.toast.ok { border-color: rgba(107, 227, 143, 0.5); color: var(--ok); } .toast.bad { border-color: rgba(95, 208, 255, 0.5); color: #bfeaff; } .toast.warn { color: var(--warn); }
#help-hint { position: absolute; right: 18px; bottom: 18px; color: var(--dim); font-size: 12px; }
.card-mini { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); width: min(420px, 90vw); padding: 18px 22px; border-radius: 14px; background: rgba(10, 10, 12, 0.86); border: 1px solid var(--line); text-align: center; }
.card-mini h2 { margin: 6px 0; font-size: 26px; }
.card-mini .big { font-size: 34px; font-weight: 700; }
.rs-opt { padding: 5px 10px; margin: 3px auto; border-radius: 8px; border: 1px solid transparent; color: var(--dim); }
.rs-opt.sel { border-color: var(--acc); color: var(--fg); background: rgba(255, 210, 122, 0.08); }

/* Tab help */
.overlay-panel { position: fixed; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.help-card { width: min(900px, 94vw); padding: 18px 24px; border-radius: 14px; background: rgba(10, 10, 12, 0.88); border: 1px solid var(--line); }

/* Esc menu */
.screen.menu { background: rgba(4, 6, 10, 0.72); }
.menu-card { display: grid; grid-template-columns: 230px 1fr; width: min(980px, 94vw); max-height: 90vh; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(10, 10, 12, 0.92); }
.menu-side { padding: 24px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.menu-side h1 { margin: 0; font-size: 28px; }
.menu-where { color: var(--dim); font: 12px var(--mono); }
.menu-tabs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.menu-tab { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--dim); font: 600 13px var(--sans); cursor: pointer; }
.menu-tab.on, .menu-tab:focus { color: var(--fg); border-color: var(--line); background: rgba(255, 210, 122, 0.06); outline: none; }
.menu-main { padding: 22px 26px; overflow: auto; }
.menu-pane h2 { margin: 0 0 12px; font-size: 20px; }
.menu-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.btn { display: inline-block; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--fg); font: 600 13px var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn.primary { color: #1a1000; background: linear-gradient(180deg, #ffe0a0, #ffb13b); border-color: transparent; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.opt-label b { display: block; }
.opt-label .s { margin: 0; }
.opt-ctl { display: flex; align-items: center; gap: 8px; }
.opt-ctl input[type=range] { width: 180px; accent-color: var(--acc2); }
.opt-val { min-width: 48px; text-align: right; font: 12px var(--mono); color: var(--dim); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 6px 12px; border: 0; background: none; color: var(--dim); font: 600 12px var(--sans); cursor: pointer; }
.seg button.on { background: rgba(255, 210, 122, 0.14); color: var(--fg); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: rgba(255, 255, 255, 0.15); transition: 0.15s; }
.switch i::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: 0.15s; }
.switch input:checked + i { background: var(--acc2); }
.switch input:checked + i::before { transform: translateX(18px); }
#resume-hint { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 11; padding: 10px 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: 600 13px var(--sans); cursor: pointer; }
body.menu-open #hud { filter: blur(2px); }

/* §4.10: who sits where (a person or a bot), the online chip, the name field, the bot tags */
.team .who { grid-column: 1 / -1; font: 600 10px/1.2 var(--mono); color: var(--fg); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .who .tag, #feed .tag, .rs-opt .tag, .round-who .tag { font: 700 8px/1 var(--mono); letter-spacing: 0.12em; padding: 2px 4px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); margin-left: 4px; vertical-align: middle; }
.team .who .tag.bot, #feed .tag.bot, .rs-opt .tag.bot { color: #ffb347; border-color: rgba(255, 179, 71, 0.5); }
.team .who .tag.you, .rs-opt .tag.you { color: var(--acc2, #4ade80); border-color: rgba(74, 222, 128, 0.5); }
#hud-time { flex-wrap: wrap; max-width: 170px; }
#net-chip { flex-basis: 100%; margin-top: 4px; text-align: center; } #net-chip.on { color: #4ade80; border-color: rgba(74, 222, 128, 0.5); } #net-chip.wait { color: #ffb347; border-color: rgba(255, 179, 71, 0.5); }
.intro-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.intro-name input, .opt-text { font: 500 14px var(--sans); color: var(--fg); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 200px; outline: none; }
.intro-name input:focus, .opt-text:focus { border-color: var(--acc); }
.intro-online { margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); font: 500 13px/1.5 var(--sans); }
.intro-online.on { border-color: rgba(74, 222, 128, 0.5); } .intro-online.wait { border-color: rgba(255, 179, 71, 0.5); } .intro-online.off { border-color: rgba(255, 90, 79, 0.4); }
.intro-online code, #round-hint code, #menu-online code { font: 500 12px var(--mono); color: var(--acc); user-select: all; }
#round-list .rs-opt { display: flex; gap: 8px; align-items: center; justify-content: center; }
/* the scoreboard (Tab held) */
.sb-card { min-width: min(760px, 92vw); }
.sb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.sb-side { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.sb-side.t0 { border-color: rgba(232, 57, 46, 0.45); } .sb-side.t1 { border-color: rgba(47, 128, 255, 0.45); }
.sb-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; } .sb-head b { font: 700 11px/1 var(--mono); letter-spacing: 0.18em; } .sb-head .num { font-size: 20px; font-weight: 700; }
table.sb { width: 100%; border-collapse: collapse; font: 500 13px/1.4 var(--sans); } table.sb th { text-align: left; font: 600 9px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.sb td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); } table.sb td.num { text-align: right; font-weight: 700; } table.sb tr.you td { background: rgba(255, 210, 122, 0.06); } table.sb tr.down td { color: var(--dim); }
table.sb .tag { font: 700 8px/1 var(--mono); letter-spacing: 0.12em; padding: 2px 4px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); margin-left: 5px; vertical-align: middle; } table.sb .tag.bot { color: #ffb347; border-color: rgba(255, 179, 71, 0.5); } table.sb .tag.you { color: #4ade80; border-color: rgba(74, 222, 128, 0.5); }
.sb-foot { margin-top: 10px; }

/* BF-1206: the online lobby (before and after a match) and the chat (in the lobby, and over the match) */
.screen.lobby { background: rgba(4, 6, 10, 0.62); z-index: 22; }
.lobby-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; }
.lobby-main h1 { margin: 6px 0 4px; }
.lobby-h { margin: 16px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.lobby-note { color: var(--acc2); letter-spacing: 0.06em; text-transform: none; font-weight: 500; }
.lobby-people { display: flex; flex-direction: column; gap: 6px; }
.lp { display: grid; grid-template-columns: 10px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.lp i { grid-row: 1 / span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--t2); }
.lp b { font-weight: 600; } .lp .s { grid-column: 2; margin: 0; }
.lp em { grid-column: 3; grid-row: 1 / span 2; font: 600 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; font-style: normal; color: var(--warn); }
.lp.ready { border-color: rgba(74, 222, 128, 0.5); } .lp.ready em { color: var(--ok); }
.lp.empty { opacity: 0.6; border-style: dashed; } .lp.empty i { background: none; border: 1px dashed var(--dim); }
#lobby-share code { font: 500 12px var(--mono); color: var(--acc); user-select: all; }
.lobby-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.lobby-row > .k { min-width: 92px; }
.lobby-inline { margin: 0; }
.seg button:disabled { cursor: default; opacity: 0.55; } .seg button.on:disabled { opacity: 1; }
.seg button small { display: block; font-weight: 500; color: var(--dim); font-size: 10px; }
#lobby-mode button.voted { box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.55); } /* BF-1297: your vote for the next mode */
.lobby-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.lobby-actions button, .chat-form button { padding: 10px 22px; font: 600 13px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: #1a1000; background: var(--acc); border: 0; border-radius: 10px; cursor: pointer; }
.lobby-actions button.ghost { background: none; color: var(--fg); border: 1px solid var(--line); }
.lobby-actions .s { margin: 0; }
.lobby-chat { display: flex; flex-direction: column; min-height: 0; }
.lobby-chat .chat-log { flex: 1; min-height: 260px; max-height: 56vh; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.chat-log .cl { font: 500 13px/1.45 var(--sans); padding: 1px 0; overflow-wrap: anywhere; }
.chat-log .cl b { font-weight: 700; margin-right: 4px; }
.chat-log .cl.sys { color: var(--dim); font-style: italic; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input, #chat-line { flex: 1; font: 500 14px var(--sans); color: var(--fg); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
.chat-form input:focus, #chat-line:focus { border-color: var(--acc); }
.chat-form button { padding: 8px 16px; }
/* the match's feed: inside #vitals, just above it; lines fade, Enter opens the line */
.chat { position: absolute; left: 0; bottom: calc(100% + 10px); width: min(440px, 60vw); display: flex; flex-direction: column; gap: 6px; }
.chat .chat-log { display: flex; flex-direction: column; gap: 2px; }
.chat .cl { background: rgba(8, 12, 18, 0.55); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.chat.open { pointer-events: auto; } .chat.open .chat-log { max-height: 40vh; overflow-y: auto; }
.chat.empty .chat-log { display: none; }
@media (max-width: 760px) { .lobby-card { grid-template-columns: 1fr; } .lobby-chat .chat-log { min-height: 160px; } }
#chat-line { background: rgba(8, 12, 18, 0.82); pointer-events: auto; }
/* BF-1228: the gunsmith */
.intro-gunsmith { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.intro-gunsmith .s { margin-top: 0; max-width: 560px; }
.screen.gunsmith { background: rgba(4, 6, 10, 0.82); z-index: 24; }
body.gunsmith-open #hud { filter: blur(2px); }
.gs-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1600px, 94vw); height: min(1000px, 92vh); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(10, 10, 12, 0.94); }
.gs-head { display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.gs-head h1 { margin: 2px 0 0; font-size: 24px; }
.gs-guns { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; justify-content: center; }
.gs-gun { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 14px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--dim); font: 600 13px var(--sans); cursor: pointer; text-align: left; }
.gs-gun small { font: 500 10px var(--sans); letter-spacing: 0; color: var(--dim); }
.gs-gun.on { color: var(--fg); border-color: var(--line); background: rgba(255, 210, 122, 0.08); }
.gs-gun:focus-visible, .gs-slots:focus-visible, .gs-canvas:focus-visible, .btn:focus-visible, .gs-opt:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.gs-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr) minmax(250px, 0.85fr); min-height: 0; }
.gs-body h2 { margin: 0 0 8px; font: 700 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); }
.gs-body h2 .s { text-transform: none; letter-spacing: 0; font: 500 11px var(--sans); margin: 0 0 0 6px; }
.gs-view { display: flex; flex-direction: column; min-height: 0; padding: 12px; border-right: 1px solid var(--line); }
.gs-canvas, .gs-nogl { flex: 1; min-height: 160px; width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #161b22; cursor: grab; touch-action: none; }
.gs-canvas:active { cursor: grabbing; }
.gs-nogl { display: flex; align-items: center; justify-content: center; color: var(--dim); }
.gs-viewtools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; } .gs-viewtools .s { margin: 0; }
.gs-code { margin-top: 4px; } .gs-code code { font: 500 12px var(--mono); color: var(--acc); }
.btn.small { padding: 5px 10px; font-size: 12px; } .btn.dim { opacity: 0.72; } .btn:disabled { opacity: 0.45; cursor: default; }
.gs-slots-wrap, .gs-side { display: flex; flex-direction: column; min-height: 0; padding: 12px 14px; overflow: hidden; } .gs-side { border-left: 1px solid var(--line); }
.gs-slots { flex: 1; overflow-y: auto; border-radius: 10px; padding-right: 4px; }
.gs-slot { border: 1px solid transparent; border-radius: 10px; padding: 6px 10px; margin-bottom: 4px; cursor: pointer; }
.gs-slot:hover { background: rgba(255, 255, 255, 0.03); } .gs-slot.cur { border-color: var(--acc); background: rgba(255, 210, 122, 0.06); } .gs-slot.fixed:not(.cur) { opacity: 0.6; }
.gs-slot-head { display: flex; align-items: baseline; gap: 10px; } .gs-slot-name { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); min-width: 92px; } .gs-slot-cur { flex: 1; font-weight: 600; }
.gs-badge { font: 700 8px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--acc); color: var(--acc); } .gs-badge.dim { border-color: var(--line); color: var(--dim); }
.gs-opts { display: grid; gap: 4px; margin: 8px 0 4px; }
.gs-opt { display: grid; grid-template-columns: 1fr; gap: 2px; text-align: left; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--fg); font: 500 13px var(--sans); cursor: pointer; }
.gs-opt:hover { background: rgba(255, 255, 255, 0.07); } .gs-opt.on { border-color: var(--acc); background: rgba(255, 210, 122, 0.12); }
.gs-opt b i { font: 700 8px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-left: 4px; font-style: normal; }
.gs-opt small { font-size: 11px; color: var(--dim); } .gs-opt .good, .gs-dl .good { color: var(--ok); } .gs-opt .bad, .gs-dl .bad { color: var(--bad); }
.gs-opt.off { cursor: not-allowed; color: var(--dim); border-style: dashed; background: none; } .gs-opt.off:hover { background: none; }
.gs-opt .why { font: 500 11px/1.35 var(--sans); font-style: normal; color: var(--warn); }
.gs-bars { display: grid; gap: 7px; }
.gs-stat { display: grid; grid-template-columns: 78px 1fr 62px 58px; align-items: center; gap: 8px; font-size: 12px; }
.gs-stat-l { color: var(--dim); } .gs-stat .num { text-align: right; } .gs-d { font: 600 11px var(--mono); text-align: right; color: var(--dim); } .gs-d.good { color: var(--ok); } .gs-d.bad { color: var(--bad); }
.gs-track { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.gs-track i { position: absolute; top: 0; bottom: 0; } .gs-track .fill { left: 0; background: var(--dim); opacity: 0.8; } .gs-track .seg.good { background: var(--ok); } .gs-track .seg.bad { background: var(--bad); } .gs-track .seg.even { background: var(--acc); }
.gs-track .mark { width: 1px; background: rgba(255, 255, 255, 0.45); }
.gs-tip { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); min-height: 92px; overflow: auto; }
.gs-tip h3 { margin: 4px 0 2px; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--fg); } .gs-tip .s { margin: 2px 0; }
.gs-dl { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; font: 600 12px var(--mono); } .gs-why { margin: 6px 0 0; color: var(--warn); font-size: 12px; }
.gs-foot { display: grid; gap: 8px; padding: 10px 20px 12px; border-top: 1px solid var(--line); }
.gs-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .gs-row .k { min-width: 74px; }
.gs-chip { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; } .gs-chip.on { border-color: var(--acc); }
.gs-chip button { padding: 5px 10px; border: 0; background: rgba(255, 255, 255, 0.04); color: var(--fg); font: 600 12px var(--sans); cursor: pointer; } .gs-chip button:hover { background: rgba(255, 255, 255, 0.1); } .gs-chip .x { color: var(--dim); padding: 5px 8px; border-left: 1px solid var(--line); }
.gs-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; } .gs-chips .s { margin: 0; }
.gs-customs input { font: 500 13px var(--sans); color: var(--fg); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; width: 160px; outline: none; } .gs-customs input:focus { border-color: var(--acc); }
.gs-presets .btn.on { border-color: var(--acc); background: rgba(255, 210, 122, 0.12); }
.gs-actions { justify-content: flex-end; flex-wrap: nowrap; } .gs-actions .btn { flex: none; white-space: nowrap; }
/* BB-287: a long status (an auto-fit) takes two lines at most beside the buttons, never under them; the whole text is its title */
.gs-status { flex: 1 1 auto; min-width: 0; margin: 0; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; } .gs-status.ok { color: var(--ok); } .gs-status.bad { color: var(--warn); } .gs-status.fix { color: var(--acc); }
/* BF-1258: a pick that needed other slots changed: the changed rows are marked, the option says what comes with it */
.gs-slot.autofix:not(.cur) { border-color: rgba(255, 210, 122, 0.45); } .gs-badge.fix { border-style: dashed; }
.gs-opt .gs-fixnote { color: var(--acc); } .gs-fixtip { margin: 6px 0 0; color: var(--acc); font-size: 12px; }
.gs-keys { margin: 0; line-height: 1.9; }
/* BB-287: the layouts (gunsmith.js relayout -> #gunsmith[data-layout], from gunsmith-core layoutFor). 'wide': the three columns above.
   'compact' (under 1000 x 680, e.g. 960 x 540): the parts stay on the right; the preview and the stats share the left pane as tabs
   (V / R3 / click); a slimmer head and a two-row footer. 'narrow' (under 720 wide): one pane, three tabs. Nothing overlaps: each
   panel owns its grid cell and scrolls inside it. */
.gs-tabs { display: none; } .gs-hide { display: none !important; }
#gunsmith[data-layout="wide"] .gs-opts { max-height: 240px; overflow-y: auto; padding-right: 2px; }   /* a long option list (the rifle optic) scrolls in itself, so the other slots stay in sight */
@media (max-height: 860px) { #gunsmith[data-layout="wide"] .gs-opts { max-height: 156px; } }   /* 720p / 768p / 800p: the open slot and two more stay whole */
.gs-tab { padding: 6px 14px; border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: 0; background: none; color: var(--dim); font: 700 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.gs-tab:hover { color: var(--fg); } .gs-tab.on { color: var(--acc); border-color: var(--line); background: rgba(255, 210, 122, 0.06); } .gs-tab:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.gs-tabkey { margin: 0 0 0 auto; align-self: center; font-size: 11px; } .gs-tabkey kbd { font-size: 10px; }
#gunsmith:not([data-layout="wide"]) .gs-card { width: min(1280px, 98vw); height: min(820px, 97vh); border-radius: 12px; }
#gunsmith:not([data-layout="wide"]) .gs-head { padding: 7px 14px; gap: 12px; }
#gunsmith:not([data-layout="wide"]) .gs-head .eyebrow { display: none; } #gunsmith:not([data-layout="wide"]) .gs-head h1 { margin: 0; font-size: 18px; }
#gunsmith:not([data-layout="wide"]) .gs-gun { padding: 4px 10px; }
#gunsmith:not([data-layout="wide"]) .gs-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); grid-area: tabs; }
#gunsmith:not([data-layout="wide"]) .gs-view, #gunsmith:not([data-layout="wide"]) .gs-side { grid-area: pane; border: 0; padding: 10px 12px; }
#gunsmith:not([data-layout="wide"]) .gs-side { overflow-y: auto; }
#gunsmith:not([data-layout="wide"]) .gs-canvas { min-height: 120px; }
#gunsmith:not([data-layout="wide"]) .gs-code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gunsmith:not([data-layout="wide"]) .gs-tip { margin-top: 10px; min-height: 0; }
#gunsmith:not([data-layout="wide"]) .gs-slots-wrap { grid-area: parts; padding: 10px 12px; }
#gunsmith:not([data-layout="wide"]) .gs-slot { padding: 5px 9px; margin-bottom: 3px; }
#gunsmith:not([data-layout="wide"]) .gs-slot-name { min-width: 78px; }
#gunsmith:not([data-layout="wide"]) .gs-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 164px; overflow-y: auto; margin: 6px 0 2px; padding-right: 2px; }
#gunsmith:not([data-layout="wide"]) .gs-opt { padding: 5px 8px; font-size: 12px; align-content: start; }
#gunsmith:not([data-layout="wide"]) .gs-foot { grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; padding: 8px 14px 10px; }
#gunsmith:not([data-layout="wide"]) .gs-actions { grid-column: 1 / -1; } #gunsmith:not([data-layout="wide"]) .gs-keys { display: none; }
#gunsmith:not([data-layout="wide"]) .gs-row .k { min-width: 0; } #gunsmith:not([data-layout="wide"]) .gs-chips > .s { display: none; }
#gunsmith:not([data-layout="wide"]) .gs-customs input { width: 140px; }
#gunsmith[data-layout="compact"] .gs-body { grid-template-columns: minmax(0, 1.08fr) minmax(330px, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "tabs parts" "pane parts"; }
#gunsmith[data-layout="compact"] .gs-slots-wrap { border-left: 1px solid var(--line); }
#gunsmith[data-layout="narrow"] .gs-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "tabs" "pane"; }
#gunsmith[data-layout="narrow"] .gs-slots-wrap { grid-area: pane; } #gunsmith[data-layout="narrow"] .gs-slots-wrap > h2 { display: none; }
#gunsmith[data-layout="narrow"] .gs-head { flex-wrap: wrap; } #gunsmith[data-layout="narrow"] .gs-guns { order: 3; flex-basis: 100%; justify-content: flex-start; }
#gunsmith[data-layout="narrow"] .gs-foot { grid-template-columns: minmax(0, 1fr); } #gunsmith[data-layout="narrow"] .gs-actions { flex-wrap: wrap; } #gunsmith[data-layout="narrow"] .gs-status { flex-basis: 100%; }
#gunsmith[data-layout="narrow"] .gs-opts { grid-template-columns: minmax(0, 1fr); }
