/* style.css - NASA Space Mission Design Game Web Styles */

:root {
  --bg-deep: #050811;
  --bg-panel: #0b1120;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --border: rgba(56, 189, 248, 0.2);
  --border-glow: rgba(0, 229, 255, 0.4);
  --cyan: #00e5ff;
  --cyan-dim: #38bdf8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(0, 229, 255, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 82% 85%, rgba(56, 189, 248, 0.07) 0%, transparent 45%),
    linear-gradient(180deg, #03060e 0%, #070d1c 55%, #040711 100%);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

/* Header & Mission Bar */
.game-header {
  background: rgba(11, 17, 32, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 7px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  backdrop-filter: blur(8px);
  z-index: 100;
  flex-shrink: 0;
}

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

.brand-badge {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: var(--cyan-dim);
  white-space: nowrap;
}

.phase-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.step-item {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.step-item.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-icon:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Main Layout Area */
.app-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 10px 16px;
  overflow: hidden;
  min-height: 0;
}

.screen-view {
  display: none;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
}

.screen-view.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

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

/* Common UI Elements */
.hud-card {
  background: linear-gradient(165deg, rgba(16, 26, 48, 0.92) 0%, rgba(9, 15, 29, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-top: 1px solid rgba(0, 229, 255, 0.38);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.hud-header {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 1px solid var(--cyan-dim);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #475569;
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 13px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  color: var(--text-main);
  border-color: var(--cyan-dim);
}

/* -------------------------------------------------------------
   Phase 1: Mission Select
------------------------------------------------------------- */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.mission-card {
  background: linear-gradient(160deg, rgba(16, 27, 50, 0.92) 0%, rgba(8, 13, 26, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mission-card-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.mission-card-titles {
  flex: 1;
  min-width: 0;
}

.mission-planet-canvas {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.22));
}

.mission-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 229, 255, 0.24), inset 0 0 18px rgba(0, 229, 255, 0.06);
}

.mission-card.selected {
  border-color: var(--cyan);
  background: linear-gradient(160deg, rgba(14, 34, 64, 0.96) 0%, rgba(8, 18, 38, 0.98) 100%);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.38), inset 0 0 22px rgba(0, 229, 255, 0.1);
}

.mission-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
}

.mission-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.mission-target {
  font-size: 13px;
  color: var(--cyan-dim);
  margin-bottom: 8px;
}

.mission-spec-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 0;
  font-size: 13px;
}

.mission-spec-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.spec-key {
  color: var(--text-muted);
}

.spec-val {
  font-weight: 700;
  color: var(--text-main);
}

/* -------------------------------------------------------------
   Phase 2: Spacecraft Builder (3 Columns, Strictly Contained)
------------------------------------------------------------- */
.builder-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.15fr;
  gap: 12px;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.catalog-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.builder-rocket-cap-badge {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}

.builder-rocket-cap-badge.overweight {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
}

.builder-rocket-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 7px;
  flex-shrink: 0;
}

.builder-rocket-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  min-width: 0;
}

.builder-rocket-pill:hover {
  border-color: var(--cyan);
  color: #f8fafc;
}

.builder-rocket-pill.selected {
  background: rgba(0, 229, 255, 0.13);
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.18);
}

.builder-rocket-pill.selected.overweight {
  background: rgba(239, 68, 68, 0.16);
  border-color: var(--red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

.builder-rocket-pill-name {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.builder-rocket-pill-meta {
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  color: var(--cyan-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.builder-rocket-pill.selected.overweight .builder-rocket-pill-meta {
  color: #fca5a5;
}

.catalog-search-input {
  width: 100%;
  background: rgba(5, 10, 22, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text-main);
  font-size: 12.5px;
  margin-bottom: 7px;
  outline: none;
  flex-shrink: 0;
}

.catalog-search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.category-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.cat-tab {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-tab.active {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan);
  border-color: var(--cyan);
}

.catalog-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.catalog-item-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.catalog-item-card.recommended-highlight {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(30, 24, 14, 0.45);
}

.catalog-item-card.selected-rocket {
  border-color: var(--cyan);
  background: rgba(14, 28, 48, 0.92);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.22);
}

.catalog-item-card.selected-rocket.overweight {
  border-color: var(--red);
  background: rgba(45, 16, 24, 0.85);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.24);
}

.rec-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  align-self: flex-start;
}

.catalog-item-card:hover {
  border-color: var(--cyan-dim);
  background: rgba(30, 41, 59, 0.7);
}

.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.item-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
}

.item-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.item-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--cyan-dim);
  margin-top: 2px;
}

