/* ------------------------------------------------------------------
   STEEL FRONT — field dossier / live CRT
   All visuals are original. No external fonts, images or audio.
------------------------------------------------------------------- */

:root {
  --paper: #d6ccb5;
  --paper-hi: #e5dcc7;
  --paper-lo: #c2b69c;
  --ink: #191b15;
  --ink-soft: #3a3d30;
  --ink-mute: #555746;
  --screen: #0b110c;
  --screen-2: #121913;
  --bone: #e9dfc6;
  --bone-dim: #a9a48f;
  --rust: #8e3a25;
  --rust-bright: #c66143;
  --brass: #b78d4a;
  --brass-bright: #d8b274;
  --sage: #778a71;
  --line: rgba(25, 27, 21, 0.22);
  --line-soft: rgba(25, 27, 21, 0.13);
  --screen-line: rgba(233, 223, 198, 0.13);
  --font-display: "Bahnschrift Condensed", "Bahnschrift SemiCondensed", "DIN Condensed", "Arial Narrow", "Liberation Sans Narrow", sans-serif;
  --font-body: "Microsoft YaHei", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", "IBM Plex Mono", "Consolas", "SFMono-Regular", monospace;
  --shadow-stage: 0 28px 54px -28px rgba(25, 27, 21, 0.75), 0 4px 12px rgba(25, 27, 21, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-body);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 750px at 8% -10%, rgba(255, 251, 239, 0.62), transparent 62%),
    radial-gradient(900px 700px at 102% 108%, rgba(104, 81, 45, 0.18), transparent 58%),
    linear-gradient(rgba(25, 27, 21, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 27, 21, 0.043) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--rust);
  color: var(--paper-hi);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

canvas {
  display: block;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 12px;
  color: var(--paper-hi);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 26px 28px 20px;
}

/* ------------------------------ masthead ------------------------------ */

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 14px 0 13px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.seal {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--ink);
}

.brand-copy {
  min-width: 0;
}

.eyebrow,
.mission-zone,
.mono-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--rust);
}

h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 5px 0 4px;
  line-height: 0.9;
}

.title-main {
  font-family: var(--font-display);
  font-size: clamp(42px, 4.3vw, 58px);
  font-weight: 700;
  letter-spacing: 0.012em;
}

