:root {
  --crt-green: #33ff66;
  --crt-dim: #1a8f3c;
  --crt-amber: #ffb000;
  --crt-cyan: #00e5ff;
  --bg: #020406;
  --panel: rgba(0, 12, 8, 0.88);
  --border: #1a8f3c;
  --font: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font);
  color: var(--crt-green);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* Looking into a laser: FOV fills with bloom + red wash (not a thin world-space line) */
#laser-glare {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.04s linear;
  background:
    radial-gradient(
      ellipse at 50% 45%,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 80, 80, 0.75) 22%,
      rgba(220, 0, 0, 0.7) 55%,
      rgba(80, 0, 0, 0.55) 100%
    );
  mix-blend-mode: normal;
}
#laser-glare.on {
  /* opacity set inline 0–1 from boss.laserGlare */
}

/* CRT scanline overlay */
/* Full-viewport cockpit frame — transparent center, drawn HUD on top */
#cockpit-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 14;
  opacity: 0.92;
  image-rendering: auto;
}

#scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  mix-blend-mode: multiply;
}

#ui-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

#ui-layer .screen {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0, 30, 20, 0.92), rgba(0, 0, 0, 0.95));
  padding: 2rem;
  text-align: center;
}

/*
 * Title grows with pilot panel + dual boards — allow scroll.
 * MUST beat #ui-layer .screen (justify-content:center). That rule is (1,1,0);
 * a lone #screen-title is only (1,0,0) and loses — center + overflow clips the
 * start edge so h1/h2 sit above the scrollport with scrollTop stuck at 0
 * ("headings pop out, can't scroll up to them").
 */
#ui-layer #screen-title {
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  overflow-anchor: none;
  /* Children size to content — do not stretch last box to fill the viewport */
}

#ui-layer #screen-title > * {
  flex: 0 0 auto;
  max-width: 100%;
}

/* Pre-mission cutscene — full black, letterboxed video */
#screen-cut {
  background: #000;
  padding: 0;
  z-index: 25;
  cursor: pointer;
}

#cut-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

#cut-chrome {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

#cut-hint {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: rgba(51, 255, 102, 0.75);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.screen h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 0.15em;
  margin: 0 0 0.5rem;
  text-shadow: 0 0 12px var(--crt-green);
  color: var(--crt-green);
}

.screen h2 {
  font-size: 1rem;
  font-weight: normal;
  color: var(--crt-cyan);
  letter-spacing: 0.2em;
  margin: 0 0 1.5rem;
}

.screen .ver {
  color: var(--crt-dim);
  font-size: 0.75rem;
  margin-bottom: 2rem;
}

.btn {
  pointer-events: auto;
  font-family: var(--font);
  background: transparent;
  color: var(--crt-green);
  border: 1px solid var(--crt-green);
  padding: 0.7rem 1.6rem;
  margin: 0.4rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  box-shadow: 0 0 8px rgba(51, 255, 102, 0.25);
  transition: background 0.15s, color 0.15s;
}

.btn:hover, .btn:focus {
  background: var(--crt-green);
  color: #000;
  outline: none;
}

.btn-amber {
  border-color: var(--crt-amber);
  color: var(--crt-amber);
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.25);
}
.btn-amber:hover {
  background: var(--crt-amber);
  color: #000;
}

.btn-danger {
  border-color: #ff3344;
  color: #ff6677;
  box-shadow: 0 0 12px rgba(255, 50, 60, 0.35);
  margin-top: 0.5rem;
}
.btn-danger:hover {
  background: #ff3344;
  color: #000;
}

/* Gate: allow scroll on short displays so warning + button stay reachable */
#ui-layer #screen-gate {
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
}

/* —— Gate (poster + Sky Fab warning strip) —— */
.gate-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(32rem, 92vw);
  margin: auto;
  gap: 0;
  flex: 0 0 auto;
}

.gate-poster {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vh, 420px);
  object-fit: contain;
  object-position: center top;
  /* Poster is pixel art — keep edges crisp when scaled */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid #1a4a2a;
  border-bottom: none;
  box-shadow: 0 0 28px rgba(0, 255, 100, 0.12), 0 0 40px rgba(0, 0, 0, 0.55);
  background: #050805;
  user-select: none;
  -webkit-user-drag: none;
}

.gate-panel {
  max-width: 28rem;
  border: 1px solid #662222;
  background: rgba(12, 4, 4, 0.92);
  padding: 2rem 1.75rem;
  box-shadow: 0 0 40px rgba(255, 40, 40, 0.15), inset 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Warning slab: same width as poster, compact strip under art */
.gate-panel--warning {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem 1rem;
  border-color: #662222;
  border-top: 1px solid #883333;
  box-shadow:
    0 0 28px rgba(255, 40, 40, 0.18),
    inset 0 0 28px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.gate-badge {
  display: inline-block;
  border: 1px solid #ff3344;
  color: #ff6677;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  padding: 0.28rem 0.65rem;
  margin-bottom: 0.55rem;
  animation: gate-pulse 1.6s ease-in-out infinite;
}

@keyframes gate-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(255, 50, 60, 0.3); }
  50% { opacity: 0.75; box-shadow: 0 0 14px rgba(255, 50, 60, 0.55); }
}

.gate-line {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: #aa6666;
  letter-spacing: 0.05em;
  line-height: 1.45;
}

.gate-line-strong {
  color: #ff8899;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.gate-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #662222, transparent);
  margin: 0.55rem 0;
}

.gate-body {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #886666;
  margin: 0 0 0.55rem;
}

.gate-body strong {
  color: #bb8888;
  font-weight: 600;
}

.gate-risk {
  color: #ff3344;
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  margin: 0 0 0.65rem;
  text-shadow: 0 0 10px rgba(255, 40, 40, 0.5);
}

.gate-panel--warning .btn-danger {
  margin-top: 0.15rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
}

.gate-hint {
  margin: 0.55rem 0 0;
  font-size: 0.6rem;
  color: #553333;
  letter-spacing: 0.08em;
}

/* Short viewports: shrink poster so warning + button stay on screen */
@media (max-height: 720px) {
  .gate-poster {
    max-height: min(42vh, 300px);
  }
  .gate-panel--warning {
    padding: 0.65rem 0.85rem 0.75rem;
  }
}

