:root {
  --blue: #009dff;
  --red: #ff4444;
  --gold: #f0c040;
  --green: #00ff88;
  --purple: #cc44ff;
  --orange: #ff6b35;
  --bg: #0a0a1a;
  --panel-bg: rgba(13, 13, 43, 0.95);
  --panel-border: #009dff;
  --text: #ffffff;
  --text-dim: #aaaaaa;
  --font-body: "Press Start 2P", monospace;
  --font-header: "Silkscreen", monospace;

  /* Station theme */
  --station-bg: #f5f0e1;
  --station-shell: #2a1a2e;
  --station-panel: #3d1f42;
  --station-panel-light: #5a3060;
  --station-border: #8b5e8b;
  --station-accent: #d4a843;
  --station-accent-hover: #e8c05a;
  --station-text: #f5f0e1;
  --station-text-dim: #b8a898;
  --station-success: #50c878;
  --station-danger: #c0392b;
  --station-info: #3498db;
  --station-card-bg: #2d1835;
  --station-card-border: #6b3f6b;
  --station-btn-bg: #d4a843;
  --station-btn-text: #1a0a1e;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
  image-rendering: pixelated;
}

#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== CRT Overlay ===== */
#crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

#crt-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

#crt-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* ===== Station Wrapper ===== */
#station-wrapper {
  position: absolute;
  inset: 0;
  background: var(--station-shell);
  z-index: 50;
  display: flex;
  overflow: hidden;
}

#station-wrapper.hidden {
  display: none;
}

/* ===== Station Layout ===== */
.station-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--station-shell) 0%, #1a0e20 100%);
}

/* Nav Bar */
.station-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--station-panel);
  border-bottom: 4px solid var(--station-border);
  flex-shrink: 0;
}

.station-status {
  padding: 10px 24px;
  font-size: 12px;
  line-height: 1.4;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.station-status.info {
  background: rgba(52, 152, 219, 0.18);
  color: #9fd5ff;
}

.station-status.success {
  background: rgba(80, 200, 120, 0.16);
  color: #a7f0bf;
}

.station-status.warning {
  background: rgba(212, 168, 67, 0.16);
  color: #f3d485;
}

.nav-btn {
  font-family: var(--font-header);
  font-size: 16px;
  padding: 10px 20px;
  background: transparent;
  color: var(--station-text-dim);
  border: 2px solid transparent;
  cursor: pointer;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

.nav-btn:hover {
  color: var(--station-accent);
}

.nav-btn.active {
  color: var(--station-accent);
  border-bottom: 3px solid var(--station-accent);
}

.nav-day {
  margin-left: auto;
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-accent);
  padding: 0 20px;
  letter-spacing: 2px;
}

.nav-meta {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 20px;
}

.nav-meta-label {
  font-size: 11px;
  color: var(--station-text-dim);
  letter-spacing: 2px;
}

.nav-meta-value {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-accent);
}

.settings-btn {
  margin-left: 12px;
}

