:root {
  --bg: #060b14;
  --bg-soft: #0d1626;
  --panel: rgba(10, 19, 33, 0.85);
  --panel-strong: rgba(13, 23, 40, 0.96);
  --overlay: rgba(8, 17, 30, 0.8);
  --line: rgba(124, 161, 199, 0.28);
  --text: #eef6ff;
  --muted: #9ab1c7;
  --accent: #7ee0d6;
  --accent-warm: #f8cf72;
  --danger: #f87d7d;
  --success: #7ff0a9;
  --cooldown: #f5b85d;
  --repair: #f3a468;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(40, 73, 120, 0.45), transparent 36%),
    radial-gradient(circle at bottom left, rgba(20, 135, 124, 0.2), transparent 28%),
    linear-gradient(180deg, #08111e 0%, #05080f 100%);
}

.shell {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: 1rem;
  color: var(--accent-warm);
}

.layout {
  display: grid;
  align-items: stretch;
  grid-template-areas: "left center right";
  grid-template-columns: minmax(250px, 320px) minmax(0, 1.55fr) minmax(270px, 340px);
  gap: 20px;
}

.launch-lobby {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.launch-lobby-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
  gap: 16px;
}

.launch-panel,
.launch-stack,
.room-list {
  display: grid;
  gap: 12px;
}

.launch-panel {
  align-content: start;
}

.center-stack {
  grid-area: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  height: 100%;
}

.canvas-panel,
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.canvas-panel {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  min-height: clamp(380px, 50vh, 660px);
  flex: 1 1 auto;
}

#battlefield {
  width: 100%;
  height: 100%;
  display: block;
}

.pause-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(248, 207, 114, 0.16);
  border: 1px solid rgba(248, 207, 114, 0.35);
  letter-spacing: 0.16em;
}

.hidden {
  display: none;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  max-width: 100%;
}

.pill {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(126, 224, 214, 0.12);
  color: var(--text);
  font-size: 0.85rem;
  max-width: min(100%, 28rem);
  overflow-wrap: anywhere;
  text-align: center;
}

.pill.subtle {
  background: rgba(154, 177, 199, 0.12);
}

.top-dropdown {
  position: relative;
}

.top-dropdown > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.top-dropdown > summary::-webkit-details-marker {
  display: none;
}

.dropdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dropdown-pill::after {
  content: "▾";
  font-size: 0.72rem;
  opacity: 0.8;
}

.top-dropdown[open] .dropdown-pill::after {
  content: "▴";
}

.dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}

.sidebar {
  display: grid;
  gap: 14px;
  min-width: 0;
  width: 100%;
  align-content: start;
}

.sidebar-left {
  grid-area: left;
}

.sidebar-right {
  grid-area: right;
}

.card {
  padding: 16px;
}

.connect-row,
.section-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

label,
.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

button {
  border: 1px solid rgba(126, 224, 214, 0.35);
  background: linear-gradient(180deg, rgba(126, 224, 214, 0.28), rgba(126, 224, 214, 0.16));
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: filter 180ms ease, opacity 180ms ease, box-shadow 220ms ease, border-color 180ms ease, background 180ms ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 0 0 1px rgba(126, 224, 214, 0.18), 0 12px 28px rgba(126, 224, 214, 0.16);
}

button:active:not(:disabled) {
  filter: brightness(0.98);
  box-shadow: 0 0 0 1px rgba(126, 224, 214, 0.1), 0 4px 12px rgba(126, 224, 214, 0.08);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  background: rgba(248, 207, 114, 0.1);
  border-color: rgba(248, 207, 114, 0.35);
}

.crew-list,
.server-panel,
.station-grid,
.combat-alerts,
.control-panel,
.combat-log,
.status-strip {
  display: grid;
  gap: 10px;
}

.crew-member,
.station-card,
.log-entry,
.control-button,
.server-entry,
.status-bar-card,
.launch-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.crew-member,
.station-card,
.server-entry,
.status-bar-card,
.launch-panel {
  padding: 12px;
}

