/* Presentation adapter; original source and game logic remain unchanged. */
:root {
  --bg-main: #edf1f6;
  --bg-card: #fcfdff;
  --bg-card-hover: #e4ecf6;
  --border-color: #899caf;
  --border-glow: #225da7;
  --text-primary: #182c45;
  --text-secondary: #445d77;
  --text-muted: #506580;
  --accent-blue: #0e5b91;
  --accent-emerald: #176545;
  --accent-amber: #865209;
  --accent-rose: #a62843;
  --accent-purple: #7933a8;
  --header-surface: #e6edf5;
  --inset: #e5ecf5;
  --terminal-surface: #f7faff;
  --selected-surface: #d8e8f6;
  --hover-surface: #e2edf8;
  --track: #becddd;
  --on-accent: #ffffff;
  --button-hover: #0b4874;
  --good-surface: #e0efe8;
  --good-text: #165d43;
  --bad-surface: #fae4e9;
  --bad-text: #932139;
  --neutral-surface: #f8edcf;
  --neutral-text: #75500a;
  --focus: #0e5b91;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-main: #0a0c10;
  --bg-card: #11141c;
  --bg-card-hover: #161b26;
  --border-color: #526179;
  --border-glow: #3b82f6;
  --text-primary: #f1f5f9;
  --text-secondary: #b6c3d7;
  --text-muted: #a1b1c7;
  --accent-blue: #38bdf8;
  --accent-emerald: #46d9a5;
  --accent-amber: #f5b643;
  --accent-rose: #ff849a;
  --accent-purple: #d6a0ff;
  --header-surface: #0d1117;
  --inset: #192536;
  --terminal-surface: #06090e;
  --selected-surface: #17374c;
  --hover-surface: #183041;
  --track: #4c5e74;
  --on-accent: #040d1a;
  --button-hover: #7dd3fc;
  --good-surface: #12352c;
  --good-text: #a7f3d0;
  --bad-surface: #3d1d2d;
  --bad-text: #fecdd3;
  --neutral-surface: #3a2f1e;
  --neutral-text: #fef3c7;
  --focus: #a3deff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg-main: #0a0c10;
  --bg-card: #11141c;
  --bg-card-hover: #161b26;
  --border-color: #526179;
  --border-glow: #3b82f6;
  --text-primary: #f1f5f9;
  --text-secondary: #b6c3d7;
  --text-muted: #a1b1c7;
  --accent-blue: #38bdf8;
  --accent-emerald: #46d9a5;
  --accent-amber: #f5b643;
  --accent-rose: #ff849a;
  --accent-purple: #d6a0ff;
  --header-surface: #0d1117;
  --inset: #192536;
  --terminal-surface: #06090e;
  --selected-surface: #17374c;
  --hover-surface: #183041;
  --track: #4c5e74;
  --on-accent: #040d1a;
  --button-hover: #7dd3fc;
  --good-surface: #12352c;
  --good-text: #a7f3d0;
  --bad-surface: #3d1d2d;
  --bad-text: #fecdd3;
  --neutral-surface: #3a2f1e;
  --neutral-text: #fef3c7;
  --focus: #a3deff;
  color-scheme: dark;
  }
}

/* Scan lines stay behind opaque interface panels instead of dimming their text. */
body::before { z-index: 0; opacity: .25; }
body > .container, body > footer { position: relative; z-index: 1; }
header { background: var(--header-surface); flex-wrap: wrap; gap: 12px; }
.scenario-box, .enemy-stats, .inquiry-chip, .meter-card { background: var(--inset); }
#debriefBox { background: var(--inset) !important; }
.terminal-box, .output-box { background: var(--terminal-surface); }
textarea#promptInput { color: var(--text-primary); }
textarea#promptInput::placeholder { color: var(--text-muted); }
.enemy-stat-bar, .meter-bar { background: var(--track); }
.mission-tab.active, .inquiry-chip.selected { background: var(--selected-surface); }
.inquiry-chip:hover, .btn-secondary:hover { background: var(--hover-surface); }
.btn-primary { color: var(--on-accent); }
.btn-primary:hover { background: var(--button-hover); }
.btn-secondary { background: var(--inset); }
.verdict-banner.success { background: var(--good-surface); color: var(--good-text); }
.verdict-banner.fail { background: var(--bad-surface); color: var(--bad-text); }
.verdict-banner.neutral { background: var(--neutral-surface); color: var(--neutral-text); }
.theme-toggle { border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); background: var(--bg-card); font: .78rem var(--font-mono); padding: 8px 12px; min-height: 44px; cursor: pointer; white-space: nowrap; }
button:focus-visible, textarea#promptInput:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 600px) {
 header { padding: 14px 18px; position: static; }
 .header-stats { flex-wrap: wrap; gap: 10px; }
 .logo { flex-wrap: wrap; }
 .container { padding: 16px; }
 .panel { padding: 16px; min-width: 0; }
 .panel-header { flex-wrap: wrap; gap: 8px; }
 .button-row { flex-wrap: wrap; }
 .button-row .btn { justify-content: center; width: 100%; padding-inline: 10px; }
 .telemetry-grid { gap: 8px; }
 .meter-card { min-width: 0; padding: 8px; }
 .meter-val-row { flex-wrap: wrap; gap: 4px; }
 .meter-title { overflow-wrap: anywhere; }
 .output-box { overflow-wrap: anywhere; }
}

.target-badge { background: var(--bad-surface); }
.logo-badge { background: var(--selected-surface); }
.meta-tag, .objective-item { background: var(--inset); }
.chip-header { flex-wrap: wrap; gap: 8px; }