.btn-add-part {
  background: rgba(2, 132, 199, 0.3);
  border: 1px solid var(--cyan-dim);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-end;
  margin-top: 2px;
  transition: all 0.15s;
}

.btn-add-part:hover {
  background: var(--cyan);
  color: #000;
}

/* Center Column (Schematic & Installed Subsystems) */
.center-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.schematic-box {
  flex: 1.15;
  min-height: 180px;
  max-height: 270px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.schematic-canvas {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.installed-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.installed-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}

.subsystem-section-banner {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(30, 41, 59, 0.6);
  margin-top: 4px;
}

.installed-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 6px 9px;
  font-size: 12px;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-multiplier {
  background: var(--cyan);
  color: #000;
  font-weight: 800;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
}

.item-ctrls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.btn-ctrl {
  background: rgba(51, 65, 85, 0.8);
  border: none;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ctrl:hover {
  background: var(--cyan);
  color: #000;
}

.btn-ctrl-remove {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.btn-ctrl-remove:hover {
  background: var(--red);
  color: #fff;
}

/* Right Column (Diagnostics & Checklist) */
.diagnostics-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.gauge-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
}

.gauge-label-row {
  display: flex;
  justify-content: space-between;
}

.progress-bar-track {
  height: 8px;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.checklist-container {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.check-pass {
  color: var(--green);
}

.check-fail {
  color: var(--red);
}

.check-warn {
  color: var(--amber);
}

/* -------------------------------------------------------------
   Phase 3: Launch Vehicle & Countdown
------------------------------------------------------------- */
.launch-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.45fr;
  gap: 14px;
  flex: 1;
  height: 100%;
  min-height: 0;
}

.rocket-selector-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.rocket-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.rocket-card:hover {
  border-color: var(--cyan);
}

.rocket-card.selected {
  border-color: var(--cyan);
  background: rgba(14, 28, 48, 0.95);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
}

.launch-viewport-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 0;
}

.view-tabs {
  display: flex;
  gap: 6px;
}

.view-tab {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-tab.active {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan);
  border-color: var(--cyan);
}

.launch-canvas-wrapper {
  flex: 1;
  position: relative;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.launch-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* -------------------------------------------------------------
   Phase 4: Simulation & Full Cockpit Journey
------------------------------------------------------------- */
.sim-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 12px;
  flex: 1;
  height: 100%;
  min-height: 0;
}

.sim-flight-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.sim-canvas-box {
  flex: 1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 0;
}

.sim-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.flight-logs-box {
  height: 105px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.sim-telemetry-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.telemetry-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 12px;
}

.telemetry-title {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.telemetry-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  font-family: monospace;
}

.sim-controls-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* -------------------------------------------------------------
   Dialogue Box & Characters
------------------------------------------------------------- */
.dialogue-bar {
  background: rgba(11, 17, 32, 0.95);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.char-portrait {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 1.5px solid var(--cyan);
  overflow: hidden;
  flex-shrink: 0;
  background: #0f172a;
}

.char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialogue-content {
  flex: 1;
}

.dialogue-speaker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--cyan);
  margin-bottom: 3px;
}

.dialogue-text {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.4;
}

/* -------------------------------------------------------------
   Malfunction Incident Modal
------------------------------------------------------------- */
.incident-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.incident-modal-backdrop.active {
  display: flex;
}

.incident-modal {
  background: #0b1120;
  border: 1.5px solid var(--red);
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  width: 640px;
  max-width: 90vw;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popIn 0.25s ease-out;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.incident-title {
  color: var(--red);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.incident-canvas-wrapper {
  height: 165px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.incident-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.incident-desc {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.45;
}

.incident-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn-choice {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  line-height: 1.4;
}

.btn-choice:hover {
  border-color: var(--cyan);
  background: rgba(14, 28, 48, 0.95);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

/* -------------------------------------------------------------
   Phase 5: Debrief
------------------------------------------------------------- */
.debrief-card {
  background: var(--bg-card);
  border: 1.5px solid var(--green);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.debrief-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 4px;
}

.debrief-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.debrief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.debrief-col {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.6;
}

.debrief-col h4 {
  color: var(--cyan);
  margin-bottom: 8px;
  font-size: 14.5px;
}

/* -------------------------------------------------------------
   NASA/JPL Concept Maturity Levels (CML) Pill & Modal
------------------------------------------------------------- */
.btn-cml-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 229, 255, 0.10);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--cyan);
  padding: 5px 11px;
  border-radius: 999px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cml-pill:hover {
  background: rgba(0, 229, 255, 0.20);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.cml-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.cml-modal {
  width: 560px;
  max-width: 92vw;
  max-height: 78vh;
  padding: 14px 16px;
  gap: 8px;
}

.cml-modal .incident-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  flex-shrink: 0;
}

.cml-modal .incident-desc {
  font-size: 14.5px;
  line-height: 1.5;
  flex-shrink: 0;
}

.cml-levels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.cml-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.cml-row.done {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(20, 83, 45, 0.22);
}

.cml-row.current {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.18);
}

.cml-badge {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan);
  white-space: nowrap;
}

.cml-row.done .cml-badge {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

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

.cml-source-link {
  color: var(--cyan-dim);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}

.cml-source-link:hover {
  color: var(--cyan);
  text-decoration: underline;
}

/* -------------------------------------------------------------
   Details Tab Upgrades: Difficulty, Team Mode, Orbit & Archive
------------------------------------------------------------- */
#screen-mission-select,
#screen-debrief {
  overflow-y: auto;
  padding-right: 4px;
}

.mission-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
  margin-top: 12px;
}