/* Station Body */
.station-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.station-center {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.station-center.skills-view {
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.station-right {
  width: 340px;
  background: var(--station-panel);
  border-left: 4px solid var(--station-border);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  overflow-y: auto;
  flex-shrink: 0;
}

.station-bottom {
  flex-shrink: 0;
  background: var(--station-panel);
  border-top: 4px solid var(--station-border);
  padding: 14px 24px;
}

/* ===== Stats Panel ===== */
.stats-section {
  margin-bottom: 16px;
}

.stats-title {
  font-family: var(--font-header);
  font-size: 14px;
  color: var(--station-accent);
  border-bottom: 3px solid var(--station-card-border);
  padding-bottom: 6px;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
}

.stat-key {
  color: var(--station-text-dim);
}

.stat-val {
  color: var(--station-text);
  font-weight: bold;
}

.bank-section .bank-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.bank-name {
  color: var(--station-text-dim);
}

.bank-val {
  color: var(--station-accent);
  font-weight: bold;
}

.bank-empty {
  color: var(--station-text-dim);
  font-size: 12px;
  font-style: italic;
}

/* ===== Launch Section ===== */
.launch-section {
  margin-top: auto;
  padding: 16px;
  background: var(--station-card-bg);
  border: 3px solid var(--station-card-border);
  border-radius: 6px;
  text-align: center;
}

.launch-sector {
  font-family: var(--font-header);
  font-size: 14px;
  color: var(--station-accent);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.launch-btn {
  font-family: var(--font-header);
  font-size: 24px;
  padding: 18px 56px;
  background: var(--station-success);
  color: #0a0a0a;
  border: 4px solid #000;
  cursor: pointer;
  box-shadow: 5px 5px 0 #000;
  transition: transform 100ms ease-out, box-shadow 100ms ease-out;
  width: 100%;
}

.launch-btn:hover {
  background: #60d890;
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #000;
}

.launch-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 #000;
}

.launch-time {
  font-size: 13px;
  color: var(--station-text-dim);
  margin-top: 8px;
}

.launch-meta {
  font-size: 12px;
  color: var(--station-text-dim);
  margin-bottom: 12px;
}

/* ===== Shop Panel ===== */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.shop-title {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-accent);
  letter-spacing: 2px;
}

.shop-reroll-btn {
  font-family: var(--font-header);
  font-size: 13px;
  padding: 8px 18px;
  background: var(--station-panel-light);
  color: var(--station-accent);
  border: 2px solid var(--station-accent);
  cursor: pointer;
  transition: background 150ms ease-out;
}

.shop-reroll-btn:hover:not(.disabled) {
  background: var(--station-accent);
  color: var(--station-btn-text);
}

.shop-reroll-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-offers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.offer-card {
  background: var(--station-card-bg);
  border: 3px solid var(--station-card-border);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: border-color 150ms ease-out;
}

.offer-card:hover:not(.purchased) {
  border-color: var(--station-accent);
}

.offer-card.purchased {
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.offer-sold {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-text-dim);
  letter-spacing: 4px;
}

.offer-card-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.offer-tier {
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.offer-name {
  font-family: var(--font-header);
  font-size: 15px;
  color: var(--station-text);
  margin-bottom: 8px;
}

.offer-desc {
  font-size: 12px;
  color: var(--station-text-dim);
  margin-bottom: 12px;
  flex: 1;
  line-height: 1.5;
}

.offer-category {
  font-size: 10px;
  color: var(--station-text-dim);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.offer-buy-btn {
  font-family: var(--font-header);
  font-size: 13px;
  padding: 10px 16px;
  background: var(--station-btn-bg);
  color: var(--station-btn-text);
  border: 3px solid #000;
  cursor: pointer;
  transition: background 100ms ease-out, transform 80ms ease-out;
  margin-top: auto;
}

.offer-buy-btn:hover:not(.disabled) {
  background: var(--station-accent-hover);
}

.offer-buy-btn:active:not(.disabled) {
  transform: scale(0.97);
}

.offer-buy-btn.disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

.shop-empty {
  color: var(--station-text-dim);
  font-size: 14px;
  text-align: center;
  padding: 48px;
}

/* ===== Sectors Panel ===== */
.sectors-header {
  margin-bottom: 16px;
}

.sectors-title {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-accent);
  letter-spacing: 2px;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.sector-card {
  background: var(--station-card-bg);
  border: 3px solid var(--station-card-border);
  border-radius: 6px;
  padding: 16px;
  transition: border-color 150ms ease-out;
}

.sector-card.locked {
  opacity: 0.6;
}

.sector-card.selected {
  border-color: var(--station-accent);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.3);
}

.sector-card.completed {
  border-color: var(--station-success);
}

.sector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sector-difficulty {
  color: var(--station-accent);
  font-size: 13px;
}

.sector-name {
  font-family: var(--font-header);
  font-size: 15px;
  color: var(--station-text);
}

.sector-desc {
  font-size: 12px;
  color: var(--station-text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

.sector-costs {
  margin-bottom: 10px;
  font-size: 13px;
}

.sector-cost {
  margin-right: 10px;
}

.sector-cost.free {
  color: var(--station-success);
}

.sector-badge {
  font-family: var(--font-header);
  font-size: 11px;
  padding: 3px 10px;
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.completed-badge {
  background: var(--station-success);
  color: #000;
}

.selected-badge {
  background: var(--station-accent);
  color: #000;
}

.locked-badge {
  background: #5a3040;
  color: #fff;
}

.sector-actions {
  display: flex;
  gap: 8px;
}

.sector-btn {
  font-family: var(--font-header);
  font-size: 13px;
  padding: 8px 16px;
  border: 3px solid #000;
  cursor: pointer;
  transition: transform 80ms ease-out;
}

.sector-btn:active {
  transform: scale(0.97);
}

.unlock-btn {
  background: var(--station-accent);
  color: #000;
}

.select-btn {
  background: var(--station-info);
  color: #fff;
}

/* ===== Skill Tree ===== */
.skill-tree-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.skill-tree-toolbar {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.skill-tree-zoom-controls {
  display: inline-flex;
  align-items: stretch;
  border: 3px solid var(--station-card-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--station-card-bg);
}

.skill-tree-zoom-btn,
.skill-tree-zoom-level {
  font-family: var(--font-header);
  color: var(--station-text);
  background: transparent;
  border: 0;
  min-width: 52px;
  padding: 0 16px;
  cursor: pointer;
  transition: background-color 140ms ease-out, color 140ms ease-out, transform 120ms ease-out;
}

.skill-tree-zoom-btn {
  font-size: 22px;
}

.skill-tree-zoom-level {
  font-size: 13px;
  letter-spacing: 1px;
  min-width: 82px;
  border-left: 2px solid rgba(236, 216, 183, 0.15);
  border-right: 2px solid rgba(236, 216, 183, 0.15);
}

.skill-tree-zoom-btn:hover,
.skill-tree-zoom-level:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--station-accent);
}

.skill-tree-zoom-btn:active,
.skill-tree-zoom-level:active {
  transform: scale(0.97);
}

.skill-tree-graph-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.skill-tree-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(72, 28, 48, 0.78) 0%, rgba(40, 14, 32, 0.95) 100%);
  border: 3px solid rgba(217, 197, 158, 0.3);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 238, 203, 0.06);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.skill-tree-viewport:active {
  cursor: grabbing;
}

.skill-tree-graph {
  position: relative;
  width: var(--graph-width);
  height: var(--graph-height);
  transform-origin: top left;
  transition: box-shadow 160ms ease-out;
  will-change: transform;
}

.skill-tree-graph.dragging {
  cursor: grabbing;
}

.skill-tree-graph.dragging .skill-graph-node {
  pointer-events: none;
}

.skill-tree-backdrop {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at center, rgba(244, 222, 182, 0.06) 0, rgba(244, 222, 182, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 40%);
  background-size: 10px 10px, 100% 100%;
  pointer-events: none;
}

.skill-tree-core-ring {
  position: absolute;
  left: 418px;
  top: 318px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 2px solid rgba(236, 215, 175, 0.12);
  box-shadow: 0 0 0 16px rgba(236, 215, 175, 0.05), 0 0 50px rgba(18, 8, 12, 0.35) inset;
  pointer-events: none;
}

.skill-graph-lines {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--graph-width);
  height: var(--graph-height);
  overflow: visible;
  pointer-events: none;
}

.skill-link {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skill-link.locked {
  stroke: rgba(214, 197, 167, 0.14);
}

.skill-link.reachable {
  stroke: rgba(230, 220, 181, 0.55);
}

.skill-link.purchased {
  stroke: rgba(96, 227, 148, 0.72);
}

.skill-graph-node-wrap {
  position: absolute;
}

.skill-graph-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 3px solid rgba(236, 216, 183, 0.7);
  background: rgba(65, 43, 46, 0.88);
  color: #f2e6ca;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1), border-color 180ms ease-out, background-color 180ms ease-out;
}

.skill-graph-node:active {
  transform: scale(0.97);
}

.skill-graph-node:disabled {
  opacity: 1;
}

.skill-graph-node-wrap:hover .skill-graph-node,
.skill-graph-node-wrap:focus-within .skill-graph-node {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.4);
}