.title-blurb {
  max-width: 28rem;
  font-size: 0.85rem;
  color: #1a8f3c;
  margin-bottom: 1.5rem;
}

.pilot-panel {
  width: min(20rem, 92vw);
  margin: 0 auto 0.75rem;
  text-align: center;
}

.pilot-mode-row {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.pilot-mode-btn {
  font-family: var(--font);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 0.4rem 0.65rem;
  color: var(--crt-dim);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(26, 143, 60, 0.4);
  cursor: pointer;
}

.pilot-mode-btn.active {
  color: var(--crt-green);
  border-color: var(--crt-green);
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.25);
}

.pilot-mode-btn:hover {
  border-color: var(--crt-amber);
  color: var(--crt-amber);
}

.pilot-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--crt-amber);
  margin-bottom: 0.35rem;
}

.pilot-input {
  font-family: var(--font);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: var(--crt-green);
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--crt-dim);
  padding: 0.55rem 0.75rem;
  width: min(14rem, 80vw);
  margin-bottom: 0.65rem;
  outline: none;
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.15);
}

.pilot-input.pilot-pin {
  letter-spacing: 0.35em;
  text-transform: none;
}

.pilot-input:focus {
  border-color: var(--crt-green);
  box-shadow: 0 0 14px rgba(51, 255, 102, 0.35);
}

.pilot-auth-msg {
  min-height: 1.2em;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--crt-amber);
}

.pilot-auth-msg.is-error {
  color: #ff6680;
}

.pilot-auth-msg.is-ok {
  color: var(--crt-green);
}

.pilot-hint {
  margin: 0 0 0.5rem;
  font-size: 0.62rem;
  line-height: 1.4;
  color: #3a5a44;
  letter-spacing: 0.04em;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.mission-select-row {
  width: min(20rem, 92vw);
  margin: 0.35rem auto 0.85rem;
  text-align: center;
}

.mission-select {
  font-family: var(--font);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--crt-green);
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--crt-dim);
  padding: 0.5rem 0.65rem;
  width: min(18rem, 88vw);
  margin: 0 auto 0.35rem;
  outline: none;
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.12);
  cursor: pointer;
}

.mission-select:focus {
  border-color: var(--crt-green);
  box-shadow: 0 0 14px rgba(51, 255, 102, 0.3);
}

.mission-select option:disabled {
  color: #445;
}

.mission-select-hint {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 0.58rem;
  line-height: 1.4;
  color: #3a5a44;
  letter-spacing: 0.04em;
}

.hiscore-box {
  margin-top: 1.25rem;
  margin-bottom: 2rem;
  max-width: 22rem;
  width: 100%;
  /* Hug content — border must wrap all rows when the title screen scrolls */
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--crt-dim);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(26, 143, 60, 0.45);
  padding: 0.65rem 0.85rem 0.85rem;
  overflow: visible;
}

.hiscore-box-wide {
  max-width: min(28rem, 94vw);
  width: min(28rem, 94vw);
}

.hiscore-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
}

.hiscore-head h3 {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--crt-amber);
  font-weight: normal;
}

.hiscore-box h3 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--crt-amber);
  font-weight: normal;
}

.hiscore-info-btn {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--crt-amber);
  background: rgba(0, 0, 0, 0.55);
  color: var(--crt-amber);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: bold;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.25);
}

.hiscore-info-btn:hover,
.hiscore-info-btn:focus {
  color: var(--crt-green);
  border-color: var(--crt-green);
  box-shadow: 0 0 10px rgba(51, 255, 102, 0.35);
  outline: none;
}

/* Title: Initiate + amber gear (settings) */
.title-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.25rem 0 0.35rem;
  flex-wrap: wrap;
}

.btn-gear {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--crt-amber);
  background: rgba(0, 0, 0, 0.55);
  color: var(--crt-amber);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-gear:hover,
.btn-gear:focus {
  background: var(--crt-amber);
  color: #000;
  outline: none;
  box-shadow: 0 0 14px rgba(255, 176, 0, 0.45);
}

.btn-settings-pause .gear-icon {
  margin-right: 0.35rem;
}

.gear-icon,
.phone-icon {
  display: inline-block;
  font-style: normal;
  line-height: 1;
}

.phone-icon {
  font-size: 1.2rem;
  transform: translateY(1px);
}

/* Settings panel — reuses score-help “document” look; amber ops accent */
.settings-overlay {
  z-index: 45;
}

/* Call Center — above settings so phone line wins focus */
.callcenter-overlay {
  z-index: 46;
}

.callcenter-seal {
  font-size: 1.2rem !important;
  letter-spacing: 0 !important;
}

.callcenter-panel {
  width: min(26rem, 94vw);
  max-height: min(88vh, 42rem);
}

.callcenter-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0 0.5rem;
  text-align: center;
}

.callcenter-state.hidden {
  display: none !important;
}

.callcenter-avatar {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 6px;
  border: 2px solid rgba(0, 229, 255, 0.45);
  background:
    linear-gradient(145deg, rgba(0, 40, 50, 0.9), rgba(0, 10, 18, 0.95));
  box-shadow:
    0 0 18px rgba(0, 229, 255, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.callcenter-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}

.callcenter-avatar img.hidden {
  display: none !important;
}

.callcenter-avatar-placeholder {
  font-size: 2.4rem;
  color: rgba(0, 229, 255, 0.55);
  line-height: 1;
  user-select: none;
}

.callcenter-avatar-pulse {
  animation: callcenter-ring-pulse 1.1s ease-in-out infinite;
}

.callcenter-avatar-offline {
  border-color: rgba(255, 68, 102, 0.45);
  box-shadow: 0 0 14px rgba(255, 68, 102, 0.18);
}

@keyframes callcenter-ring-pulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
    border-color: rgba(0, 229, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 28px rgba(255, 176, 0, 0.45);
    border-color: rgba(255, 176, 0, 0.75);
  }
}

.callcenter-status {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--crt-amber);
  text-transform: uppercase;
}

.callcenter-status-sub {
  margin: 0;
  font-size: 0.72rem;
  color: #6a9a7a;
  letter-spacing: 0.04em;
}

.callcenter-status-error {
  color: #ff6a7a;
  text-transform: none;
  letter-spacing: 0.02em;
  max-width: 22rem;
  line-height: 1.45;
  font-size: 0.88rem;
}

