/* ==========================================================================
   Neon Houses: Proxy War - Tactical Prototype Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  --font-hud: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* HSL Color System */
  --dark-bg: hsl(225, 30%, 6%);
  --panel-bg: hsla(223, 26%, 10%, 0.75);
  --border-color: hsla(180, 100%, 50%, 0.15);
  
  --neon-cyan: hsl(180, 100%, 50%);
  --neon-pink: hsl(325, 100%, 55%);
  --neon-green: hsl(140, 95%, 45%);
  --neon-yellow: hsl(50, 100%, 50%);
  
  --neon-cyan-glow: hsla(180, 100%, 50%, 0.3);
  --neon-pink-glow: hsla(325, 100%, 55%, 0.3);
  --neon-green-glow: hsla(140, 95%, 45%, 0.3);

  --text-light: hsl(210, 20%, 90%);
  --text-muted: hsl(215, 15%, 55%);

  /* === "Gritty Command Console" art-direction tokens (Art Guide §4) === */
  --nh-bg-void: #05080A;
  --nh-bg-panel: #0B1116;
  --nh-amber: #F4A83A;
  --nh-amber-glow: rgba(244, 168, 58, 0.3);
  --nh-violet: #9B6CFF;
  --nh-red: #FF4D4D;
  /* Faction signal colors */
  --fac-veyr: #62DDE8;
  --fac-morrow: #E0A33A;
  --fac-choir: #8E6BFF;
  --fac-red-market: #D43F7D;
  --fac-civic: #AFC4CC;
  --fac-null: #77E36B;

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 28px;
  /* Radii */
  --r-sm: 3px;  --r-md: 6px;  --r-lg: 10px;
  /* Elevation / glow shadows */
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 8px var(--neon-cyan-glow);
  --shadow-glow-amber: 0 0 8px var(--nh-amber-glow);
  /* Animation timing (Art Guide §12) */
  --t-hover: 100ms;
  --t-feedback: 300ms;
  --t-hack: 500ms;
  --t-blackice: 800ms;
  --ease-snappy: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base Body Styles & CRT Scanlines */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--dark-bg);
  color: var(--text-light);
  font-family: var(--font-body);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* CRT Screen Effect Overlay */
.crt-screen::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 9999;
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
}

.scanlines {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 0%,
    rgba(18, 16, 16, 0.08) 50%,
    rgba(18, 16, 16, 0) 100%
  );
  background-size: 100% 12px;
  z-index: 9998;
  pointer-events: none;
  animation: scanlineScroll 25s linear infinite;
}

@keyframes scanlineScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

/* ===== Reduced motion: respect OS preference AND a manual toggle ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .scanlines, .crt-screen::before { display: none !important; }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after,
body.screenshot-mode *, body.screenshot-mode *::before, body.screenshot-mode *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
body.reduced-motion .scanlines,
body.reduced-motion .crt-screen::before,
body.screenshot-mode .scanlines,
body.screenshot-mode .crt-screen::before { display: none !important; }

.matrix-background {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 50% 50%, hsla(220, 30%, 15%, 0.3) 0%, transparent 80%),
    radial-gradient(circle at 10% 20%, hsla(180, 100%, 50%, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, hsla(325, 100%, 55%, 0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Layout Grid Container */
.app-container {
  display: flex;
  gap: 20px;
  width: 96vw;
  height: 94vh;
  z-index: 10;
  max-width: 1600px;
}

/* Glassmorphism Panel Bases */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.panel {
  width: 320px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.35) transparent;
}