.skill-graph-node.core {
  border-width: 4px;
  background: linear-gradient(180deg, #f0e1bc 0%, #d1b783 100%);
  color: #3b2130;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.45), 0 0 25px rgba(255, 240, 199, 0.18);
}

.skill-graph-node.available {
  background: rgba(225, 211, 179, 0.95);
  color: #4a2a37;
}

.skill-graph-node.purchased {
  background: linear-gradient(180deg, rgba(54, 143, 90, 0.96) 0%, rgba(36, 107, 66, 0.96) 100%);
  border-color: rgba(182, 255, 206, 0.9);
  color: #ecf7e9;
}

.skill-graph-node.locked {
  background: rgba(74, 45, 59, 0.82);
  border-style: dashed;
  color: rgba(242, 230, 202, 0.72);
}

.skill-graph-node.available:hover,
.skill-graph-node.available:focus-visible {
  border-color: rgba(255, 237, 197, 0.95);
}

.skill-graph-node.purchased:hover,
.skill-graph-node.purchased:focus-visible {
  border-color: rgba(214, 255, 225, 0.98);
}

.skill-graph-node.locked {
  cursor: default;
}

.skill-graph-glyph {
  font-family: var(--font-header);
  font-size: 14px;
  letter-spacing: 1px;
}

.skill-graph-node.core .skill-graph-glyph {
  font-size: 34px;
}

.skill-node-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  width: 260px;
  padding: 14px 15px;
  background: rgba(18, 10, 20, 0.94);
  border: 2px solid rgba(236, 216, 183, 0.36);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  transform: translate(-50%, 8px) scale(0.97);
  transform-origin: bottom center;
  opacity: 0;
  pointer-events: none;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), opacity 140ms ease-out;
  z-index: 5;
}