.callcenter-chat {
  align-items: stretch;
  text-align: left;
  gap: 0.55rem;
}

.callcenter-chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.callcenter-chat-head .callcenter-avatar {
  width: 4.25rem;
  height: 4.25rem;
  flex-shrink: 0;
}

.callcenter-chat-meta {
  min-width: 0;
}

.callcenter-operator-name {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--crt-amber);
  text-transform: uppercase;
}

.callcenter-line-status {
  margin: 0.2rem 0 0;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #5a9a6a;
  text-transform: uppercase;
}

.callcenter-log {
  min-height: 10rem;
  max-height: min(38vh, 16rem);
  overflow-y: auto;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
  background: rgba(0, 8, 12, 0.72);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.callcenter-msg {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--crt-green);
  word-wrap: break-word;
}

.callcenter-msg .cc-who {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.12rem;
  opacity: 0.85;
}

.callcenter-msg.is-operator .cc-who {
  color: var(--crt-amber);
}

.callcenter-msg.is-pilot .cc-who {
  color: #00e5ff;
}

.callcenter-msg.is-system {
  color: #7a8a90;
  font-style: italic;
  font-size: 0.7rem;
}

.callcenter-compose {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.callcenter-pilot-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 3.4rem;
  max-width: 4.2rem;
}

.callcenter-pilot-face {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background-color: rgba(0, 8, 14, 0.9);
  background-repeat: no-repeat;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.18);
  image-rendering: pixelated;
  flex-shrink: 0;
}

.callcenter-pilot-sign {
  display: block;
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: #00e5ff;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
  font-weight: 600;
}

.callcenter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.callcenter-input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--crt-green);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.callcenter-input:focus {
  outline: none;
  border-color: var(--crt-amber);
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.25);
}

.callcenter-input:disabled {
  opacity: 0.5;
}

.callcenter-send {
  min-width: 4.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.callcenter-hangup {
  align-self: center;
  margin-top: 0.15rem;
  border-color: #c42840 !important;
  color: #ff6a7a !important;
}

.callcenter-hangup:hover,
.callcenter-hangup:focus {
  background: #c42840 !important;
  color: #fff !important;
}

.settings-seal {
  font-size: 1.15rem !important;
  letter-spacing: 0 !important;
}

.settings-section-later {
  opacity: 0.55;
}

.settings-placeholder {
  font-style: italic;
}

.settings-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 2.6rem;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0.4rem 0;
}

.settings-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #0d4a28;
  font-weight: 600;
}

.settings-pct {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
  color: #0d5c30;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.45rem;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(26, 92, 58, 0.25), rgba(255, 176, 0, 0.35));
  border: 1px solid rgba(26, 92, 58, 0.35);
  outline: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #ffb000;
  border: 2px solid #0a2818;
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.55);
  cursor: pointer;
}

.settings-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #ffb000;
  border: 2px solid #0a2818;
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.55);
  cursor: pointer;
}

.settings-check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.65rem 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #0d4a28;
  cursor: pointer;
  user-select: none;
}

.settings-check-row input {
  width: 1rem;
  height: 1rem;
  accent-color: #ffb000;
  cursor: pointer;
}

/* Mission profile — CHILL / MID / EXTRA */
.settings-diff-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin: 0.55rem 0 0.35rem;
}

.settings-diff-btn {
  font-family: var(--font);
  text-align: center;
  padding: 0.45rem 0.25rem 0.4rem;
  cursor: pointer;
  color: #3a5a44;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(26, 92, 58, 0.3);
  border-radius: 2px;
  transition: border-color 0.12s, color 0.12s, box-shadow 0.12s, background 0.12s;
}

.settings-diff-btn:hover {
  border-color: #c07800;
  color: #0d4a28;
}

.settings-diff-btn.active {
  color: #0a2818;
  border-color: #ffb000;
  background: rgba(255, 176, 0, 0.22);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.25);
}

.settings-diff-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.settings-diff-blurb {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  color: #4a6a55;
  text-transform: lowercase;
}

.settings-diff-btn.active .settings-diff-blurb {
  color: #6a4a10;
}

/* Scoring help — Sky Fab Statistics & Records “document” */
.score-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at center, rgba(0, 40, 28, 0.35), rgba(0, 0, 0, 0.82));
  pointer-events: auto;
}

.score-help-overlay.hidden {
  display: none !important;
}

.score-help-panel {
  position: relative;
  width: min(28rem, 94vw);
  max-height: min(85vh, 40rem);
  overflow-y: auto;
  overflow-x: hidden;
  text-align: left;
  outline: none;
  /* Paper / form stock with faint ruling */
  color: #1a2e24;
  border: 2px solid #1a5c3a;
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.25),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  padding: 0;
  background-color: #e8f0e4;
  background-image:
    linear-gradient(180deg, rgba(255, 252, 240, 0.92) 0%, rgba(232, 240, 228, 0.5) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 14px,
      rgba(26, 92, 58, 0.045) 14px,
      rgba(26, 92, 58, 0.045) 15px
    );
}

.score-help-doc-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 2.4rem 0.75rem 1rem;
  background: linear-gradient(90deg, #0a2818 0%, #143d28 55%, #0d3020 100%);
  color: #b8e0c8;
  border-bottom: 3px double #33ff66;
}

.score-help-seal {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 2px solid #ffb000;
  color: #ffb000;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.35);
  background: radial-gradient(circle at 35% 30%, #1a4a30, #06140c);
}

.score-help-doc-meta {
  min-width: 0;
  flex: 1;
}

.score-help-org {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: #7ab88a;
  text-transform: uppercase;
}

.score-help-dept {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #00e5ff;
  text-transform: uppercase;
}

.score-help-panel h3,
#score-help-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #ffb000;
  font-weight: normal;
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.25);
}

.score-help-doc-id {
  margin: 0.35rem 0 0;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: #5a8a6a;
  font-family: ui-monospace, Consolas, monospace;
}

.score-help-rule {
  height: 0;
  border: none;
  border-top: 1px dashed #1a5c3a;
  margin: 0;
  opacity: 0.5;
}

.score-help-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #5a8a6a;
  background: rgba(0, 0, 0, 0.35);
  color: #33ff66;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font);
}

.score-help-close:hover {
  border-color: #ffb000;
  color: #ffb000;
}

