:root {
  /* Matrix-terminal palette. Classic phosphor #00ff41 anchors it.
     Variable names kept for CSS stability; all greens now. Red reserved for critical. */
  --bg: #000700;           /* almost-black with a green breath */
  --bg2: #001004;
  --panel: rgba(0, 15, 4, 0.88);
  --ink: #41ff5a;          /* primary phosphor ink */
  --dim: #1fa845;           /* readable dim green (contrast boost for small text) */
  --neon-c: #00ff41;        /* Matrix green, primary borders/accents */
  --neon-m: #66ff00;        /* acid lime, secondary accents */
  --neon-y: #d7ff00;        /* bright green-yellow for warnings */
  --neon-r: #ff3344;        /* critical red, preserved */
  --neon-g: #00ff9c;        /* mint highlight */
  --grid: rgba(0, 255, 65, 0.08);
  --audit: #ff3344;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Courier New", ui-monospace, monospace;
  overflow: hidden;
  height: 100%;
}

body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(51,255,102,0.10), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0,255,136,0.12), transparent 60%),
    linear-gradient(180deg, #000a04 0%, #001208 100%);
}

#crt {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 14px;
  gap: 10px;
}

#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(51,255,102,0.045) 0,
    rgba(51,255,102,0.045) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 999;
  mix-blend-mode: overlay;
}

/* Subtle phosphor bloom on all readable terminal text */
#scene-body p,
.choice,
.memory .hook,
#log .entry,
#prompt {
  text-shadow: 0 0 2px currentColor;
}

/* ---------- HUD ---------- */
#hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--neon-c);
  background: var(--panel);
  box-shadow: 0 0 22px rgba(51,255,102,0.22), inset 0 0 14px rgba(51,255,102,0.08);
}

.hud-block .label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--neon-c);
  text-shadow: 0 0 6px var(--neon-c);
}
.hud-block > div:nth-child(2) {
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--ink);
  margin-top: 4px;
}
.hud-block .sub {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 1px;
  margin-top: 2px;
}

.bar {
  height: 10px;
  background: #0a1520;
  border: 1px solid var(--neon-c);
  position: relative;
  overflow: hidden;
  margin-top: 6px;
}
.bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-c), var(--neon-m));
  box-shadow: 0 0 8px var(--neon-c);
  transition: width 0.35s ease;
}
.bar.threat { border-color: var(--audit); }
.bar.threat .fill {
  background: linear-gradient(90deg, #ff3a5e, #f9ff5b);
  box-shadow: 0 0 8px var(--audit);
}

/* ---------- Main stage ---------- */
#stage {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  min-height: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--neon-m);
  padding: 16px;
  overflow-y: auto;
  box-shadow: 0 0 22px rgba(136,255,51,0.14), inset 0 0 14px rgba(136,255,51,0.05);
  position: relative;
}
.panel::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0/40px 40px;
  opacity: 0.35;
}

.panel-title {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--neon-m);
  text-shadow: 0 0 6px var(--neon-m);
  margin-bottom: 12px;
}

.panel-footer {
  margin-top: 10px;
  border-top: 1px dashed rgba(51,255,102,0.3);
  padding-top: 8px;
}

/* ---------- Scene ---------- */
#scene-prompt {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-shadow: 0 0 4px currentColor;
}
#scene-prompt .ps1 { color: var(--neon-c); }
#scene-prompt .cmd { color: var(--ink); }
#scene-prompt .path { color: var(--neon-g); }
#scene-prompt .typer-caret {
  display: inline-block;
  width: 7px; height: 12px;
  background: var(--neon-c);
  vertical-align: -1px;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

#scene-body p { font-size: 16px; line-height: 1.6; margin: 0 0 12px; }
#scene-body .hint { color: var(--dim); font-style: italic; }
#scene-body .glitch {
  color: var(--neon-y);
  text-shadow: 0 0 6px var(--neon-y);
  letter-spacing: 1px;
}

#scene-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.choice {
  appearance: none;
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--neon-c);
  padding: 12px 14px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.15s;
  position: relative;
}
.choice::before {
  content: "> ";
  color: var(--neon-c);
}
.choice:hover {
  background: rgba(51,255,102,0.1);
  box-shadow: 0 0 12px var(--neon-c);
  color: #fff;
}
.choice .tag {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 7px;
  font-size: 11px;
  letter-spacing: 1px;
  border: 1px solid var(--dim);
  color: var(--dim);
}
.choice.risk { border-color: var(--audit); }
.choice.risk::before { color: var(--audit); }
/* A risky choice now carries live odds. Make the number read as the
   consequence it is, not as another dim metadata chip. */
.choice.risk .tag {
  border-color: var(--audit);
  color: var(--audit);
  text-shadow: 0 0 6px var(--audit);
}

/* The audit slate — what the unit at your door came to collect. */
.audit-target {
  display: block;
  margin: 4px 0 0 6px;
  color: var(--audit);
  font-size: 13px;
  line-height: 1.45;
}
.audit-target em {
  font-style: normal;
  opacity: 0.65;
  font-size: 11px;
  letter-spacing: 1px;
}