.title-cn {
  align-self: center;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  color: var(--rust);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.tagline {
  margin: 0;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.masthead-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  padding-top: 2px;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.led {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(119, 138, 113, 0.16), 0 0 10px rgba(119, 138, 113, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.led.is-live {
  background: var(--rust-bright);
  box-shadow: 0 0 0 3px rgba(198, 97, 67, 0.16), 0 0 11px rgba(198, 97, 67, 0.45);
}

.led.is-warn {
  background: var(--brass);
  box-shadow: 0 0 0 3px rgba(183, 141, 74, 0.16), 0 0 11px rgba(183, 141, 74, 0.4);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: color 0.16s ease, background 0.16s ease;
}

.sound-toggle svg {
  width: 15px;
  height: 15px;
}

.sound-toggle:hover {
  color: var(--paper-hi);
  background: var(--ink);
}

.sound-toggle.is-muted .sound-waves {
  opacity: 0.18;
}

.sound-toggle:focus-visible,
.monitor-btn:focus-visible,
.btn:focus-visible,
.action-btn:focus-visible,
.action-ghost:focus-visible,
.fire-btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.sound-toggle:focus-visible,
.btn:focus-visible {
  outline-color: var(--ink);
}

.file-meta {
  display: flex;
  gap: 13px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.09em;
}

/* ------------------------------ layout ------------------------------ */

.console {
  --stage-w: 704px;
  display: grid;
  grid-template-columns: minmax(0, var(--stage-w)) 340px;
  justify-content: center;
  align-items: start;
  column-gap: clamp(30px, 4vw, 58px);
  margin-top: 22px;
}

.stage-column {
  min-width: 0;
}

/* ------------------------------ CRT monitor ------------------------------ */

.monitor {
  position: relative;
  border: 1px solid #30362a;
  background:
    linear-gradient(180deg, #1a2017 0%, #131811 52%, #0e130e 100%);
  padding: 12px 12px 9px;
  box-shadow: var(--shadow-stage);
}

.monitor::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(233, 223, 198, 0.07);
  pointer-events: none;
}

.bolt {
  position: absolute;
  z-index: 4;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #a7a58d, #404638 58%, #12160f 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.bolt-tl { top: 6px; left: 6px; }
.bolt-tr { top: 6px; right: 6px; }
.bolt-bl { bottom: 6px; left: 6px; }
.bolt-br { bottom: 6px; right: 6px; }

.monitor-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 9px;
  color: #8f9280;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.monitor-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.slash {
  color: #5c6252;
}

.rec-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--rust-bright);
  opacity: 0.34;
}

body.game-active .rec-dot {
  opacity: 1;
  animation: recPulse 1.9s ease-in-out infinite;
}

.monitor-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.monitor-mode {
  color: var(--brass-bright);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.monitor-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(233, 223, 198, 0.23);
  color: #b0ad98;
  background: transparent;
  touch-action: manipulation;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.monitor-btn svg {
  width: 10px;
  height: 10px;
}

.monitor-btn:hover:not(:disabled) {
  color: var(--screen);
  background: var(--bone);
  border-color: var(--bone);
}

.monitor-btn:disabled {
  opacity: 0.32;
}

.screen {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(233, 223, 198, 0.18);
  background: var(--screen);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

#game {
  width: 100%;
  height: 100%;
  outline: none;
  background: var(--screen);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#game:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: -2px;
}

.screen-scanlines,
.screen-vignette,
.screen-scanbeam {
  position: absolute;
  pointer-events: none;
}

.screen-scanlines {
  inset: 0;
  z-index: 3;
  opacity: 0.24;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.52) 0,
    rgba(0, 0, 0, 0.52) 1px,
    transparent 1px,
    transparent 3px
  );
}

.screen-vignette {
  inset: 0;
  z-index: 3;
  background: radial-gradient(ellipse at 50% 44%, transparent 55%, rgba(3, 7, 3, 0.46) 100%);
}

.screen-scanbeam {
  z-index: 3;
  top: -20%;
  left: 0;
  right: 0;
  height: 18%;
  opacity: 0.55;
  background: linear-gradient(180deg, transparent, rgba(232, 223, 196, 0.035) 55%, transparent);
  animation: scanbeam 9s linear infinite;
}

.monitor-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
  padding: 9px 3px 1px;
}

.monitor-stats {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 17px;
}

.mstat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mstat-label {
  color: #939783;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mstat b {
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.mstat b.is-danger {
  color: #e68a6a;
}

.monitor-hint {
  color: #939783;
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.55;
  letter-spacing: 0.08em;
  text-align: right;
}

.stage-notes {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 8px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.13em;
}

/* ------------------------------ dossier ------------------------------ */

.dossier {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-top: 3px solid var(--ink);
  padding-top: 12px;
}

.dossier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mission-block {
  padding: 15px 0 16px;
  border-bottom: 1px dashed var(--line);
}

.mission-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
}

.mission-number {
  padding-top: 4px;
  color: transparent;
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 700;
  line-height: 0.72;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 1px rgba(25, 27, 21, 0.55);
}

.mission-title-group {
  min-width: 0;
}

.mission-zone {
  display: block;
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mission-title-group h2 {
  margin: 3px 0 0;
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stamp {
  align-self: start;
  margin-top: 4px;
  padding: 4px 6px;
  border: 1.5px solid var(--rust);
  color: var(--rust);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-4deg);
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}

.stamp.is-hot {
  color: var(--paper-hi);
  background: var(--rust);
}

.stamp.is-neutral {
  border-color: var(--ink-mute);
  color: var(--ink-mute);
}

.mission-desc {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.75;
}

.threat {
  margin-top: 14px;
}

.threat-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.threat-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(25, 27, 21, 0.28);
  background: rgba(25, 27, 21, 0.1);
}