.panel-header {
  font-family: var(--font-hud);
  font-size: 1.2rem;
  letter-spacing: 2px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.subsection-header {
  font-family: var(--font-hud);
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Utility layout blocks */
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-neon-cyan { color: var(--neon-cyan); text-shadow: 0 0 5px var(--neon-cyan-glow); }
.text-neon-pink { color: var(--neon-pink); text-shadow: 0 0 5px var(--neon-pink-glow); }
.text-neon-green { color: var(--neon-green); text-shadow: 0 0 5px var(--neon-green-glow); }
.text-neon-yellow { color: var(--neon-yellow); }

.v-good { color: var(--neon-green); }
.v-bad { color: var(--neon-pink); }

/* Left Panel Security Components */
.trace-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-tech {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.trace-bar {
  display: flex;
  gap: 4px;
  height: 20px;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.trace-notch {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.notch-active {
  background: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan-glow);
}

.notch-warning {
  background: var(--neon-yellow);
}

.notch-critical {
  background: var(--neon-pink);
  box-shadow: 0 0 8px var(--neon-pink-glow);
  animation: alarmPulse 1s infinite alternate;
}

@keyframes alarmPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.section-subtext {
  font-size: 0.75rem;
  line-height: 1.35;
}

.faction-compact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.8rem;
}

.faction-compact-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 6px;
}

/* Inline SVG icon system (inherits color via currentColor) */
.ic {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-block;
  vertical-align: middle;
  color: inherit;
}
.btn-ic { margin-right: 6px; }

/* Vanta City pressure meters */
.city-meters { display: flex; flex-direction: column; gap: var(--sp-3); }
.city-meter { cursor: help; }
.city-meter-label {
  font-family: var(--font-hud);
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.city-meter-val { font-family: var(--font-hud); font-size: 0.7rem; color: var(--text-light); }
.city-meter-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.city-meter-fill { height: 100%; transition: width var(--t-feedback) ease; }
.meter-heat { background: var(--nh-amber); box-shadow: 0 0 6px var(--nh-amber-glow); }
.meter-oppression { background: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink-glow); }
.meter-truth { background: var(--neon-cyan); box-shadow: 0 0 6px var(--neon-cyan-glow); }
.log-city { color: var(--nh-amber); }

/* Mission objective tracker */
.objective-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.objective-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.74rem;
  line-height: 1.25;
}
.obj-mark {
  width: 10px; height: 10px;
  border-radius: 2px;
  border: 1px solid var(--text-muted);
}
.obj-label { color: var(--text-light); }
.obj-tag {
  font-family: var(--font-hud);
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.obj-done .obj-mark { background: var(--neon-green); border-color: var(--neon-green); box-shadow: var(--shadow-glow-cyan); }
.obj-done .obj-tag { color: var(--neon-green); }
.obj-done .obj-label { color: var(--text-muted); text-decoration: line-through; }
.obj-active .obj-mark { border-color: var(--neon-cyan); }
.obj-active .obj-tag { color: var(--neon-cyan); }
.obj-pending .obj-mark { border-style: dashed; }
.obj-failed .obj-mark { background: var(--neon-pink); border-color: var(--neon-pink); }
.obj-failed .obj-tag { color: var(--neon-pink); }
.obj-timer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: var(--sp-2); margin-top: var(--sp-1); }
.obj-timer .obj-mark { border-color: var(--nh-amber); }
.obj-timer .obj-tag { color: var(--nh-amber); }
.obj-urgent .obj-tag { color: var(--neon-pink); animation: alarmPulse 1s infinite alternate; }
.obj-urgent .obj-mark { border-color: var(--neon-pink); }

/* Deterministic enemy intent: compact, semantic, and distinct from the post-action replay. */
.intent-mount:empty { display: none; }
.intent-mobile-mount { display: none; }
.intent-section {
  min-width: 0;
  transition: background var(--t-feedback) ease, border-color var(--t-feedback) ease;
}
.intent-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 12px;
}
.intent-heading-row .subsection-header { margin-bottom: 0; }
.intent-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid rgba(255, 46, 151, 0.45);
  border-radius: 999px;
  color: var(--text-light);
  background: rgba(255, 46, 151, 0.09);
  font-size: 0.58rem;
  vertical-align: middle;
}
.intent-toggle {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 8px;
  border-color: rgba(255, 46, 151, 0.35);
  background: rgba(255, 46, 151, 0.06);
  color: var(--neon-pink);
  font-size: 0.58rem;
  letter-spacing: 1px;
}
.intent-toggle:hover,
.intent-toggle:focus-visible { border-color: var(--neon-pink); background: rgba(255, 46, 151, 0.13); }
.intent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 360px;
  overflow: hidden auto;
  opacity: 1;
  transition: max-height var(--t-feedback) ease, opacity var(--t-feedback) ease;
}
.intent-section.is-collapsed .intent-list { max-height: 0; opacity: 0; pointer-events: none; }
.intent-section.is-collapsed .intent-heading-row { margin-bottom: 0; }
.intent-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px var(--sp-2);
  padding: 8px 9px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 2px solid var(--neon-pink);
  border-radius: var(--r-sm);
}
.intent-glyph {
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--neon-pink);
  font: 700 0.68rem var(--font-hud);
}
.intent-main {
  font: 700 0.68rem/1.2 var(--font-hud);
  letter-spacing: 0.6px;
  color: var(--text-light);
}
.intent-detail { font-size: 0.66rem; line-height: 1.25; color: var(--text-muted); }
.intent-recall { border-left-color: var(--nh-amber); }
.intent-recall .intent-glyph { color: var(--nh-amber); }
.intent-advance { border-left-color: var(--neon-cyan); }
.intent-advance .intent-glyph { color: var(--neon-cyan); }
.intent-transmit { border-left-color: var(--neon-yellow, #f3ec64); }
.intent-transmit .intent-glyph { color: var(--neon-yellow, #f3ec64); }
.intent-empty {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  padding: 4px 0;
}

.infrastructure-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.infra-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.05);
  font: 0.62rem/1 var(--font-hud);
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.infra-chip strong { color: var(--neon-cyan); font-weight: 800; }
.infra-chip.is-risk strong { color: var(--nh-amber); }

/* Center Stage Components */
.center-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hud-header {
  height: 80px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
}

.full-width { width: 100%; }

.game-title {
  font-family: var(--font-hud);
  font-size: 1.1rem;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan-glow);
}

.turn-tracker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.turn-counter {
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.countdown-bar-container {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.countdown-bar-fill {
  height: 100%;
  background: var(--neon-cyan);
  width: 100%;
  transition: width 0.5s ease, background-color 0.5s ease;
}

.phase-banner {
  font-family: var(--font-hud);
  font-size: 1rem;
  letter-spacing: 2px;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
}

.active-player {
  background: hsla(180, 100%, 50%, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px hsla(180, 100%, 50%, 0.1);
}

.active-enemy {
  background: hsla(325, 100%, 55%, 0.15);
  border: 1px solid var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: 0 0 10px hsla(325, 100%, 55%, 0.1);
  animation: alertPulse 1.2s infinite alternate;
}

/* The Grid Map System CSS */
.grid-viewport {
  flex: 1;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}


/* Phase 2: the isometric <canvas> is the primary board. It fills the viewport at a locked aspect;
   CSS scales the fixed 720x470 logical frame (hitTest accounts for the scale). The fx layer overlays
   it for floating combat numbers; the legacy DOM grid is hidden behind the USE_CANVAS_BOARD flag. */
#grid-container { position: relative; }
#board-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 920px;
  max-height: 100%;
  aspect-ratio: 720 / 470;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.board-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.fx-anchor { position: absolute; width: 0; height: 0; }
.board-rotate { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 6; }
.board-rotate button {
  width: 30px; height: 30px; border-radius: 6px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: rgba(8, 12, 20, 0.7); border: 1px solid rgba(0, 229, 255, 0.35); color: var(--neon-cyan);
}
.board-rotate button:hover { background: rgba(0, 229, 255, 0.16); border-color: var(--neon-cyan); }
.touch-confirm {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 8;
  max-width: min(86%, 440px);
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid var(--nh-amber);
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.92);
  box-shadow: 0 0 18px rgba(255, 174, 61, 0.2);
  color: var(--text-light);
  font: 700 0.66rem/1.25 var(--font-hud);
  letter-spacing: 0.7px;
  text-align: center;
  pointer-events: none;
}

/* Active action button (attack/skill armed, netrun on) */
.btn-hud.btn-active {
  border-color: var(--neon-pink) !important;
  color: var(--neon-pink) !important;
  background: rgba(255, 0, 85, 0.08) !important;
  box-shadow: 0 0 8px var(--neon-pink-glow);
}
.btn-hud-push { border-color: var(--neon-pink); color: var(--neon-pink); animation: alarmPulse 1s infinite alternate; }
.fc-note { color: var(--text-muted); font-size: 0.66rem; }

/* Hack-mode selector (trace-as-choice) */
.hackmode-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hackmode-label { font-family: var(--font-hud); font-size: 0.6rem; letter-spacing: 1px; color: var(--text-muted); margin-right: 2px; }
.hackmode-btn {
  flex: 1;
  min-width: 48px;
  font-family: var(--font-hud);
  font-size: 0.62rem;
  letter-spacing: 1px;
  padding: 5px 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--nh-border-dim, #22323a);
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.hackmode-btn.hackmode-active { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--shadow-glow-cyan); }

/* Scrolling Combat Log feed styles */
.console-panel {
  height: 160px;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
}

.console-log-feed {
  flex: 1;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  padding-right: 10px;
}

.console-log-feed::-webkit-scrollbar {
  width: 4px;
}

.console-log-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.log-line {
  margin-bottom: 4px;
  color: var(--text-light);
}

.log-alert { color: var(--neon-pink); }
.log-success { color: var(--neon-green); }
.log-failure { color: hsl(0, 100%, 60%); }
.log-hacking { color: var(--neon-cyan); }
.log-loyalty { color: var(--neon-yellow); font-style: italic; }

/* Right Panel Selected character details */
.unit-detail-hud {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prompt-select-unit {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  color: var(--text-muted);
  gap: 20px;
}

.crew-quick-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.quick-unit-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-light);
  width: 100%;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.quick-unit-btn:hover:not(:disabled) { border-color: rgba(0, 229, 255, 0.55); background: rgba(0, 229, 255, 0.07); }
.quick-unit-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.quick-unit-label { padding: 0 !important; border: 0 !important; background: none !important; color: inherit !important; font-size: inherit !important; font-weight: inherit !important; }

.quick-unit-btn span {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}

.avatar-ks { background: rgba(0, 255, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.avatar-vt { background: rgba(0, 255, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.avatar-gc { background: rgba(0, 255, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.avatar-dv { background: rgba(255, 174, 61, 0.15); color: var(--nh-amber); border: 1px solid var(--nh-amber); }

.unit-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideInHUD 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  padding-left: 12px;
  border-left: 2px solid var(--neon-cyan);
}
/* Risk accent (left border) by asset reliability */
.unit-card.risk-stable { border-left-color: var(--neon-green); }
.unit-card.risk-detached { border-left-color: var(--text-muted); }
.unit-card.risk-unstable { border-left-color: var(--nh-amber); }
.unit-card.risk-volatile { border-left-color: var(--neon-pink); }
.unit-card.risk-target { border-left-color: var(--nh-amber); }

.unit-card-headtext { display: flex; flex-direction: column; gap: 3px; }

.dossier-tag {
  font-family: var(--font-hud);
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  padding: 2px 6px;
  border-radius: 2px;
  align-self: flex-start;
  margin-top: 2px;
  border: 1px solid currentColor;
}
.risk-stable .dossier-tag { color: var(--neon-green); }
.risk-detached .dossier-tag { color: var(--text-muted); }
.risk-unstable .dossier-tag { color: var(--nh-amber); }
.risk-volatile .dossier-tag { color: var(--neon-pink); animation: alarmPulse 1s infinite alternate; }
.risk-target .dossier-tag { color: var(--nh-amber); }

@keyframes slideInHUD {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.unit-card-header {
  display: flex;
  gap: 15px;
  align-items: center;
}

.unit-icon-avatar {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan-glow);
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: 1.1rem;
}

.unit-card-name {
  font-family: var(--font-hud);
  font-size: 1.1rem;
  color: var(--text-light);
  letter-spacing: 1px;
}

.unit-card-class {
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.unit-stats-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 1px;
  font-family: var(--font-hud);
}

.stat-value {
  font-size: 0.72rem;
  font-family: var(--font-hud);
}

.stat-bar-bg {
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.3s ease;
}

.bg-neon-green { background-color: var(--neon-green); box-shadow: 0 0 6px var(--neon-green-glow); }

.stress-dots-group {
  display: flex;
  gap: 4px;
}

.stress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.02);
  transition: all 0.3s ease;
}

.dot-filled {
  background: var(--neon-cyan);
  box-shadow: 0 0 4px var(--neon-cyan-glow);
}

.dot-danger {
  background: var(--neon-pink);
  box-shadow: 0 0 5px var(--neon-pink-glow);
}

.attributes-table {
  width: 100%;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  border-collapse: collapse;
}

.attributes-table td {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.attributes-table td:nth-child(even) {
  text-align: right;
  font-family: var(--font-hud);
  font-weight: 700;
  color: var(--neon-cyan);
}

.attributes-table td:nth-child(odd) {
  color: var(--text-muted);
}

.unit-narrative-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.72rem;
}

.loyalty-badge {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-hud);
}

.badge-devoted { background: rgba(0, 255, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.badge-loyal { background: rgba(0, 255, 0, 0.12); color: var(--neon-green); border: 1px solid var(--neon-green); }
.badge-detached { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.25); }
.badge-conflicted { background: rgba(255, 200, 0, 0.12); color: var(--neon-yellow); border: 1px solid var(--neon-yellow); }
.badge-fractured { background: rgba(255, 0, 85, 0.15); color: var(--neon-pink); border: 1px solid var(--neon-pink); }

/* Loyalty bar fills, tinted by how close the unit is to breaking */
.bg-loyalty-high { background-color: var(--neon-cyan); box-shadow: 0 0 6px var(--neon-cyan-glow); }
.bg-loyalty-mid { background-color: var(--neon-yellow); box-shadow: 0 0 6px rgba(255, 200, 0, 0.3); }
.bg-loyalty-low { background-color: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink-glow); }

/* Crew bond chips */
.bonds-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.bond-chip {
  font-size: 0.62rem;
  font-family: var(--font-hud);
  letter-spacing: 0.5px;
  padding: 4px 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid var(--neon-cyan);
  cursor: help;
}

.bond-chip .bond-type {
  font-weight: 900;
  margin-right: 4px;
}

.bond-chip .bond-effect {
  float: right;
  color: var(--text-muted);
}

.bond-trust { border-left-color: var(--neon-cyan); }
.bond-trust .bond-type { color: var(--neon-cyan); }
.bond-debt { border-left-color: var(--neon-green); }
.bond-debt .bond-type { color: var(--neon-green); }
.bond-suspicion { border-left-color: var(--neon-yellow); }
.bond-suspicion .bond-type { color: var(--neon-yellow); }
.bond-redline { border-left-color: var(--neon-red); background: rgba(255, 77, 77, 0.06); }
.bond-redline .bond-type { color: var(--neon-red); }

/* Vengeance / refusal status line in the unit card */
.psych-status-line {
  font-size: 0.65rem;
  font-family: var(--font-hud);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon-pink);
  padding: 4px 0;
}

/* Command HUD Actions Panel */
.actions-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-buttons-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-divider {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 5px 0;
}

/* Button style standards */
button {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  outline: none;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  border-color: rgba(255,255,255,0.05) !important;
}

.btn-primary {
  background: var(--neon-cyan);
  color: var(--dark-bg);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.btn-primary:hover {
  background: #00cccc;
  box-shadow: 0 0 15px var(--neon-cyan);
}

.btn-primary.btn-active {
  background: var(--dark-bg);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  box-shadow: 0 0 6px rgba(0, 255, 255, 0.05);
}

.btn-secondary:hover {
  background: rgba(0, 255, 255, 0.08);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
  border-color: var(--neon-cyan);
}

.btn-danger {
  background: rgba(255, 0, 85, 0.1);
  border: 1px solid rgba(255, 0, 85, 0.4);
  color: var(--neon-pink);
}

.btn-danger:hover {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink-glow);
}

.btn-hud {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  text-align: left;
  padding-left: 15px;
}

.btn-hud:hover {
  background: rgba(0, 255, 255, 0.06);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-hud-attack {
  border-color: rgba(255, 0, 85, 0.2);
}

.btn-hud-attack:hover {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  background: rgba(255, 0, 85, 0.05);
}

.btn-hud-skill {
  border-color: rgba(255, 200, 0, 0.2);
}

.btn-hud-skill:hover {
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
  background: rgba(255, 200, 0, 0.05);
}

.btn-full-width { width: 100%; }
.checkpoint-btn { margin-top: 2px; border-style: dashed; }
.checkpoint-status {
  display: block;
  min-height: 1em;
  color: var(--text-muted);
  font: 0.56rem/1.2 var(--font-hud);
  letter-spacing: 0.8px;
  text-align: center;
}
.checkpoint-status.is-saved { color: var(--neon-green); }
.checkpoint-status.is-error { color: var(--neon-pink); }

/* Absolute Combat Forecast Tooltip */
.combat-forecast-tooltip {
  position: absolute;
  background: var(--panel-bg);
  border: 1px solid var(--neon-pink);
  box-shadow: 0 0 12px var(--neon-pink-glow);
  border-radius: 4px;
  padding: 12px;
  z-index: 10006; /* above the iso play-surface overlay (10001) */
  width: 180px;
  pointer-events: none;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.forecast-title {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.forecast-target {
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
  margin-bottom: 4px;
}

.forecast-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Fullscreen Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(5, 8, 15, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  /* Modal controls must sit above boot/title dossiers (10002) as well as the play surface. */
  z-index: 10003;
  animation: fadeIn 0.4s ease;
  backdrop-filter: blur(12px);
}


@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal-card {
  width: 90%;
  max-width: 960px;
  padding: 35px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.modal-header h2 {
  font-family: var(--font-hud);
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 0.82rem;
}

.modal-content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.modal-column {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 15px;
}

.fallout-detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fallout-list-item {
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.fallout-list-item strong {
  font-family: var(--font-hud);
  letter-spacing: 0.5px;
  font-size: 0.78rem;
}

.fallout-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

/* Next-operation forecast in the debrief */
.fallout-preview {
  border-top: 1px solid rgba(244, 168, 58, 0.25);
  padding-top: 16px;
}
.preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-list li {
  font-size: 0.8rem;
  color: var(--text-light);
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}
.preview-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--nh-amber);
}

/* Briefing before-state city feed */
.briefing-feed {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  color: var(--text-muted);
  border-left: 2px solid var(--neon-pink);
  padding: 8px 12px;
  background: rgba(255, 0, 85, 0.05);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.modal-card { max-height: 90vh; overflow-y: auto; }

/* ===== Responsive guardrails (desktop-first; graceful down to tablet) ===== */
@media (max-width: 1200px) {
  .panel { width: 264px; padding: 14px; gap: 14px; }
  .app-container { gap: 12px; }
}
@media (max-width: 980px) {
  body {
    overflow: auto;
    align-items: flex-start;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }
  .app-container {
    flex-direction: column;
    height: auto;
    min-height: 94vh;
    width: 100%;
    gap: 10px;
  }
  .center-stage { order: 0; gap: 10px; }
  #panel-crew { order: 1; }
  #panel-security { order: 2; }
  .panel { width: 100%; flex-shrink: 1; }
  .intent-mobile-mount { display: block; }
  .intent-mobile-mount .intent-section {
    padding: 10px 12px;
    border: 1px solid rgba(255, 46, 151, 0.25);
    border-left: 3px solid var(--neon-pink);
    border-radius: var(--r-sm);
    background: rgba(9, 8, 20, 0.88);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  }
  .intent-list { max-height: 190px; }
  .intent-item { padding: 7px 8px; }
  .intent-detail {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.54rem;
  }
  .intent-glyph { grid-row: 1; }
  .grid-viewport { min-height: 0; padding: 8px; }
  .hud-header { height: auto; min-height: 68px; padding: 10px 14px; }
  .game-title { font-size: clamp(0.76rem, 3.4vw, 1rem); }
  .phase-banner { min-width: 96px; padding: 7px 8px; font-size: 0.58rem; text-align: center; }
  .board-rotate button,
  button:not(.intent-toggle) { min-height: 44px; }
  .intent-toggle { min-height: 44px; }
  .board-rotate button { width: 44px; height: 44px; }
  .touch-confirm { bottom: 10px; max-width: 92%; }
  .combat-forecast-tooltip,
  .tile-inspector {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto !important;
    width: auto;
    max-width: none;
  }
  .modal-content-grid { grid-template-columns: 1fr; }
  .briefing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .panel { padding: 12px; gap: 12px; }
  .console-panel { min-height: 100px; max-height: 150px; }
  .turn-counter { font-size: 0.58rem; }
  .phase-banner { max-width: 112px; }
  .intent-main { font-size: 0.62rem; }
  .intent-toggle { min-height: 44px; }
  .settings-row { align-items: flex-start; flex-direction: column; }
  .settings-row input[type="range"] { width: 100%; }
  .boot-inner { width: min(96vw, 520px); padding: 22px 14px; }
}

/* Final data choice */
.final-choice-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.final-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--nh-border-dim, #22323a);
  border-left: 3px solid var(--neon-cyan);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-hover) ease, border-color var(--t-hover) ease;
  width: 100%;
}
.final-choice-btn:hover {
  background: rgba(0, 255, 255, 0.06);
  border-left-color: var(--nh-amber);
}
.final-choice-btn .fc-label {
  font-family: var(--font-hud);
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--text-light);
}
.final-choice-btn .fc-effect { font-size: 0.76rem; color: var(--text-muted); }

/* Consequence report gets the debrief evidence-desk backdrop */
#fallout-modal .modal-card {
  position: relative;
  background:
    linear-gradient(rgba(5, 8, 12, 0.86), rgba(5, 8, 12, 0.94)),
    url('assets/ui/bg-debrief.jpg') center / cover no-repeat;
  border: 1px solid var(--neon-green);
}
#fallout-modal .modal-card.card-defeat { border-color: var(--neon-pink); }
#fallout-modal .modal-card.card-partial {
  border-color: var(--nh-amber);
  box-shadow: var(--shadow-panel), inset 0 0 28px rgba(244, 168, 58, 0.06);
}

.outcome-badge {
  display: inline-block;
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 3px;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}
.outcome-badge.outcome-victory {
  color: var(--nh-bg-void);
  background: var(--neon-green);
  box-shadow: 0 0 12px var(--neon-green-glow);
}
.outcome-badge.outcome-defeat {
  color: var(--text-light);
  background: var(--neon-pink);
  box-shadow: 0 0 12px var(--neon-pink-glow);
}
.outcome-badge.outcome-partial {
  color: var(--nh-bg-void);
  background: var(--nh-amber);
  box-shadow: 0 0 12px var(--nh-amber-glow);
}

/* Tile / object inspector (hover help) */
.tile-inspector {
  position: absolute;
  z-index: 10006; /* above the iso play-surface overlay (10001) */
  width: 190px;
  padding: 10px 12px;
  background: rgba(8, 14, 19, 0.95);
  border: 1px solid var(--neon-cyan);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-panel);
  pointer-events: none;
  font-size: 0.72rem;
}
.tile-inspector .insp-title {
  font-family: var(--font-hud);
  font-size: 0.8rem;
  letter-spacing: 1px;
  margin-bottom: 6px;
  color: var(--neon-cyan);
}
.tile-inspector .insp-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  line-height: 1.5;
}
.tile-inspector .insp-row span:last-child { color: var(--text-light); text-align: right; }
.insp-pink { border-color: var(--neon-pink); }
.insp-pink .insp-title { color: var(--neon-pink); }
.insp-amber { border-color: var(--nh-amber); }
.insp-amber .insp-title { color: var(--nh-amber); }
.insp-green { border-color: var(--neon-green); }
.insp-green .insp-title { color: var(--neon-green); }

/* ==========================================================================
   Boot overlays: Title screen + Mission briefing (Gritty Command Console)
   ========================================================================== */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--nh-bg-void);
  animation: fadeIn 0.5s ease;
}