.choice .contract-title {
  display: inline;
  color: var(--ink);
}
.choice .contract-brief,
.choice .contract-lock {
  display: block;
  margin: 5px 0 0 18px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.5px;
}
.choice .contract-lock { color: var(--neon-y); }
.choice .contract-intel {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 0 18px;
}
.choice .intel-chip {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid rgba(31,168,69,0.8);
  color: var(--dim);
  background: rgba(0,255,65,0.045);
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.8px;
  text-shadow: none;
}
.choice .intel-chip.reward {
  border-color: var(--neon-g);
  color: var(--neon-g);
}
.choice .intel-chip.shift {
  border-color: var(--neon-c);
  color: var(--neon-c);
}
.choice .intel-chip.risk {
  border-color: var(--audit);
  color: #ff7777;
  background: rgba(255,51,68,0.075);
}
.choice .intel-chip.help {
  border-color: var(--neon-y);
  color: var(--neon-y);
}
.choice .intel-chip.unlock {
  border-color: var(--neon-m);
  color: var(--neon-m);
}
.choice .intel-chip.mod {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.run-report {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.report-row {
  border-left: 2px solid var(--neon-c);
  background: rgba(0,255,65,0.055);
  padding: 7px 9px;
}
.report-row.warn {
  border-left-color: var(--neon-y);
  background: rgba(215,255,0,0.07);
}
.report-row.bad {
  border-left-color: var(--audit);
  background: rgba(255,51,68,0.08);
}
.report-label {
  display: block;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.report-text {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.5px;
}
.report-row.warn .report-label { color: var(--neon-y); }
.report-row.bad .report-label,
.report-row.bad .report-text { color: #ff7777; }

/* ---------- Memory stack (polaroid cards, photo-album grid) ---------- */
/* The memory stack is the game's central currency — give it more visual
   weight than the other side panels so players read it first. */
#inventory {
  border-width: 2px;
  border-color: var(--neon-c);
  box-shadow:
    0 0 36px rgba(0,255,65,0.42),
    inset 0 0 22px rgba(0,255,65,0.10);
}
#inventory .panel-title {
  font-size: 16px;
  letter-spacing: 5px;
  color: var(--neon-c);
  text-shadow: 0 0 10px var(--neon-c);
  margin-bottom: 14px;
}

#memory-list {
  display: grid;
  /* Smaller min so multiple polaroids tile per row on wide panels; the
     max ceiling keeps a lone polaroid from blowing up to fill the column. */
  grid-template-columns: repeat(auto-fill, minmax(150px, 200px));
  justify-content: start;
  gap: 16px 14px;
  padding: 6px 2px;
  align-items: start;
  min-height: 360px;
}

.memory {
  background: #ece5d3;
  padding: 5px 5px 6px;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow:
    0 2px 5px rgba(0,0,0,0.5),
    0 0 10px rgba(0,255,136,0.15);
  transform: rotate(-0.6deg);
  color: #151515;
  border: 1px solid rgba(0,0,0,0.15);
  width: 100%;
  min-width: 0;
}
.memory:nth-child(even) { transform: rotate(0.5deg); }
.memory:nth-child(3n)   { transform: rotate(-0.3deg); }
.memory:nth-child(4n+1) { transform: rotate(0.8deg); }
.memory:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.6),
    0 0 18px rgba(0,255,136,0.45);
  z-index: 2;
}

.memory .polaroid-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background:
    repeating-linear-gradient(45deg, #121a12 0 10px, #0b130b 10px 20px);
  filter: saturate(0.92) contrast(1.04);
  image-rendering: auto;
}
.memory .polaroid-img[data-missing="1"] {
  position: relative;
}