.threat-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 19px, rgba(214, 204, 181, 0.7) 19px 20px);
}

#threat-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--rust);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mission-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.mission-meta div {
  min-width: 0;
  padding-right: 8px;
  border-right: 1px dashed var(--line-soft);
}

.mission-meta div + div {
  padding-left: 9px;
}

.mission-meta div:last-child {
  padding-right: 0;
  border-right: 0;
}

.mission-meta dt {
  margin: 0 0 3px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mission-meta dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.mission-meta dd.is-danger {
  color: var(--rust);
}

.unit-block,
.teleprinter-block {
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-label span:last-child {
  color: var(--ink-mute);
  font-size: 6.5px;
}

.lives-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

.mini-label {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lives-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lives-pips {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 12px;
}

.life-pip {
  display: block;
  width: 4px;
  height: 10px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 55% 100%, 0 100%);
}

.life-pip.is-spent {
  height: 6px;
  background: rgba(25, 27, 21, 0.18);
}

.lives-count {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.buff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  min-height: 23px;
}

.buff-empty {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.buff {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 4px 7px 5px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 243, 0.23);
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1;
}

.buff::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--p, 100%);
  height: 2px;
  background: var(--brass);
  transition: width 0.18s linear;
}

.buff b {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
}

.buff em {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.feed-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.55;
  animation: feedIn 0.26s ease;
}

.feed-time {
  color: var(--ink-soft);
  font-size: 7.5px;
  padding-top: 1px;
}

.feed-text {
  min-width: 0;
}

.feed-item.is-alert .feed-text {
  color: var(--rust);
}

.feed-item.is-good .feed-text {
  color: #435536;
}

.terrain-block {
  padding: 13px 0 12px;
  border-bottom: 1px dashed var(--line);
}