.skill-node-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 14px;
  height: 14px;
  background: rgba(18, 10, 20, 0.94);
  border-right: 2px solid rgba(236, 216, 183, 0.36);
  border-bottom: 2px solid rgba(236, 216, 183, 0.36);
  transform: translate(-50%, -7px) rotate(45deg);
}

.skill-graph-node-wrap:hover .skill-node-tooltip,
.skill-graph-node-wrap:focus-within .skill-node-tooltip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.skill-node-tooltip-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.skill-node-tooltip-branch {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--station-text-dim);
}

.skill-node-tooltip-title {
  margin-top: 5px;
  font-family: var(--font-header);
  font-size: 16px;
  color: var(--station-text);
  letter-spacing: 1px;
}

.skill-node-tooltip-cost {
  font-family: var(--font-header);
  font-size: 12px;
  color: var(--station-accent);
  text-align: right;
}

.skill-node-tooltip-status {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skill-node-tooltip-status.available {
  background: rgba(225, 211, 179, 0.18);
  color: #f0e1bc;
}

.skill-node-tooltip-status.purchased {
  background: rgba(36, 107, 66, 0.26);
  color: #8ef0b7;
}

.skill-node-tooltip-status.locked {
  background: rgba(120, 88, 94, 0.22);
  color: rgba(240, 225, 188, 0.75);
}

.skill-node-tooltip-desc,
.skill-node-tooltip-effect,
.skill-node-tooltip-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.skill-node-tooltip-effect {
  color: var(--station-accent);
}

.skill-node-tooltip-note {
  color: var(--station-text-dim);
}

.skill-tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--station-text-dim);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid rgba(236, 216, 183, 0.7);
}

.legend-swatch.available {
  background: rgba(225, 211, 179, 0.95);
}

.legend-swatch.purchased {
  background: rgba(36, 107, 66, 0.96);
  border-color: rgba(182, 255, 206, 0.9);
}

.legend-swatch.locked {
  background: rgba(74, 45, 59, 0.82);
  border-style: dashed;
}

.skill-tree-caption-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.skill-caption-chip {
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 2px solid rgba(236, 216, 183, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--station-text-dim);
  cursor: pointer;
  transition: border-color 160ms ease-out, color 160ms ease-out, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.skill-caption-chip:hover {
  border-color: rgba(236, 216, 183, 0.45);
  color: var(--station-text);
}

.skill-caption-chip:active {
  transform: scale(0.97);
}

.skill-caption-chip.selected {
  border-color: var(--station-accent);
  color: var(--station-accent);
}

@media (hover: hover) and (pointer: fine) {
  .skill-tree-zoom-btn:hover,
  .skill-tree-zoom-level:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--station-accent);
  }

  .skill-graph-node-wrap:hover .skill-graph-node,
  .skill-graph-node-wrap:focus-within .skill-graph-node {
    transform: translateY(-2px);
  }

  .skill-graph-node-wrap:hover .skill-node-tooltip,
  .skill-graph-node-wrap:focus-within .skill-node-tooltip {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 1200px) {
  .skill-tree-toolbar {
    justify-content: space-between;
  }
}

