/* ONSA game HUD — floating glass, neon edges, ONSA lime + cyan */
:root {
  --glass: rgba(9, 24, 28, .68);
  --glass-hi: rgba(14, 34, 38, .82);
  --panel: #0b1d21;          /* solid surfaces (drawer, modal) */
  --panel-2: #10282d;
  --panel-3: #163539;
  --line: rgba(160, 220, 210, .16);
  --edge: rgba(200, 238, 58, .35);
  --text: #f4f7f2;
  --muted: #9cb5b1;
  --lime: #c8ee3a;
  --lime-ink: #0e3b36;
  --cyan: #39e6ff;
  --mint: var(--lime);        /* kept for inline styles in game.js */
  --mint-ink: var(--lime-ink);
  --red: #ff4d6a;
  --amber: #ffc23d;
  --blue: var(--cyan);
  --r: 16px;
  --shadow: 0 10px 30px rgba(0, 10, 14, .45);
  --glow: 0 0 0 1px var(--edge), 0 0 18px rgba(200, 238, 58, .12);
  --head: 'Chakra Petch', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1d21; color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
small { font-family: var(--head); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; }
#scene canvas { display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.25); -webkit-backdrop-filter: blur(14px) saturate(1.25); border-radius: var(--r); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.card { background: var(--glass-hi); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--r); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }

/* ---------- top-left: operator + resources ---------- */
.hud-left { position: fixed; top: 14px; left: 14px; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.operator { display: flex; align-items: center; gap: 11px; padding: 8px 14px 8px 8px; min-width: 210px; cursor: pointer; }
.avatar { position: relative; width: 46px; height: 46px; flex: none; }
.avatar img { width: 46px; height: 46px; display: block; border-radius: 12px; box-shadow: 0 0 0 2px var(--lime), 0 0 16px rgba(200, 238, 58, .45); }
.avatar .lvl { position: absolute; right: -6px; bottom: -6px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); font-family: var(--head); font-weight: 700; font-size: 11px; display: grid; place-items: center; box-shadow: 0 0 0 2px #0b1d21; }
.op-info { min-width: 0; flex: 1; }
.op-info b { display: block; font-family: var(--head); font-size: 15px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.op-info small { display: block; color: var(--lime); font-size: 9.5px; margin-top: 1px; }
.xp { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); margin-top: 6px; overflow: hidden; }
.xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--lime)); box-shadow: 0 0 8px var(--lime); transition: width .5s; }