.terrain-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.terrain-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.terrain-list em {
  margin-left: auto;
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terrain-swatch {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 1px solid rgba(25, 27, 21, 0.25);
}

.sw-brick {
  background:
    repeating-linear-gradient(0deg, #261a13 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, #a6563b 0 5px, #6f3526 5px 6px);
}

.sw-steel {
  background:
    repeating-linear-gradient(135deg, transparent 0 2px, rgba(233, 223, 198, 0.35) 2px 3px),
    #4d554a;
}

.sw-water {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(162, 197, 183, 0.35) 3px 4px),
    #14322d;
}

.sw-foliage {
  background:
    radial-gradient(circle at 30% 35%, #596841 0 2px, transparent 2.5px),
    radial-gradient(circle at 70% 65%, #3d4d32 0 3px, transparent 3.5px),
    #26321f;
}

.sw-core {
  background:
    radial-gradient(circle at 50% 50%, #e7c27e 0 2px, transparent 2.5px),
    #3c3020;
}

.sw-drop {
  background:
    linear-gradient(45deg, transparent 42%, #c9a26a 43% 57%, transparent 58%),
    #27251b;
}

.field-note {
  margin: 10px 0 0;
  padding: 7px 9px;
  border-left: 2px solid var(--brass);
  color: var(--ink-mute);
  background: rgba(255, 252, 243, 0.2);
  font-size: 9px;
  line-height: 1.7;
}

.controls-block {
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}

.key-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  margin-top: 10px;
}

.key-list div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
}

.key-list kbd {
  min-width: 34px;
  padding: 2px 4px;
  border-color: rgba(25, 27, 21, 0.3);
  color: var(--ink);
  background: rgba(25, 27, 21, 0.04);
}

.dossier-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.btn kbd {
  padding: 1px 4px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0.55;
}

.btn-dark {
  color: var(--paper-hi);
  background: var(--ink);
}

.btn-dark:hover:not(:disabled) {
  background: #303327;
}

.btn-outline {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(25, 27, 21, 0.09);
}

.btn:disabled {
  opacity: 0.34;
}

.dossier-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ------------------------------ in-screen HUD ------------------------------ */

.boss-meter {
  position: absolute;
  z-index: 9;
  top: 12px;
  left: 50%;
  width: min(calc(100% - 28px), 440px);
  padding: 7px 9px 8px;
  border: 1px solid rgba(198, 97, 67, 0.58);
  background: rgba(12, 9, 7, 0.84);
  transform: translateX(-50%);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.boss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: #e3b295;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.boss-track {
  height: 4px;
  overflow: hidden;
  background: rgba(233, 223, 198, 0.14);
}

#boss-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--rust-bright);
  transition: width 0.14s linear;
}

.sector-toast {
  position: absolute;
  z-index: 10;
  top: 22px;
  left: 50%;
  width: min(calc(100% - 40px), 390px);
  padding: 9px 12px 10px;
  border: 1px solid rgba(233, 223, 198, 0.2);
  border-left: 2px solid var(--brass);
  background: rgba(9, 14, 9, 0.86);
  color: var(--bone);
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.sector-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sector-toast.is-alert {
  border-color: rgba(198, 97, 67, 0.55);
  border-left-color: var(--rust-bright);
  background: rgba(21, 10, 8, 0.9);
}

.toast-kicker {
  display: block;
  color: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sector-toast.is-alert .toast-kicker {
  color: #e28e6e;
}

.sector-toast strong {
  display: block;
  margin: 2px 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.toast-sub {
  display: block;
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

/* ------------------------------ touch controls ------------------------------ */

.touch-ui {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 2px;
  padding: 13px 16px 3px;
  border-top: 1px solid rgba(233, 223, 198, 0.12);
  touch-action: none;
}

.joystick {
  position: relative;
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border: 1px solid rgba(233, 223, 198, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(31, 40, 29, 0.7) 0 35%, rgba(12, 18, 12, 0.82) 72%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4), 0 0 0 7px rgba(233, 223, 198, 0.035);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.joystick::before,
.joystick::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(233, 223, 198, 0.1);
  pointer-events: none;
}

.joystick::before {
  width: 56%;
  height: 1px;
  transform: translate(-50%, -50%);
}

.joystick::after {
  width: 1px;
  height: 56%;
  transform: translate(-50%, -50%);
}

.joystick-mark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(233, 223, 198, 0.32);
}

.mark-n { top: 8px; left: 50%; transform: translateX(-50%); }
.mark-e { right: 8px; top: 50%; transform: translateY(-50%); }
.mark-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.mark-w { left: 8px; top: 50%; transform: translateY(-50%); }

.stick {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid rgba(233, 223, 198, 0.36);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(233, 223, 198, 0.2), rgba(24, 32, 24, 0.48));
  pointer-events: none;
  will-change: transform;
}

.touch-link {
  color: #939783;
  font-family: var(--font-mono);
  font-size: 6.5px;
  line-height: 1.9;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.fire-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border: 1px solid rgba(216, 178, 116, 0.64);
  border-radius: 50%;
  color: var(--bone);
  background: radial-gradient(circle at 38% 32%, rgba(183, 84, 55, 0.92), rgba(103, 36, 22, 0.94));
  box-shadow: 0 0 0 7px rgba(198, 97, 67, 0.07), 0 8px 24px rgba(0, 0, 0, 0.24);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, filter 0.08s ease;
}

.fire-btn.is-pressed {
  transform: scale(0.94);
  filter: brightness(1.14);
}

.fire-main {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
}

.fire-sub {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.15em;
  opacity: 0.65;
}

@media (hover: none), (pointer: coarse) {
  body.game-active .touch-ui {
    display: flex;
  }

  body[data-phase="paused"] .touch-ui {
    display: flex;
    opacity: 0.34;
    pointer-events: none;
  }

  body[data-phase="ending"] .touch-ui,
  body[data-phase="levelclear"] .touch-ui,
  body[data-phase="gameover"] .touch-ui,
  body[data-phase="victory"] .touch-ui {
    display: flex;
    visibility: hidden;
  }
}

@media (max-width: 520px) {
  .touch-ui {
    padding: 11px 13px 2px;
  }

  .joystick {
    width: 78px;
    height: 78px;
  }

  .stick {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
  }

  .fire-btn {
    width: 68px;
    height: 68px;
  }

  .touch-link {
    font-size: 6px;
  }
}

@media (max-width: 380px) {
  .touch-link {
    display: none;
  }
}

/* ------------------------------ overlay cards ------------------------------ */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3.6vw, 30px);
  background:
    linear-gradient(rgba(5, 9, 5, 0.66), rgba(5, 9, 5, 0.84)),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(233, 223, 198, 0.025) 47px 48px);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  overflow: hidden;
}

.overlay[hidden] {
  display: none;
}

.overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.briefing {
  position: relative;
  width: min(100%, 468px);
  max-height: 100%;
  overflow: auto;
  padding: clamp(17px, 3.4vw, 27px);
  border: 1px solid rgba(233, 223, 198, 0.23);
  color: var(--bone);
  background:
    linear-gradient(160deg, rgba(28, 35, 26, 0.98), rgba(12, 17, 12, 0.985) 68%);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 223, 198, 0.25) transparent;
  transform: translateY(9px);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay.is-visible .briefing {
  transform: translateY(0);
}

.briefing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 86px;
  height: 3px;
  background: var(--rust-bright);
}