#title-screen {
  flex-direction: column;
  text-align: center;
  background:
    linear-gradient(rgba(5, 8, 10, 0.55), rgba(5, 8, 10, 0.85)),
    url('assets/ui/bg-title.jpg') center / cover no-repeat;
}

.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px;
  background: rgba(5, 9, 14, 0.35);
  backdrop-filter: blur(2px);
  border-radius: 8px;
}

.game-wordmark {
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  letter-spacing: 6px;
  color: var(--text-light);
  text-shadow: 0 0 18px var(--neon-cyan-glow), 0 2px 4px #000;
  line-height: 1;
}
.wordmark-sub { color: var(--neon-cyan); }

.game-tagline {
  font-family: var(--font-hud);
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-transform: uppercase;
}
.game-tagline .tag-amber { color: var(--nh-amber); }

.boot-btn {
  margin-top: 10px;
  font-size: 1rem;
  padding: 14px 38px;
  letter-spacing: 3px;
}
.resume-btn {
  border-color: var(--neon-green);
  background: var(--neon-green);
  box-shadow: 0 0 15px rgba(65, 240, 160, 0.25);
}
.resume-btn:hover { background: #31d78c; box-shadow: 0 0 18px rgba(65, 240, 160, 0.45); }
.resume-meta {
  margin-top: -12px;
  color: var(--neon-green);
  font: 0.62rem/1.3 var(--font-hud);
  letter-spacing: 1px;
}

.boot-foot {
  font-size: 0.75rem;
  letter-spacing: 1px;
  max-width: 420px;
}

.boot-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.boot-toggle input { accent-color: var(--neon-cyan); cursor: pointer; }

/* Campaign continuity recap on the title screen */
.last-op-recap {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 12px 16px;
  background: rgba(8, 14, 19, 0.6);
  border: 1px solid var(--nh-amber-glow);
  border-left-width: 3px;
  border-radius: var(--r-sm);
}
.recap-label { font-family: var(--font-hud); font-size: 0.62rem; letter-spacing: 2px; color: var(--nh-amber); }
.recap-body { color: var(--text-light); font-size: 0.82rem; }
.recap-carry { color: var(--text-muted); font-size: 0.72rem; }
.recap-mutator { color: var(--neon-pink); font-size: 0.74rem; margin-top: 2px; }

/* Briefing dossier */
.briefing-overlay {
  background:
    linear-gradient(rgba(5, 8, 12, 0.78), rgba(5, 8, 12, 0.92)),
    url('assets/ui/bg-briefing-lockdown-clock.jpg') center / cover no-repeat;
}

.briefing-card {
  width: 90%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(8, 14, 19, 0.9);
  border: 1px solid var(--nh-amber-glow);
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.briefing-tag {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: var(--nh-amber);
}

.briefing-title {
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 3px;
  color: var(--text-light);
  margin: 4px 0;
}

.briefing-sub { font-size: 0.82rem; }

.briefing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.briefing-block {
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid var(--neon-cyan);
  border-radius: 4px;
  padding: 14px 16px;
}
.briefing-block h3 {
  font-family: var(--font-hud);
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  margin-bottom: 8px;
}
.briefing-block p { font-size: 0.85rem; line-height: 1.5; color: var(--text-light); }
.briefing-block strong { color: var(--nh-amber); }
.briefing-warn { border-left-color: var(--nh-amber); }
.briefing-warn h3 { color: var(--nh-amber); }

.briefing-choice {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 193, 7, 0.22);
  border-left: 3px solid var(--nh-amber);
  border-radius: var(--r-sm);
}
.briefing-choice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font: 700 0.7rem/1.2 var(--font-hud);
  letter-spacing: 1.2px;
  color: var(--nh-amber);
}
.briefing-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.briefing-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 68px;
  padding: 10px 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sm);
  color: var(--text-light);
  cursor: pointer;
}
.briefing-choice-btn:hover,
.briefing-choice-btn.is-selected {
  border-color: var(--nh-amber);
  background: rgba(255, 193, 7, 0.08);
}
.briefing-choice-btn strong { font: 700 0.74rem var(--font-hud); letter-spacing: 0.8px; }
.briefing-choice-btn span { font-size: 0.7rem; line-height: 1.35; color: var(--text-muted); }