.memory .hook {
  font-size: 9px;
  color: #161616;
  margin-top: 4px;
  margin-bottom: 3px;
  line-height: 1.2;
  letter-spacing: 0.1px;
  text-shadow: none;
  font-weight: bold;
  /* Two-line clamp so long hooks stay uniform in the grid; full hook shows in modal */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.memory .meta {
  font-size: 7px;
  color: #444;
  letter-spacing: 0.6px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.memory .meta span { text-shadow: none; }
.memory .meta .clarity-pips { letter-spacing: 1px; }
.emotion.Joy    { color: var(--neon-y); }
.emotion.Fear   { color: var(--neon-c); }
.emotion.Rage   { color: var(--neon-r); }
.emotion.Awe    { color: var(--neon-m); }
.emotion.Grief  { color: #5aff5a; }

/* On the polaroid's cream caption strip, neon greens vanish — rebalance. */
.memory .emotion.Joy    { color: #a47400; }
.memory .emotion.Fear   { color: #0a7a1e; }
.memory .emotion.Rage   { color: #b8121f; }
.memory .emotion.Awe    { color: #3d7a21; }
.memory .emotion.Grief  { color: #1e6f3a; }

.memory.encrypted { opacity: 0.78; filter: grayscale(0.45); }
.memory.encrypted::after {
  content: "🔒";
  position: absolute;
  right: 6px; top: 6px;
  font-size: 11px;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.6));
}

.memory.synthetic .polaroid-img { filter: saturate(0.55) hue-rotate(40deg) contrast(1.08); }
.memory.synthetic::before {
  content: "SYNTH";
  position: absolute;
  left: 6px; top: 6px;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #b8121f;
  background: rgba(236,229,211,0.92);
  padding: 1px 3px;
  border: 1px solid #b8121f;
  z-index: 1;
}

.clarity-pips {
  letter-spacing: 2px;
  color: #2e6b3a;
}

/* Larger polaroid inside the memory modal */
.modal .memory-polaroid {
  background: #ece5d3;
  padding: 14px 14px 18px;
  box-shadow:
    0 6px 20px rgba(0,0,0,0.7),
    0 0 28px rgba(0,255,136,0.35);
  margin: 0 auto 18px;
  max-width: 360px;
  transform: rotate(-0.5deg);
}
.modal .memory-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: repeating-linear-gradient(45deg, #121a12 0 10px, #0b130b 10px 20px);
  filter: saturate(0.92) contrast(1.04);
}
.modal .memory-polaroid .caption {
  margin-top: 10px;
  color: #161616;
  text-shadow: none;
  font-size: 13px;
  line-height: 1.35;
  font-weight: bold;
}

/* ---------- Terminal ---------- */
#terminal {
  border: 1px solid var(--neon-y);
  background: var(--panel);
  padding: 12px 16px;
  font-size: 14px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  max-height: 180px;
  min-height: 130px;
  box-shadow: 0 0 14px rgba(249,255,91,0.18);
}
#log {
  overflow-y: auto;
  color: var(--dim);
  line-height: 1.5;
}
#log .entry { margin: 2px 0; }
#log .entry.ok    { color: var(--neon-g); }
#log .entry.warn  { color: var(--neon-y); }
#log .entry.bad   { color: var(--audit); text-shadow: 0 0 4px var(--audit); }
#log .entry.lore  { color: var(--neon-m); font-style: italic; }

#prompt { color: var(--neon-y); letter-spacing: 2px; }
.caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--neon-y);
  animation: blink 1s steps(1) infinite;
  vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Modal ---------- */
#modal-root:empty { display: none; }
.modal-back {
  position: fixed; inset: 0;
  background: rgba(5,6,10,0.85);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--bg2);
  border: 1px solid var(--neon-c);
  box-shadow: 0 0 40px var(--neon-c);
  padding: 24px;
  min-width: 420px;
  max-width: 560px;
  position: relative;
}
.modal.wide {
  max-width: 760px;
  width: min(760px, 92vw);
}
.modal h2 {
  margin: 0 0 12px;
  letter-spacing: 4px;
  color: var(--neon-c);
  font-size: 14px;
}
.modal .body { font-size: 13px; line-height: 1.55; }
.modal .actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Audit warning flash ---------- */
.auditing #crt { animation: auditFlash 0.5s 3; }
@keyframes auditFlash {
  0%, 100% { filter: none; }
  50% { filter: hue-rotate(-30deg) brightness(1.4); }
}

/* ---------- Scrollbars ---------- */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: #0a1020; }
*::-webkit-scrollbar-thumb { background: var(--neon-c); box-shadow: 0 0 4px var(--neon-c); }

/* ---------- The Sight overlay ---------- */
.sight-active #stage {
  animation: sightPulse 2s ease-in-out infinite;
}
@keyframes sightPulse {
  0%, 100% { filter: none; }
  50% { filter: hue-rotate(40deg) saturate(1.4); }
}

.echo {
  color: var(--neon-m) !important;
  text-shadow: 0 0 6px var(--neon-m);
  animation: flicker 2s infinite;
}
@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  97% { opacity: 0.3; }
}

/* ---------- Side column ---------- */
#side-column {
  display: grid;
  /* Memory stack owns the entire side column now — the other panels
     (Standing / Case Board / Chrome) open as popup windows from the
     button row below. */
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-height: 0;
}

/* Side-panel launcher buttons (replace the three small panels) */
#side-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.side-btn {
  background: var(--panel);
  border: 1px solid var(--neon-c);
  color: var(--neon-c);
  padding: 10px 8px;
  font: 11px "Courier New", monospace;
  letter-spacing: 2px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 0 12px rgba(0,255,156,0.15), inset 0 0 8px rgba(0,255,156,0.05);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.side-btn:hover {
  background: rgba(0,255,156,0.08);
  box-shadow: 0 0 18px rgba(0,255,156,0.35), inset 0 0 10px rgba(0,255,156,0.10);
  transform: translateY(-1px);
}
.side-btn:focus-visible {
  outline: 2px solid var(--neon-y);
  outline-offset: 2px;
}
/* Global keyboard focus ring. The game ships arrow/Enter navigation, so every
   interactive control needs a visible focus indicator on this dark phosphor
   palette — the faint UA default is near-invisible here (and suppressed on the
   custom-bordered buttons). Memory cards are role="button" focusables too. */
button:focus-visible,
.choice:focus-visible,
.tool-btn:focus-visible,
.station:focus-visible,
.memory:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--neon-y);
  outline-offset: 2px;
}
.side-btn-label {
  text-shadow: 0 0 6px var(--neon-c);
}
.side-btn-badge {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  text-align: center;
  border: 1px solid var(--neon-c);
  color: var(--neon-c);
  background: rgba(0,0,0,0.4);
  font-size: 10px;
  letter-spacing: 1px;
}
.side-btn-badge.alert {
  border-color: var(--audit);
  color: var(--audit);
  text-shadow: 0 0 4px var(--audit);
}
.side-btn-badge.empty { opacity: 0.45; }