/* ===== Tasks Panel ===== */
.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tasks-title {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-accent);
  letter-spacing: 2px;
}

.tasks-count {
  font-size: 13px;
  color: var(--station-text-dim);
}

.tasks-refresh-btn {
  font-family: var(--font-header);
  font-size: 13px;
  padding: 8px 18px;
  background: var(--station-panel-light);
  color: var(--station-accent);
  border: 2px solid var(--station-accent);
  cursor: pointer;
}

.tasks-refresh-btn:hover {
  background: var(--station-accent);
  color: var(--station-btn-text);
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tasks-empty {
  color: var(--station-text-dim);
  font-size: 14px;
  text-align: center;
  padding: 48px;
}

.task-card {
  background: var(--station-card-bg);
  border: 3px solid var(--station-card-border);
  border-radius: 6px;
  padding: 16px;
}

.task-card.completed {
  border-color: var(--station-success);
}

.task-card.claimed {
  opacity: 0.6;
}

.task-name {
  font-family: var(--font-header);
  font-size: 14px;
  color: var(--station-text);
  margin-bottom: 6px;
}

.task-desc {
  font-size: 12px;
  color: var(--station-text-dim);
  margin-bottom: 10px;
  line-height: 1.5;
}

.task-progress-wrap {
  position: relative;
  height: 22px;
  background: #1a0a1e;
  border: 2px solid var(--station-card-border);
  margin-bottom: 10px;
}

.task-progress-bar {
  height: 100%;
  background: var(--station-accent);
  transition: width 300ms ease-out;
}

.task-card.completed .task-progress-bar {
  background: var(--station-success);
}

.task-progress-text {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--station-text);
  line-height: 22px;
  text-shadow: 1px 1px 0 #000;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-rewards {
  font-size: 13px;
}

.task-reward {
  margin-right: 10px;
}

.task-claim-btn {
  font-family: var(--font-header);
  font-size: 13px;
  padding: 6px 16px;
  background: var(--station-success);
  color: #000;
  border: 3px solid #000;
  cursor: pointer;
  animation: claimPulse 1.5s ease-in-out infinite;
}

.task-claim-btn:active {
  transform: scale(0.97);
}

@keyframes claimPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(80, 200, 120, 0); }
  50% { box-shadow: 0 0 10px rgba(80, 200, 120, 0.4); }
}

.task-claimed-label {
  font-family: var(--font-header);
  font-size: 12px;
  color: var(--station-text-dim);
}

