/* ============================================
   EXPEDITION-418 — Mission Page Styles
   Sidebar + long-scroll layout for running missions
   ============================================ */

@import url('tokens.css');

:root {
  --sidebar-width: 300px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 14% 6%, rgba(236, 84, 76, 0.12), transparent 40%),
    radial-gradient(circle at 84% 8%, rgba(247, 136, 64, 0.08), transparent 34%),
    linear-gradient(135deg, var(--bg-base) 0%, var(--bg-layer) 100%);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 220;
  background: var(--accent-bright); color: var(--bg-base);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-ui); font-size: 0.8rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ============================================
   LAYOUT
   ============================================ */
.mission-container {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.mission-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-layer);
  border-right: 1px solid var(--line-soft);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  padding: 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  margin-bottom: 1.4rem;
}

.sidebar-header h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.back-link {
  color: var(--accent-bright);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent-soft); text-decoration: underline; }

/* ---- Storm tracker in sidebar ---- */
.sidebar-storm {
  margin-bottom: 1.4rem;
  padding: 0.8rem;
  background: rgba(8, 19, 41, 0.55);
  border: 1px solid rgba(236, 84, 76, 0.25);
  border-radius: var(--radius-sm);
}

.sidebar-storm-title {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-storm-ro {
  color: var(--error-color);
  font-weight: 700;
}

.storm-phase-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(47, 63, 88, 0.3);
}
.storm-phase-row:last-child { border-bottom: none; }

.storm-phase-label {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 0;
  flex: 1;
}

.storm-phase-cells {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.storm-cell {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(80, 92, 100, 0.9);
  background: rgba(24, 33, 60, 0.72);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  padding: 0;
}
.storm-cell.active {
  background: rgba(247, 136, 64, 0.75);
  border-color: rgba(247, 136, 64, 0.92);
  box-shadow: 0 0 6px rgba(247, 136, 64, 0.24);
}
.storm-phase-row.final .storm-cell.active {
  background: rgba(236, 84, 76, 0.8);
  border-color: rgba(236, 84, 76, 0.95);
  box-shadow: 0 0 8px rgba(236, 84, 76, 0.32);
}

/* ---- Scene & goal trackers in sidebar ---- */
.sidebar-trackers {
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  background: rgba(8, 19, 41, 0.45);
  border: 1px solid rgba(117, 148, 181, 0.2);
  border-radius: var(--radius-sm);
}

.sidebar-trackers-title {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.sidebar-trackers-title--sub {
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(47, 63, 88, 0.3);
  color: var(--ok-color, #7ed6ac);
}

.sidebar-threat-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(47, 63, 88, 0.2);
  transition: opacity 0.25s ease;
}
.sidebar-threat-row:last-child { border-bottom: none; }

.sidebar-threat-row.hidden-track {
  opacity: 0.35;
}
.sidebar-threat-row.hidden-track .sidebar-threat-cells,
.sidebar-threat-row.hidden-track .sidebar-threat-count {
  opacity: 0.4;
}

.sidebar-threat-label {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-threat-cells {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.sidebar-threat-cells .threat-cell {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(80, 92, 100, 0.9);
  background: rgba(24, 33, 60, 0.72);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s, border-color 0.2s;
}

.sidebar-threat-cells .threat-cell.active {
  background: rgba(247, 136, 64, 0.75);
  border-color: rgba(247, 136, 64, 0.92);
  box-shadow: 0 0 6px rgba(247, 136, 64, 0.24);
}

.sidebar-threat-cells .threat-cell--goal.active {
  background: rgba(126, 214, 172, 0.8);
  border-color: rgba(126, 214, 172, 1);
  box-shadow: 0 0 8px rgba(126, 214, 172, 0.35);
}

.sidebar-threat-count {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  color: var(--text-dim);
  min-width: 22px;
  text-align: right;
  flex-shrink: 0;
}

/* Visibility toggle button */
.vis-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.2s, opacity 0.2s;
}
.vis-toggle:hover {
  border-color: rgba(117, 148, 181, 0.4);
  color: var(--text-muted);
}

/* ---- Custom trackers in sidebar ---- */
.sidebar-custom-tracks {
  margin-bottom: 1.2rem;
  padding: 0.6rem 0.8rem;
  background: rgba(8, 19, 41, 0.4);
  border: 1px dashed rgba(117, 148, 181, 0.25);
  border-radius: var(--radius-sm);
}

.btn-popout {
  margin-bottom: 1.2rem;
  font-size: 0.6rem;
  min-height: 34px;
}

.sidebar-custom-title {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.sidebar-custom-form {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 0.5rem;
}

.sidebar-custom-form .sidebar-custom-input {
  flex: 1 1 100%;
}

.sidebar-custom-form .sidebar-custom-size {
  flex: 0 0 auto;
}

.sidebar-custom-form .btn {
  width: auto;
  min-height: 0;
  padding: 3px 10px;
  font-size: 0.72rem;
  flex: 1 1 0;
}

.sidebar-custom-input {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid rgba(117, 148, 181, 0.3);
  border-radius: 3px;
  background: rgba(13, 21, 43, 0.7);
  color: var(--text-main);
  font-size: 0.72rem;
  font-family: var(--font-ui);
}

.sidebar-custom-size {
  width: 36px;
  padding: 3px 4px;
  border: 1px solid rgba(117, 148, 181, 0.3);
  border-radius: 3px;
  background: rgba(13, 21, 43, 0.7);
  color: var(--text-main);
  font-size: 0.72rem;
  font-family: var(--font-ui);
  text-align: center;
}

.custom-track-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(47, 63, 88, 0.2);
}
.custom-track-row:last-child { border-bottom: none; }

.custom-track-label {
  font-size: 0.7rem;
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-track-cells {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.custom-track-cell {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(80, 92, 100, 0.9);
  background: rgba(24, 33, 60, 0.72);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s, border-color 0.2s;
}

.custom-track-cell.active {
  background: rgba(247, 136, 64, 0.75);
  border-color: rgba(247, 136, 64, 0.92);
  box-shadow: 0 0 5px rgba(247, 136, 64, 0.24);
}

.custom-track-remove {
  background: none;
  border: none;
  color: rgba(236, 84, 76, 0.6);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  line-height: 1;
}
.custom-track-remove:hover {
  color: var(--error-color);
}

/* ---- TOC ---- */
.sidebar-toc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.4rem;
  flex: 1;
}

.toc-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-left: 0.9rem;
  margin-bottom: 0.3rem;
}

.toc-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  padding: 0.3rem 0 0.3rem 0.9rem;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toc-link:hover { color: var(--text-soft); }
.toc-link.active {
  color: var(--accent-bright);
  border-left-color: var(--accent-bright);
  font-weight: 600;
}

.toc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 0.6rem; font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.toc-divider {
  border: none;
  border-top: 1px dashed var(--line-soft);
  margin: 0.4rem 0;
}

/* ---- Sidebar buttons ---- */
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
}

.btn {
  min-height: 40px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-bright);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-bright);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s;
  pointer-events: none;
}
.btn:hover::after { transform: translateX(100%); }
.btn:hover, .btn:focus-visible {
  border-color: var(--accent);
  background: rgba(236, 84, 76, 0.2);
}