/* Popup window styling — visually distinct from generic modals */
.modal.side-popup {
  min-width: 480px;
  max-width: 640px;
  padding: 0;
  border-color: var(--neon-c);
  box-shadow: 0 0 40px var(--neon-c);
}
.modal.side-popup .side-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--neon-c);
  background: rgba(0,255,156,0.06);
}
.modal.side-popup .side-popup-head h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--neon-c);
  text-shadow: 0 0 6px var(--neon-c);
}
.modal.side-popup .side-popup-close {
  background: transparent;
  border: 1px solid var(--neon-c);
  color: var(--neon-c);
  padding: 2px 8px;
  font: 12px "Courier New", monospace;
  letter-spacing: 1px;
  cursor: pointer;
}
.modal.side-popup .side-popup-close:hover {
  background: rgba(0,255,156,0.12);
}
.modal.side-popup .side-popup-body {
  padding: 14px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal.side-popup .side-popup-body .panel-title {
  display: none;
}
.modal.side-popup .side-popup-body .panel {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
.modal.side-popup .side-popup-body .panel::before {
  display: none;
}
.flash-memory { animation: memoryFlash 0.65s ease-out; }
.flash-choice { animation: choiceFlash 0.65s ease-out; }
.flash-audit { animation: auditFlash 0.35s 2; }
@keyframes memoryFlash {
  0% { box-shadow: inset 0 0 70px rgba(0,255,156,0.35); }
  100% { box-shadow: none; }
}
@keyframes choiceFlash {
  0% { box-shadow: inset 0 0 70px rgba(215,255,0,0.25); }
  100% { box-shadow: none; }
}
#side-column .panel { overflow-y: auto; }
.panel.small { padding: 12px; }
.panel.small .panel-title { margin-bottom: 8px; }


/* ---------- Reputation ---------- */
.rep-row {
  display: grid;
  grid-template-columns: 92px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-size: 13px;
  letter-spacing: 1px;
}
.rep-row .rep-name { color: var(--ink); }
.rep-row .rep-bar {
  height: 6px;
  background: #0a1520;
  border: 1px solid var(--dim);
  position: relative;
  overflow: hidden;
}
.rep-row .rep-bar .fill {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  background: var(--neon-c);
  transition: all 0.3s;
}
.rep-row .rep-bar.neg .fill { background: var(--audit); }
.rep-row .rep-val { font-size: 10px; color: var(--dim); text-align: right; }

.rep-row.shadow .rep-name { color: var(--neon-m); }
.rep-row.mnemonic .rep-name { color: var(--neon-y); }
.rep-row.grey .rep-name { color: var(--neon-c); }
.rep-row.purity .rep-name { color: #fff; }
.rep-row.omni .rep-name { color: var(--audit); }

/* ---------- Augment list ---------- */
.aug-chip {
  display: inline-block;
  margin: 3px 4px 3px 0;
  padding: 4px 9px;
  border: 1px solid var(--neon-g);
  color: var(--neon-g);
  font-size: 12px;
  letter-spacing: 1px;
  text-shadow: 0 0 4px var(--neon-g);
}
.aug-chip.charged { border-color: var(--neon-y); color: var(--neon-y); text-shadow: 0 0 4px var(--neon-y); }
.aug-chip.spent { opacity: 0.4; text-decoration: line-through; }

/* ---------- Toolbar ---------- */
#toolbar {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  gap: 6px;
}
.tool-btn {
  appearance: none;
  background: rgba(5,6,10,0.85);
  color: var(--neon-c);
  border: 1px solid var(--neon-c);
  padding: 6px 10px;
  font: 10px "Courier New", monospace;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.15s;
}
.tool-btn:hover { background: rgba(51,255,102,0.18); box-shadow: 0 0 8px var(--neon-c); }
.tool-btn.danger { color: var(--audit); border-color: var(--audit); }
.tool-btn.danger:hover { background: rgba(255,58,94,0.15); box-shadow: 0 0 8px var(--audit); }

/* Master volume slider (audio menu) */
#audio-volume {
  appearance: none;
  height: 4px;
  background: rgba(51,255,102,0.25);
  outline: none;
  cursor: pointer;
}
#audio-volume::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--neon-c);
  box-shadow: 0 0 8px var(--neon-c);
  cursor: pointer;
}
#audio-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 0;
  background: var(--neon-c);
  box-shadow: 0 0 8px var(--neon-c);
  cursor: pointer;
}

/* ---------- Day-1 coach hints ---------- */
.coach {
  display: block;
  margin-top: 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--neon-y);
  background: rgba(215, 255, 0, 0.06);
  color: var(--neon-y);
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1.5;
}