.control-console-card {
  border-color: rgba(248, 207, 114, 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(248, 207, 114, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.38);
  background:
    linear-gradient(180deg, rgba(22, 31, 52, 0.96), rgba(11, 19, 34, 0.96)),
    var(--panel);
}

.control-panel {
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(248, 207, 114, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(248, 207, 114, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.03);
}

.control-button-grid {
  display: grid;
  gap: 10px;
}

.control-console-banner {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(124, 161, 199, 0.24);
  background: linear-gradient(180deg, rgba(18, 30, 50, 0.92), rgba(10, 18, 31, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.control-console-banner strong {
  font-size: 0.98rem;
  color: var(--accent-warm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.control-console-banner span {
  color: var(--text);
  font-size: 0.86rem;
}

.control-console-banner.armed {
  border-color: rgba(248, 207, 114, 0.36);
  background:
    linear-gradient(180deg, rgba(43, 35, 13, 0.92), rgba(19, 19, 18, 0.92));
  box-shadow: inset 0 0 0 1px rgba(248, 207, 114, 0.12), 0 12px 24px rgba(248, 207, 114, 0.08);
}

.control-console-banner.prep {
  border-color: rgba(126, 224, 214, 0.3);
  background:
    linear-gradient(180deg, rgba(13, 36, 40, 0.92), rgba(10, 18, 31, 0.92));
}

.control-console-banner.blocked {
  border-color: rgba(248, 125, 125, 0.34);
  background:
    linear-gradient(180deg, rgba(54, 20, 26, 0.9), rgba(20, 15, 24, 0.92));
}

.station-card {
  display: grid;
  gap: 4px;
  align-content: start;
  transition: padding 140ms ease, background 140ms ease, border-color 140ms ease;
}

.station-list-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid rgba(124, 161, 199, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.station-release-button {
  width: auto;
}

.station-compact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.station-compact-card.active {
  border-color: rgba(126, 224, 214, 0.4);
}

.station-compact-card.mine {
  border-color: rgba(248, 207, 114, 0.5);
  box-shadow: inset 0 0 0 1px rgba(248, 207, 114, 0.14);
}

.station-compact-main,
.station-compact-top,
.station-compact-actions {
  display: flex;
  gap: 8px;
}

.station-compact-main {
  min-width: 0;
  flex-direction: column;
}

.station-compact-top {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.station-compact-main strong {
  margin: 0;
}

.station-compact-actions {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.station-claim-button {
  width: auto;
  min-width: 72px;
  margin: 0;
  padding: 6px 10px;
}

.station-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.crew-member strong,
.station-card strong,
.server-entry strong {
  display: block;
  margin-bottom: 4px;
}

.server-entry code {
  display: block;
  word-break: break-all;
  color: var(--accent);
}

.room-entry.active-room {
  border-color: rgba(248, 207, 114, 0.36);
  box-shadow: inset 0 0 0 1px rgba(248, 207, 114, 0.12);
}

.room-entry button {
  width: auto;
  justify-self: start;
}

.station-card.active {
  border-color: rgba(126, 224, 214, 0.55);
  box-shadow: inset 0 0 0 1px rgba(126, 224, 214, 0.18);
}

.station-card.mine {
  border-color: rgba(248, 207, 114, 0.55);
}

.station-card.collapsed {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.station-card.collapsed strong {
  margin-bottom: 0;
}

.station-card button {
  width: 100%;
  margin-top: 10px;
}

.station-tree-button {
  width: 78px;
  min-width: 78px;
  flex: 0 0 auto;
  justify-content: flex-start;
  margin-top: 0;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(248, 207, 114, 0.08);
  border-color: rgba(248, 207, 114, 0.26);
  white-space: nowrap;
  box-shadow: none;
}

.tree-points {
  font-size: 0.68rem;
  color: var(--accent-warm);
  font-variant-numeric: tabular-nums;
}

.tree-glyph {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex: 0 0 14px;
}

.tree-glyph svg {
  width: 100%;
  height: 100%;
}

.tree-glyph polygon,
.tree-glyph rect,
.tree-glyph circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.skill-tree-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(10px);
}

.skill-tree-overlay.hidden {
  display: none;
}

.skill-tree-modal {
  width: min(1100px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
}

.skill-tree-head {
  margin-bottom: 14px;
}

.skill-tree-content,
.skill-tree-layout,
.skill-tree-list,
.skill-tree-summary,
.sector-track,
.sector-branch,
.decision-flow,
.decision-mainline,
.decision-fork,
.decision-options {
  display: grid;
  gap: 12px;
}

.skill-tree-layout {
  grid-template-columns: minmax(300px, 1fr) minmax(0, 1.1fr);
  align-items: start;
}

.skill-tree-summary {
  grid-auto-flow: column;
  justify-content: start;
}

.sector-track,
.decision-flow {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.sector-node {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 17, 30, 0.76);
}

.sector-node.cleared {
  border-color: rgba(126, 224, 214, 0.28);
}

.sector-node.current {
  border-color: rgba(126, 224, 214, 0.42);
  box-shadow: inset 0 0 0 1px rgba(126, 224, 214, 0.14);
}

.sector-node.launch {
  border-color: rgba(124, 161, 199, 0.3);
}

.sector-node.selected {
  border-color: rgba(248, 207, 114, 0.48);
  box-shadow: inset 0 0 0 1px rgba(248, 207, 114, 0.14);
}

.sector-node.station {
  border-color: rgba(127, 240, 169, 0.4);
  box-shadow: inset 0 0 0 1px rgba(127, 240, 169, 0.12);
}

.sector-node.upcoming {
  border-color: rgba(124, 161, 199, 0.3);
}

.sector-node span {
  color: var(--muted);
  font-size: 0.82rem;
}

.sector-connector {
  height: 1px;
  margin: 2px 0;
  background: linear-gradient(90deg, rgba(126, 224, 214, 0.2), rgba(248, 207, 114, 0.3));
}

.sector-connector.vertical {
  width: 2px;
  height: 24px;
  justify-self: center;
  margin: 0;
  background: linear-gradient(180deg, rgba(126, 224, 214, 0.2), rgba(248, 207, 114, 0.3));
}

.decision-flow {
  gap: 14px;
}

.route-history-panel {
  display: grid;
  gap: 8px;
}

.route-history-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.route-history-item {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: max-content;
}

.route-history-item small {
  max-width: 88px;
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.2;
}

.route-history-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(124, 161, 199, 0.2);
  background: rgba(124, 161, 199, 0.1);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.route-history-chip.current {
  border-color: rgba(126, 224, 214, 0.34);
  background: rgba(126, 224, 214, 0.12);
}

.route-history-chip.cleared {
  border-color: rgba(124, 161, 199, 0.24);
}

.route-history-chip.launch {
  border-color: rgba(124, 161, 199, 0.26);
}

.route-history-chip.station {
  border-color: rgba(127, 240, 169, 0.32);
  background: rgba(127, 240, 169, 0.12);
  color: var(--success);
}

.route-history-link {
  color: var(--muted);
  font-size: 0.84rem;
}

.decision-mainline {
  justify-items: center;
}

.decision-mainline .sector-node,
.decision-fork .sector-node {
  width: min(100%, 360px);
}

.decision-fork {
  justify-items: center;
}

.decision-fork-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.decision-options {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: start;
}

.sector-option,
.route-choice-card {
  display: grid;
  gap: 8px;
}

.sector-option-line {
  width: 70%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(126, 224, 214, 0.16), rgba(248, 207, 114, 0.34), rgba(126, 224, 214, 0.16));
}

.sector-option .sector-node {
  gap: 8px;
}

.sector-option .skill-card-row {
  justify-content: space-between;
}

.sector-option .skill-card-row.compact {
  gap: 6px;
}

.route-choice-card {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(124, 161, 199, 0.22);
  background: rgba(8, 17, 30, 0.46);
}

.route-choice-card.selected {
  border-color: rgba(248, 207, 114, 0.4);
  box-shadow: inset 0 0 0 1px rgba(248, 207, 114, 0.12);
}

.route-choice-card.station {
  border-color: rgba(127, 240, 169, 0.28);
}

.route-choice-head,
.route-choice-meta,
.route-forecast-row,
.route-forecast-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.route-choice-body {
  display: grid;
  gap: 8px;
}

.route-choice-body .skill-card-row strong {
  margin: 0;
  font-size: 0.92rem;
}

.route-choice-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.route-choice-forecast {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(124, 161, 199, 0.14);
}

.route-choice-forecast-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.route-choice-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.route-forecast-bands {
  display: grid;
  gap: 6px;
}

.route-forecast-row {
  justify-content: flex-start;
}

.route-forecast-label {
  min-width: 24px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.route-forecast-chips {
  justify-content: flex-start;
  gap: 6px;
}

.route-forecast-chip,
.route-forecast-more {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  border: 1px solid rgba(124, 161, 199, 0.2);
  background: rgba(124, 161, 199, 0.1);
  color: var(--text);
}

.route-forecast-chip.survival {
  border-color: rgba(248, 207, 114, 0.28);
  background: rgba(248, 207, 114, 0.12);
  color: var(--accent-warm);
}

.route-forecast-chip.station {
  border-color: rgba(127, 240, 169, 0.28);
  background: rgba(127, 240, 169, 0.12);
  color: var(--success);
}

.route-choice-button {
  justify-self: start;
  min-width: 96px;
}

.sector-outlook {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(124, 161, 199, 0.14);
}

.sector-outlook-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sector-preview-grid {
  display: grid;
  gap: 8px;
}

.sector-preview-grid.depth-1 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.sector-preview-grid.depth-2,
.sector-preview-grid.depth-3 {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(124, 161, 199, 0.12);
}

.sector-preview-node {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(124, 161, 199, 0.18);
  background: rgba(255, 255, 255, 0.025);
}

.sector-preview-node.station {
  border-color: rgba(127, 240, 169, 0.28);
  background: rgba(127, 240, 169, 0.06);
}

.sector-preview-node strong {
  font-size: 0.74rem;
}

.sector-preview-node span {
  font-size: 0.78rem;
  color: var(--muted);
}

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

.skill-tree-board {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(126, 224, 214, 0.12), transparent 40%),
    rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.skill-tree-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.skill-tree-lines line,
.skill-tree-lines circle,
.skill-tree-lines polygon {
  fill: none;
  stroke: rgba(124, 161, 199, 0.36);
  stroke-width: 1.1;
}

.skill-tree-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 108px;
  height: 108px;
  border-radius: 999px;
  border: 1px solid rgba(126, 224, 214, 0.3);
  background: rgba(126, 224, 214, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
}

.skill-tree-core strong {
  display: block;
}

.skill-tree-core span {
  font-size: 0.78rem;
  color: var(--muted);
}

.skill-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 82px;
  min-height: 54px;
  margin: 0;
  padding: 8px 7px;
  border-radius: 16px;
  border-color: rgba(124, 161, 199, 0.28);
  background: rgba(13, 23, 40, 0.9);
  display: grid;
  place-items: center;
  text-align: center;
  transition:
    box-shadow 220ms ease,
    border-color 180ms ease,
    background 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.skill-node span {
  font-size: 0.72rem;
  line-height: 1.2;
}

.skill-node.available {
  border-color: rgba(248, 207, 114, 0.48);
  box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.16);
}

.station-tree-button:hover:not(:disabled),
.station-tree-button:focus-visible {
  border-color: rgba(248, 207, 114, 0.4);
  box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.22), 0 12px 28px rgba(248, 207, 114, 0.16);
  animation: hover-glow-warm 3.1s ease-in-out infinite;
}

.skill-node.available:hover:not(:disabled),
.skill-node.available:focus-visible,
.skill-card.available .skill-card-button:hover:not(:disabled),
.skill-card.available .skill-card-button:focus-visible {
  border-color: rgba(248, 207, 114, 0.58);
  box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.24), 0 14px 30px rgba(248, 207, 114, 0.18);
  animation: hover-glow-warm 2.9s ease-in-out infinite;
}

.control-button:hover:not(:disabled),
.control-button:focus-visible {
  transform: translateY(-1px);
  border-left-color: rgba(248, 207, 114, 0.94);
  box-shadow: 0 0 0 1px rgba(126, 224, 214, 0.16), 0 14px 30px rgba(126, 224, 214, 0.16);
  animation: hover-glow-cool 3.2s ease-in-out infinite;
}

.skill-node.unlocked {
  border-color: rgba(127, 240, 169, 0.42);
  background: rgba(127, 240, 169, 0.12);
}

.skill-node.locked {
  opacity: 0.86;
}

.skill-node:disabled {
  opacity: 1;
  cursor: default;
}

.skill-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.skill-card.available {
  border-color: rgba(248, 207, 114, 0.34);
}

.skill-card.unlocked {
  border-color: rgba(127, 240, 169, 0.34);
  background: rgba(127, 240, 169, 0.06);
}

.skill-card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.skill-card-button {
  width: auto;
  min-width: 112px;
}

.combat-log {
  max-height: min(42vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 224, 214, 0.72) rgba(8, 17, 30, 0.68);
}

.combat-log::-webkit-scrollbar {
  width: 12px;
}

.combat-log::-webkit-scrollbar-track {
  background: rgba(8, 17, 30, 0.72);
  border-radius: 999px;
}

.combat-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126, 224, 214, 0.9), rgba(135, 205, 248, 0.78));
  border: 2px solid rgba(8, 17, 30, 0.72);
  border-radius: 999px;
}

.combat-log::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(126, 224, 214, 1), rgba(135, 205, 248, 0.9));
}

.encounter-overlay {
  position: absolute;
  z-index: 3;
}

.encounter-top-left {
  top: 16px;
  left: 16px;
  width: min(250px, calc(100% - 32px));
}

.encounter-top-right {
  top: 16px;
  right: 16px;
}

.overlay-icon-button {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 17, 30, 0.82);
  border-color: rgba(126, 224, 214, 0.28);
  min-width: 68px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

.overlay-card {
  border: 1px solid rgba(124, 161, 199, 0.24);
  border-radius: 18px;
  background: rgba(8, 17, 30, 0.78);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  padding: 12px;
}

.overlay-status-card {
  width: min(348px, calc(100vw - 48px));
  padding: 10px;
}

.overlay-status-card h2 {
  margin-bottom: 10px;
}

.log-entry {
  padding: 10px 12px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.log-entry.fresh {
  border-color: rgba(248, 207, 114, 0.55);
  background: rgba(248, 207, 114, 0.08);
  animation: log-entry-flash 1s ease;
}

.combat-alerts {
  align-content: start;
}

.alert-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(248, 125, 125, 0.24);
  border-radius: 14px;
  background: rgba(248, 125, 125, 0.06);
}

.alert-card.owner {
  border-color: rgba(248, 207, 114, 0.48);
  background: rgba(248, 207, 114, 0.08);
}

.alert-card.assist {
  border-color: rgba(126, 224, 214, 0.42);
  background: rgba(126, 224, 214, 0.08);
}

.alert-card-row,
.alert-meta,
.control-chip-row,
.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.alert-card-row {
  justify-content: space-between;
}

.alert-timer,
.alert-pill,
.status-badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.alert-timer {
  border: 1px solid rgba(248, 125, 125, 0.3);
  background: rgba(248, 125, 125, 0.14);
}

.alert-pill,
.status-badge {
  border: 1px solid rgba(124, 161, 199, 0.22);
  background: rgba(124, 161, 199, 0.1);
}

.alert-pill.owner {
  border-color: rgba(248, 207, 114, 0.3);
  background: rgba(248, 207, 114, 0.12);
}

.alert-pill.assist,
.status-badge.accent {
  border-color: rgba(126, 224, 214, 0.3);
  background: rgba(126, 224, 214, 0.12);
}

.alert-pill.mitigated,
.status-badge.positive {
  border-color: rgba(127, 240, 169, 0.28);
  background: rgba(127, 240, 169, 0.12);
  color: var(--success);
}

.alert-pill.critical,
.status-badge.danger {
  border-color: rgba(248, 125, 125, 0.28);
  background: rgba(248, 125, 125, 0.12);
  color: #ffd6d6;
}

.status-badge.warning {
  border-color: rgba(248, 207, 114, 0.3);
  background: rgba(248, 207, 114, 0.12);
  color: var(--accent-warm);
}

.status-badge.neutral {
  color: var(--muted);
}

.control-button {
  display: grid;
  gap: 8px;
  padding: 16px;
  text-align: left;
  border-color: rgba(124, 161, 199, 0.28);
  border-left: 4px solid rgba(124, 161, 199, 0.4);
  background:
    linear-gradient(180deg, rgba(29, 46, 76, 0.46), rgba(15, 24, 40, 0.88)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, border-left-color 160ms ease;
}

.control-button.ready {
  border-color: rgba(126, 224, 214, 0.34);
  border-left-color: rgba(126, 224, 214, 0.86);
}

.control-button.urgent {
  border-color: rgba(248, 207, 114, 0.5);
  border-left-color: rgba(248, 207, 114, 0.92);
  box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.18);
}

.control-button.assist {
  border-color: rgba(126, 224, 214, 0.42);
  border-left-color: rgba(126, 224, 214, 0.92);
}

.control-button.pending {
  border-color: rgba(248, 207, 114, 0.52);
  border-left-color: rgba(248, 207, 114, 0.92);
  box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.2), 0 12px 28px rgba(248, 207, 114, 0.12);
}

.control-button.pending:disabled {
  opacity: 0.9;
  cursor: progress;
}

.control-button.locked {
  border-color: rgba(124, 161, 199, 0.22);
  border-left-color: rgba(124, 161, 199, 0.34);
}

.control-button-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.control-button strong {
  font-size: 1.04rem;
  letter-spacing: 0.01em;
}

.action-state-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(124, 161, 199, 0.2);
  background: rgba(124, 161, 199, 0.12);
}

.action-state-chip.ready {
  color: var(--success);
  border-color: rgba(127, 240, 169, 0.26);
  background: rgba(127, 240, 169, 0.1);
}

.action-state-chip.locked {
  color: var(--muted);
}

.action-state-chip.pending {
  color: var(--accent-warm);
  border-color: rgba(248, 207, 114, 0.34);
  background: rgba(248, 207, 114, 0.14);
}

.action-role-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(124, 161, 199, 0.2);
}