.score-help-body {
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  padding: 0.85rem 1rem 0.25rem;
  color: #1a3328;
}

.score-help-lede {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid #1a8f3c;
  background: rgba(26, 143, 60, 0.08);
  color: #243d30;
  font-size: 0.7rem;
}

.score-help-section {
  margin: 0 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(26, 92, 58, 0.2);
}

.score-help-section:last-of-type {
  border-bottom: none;
}

.score-help-body h4 {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #0d4a28;
  font-weight: normal;
  text-transform: uppercase;
}

.score-help-body .sh-sec {
  color: #c07800;
  margin-right: 0.35rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.62rem;
}

.score-help-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.35rem;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(26, 92, 58, 0.25);
}

.score-help-body th,
.score-help-body td {
  padding: 0.22rem 0.35rem;
  border-bottom: 1px solid rgba(26, 92, 58, 0.12);
  text-align: left;
}

.score-help-body th {
  color: #3a5a44;
  font-weight: normal;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  background: rgba(26, 92, 58, 0.1);
  text-transform: uppercase;
}

.score-help-body td.sh-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.65rem;
  color: #0a5c8a;
  letter-spacing: 0.06em;
  width: 2.6rem;
}

.score-help-body td:last-child,
.score-help-body th:last-child {
  text-align: right;
  color: #0d5c30;
  font-weight: 600;
  font-family: ui-monospace, Consolas, monospace;
}

.score-help-body .score-help-note {
  color: #4a6a55;
  font-size: 0.64rem;
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.score-help-policy {
  margin: 0;
  padding-left: 1.1rem;
  color: #243d30;
}

.score-help-policy li {
  margin: 0.3rem 0;
}

.score-help-doc-foot {
  padding: 0.5rem 1rem 1rem;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(26, 92, 58, 0.08));
  border-top: 1px dashed rgba(26, 92, 58, 0.35);
}

.score-help-stamp {
  margin: 0 0 0.65rem;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: #5a8a6a;
  text-transform: uppercase;
}

.score-help-ok {
  display: inline-block;
  margin: 0 auto;
  min-width: 10rem;
}

.hiscore-box h4 {
  margin: 0.65rem 0 0.3rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #7ab88a;
  font-weight: normal;
}

/* Rank numbers are in the row text — never use browser list markers (avoids "1. 1.") */
.hiscore-box ol,
.hiscore-box ol.hiscore-list,
.rank-board.hiscore-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.hiscore-box li {
  margin: 0.15rem 0;
  color: var(--crt-green);
  white-space: pre;
  font-variant-numeric: tabular-nums;
}

.hiscore-box li.is-you {
  color: var(--crt-amber);
}

.hiscore-box .hs-sub {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: #3a5a44;
  font-weight: normal;
}

.hiscore-box .hs-campaign-note {
  display: block;
  margin: 0.15rem 0 0.55rem;
  line-height: 1.35;
}

.hiscore-box .hs-mis {
  color: #7ab88a;
}

.hiscore-box .empty {
  color: #3a5a44;
  font-style: italic;
}

.hiscore-mission-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 0.25rem;
}

.hiscore-mission-row label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--crt-dim);
}

.hiscore-mission-row select {
  font-family: var(--font);
  font-size: 0.7rem;
  color: var(--crt-green);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--crt-dim);
  padding: 0.2rem 0.4rem;
}

.hiscore-view-toggle {
  display: inline-flex;
  margin: 0.35rem 0 0.55rem;
  border: 1px solid var(--crt-dim);
  border-radius: 2px;
  overflow: hidden;
}

.hiscore-mode-toggle {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--crt-dim);
  border-radius: 2px;
  overflow: hidden;
}

.pilot-roster-list {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.pilot-roster-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.4rem 0;
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 3px;
  background: rgba(0, 8, 12, 0.45);
  /* Override .hiscore-box li { white-space: pre } so blurbs wrap */
  white-space: normal;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.pilot-roster-row.is-you {
  border-color: rgba(255, 176, 0, 0.45);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.15);
}

.pilot-roster-face {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background-color: rgba(0, 0, 0, 0.75);
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.pilot-roster-meta {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  overflow: hidden;
}

.pilot-roster-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.pilot-roster-sign {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--crt-green);
  font-weight: 600;
  word-break: break-word;
}

.pilot-roster-row.is-you .pilot-roster-sign {
  color: var(--crt-amber);
}

.pilot-roster-tier {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: #5a8a6a;
}

.pilot-roster-term {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crt-amber);
}

.pilot-roster-blurb {
  margin-top: 0.2rem;
  font-size: 0.58rem;
  line-height: 1.4;
  color: #6a9a7a;
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.hs-mode-btn {
  font-family: var(--font);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--crt-dim);
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-right: 1px solid var(--crt-dim);
  padding: 0.22rem 0.5rem;
  cursor: pointer;
}

.hs-mode-btn:last-child {
  border-right: none;
}

.hs-mode-btn:hover {
  color: var(--crt-green);
}

.hs-mode-btn.is-on {
  color: #001408;
  background: var(--crt-green);
  box-shadow: 0 0 8px rgba(51, 255, 102, 0.35);
}

.hiscore-box .hs-time-lead {
  color: var(--crt-amber, #ffb000);
  font-weight: 600;
  min-width: 3.2rem;
  display: inline-block;
}

.rank-strip {
  white-space: pre-wrap;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--crt-green);
  background: rgba(0, 20, 10, 0.45);
  border: 1px solid rgba(51, 255, 102, 0.35);
  padding: 0.65rem 0.85rem;
  margin: 0.5rem 0 0.65rem;
}

.rank-strip.is-offline {
  color: var(--crt-amber);
  border-color: rgba(255, 176, 0, 0.35);
}

.rank-board {
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: var(--crt-dim);
  list-style: none;
  padding-left: 0;
}

.rank-board li {
  white-space: pre;
  font-variant-numeric: tabular-nums;
  color: var(--crt-green);
}

.rank-board li.is-you {
  color: var(--crt-amber);
}

.debrief-score {
  white-space: pre-wrap;
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--crt-amber);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 176, 0, 0.35);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 0.5rem;
}

/* —— Hangar bay doors —— */
#hangar-doors {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

#hangar-doors.hidden {
  display: none !important;
}