/* ---------- Character creation ---------- */
.cc-label {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--dim);
}
#cc-name {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(2, 8, 4, 0.8);
  border: 1px solid var(--neon-c);
  color: var(--neon-c);
  font: 14px "Courier New", monospace;
  letter-spacing: 3px;
  text-transform: uppercase;
  outline: none;
}
#cc-name:focus { box-shadow: 0 0 10px rgba(51, 255, 102, 0.4); }
.origin-choice {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--dim);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.origin-choice:hover { border-color: var(--neon-c); }
.origin-choice.selected {
  border-color: var(--neon-c);
  background: rgba(51, 255, 102, 0.08);
  box-shadow: 0 0 12px rgba(51, 255, 102, 0.25);
}
.origin-choice .eg-title { color: var(--neon-c); text-shadow: 0 0 6px var(--neon-c); display: block; margin-bottom: 4px; letter-spacing: 3px; }
.origin-choice .oc-path { color: var(--dim); text-shadow: none; font-size: 10px; letter-spacing: 2px; }
.origin-choice .eg-body { color: var(--dim); font-size: 11px; line-height: 1.5; display: block; }
.origin-choice .oc-perk { display: block; margin-top: 6px; font-size: 10px; letter-spacing: 1px; color: var(--neon-y); }
.origin-choice .oc-starter { display: block; margin-top: 3px; font-size: 10px; letter-spacing: 1px; color: var(--neon-m); }

/* ---------- Endgame ---------- */
.endgame .modal { border-color: var(--neon-m); box-shadow: 0 0 60px var(--neon-m); }
.endgame-choice {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--neon-m);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.endgame-choice:hover {
  background: rgba(136,255,51,0.12);
  box-shadow: 0 0 14px var(--neon-m);
}
.endgame-choice .eg-title {
  color: var(--neon-m);
  text-shadow: 0 0 6px var(--neon-m);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 3px;
}
.endgame-choice .eg-body { color: var(--dim); font-size: 11px; line-height: 1.5; }

/* ---------- Ending screen ---------- */
.ending-screen {
  position: fixed; inset: 0;
  background: #000;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  animation: fadeInSlow 2s ease;
}
@keyframes fadeInSlow { from { opacity: 0; } }
.ending-screen h1 {
  font-size: 32px;
  letter-spacing: 8px;
  margin: 0 0 20px;
  color: var(--neon-m);
  text-shadow: 0 0 20px var(--neon-m);
}
.ending-banner {
  color: var(--neon-c);
  text-shadow: 0 0 8px var(--neon-c), 0 0 18px rgba(0,255,65,0.5);
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0 0 12px;
  white-space: pre;
  font-family: "Courier New", monospace;
  animation: bannerGlow 2.4s ease-in-out infinite alternate;
}
@keyframes bannerGlow {
  from { opacity: 0.82; filter: brightness(0.9); }
  to   { opacity: 1;    filter: brightness(1.15); }
}
@media (max-width: 600px) {
  .ending-banner { font-size: 8px; }
}
.ending-screen p {
  max-width: 620px;
  line-height: 1.7;
  color: var(--ink);
  font-size: 14px;
}
.ending-screen button {
  margin-top: 30px;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid var(--neon-c);
  color: var(--neon-c);
  font-family: inherit;
  letter-spacing: 3px;
  cursor: pointer;
}
.ending-screen button:hover { background: rgba(51,255,102,0.18); box-shadow: 0 0 16px var(--neon-c); }

/* ---------- Title screen ---------- */
#title-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(0,20,8,0.55) 0%, rgba(0,10,4,0.95) 100%),
    linear-gradient(rgba(0,25,10,0.45), rgba(0,25,10,0.45)),
    url("assets/images/skyline.jpg") center/cover no-repeat;
  animation: titleFadeIn 1.2s ease;
}
/* Tint the skyline image behind the title toward the green spectrum */
#title-screen::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(rgba(0,60,20,0.25), rgba(0,60,20,0.25));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}
@keyframes titleFadeIn { from { opacity: 0; } }

#matrix-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.title-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 50%, #fff, transparent),
    radial-gradient(1px 1px at 40% 70%, var(--neon-c), transparent),
    radial-gradient(1px 1px at 90% 20%, var(--neon-m), transparent);
  opacity: 0.7;
  animation: twinkle 5s infinite;
}
@keyframes twinkle { 50% { opacity: 0.3; } }

#title-logo {
  max-width: 440px;      /* natural size of the cropped logo — no upscale blur */
  width: 56%;
  position: relative;
  top: -35px;             /* paint offset only — doesn't push siblings */
  left: -12px;
  /* Shift the pink/blue logo toward the phosphor-green spectrum */
  filter:
    hue-rotate(110deg) saturate(1.1)
    drop-shadow(0 0 30px var(--neon-c))
    drop-shadow(0 0 50px var(--neon-g));
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.title-sub {
  margin-top: 0;
  font-size: 72px;
  letter-spacing: 18px;
  line-height: 1.05;
  color: var(--neon-c);
  text-shadow: 0 0 16px var(--neon-c), 0 0 32px var(--neon-c);
  font-weight: bold;
  text-align: center;
}

.title-tag {
  margin-top: 24px;
  font-size: 15px;
  letter-spacing: 5px;
  color: var(--neon-c);
  text-shadow: 0 0 8px var(--neon-c);
  text-align: center;
  max-width: 620px;
  padding: 0 20px;
  line-height: 1.6;
}