.briefing-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 18px;
}
.briefing-foot span { font-size: 0.76rem; line-height: 1.4; }

@media (max-width: 760px) {
  .briefing-choice-list { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Portraits: crew dossier avatar + enemy forecast thumbnail
   ========================================================================== */
.unit-icon-avatar.has-portrait {
  width: 64px;
  height: 84px;
  border-radius: 4px;
  background-size: cover;
  background-position: top center;
  color: transparent; /* hide fallback initials */
  text-indent: -9999px;
}

.forecast-portrait {
  width: 100%;
  height: 96px;
  border-radius: 3px;
  background-size: cover;
  background-position: top center;
  margin-bottom: 8px;
  border: 1px solid var(--neon-pink);
  filter: saturate(0.9) contrast(1.05);
}

/* ============================================================================
   COMBAT JUICE — floating damage numbers, hit flashes, screen shake.
   All motion is driven by CSS animations, so the reduced-motion / screenshot
   overrides above neutralize it automatically (the HP bars carry the info).
   ============================================================================ */

/* Floating combat numbers (appended to the affected tile; the tile doesn't clip) */
.fx-float {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  pointer-events: none;
  z-index: 60;
  text-shadow: 0 0 6px currentColor, 0 1px 2px #000;
  animation: fxFloat 0.55s ease-out forwards;
  white-space: nowrap;
}
.fx-float.fx-dmg  { color: #ff4f6d; }
.fx-float.fx-crit { color: #ffd23f; font-size: 1.45rem; }
.fx-float.fx-heal { color: #41f0a0; }
.fx-float.fx-miss { color: #9fb4bd; font-size: 0.85rem; font-weight: 700; }
@keyframes fxFloat {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(0.7); }
  20%  { opacity: 1; transform: translate(-50%, -2px) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -26px) scale(1); }
}

/* Token impact flash */
@keyframes fxHit {
  0%   { filter: brightness(2.4) saturate(0.3); }
  40%  { filter: brightness(1.2); }
  100% { filter: none; }
}
@keyframes fxCrit {
  0%   { filter: brightness(3) saturate(0.2) drop-shadow(0 0 8px #ffd23f); transform: scale(1.18); }
  50%  { filter: brightness(1.4) drop-shadow(0 0 4px #ffd23f); transform: scale(1.04); }
  100% { filter: none; transform: scale(1); }
}

/* Board shake on impact (applied to the persistent grid canvas, not the rebuilt children) */
.fx-shake1 { animation: fxShake1 0.22s ease-in-out; }
.fx-shake2 { animation: fxShake2 0.34s ease-in-out; }
@keyframes fxShake1 {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 1px); }
}
@keyframes fxShake2 {
  0%,100% { transform: translate(0,0); }
  15% { transform: translate(-4px, 2px) rotate(-0.3deg); }
  35% { transform: translate(4px, -2px) rotate(0.3deg); }
  55% { transform: translate(-3px, 2px); }
  75% { transform: translate(3px, -1px); }
  90% { transform: translate(-1px, 1px); }
}

/* ============================================================================
   SETTINGS PANEL (audio + accessibility), reachable from title + HUD.
   ============================================================================ */
.settings-trigger {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--nh-border-dim, #22323a);
  color: var(--text-muted, #8aa0a8);
  border-radius: var(--r-sm, 4px);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, border-color 0.2s;
}
.settings-trigger:hover { color: var(--neon-cyan); border-color: var(--neon-cyan); }

.settings-card {
  width: min(440px, 92vw);
  background: var(--nh-panel, #0b1418);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--r-md, 6px);
  padding: 22px 24px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6), 0 0 24px hsla(180,100%,50%,0.12);
}
.settings-card h2 {
  font-family: var(--font-display, 'Orbitron', sans-serif);
  color: var(--neon-cyan);
  letter-spacing: 0.12em;
  font-size: 1.1rem;
  margin: 0 0 4px;
}
.settings-card .settings-sub { color: var(--text-muted, #8aa0a8); font-size: 0.82rem; margin: 0 0 18px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.settings-row:first-of-type { border-top: none; }
.settings-row label { font-size: 0.9rem; color: var(--text-bright, #d7e6ea); }
.settings-row .settings-hint { display: block; font-size: 0.72rem; color: var(--text-muted, #8aa0a8); margin-top: 2px; }
.settings-row input[type="range"] { width: 160px; accent-color: var(--neon-cyan); cursor: pointer; }
.settings-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--neon-cyan); cursor: pointer; }
.settings-vol-val { min-width: 38px; text-align: right; color: var(--neon-cyan); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.settings-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.version-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--neon-cyan);
  border-radius: 999px;
  color: var(--neon-cyan);
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  vertical-align: middle;
}


/* How to Play card */
.boot-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.help-card { width: min(560px, 94vw); }
.help-card h2 { font-family: var(--font-display, 'Orbitron', sans-serif); color: var(--neon-cyan); letter-spacing: 0.12em; font-size: 1.1rem; margin: 0 0 4px; }
.help-section { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.05); }
.help-section h3 { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--text-bright, #d7e6ea); margin: 0 0 6px; letter-spacing: 0.04em; }
.help-section h3 .ic { width: 18px; height: 18px; color: var(--neon-cyan); }
.help-section p { font-size: 0.85rem; color: var(--text-muted, #9fb4bd); line-height: 1.55; margin: 0; }
.help-section.help-warn h3 { color: #ffae3d; }
.help-cyan { color: var(--neon-cyan); }
.help-pink { color: var(--neon-pink); }
.help-amber { color: #ffae3d; }
.help-keys { font-size: 0.78rem; color: var(--text-muted, #8aa0a8); margin-top: 8px; }
.help-keys kbd { display: inline-block; background: rgba(0,229,255,0.08); border: 1px solid rgba(0,229,255,0.3); border-radius: 3px; padding: 0 6px; margin: 0 2px; font-family: var(--font-mono, monospace); font-size: 0.74rem; color: var(--neon-cyan); }

/* Mission Select cards */
.missions-card { width: min(620px, 94vw); }
.missions-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 0; max-height: 56vh; overflow-y: auto; }
.mission-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; width: 100%; padding: 11px 14px; background: rgba(0,0,0,0.35); border: 1px solid var(--nh-border-dim, #22323a); border-left: 3px solid var(--neon-cyan); border-radius: 0; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.mission-pick:hover { background: rgba(0,229,255,0.06); border-left-color: var(--neon-pink); }
.mission-pick .mp-name { font-family: var(--font-display, 'Orbitron', sans-serif); color: var(--neon-cyan); letter-spacing: 0.05em; font-size: 0.95rem; }
.mission-pick .mp-tag { font-size: 0.68rem; color: var(--neon-pink); letter-spacing: 0.08em; }
.mission-pick .mp-sub { font-size: 0.77rem; color: var(--text-muted, #8aa0a8); margin-top: 3px; }