.btn-ghost {
  border-color: rgba(198, 217, 198, 0.5);
  color: var(--text-muted);
  font-size: 0.62rem;
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: rgba(198, 217, 198, 0.1);
  border-color: var(--text-main);
  color: var(--text-bright);
}

/* ---- Mobile toggle ---- */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  width: 42px; height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-layer);
  color: var(--accent-bright);
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 7, 29, 0.7);
  z-index: 90;
}

/* ---- Content area ---- */
.mission-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  position: relative;
}

/* ============================================
   MISSION HEADER / HERO
   ============================================ */
.mission-hero {
  position: relative;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.5rem, 4vw, 3rem);
  background:
    linear-gradient(to bottom, rgba(8, 19, 41, 0.5), rgba(8, 19, 41, 0.92)),
    url('') center/cover no-repeat;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.mission-hero-bg {
  position: absolute; inset: 0;
  background: center/cover no-repeat;
  opacity: 0.3;
  z-index: 0;
}

.mission-hero-bg--ice {
  background-image: url('/missions/cold-reception/img/ice-bg.jpg');
}

.mission-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.mission-kicker {
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.mission-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 0.8rem;
}

.mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.mission-meta-item {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.mission-meta-item span {
  color: var(--text-soft);
  font-weight: 600;
}

.mission-objectives {
  background: rgba(8, 19, 41, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 500px;
}

.mission-objectives-head {
  background: rgba(47, 79, 111, 0.3);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mission-objectives-body {
  padding: 0.5rem 0.8rem;
}

.mission-objectives-body table {
  width: 100%;
  border-collapse: collapse;
}

.mission-objectives-body td {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(47, 63, 88, 0.25);
  font-size: 0.9rem;
  color: var(--text-soft);
}

.mission-objectives-body tr:last-child td { border-bottom: none; }

.mission-objectives-body td:last-child {
  text-align: right;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
  font-weight: 600;
}

.mission-download {
  max-width: 500px;
  margin-top: 0.9rem;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.mission-section {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(47, 63, 88, 0.2);
  max-width: 900px;
}

.mission-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.mission-section h3 {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  margin-top: 1.2rem;
}

.mission-section p {
  margin-bottom: 0.6rem;
  max-width: 72ch;
}

.mission-section strong {
  color: var(--text-bright);
}

/* ============================================
   SCENE BLOCKS
   ============================================ */
.mission-scene {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(47, 63, 88, 0.2);
  max-width: 900px;
}

.scene-header-block {
  margin-bottom: 1.4rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--accent);
}

.scene-num {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.scene-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.scene-body h3 {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--text-bright);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  margin-top: 1.6rem;
}

.scene-body p {
  margin-bottom: 0.6rem;
  max-width: 72ch;
}

.scene-body strong {
  color: var(--text-bright);
}

/* ============================================
   READ-ALOUD
   ============================================ */
.read-aloud {
  border-left: 4px solid var(--accent-cyan);
  background: rgba(79, 224, 217, 0.06);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.65;
}

.read-aloud::before {
  content: '\25B6  \41F\420\41E\427\422\418\422\415  \418\41B\418  \41F\415\420\415\424\420\410\417\418\420\423\419\422\415';
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

/* ============================================
   OPERATOR TIPS
   ============================================ */

/* Style 1: Tech Documentation */
.op-tip {
  border-left: 4px solid var(--accent-amber);
  background: rgba(245, 197, 66, 0.06);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
  border-top: 1px dashed rgba(245, 197, 66, 0.2);
  border-bottom: 1px dashed rgba(245, 197, 66, 0.2);
  position: relative;
}

.op-tip::before {
  content: '\2699  \421\41E\412\415\422  \41E\41F\415\420\410\422\41E\420\423';
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-amber);
  margin-bottom: 0.4rem;
}

/* Style 2: Sticky Note */
.op-tip--sticky {
  border-left: 4px solid var(--accent-amber);
  background: rgba(245, 197, 66, 0.08);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0 1.2rem 0.5rem;
  font-size: 0.88rem;
  line-height: 1.55;
  border-top: none;
  border-bottom: none;
  border-right: 1px solid rgba(245, 197, 66, 0.12);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transform: rotate(-0.4deg);
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.2);
}

.op-tip--sticky::before {
  content: '\1F4CC  \417\410\41C\415\422\41A\410';
  color: var(--accent-amber);
}

/* ============================================
   RULE BLOCK
   ============================================ */
.rule-block {
  border-left: 4px solid var(--accent-operator);
  background: rgba(125, 183, 255, 0.06);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.rule-block::before {
  content: '\1F4D0  \41F\420\410\412\418\41B\41E';
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-operator);
  margin-bottom: 0.4rem;
}

.rule-block ol, .rule-block ul {
  padding-left: 1.2rem;
  margin: 0.3rem 0;
  font-size: 0.88rem;
}

.rule-block li {
  margin: 0.15rem 0;
}

/* ============================================
   ECHO DIALOG
   ============================================ */
.echo-dialog {
  border-left: 4px solid var(--luck-color);
  background: rgba(196, 181, 253, 0.06);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
}

.echo-dialog::before {
  content: '\25C8  \42D\425\41E';
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--luck-color);
  margin-bottom: 0.4rem;
}

/* ============================================
   THREAT CARD (stat block)
   ============================================ */
.threat-card {
  border: 1px solid rgba(247, 136, 64, 0.45);
  background: linear-gradient(165deg, rgba(32, 43, 73, 0.7), rgba(13, 21, 43, 0.85));
  border-radius: var(--radius-sm);
  margin: 1.2rem 0;
  overflow: clip;
}

.threat-card-header {
  background: rgba(2, 7, 29, 0.7);
  padding: 0.55rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.threat-card-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-bright);
}