.action-role-chip.urgent {
  border-color: rgba(248, 207, 114, 0.34);
  background: rgba(248, 207, 114, 0.14);
  color: var(--accent-warm);
}

.action-role-chip.assist {
  border-color: rgba(126, 224, 214, 0.3);
  background: rgba(126, 224, 214, 0.14);
  color: var(--accent);
}

.control-button > span {
  display: block;
  color: #cfe0ef;
  font-size: 0.84rem;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.status-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-badges {
  grid-column: 1 / -1;
}

.compact-status-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.systems-card {
  width: 100%;
  justify-self: stretch;
  align-self: center;
}

.system-status-strip {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  align-content: start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 224, 214, 0.56) rgba(8, 17, 30, 0.36);
}

.status-list-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid rgba(124, 161, 199, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.status-compact-card {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.status-compact-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.status-compact-top strong {
  font-size: 0.71rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-bar-card {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.status-compact-card.pulse-danger,
.status-compact-card.pulse-positive,
.status-compact-card.pulse-warning,
.status-compact-card.pulse-accent,
.status-bar-card.pulse-danger,
.status-bar-card.pulse-positive,
.status-bar-card.pulse-warning,
.status-bar-card.pulse-accent {
  animation: status-pulse 0.7s ease;
}

.status-compact-card.pulse-danger,
.status-bar-card.pulse-danger {
  border-color: rgba(248, 125, 125, 0.5);
  background: rgba(248, 125, 125, 0.08);
}

.status-compact-card.pulse-positive,
.status-bar-card.pulse-positive {
  border-color: rgba(127, 240, 169, 0.46);
  background: rgba(127, 240, 169, 0.08);
}

.status-compact-card.pulse-warning,
.status-bar-card.pulse-warning {
  border-color: rgba(248, 207, 114, 0.52);
  background: rgba(248, 207, 114, 0.08);
}

.status-compact-card.pulse-accent,
.status-bar-card.pulse-accent {
  border-color: rgba(126, 224, 214, 0.52);
  background: rgba(126, 224, 214, 0.08);
}

.status-bar-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.status-bar-row strong {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-state {
  font-size: 0.62rem;
  color: var(--text);
}

.status-meter {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.status-meter.compact {
  height: 6px;
}

.status-bar-card .status-badge,
.status-compact-card .status-badge {
  padding: 3px 8px;
  font-size: 0.66rem;
}

.status-badges {
  gap: 6px;
}

.system-status-strip::-webkit-scrollbar {
  height: 8px;
}

.system-status-strip::-webkit-scrollbar-track {
  background: rgba(8, 17, 30, 0.42);
  border-radius: 999px;
}

.system-status-strip::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(126, 224, 214, 0.72), rgba(135, 205, 248, 0.62));
  border-radius: 999px;
}

.status-fill {
  height: 100%;
  border-radius: inherit;
}

.status-fill.hull {
  background: linear-gradient(90deg, rgba(248, 125, 125, 0.8), rgba(248, 125, 125, 1));
}

.status-fill.shield {
  background: linear-gradient(90deg, rgba(126, 224, 214, 0.8), rgba(126, 224, 214, 1));
}

.status-fill.fuel {
  background: linear-gradient(90deg, rgba(243, 164, 104, 0.84), rgba(248, 207, 114, 1));
}

.status-fill.weapons,
.status-fill.systems {
  background: linear-gradient(90deg, rgba(248, 207, 114, 0.8), rgba(245, 184, 93, 1));
}

.status-fill.repair {
  background: linear-gradient(90deg, rgba(243, 164, 104, 0.82), rgba(243, 164, 104, 1));
}

.status-fill.evade {
  background: linear-gradient(90deg, rgba(135, 205, 248, 0.82), rgba(135, 205, 248, 1));
}

.status-fill.surge {
  background: linear-gradient(90deg, rgba(127, 240, 169, 0.82), rgba(127, 240, 169, 1));
}

@keyframes status-pulse {
  0% {
    transform: scale(0.985);
  }
  45% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes log-entry-flash {
  0% {
    transform: translateX(8px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes hover-glow-cool {
  0% {
    box-shadow: 0 0 0 1px rgba(126, 224, 214, 0.1), 0 8px 18px rgba(126, 224, 214, 0.08);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(126, 224, 214, 0.28), 0 18px 38px rgba(126, 224, 214, 0.24);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(126, 224, 214, 0.1), 0 8px 18px rgba(126, 224, 214, 0.08);
  }
}

@keyframes hover-glow-warm {
  0% {
    box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.12), 0 8px 18px rgba(248, 207, 114, 0.08);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.34), 0 18px 38px rgba(248, 207, 114, 0.26);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(248, 207, 114, 0.12), 0 8px 18px rgba(248, 207, 114, 0.08);
  }
}

@media (max-width: 1260px) {
  .layout {
    grid-template-areas:
      "center"
      "left"
      "right";
    grid-template-columns: 1fr;
  }

  .launch-lobby-grid {
    grid-template-columns: 1fr;
  }

  .status-pills {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .status-strip,
  .compact-status-strip {
    grid-template-columns: 1fr;
  }

  .compact-status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .system-status-strip {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }

  .canvas-panel {
    min-height: clamp(340px, 54vh, 560px);
  }

  .skill-tree-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .connect-row,
  .section-head {
    flex-wrap: wrap;
  }

  .connect-row button,
  .section-head button {
    width: 100%;
  }

  .top-dropdown {
    width: 100%;
  }

  .top-dropdown > summary {
    width: 100%;
  }

  .dropdown-card {
    left: 0;
    right: auto;
    width: min(100%, 420px);
  }

  .canvas-panel,
  .card {
    border-radius: 16px;
  }

  .skill-tree-overlay {
    padding: 10px;
  }

  .skill-tree-board {
    min-height: 360px;
  }

  .skill-node {
    width: 72px;
    min-height: 48px;
    padding: 7px 6px;
  }

  .systems-card,
  .system-status-strip {
    width: 100%;
  }

  .system-status-strip {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }
}