.briefing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(233, 223, 198, 0.14);
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.briefing-top .stamp {
  border-color: rgba(216, 178, 116, 0.6);
  color: var(--brass-bright);
  font-size: 6.5px;
  margin: 0;
  transform: rotate(2deg);
}

.briefing-top .stamp.is-danger {
  border-color: var(--rust-bright);
  color: #e79272;
}

.briefing-title {
  margin: 0;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: clamp(25px, 4.2vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.briefing-title em {
  color: var(--rust-bright);
  font-style: normal;
}

.briefing-title .subline {
  display: block;
  margin-top: 3px;
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.6;
  text-transform: uppercase;
}

.briefing-lede {
  max-width: 39em;
  margin: 11px 0 0;
  color: #b8b39f;
  font-size: 11.5px;
  line-height: 1.78;
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0 0;
  padding: 10px 0;
  border-top: 1px solid rgba(233, 223, 198, 0.12);
  border-bottom: 1px solid rgba(233, 223, 198, 0.12);
}

.briefing-grid div {
  min-width: 0;
  padding: 0 10px;
  border-right: 1px solid rgba(233, 223, 198, 0.1);
}

.briefing-grid div:first-child {
  padding-left: 0;
}

.briefing-grid div:last-child {
  padding-right: 0;
  border-right: 0;
}

.briefing-grid span {
  display: block;
  margin-bottom: 3px;
  color: #7e8373;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.briefing-grid b {
  display: block;
  overflow: hidden;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.briefing-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-top: 14px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-bottom: 5px;
  border-bottom: 1px dashed rgba(233, 223, 198, 0.1);
  color: #999b87;
  font-size: 9px;
}

.control-row .keys {
  display: inline-flex;
  gap: 3px;
  flex: 0 0 auto;
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 2px 5px;
  border: 1px solid rgba(233, 223, 198, 0.24);
  color: var(--bone);
  background: rgba(233, 223, 198, 0.05);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

.briefing-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 15px 0 0;
  border: 1px solid rgba(233, 223, 198, 0.12);
  background: rgba(233, 223, 198, 0.12);
}

.result-cell {
  min-width: 0;
  padding: 10px 11px;
  background: rgba(13, 18, 13, 0.95);
}

.result-cell span {
  display: block;
  margin-bottom: 4px;
  color: #858979;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-cell b {
  display: block;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.result-cell.is-accent b {
  color: var(--brass-bright);
}

.result-cell.is-danger b {
  color: #e28a6b;
}

.result-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.record-tag {
  display: inline-block;
  padding: 3px 5px;
  border: 1px solid var(--brass);
  color: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.briefing-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}

.action-btn,
.action-ghost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 43px;
  padding: 0 14px;
  border: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  transition: background 0.16s ease, color 0.16s ease, filter 0.16s ease;
}

.action-btn {
  color: #17130d;
  background: var(--brass-bright);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
}

.action-btn:hover {
  background: #e5c389;
}

.action-btn .arrow {
  font-size: 15px;
  line-height: 1;
}

.action-ghost {
  justify-content: center;
  min-height: 35px;
  color: #a6a48f;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(233, 223, 198, 0.17);
}

.action-ghost:hover {
  color: var(--bone);
  background: rgba(233, 223, 198, 0.06);
}

.action-ghost.is-danger {
  color: #d78f73;
  box-shadow: inset 0 0 0 1px rgba(198, 97, 67, 0.32);
}

.briefing-note {
  margin: 11px 0 0;
  color: #949784;
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.65;
  letter-spacing: 0.04em;
}

@keyframes feedIn {
  from { transform: translateY(3px); }
  to { transform: translateY(0); }
}

@keyframes recPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(198, 97, 67, 0); }
  50% { opacity: 0.5; box-shadow: 0 0 8px rgba(198, 97, 67, 0.7); }
}