.threat-card-ro {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(236, 84, 76, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.threat-card-sub {
  background: rgba(47, 79, 111, 0.25);
  padding: 0.25rem 0.9rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  font-style: italic;
}

.threat-card-body {
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.threat-card-body p {
  margin: 0.15rem 0 0.4rem;
}

.threat-card-body em {
  color: var(--text-muted);
}

.threat-card-section {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(47, 63, 88, 0.3);
}

.threat-card-section-title {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-operator);
  margin-bottom: 0.3rem;
}

/* Threat table */
.threat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.2rem 0;
}

.threat-table th {
  background: rgba(47, 79, 111, 0.2);
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-operator);
  padding: 0.3rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(47, 63, 88, 0.3);
}

.threat-table td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid rgba(47, 63, 88, 0.15);
  vertical-align: top;
  color: var(--text-soft);
}

.threat-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
  width: 35%;
  color: var(--text-bright);
}

/* Tags */
.stat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.3rem 0;
}

.tag {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tag-weak {
  background: rgba(126, 214, 172, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(126, 214, 172, 0.3);
}

.tag-def {
  background: rgba(236, 84, 76, 0.12);
  color: var(--error-text);
  border: 1px solid rgba(236, 84, 76, 0.25);
}

/* Stats baseline */
.stat-base {
  display: flex;
  gap: 1rem;
  margin: 0.3rem 0;
  font-size: 0.82rem;
}

.stat-base span {
  font-weight: 700;
  color: var(--accent-operator);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* Goals list */
.goals-list {
  margin: 0.2rem 0;
  padding-left: 0;
  list-style: none;
}

.goals-list li {
  margin: 0.15rem 0;
  padding: 0.2rem 0;
  border-bottom: 1px dotted rgba(47, 63, 88, 0.3);
  font-size: 0.85rem;
  color: var(--text-soft);
}
.goals-list li:last-child { border-bottom: none; }

.goal-name {
  font-weight: 700;
  color: var(--text-bright);
}

/* ---- Interactive threat track ---- */
.threat-track {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.threat-track-label {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.threat-track-cells {
  display: flex;
  gap: 4px;
}

.threat-cell {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(80, 92, 100, 0.9);
  background: rgba(24, 33, 60, 0.72);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  padding: 0;
  border-radius: 2px;
}
.threat-cell:hover {
  border-color: rgba(247, 136, 64, 0.6);
}
.threat-cell.active {
  background: rgba(247, 136, 64, 0.75);
  border-color: rgba(247, 136, 64, 0.92);
  box-shadow: 0 0 8px rgba(247, 136, 64, 0.24);
}
.threat-cell.critical {
  background: rgba(236, 84, 76, 0.8);
  border-color: rgba(236, 84, 76, 0.95);
  box-shadow: 0 0 10px rgba(236, 84, 76, 0.32);
}

.threat-cell--goal {
  border-color: rgba(126, 214, 172, 0.6);
}

.threat-track-count {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ============================================
   NPC CARD
   ============================================ */
.npc-card {
  border: 1px solid rgba(125, 183, 255, 0.35);
  background: linear-gradient(165deg, rgba(32, 43, 73, 0.7), rgba(13, 21, 43, 0.85));
  border-radius: var(--radius-sm);
  margin: 1.2rem 0;
  overflow: hidden;
}

.npc-card-header {
  background: rgba(75, 134, 217, 0.25);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-operator);
}

.npc-card-body {
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.npc-card-body p {
  margin: 0.15rem 0 0.4rem;
}

.npc-card-body strong {
  color: var(--text-bright);
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */
.mission-collapse {
  margin: 0.8rem 0;
  border: 1px solid rgba(47, 63, 88, 0.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mission-collapse-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: rgba(8, 19, 41, 0.4);
  border: none;
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-align: left;
}
.mission-collapse-trigger:hover {
  background: rgba(8, 19, 41, 0.6);
  color: var(--text-bright);
}

.mission-collapse-icon {
  font-size: 0.6rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mission-collapse[data-open] .mission-collapse-icon {
  transform: rotate(90deg);
}

.mission-collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mission-collapse[data-open] .mission-collapse-body {
  max-height: none;
}

.mission-collapse-inner {
  padding: 0.7rem 0.9rem;
}

/* ============================================
   MISSION MAP (lightbox)
   ============================================ */
.mission-map {
  margin: 1.2rem 0;
}

.mission-map img {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.mission-map img:hover { opacity: 0.9; }

.mission-map figcaption {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 0.4rem;
  text-align: center;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 7, 29, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ============================================
   TOOLTIPS
   ============================================ */
.term-tip {
  border-bottom: 1px dashed var(--accent-operator);
  cursor: help;
  position: relative;
}

.term-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  color: var(--text-bright);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  white-space: normal;
  width: max-content;
  max-width: 280px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.term-tip:hover::after,
.term-tip:focus::after {
  opacity: 1;
}

/* ============================================
   BRIEFING BOX
   ============================================ */
.briefing-box {
  background: rgba(2, 7, 29, 0.7);
  border: 1px solid rgba(47, 79, 111, 0.45);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.briefing-box .call {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.briefing-box em {
  color: var(--text-dim);
}

/* ============================================
   EPILOGUE STEPS
   ============================================ */
.epilogue-step {
  margin: 0.8rem 0;
}

.epilogue-step h3 {
  margin-top: 0 !important;
}

.step-num {
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 0.3rem;
}

/* ============================================
   CAMPAIGN HOOKS
   ============================================ */
.hook {
  border-left: 4px solid var(--accent);
  background: rgba(236, 84, 76, 0.06);
  padding: 0.9rem 1.1rem;
  margin: 0.8rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hook-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
  letter-spacing: 0.08em;
}

.hook p {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .mission-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .mission-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .mobile-toggle {
    display: flex;
  }
  .mission-content {
    margin-left: 0;
  }
  .mission-section,
  .mission-scene {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 600px) {
  .mission-hero {
    padding: 2rem 1rem;
  }
  .mission-meta {
    gap: 0.6rem;
  }
  .threat-card-sub {
    flex-direction: column;
    gap: 0.1rem;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .mission-sidebar {
    transition: none;
  }
}