.resources { display: flex; align-items: center; gap: 4px; padding: 6px; }
.res { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 6px; border-radius: 12px; }
.res + .res { border-left: 1px solid var(--line); border-radius: 0; }
.res b { display: block; font-family: var(--head); font-size: 17px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.res small { display: block; font-size: 9px; }
.r-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; flex: none; }
.r-ic.coin { background: radial-gradient(circle at 30% 30%, #fff4b8, var(--amber) 55%, #b37a00); color: #4a3200; box-shadow: 0 0 14px rgba(255, 194, 61, .45); }
.r-ic.coin .ic { width: 20px; height: 20px; }
.r-ic.shield { width: 34px; height: 38px; background: linear-gradient(160deg, var(--cyan), #138aa3); clip-path: polygon(50% 0, 100% 16%, 100% 58%, 50% 100%, 0 58%, 0 16%); color: #032830; }
.r-ic.shield b { font-size: 16px; }
#sec b:not(#sl) { font-size: 14px; }
#rel b { font-size: 14px; }
.ring { position: relative; width: 38px; height: 38px; flex: none; }
.ring svg { width: 38px; height: 38px; transform: rotate(-90deg); filter: drop-shadow(0 0 4px rgba(200, 238, 58, .5)); }
.ring circle { fill: none; stroke-width: 3.6; }
.ring .bg { stroke: rgba(255, 255, 255, .12); }
.ring .fg { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 80 100; transition: stroke-dasharray .4s, stroke .4s; }
.ring > span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-size: 12px; font-weight: 700; }

/* ---------- top-centre: threat meter ---------- */
.threat { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 10px; }
.t-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--lime); background: rgba(200, 238, 58, .12); box-shadow: inset 0 0 0 1px var(--edge); }
.t-ic .ic { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.t-body small { display: block; font-size: 9px; }
.t-bar { display: flex; gap: 4px; margin-top: 5px; }
.t-bar i { width: 26px; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, .1); transform: skewX(-20deg); }
.threat b { font-family: var(--head); font-size: 15px; font-weight: 700; min-width: 76px; }
.threat[data-level="guarded"] .t-bar i:nth-child(-n+1) { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.threat[data-level="guarded"] b { color: var(--lime); }
.threat[data-level="elevated"] .t-bar i:nth-child(-n+2) { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.threat[data-level="elevated"] b, .threat[data-level="elevated"] .t-ic { color: var(--amber); }
.threat[data-level="high"] .t-bar i:nth-child(-n+3), .threat[data-level="active"] .t-bar i { background: var(--red); box-shadow: 0 0 8px var(--red); }
.threat[data-level="high"] b, .threat[data-level="active"] b, .threat[data-level="high"] .t-ic, .threat[data-level="active"] .t-ic { color: var(--red); }
.threat[data-level="active"] { display: none; }   /* the alarm banner takes its place */

/* ---------- alarm banner ---------- */
#banner { position: fixed; top: 14px; left: 410px; right: 470px; z-index: 6; display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 12px; border-radius: var(--r); color: #fff; background: linear-gradient(90deg, rgba(120, 10, 34, .92), rgba(200, 30, 60, .92)); box-shadow: 0 0 0 1px rgba(255, 77, 106, .8), 0 0 30px rgba(255, 77, 106, .45), var(--shadow); animation: alarm 1.6s ease-in-out infinite; }
@keyframes alarm { 50% { box-shadow: 0 0 0 1px rgba(255, 77, 106, 1), 0 0 44px rgba(255, 77, 106, .7), var(--shadow); } }
#banner .b-ic { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; }
#banner .b-tx { flex: 1; min-width: 0; }
#banner small { color: rgba(255, 255, 255, .85); font-size: 9.5px; }
#banner b { display: block; font-family: var(--head); font-size: 16px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#banner .b-sub { display: block; font-size: 11.5px; opacity: .9; font-weight: 500; }
#banner .decide { background: rgba(0, 0, 0, .28); border-radius: 12px; padding: 5px 12px; text-align: center; flex: none; }
#banner .decide b { font-family: var(--mono); font-size: 21px; }
#banner.urgent .decide { background: #fff; color: #b0122f; }
#banner.urgent .decide small { color: #b0122f; }

/* ---------- top-right: clock & settings ---------- */
.hud-right { position: fixed; top: 14px; right: 14px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; }
.clk { text-align: right; }
.clk small { display: block; font-size: 9px; }
.clk b { display: block; font-family: var(--head); font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(57, 230, 255, .35); }
.clk em { display: block; font-style: normal; font-family: var(--head); font-size: 9px; color: var(--amber); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.speeds { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.speeds button { width: 32px; height: 28px; border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.speeds button .ic { width: 14px; height: 14px; }
.speeds button:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.speeds button.on { background: var(--lime); color: var(--lime-ink); box-shadow: 0 0 12px rgba(200, 238, 58, .5); }
.settings { display: flex; gap: 3px; padding-left: 10px; border-left: 1px solid var(--line); }
.settings button { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #d6e4e1; }
.settings button .ic { width: 16px; height: 16px; }
.settings button:hover { background: rgba(255, 255, 255, .08); }
.settings button.on { color: var(--lime); background: rgba(200, 238, 58, .12); }
.settings button.txt { font-family: var(--head); font-size: 11px; font-weight: 700; }
.settings button.img { padding: 3px; }
.settings button.img img { width: 100%; height: 100%; border-radius: 8px; display: block; }
.more, .phone-only { display: none !important; }

/* ---------- right: camera bar ---------- */
.camera { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 3px; padding: 6px; }
.camera button { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #d6e4e1; transition: background .15s, color .15s; }
.camera button:hover { background: rgba(255, 255, 255, .09); color: var(--text); }
.camera button.on { background: var(--lime); color: var(--lime-ink); }
.camera button.txt { font-family: var(--head); font-size: 11px; font-weight: 700; }
.camera button.img { padding: 4px; }
.camera button.img img { width: 100%; height: 100%; border-radius: 9px; display: block; }
.camera .sep { height: 1px; margin: 3px 6px; background: var(--line); }

/* ---------- bottom: action dock ---------- */
.dock { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 6px; padding: 8px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(14px) saturate(1.25); -webkit-backdrop-filter: blur(14px) saturate(1.25); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.dock button { position: relative; width: 70px; padding: 9px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: var(--head); font-size: 11px; font-weight: 600; letter-spacing: .03em; color: #cfdeda; clip-path: var(--cut); background: rgba(255, 255, 255, .04); transition: background .15s, color .15s, transform .15s; }
.dock button .ic { width: 22px; height: 22px; }
.dock button:hover { background: rgba(200, 238, 58, .12); color: var(--text); transform: translateY(-2px); }
.dock button.on { background: var(--lime); color: var(--lime-ink); }
.dock .count { position: absolute; top: 4px; right: 10px; background: var(--red); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; box-shadow: 0 0 10px rgba(255, 77, 106, .7); }
.dock .dot { position: absolute; top: 6px; right: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.corner-logo { position: fixed; left: 16px; bottom: 18px; z-index: 3; height: 22px; width: auto; opacity: .85; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); pointer-events: none; }

/* ---------- map labels & pins ---------- */
.label { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 12px; background: rgba(8, 22, 26, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px var(--line), 0 4px 14px rgba(0, 0, 0, .3); white-space: nowrap; will-change: transform; transition: background .2s, box-shadow .2s; }
.label:hover { background: rgba(16, 40, 45, .92); box-shadow: inset 0 0 0 1px var(--edge), 0 0 16px rgba(200, 238, 58, .2); }
.label .l-ic { width: 24px; height: 24px; border-radius: 8px; background: rgba(200, 238, 58, .14); color: var(--lime); display: grid; place-items: center; }
.label .l-ic .ic { width: 13px; height: 13px; }
.label b { display: block; font-family: var(--head); font-size: 12px; font-weight: 700; line-height: 1.1; text-align: left; }
.label small { display: block; font-family: 'Inter', sans-serif; font-size: 9.5px; letter-spacing: 0; text-transform: none; font-weight: 500; text-align: left; }
.label.alert { background: rgba(70, 8, 22, .92); box-shadow: inset 0 0 0 1px var(--red), 0 0 18px rgba(255, 77, 106, .45); }
.label.alert .l-ic { background: var(--red); color: #fff; }
.label.alert small, .label.off small { color: #ff9aac; }
.label.off .l-ic { background: rgba(255, 77, 106, .18); color: var(--red); }
.label.ok small { color: var(--lime); }
.label.warn small { color: var(--amber); }

.pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 4px; background: var(--red); color: #fff; font-family: var(--head); font-weight: 700; font-size: 12px; padding: 5px 9px; border-radius: 10px; box-shadow: 0 0 0 3px rgba(255, 77, 106, .3), 0 0 18px rgba(255, 77, 106, .6); will-change: transform; animation: pinpulse 1.4s ease-in-out infinite; }
@keyframes pinpulse { 50% { box-shadow: 0 0 0 6px rgba(255, 77, 106, .12), 0 0 24px rgba(255, 77, 106, .8); } }
.pin::after { content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--red); border-bottom: 0; }
.pin .ic { width: 13px; height: 13px; }
.pin.done { background: var(--lime); color: var(--lime-ink); animation: none; box-shadow: 0 0 14px rgba(200, 238, 58, .5); }
.pin.done::after { border-top-color: var(--lime); }

.me { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; text-align: center; background: var(--lime); color: var(--lime-ink); border-radius: 9px; padding: 2px 9px 3px; box-shadow: 0 0 14px rgba(200, 238, 58, .5); will-change: transform; }
.me b { display: block; font-family: var(--head); font-size: 11px; font-weight: 700; line-height: 1.1; }
.me small { display: block; font-family: 'Inter', sans-serif; font-size: 8.5px; letter-spacing: .02em; text-transform: none; color: var(--lime-ink); opacity: .8; }
.me::after { content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); border: 4px solid transparent; border-top-color: var(--lime); border-bottom: 0; }
.me.npc { background: var(--cyan); color: #04262e; box-shadow: 0 0 14px rgba(57, 230, 255, .5); }
.me.npc small { color: #04262e; }
.me.npc::after { border-top-color: var(--cyan); }
.me.mate { background: #f4f7f2; color: #0b1d21; cursor: default; box-shadow: 0 0 12px rgba(255, 255, 255, .35); }
.me.mate small { color: #0b1d21; }
.me.mate::after { border-top-color: #f4f7f2; }
.itag { position: absolute; left: 0; top: 0; pointer-events: auto; font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--text); background: rgba(8, 22, 26, .86); border-radius: 5px; padding: 1px 5px; white-space: nowrap; will-change: transform; }
.itag:hover { background: var(--lime); color: var(--lime-ink); }
.itag.hp { pointer-events: none; background: var(--amber); color: #2a1d02; font-family: var(--head); font-weight: 700; }
.itag.line { pointer-events: none; font-family: var(--head); font-weight: 700; font-size: 10px; background: rgba(57, 230, 255, .9); color: #04262e; }

/* ---------- side panel ---------- */
#sheet { position: fixed; left: 14px; top: 150px; bottom: 100px; width: 372px; z-index: 7; background: rgba(11, 29, 33, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 20px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); display: flex; flex-direction: column; animation: slidein .2s ease-out; overflow: hidden; }
#sheet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--lime), var(--cyan)); }
#sheet.danger { box-shadow: var(--shadow), inset 0 0 0 1px var(--red), 0 0 26px rgba(255, 77, 106, .35); }
#sheet.danger::before { background: var(--red); }
@keyframes slidein { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
#sheet header { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 16px 10px; }
#sheet h2 { margin: 3px 0 0; font-family: var(--head); font-size: 23px; font-weight: 700; }
#sheet .x { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: rgba(255, 255, 255, .05); }
#sheet .x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.sheet-body { overflow-y: auto; padding: 0 14px 16px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sheet-body p { color: #d3e0dc; font-size: 13px; line-height: 1.5; margin: 0 0 10px; }
.sec { margin: 16px 2px 8px; }

.box { background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 12px; margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 10.5px; font-weight: 600; background: rgba(255, 255, 255, .08); color: #d3e0dc; }
.pill.ok { background: rgba(200, 238, 58, .14); color: var(--lime); }
.pill.warn { background: rgba(255, 194, 61, .15); color: var(--amber); }
.pill.bad { background: rgba(255, 77, 106, .16); color: #ff9aac; }
.pill .ic { width: 11px; height: 11px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: .02em; background: rgba(255, 255, 255, .07); color: var(--text); clip-path: var(--cut); transition: background .15s, filter .15s, transform .1s; }
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .13); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(90deg, var(--lime), #a7e34a); color: var(--lime-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(90deg, var(--lime), #a7e34a); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn .ic { width: 15px; height: 15px; }

/* asset list */
.alist button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 13px; background: rgba(255, 255, 255, .04); margin-bottom: 6px; box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, box-shadow .15s; }
.alist button:hover { background: rgba(200, 238, 58, .08); box-shadow: inset 0 0 0 1px var(--edge); }
.a-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(200, 238, 58, .12); color: var(--lime); display: grid; place-items: center; flex: none; }
.alist b { display: block; font-family: var(--head); font-size: 14px; font-weight: 700; }
.alist .st { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.alist .st.alert, .alist .st.off { color: #ff9aac; }
.alist .st.ok { color: var(--lime); }

/* upgrades */
.ctl { background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 12px; margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.ctl.owned { box-shadow: inset 0 0 0 1px var(--edge), 0 0 16px rgba(200, 238, 58, .12); }
.ctl h4 { margin: 0; font-family: var(--head); font-size: 15px; font-weight: 700; }
.ctl p { font-size: 12.5px; margin: 6px 0; }
.ctl .eff { font-size: 12px; color: var(--lime); font-weight: 600; }
.ctl .ref { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.price { font-family: var(--head); font-weight: 700; font-size: 16px; color: var(--amber); }

/* purdue */
.purdue .lvl { display: flex; gap: 10px; align-items: stretch; margin-bottom: 5px; }
.purdue .lvl small { width: 92px; flex: none; padding-top: 9px; text-transform: none; letter-spacing: 0; font-size: 11px; }
.purdue .zone { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; background: rgba(255, 255, 255, .03); border-radius: 12px; padding: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.purdue .zone button { background: rgba(255, 255, 255, .07); border-radius: 9px; padding: 5px 9px; font-size: 12px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.purdue .zone button:hover { background: rgba(200, 238, 58, .15); }
.purdue .zone .ic { width: 13px; height: 13px; }

/* detections */
.filters { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.filters button { border-radius: 999px; padding: 4px 11px; font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); }
.filters button.on { background: var(--cyan); color: #04262e; }
.clue { background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 11px; margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.clue.tagged { background: rgba(255, 77, 106, .1); box-shadow: inset 0 0 0 1px rgba(255, 77, 106, .7); }
.clue.benign { background: rgba(200, 238, 58, .07); box-shadow: inset 0 0 0 1px var(--edge); }
.clue-h { display: flex; justify-content: space-between; gap: 8px; font-family: var(--head); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.clue pre { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin: 7px 0 8px; color: #e9f4f0; background: rgba(0, 0, 0, .3); border-radius: 9px; padding: 8px 9px; }
.cchips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.cchip { font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 2px 7px; background: rgba(255, 194, 61, .15); color: var(--amber); }
.cchip.ok { background: rgba(200, 238, 58, .14); color: var(--lime); }
.btn-tag { display: inline-flex; gap: 6px; align-items: center; border-radius: 10px; padding: 6px 11px; font-family: var(--head); font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .06); }
.btn-tag:hover { background: rgba(255, 255, 255, .12); }
.btn-tag.tp.on { background: var(--red); color: #fff; box-shadow: 0 0 14px rgba(255, 77, 106, .5); }
.btn-tag.fp.on { background: var(--lime); color: var(--lime-ink); box-shadow: 0 0 14px rgba(200, 238, 58, .45); }
.sticky-foot { position: sticky; bottom: -16px; background: linear-gradient(transparent, rgba(11, 29, 33, .98) 30%); padding: 18px 0 14px; display: flex; gap: 8px; }

/* debrief */
.grade { width: 52px; height: 52px; display: grid; place-items: center; font-family: var(--head); font-size: 30px; font-weight: 700; color: #2a1d02; background: var(--amber); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.grade.A, .grade.B { background: var(--lime); color: var(--lime-ink); }
.grade.D, .grade.F { background: var(--red); color: #fff; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 13px; margin: 12px 0; }
.kv span:nth-child(odd) { color: #d3e0dc; }
.kv span:nth-child(even) { font-family: var(--head); font-weight: 700; text-align: right; }
.kv .bad { color: #ff9aac; }
.kv .good { color: var(--lime); }
.capnote { color: #ff9aac; font-size: 12.5px; font-weight: 600; margin: 8px 0; }
.explain { margin-bottom: 12px; }
.explain h5 { margin: 0 0 3px; font-family: var(--head); font-size: 13.5px; font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.explain p { font-size: 12.5px; margin: 0; }
.explain .ttp { font-family: var(--mono); font-size: 10.5px; color: var(--cyan); margin-top: 3px; }
.verdict-ok { color: var(--lime); font-size: 11.5px; font-weight: 600; }
.verdict-bad { color: #ff9aac; font-size: 11.5px; font-weight: 600; }

/* report KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.kpi { background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.kpi b { display: block; font-family: var(--head); font-size: 21px; font-weight: 700; margin-top: 2px; }

/* ---------- left: mission tracker ---------- */
#action { position: fixed; left: 14px; top: 150px; z-index: 4; width: 330px; }
body:has(#sheet:not([hidden])) #action { display: none; }
.quest { padding: 12px 13px; }
.quest::before { content: ''; position: absolute; left: 16px; right: 16px; top: 0; height: 2px; background: linear-gradient(90deg, var(--lime), transparent); }
.quest, .inc-card { position: relative; }
.q-top { display: flex; justify-content: space-between; align-items: center; }
.q-top small:first-child { color: var(--lime); }
.q-bar { display: flex; gap: 4px; margin: 8px 0 10px; }
.q-bar i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); transform: skewX(-20deg); }
.q-bar i.done { background: var(--lime); box-shadow: 0 0 8px rgba(200, 238, 58, .6); }
.q-row { display: flex; gap: 11px; align-items: center; }
.q-ic { width: 38px; height: 38px; background: linear-gradient(160deg, var(--cyan), #138aa3); color: #032830; display: grid; place-items: center; flex: none; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.q-row b { display: block; font-family: var(--head); font-size: 15px; font-weight: 700; }
.q-row p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.q-go { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: rgba(200, 238, 58, .14); color: var(--lime); }
.q-go:hover { background: var(--lime); color: var(--lime-ink); }
.inc-card { padding: 12px 13px; box-shadow: var(--shadow), inset 0 0 0 1px var(--red), 0 0 22px rgba(255, 77, 106, .3); }
.inc-card p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.inc-card .row { gap: 8px; flex-wrap: wrap; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(11, 29, 33, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--text); padding: 8px 14px 8px 8px; border-radius: 14px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; display: flex; gap: 10px; align-items: center; animation: toastin .25s ease-out; max-width: min(520px, 90vw); }
.toast .ic { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: rgba(200, 238, 58, .15); color: var(--lime); }
.toast.bad .ic { background: rgba(255, 77, 106, .18); color: var(--red); }
.toast.warn .ic { background: rgba(255, 194, 61, .16); color: var(--amber); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .3s; }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 30; background: rgba(2, 10, 12, .62); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); }
.modal-inner { position: relative; background: rgba(11, 29, 33, .97); border-radius: 22px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); max-width: 980px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; }
.modal-inner h3 { margin: 3px 0 4px; font-family: var(--head); font-size: 24px; font-weight: 700; }
.modal-inner > p { color: #d3e0dc; font-size: 13.5px; margin: 0 0 14px; }
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rcard { text-align: left; background: rgba(255, 255, 255, .05); border-radius: 16px; padding: 13px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s, background .15s; }
.rcard:hover { transform: translateY(-4px); background: rgba(200, 238, 58, .07); box-shadow: inset 0 0 0 1px var(--lime), 0 10px 26px rgba(200, 238, 58, .15); }
.rcard h4 { margin: 0; font-family: var(--head); font-size: 15px; font-weight: 700; line-height: 1.25; }
.rcard p { margin: 0; font-size: 12px; color: #d3e0dc; line-height: 1.45; flex: 1; }
.r-top { display: flex; justify-content: space-between; align-items: center; }
.r-tag { font-family: var(--head); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.r-tag.Shutdown { background: rgba(255, 77, 106, .18); color: #ff9aac; }
.r-tag.Contain { background: rgba(57, 230, 255, .15); color: var(--cyan); }
.r-tag.Recover { background: rgba(200, 238, 58, .15); color: var(--lime); }
.r-cost { font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--amber); }
.pb { font-size: 11px; font-weight: 600; border-radius: 7px; padding: 4px 7px; }
.pb.ok { background: rgba(200, 238, 58, .14); color: var(--lime); }
.pb.bad { background: rgba(255, 77, 106, .14); color: #ff9aac; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* chapter title card and the Grid of the Year certificate */
.chapter-card, .certificate { text-align: center; max-width: 640px; margin: 0 auto; padding: 8px 4px 0; }
.chapter-card small, .certificate small { color: var(--lime); }
.chapter-card h3, .certificate h3 { font-size: clamp(26px, 4.4vw, 38px); text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 0 24px rgba(200, 238, 58, .35); margin: 6px 0 10px; }
.chapter-card > p, .certificate > p { color: #d6e5e0; font-size: 14.5px; line-height: 1.6; margin: 0 auto 16px; max-width: 58ch; }
.cc-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: radial-gradient(circle at 30% 30%, #e9ff8a, var(--lime) 60%, #7da11a); color: var(--lime-ink); box-shadow: 0 0 30px rgba(200, 238, 58, .55); margin-bottom: 10px; animation: ccpop .6s cubic-bezier(.2, 1.6, .4, 1); }
.cc-ic .ic { width: 32px; height: 32px; }
@keyframes ccpop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.cc-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cc-list span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; }
.cc-list .ic { width: 14px; height: 14px; color: var(--lime); }
.chapter-card .modal-foot, .certificate .modal-foot { justify-content: center; }
/* detection badges: earned once per real attack */
.badges { display: grid; gap: 8px; margin-bottom: 10px; }
.badge { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.badge b { display: block; font-family: var(--head); font-size: 15px; margin: 1px 0; }
.badge small { color: var(--muted, #8fa3a0); }
.b-medal { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line); color: #7d8c8a; }
.b-medal .ic { width: 20px; height: 20px; }
.badge.got { background: linear-gradient(135deg, rgba(200, 238, 58, .14), rgba(200, 238, 58, .03)); box-shadow: inset 0 0 0 1px rgba(200, 238, 58, .45); }
.badge.got small { color: var(--lime); }
.badge.got .b-medal { background: radial-gradient(circle at 35% 30%, #f3ff9a, var(--lime) 55%, #8fb21c); color: #142019; box-shadow: 0 0 18px rgba(200, 238, 58, .45), inset 0 0 0 2px rgba(255, 255, 255, .35); }
.badge.big { margin-bottom: 12px; padding: 14px; animation: badge-in .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.badge.big .b-medal { width: 56px; height: 56px; }
.badge.big .b-medal .ic { width: 26px; height: 26px; }
.badge.big b { font-size: 18px; }
.cert-badges { margin: 4px 0 14px; }
.cert-badges > div { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.b-medal.on { background: radial-gradient(circle at 35% 30%, #f3ff9a, var(--lime) 55%, #8fb21c); color: #142019; box-shadow: 0 0 18px rgba(200, 238, 58, .45), inset 0 0 0 2px rgba(255, 255, 255, .35); }
@keyframes badge-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.certificate { position: relative; padding: 18px 10px 4px; border-radius: 18px; box-shadow: inset 0 0 0 2px var(--edge), 0 0 40px rgba(200, 238, 58, .12); }
.certificate img { display: block; height: 54px; margin: 0 auto 10px; }
.certificate > small { display: block; }
.certificate .kpis { grid-template-columns: repeat(3, 1fr); text-align: left; }
.box.locked { opacity: .55; }
@media (max-width: 640px) { .certificate .kpis { grid-template-columns: 1fr 1fr; } }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help-grid .box b { font-family: var(--head); font-size: 14px; }
.help-grid .box p { margin: 4px 0 0; font-size: 12.5px; color: #d3e0dc; line-height: 1.5; }
kbd { font-family: var(--mono); font-size: 11px; background: rgba(255, 255, 255, .1); border-radius: 5px; padding: 1px 5px; }

/* ---------- inputs ---------- */
.name-field { display: block; margin: 0 0 16px; }
.name-field small { display: block; margin-bottom: 5px; }
.name-field input, .text-input, .callsign input { width: 100%; font: inherit; font-family: var(--head); font-size: 17px; font-weight: 600; letter-spacing: .03em; color: var(--text); background: rgba(0, 0, 0, .35); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 11px 14px; outline: none; transition: box-shadow .15s; }
.name-field input:focus, .text-input:focus, .callsign input:focus { box-shadow: inset 0 0 0 1px var(--lime), 0 0 18px rgba(200, 238, 58, .25); }
.callsign input.error, .name-field input.error { box-shadow: inset 0 0 0 1px var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- title screen ---------- */
#intro { position: fixed; inset: 0; z-index: 40; display: flex; overflow-y: auto; padding: 24px; background: radial-gradient(ellipse at 50% 35%, rgba(14, 59, 54, .78), rgba(3, 12, 14, .95) 70%); }
.intro-grid-bg { position: fixed; left: -50%; right: -50%; bottom: -10%; height: 55%; pointer-events: none; background-image: linear-gradient(rgba(200, 238, 58, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(200, 238, 58, .18) 1px, transparent 1px); background-size: 60px 60px; transform: perspective(500px) rotateX(62deg); transform-origin: bottom; mask-image: linear-gradient(transparent, #000 60%); -webkit-mask-image: linear-gradient(transparent, #000 60%); animation: gridmove 3s linear infinite; }
@keyframes gridmove { to { background-position: 0 60px; } }
.title-screen { position: relative; margin: auto; width: min(760px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; }
.intro-logo { height: 40px; width: auto; display: block; margin-bottom: 18px; filter: drop-shadow(0 0 14px rgba(200, 238, 58, .35)); }
.eyebrow { color: var(--cyan); letter-spacing: .3em; display: inline-flex; align-items: center; gap: 12px; }
.eyebrow::before, .eyebrow::after { content: ''; width: 34px; height: 1px; background: var(--cyan); opacity: .6; }
.title-screen h1 { font-family: var(--head); font-weight: 700; font-size: clamp(38px, 7vw, 76px); line-height: .98; margin: 12px 0 14px; text-transform: uppercase; letter-spacing: .01em; text-shadow: 0 0 30px rgba(57, 230, 255, .25); }
.title-screen h1 span { display: block; color: var(--lime); text-shadow: 0 0 24px rgba(200, 238, 58, .55); }
.title-screen > .lede { margin: 0 0 24px; max-width: 64ch; padding: 14px 18px; border-radius: 16px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #d6e5e0; font-size: 14.5px; line-height: 1.6; }
.title-screen > .lede b { color: var(--lime); font-weight: 600; }
.launch { display: flex; gap: 10px; align-items: flex-end; width: min(520px, 100%); margin-bottom: 26px; }
.callsign { flex: 1; text-align: left; }
.callsign small { display: block; margin-bottom: 6px; color: var(--lime); }
.btn.big { padding: 13px 26px; font-size: 16px; text-transform: uppercase; letter-spacing: .08em; box-shadow: 0 0 24px rgba(200, 238, 58, .35); }
.btn.big .ic { width: 16px; height: 16px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-bottom: 16px; }
.feat { text-align: left; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.feat > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(200, 238, 58, .14); color: var(--lime); margin-bottom: 10px; }
.feat b { display: block; font-family: var(--head); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.feat p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hint { color: var(--muted); font-size: 12px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1280px) {
  #rel > div, #sec > div { display: none; }
  .res { padding-right: 8px; }
  .operator { min-width: 0; }
  .op-info b { max-width: 110px; }
}
@media (max-width: 1200px) {
  .threat { top: 86px; left: auto; right: 14px; transform: none; }
  #banner { top: 86px; left: 416px; right: 14px; }

}
@media (max-width: 900px) {
  .operator .op-info small, .xp { display: none; }
  .dock button { width: 58px; font-size: 10px; }
  .corner-logo { display: none; }
  #banner .b-sub { display: none; }
  #sheet { width: min(372px, calc(100vw - 28px)); }
  .camera { top: auto; bottom: 100px; transform: none; }
  #sheet { top: 172px; }
  #banner { min-height: 0; }
  #banner b { font-size: 14px; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* two rows: clock + speed + help across the top, then resources and threat */
  .hud-right { top: 8px; left: 8px; right: 8px; justify-content: space-between; padding: 6px 6px 6px 12px; gap: 8px; }
  .clk { text-align: left; }
  .clk b { font-size: 18px; }
  .speeds button { width: 30px; }
  /* the settings fold into a labelled menu under the sliders button */
  .more { display: grid !important; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #d6e4e1; flex: none; }
  .more[aria-expanded="true"] { color: var(--lime); background: rgba(200, 238, 58, .12); }
  .settings { display: none; position: fixed; top: 58px; right: 8px; z-index: 29; flex-direction: column; gap: 2px; padding: 6px; border-left: 0;
    background: var(--glass-hi); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 14px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
  .settings.open { display: flex; }
  .hud-right:has(.settings.open) { z-index: 29; }   /* the top bar is its own stacking layer; lift it over toasts */
  .settings .phone-only { display: flex !important; }
  .settings button { width: auto; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 8px; justify-content: flex-start; font-size: 13px; }
  .settings button.img { padding: 0 12px 0 8px; }
  .settings button.img img { width: 24px; height: 24px; }
  .settings button::after { content: attr(data-label); font-family: 'Inter', system-ui, sans-serif; font-weight: 500; font-size: 13px; color: var(--text); }
  .settings button.txt { min-width: 0; }
  .hud-left { top: 70px; left: 8px; gap: 6px; }
  .operator { display: none; }
  .resources { padding: 4px; }
  .res { padding: 3px 8px 3px 4px; }
  .res b { font-size: 14px; }
  .res small { display: none; }
  .r-ic { width: 28px; height: 28px; }
  .r-ic.shield { width: 26px; height: 30px; }
  .ring, .ring svg { width: 30px; height: 30px; }
  .threat { top: 70px; right: 8px; padding: 7px 10px; gap: 8px; }
  .threat .t-ic, .threat .t-body small { display: none; }
  .t-bar { margin: 0; }
  .t-bar i { width: 12px; }
  .threat b { min-width: 0; font-size: 12px; }
  #banner { top: 120px; left: 8px; right: 8px; padding: 6px 8px; gap: 8px; }
  #banner .b-ic { display: none; }
  #banner b { font-size: 14px; }
  #banner .decide b { font-size: 17px; }
  #action { top: auto; bottom: 84px; left: 8px; right: 60px; width: auto; }
  #action .q-row p { display: none; }
  .camera { right: 8px; top: auto; bottom: 84px; transform: none; padding: 4px; }
  .camera button { width: 34px; height: 34px; }
  .camera .sep { display: none; }
  .dock { left: 8px; right: 8px; transform: none; justify-content: space-between; bottom: 8px; padding: 5px; gap: 2px; }
  .dock button { width: auto; flex: 1; font-size: 9.5px; padding: 7px 0 5px; }
  .dock button .ic { width: 19px; height: 19px; }
  #sheet { left: 8px; right: 8px; width: auto; top: auto; bottom: 80px; height: 52vh; }
  body:has(#sheet:not([hidden])) .camera { display: none; }
  #toasts { top: 124px; }
  body:has(#banner:not([hidden])) #toasts { top: 188px; }
  .help-grid { grid-template-columns: 1fr; }
  .launch { flex-direction: column; align-items: stretch; }
  #intro { padding: 16px; }
}

/* ---------- multiplayer: mode switch, role picker, lobby, team chat, shared logs ---------- */
.modes { display: flex; gap: 6px; padding: 5px; margin-bottom: 14px; border-radius: 14px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line); }
.mode { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font-family: var(--head); font-weight: 600; font-size: 14px; color: var(--muted); }
.mode .ic { width: 16px; height: 16px; }
.mode.on { background: var(--lime); color: var(--lime-ink); }
.mp-box { width: min(760px, 100%); margin-bottom: 22px; padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: left; }
.mp-step { display: block; margin: 0 2px 8px; color: var(--lime); font-family: var(--head); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.mp-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.role-card { text-align: left; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, background .15s; }
.role-card b { display: block; font-family: var(--head); font-size: 15px; margin: 8px 0 3px; }
.role-card p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.role-card:hover { background: rgba(200, 238, 58, .07); }
.role-card.on { background: rgba(200, 238, 58, .13); box-shadow: inset 0 0 0 1.5px var(--lime), 0 0 18px rgba(200, 238, 58, .2); }
.rc-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(200, 238, 58, .14); color: var(--lime); }
.rc-ic .ic { width: 17px; height: 17px; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mp-or { color: var(--muted); font-size: 13px; }
#mp-code { width: 140px; font-size: 16px; letter-spacing: .2em; text-transform: uppercase; }
.mp-error { min-height: 1em; margin: 10px 2px 0; color: #ff9aa9; font-size: 13px; }
.mp-room { font-family: var(--head); font-size: 44px; font-weight: 700; letter-spacing: .25em; color: var(--lime); text-shadow: 0 0 20px rgba(200, 238, 58, .45); margin-bottom: 12px; }
.mp-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.slot small { display: block; color: var(--muted); font-size: 11px; }
.slot b { font-family: var(--head); font-size: 14px; color: var(--muted); }
.slot.filled b { color: var(--text); }
.slot.you { box-shadow: inset 0 0 0 1.5px var(--lime); }
.mp-wait { margin: 0 2px 12px; color: var(--muted); font-size: 13px; }
#chat.inline { position: static; width: 100%; margin-top: 14px; box-shadow: inset 0 0 0 1px var(--line); }
#chat.inline #chat-list { height: 160px; }
.launch[hidden] { display: none; }
@media (max-width: 760px) { .mp-roles, .mp-slots { grid-template-columns: 1fr; } }

#chat { position: fixed; right: 16px; bottom: 96px; z-index: 45; width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column; border-radius: 16px; background: var(--glass-hi); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; }
#chat[hidden] { display: none; }
#chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-family: var(--head); font-weight: 700; font-size: 13px; text-align: left; border-bottom: 1px solid var(--line); }
#chat-unread { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; text-align: center; }
#chat-list { height: 220px; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
#chat.min #chat-list, #chat.min .chat-form { display: none; }
/* minimised: just the round ONSA logo, with the unread count on its corner */
.chat-logo { display: none; }
#chat.min { width: 56px; height: 56px; border-radius: 50%; overflow: visible; box-shadow: var(--shadow), 0 0 0 1px var(--edge), 0 0 18px rgba(200, 238, 58, .25); }
#chat.min #chat-head { position: relative; width: 100%; height: 100%; padding: 0; justify-content: center; border: 0; border-radius: 50%; }
#chat.min .chat-title { display: none; }
#chat.min .chat-logo { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#chat.min #chat-head:hover .chat-logo { filter: brightness(1.15); }
#chat.min #chat-unread { position: absolute; top: -4px; right: -4px; margin: 0; }
.chat-msg { max-width: 88%; padding: 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 13px; line-height: 1.4; word-break: break-word; }
.chat-msg small { display: block; font-size: 10.5px; font-weight: 600; margin-bottom: 1px; }
.chat-msg.analyst small { color: var(--cyan); }
.chat-msg.responder small { color: var(--amber); }
.chat-msg.engineer small { color: var(--lime); }
.chat-msg.mine { align-self: flex-end; background: rgba(200, 238, 58, .14); }
.chat-msg.sys { align-self: center; max-width: 100%; background: none; color: var(--muted); font-size: 12px; text-align: center; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
#chat-input { flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--text); background: rgba(0, 0, 0, .3); border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); padding: 8px 10px; outline: none; }
#chat-input:focus { box-shadow: inset 0 0 0 1px var(--lime); }
#chat-send { width: 36px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; }
#chat-send .ic { width: 16px; height: 16px; }
@media (max-width: 640px) { #chat { bottom: 92px; } #chat-list { height: 150px; } }

/* role badge on the incident card and the Analyst's calls as others see them */
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-family: var(--head); font-size: 11px; font-weight: 700; letter-spacing: .04em; background: rgba(200, 238, 58, .14); color: var(--lime); }
.role-chip .ic { width: 13px; height: 13px; }
.clue-call { display: inline-flex; padding: 4px 9px; border-radius: 8px; font-size: 12px; background: rgba(255, 255, 255, .05); color: var(--muted); }
.clue-call.tp { background: rgba(255, 77, 106, .15); color: #ffb3bf; }
.clue-call.fp { background: rgba(200, 238, 58, .12); color: var(--lime); }
.rec-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 3px 8px; border-radius: 8px; font-size: 11.5px; font-weight: 600; background: rgba(57, 230, 255, .14); color: var(--cyan); }
.rec-badge .ic { width: 13px; height: 13px; }
.pill.pending { background: rgba(255, 194, 61, .16); color: var(--amber); }
.mp-note { margin: 0 0 10px; padding: 9px 11px; border-radius: 12px; background: rgba(57, 230, 255, .08); box-shadow: inset 0 0 0 1px rgba(57, 230, 255, .3); font-size: 12.5px; line-height: 1.45; color: #cdf6ff; }

/* lab work on an incident: forensics, malware analysis, reverse engineering */
.lab { margin-bottom: 8px; padding: 11px; border-radius: 14px; background: rgba(57, 230, 255, .06); box-shadow: inset 0 0 0 1px rgba(57, 230, 255, .28); }
.lab.done { background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.lab.wait { opacity: .8; }
.lab-h { display: flex; align-items: center; gap: 10px; }
.lab-h small { display: block; color: var(--cyan); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.lab-h b { font-family: var(--head); font-size: 14px; }
.lab-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(57, 230, 255, .14); color: var(--cyan); }
.lab-ic .ic { width: 16px; height: 16px; }
.lab pre { font-family: var(--mono); font-size: 11px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin: 8px 0; padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, .3); color: #e9f4f0; }
.lab-q { margin: 6px 0; font-weight: 600; font-size: 13px; }
.lab-o { display: grid; gap: 6px; }
.lab-o .btn { justify-content: flex-start; text-align: left; white-space: normal; height: auto; padding: 8px 10px; line-height: 1.35; }
.lab-f { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: #d6e5e0; }