.hangar-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.35) 0%, transparent 8%, transparent 92%, rgba(0,0,0,0.35) 100%),
    linear-gradient(180deg, #1a222c 0%, #0d1218 40%, #151c26 100%);
  border: 2px solid #2a3544;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7);
  transition: transform 1.35s cubic-bezier(0.45, 0.05, 0.2, 1);
}

.hangar-door-left {
  left: 0;
  border-right: 3px solid #ffb000;
  transform: translateX(0);
}

.hangar-door-right {
  right: 0;
  border-left: 3px solid #ffb000;
  transform: translateX(0);
}

#hangar-doors.opening .hangar-door-left {
  transform: translateX(-102%);
}

#hangar-doors.opening .hangar-door-right {
  transform: translateX(102%);
}

.door-ribs {
  position: absolute;
  inset: 8% 12%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 18px,
    rgba(0, 229, 255, 0.06) 18px,
    rgba(0, 229, 255, 0.06) 20px
  );
  border: 1px solid rgba(0, 229, 255, 0.12);
}

.door-warning-stripe {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  height: 16%;
  background: repeating-linear-gradient(
    -45deg,
    #ffb000,
    #ffb000 14px,
    #111 14px,
    #111 28px
  );
  opacity: 0.85;
  box-shadow: 0 0 20px rgba(255, 176, 0, 0.25);
}

.hangar-seam {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  margin-left: -2px;
  background: linear-gradient(180deg, #ffb000, #00e5ff, #ffb000);
  box-shadow: 0 0 16px rgba(255, 176, 0, 0.6);
  opacity: 0.9;
  transition: opacity 0.4s ease;
  z-index: 2;
}

#hangar-doors.opening .hangar-seam {
  opacity: 0;
}

#screen-intro {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 10vh;
}

#intro-text {
  max-width: 42rem;
  text-align: left;
  line-height: 1.55;
  font-size: 0.95rem;
  color: var(--crt-green);
}

.crawl-line {
  margin: 0.15rem 0;
}

#intro-text .crawl-line:first-child {
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 0.25rem;
}

#brief-panel,
.brief-infographic {
  max-width: min(52rem, 94vw);
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.12);
  max-height: 90vh;
  overflow-y: auto;
}

#brief-title {
  color: var(--crt-cyan);
  letter-spacing: 0.15em;
  margin: 0 0 0.35rem;
  text-align: center;
}

