/* NEO — upright, a column: the top bar, the room view, the control deck,
   and the screens that open over them. Sideways (#app.wide), the room
   stands in the middle with the controls either side. Phosphor green on
   near-black. */

:root {
  --bg: #010302;
  --ink: #b8ffc8;
  --dim: #4f8a5e;
  --green: #3cff6e;
  --deep: #062a12;
  --panel: rgba(1, 8, 4, 0.97);
  --red: #ff4060;
  --gold: #ffb43a;
  --r0: #c8d4c8; --r1: #3cff6e; --r2: #4aa8ff; --r3: #c25aff; --r4: #ffb43a;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --app-h: 100vh;
}
@supports (height: 100dvh) { :root { --app-h: 100dvh; } }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  overflow: hidden; overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  font-family: 'VT323', ui-monospace, Menlo, Consolas, monospace;
}
button { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
[hidden] { display: none !important; }

#app {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--app-h);
  display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
}
@media (min-width: 600px) { #app { border-left: 1px solid #0c2a16; border-right: 1px solid #0c2a16; box-shadow: 0 0 60px rgba(60, 255, 110, 0.06); } }

/* ---- the top bar ---- */
#topbar {
  flex: 0 0 auto; height: calc(48px + var(--safe-t)); padding: var(--safe-t) 4px 0 8px;
  display: flex; align-items: center; gap: 8px; font-size: 20px; line-height: 1;
  background: linear-gradient(#020a05, #010302); border-bottom: 1px solid #0c2a16;
}
.hp { display: flex; align-items: center; gap: 6px; flex: 1 1 40%; min-width: 0; }
.hp-track { flex: 1; height: 10px; border: 1px solid var(--dim); background: #10060a; position: relative; }
.hp-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--green); transition: width 0.15s; }
.hp-fill.low { background: var(--red); }
.hp-text { min-width: 30px; text-align: right; color: var(--ink); }
.hud-mid { display: flex; gap: 10px; color: var(--dim); white-space: nowrap; }
.hud-data { color: var(--gold); white-space: nowrap; }
.data-glyph { font-size: 14px; margin-right: 2px; }
.icon-btn {
  width: 48px; height: 48px; flex: 0 0 48px; background: transparent; border: 1px solid #1d4a2a; border-radius: 6px;
  font-size: 22px; color: var(--ink); letter-spacing: -2px;
}