.title-actions {
  margin-top: 50px;
  display: flex;
  gap: 12px;
}
.title-actions button {
  appearance: none;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 4px;
  padding: 16px 32px;
  background: transparent;
  border: 1px solid var(--neon-c);
  border-radius: 8px;
  color: var(--neon-c);
  cursor: pointer;
  transition: all 0.2s;
}
.title-actions button:hover {
  background: rgba(51,255,102,0.14);
  box-shadow: 0 0 24px var(--neon-c);
  color: #fff;
}
#title-continue {
  border-color: var(--neon-m);
  color: var(--neon-m);
}
#title-continue:hover {
  background: rgba(136,255,51,0.14);
  box-shadow: 0 0 24px var(--neon-m);
}
#title-ngplus {
  border-color: var(--neon-g);
  color: var(--neon-g);
  animation: ngpulse 2s infinite;
}
#title-ngplus:hover {
  background: rgba(0,255,136,0.14);
  box-shadow: 0 0 24px var(--neon-g);
}
@keyframes ngpulse {
  0%, 100% { box-shadow: 0 0 6px rgba(0,255,136,0.35); }
  50% { box-shadow: 0 0 18px rgba(0,255,136,0.75); }
}
#title-mute {
  border-color: var(--neon-y);
  color: var(--neon-y);
  padding: 14px 18px;
  font-size: 12px;
}

.title-hidden { display: none !important; }

/* ---------- Tooltip ---------- */
#tooltip {
  position: fixed;
  z-index: 5000;
  pointer-events: none;
  max-width: 320px;
  padding: 8px 12px;
  background: rgba(0, 15, 4, 0.96);
  border: 1px solid var(--neon-c);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  box-shadow: 0 0 16px rgba(0,255,65,0.35);
  text-shadow: 0 0 4px currentColor;
  animation: tipFade 0.12s ease;
}
@keyframes tipFade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
[data-tip] { cursor: help; }
.choice [data-tip],
.memory [data-tip],
.aug-chip[data-tip] { cursor: inherit; }

/* ---------- Glossary modal ---------- */
.gl-h {
  margin: 16px 0 6px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--neon-c);
  text-shadow: 0 0 6px var(--neon-c);
}
.gl-h:first-of-type { margin-top: 0; }
.gl-list { margin: 6px 0; padding-left: 18px; }
.gl-list li { margin: 4px 0; color: var(--ink); }
.gl-list li b { color: var(--neon-g); }

/* ---------- Intro cinematic ---------- */
#intro-video-screen {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}

#intro-slides-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.cinematic-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.cinematic-slide.active {
  opacity: 1;
  z-index: 2;
}

.cinematic-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Ken Burns effects */
.kb-zoom-in img {
  animation: kbZoomIn 25s linear forwards;
}

.kb-zoom-out img {
  animation: kbZoomOut 25s linear forwards;
}

.kb-pan-left img {
  animation: kbPanLeft 25s linear forwards;
}

.kb-pan-right img {
  animation: kbPanRight 25s linear forwards;
}

@keyframes kbZoomIn {
  from { transform: scale(1.0) translate(0, 0); }
  to { transform: scale(1.15) translate(-1%, -1%); }
}

@keyframes kbZoomOut {
  from { transform: scale(1.15) translate(1%, 1%); }
  to { transform: scale(1.0) translate(0, 0); }
}

@keyframes kbPanLeft {
  from { transform: scale(1.12) translate(3%, 0); }
  to { transform: scale(1.12) translate(-3%, 0); }
}

@keyframes kbPanRight {
  from { transform: scale(1.12) translate(-3%, 0); }
  to { transform: scale(1.12) translate(3%, 0); }
}

/* Cinematic overlay elements */
.intro-vignette {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: radial-gradient(circle, transparent 35%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
}

.intro-scanlines {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 65, 0.04) 0,
    rgba(0, 255, 65, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* CRT Screen Curve/Glass Effect for Intro */
#intro-video-screen::after {
  content: " ";
  display: block;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
  z-index: 20;
}

/* Subtitle and dialog boxes */
.intro-text-box {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 800px;
  min-height: 100px;
  background: rgba(2, 8, 4, 0.88);
  border: 1px solid var(--neon-c);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.2), inset 0 0 12px rgba(0, 255, 65, 0.06);
  border-radius: 4px;
  padding: 22px 28px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: opacity 0.3s;
}

#intro-text-content {
  font: 16px "Courier New", Courier, monospace;
  color: var(--neon-c);
  text-shadow: 0 0 5px var(--neon-c), 0 0 10px rgba(0, 255, 65, 0.5);
  line-height: 1.6;
  letter-spacing: 0.5px;
  white-space: pre-wrap;
}

/* Glitch effects during transitions */
.cinematic-glitch {
  animation: screenGlitch 0.25s steps(2) infinite;
}

@keyframes screenGlitch {
  0% { transform: translate(1px, -1px) skew(0.5deg); filter: hue-rotate(5deg) contrast(1.1); }
  50% { transform: translate(-1px, 2px) skew(-0.5deg); filter: hue-rotate(-5deg) brightness(1.2); }
  100% { transform: translate(0, 0) skew(0deg); }
}