.brief-sub {
  text-align: center;
  color: #1a8f3c;
  font-size: 0.8rem;
  margin: 0 0 1rem;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.target-card {
  border: 1px solid #1a4a30;
  background: rgba(0, 20, 12, 0.85);
  padding: 0.55rem 0.5rem 0.65rem;
  text-align: center;
  border-radius: 2px;
}



.target-card.kill { border-color: #663344; }
.target-card.objective { border-color: #aa3344; box-shadow: 0 0 10px rgba(255, 50, 60, 0.15); }
.target-card.extract { border-color: #886620; }
.target-card.pickup { border-color: #2a6680; }
.target-card.friend { border-color: #2a5530; }

.target-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.4rem;
  border-radius: 4px;
  position: relative;
  image-rendering: pixelated;
  background-color: #0a1018;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* First frame of a horizontal multi-view strip */
.target-icon-frame {
  width: 64px;
  height: 64px;
  border: 1px solid #1a3a28;
  background-color: #0a1018;
}

.target-icon-single {
  width: 64px;
  height: 64px;
}

.target-icon-single .sprite-single-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.sprite-caption {
  font-size: 0.55rem;
  color: #2a6a48;
  letter-spacing: 0.04em;
  margin: -0.15rem 0 0.35rem;
}

.sprite-missing {
  background: #331111 !important;
}
.sprite-missing::after {
  content: 'IMG?';
  color: #ff6677;
  font-size: 0.65rem;
}

/* CSS “icons” — infographic stand-ins until art packs arrive */
.icon-drone {
  background: radial-gradient(circle at 50% 45%, #00e5ff 0%, #00e5ff 28%, transparent 30%),
    linear-gradient(135deg, transparent 40%, #00e5ff 40%, #00e5ff 60%, transparent 60%),
    #0a1820;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}
.icon-turret {
  background:
    linear-gradient(#ffb000, #ffb000) center 18% / 18% 22% no-repeat,
    linear-gradient(#4a5a6a, #4a5a6a) center 55% / 55% 40% no-repeat,
    #121820;
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.35);
}
.icon-nest {
  background:
    radial-gradient(circle at 50% 40%, #ff4466 0%, #ff2244 40%, #3a1020 42%, #3a1020 100%);
  box-shadow: 0 0 14px rgba(255, 40, 60, 0.5);
}
.icon-bay {
  background:
    linear-gradient(#ff2244, #ff2244) center / 48% 48% no-repeat,
    linear-gradient(#5a2030, #5a2030) center / 78% 78% no-repeat,
    #1a0a10;
  box-shadow: 0 0 14px rgba(255, 30, 50, 0.55);
}
.icon-drill {
  /* Upright industrial drill: base, mast, spinning crown, bit down */
  background:
    /* crown disc */
    radial-gradient(circle at 50% 28%, #ffb000 0 18%, transparent 19%),
    /* mast */
    linear-gradient(#ff4466, #ff4466) 50% 55% / 18% 42% no-repeat,
    /* base foot */
    linear-gradient(#5a2030, #5a2030) 50% 88% / 70% 16% no-repeat,
    /* bit tip */
    linear-gradient(#00e5ff, #00e5ff) 50% 72% / 10% 14% no-repeat,
    #1a0a10;
  box-shadow: 0 0 14px rgba(255, 80, 40, 0.55);
}
.icon-extract {
  /* Closed hangar doors: two panels + amber seam + hazard band */
  background:
    /* hazard stripe band */
    repeating-linear-gradient(
      -45deg,
      #ffb000 0 5px,
      #1a1408 5px 10px
    ),
    /* left door */
    linear-gradient(90deg, #1a222c 0%, #121820 100%),
    /* right door */
    linear-gradient(90deg, #121820 0%, #1a222c 100%),
    /* frame */
    #0a0e14;
  background-size:
    100% 22%,
    46% 100%,
    46% 100%,
    100% 100%;
  background-position:
    center,
    left center,
    right center,
    center;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 0 2px #2a3544,
    0 0 10px rgba(255, 176, 0, 0.35);
  position: relative;
}
.icon-extract::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 3px;
  margin-left: -1.5px;
  background: linear-gradient(#ffb000, #00e5ff, #ffb000);
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.7);
}
.icon-shield {
  background: radial-gradient(circle, #ffb000 0%, #ffb000 35%, #1a1408 38%);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.4);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.icon-emp {
  background: radial-gradient(circle, #00e5ff 0%, #00e5ff 35%, #081418 38%);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.target-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--crt-green);
  font-weight: normal;
}

.target-card p {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.35;
  color: #2a8f55;
}

.target-card .tag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.35rem;
  border: 1px solid currentColor;
}

.tag-kill { color: #ff8899; }
.tag-obj { color: #ff4466; }
.tag-go { color: #ffb000; }
.tag-item { color: #00e5ff; }

.brief-objectives,
.debrief-body {
  /* Each child is a real <p> block — never preformatted / never comma-joined arrays */
  white-space: normal;
  text-align: left;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.brief-objectives {
  border-top: 1px solid #1a4a30;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--crt-green);
}

.debrief-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #33ff66;
  margin: 1rem 0 1.5rem;
}

/* Force block layout so paragraphs never run into one line */
.brief-objectives > p,
.debrief-body > p {
  display: block !important;
  max-width: 100%;
}

.brief-objectives .brief-heading,
.debrief-body .brief-heading {
  margin: 1em 0 0.4em;
  padding-bottom: 0.15em;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--crt-cyan, #00e5ff);
  font-size: 0.95em;
}

.brief-objectives .brief-heading:first-child,
.debrief-body .brief-heading:first-child {
  margin-top: 0;
}

.brief-objectives .brief-para,
.debrief-body .brief-para {
  margin: 0 0 0.75em;
}

.brief-objectives .brief-item,
.debrief-body .brief-item {
  margin: 0.15em 0 0.15em 0.6em;
  padding-left: 0.35em;
  border-left: 2px solid rgba(51, 255, 102, 0.35);
}

.brief-objectives .brief-callout,
.debrief-body .brief-callout {
  margin: 0.65em 0;
  padding: 0.45em 0.55em;
  border-left: 3px solid #ffb000;
  background: rgba(255, 176, 0, 0.08);
  color: #ffe0a0;
}

.brief-objectives > p:last-child,
.debrief-body > p:last-child {
  margin-bottom: 0;
}

.brief-controls {
  border-top: 1px solid #1a4a30;
  padding-top: 0.65rem;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  color: #1a8f3c;
  line-height: 1.4;
}

#brief-panel .btn {
  display: block;
  margin: 0 auto;
}

/* ---- Campaign end-roll (epilogue + credits) ---- */
#screen-endroll {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

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

#endroll-mask {
  position: relative;
  z-index: 1;
  /* Wide enough for credit text + polaroid rails */
  width: min(54rem, 96vw);
  height: 100%;
  overflow: hidden;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  pointer-events: none;
}

#endroll-scroll {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  will-change: transform;
}

#endroll-content {
  padding: 100vh 1.25rem 40vh;
  text-align: center;
  color: #33ff66;
  text-shadow: 0 0 12px rgba(0, 255, 100, 0.35);
  font-family: var(--font);
  line-height: 1.55;
}

#endroll-content .endroll-line {
  margin: 0.35em 0;
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  letter-spacing: 0.04em;
}

#endroll-content .endroll-line.empty {
  height: 0.85em;
}

#endroll-content .endroll-heading {
  margin: 2.2em 0 0.75em;
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  letter-spacing: 0.22em;
  color: #00e5ff;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}

#endroll-content .endroll-heading:first-child {
  margin-top: 0;
}

#endroll-hint {
  position: absolute;
  z-index: 2;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(51, 255, 102, 0.55);
  pointer-events: none;
}

/* End-roll polaroids (pilot epilogue + enemy credit rails) */
.endroll-polaroid {
  display: inline-block;
  background: #f4efe6;
  padding: 0.4rem 0.4rem 0.85rem;
  margin: 0.85rem auto 0.35rem;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.65) inset,
    0 6px 18px rgba(0, 0, 0, 0.55);
  border: 1px solid #e8e2d6;
  vertical-align: middle;
}

.endroll-polaroid-pilot {
  display: block;
  width: 8rem;
  margin: 1.25rem auto 0.75rem;
  transform: rotate(-1.5deg);
}

.endroll-polaroid-shot {
  display: block;
  width: 7.1rem;
  height: 7.1rem;
  background-color: #0a0e12;
  background-repeat: no-repeat;
  box-sizing: border-box;
  image-rendering: pixelated;
}

.endroll-polaroid-cap {
  margin-top: 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #2a2a2a;
  text-shadow: none;
  font-family: Georgia, 'Times New Roman', serif;
}

/* Fixed independent side rails retired — polaroids live in the scroll with credits */
.endroll-side {
  display: none !important;
}

/* Credits: continuous text center; polaroids absolute in side rails (no text gaps) */
.endroll-credits-wrap {
  display: grid;
  grid-template-columns: minmax(5.25rem, 6.75rem) minmax(0, 1fr) minmax(5.25rem, 6.75rem);
  gap: 0.25rem 0.5rem;
  align-items: stretch;
  width: min(52rem, 96vw);
  margin: 2rem auto 0;
  text-align: center;
}

.endroll-credits-center {
  min-width: 0;
  padding: 0 0.35rem;
}

/* Stretch to full credits height; photos positioned by % along that height */
.endroll-credits-rail {
  position: relative;
  min-height: 100%;
  pointer-events: none;
}

.endroll-polaroid-credit {
  position: absolute;
  left: 50%;
  /* top: set inline as % of rail height */
  width: 5.2rem;
  margin: 0;
  padding: 0.3rem 0.3rem 0.7rem;
  transform: translate(-50%, -50%) rotate(var(--polaroid-rot, -2deg));
  flex: 0 0 auto;
}

.endroll-polaroid-shot-enemy {
  width: 100%;
  height: 4.5rem;
  background-color: #05080c;
}

@media (max-width: 720px) {
  .endroll-credits-wrap {
    grid-template-columns: 1fr;
    width: min(42rem, 92vw);
  }
  .endroll-credits-rail {
    display: none;
  }
}

/* Settings — pilot face carousel */
.settings-face-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.65rem 0 0.25rem;
}

.settings-face-nav {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--crt-green);
  background: rgba(0, 20, 10, 0.6);
  border: 1px solid var(--crt-dim);
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  border-radius: 2px;
}

.settings-face-nav:hover {
  border-color: var(--crt-green);
  box-shadow: 0 0 8px rgba(51, 255, 102, 0.25);
}

.settings-face-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.settings-face-preview {
  width: 5.5rem;
  height: 5.5rem;
  border: 1px solid rgba(51, 255, 102, 0.45);
  background-color: #050a08;
  box-shadow: 0 0 14px rgba(0, 255, 100, 0.12);
  image-rendering: pixelated;
}

.settings-face-caption {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--crt-dim);
}

/* —— HUD (cockpit-aligned slots @ 1920×1080 art) —— */
#hud {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  font-family: var(--font);
  color: var(--crt-green);
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.5);
}

/* Slots: transparent over black CRTs in cockpit.png (object-fit: fill) */
.hud-slot {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

/* Top middle ticker — 769,0 → 1168,18 */
#hud-slot-top {
  left: 40.05%;
  top: 0;
  width: 20.78%;
  height: 1.85%;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* Semi-transparent plate under console text (bot L / M / R) */
.hud-glass {
  background: rgba(20, 24, 28, 0.5);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Bottom left integrity — 557,985 → 684,1061 */
#hud-slot-bot-l {
  left: 29.01%;
  top: 91.2%;
  width: 6.61%;
  height: 7.04%;
  padding: 0.35% 0.45%;
  gap: 0.28rem;
  justify-content: space-evenly;
}

/* Bottom middle primary — 712,985 → 1214,1061 */
#hud-slot-bot-m {
  left: 37.08%;
  top: 91.2%;
  width: 26.15%;
  height: 7.04%;
  padding: 0.3% 0.55%;
  justify-content: center;
}

/* Bottom right EMP + weapons — left by ~glass→cyan inset from 64.85% */
#hud-slot-bot-r {
  left: 64.5%;
  top: 91.2%;
  width: 7.6%;
  height: 7.04%;
  padding: 0.25% 0.35%;
  justify-content: center;
  align-items: center;
}

/* BR screen 1 face — 1444,930 → 1608,1042 */
#hud-slot-br1 {
  left: 75.21%;
  top: 86.11%;
  width: 8.54%;
  height: 10.37%;
  padding: 0.2% 0.25%;
  justify-content: flex-start;
}

/* BR screen 2 status — 1674,930 → 1885,1042 */
#hud-slot-br2 {
  left: 87.19%;
  top: 86.11%;
  width: 10.99%;
  height: 10.37%;
  padding: 0.4% 0.5%;
  justify-content: center;
  text-align: center;
  gap: 0.15rem;
}

/* Minimap CRT — 37,897 → 157,1051 */
#hud-minimap-wrap {
  position: absolute;
  left: 1.93%;
  top: 83.06%;
  width: 6.25%;
  height: 14.26%;
  pointer-events: none;
  z-index: 2;
}

#hud-minimap {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(2, 4, 6, 0.92);
  border: none;
  image-rendering: pixelated;
}

/* —— Bars —— */
.bar-label {
  font-size: clamp(0.5rem, 0.8vw, 0.65rem);
  letter-spacing: 0.1em;
  opacity: 0.95;
  line-height: 1.15;
}

.bar {
  height: clamp(7px, 0.95vh, 11px);
  border: 1px solid var(--crt-dim);
  background: rgba(0, 0, 0, 0.55);
  margin-top: 2px;
}

.bar > i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--crt-green);
  box-shadow: 0 0 5px var(--crt-green);
}

#hud-shield-bar > i {
  background: var(--crt-cyan);
  box-shadow: 0 0 5px var(--crt-cyan);
}

.hud-bar-block {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#hud-slot-bot-l .bar {
  height: clamp(8px, 1.1vh, 12px);
}

/* —— Score ticker —— */
#hud-scorebar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 100%;
  font-size: clamp(0.5rem, 0.85vw, 0.72rem);
  letter-spacing: 0.1em;
  color: var(--crt-green);
  white-space: nowrap;
  overflow: hidden;
  line-height: 1;
}