@keyframes scanbeam {
  from { transform: translateY(0); }
  to { transform: translateY(820%); }
}

/* ------------------------------ responsive ------------------------------ */

@media (max-height: 1010px) and (min-width: 1061px) {
  .console {
    --stage-w: min(704px, calc(100dvh - 286px));
  }
}

@media (max-height: 840px) and (min-width: 1061px) {
  .page {
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .masthead {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .seal {
    width: 46px;
    height: 46px;
  }

  .title-main {
    font-size: 42px;
  }

  .tagline {
    display: none;
  }

  .console {
    --stage-w: min(704px, calc(100dvh - 235px));
    margin-top: 12px;
  }

  .stage-notes {
    display: none;
  }

  .terrain-block,
  .controls-block {
    display: none;
  }

  .page-footer {
    display: none;
  }
}

@media (max-width: 900px) {
  .dossier {
    display: none;
  }

  .page-footer {
    width: min(100%, 704px);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 1060px) {
  .page {
    width: min(100%, 820px);
  }

  .console {
    --stage-w: 704px;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 25px;
  }

  .stage-column {
    width: min(100%, var(--stage-w));
    margin: 0 auto;
  }

  .dossier {
    width: min(100%, var(--stage-w));
    margin: 0 auto;
    min-height: 0;
  }

  .dossier-actions {
    margin-top: 2px;
  }

  .feed-list {
    min-height: 0;
  }

  .page-footer {
    width: min(100%, 704px);
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 14px 14px 18px;
  }

  .masthead {
    gap: 14px;
    padding: 10px 0 10px;
  }

  .brand {
    gap: 10px;
  }

  .seal {
    width: 41px;
    height: 41px;
    margin-top: 1px;
  }

  .eyebrow {
    font-size: 7px;
    letter-spacing: 0.11em;
  }

  h1 {
    gap: 0 9px;
    margin-top: 4px;
  }

  .title-main {
    font-size: clamp(29px, 7.8vw, 42px);
  }

  .title-cn {
    padding-left: 9px;
    font-size: 11px;
    letter-spacing: 0.22em;
  }

  .tagline {
    display: none;
  }

  .masthead-rail {
    gap: 7px;
    padding-top: 0;
  }

  .status-block {
    font-size: 7.5px;
  }

  .file-meta {
    display: none;
  }

  .sound-toggle {
    min-height: 36px;
    padding: 0 9px;
    font-size: 7px;
  }

  .sound-toggle svg {
    width: 14px;
    height: 14px;
  }

  .monitor-btn {
    width: 32px;
    height: 28px;
  }

  .monitor-btn svg {
    width: 11px;
    height: 11px;
  }

  .console {
    margin-top: 15px;
    gap: 20px;
  }

  .monitor {
    padding: 9px 9px 7px;
  }

  .monitor-bar {
    font-size: 7px;
    padding-bottom: 7px;
  }

  .monitor-mode {
    font-size: 6px;
  }

  .monitor-foot {
    min-height: 33px;
    padding-top: 7px;
  }

  .monitor-stats {
    gap: 13px;
  }

  .mstat b {
    font-size: 11px;
  }

  .mstat-label {
    font-size: 5.5px;
  }

  .monitor-hint {
    display: none;
  }

  .stage-notes {
    display: none;
  }

  .dossier {
    display: none;
  }

  .page-footer {
    gap: 10px;
    margin-top: 17px;
    font-size: 6px;
  }

  .page-footer span:last-child {
    display: none;
  }

  .overlay {
    padding: 10px;
  }

  .briefing {
    padding: 16px 15px 15px;
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  }

  .briefing-top {
    margin-bottom: 11px;
    padding-bottom: 7px;
    font-size: 6px;
  }

  .briefing-title {
    font-size: clamp(22px, 6.2vw, 28px);
  }

  .briefing-lede {
    margin-top: 7px;
    font-size: 10.5px;
    line-height: 1.62;
  }

  .briefing-grid {
    margin-top: 11px;
    padding: 7px 0;
  }

  .briefing-grid b {
    font-size: 8.5px;
  }

  .briefing-controls {
    margin-top: 10px;
    gap: 4px 12px;
  }

  .control-row {
    font-size: 8px;
    padding-bottom: 4px;
  }

  .briefing-actions {
    margin-top: 12px;
    gap: 6px;
  }

  .action-btn {
    min-height: 40px;
    font-size: 8px;
  }

  .action-ghost {
    min-height: 32px;
    font-size: 8px;
  }

  .briefing-note {
    display: none;
  }

  .briefing-result {
    margin-top: 10px;
  }

  .result-cell {
    padding: 8px;
  }

  .result-cell span {
    font-size: 6px;
  }

  .result-cell b {
    font-size: 13px;
  }

  .result-note {
    margin-top: 8px;
    font-size: 6.5px;
  }

  .sector-toast {
    top: 13px;
    width: calc(100% - 24px);
    padding: 7px 9px;
  }

  .sector-toast strong {
    font-size: 13px;
  }

  .toast-sub {
    font-size: 6.5px;
  }

  .boss-meter {
    top: 9px;
    width: calc(100% - 20px);
    padding: 6px 7px;
  }
}

@media (max-width: 420px) {
  .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .eyebrow {
    max-width: 215px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .title-main {
    font-size: 29px;
  }

  .title-cn {
    font-size: 9.5px;
    letter-spacing: 0.16em;
  }

  .briefing-lede {
    font-size: 10px;
    line-height: 1.55;
    margin-top: 8px;
  }

  .briefing-grid {
    display: none;
  }

  .briefing-controls {
    margin-top: 12px;
  }

  .briefing-top {
    margin-bottom: 10px;
  }

  .overlay {
    padding: 8px;
  }

  .briefing {
    padding: 14px 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .screen-scanbeam {
    display: none;
  }
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 14px 16px;
  border: 1px solid var(--rust);
  color: var(--paper-hi);
  background: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  text-align: center;
}
