@import url('./theme.css');

/* ExoDeus — futuristic fleet-command dashboard.
   Vanilla CSS, dark holographic theme, fully responsive. */



/* The hidden attribute must win over class-level display rules
   (.authgate/.app set an explicit display that would otherwise override it). */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 10px 18px;
  border-bottom: 1px solid var(--panel-brd);
  background: linear-gradient(180deg, rgba(10, 12, 24, 0.9), rgba(10, 12, 24, 0.4));
  backdrop-filter: blur(8px);
}



.status { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 16px; letter-spacing: 1px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--panel-brd); background: rgba(53, 224, 255, 0.08); color: var(--ink);
  white-space: nowrap;
}
.chip--muted { background: rgba(133, 146, 184, 0.08); color: var(--ink-dim); }
.chip[data-domain="pve"] { color: var(--good); border-color: rgba(52, 245, 197, 0.4); }
.chip[data-domain="pvp"] { color: var(--danger); border-color: rgba(255, 92, 122, 0.4); }

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--gap);
  padding: var(--gap);
  min-height: 0;
}
.panel { min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.panel--main { min-width: 0; }

.main-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 0;
  border-bottom: 1px solid var(--panel-brd);
  scrollbar-width: thin;
  scrollbar-color: var(--panel-brd) transparent;
}
.main-tabs::-webkit-scrollbar { height: 4px; }
.main-tabs::-webkit-scrollbar-thumb { background: var(--panel-brd); border-radius: 4px; }

.tab--main {
  flex: 0 0 auto;
  font: inherit;
  font-size: 19px;
  padding: 10px 18px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}
.tab--main:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
  transform: none;
}
.tab--main.tab--on {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--panel-brd);
  border-bottom-color: var(--accent);
  box-shadow: inset 0 -2px 10px rgba(53, 224, 255, 0.1);
}