/* ===== Loadout Tray ===== */
.loadout-tray {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.loadout-section {
  flex: 1;
}

.loadout-title {
  font-family: var(--font-header);
  font-size: 13px;
  color: var(--station-accent);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 8px;
}

.loadout-slots {
  display: flex;
  gap: 12px;
}

.loadout-slot {
  background: var(--station-card-bg);
  border: 3px solid var(--station-card-border);
  border-radius: 6px;
  padding: 12px;
  min-width: 160px;
  min-height: 64px;
}

.loadout-slot.filled {
  border-color: var(--station-border);
}

.loadout-slot.empty {
  border-style: dashed;
}

.slot-label {
  font-size: 10px;
  color: var(--station-text-dim);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.slot-weapon-name {
  font-family: var(--font-header);
  font-size: 13px;
  color: var(--station-text);
}

.slot-weapon-desc {
  font-size: 11px;
  color: var(--station-text-dim);
  margin-top: 3px;
}

.slot-empty-text {
  font-size: 12px;
  color: var(--station-text-dim);
  font-style: italic;
}

.armory {
  max-width: 380px;
}

.armory-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.armory-item {
  background: var(--station-card-bg);
  border: 2px solid var(--station-card-border);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  transition: border-color 100ms ease-out;
}

.armory-item:hover {
  border-color: var(--station-accent);
}

.armory-name {
  color: var(--station-text);
}

.armory-tier {
  font-size: 10px;
}

.armory-tier.common { color: #8a8a8a; }
.armory-tier.uncommon { color: #50c878; }
.armory-tier.rare { color: #009dff; }
.armory-tier.epic { color: #9b59b6; }
.armory-tier.legendary { color: #ff6b35; }

.armory-empty {
  font-size: 12px;
  color: var(--station-text-dim);
  font-style: italic;
}

/* ===== Game Canvas Area (during run) ===== */
#game-area {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

#game-area.active {
  display: flex;
}

#run-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--station-panel);
  border-bottom: 4px solid var(--station-border);
  font-size: 18px;
  z-index: 10;
  min-height: 56px;
  flex-shrink: 0;
}

#run-top-bar .stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

#run-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#expedition-timer {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--station-card-bg);
  border: 3px solid var(--station-accent);
  padding: 10px 28px;
  box-shadow: 4px 4px 0 #000;
}

.expedition-time-text {
  font-family: var(--font-header);
  font-size: 36px;
  color: var(--station-accent);
  text-shadow: 2px 2px 0 #000;
}

#boss-progress {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  z-index: 20;
}

#boss-progress-bar {
  height: 16px;
  background: #1a0a1e;
  border: 2px solid var(--station-card-border);
  position: relative;
}

#boss-progress-fill {
  height: 100%;
  background: var(--station-accent);
  width: 0%;
  transition: width 0.3s steps(10);
}

#boss-progress-text {
  font-size: 13px;
  color: var(--station-text-dim);
  text-align: center;
  display: block;
  margin-top: 4px;
}

#boss-bar {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--station-card-bg);
  border: 3px solid var(--station-danger);
  padding: 10px 20px;
  min-width: 380px;
  display: none;
}

#boss-hp-bar {
  height: 18px;
  background: #1a0a1e;
  border: 2px solid var(--station-card-border);
  position: relative;
  margin-top: 6px;
}

#boss-hp-fill {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--station-danger) 0px, var(--station-danger) 8px, #e07060 8px, #e07060 16px);
  width: 100%;
  transition: width 0.3s steps(10);
}

#boss-hp-text {
  font-size: 13px;
  color: var(--station-text);
  text-align: center;
  display: block;
  margin-top: 4px;
}

#combo-display {
  position: absolute;
  bottom: 50px;
  right: 20px;
  z-index: 20;
  text-align: right;
}

#ui-combo-count {
  font-family: var(--font-header);
  font-size: 30px;
  color: var(--station-accent);
}

#ui-combo-mult {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--station-text-dim);
}

#combo-bar-wrap {
  width: 130px;
  height: 8px;
  background: #1a0a1e;
  border: 2px solid var(--station-card-border);
  margin-top: 6px;
  margin-left: auto;
}

#ui-combo-bar {
  height: 100%;
  background: var(--station-accent);
  width: 0%;
  transition: width 0.2s;
}

.stat-label {
  color: var(--station-text-dim);
  font-size: 18px;
  font-family: var(--font-header);
}

.stat-value {
  font-weight: bold;
  font-size: 22px;
}

.stat-value.blue { color: var(--station-info); }
.stat-value.green { color: var(--station-success); }

.glow {
  text-shadow: 0 0 8px currentColor;
}

/* ===== XP Bar ===== */
#xp-bar-container {
  width: 200px;
  height: 20px;
  background: #1a0a1e;
  border-radius: 0;
  overflow: hidden;
  border: 2px solid var(--station-card-border);
  box-shadow: 3px 3px 0 #000;
}

#ui-xp-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--station-success) 0px,
    var(--station-success) 8px,
    #6edc9a 8px,
    #6edc9a 16px
  );
  width: 0%;
  transition: width 0.3s steps(10);
}

/* ===== HP Bar ===== */
#hp-bar-container {
  width: 160px;
  height: 20px;
  background: #1a0a1e;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--station-card-border);
  box-shadow: 3px 3px 0 #000;
}