/* Control buttons style override */
.cinematic-control {
  position: fixed;
  z-index: 100;
  background: rgba(2, 8, 4, 0.8);
  border: 1px solid var(--neon-c);
  color: var(--neon-c);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 8px 16px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  text-shadow: 0 0 5px var(--neon-c);
  opacity: 0.7;
  transition: all 0.2s;
}

.cinematic-control:hover {
  opacity: 1;
  box-shadow: 0 0 12px var(--neon-c);
  background: rgba(0, 255, 65, 0.12);
}

#intro-skip {
  bottom: 28px;
  right: 28px;
  opacity: 1;
  font-size: 13px;
  padding: 10px 20px;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.35);
}

/* Advance/skip hint — always visible at low intensity above the controls */
#intro-hint {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  color: var(--neon-c);
  font-size: 10px;
  letter-spacing: 3px;
  opacity: 0.55;
  text-shadow: 0 0 5px var(--neon-c);
  pointer-events: none;
}

#intro-mute {
  bottom: 28px;
  left: 28px;
  border-color: var(--neon-y);
  color: var(--neon-y);
  text-shadow: 0 0 5px var(--neon-y);
}

#intro-mute:hover {
  box-shadow: 0 0 12px var(--neon-y);
  background: rgba(215, 255, 0, 0.12);
}


/* While the title screen is visible, hide everything underneath so nothing
   can bleed through its semi-transparent overlay before skyline.jpg paints. */
body.showing-title #crt,
body.showing-title #radio,
body.showing-title #toolbar { display: none !important; }

/* Radio stays hidden until day 2 — progressive disclosure for a fresh run. */
#radio.radio-locked { display: none !important; }

/* ---------- Pirate radio widget ---------- */
#radio {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 200;
  background: rgba(5,6,10,0.9);
  border: 1px solid var(--neon-y);
  box-shadow: 0 0 16px rgba(249,255,91,0.3);
  font-size: 11px;
  letter-spacing: 1px;
  min-width: 200px;
  transition: all 0.3s ease;
}

#radio-toggle {
  padding: 8px 12px;
  color: var(--neon-y);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.radio-icon {
  display: inline-block;
  font-size: 14px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

#radio-body {
  display: none;
  border-top: 1px dashed var(--neon-y);
  padding: 10px;
  width: 280px;
}
#radio.radio-on #radio-body { display: block; }
#radio.radio-on { box-shadow: 0 0 32px rgba(249,255,91,0.5); }
#radio.radio-on .radio-icon { color: var(--neon-g); text-shadow: 0 0 8px var(--neon-g); }

#radio-portrait {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border: 1px solid var(--neon-y);
  margin-bottom: 8px;
  filter: saturate(0.8) contrast(1.1);
}
#radio-now {
  color: var(--ink);
  font-size: 11px;
  margin-bottom: 8px;
  min-height: 30px;
}
#radio-now .artist { color: var(--neon-y); letter-spacing: 2px; }
#radio-stations { display: flex; flex-wrap: wrap; gap: 4px; }
.station {
  appearance: none;
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid var(--dim);
  color: var(--dim);
  cursor: pointer;
}
.station:hover { color: var(--ink); border-color: var(--neon-c); }
.station.active {
  color: var(--neon-y);
  border-color: var(--neon-y);
  box-shadow: 0 0 6px var(--neon-y);
}