/* ---- the room view ---- */
#stage { flex: 1 1 auto; position: relative; min-height: 0; overflow: hidden; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.hint {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); max-width: 92%;
  padding: 4px 10px; font-size: 22px; color: var(--bg); background: var(--green); white-space: nowrap;
  box-shadow: 0 0 12px rgba(60, 255, 110, 0.5); pointer-events: none; animation: blink-in 0.25s;
}
.banner {
  position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 34px; color: var(--green);
  text-shadow: 0 0 10px rgba(60, 255, 110, 0.8); pointer-events: none; animation: banner 1.4s forwards;
}
.banner.boss { top: 12%; font-size: 26px; color: #e8ffe8; text-shadow: 0 0 8px #000; animation: banner 2.2s forwards; }
.toasts { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.toast { font-size: 19px; padding: 2px 8px; background: rgba(0, 0, 0, 0.75); border: 1px solid currentColor; animation: toast 2.4s forwards; max-width: 94%; text-align: center; }
@keyframes blink-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes banner { 0% { opacity: 0; letter-spacing: 12px; } 15% { opacity: 1; letter-spacing: 2px; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes toast { 0% { opacity: 0; transform: translateY(6px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---- the control deck ---- */
#deck {
  flex: 0 0 auto; position: relative; height: calc(var(--deck-h, 220px) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: radial-gradient(ellipse at 50% 120%, #04170a, #010302 70%); border-top: 1px solid #0c2a16;
  touch-action: none; overflow: hidden;
}
#minimap { position: absolute; left: 8px; top: 8px; width: 72px; height: 72px; image-rendering: pixelated; pointer-events: none; opacity: 0.95; }
.feed {
  position: absolute; left: 88px; right: 146px; top: 6px; font-size: 18px; line-height: 19px; color: var(--green);
  pointer-events: none; overflow: hidden; height: 60px; text-shadow: 0 0 6px rgba(60, 255, 110, 0.4);
}
.feed div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed div:not(:last-child) { opacity: 0.45; }
.stick-base { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border: 2px solid rgba(60, 255, 110, 0.45); border-radius: 50%; pointer-events: none; background: rgba(60, 255, 110, 0.05); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(60, 255, 110, 0.55); box-shadow: 0 0 12px rgba(60, 255, 110, 0.6); }
.stick-ghost { position: absolute; left: 25%; top: 64%; width: 96px; height: 96px; margin: -48px 0 0 -48px; border: 2px dashed rgba(60, 255, 110, 0.25); border-radius: 50%; pointer-events: none; animation: ghost 2s infinite; }
@keyframes ghost { 50% { opacity: 0.35; transform: translateX(10px); } }
/* the aim stick: paler, with a crosshair for a knob */
.stick-base.aim { border-color: rgba(184, 255, 200, 0.45); background: rgba(184, 255, 200, 0.04); }
.stick-base.aim .stick-knob { background: transparent; border: 2px solid rgba(184, 255, 200, 0.8); box-shadow: 0 0 10px rgba(184, 255, 200, 0.5); box-sizing: border-box; }
.stick-base.aim .stick-knob::before, .stick-base.aim .stick-knob::after { content: ''; position: absolute; background: rgba(184, 255, 200, 0.9); }
.stick-base.aim .stick-knob::before { left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; }
.stick-base.aim .stick-knob::after { top: 50%; left: 6px; right: 6px; height: 2px; margin-top: -1px; }
.stick-ghost.aim { left: 75%; border-color: rgba(184, 255, 200, 0.3); animation-name: ghost-aim; }
@keyframes ghost-aim { 50% { opacity: 0.35; transform: translateY(-10px); } }
.deck-buttons { position: absolute; right: 0; top: 0; bottom: var(--safe-b); width: 146px; pointer-events: none; }
.deck-btn {
  position: absolute; pointer-events: auto; border-radius: 50%; background: rgba(4, 24, 10, 0.9); border: 1px solid #1d4a2a;
  display: flex; align-items: center; justify-content: center; font-size: 18px; letter-spacing: 1px; color: var(--ink); padding: 0;
}
.deck-btn .ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); transform: rotate(-90deg); pointer-events: none; }
.ring-bg { fill: none; stroke: #0c2a16; stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 6; stroke-dasharray: 283; stroke-dashoffset: 283; transition: stroke-dashoffset 0.1s; }
.deck-btn span { position: relative; }
.deck-btn.focus { width: 64px; height: 64px; right: 10px; top: 8px; font-size: 16px; }
.deck-btn.focus.ready { background: #0a3a18; box-shadow: 0 0 18px rgba(60, 255, 110, 0.6); color: #eaffef; }
.deck-btn.focus:not(.ready) { opacity: 0.55; }
.deck-btn.phase { width: 56px; height: 56px; right: 84px; top: 12px; font-size: 15px; }
.deck-btn.phase.cooling { opacity: 0.5; }
.deck-btn.act { width: 88px; height: 88px; right: 8px; top: 30px; font-size: 20px; border-radius: 12px; border-color: var(--green); color: var(--green); box-shadow: 0 0 14px rgba(60, 255, 110, 0.3); }
.deck-btn.pulse { animation: pulse 0.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(60, 255, 110, 0.35); } }
#app.lefty .deck-buttons { right: auto; left: 0; }
#app.lefty .deck-btn.focus { right: auto; left: 10px; }
#app.lefty .deck-btn.phase { right: auto; left: 84px; }
#app.lefty .deck-btn.act { right: auto; left: 8px; }
#app.lefty #minimap { left: auto; right: 8px; }
#app.lefty .feed { left: 146px; right: 88px; }
#app.lefty .stick-ghost { left: 75%; }
#app.lefty .stick-ghost.aim { left: 25%; }
#app.hub-mode .deck-btn.focus, #app.hub-mode .deck-btn.phase, #app.hub-mode #minimap { display: none; }
#app.hub-mode .hp, #app.hub-mode #sector { visibility: hidden; }

/* ---- sideways (main.js adds .wide): the room in the middle, the HUD,
   minimap and feed on the left, the buttons on the right; the deck fills
   the whole screen behind the room, so either side takes a thumb ---- */
:root { --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --side-w: calc((100% - var(--stage-w, 300px)) / 2); }
#app.wide { left: 0; transform: none; max-width: none; display: block; border: none; box-shadow: none; }
#app.wide #stage { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--stage-w, 300px); margin-left: calc(var(--stage-w, 300px) / -2); z-index: 2; box-shadow: 0 0 0 1px #0c2a16, 0 0 40px rgba(60, 255, 110, 0.05); }
#app.wide #deck { position: absolute; inset: 0; height: auto; padding: 0; border: none; background: radial-gradient(ellipse at 50% 110%, #04170a, #010302 60%); }
#app.wide #topbar {
  position: absolute; z-index: 3; top: 0; left: 0; width: var(--side-w); height: auto; flex-wrap: wrap; gap: 6px 12px;
  padding: calc(10px + var(--safe-t)) 10px 0 calc(10px + var(--safe-l)); background: none; border: none; pointer-events: none;
}
#app.wide .hp { flex: 1 1 100%; }
#app.wide #btn-pause { position: fixed; top: calc(8px + var(--safe-t)); right: calc(8px + var(--safe-r)); pointer-events: auto; }
#app.wide #minimap { left: calc(10px + var(--safe-l)); top: calc(70px + var(--safe-t)); }
#app.wide .feed { left: calc(90px + var(--safe-l)); right: auto; width: calc(var(--side-w) - 100px - var(--safe-l)); top: calc(66px + var(--safe-t)); height: 80px; font-size: 17px; line-height: 20px; }
#app.wide .deck-buttons { top: calc(64px + var(--safe-t)); bottom: auto; right: var(--safe-r); width: 170px; height: 150px; }
#app.wide .deck-btn.focus { width: 72px; height: 72px; right: 12px; top: 0; }
#app.wide .deck-btn.phase { width: 66px; height: 66px; right: 94px; top: 46px; }
#app.wide .deck-btn.act { right: 12px; top: 10px; }
#app.wide.lefty #topbar { left: auto; right: 0; padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) 0 10px; }
#app.wide.lefty #btn-pause { right: auto; left: calc(8px + var(--safe-l)); }
#app.wide.lefty #minimap { left: auto; right: calc(10px + var(--safe-r)); }
#app.wide.lefty .feed { left: auto; right: calc(90px + var(--safe-r)); width: calc(var(--side-w) - 100px - var(--safe-r)); }
#app.wide.lefty .deck-buttons { right: auto; left: var(--safe-l); }
#app.wide.lefty .deck-btn.focus { right: auto; left: 12px; }
#app.wide.lefty .deck-btn.phase { right: auto; left: 94px; }
#app.wide.lefty .deck-btn.act { right: auto; left: 12px; }
#app.wide .stick-ghost { left: calc(var(--side-w) / 2); }
#app.wide .stick-ghost.aim, #app.wide.lefty .stick-ghost { left: calc(100% - var(--side-w) / 2); }
#app.wide.lefty .stick-ghost.aim { left: calc(var(--side-w) / 2); }
#app.wide .hint { white-space: normal; text-align: center; font-size: 19px; width: max-content; max-width: 94%; }
#app.wide .banner { font-size: 26px; }
#app.wide .banner.boss { font-size: 22px; }
/* screens scroll when they don't fit the short height, and centre when they do */
#app.wide .screen { justify-content: flex-start; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) calc(10px + var(--safe-b)) calc(16px + var(--safe-l)); }
#app.wide .screen > :first-child { margin-top: auto; }
#app.wide .screen > :last-child { margin-bottom: auto; }
#app.wide .screen h2 { font-size: 28px; margin: 2px 0 8px; }
#app.wide .logo { font-size: 84px; letter-spacing: 8px; }
#app.wide .title-inner { margin: auto 0; }
#app.wide .crt { padding: 8% 12% 0; }
/* the compare card in two columns; patch and cache choices side by side */
#app.wide #compare-card { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "row b"; gap: 0 18px; width: min(760px, 100%); }
#app.wide #compare-card .cmp-a { grid-area: a; }
#app.wide #compare-card .cmp-b { grid-area: b; }
#app.wide #compare-card .row { grid-area: row; align-self: end; }
#app.wide #compare-card .diff { margin-top: 0; }
#app.wide .patch-options, #app.wide .cache-options { flex-direction: row; flex-wrap: wrap; align-items: stretch; width: min(920px, 100%); }
#app.wide .option { flex: 1 1 0; min-width: 200px; }
#app.wide #cache-options > .btn:last-child { flex: 1 1 100%; position: static; padding: 6px 12px; background: rgba(4, 24, 10, 0.6); }

/* ---- screens ---- */
.screen {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: var(--panel); text-align: center;
}
.screen.scroll { justify-content: flex-start; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.screen h2 { margin: 6px 0 12px; font-weight: normal; font-size: 34px; color: var(--green); letter-spacing: 2px; text-shadow: 0 0 10px rgba(60, 255, 110, 0.5); }
.screen h3 { margin: 16px 0 6px; font-weight: normal; font-size: 22px; color: var(--dim); letter-spacing: 2px; }
.menu { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 10px; margin-top: 8px; }
.btn {
  width: min(320px, 92%); min-height: 54px; padding: 6px 12px; font-size: 26px; letter-spacing: 1px;
  background: rgba(4, 24, 10, 0.6); border: 2px solid #1d6a35; color: var(--ink); border-radius: 4px;
}
.btn:active, .btn.pressed { background: #0d4a20; }
.btn.primary { border-color: var(--green); color: var(--green); box-shadow: 0 0 14px rgba(60, 255, 110, 0.25); }
.btn.danger { border-color: #8a2a3a; color: #ff9aa8; }
.btn:disabled { opacity: 0.35; }
.btn small { display: block; font-size: 17px; color: var(--dim); }

.title { background: #000; padding: 0; }
#rain { position: absolute; inset: 0; width: 100%; height: 100%; }
.title-inner { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0 16px; }
.logo { margin: 0 0 4px; font-weight: normal; font-size: 132px; line-height: 1; color: var(--green); letter-spacing: 12px; text-shadow: 0 0 18px rgba(60, 255, 110, 0.9), 0 0 2px #fff; }
.build { margin-top: 18px; font-size: 16px; color: #2c5a38; }
.blink::after { content: '_'; animation: cursor 1s steps(1) infinite; }
@keyframes cursor { 50% { opacity: 0; } }

.crt { background: #000; align-items: flex-start; justify-content: flex-start; padding: 22% 9% 0; z-index: 30; }
.crt-text { font-size: 34px; color: var(--green); text-align: left; text-shadow: 0 0 8px rgba(60, 255, 110, 0.85); line-height: 1.2; }
.crt .cursor { animation: cursor 1s steps(1) infinite; font-size: 30px; }
.skip { position: absolute; right: 12px; bottom: calc(16px + var(--safe-b)); min-width: 96px; min-height: 48px; font-size: 22px; background: transparent; border: 1px solid #1d4a2a; color: var(--dim); }

/* ---- cards ---- */
.card-screen { background: rgba(0, 4, 2, 0.97); }
.card-title { margin-top: 0; }
.card-sub { margin: 0 0 10px; color: var(--dim); font-size: 20px; }
.card { width: min(360px, 100%); padding: 14px 14px 10px; border: 2px solid currentColor; background: #020c06; text-align: left; box-shadow: 0 0 24px rgba(0, 0, 0, 0.9); }
.card .rar { font-size: 18px; letter-spacing: 2px; }
.card .name { font-size: 28px; line-height: 1.05; margin: 2px 0 2px; }
.card .slot { font-size: 18px; color: var(--dim); margin-bottom: 8px; }
.card .line { font-size: 20px; color: var(--ink); line-height: 1.15; }
.card .implicit { color: #9ac8a6; }
.card .power { color: var(--gold); font-size: 20px; margin: 6px 0; line-height: 1.15; }
/* the verdict: UPGRADE / DOWNGRADE / SIDEGRADE / NEW SLOT */
.verdict { --vc: var(--green); display: block; margin: 6px 0 2px; padding: 4px 8px; border: 2px solid var(--vc); background: #06180c; background: color-mix(in srgb, var(--vc) 12%, #020c06); color: var(--ink); text-align: left; }
.verdict.down { --vc: #ff6a7a; }
.verdict.side { --vc: #e8e070; }
.verdict .vt { display: flex; justify-content: space-between; align-items: baseline; color: var(--vc); font-size: 22px; letter-spacing: 1px; }
.verdict .pct { font-size: 22px; }
.verdict .parts { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 17px; color: var(--dim); }
.verdict.big { margin: 0 0 10px; padding: 6px 10px; }
.verdict.big .vt, .verdict.big .pct { font-size: 32px; line-height: 1.05; }
.verdict.big .parts { font-size: 19px; }
.card .diff { margin: 8px 0 4px; }
.card .diff .line.up { color: var(--green); }
.card .diff .line.down { color: #ff6a7a; }
.card .has { font-size: 17px; color: var(--dim); line-height: 1.15; margin-top: 6px; }
.card .dimr { color: var(--dim); }
.up { color: var(--green); }
.down { color: #ff6a7a; }
.card .equipped { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #1d4a2a; font-size: 18px; color: var(--dim); }
.card .row { display: flex; gap: 16px; margin-top: 12px; }
.card .row .btn { flex: 1; width: auto; min-height: 56px; font-size: 24px; }
.cache-options, .patch-options { display: flex; flex-direction: column; gap: 10px; width: min(380px, 100%); }
.option { width: 100%; text-align: left; padding: 10px 12px; min-height: 96px; border: 2px solid currentColor; background: #020c06; font-size: 20px; border-radius: 4px; }
.option .name { font-size: 26px; display: block; line-height: 1.05; }
.option .sub { color: var(--dim); font-size: 18px; display: block; }
.option .line { display: block; color: var(--ink); line-height: 1.15; }
.option .verdict { margin-top: 6px; }
.option.patch { color: var(--green); }
.option.patch.rare { color: var(--r3); }
.oracle .name { color: var(--green); }
.oracle .text { color: var(--dim); font-size: 20px; margin: 4px 0 10px; }
.oracle .btn { width: 100%; margin: 6px 0; font-size: 21px; min-height: 52px; }

/* ---- panels ---- */
.settings { width: min(380px, 100%); display: flex; flex-direction: column; gap: 6px; text-align: left; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 10px; border: 1px solid #0f3a1c; background: rgba(4, 24, 10, 0.5); font-size: 22px; width: 100%; text-align: left; }
.setting .val { color: var(--green); white-space: nowrap; }
.setting input[type=range] { width: 46%; accent-color: var(--green); height: 32px; }
.setting.hold { position: relative; overflow: hidden; color: #ff9aa8; border-color: #5a1a26; justify-content: center; }
.setting.hold .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 64, 96, 0.3); }
.setting.hold span { position: relative; }
.balance { font-size: 26px; color: var(--gold); margin-bottom: 10px; }
.up-list { width: min(380px, 100%); display: flex; flex-direction: column; gap: 8px; }
.up-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #0f3a1c; background: rgba(4, 24, 10, 0.5); text-align: left; }
.up-item .info { flex: 1; min-width: 0; }
.up-item .nm { font-size: 22px; color: var(--ink); }
.up-item .ds { font-size: 18px; color: var(--dim); line-height: 1.1; }
.up-item .pips { letter-spacing: 2px; color: var(--green); font-size: 16px; }
.up-item .buy { min-width: 96px; min-height: 48px; font-size: 20px; background: transparent; border: 1px solid var(--green); color: var(--green); border-radius: 4px; }
.up-item .buy:disabled { border-color: #1d4a2a; color: #2f5a3a; }
.up-item .buy.toggle { color: var(--dim); border-color: #1d4a2a; }
.up-item .buy.toggle.on { color: #ff9a3c; border-color: #ff9a3c; }
.choices .proto { display: block; font-size: 17px; }
.unstable { font-size: 18px; margin: 4px 0; line-height: 1.15; }
.unstable .tag { color: #ff9a3c; letter-spacing: 1px; }
.option .unstable { display: block; }
.up-depth { margin: 14px 0 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(380px, 100%); }
.up-depth .lbl { width: 100%; font-size: 20px; color: var(--dim); }
.up-depth button { min-width: 52px; min-height: 48px; font-size: 22px; background: transparent; border: 1px solid #1d4a2a; color: var(--ink); }
.up-depth button.on { border-color: var(--green); color: var(--green); background: #06240f; }
.stats-table { width: min(380px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 20px; text-align: left; }
.stats-table .k { color: var(--dim); }
.stats-table .v { color: var(--ink); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: min(380px, 100%); }
.tx-list { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; font-size: 19px; color: var(--ink); line-height: 1.15; }
.tx-list .from { display: block; color: var(--green); font-size: 17px; letter-spacing: 1px; }
.tx-list .dim { color: var(--dim); }
.card .proto { display: block; font-size: 18px; margin: 2px 0 4px; }
.chip { padding: 2px 8px; border: 1px solid #1d6a35; font-size: 18px; color: var(--green); }
/* protocols: a tag on patch choices, and the loadout's list */
.option .proto { display: block; font-size: 18px; margin-top: 2px; }
.protocols { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.proto-row { border-left: 3px solid var(--pc); padding: 2px 8px; color: var(--dim); font-size: 17px; line-height: 1.15; }
.proto-row .pn { display: flex; justify-content: space-between; color: var(--pc); font-size: 20px; letter-spacing: 1px; }
.proto-row .pd.on { color: var(--ink); }
.proto-row.full { background: rgba(255, 255, 255, 0.04); }
.loadout-items { display: flex; flex-direction: column; gap: 8px; width: min(380px, 100%); }
.loadout-items .card { width: 100%; padding: 8px 10px; }
.loadout-items .card .name { font-size: 22px; }
.codex { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: min(380px, 100%); font-size: 18px; }
.codex div { padding: 6px; border: 1px solid #0f3a1c; text-align: left; }
.codex .found { color: var(--gold); border-color: #5a4010; }
.sum-lines { width: min(360px, 100%); font-size: 23px; text-align: left; display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin-bottom: 8px; }
.sum-lines .k { color: var(--dim); white-space: nowrap; }
.sum-lines .v { text-align: right; }
.sum-trace { width: min(360px, 100%); text-align: left; border-left: 3px solid #ff6a7a; padding: 4px 10px; margin: 4px 0 10px; font-size: 19px; line-height: 1.15; color: var(--ink); }
.sum-trace .th { color: #ff6a7a; letter-spacing: 2px; font-size: 18px; }
.sum-trace .tip { color: var(--green); margin: 4px 0; }
.sum-trace .hits { color: var(--dim); font-size: 17px; }
.sum-unlocks { color: var(--gold); font-size: 21px; margin: 6px 0 10px; line-height: 1.2; }
.confirm-text { font-size: 22px; color: var(--dim); max-width: 340px; }
#screen-summary h2.won { color: #eaffef; }
#screen-summary h2.lost { color: #ff6a7a; text-shadow: 0 0 10px rgba(255, 64, 96, 0.5); }

/* ---- overlays ---- */
.scanlines {
  position: absolute; inset: 0; z-index: 40; pointer-events: none; opacity: 0.18;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.9) 3px);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8);
}
#app.no-scanlines .scanlines { background: none; }

/* long screens: the way out stays in reach while the list scrolls */
.screen.scroll > .menu:last-child, #cache-options > .btn:last-child {
  position: sticky; bottom: calc(-16px - var(--safe-b)); padding: 10px 0 calc(12px + var(--safe-b));
  background: linear-gradient(rgba(1, 8, 4, 0), rgba(1, 8, 4, 0.98) 30%); z-index: 2;
}
#cache-options > .btn:last-child { width: 100%; margin: 0; }
.title .btn { background: rgba(2, 12, 6, 0.92); }