#hud-scorebar #hud-score {
  color: var(--crt-amber);
  font-weight: bold;
}

#hud-scorebar #hud-lives {
  color: var(--crt-cyan);
}

#hud-scorebar #hud-time {
  color: var(--crt-green);
  opacity: 0.95;
}

#hud-score-popup {
  position: absolute;
  top: 2.2%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  letter-spacing: 0.12em;
  color: var(--crt-amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.7);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.15rem 0.45rem;
  pointer-events: none;
  z-index: 4;
}

/* —— Bottom middle: objective + boss stacked —— */
#hud-mission-panel {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
}

#hud-objective {
  font-size: clamp(0.5rem, 0.85vw, 0.72rem);
  letter-spacing: 0.04em;
  color: var(--crt-amber);
  line-height: 1.25;
  max-height: 2.4em;
  overflow: hidden;
}

#hud-boss {
  width: 100%;
  text-align: center;
  padding: 0;
}

#hud-boss-label {
  font-size: clamp(0.42rem, 0.65vw, 0.55rem);
  letter-spacing: 0.1em;
  color: #ff66cc;
  text-shadow: 0 0 8px rgba(255, 0, 170, 0.55);
  margin-bottom: 0.05rem;
}

#hud-boss-bar {
  height: clamp(6px, 0.85vh, 10px);
  border-color: rgba(255, 0, 170, 0.45);
  background: rgba(0, 0, 0, 0.55);
}

#hud-boss-bar > i {
  background: linear-gradient(90deg, #ff2244, #ff00aa);
  box-shadow: 0 0 8px rgba(255, 0, 170, 0.75);
  transition: width 0.12s linear;
}

#hud-boss-pct {
  font-size: clamp(0.4rem, 0.6vw, 0.52rem);
  letter-spacing: 0.08em;
  color: rgba(255, 180, 220, 0.9);
  margin-top: 0.05rem;
}

#hud-boss.critical #hud-boss-bar > i {
  background: linear-gradient(90deg, #ff4466, #ff8800);
  animation: boss-bar-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes boss-bar-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.35); }
}