.main-content {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tab-pane > .card--full { flex: 1; min-height: 0; overflow: auto; }

.card--grow { flex: 1; min-height: 0; overflow: auto; }
.card__title {
  margin: 0 0 12px; font-size: 17px; letter-spacing: 2px;
  color: var(--ink-dim); display: flex; align-items: center; gap: 8px;
}
.tag {
  font-size: 15px; padding: 1px 8px; border-radius: 999px;
  background: rgba(53, 224, 255, 0.14); color: var(--accent);
}

/* ---------- Ship card ---------- */
.ship { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.ship__core {
  align-self: center; width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #eaf6ff, var(--accent) 45%, var(--accent-2));
  box-shadow: 0 0 30px rgba(53, 224, 255, 0.6), inset 0 0 12px rgba(255, 255, 255, 0.5);
  animation: pulse 3.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--ink-dim); font-size: 16px; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; cursor: pointer; border-radius: 10px; padding: 9px 12px;
  border: 1px solid var(--panel-brd); background: rgba(53, 224, 255, 0.12);
  color: var(--ink); transition: 0.15s ease; letter-spacing: 1px;
}
.btn:hover { background: rgba(53, 224, 255, 0.22); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; }
.btn--icon { padding: 6px 10px; font-size: 19px; }
.btn--primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #05060d; font-weight: 700; border: none; }
.btn--xs { padding: 3px 8px; font-size: 15px; border-radius: 8px; letter-spacing: 0.5px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- Set-course form ---------- */
.course { display: flex; flex-direction: column; gap: 8px; }
.course__label { font-size: 15px; letter-spacing: 1px; color: var(--ink-dim); }
.course__inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.course__inputs input {
  font: inherit; width: 100%; padding: 8px; border-radius: 8px; text-align: center;
  border: 1px solid var(--panel-brd); background: rgba(255, 255, 255, 0.03); color: var(--ink);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.course__inputs input::-webkit-outer-spin-button,
.course__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.course__inputs input:focus { outline: none; border-color: var(--accent); }
.course__actions { display: flex; align-items: center; gap: 6px; }
.course__actions .btn { flex: 0 0 auto; }

/* ---------- Colony list + inspector notes ---------- */
/* `.list li` (shared with other simple lists) lays its children out as a flex
   row — fine for a single name/value pair, but this `<li>` holds the toggle
   button AND (when expanded) the full management panel as a second child, so
   a row would stretch the button into an empty left column matching the
   panel's height. Force it back to a plain vertical stack instead. */
#colonyList > li { flex-direction: column; align-items: stretch; }
.colonyitem {
  font: inherit; cursor: pointer; width: 100%; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 8px 12px;
  background: transparent; border: none; color: var(--ink); padding: 0; letter-spacing: 0.5px;
}
.colonyitem:hover .colony__name { color: var(--accent); }
.colonyitem__coords {
  font-variant-numeric: tabular-nums; font-size: 13px; margin-right: auto;
}
.colonyitem__deposits { margin-top: 8px; }

/* ---------- Engagement: objectives, missions, streak ---------- */
.objlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.obj {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  column-gap: 8px; font-size: 17px;
}
.obj__name { color: var(--ink); letter-spacing: 0.3px; }
.obj__reward { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 15px; }
.obj__done { color: var(--good); font-weight: 700; }
.obj__meta { grid-column: 1 / -1; font-size: 15px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.obj .res__bar { grid-column: 1 / -1; margin-top: 4px; }
.obj--done .obj__name { color: var(--ink-dim); text-decoration: line-through; }

/* Badges — tiered collections (see js/app.js#renderBadges). */
.badgelist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.badge-tile { display: flex; align-items: center; column-gap: 8px; }
/* Icon scales with the row's text so it stays proportionate. */
.badge-icon { flex: 0 0 auto; width: 2.2em; height: 2.2em; }
.badge-label { font-size: 15px; color: var(--ink); }
.badge-rank { font-size: 13px; letter-spacing: 0.4px; }
.badge-tile .muted { margin-left: auto; }
/* Locked (not-yet-earned) badges read as a dimmed version of their bronze form. */
.badge-tile--locked { opacity: 0.55; }
.badge-tile--locked .badge-label { color: var(--ink-dim); }
.rank--none { color: var(--ink-dim); border-color: var(--line); }
.rank--bronze { color: #cd7f32; border-color: #cd7f32; }
.rank--silver { color: #c8ccd4; border-color: #c8ccd4; }
.rank--gold { color: #e8c14a; border-color: #e8c14a; }
.rank--platinum { color: #6fe3d2; border-color: #6fe3d2; }
.rank--diamond { color: #8fbcff; border-color: #8fbcff; text-shadow: 0 0 6px rgba(143,188,255,0.5); }

/* Inline SVG Graphics */
.res-inline { width: 44px; height: 44px; vertical-align: middle; margin-right: 4px; display: inline-block; }
.bldg-inline { width: 56px; height: 56px; vertical-align: middle; margin-right: 6px; display: inline-block; }
.tech-inline { width: 56px; height: 56px; vertical-align: middle; margin-right: 6px; display: inline-block; }

/* SVG Colors & Atoms */
.res-atom { overflow: visible; }
.res-atom__orbits { fill: none; stroke-width: 1.5; opacity: 0.3; }
.res-atom__core { fill: var(--bg); stroke-width: 1.5; }
.res-atom__text { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 1px; dominant-baseline: central; alignment-baseline: central; }
.res-atom__sub { font-size: 14px; }
.res-atom--t1 .res-atom__orbits, .res-atom--t1 .res-atom__core { stroke: var(--accent); }
.res-atom--t1 .res-atom__text { fill: var(--ink); }
.res-atom--t2 .res-atom__orbits, .res-atom--t2 .res-atom__core { stroke: var(--good); }
.res-atom--t2 .res-atom__text { fill: var(--good); }
.res-atom--t3 .res-atom__orbits, .res-atom--t3 .res-atom__core { stroke: var(--accent-2); }
.res-atom--t3 .res-atom__text { fill: #fff; }
.res-atom--t4 .res-atom__orbits, .res-atom--t4 .res-atom__core { stroke: var(--star); }
.res-atom--t4 .res-atom__text { fill: #fff; }

/* Badges SVG modifiers */
.badge-icon--none { --badge-color: var(--line); }
.badge-icon--bronze { --badge-color: #cd7f32; }
.badge-icon--silver { --badge-color: #c8ccd4; }
.badge-icon--gold { --badge-color: #e8c14a; }
.badge-icon--platinum { --badge-color: #6fe3d2; }
.badge-icon--diamond { --badge-color: #8fbcff; filter: drop-shadow(0 0 4px rgba(143,188,255,0.4)); }

.objquest {
  margin-top: 14px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 12px;
  background: linear-gradient(135deg, rgba(53, 224, 255, 0.1), rgba(124, 92, 255, 0.05));
  box-shadow: 0 0 15px rgba(53, 224, 255, 0.15), inset 0 0 20px rgba(53, 224, 255, 0.05);
  display: flex; flex-direction: column; gap: 6px;
}
.objquest__label { font-size: 15px; letter-spacing: 2px; color: var(--accent); font-weight: 700; }
.objquest strong { font-size: 21px; color: var(--ink); text-shadow: 0 0 4px var(--accent); }
.objquest .res__bar { margin-top: 4px; }

/* ---------- Meta-progression: subroutines, boosters, codex ---------- */
#metaMods { margin: 4px 0 0; }
.meta__boosters, .meta__codex { margin-top: 12px; }
.meta__boosters .objlist, .meta__codex p { margin-top: 6px; }
.meta__codex .tag { margin-left: 4px; }

/* Codex — an open encyclopedia: category accordions (reusing `.fold`) stacked. */
.codex { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.codex-cat > summary .tag { margin-left: auto; }
.codex-cat .obj__meta { margin-top: 2px; line-height: 1.4; }

/* ---------- Research: tech tree ---------- */
.tabs { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.tab {
  font: inherit; font-size: 15px; padding: 3px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--panel-brd); background: transparent; color: var(--ink-dim);
  letter-spacing: 0.5px;
}
.tab--on { background: rgba(53, 224, 255, 0.16); color: var(--ink); border-color: var(--accent); }
.techlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tech { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 8px; font-size: 17px; }
.tech__name { color: var(--ink); letter-spacing: 0.3px; }
.tech .obj__meta { grid-column: 1 / -1; }
.tech--done .tech__name { color: var(--ink-dim); }

/* ---------- Fleets ---------- */
.fleetlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fleet {
  padding: 8px 10px; border: 1px solid var(--panel-brd); border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 3px;
}
.fleet--building { opacity: 0.6; }
.fleet__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fleet__ships { letter-spacing: 1px; }
.fleet__order { font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.fleet__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.fleet__ship {
  font: inherit; background: transparent; border: none; color: var(--ink); cursor: default;
  padding: 0 1px; letter-spacing: 1px;
}
button.fleet__ship { cursor: pointer; border-radius: 6px; }
button.fleet__ship:hover { background: rgba(255, 90, 90, 0.25); }
.fleet__pick { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--ink-dim); cursor: pointer; }
.fleet__move { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 4px; margin-top: 6px; }
.fleet__move input {
  font: inherit; font-size: 16px; width: 100%; min-width: 0; padding: 4px; text-align: center; border-radius: 8px;
  border: 1px solid var(--panel-brd); background: rgba(255, 255, 255, 0.03); color: var(--ink);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.fleet__move input::-webkit-outer-spin-button, .fleet__move input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fleet__mergebar { display: flex; gap: 6px; margin-top: 8px; }
.fleet__mergebar input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--panel-brd); background: rgba(255, 255, 255, 0.03); color: var(--ink);
}

.note { font-size: 17px; margin: 0; }
.note--good { color: var(--good); }
.note--warn { color: var(--warn); }

/* ---------- Mothership hold ---------- */
.hold { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hold__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 17px; }
.hold__name { color: var(--ink); letter-spacing: 0.3px; }
.hold__val { font-variant-numeric: tabular-nums; color: var(--accent); }

/* ---------- Colony management (inspector) ---------- */
.colony { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.colony__meters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meter {
  padding: 8px; border: 1px solid var(--panel-brd); border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 4px;
}
.meter__label { font-size: 15px; color: var(--ink-dim); letter-spacing: 0.5px; }
.meter__val { font-variant-numeric: tabular-nums; font-weight: 700; }
.meter__val--bad { color: var(--danger); }

/* Colony name + inline rename pencil. */
.colony__name-wrap { display: inline-flex; align-items: center; gap: 6px; }
.colony__name { font-weight: 700; }
.rename-input {
  background: var(--bg-2); border: 1px solid var(--panel-brd); color: var(--ink);
  padding: 4px 8px; border-radius: 4px; max-width: 200px; font: inherit;
}
.icon-btn {
  background: none; border: none; padding: 2px; cursor: pointer; color: var(--ink-dim);
  display: inline-flex; align-items: center; line-height: 0;
}
.icon-btn:hover { color: var(--accent); }

/* Foldable sections (Build / Buildings) — native <details>, styled to match the panel. */
.fold {
  border: 1px solid var(--panel-brd); border-radius: 10px; padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}
.fold > summary {
  cursor: pointer; font-weight: 700; letter-spacing: 0.5px; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '▸'; font-size: 13px; color: var(--ink-dim); }
.fold[open] > summary::before { content: '▾'; }
.fold__body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.blds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bld {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px;
  padding: 7px 9px; border: 1px solid var(--panel-brd); border-radius: 9px;
  background: rgba(255, 255, 255, 0.03); font-size: 17px;
}
.bld__name { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bld__name b { color: var(--accent); }
.off { color: var(--warn); font-size: 15px; }
.rate { color: var(--good); font-size: 15px; font-variant-numeric: tabular-nums; }
/* Per-building power footprint, in smaller script directly under the name. */
.bld__power { font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }

/* ---------- Colony storage panels (drag-and-drop) ---------- */
.store__panels { display: grid; grid-template-columns: 1fr; gap: 8px; }
.store__panels--dual { grid-template-columns: 1fr 1fr; }
.store {
  border: 1px solid var(--panel-brd); border-radius: 10px; padding: 8px; min-height: 56px;
  background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.12s, background 0.12s;
}
.store--over { border-color: var(--accent); background: rgba(120, 170, 255, 0.10); }
.store__head {
  font-size: 14px; color: var(--ink-dim); letter-spacing: 0.5px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.store__items { display: flex; flex-direction: column; gap: 4px; }
.store__chip {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 5px 8px; border: 1px solid var(--panel-brd); border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); font-size: 16px; cursor: grab; user-select: none;
}
.store__chip:active { cursor: grabbing; }
.store__chip--dragging { opacity: 0.4; }
.store__chip-name { color: var(--ink); letter-spacing: 0.3px; min-width: 0; }
.store__chip-qty { font-variant-numeric: tabular-nums; color: var(--accent); }

/* Two-line "Upgrade / ¤price" button, with breathing room from the name beside it. */
.btn--upgrade {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  line-height: 1.2; margin-left: 10px; flex-shrink: 0;
}
.btn__price { font-size: 12px; font-weight: 400; opacity: 0.85; }

/* Building condition (degradation) chip. */
.bld__cond {
  margin-left: 6px; font-size: 14px; padding: 1px 5px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink-dim); font-variant-numeric: tabular-nums;
}
.bld__cond--warn { color: #e8c14a; border-color: #e8c14a; }
.bld__cond--bad { color: #ff5a6a; border-color: #ff5a6a; }
.colony__maint {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px;
}

.colony__build, .sell { display: flex; flex-wrap: wrap; gap: 6px; }
.sell { flex-direction: column; }
.sell__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sell__name { font-size: 17px; }

.btn--mini {
  padding: 5px 9px; font-size: 16px; letter-spacing: 0.5px; border-radius: 8px;
}
.btn--mini:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Destructive action (Decolonize) — muted until hovered so it never invites a
   misclick, then reads clearly as danger. */
.btn--danger {
  color: var(--danger); border-color: rgba(255, 92, 122, 0.45); background: transparent;
}
.btn--danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

/* The Decolonize row: separated from the colony body and right-aligned so it
   sits apart from the everyday build/manage controls above it. */
.colony__danger {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--panel-brd);
}

/* ---------- Confirmation modal (our styled replacement for confirm()) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 4, 10, 0.6); backdrop-filter: blur(3px);
  animation: fade-in 0.15s ease;
}
.modal {
  max-width: 440px; width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  animation: modal-rise 0.18s ease;
}
@keyframes modal-rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal__title { margin: 0; font-size: 18px; letter-spacing: 0.5px; }
.modal__body { margin: 0; color: var(--ink-dim); font-size: 17px; line-height: 1.5; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Compact select used for the factory composite picker. */
.select--mini {
  padding: 5px 9px; font-size: 16px; border-radius: 8px;
  background: var(--panel, #10151f); color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------- Map controls ---------- */
.mapctl {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--panel); border: 1px solid var(--panel-brd);
  border-radius: var(--radius); flex-wrap: wrap;
}
.mapctl__group { display: flex; align-items: center; gap: 8px; }
.mapctl__group--right { flex-wrap: wrap; }
.mapctl__label { font-size: 15px; letter-spacing: 1px; color: var(--ink-dim); }
.zval { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }

.legend { font-size: 15px; color: var(--ink-dim); display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--star { background: var(--star); box-shadow: 0 0 6px var(--star); }
.dot--planet { background: var(--planet); box-shadow: 0 0 6px var(--planet); }
.dot--station { background: var(--station); box-shadow: 0 0 6px var(--station); }
.dot--black { background: var(--black); box-shadow: 0 0 6px var(--black); }
.dot--white { background: var(--white); box-shadow: 0 0 6px var(--white); }
.dot--deus { background: #fff6d5; box-shadow: 0 0 8px #ffd76a; }
.dot--fleet { background: transparent; border: 2px solid #8bd450; box-shadow: 0 0 6px #8bd450; border-radius: 0; transform: rotate(45deg); width: 7px; height: 7px; margin: 1px; }

/* ---------- Map ---------- */
.mapwrap {
  position: relative; flex: 1; min-height: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--panel-brd); background: #04050b;
}
#starmap { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.mapwrap__hint {
  position: absolute; left: 12px; bottom: 10px; font-size: 15px; color: var(--ink-dim);
  background: rgba(5, 6, 13, 0.6); padding: 4px 8px; border-radius: 8px; pointer-events: none;
}

/* ---------- Lists / inspector ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  padding: 10px; border: 1px solid var(--panel-brd); border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); display: flex; justify-content: space-between; gap: 8px;
}

.inspector { display: flex; flex-direction: column; gap: 12px; }
.inspector__head { display: flex; align-items: center; gap: 10px; }
.inspector__icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 27px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--panel-brd);
}
.inspector h3 { margin: 0; font-size: 21px; }
.inspector .sub { color: var(--ink-dim); font-size: 16px; letter-spacing: 1px; }

.res { display: flex; flex-direction: column; gap: 6px; }
.res__row { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 8px; font-size: 17px; }
.res__bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.res__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--good)); }
.res__name { display: flex; align-items: center; gap: 6px; }
.res__val { text-align: right; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.grp { width: 8px; height: 8px; border-radius: 2px; }
.grp--element { background: #6ee7ff; }
.grp--metal { background: #ffb86b; }
.grp--gas { background: #a0f0c0; }
.grp--organic { background: #9be36b; }
.grp--exotic { background: #ff7ae0; }

.muted { color: var(--ink-dim); }
.small { font-size: 16px; line-height: 1.5; }

/* ---------- Auth gate ---------- */
.authgate {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(1000px 700px at 70% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(53, 224, 255, 0.16), transparent 55%),
    var(--bg);
}
.authcard {
  width: min(420px, 100%); text-align: center; padding: 32px 28px;
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 18px;
  backdrop-filter: blur(12px); box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
}
.brand--big { justify-content: center; margin-bottom: 8px; }
.brand--big .brand__name { font-size: 35px; }
.brand--big .brand__mark { width: 30px; height: 30px; }
.authcard__tag { color: var(--ink-dim); font-size: 19px; margin: 0 0 22px; }
.authform { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.authform label { font-size: 16px; letter-spacing: 1px; color: var(--ink-dim); }
.authform input {
  font: inherit; padding: 12px 14px; border-radius: 10px; color: var(--ink);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--panel-brd);
}
.authform input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(53, 224, 255, 0.18); }
.capslot { display: flex; justify-content: center; margin-top: 4px; }
/* The widget host is display:inline-block and its inner .captcha is
   width:var(--cap-widget-width,260px). Give the host a real block width so our
   100% resolves against it — otherwise it collapses to a sliver. */
.capslot cap-widget { display: block; width: 100%; --cap-widget-width: 100%; }
.authmsg { font-size: 17px; margin: 16px 0 0; min-height: 18px; color: var(--ink-dim); }
.authmsg a { color: var(--accent); }
.authmsg--error { color: var(--danger); }

.starmap-side {
  position: absolute;
  right: var(--gap);
  top: var(--gap);
  width: 320px;
  max-height: calc(100% - 2 * var(--gap));
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(10px);
  animation: slide-in-right 0.3s ease;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.starmap-side[hidden] {
  display: none !important;
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; grid-auto-rows: min-content; overflow: auto; }
  .panel--main { order: -1; height: 60dvh; }
  .card--grow { max-height: 40dvh; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .mapctl__group--right { display: none; }
}

/* Persistent Spacemap background */
#tab-spacemap {
  display: flex !important;
}
#tab-spacemap:not(.tab-pane--active) .mapctl,
#tab-spacemap:not(.tab-pane--active) .starmap-side {
  display: none !important;
}
.tab-pane--overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
}
.tab-pane--overlay > .card--full {
  max-width: 800px;
  width: 100%;
  margin: 20px auto;
}