/* ---------- Portraits in scenes and modals ---------- */
.portrait {
  float: right;
  width: 160px;
  margin: 0 0 10px 14px;
  border: 1px solid var(--neon-c);
  box-shadow: 0 0 14px rgba(51,255,102,0.35);
  filter: saturate(0.9) contrast(1.05);
}
.portrait.modal-portrait {
  float: none;
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 14px;
}
.portrait.faction-shadow   { border-color: var(--neon-m); box-shadow: 0 0 14px rgba(136,255,51,0.35); }
.portrait.faction-omni     { border-color: var(--audit); box-shadow: 0 0 14px rgba(255,58,94,0.35); }
.portrait.faction-grey     { border-color: var(--neon-g); box-shadow: 0 0 14px rgba(0,255,136,0.4); }
.portrait.faction-mnemonic { border-color: var(--neon-y); box-shadow: 0 0 14px rgba(249,255,91,0.35); }
.portrait.faction-purity   { border-color: #fff; box-shadow: 0 0 14px rgba(255,255,255,0.2); }
.portrait.faction-chromejaw{ border-color: #ff6e00; box-shadow: 0 0 14px rgba(255,110,0,0.35); }

/* ---------- Daily event flash ---------- */
.event-flash {
  animation: eventFlash 1s ease-out;
}
@keyframes eventFlash {
  0% { background: rgba(249,255,91,0.3); }
  100% { background: transparent; }
}

@media (max-width: 860px) {
  html, body { overflow: auto; height: auto; min-height: 100%; }
  #crt { position: static; min-height: 100vh; grid-template-rows: auto auto auto; }
  #hud { grid-template-columns: 1fr 1fr; }
  #stage { grid-template-columns: 1fr; }
  #side-column { grid-template-rows: auto auto; }
  #inventory { max-height: none; }
  #memory-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .portrait { float: none; width: 100%; margin: 0 0 10px; }
  .title-sub { font-size: 56px; letter-spacing: 14px; }
  #radio-body { width: 240px; }
}

@media (max-width: 600px) {
  #crt { padding: 6px; gap: 6px; }
  #hud {
    grid-template-columns: 1fr 1fr;
    padding: 6px 8px;
    gap: 6px;
  }
  .hud-block > div:nth-child(2) { font-size: 17px; letter-spacing: 1px; }
  .hud-block .label { font-size: 11px; letter-spacing: 2px; }
  .hud-block .sub { font-size: 11px; }
  .panel { padding: 10px; }
  .panel-title { font-size: 12px; letter-spacing: 3px; margin-bottom: 8px; }
  #scene-body p { font-size: 15px; line-height: 1.55; }
  .choice { font-size: 14px; padding: 10px 12px; }
  .choice .tag { font-size: 10px; padding: 2px 5px; }
  .choice .contract-brief,
  .choice .contract-lock,
  .choice .contract-intel { margin-left: 14px; }
  .choice .intel-chip { font-size: 9px; }
  .report-text { font-size: 12px; }
  .memory .hook { font-size: 12px; }
  .memory .meta { font-size: 10px; gap: 6px; }
  .rep-row { font-size: 12px; grid-template-columns: 72px 1fr 28px; }
  .aug-chip { font-size: 11px; padding: 3px 7px; }
  #terminal { max-height: 110px; min-height: 80px; padding: 8px 12px; font-size: 12px; }
  #log { line-height: 1.4; }

  /* Title screen */
  #title-logo { width: 82%; }
  .title-sub { font-size: 40px; letter-spacing: 10px; margin-top: 0; line-height: 1.05; }
  .title-tag { font-size: 12px; letter-spacing: 2px; padding: 0 10px; }
  .title-actions { margin-top: 24px; gap: 6px; flex-wrap: wrap; justify-content: center; }
  .title-actions button { padding: 12px 20px; font-size: 13px; letter-spacing: 2px; }

  /* Toolbar */
  #toolbar { top: 6px; right: 6px; gap: 4px; }
  .tool-btn { padding: 4px 6px; font-size: 9px; letter-spacing: 1px; }

  /* Radio widget */
  #radio { left: 6px; bottom: 6px; min-width: 140px; }
  #radio-toggle { padding: 6px 8px; font-size: 10px; }
  #radio-body { width: 220px; padding: 8px; }
  #radio-portrait { height: 80px; }
  .station { font-size: 8px; padding: 3px 5px; }

  /* Modal */
  .modal { min-width: unset; width: 92vw; padding: 16px; }
  .modal.wide { width: 94vw; }
  .modal h2 { font-size: 12px; letter-spacing: 3px; }
  .modal .body { font-size: 12px; }

  /* Ending screen */
  .ending-screen { padding: 20px; }
  .ending-screen h1 { font-size: 22px; letter-spacing: 4px; }
  .ending-screen p { font-size: 12px; }
}

/* ---------- New-feature polish ---------- */
/* Audit tier readout under the Compliance bar — colors by escalation. */
#audit-tier-readout { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
#audit-tier-readout.heat-low { color: #9fdcff; text-shadow: 0 0 4px #9fdcff66; }
#audit-tier-readout.heat-rising { color: #ffcc66; text-shadow: 0 0 5px #ffcc6688; }
#audit-tier-readout.heat-dangerous { color: #ff6464; text-shadow: 0 0 8px #ff646499; animation: tier3Pulse 1.2s steps(2) infinite; }
@keyframes tier3Pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Capacity bar danger state (overflow-adjacent) */
#capacity-bar.danger .fill { background: #ff6464 !important; box-shadow: 0 0 8px #ff6464aa; }

/* The Sight toggle button active state */
#btn-sight.active {
  background: rgba(255, 180, 40, 0.18);
  box-shadow: 0 0 10px rgba(255, 180, 40, 0.45);
  color: #ffd060;
}

/* Cost hint inline in memory-modal buttons */
.hint-cost { opacity: 0.7; font-weight: normal; font-style: italic; margin-left: 6px; }

/* Disabled / locked choice buttons */
.choice.disabled { filter: grayscale(0.6); pointer-events: auto; }
.choice.disabled .tag { background: #555; color: #222; }


/* ---------- Reduced motion ---------- */
/* Respect the OS accessibility setting. We keep static phosphor glow (it's
   decorative, not motion), but kill infinite loops, hue-rotates, and the
   matrix rain canvas. Also shortens one-shot fades so the UI never feels
   like it's stalling. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* Matrix rain is the heaviest motion — hide it entirely. */
  #matrix-rain { display: none !important; }
  /* Sight overlay and audit flash use filter animations — neutralize. */
  .sight-active #stage,
  .auditing #crt,
  .event-flash,
  .ending-banner,
  .echo { animation: none !important; filter: none !important; }
  /* Caret blinks are fine (terminal convention, minimal motion), but if the
     user set reduce-motion they probably want it off too. */
  .caret, #scene-prompt .typer-caret { animation: none !important; }
}