#ui-hp-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--station-danger) 0px,
    var(--station-danger) 8px,
    #e07060 8px,
    #e07060 16px
  );
  width: 100%;
  transition: width 0.3s steps(10);
}

#ui-shield-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--station-info);
  opacity: 0.5;
  width: 0%;
  pointer-events: none;
  transition: width 0.2s;
}

#ui-hp-text {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: var(--station-text);
  text-shadow: 2px 2px 0 #000;
  z-index: 1;
}

.hp-critical {
  animation: hpFlash 0.5s ease-in-out infinite;
}

@keyframes hpFlash {
  0%, 100% { border-color: var(--station-card-border); }
  50% { border-color: var(--station-danger); }
}

/* ===== Run Summary Overlay ===== */
.overlay-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.overlay-panel.active {
  display: flex;
}

.overlay-panel .panel-content {
  background: var(--station-panel);
  border: 4px solid var(--station-accent);
  padding: 40px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.panel-title {
  font-family: var(--font-header);
  font-size: 22px;
  color: var(--station-accent);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 3px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--station-text);
  border-bottom: 1px solid var(--station-card-border);
}

.summary-row .summary-val {
  font-weight: bold;
}

.summary-row .summary-val.green { color: var(--station-success); }
.summary-row .summary-val.red { color: #ff6b6b; }
.summary-row .summary-val.gold { color: var(--gold); }
.summary-row .summary-val.blue { color: var(--blue); }

.summary-title {
  font-family: var(--font-header);
  font-size: 15px;
  color: var(--station-accent);
  margin-top: 16px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.continue-btn {
  font-family: var(--font-header);
  font-size: 18px;
  padding: 16px;
  background: var(--station-accent);
  color: var(--station-btn-text);
  border: 3px solid #000;
  cursor: pointer;
  width: 100%;
  margin-top: 24px;
  transition: transform 80ms ease-out;
}

.continue-btn:active {
  transform: scale(0.97);
}

/* ===== Settings Panel ===== */
#settings-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  justify-content: center;
  align-items: center;
}

#settings-panel .panel-content {
  background: var(--station-panel);
  border: 3px solid var(--station-border);
  padding: 32px;
  max-width: 480px;
  width: 90%;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--station-card-border);
}

.settings-label {
  font-size: 14px;
  color: var(--station-text);
}

.settings-btn {
  font-family: var(--font-header);
  font-size: 13px;
  padding: 8px 18px;
  background: transparent;
  color: var(--station-accent);
  border: 2px solid var(--station-accent);
  cursor: pointer;
  transition: background 100ms ease-out;
}

.settings-btn:hover {
  background: var(--station-accent);
  color: var(--station-btn-text);
}

.export-area {
  width: 100%;
  height: 100px;
  margin-top: 10px;
  background: #1a0a1e;
  color: var(--station-text);
  border: 2px solid var(--station-card-border);
  font-family: monospace;
  font-size: 12px;
  padding: 10px;
  resize: none;
}

/* ===== Pause Overlay ===== */
#pause-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 150;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
}

#pause-overlay.active {
  display: flex;
}

/* ===== Animations ===== */
@keyframes scanlineWipe {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

.scanline-wipe {
  animation: scanlineWipe 0.3s steps(6) forwards;
}

@keyframes crtFlicker {
  0% { opacity: 1; }
  50% { opacity: 0.97; }
  100% { opacity: 1; }
}

@keyframes slideInFromLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes idlePulseGlow {
  0%, 100% { box-shadow: 4px 4px 0 #000; }
  50% { box-shadow: 4px 4px 8px rgba(0, 255, 136, 0.3); }
}

@keyframes colorCycle {
  0% { background: var(--green); }
  25% { background: var(--blue); }
  50% { background: var(--gold); }
  75% { background: var(--green); }
}

@keyframes ambientScanline {
  from { top: 0; }
  to { top: 100%; }
}

@keyframes numberPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.number-pop {
  animation: numberPop 0.2s ease-out;
}

@keyframes resFlash {
  0% { color: var(--station-accent); }
  100% { color: var(--station-success); }
}

.res-flash {
  animation: resFlash 0.5s ease-out;
}

@keyframes pixelBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