.setup-panel {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s;
}

.pill-btn:hover {
  border-color: var(--cyan-dim);
  color: var(--text-main);
}

.pill-btn.active {
  background: rgba(0, 229, 255, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.setup-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.mode-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

.setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.team-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.team-role-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.team-role-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.3px;
}

.team-role-focus {
  font-size: 11px;
  color: var(--text-muted);
}

.team-name-input {
  background: rgba(5, 10, 20, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-main);
  font-size: 12.5px;
  padding: 4px 7px;
  border-radius: 4px;
  outline: none;
}

.team-name-input:focus {
  border-color: var(--cyan);
}

.orbit-pills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.orbit-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  padding: 9px 11px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orbit-card:hover {
  border-color: var(--cyan-dim);
}

.orbit-card.selected {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
}

.orbit-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.orbit-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
  font-family: Consolas, "Courier New", monospace;
}

.orbit-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.team-signoff-bar {
  background: rgba(12, 22, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.team-signoff-header {
  font-size: 10px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.4px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.team-signoff-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.signoff-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signoff-btn.approved {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(20, 83, 45, 0.35);
  color: var(--green);
}

.debrief-analysis-card {
  margin-top: 12px;
  background: linear-gradient(165deg, rgba(16, 26, 48, 0.92), rgba(9, 15, 29, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
}

.analysis-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.analysis-item {
  font-size: 13.5px;
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  border-left: 3px solid var(--cyan);
}

.typing-cursor {
  display: inline-block;
  color: var(--cyan);
  font-weight: 800;
  margin-left: 2px;
  animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.typing-skip-btn {
  padding: 2px 9px;
  font-size: 10.5px;
  height: auto;
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--cyan);
}

.analysis-item.good { border-left-color: var(--green); }
.analysis-item.warn { border-left-color: var(--amber); }
.analysis-item.bad  { border-left-color: var(--red); }

.incident-team-note {
  margin: 0 0 12px 0;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(14, 116, 144, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 13px;
  color: #bae6fd;
  line-height: 1.45;
}

.concept-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 7px;
  padding: 13px 15px;
}

.concept-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 6px;
}

.concept-formula {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13.5px;
  color: var(--amber);
  background: rgba(2, 6, 23, 0.75);
  padding: 6px 10px;
  border-radius: 4px;
  margin: 4px 0 8px 0;
  display: inline-block;
}

.concept-body {
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.55;
}

.archive-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  padding: 9px 12px;
}

.archive-card.success {
  border-left: 3px solid var(--green);
}

.archive-card.fail {
  border-left: 3px solid var(--red);
}

/* -------------------------------------------------------------
   Start Game Title Screen ("Build Your Rocket")
------------------------------------------------------------- */
.start-screen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: radial-gradient(circle at 50% 35%, #0b1630 0%, #040814 68%, #02040a 100%);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.start-screen-overlay.active {
  display: flex;
  animation: fadeIn 0.35s ease-out;
}

.start-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.start-hero-card {
  position: relative;
  z-index: 2;
  max-width: 680px;
  width: 100%;
  background: linear-gradient(165deg, rgba(13, 23, 45, 0.88) 0%, rgba(7, 13, 27, 0.94) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-top: 2px solid var(--cyan);
  border-radius: 14px;
  padding: 34px 36px 26px 36px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.78), 0 0 45px rgba(0, 229, 255, 0.14);
  backdrop-filter: blur(14px);
}

.start-top-badge {
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.32);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.start-game-title {
  font-size: clamp(34px, 5.5vw, 54px);
  font-weight: 900;
  letter-spacing: 2.5px;
  line-height: 1.05;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 10%, #7dd3fc 52%, #00e5ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 32px rgba(0, 229, 255, 0.25);
}

.start-studio-credit {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.start-studio-credit span {
  color: var(--amber);
  font-weight: 800;
}

.start-tagline {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.55;
  max-width: 560px;
  margin: 0 auto 20px auto;
}

.start-feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.start-feature-pills span {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 5px 11px;
  border-radius: 6px;
}

.start-actions-primary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.btn-start-launch {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
  color: #fff;
  border: 1px solid #38bdf8;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 14px 28px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.22s ease;
}

.btn-start-launch:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.55);
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 60%, #0284c7 100%);
}

.btn-start-coop {
  background: linear-gradient(135deg, #059669 0%, #0d9488 55%, #0f766e 100%);
  color: #fff;
  border: 1px solid #34d399;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.1px;
  padding: 14px 26px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: all 0.22s ease;
}

.btn-start-coop:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 36px rgba(52, 211, 153, 0.52);
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 60%, #0d9488 100%);
}

.start-actions-secondary {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.start-footer-status {
  font-family: Consolas, "Courier New", monospace;
  font-size: 10.5px;
  letter-spacing: 1px;
  color: rgba(148, 163, 184, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

/* -------------------------------------------------------------
   Cinematic Planetary Landing Cutscene Overlay
------------------------------------------------------------- */
.landing-cinematic-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 950;
  background: #02040a;
  flex-direction: column;
  justify-content: space-between;
}

.landing-cinematic-overlay.active {
  display: flex;
  animation: fadeIn 0.45s ease-out;
}

.landing-cinematic-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.landing-letterbox-top,
.landing-letterbox-bottom {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(2, 4, 12, 0.94) 0%, rgba(2, 4, 12, 0.78) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  backdrop-filter: blur(8px);
}

.landing-letterbox-bottom {
  background: linear-gradient(0deg, rgba(2, 4, 12, 0.96) 0%, rgba(2, 4, 12, 0.82) 100%);
  border-bottom: none;
  border-top: 1px solid rgba(56, 189, 248, 0.28);
  padding: 12px 22px;
  flex-wrap: wrap;
}

.landing-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan);
}

.landing-rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

.landing-top-center {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #f8fafc;
}

.landing-telemetry-strip {
  display: flex;
  flex: 1;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.landing-telem-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}

.landing-telem-k {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-muted);
}

.landing-telem-v {
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}

.landing-debrief-btn {
  opacity: 0.72;
  transition: all 0.25s ease;
}

.landing-debrief-btn.ready {
  opacity: 1;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  border-color: #4ade80;
  color: #020617;
  box-shadow: 0 0 26px rgba(34, 197, 94, 0.55);
}

/* -------------------------------------------------------------
   Off-screen Background Soundtrack Host (Zero Pop-out UI)
------------------------------------------------------------- */
.yt-bg-audio-host {
  position: fixed;
  left: -12000px;
  top: -12000px;
  width: 240px;
  height: 135px;
  opacity: 0.001;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

/* -------------------------------------------------------------
   4-Player Co-Op Mission Control Lobby & Live Coordination UI
------------------------------------------------------------- */
.mp-header-pill {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.mp-header-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.mp-lobby-modal {
  max-width: 720px;
}

.mp-callsign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mp-callsign-row .team-name-input {
  max-width: 220px;
}

.mp-lobby-status {
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #bae6fd;
  margin-bottom: 12px;
}

.mp-lobby-status.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.mp-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mp-entry-card {
  background: rgba(10, 18, 36, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mp-code-input {
  text-transform: uppercase;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}

.mp-room-code-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(6, 14, 30, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 8px;
  padding: 10px 14px;
}

.mp-code-value {
  font-family: Consolas, "Courier New", monospace;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #4ade80;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.35);
}

.mp-stations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.mp-station-card {
  background: rgba(12, 22, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: left;
}

.mp-station-card:hover:not(.taken) {
  border-color: var(--cyan);
  background: rgba(14, 34, 64, 0.92);
}

.mp-station-card.mine {
  border-color: #4ade80;
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.25);
}

.mp-station-card.taken {
  opacity: 0.85;
  cursor: default;
  border-color: rgba(56, 189, 248, 0.4);
}

.mp-station-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 3px;
}

.mp-station-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.mp-station-card.mine .mp-station-badge {
  background: rgba(34, 197, 94, 0.24);
  color: #86efac;
}

.mp-station-owns {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.mp-lobby-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.mp-ping-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.mp-ping-btn {
  background: rgba(15, 28, 52, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
}

.mp-ping-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.16);
}

.incident-coop-votes {
  font-size: 12px;
  background: rgba(10, 22, 44, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.38);
  color: #a7f3d0;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* -------------------------------------------------------------
   Mobile & Tablet Responsive Layouts (Desktop > 960px Unchanged)
------------------------------------------------------------- */
@media (max-width: 960px) {
  html, body {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Header & Stepper */
  .game-header {
    padding: 8px 10px;
    gap: 6px;
  }

  .brand {
    width: 100%;
  }

  .phase-stepper {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .phase-stepper::-webkit-scrollbar {
    display: none;
  }

  .step-item {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .header-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
  }

  /* Main Viewport & Screen Containers: Unlock vertical page scrolling */
  .app-viewport {
    padding: 8px 10px 14px 10px;
    overflow: visible;
    height: auto;
    flex: 1 0 auto;
  }

  .screen-view,
  .screen-view.active {
    height: auto;
    overflow: visible;
  }

  #screen-mission-select,
  #screen-debrief {
    overflow-y: visible;
    padding-right: 0;
  }

  .hud-header {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  /* Start Overlay & Hero Card */
  .start-screen-overlay {
    overflow-y: auto;
    align-items: flex-start;
    padding: 14px 12px;
  }

  .start-hero-card {
    margin: auto 0;
    padding: 22px 18px 18px 18px;
  }

  /* Phase 1: Charter Cards & Setup */
  .mission-grid {
    grid-template-columns: 1fr;
    flex: none;
    overflow: visible;
  }

  .mission-setup-grid,
  .orbit-pills-grid {
    grid-template-columns: 1fr;
  }

  /* Phase 2: Builder Columns Stacked Cleanly */
  .builder-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .catalog-panel {
    height: auto;
    overflow: visible;
  }

  .catalog-scroll {
    max-height: 310px;
    overflow-y: auto;
  }

  .center-col {
    height: auto;
    overflow: visible;
  }

  .schematic-box {
    flex: none;
    min-height: 195px;
    max-height: 230px;
  }

  .schematic-canvas {
    height: 185px;
    min-height: 185px;
  }

  .installed-panel {
    flex: none;
    height: auto;
    overflow: visible;
  }

  .installed-scroll {
    max-height: 240px;
    overflow-y: auto;
  }

  .diagnostics-panel {
    height: auto;
    overflow: visible;
  }

  /* Phase 3: Launch Pad & Countdown */
  .launch-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .launch-viewport-box {
    order: -1;
    height: auto;
  }

  .launch-canvas-wrapper {
    flex: none;
    height: 250px;
    min-height: 240px;
  }

  .rocket-selector-box {
    height: auto;
    overflow: visible;
  }

  /* Phase 4: Simulation & Telemetry */
  .sim-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sim-flight-deck {
    height: auto;
  }

  .sim-canvas-box {
    flex: none;
    height: 255px;
    min-height: 240px;
  }

  .sim-telemetry-col {
    height: auto;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .sim-telemetry-col > .hud-header,
  .sim-telemetry-col > .sim-controls-row,
  .sim-telemetry-col > #btn-goto-debrief {
    grid-column: 1 / -1;
  }

  /* Phase 5: Debrief */
  .debrief-grid {
    grid-template-columns: 1fr;
  }

  /* Modals & Co-Op Lobby */
  .incident-modal-backdrop {
    padding: 10px;
    overflow-y: auto;
    align-items: flex-start;
  }

  .incident-modal,
  .cml-modal,
  .mp-lobby-modal {
    width: 100%;
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    margin: auto 0;
  }

  .mp-entry-grid,
  .mp-stations-grid {
    grid-template-columns: 1fr;
  }

  /* Landing Cutscene Letterboxes */
  .landing-letterbox-top {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
  }

  .landing-letterbox-bottom {
    padding: 10px 12px;
    gap: 8px;
  }

  .landing-telemetry-strip {
    gap: 10px 14px;
  }

  .landing-telem-cell {
    min-width: 85px;
  }
}

@media (max-width: 600px) {
  .brand-sub {
    display: none;
  }

  .brand-title {
    font-size: 13.5px;
  }

  .header-controls .btn-icon,
  .header-controls .btn-cml-pill,
  .header-controls .mp-header-pill {
    font-size: 10px;
    padding: 4px 7px;
  }

  .step-item {
    font-size: 10px;
    padding: 4px 7px;
  }

  .start-top-badge {
    font-size: 9.5px;
    letter-spacing: 0.7px;
    padding: 4px 10px;
    margin-bottom: 10px;
  }

  .start-studio-credit {
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 12px;
  }

  .start-tagline {
    font-size: 12.5px;
    margin-bottom: 14px;
  }

  .start-feature-pills {
    gap: 6px;
    margin-bottom: 16px;
  }

  .start-feature-pills span {
    font-size: 10px;
    padding: 4px 8px;
  }

  .start-actions-primary {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .btn-start-launch,
  .btn-start-coop {
    width: 100%;
    padding: 12px 16px;
    font-size: 13.5px;
  }

  .start-actions-secondary {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .start-actions-secondary .btn-secondary {
    flex: 1;
    min-width: 130px;
    font-size: 11.5px;
    padding: 8px 10px;
  }

  .team-roster-grid,
  .incident-choices {
    grid-template-columns: 1fr;
  }

  .incident-modal {
    padding: 14px;
    gap: 9px;
  }

  .incident-canvas-wrapper {
    height: 130px;
  }

  .incident-desc {
    font-size: 13px;
  }

  .btn-choice {
    padding: 10px 12px;
    font-size: 12px;
  }

  #btn-proceed-to-builder {
    width: 100%;
  }

  .launch-canvas-wrapper {
    height: 220px;
    min-height: 220px;
  }

  .sim-canvas-box {
    height: 225px;
    min-height: 220px;
  }

  .telemetry-item {
    padding: 7px 9px;
  }

  .telemetry-title {
    font-size: 10px;
  }

  .telemetry-value {
    font-size: 13.5px;
  }

  .dialogue-bar {
    padding: 7px 10px;
    gap: 8px;
  }

  .char-portrait {
    width: 40px;
    height: 40px;
  }

  .dialogue-speaker {
    font-size: 10.5px;
  }

  .dialogue-text {
    font-size: 12px;
    line-height: 1.35;
  }

  .mp-callsign-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .mp-callsign-row .team-name-input {
    max-width: 100%;
  }

  .mp-code-value {
    font-size: 20px;
  }

  .landing-top-left,
  .landing-top-center {
    font-size: 11px;
    letter-spacing: 0.6px;
  }

  .landing-telem-cell {
    min-width: 72px;
  }

  .landing-telem-v {
    font-size: 12px;
  }

  .landing-letterbox-bottom .btn-primary,
  .landing-letterbox-top .btn-secondary {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* -------------------------------------------------------------
   Post-Landing Press Desk Overlay (Fade-In Newspapers on Table)
------------------------------------------------------------- */
.newspaper-press-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 955;
  flex-direction: column;
  background: #0a0705;
  animation: fadeIn 0.45s ease-out;
}

.newspaper-press-overlay.active {
  display: flex;
}

.press-desk-topbar {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.96) 0%, rgba(12, 16, 28, 0.88) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.press-desk-badge {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbbf24;
}

.press-desk-sub {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #e2e8f0;
  text-align: center;
}

.press-proceed-btn {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: #34d399;
  color: #022c22;
  font-weight: 800;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.42);
}

.press-proceed-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  color: #022c22;
}

.press-desk-table {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 30px 20px;
  /* Rich walnut mission briefing desk under warm overhead lamp */
  background:
    radial-gradient(circle at 50% 42%, rgba(251, 191, 36, 0.16) 0%, rgba(120, 72, 34, 0.14) 38%, rgba(8, 6, 5, 0.88) 84%),
    repeating-linear-gradient(
      92deg,
      rgba(68, 41, 22, 0.55) 0px,
      rgba(49, 29, 15, 0.65) 14px,
      rgba(76, 46, 25, 0.5) 29px,
      rgba(41, 24, 12, 0.7) 44px
    ),
    linear-gradient(180deg, #2b1a0e 0%, #1b1008 60%, #110a05 100%);
}

.press-papers-stage {
  position: relative;
  width: min(1040px, 94vw);
  min-height: 495px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes paperDropFade {
  0% {
    opacity: 0;
    transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 24px)) rotate(calc(var(--rot, 0deg) + 4deg)) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(var(--rot, 0deg)) scale(1);
  }
}

.newspaper-sheet {
  position: absolute;
  background: linear-gradient(160deg, #f5efe0 0%, #eae0c8 58%, #ded2b6 100%);
  color: #171717;
  border: 1px solid #b5a788;
  border-radius: 3px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.72), 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 0 28px rgba(139, 114, 72, 0.14);
  padding: 16px 18px 14px 18px;
  font-family: Georgia, "Times New Roman", serif;
  opacity: 0;
  animation: paperDropFade 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0.2s);
}

.newspaper-sheet.paper-left {
  width: 340px;
  --tx: -290px;
  --ty: 18px;
  --rot: -6.5deg;
  --delay: 0.25s;
  z-index: 2;
}

.newspaper-sheet.paper-right {
  width: 340px;
  --tx: 292px;
  --ty: 22px;
  --rot: 5.5deg;
  --delay: 1.0s;
  z-index: 3;
}

.newspaper-sheet.paper-lead {
  width: 470px;
  --tx: 0px;
  --ty: -4px;
  --rot: -1.1deg;
  --delay: 1.75s;
  z-index: 5;
  border: 1.5px solid #968768;
  padding: 18px 22px 16px 22px;
}

.np-masthead {
  text-align: center;
  border-bottom: 3px double #1c1917;
  padding-bottom: 5px;
  margin-bottom: 6px;
}

.np-paper-name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #111827;
  line-height: 1.05;
}

.paper-lead .np-paper-name {
  font-size: 23px;
}

.np-dateline {
  display: flex;
  justify-content: space-between;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 700;
  color: #44403c;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #44403c;
  padding: 3px 0 4px 0;
  margin-bottom: 8px;
}

.np-kicker {
  display: inline-block;
  background: #991b1b;
  color: #fef2f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  padding: 2px 7px;
  margin-bottom: 6px;
}

.np-headline {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.14;
  color: #0c0a09;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.paper-lead .np-headline {
  font-size: 22px;
}

.np-photo-frame {
  background: #0b1220;
  border: 2px solid #292524;
  padding: 4px;
  margin-bottom: 8px;
}

.np-photo-svg {
  display: block;
  width: 100%;
  height: auto;
}

.np-photo-caption {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9.5px;
  color: #d6d3d1;
  background: #1c1917;
  padding: 4px 6px;
  margin-top: 3px;
  font-style: italic;
}

.np-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 11px;
  line-height: 1.42;
  color: #292524;
  text-align: justify;
  border-top: 1px solid #78716c;
  padding-top: 7px;
}

.np-single-col {
  font-size: 11px;
  line-height: 1.44;
  color: #292524;
  text-align: justify;
  border-top: 1px solid #78716c;
  padding-top: 7px;
}

.np-stats-strip {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px;
  padding-top: 6px;
  border-top: 2px solid #1c1917;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9.5px;
  font-weight: 800;
  color: #1c1917;
}

@media (max-width: 960px) {
  .press-desk-topbar {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
  }

  .press-desk-sub {
    width: 100%;
    text-align: left;
    font-size: 11px;
  }

  .press-proceed-btn {
    width: 100%;
    font-size: 12.5px;
    padding: 9px 14px;
  }

  .press-desk-table {
    align-items: flex-start;
    padding: 14px 12px 24px 12px;
  }

  .press-papers-stage {
    width: 100%;
    min-height: auto;
    flex-direction: column;
    gap: 14px;
  }

  .newspaper-sheet {
    position: relative;
    width: 100% !important;
    max-width: 460px;
    --tx: 0px !important;
    --ty: 0px !important;
  }

  .newspaper-sheet.paper-lead {
    order: -1;
    --rot: -0.6deg;
    --delay: 0.2s;
    padding: 15px 16px;
  }

  .newspaper-sheet.paper-left {
    order: 1;
    --rot: 0.8deg;
    --delay: 0.75s;
  }

  .newspaper-sheet.paper-right {
    order: 2;
    --rot: -0.7deg;
    --delay: 1.25s;
  }

  .paper-lead .np-headline {
    font-size: 18px;
  }

  .np-columns {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .np-stats-strip {
    flex-wrap: wrap;
    font-size: 9px;
  }
}