/* —— EMP + weapons (bot-r, centered block) —— */
#hud-emp {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(0, 12, 18, 0.35);
  padding: 0.2rem 0.3rem 0.22rem;
  box-sizing: border-box;
  margin: 0 auto;
  text-align: center;
}

#hud-emp-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  font-size: clamp(0.48rem, 0.75vw, 0.68rem);
  letter-spacing: 0.04em;
  color: #7fe9ff;
  margin-bottom: 0.1rem;
}

#hud-emp-label {
  font-weight: bold;
  color: #00e5ff;
}

#hud-emp-count {
  color: #e8fbff;
  font-weight: bold;
}

#hud-emp-status {
  color: #a8f0ff;
  font-size: 0.9em;
}

#hud-emp .bar {
  height: clamp(5px, 0.7vh, 8px);
  background: rgba(0, 40, 50, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.35);
  margin-top: 0.1rem;
}

#hud-emp-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #007a8a, #00e5ff);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
  transition: width 0.08s linear;
}

#hud-weapon {
  margin-top: 0.18rem;
  font-size: clamp(0.38rem, 0.6vw, 0.52rem);
  letter-spacing: 0.04em;
  color: #3a9a60;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

#hud-emp.ready {
  border-color: rgba(0, 255, 200, 0.75);
}

#hud-emp.ready #hud-emp-status {
  color: #33ffaa;
  font-weight: bold;
}

#hud-emp.empty {
  border-color: rgba(255, 80, 80, 0.45);
  opacity: 0.9;
}

#hud-emp.empty #hud-emp-status {
  color: #ff6688;
}

#hud-emp.recharging #hud-emp-status {
  color: #ffcc66;
}

#hud-emp.breach-hot {
  border-color: #ff2244;
  animation: emp-breach-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes emp-breach-pulse {
  from { box-shadow: 0 0 4px rgba(255, 34, 68, 0.3); }
  to { box-shadow: 0 0 12px rgba(255, 34, 68, 0.65); }
}

/* —— Pilot face CRT (BR1) —— */
#hud-face-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  pointer-events: none;
}

#hud-pilot {
  flex: 0 0 auto;
  font-size: clamp(0.45rem, 0.75vw, 0.62rem);
  letter-spacing: 0.08em;
  color: var(--crt-amber);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-bottom: 0.12rem;
}

#hud-face-row {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 0;
}

#hud-face {
  flex: 0 0 auto;
  width: clamp(64px, 6.8vw, 92px);
  height: clamp(64px, 6.8vw, 92px);
  background-color: rgba(8, 12, 14, 0.85);
  background-image: none;
  background-repeat: no-repeat;
  background-size: 500% 100%;
  background-position: 0 0;
  border: 1px solid rgba(51, 255, 102, 0.35);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#hud-face.missing {
  background-image: none;
  background-color: rgba(20, 28, 24, 0.85);
  position: relative;
}

#hud-face.hurt {
  filter: brightness(1.35) saturate(1.4);
}

#hud-face-meta {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

#hud-face-label {
  font-size: clamp(0.42rem, 0.7vw, 0.58rem);
  letter-spacing: 0.08em;
  color: var(--crt-green);
  line-height: 1.2;
}

/* —— Status CRT (BR2): difficulty · assist · soft help —— */
#hud-status-idle {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
}

#hud-difficulty {
  font-size: clamp(0.55rem, 0.9vw, 0.78rem);
  letter-spacing: 0.16em;
  font-weight: bold;
  color: var(--crt-amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.35);
}

#hud-assist {
  font-size: clamp(0.5rem, 0.8vw, 0.68rem);
  letter-spacing: 0.08em;
  color: var(--crt-cyan);
}

#hud-hint {
  font-size: clamp(0.4rem, 0.65vw, 0.55rem);
  letter-spacing: 0.04em;
  color: #3a7a52;
  line-height: 1.3;
  max-width: 100%;
}

#hud-help-prompt {
  margin-top: 0.25rem;
  font-size: clamp(0.48rem, 0.75vw, 0.62rem);
  letter-spacing: 0.1em;
  font-weight: bold;
  color: #ffb000;
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.55);
}

#hud-help-prompt.flash {
  animation: help-prompt-flash 0.55s ease-in-out infinite alternate;
}

@keyframes help-prompt-flash {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

#hud-breach {
  width: 100%;
  text-align: center;
  padding: 0.15rem 0.1rem;
}

#hud-breach.flash {
  animation: breach-flash 0.45s ease-in-out infinite alternate;
}

#hud-breach-title {
  font-size: clamp(0.5rem, 0.8vw, 0.7rem);
  letter-spacing: 0.1em;
  color: #ff4466;
  text-shadow: 0 0 8px rgba(255, 34, 68, 0.85);
  font-weight: bold;
}

#hud-breach-hint {
  margin-top: 0.2rem;
  font-size: clamp(0.42rem, 0.65vw, 0.55rem);
  letter-spacing: 0.08em;
  color: #ffb000;
}

@keyframes breach-flash {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
    filter: brightness(1.15);
  }
}

/* Death banner — canopy center */
#hud-death {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 0.85rem 1.4rem;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  letter-spacing: 0.16em;
  color: #ff4466;
  text-shadow: 0 0 12px rgba(255, 40, 60, 0.85);
  background: rgba(20, 8, 10, 0.82);
  border: 2px solid rgba(255, 60, 80, 0.75);
  box-shadow: 0 0 24px rgba(255, 30, 50, 0.35);
  animation: deathPulse 0.35s ease-in-out infinite alternate;
}

@keyframes deathPulse {
  from { opacity: 0.88; }
  to { opacity: 1; filter: brightness(1.15); }
}

/* Legacy panel helper (menus / other screens may reference) */
.hud-panel {
  background: rgba(48, 52, 58, 0.65);
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(80, 90, 100, 0.45);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
}

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  z-index: 16;
  pointer-events: none;
  border: 1px solid rgba(51, 255, 102, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(51, 255, 102, 0.4);
}

#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: rgba(51, 255, 102, 0.85);
}
#crosshair::before {
  left: 50%; top: 2px; bottom: 2px; width: 1px; margin-left: -0.5px;
}
#crosshair::after {
  top: 50%; left: 2px; right: 2px; height: 1px; margin-top: -0.5px;
}
