/* ============================================================
   MERIDIUM STAR TRADERS — PANTHER v2
   "Bridge Commander" UI Framework

   Mobile-first responsive design with four themes.
   All colours via CSS custom properties.
   No external dependencies. System fonts only.

   Sections:
   1.  Theme Variables (Tycho, Belta, MCRN, Earther)
   2.  Reset & Base
   3.  Scanline Overlay
   4.  Layout Shell
   5.  Status Bar
   6.  Navigation (Desktop Tabs + Mobile Bottom Nav)
   7.  Panels
   8.  Stat / HUD Components
   9.  Tables
   10. Buttons
   11. Badges & Tags
   12. Forms
   13. Modals
   14. Game: Mission Cards
   15. Game: Crew Cards
   16. Game: Market Rows
   17. Game: Cargo Bar
   18. Game: Event Cards
   19. Game: Faction Tags
   20. Game: Activity Feed
   21. Game: System List
   22. Utility Classes
   23. Animations
   24. Responsive Breakpoints
   25. Earther Light Theme Overrides
============================================================ */


/* ============================================================
   1. THEME VARIABLES
============================================================ */

/* --- Tycho (default): warm gold/amber command deck --- */
:root,
[data-theme="tycho"] {
  --accent: #c9a86a;
  --accent-secondary: #c9a86a;
  --bg-deep: #0d1117;
  --bg-panel: #161b22;
  --bg-inset: #1c2128;
  --accent-glow: rgba(201, 168, 106, 0.15);
  --accent-border: rgba(201, 168, 106, 0.25);
  --accent-active: rgba(201, 168, 106, 0.5);
  --text: #e3e7ec;
  --text-sec: #a8b1bb;
  --text-dim: #8b949e;
  --positive: #3fb950;
  --warning: #d29922;
  --negative: #f85149;
  --info: #58a6ff;
  --scanline-opacity: 1;
  --scanline-color: rgba(201, 168, 106, 0.025);
  --btn-bg: transparent;
  --btn-text: var(--accent);
  --btn-border: var(--accent-border);
  --btn-hover-bg: var(--accent-glow);
  --btn-hover-border: var(--accent-active);
  --shadow-panel: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.5);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  --font-mono: 'Courier New', 'Consolas', monospace;
}

/* --- Belta: steel blue + OPA orange --- */
[data-theme="belta"] {
  --accent: #58a6ff;
  --accent-secondary: #e67e22;
  --bg-deep: #0a0f1a;
  --bg-panel: #111827;
  --bg-inset: #1a2234;
  --accent-glow: rgba(88, 166, 255, 0.12);
  --accent-border: rgba(88, 166, 255, 0.25);
  --accent-active: rgba(88, 166, 255, 0.5);
  --text: #e3e7ec;
  --text-sec: #a8b1bb;
  --text-dim: #8b949e;
  --positive: #3fb950;
  --warning: #e67e22;
  --negative: #f85149;
  --info: #58a6ff;
  --scanline-opacity: 1;
  --scanline-color: rgba(88, 166, 255, 0.02);
  --btn-bg: transparent;
  --btn-text: var(--accent);
  --btn-border: var(--accent-border);
  --btn-hover-bg: var(--accent-glow);
  --btn-hover-border: var(--accent-active);
  --shadow-panel: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.55);
}

/* --- MCRN: deep red/maroon military --- */
[data-theme="mcrn"] {
  --accent: #e74c3c;
  --accent-secondary: #c0392b;
  --bg-deep: #0d0a0a;
  --bg-panel: #1a1212;
  --bg-inset: #221818;
  --accent-glow: rgba(231, 76, 60, 0.12);
  --accent-border: rgba(231, 76, 60, 0.25);
  --accent-active: rgba(231, 76, 60, 0.5);
  --text: #e3e7ec;
  --text-sec: #a8b1bb;
  --text-dim: #8b949e;
  --positive: #3fb950;
  --warning: #d29922;
  --negative: #f85149;
  --info: #e74c3c;
  --scanline-opacity: 1;
  --scanline-color: rgba(231, 76, 60, 0.02);
  --btn-bg: transparent;
  --btn-text: var(--accent);
  --btn-border: var(--accent-border);
  --btn-hover-bg: var(--accent-glow);
  --btn-hover-border: var(--accent-active);
  --shadow-panel: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* --- Earther: navy on light grey (clean corporate) --- */
[data-theme="earther"] {
  --accent: #1e3a5f;
  --accent-secondary: #2563eb;
  --bg-deep: #f0f2f5;
  --bg-panel: #ffffff;
  --bg-inset: #e8ecf0;
  --accent-glow: rgba(30, 58, 95, 0.08);
  --accent-border: rgba(30, 58, 95, 0.2);
  --accent-active: rgba(30, 58, 95, 0.35);
  --text: #1a1a2e;
  --text-sec: #4a5568;
  --text-dim: #718096;
  --positive: #16a34a;
  --warning: #d97706;
  --negative: #dc2626;
  --info: #2563eb;
  --scanline-opacity: 0;
  --scanline-color: transparent;
  --btn-bg: #1e3a5f;
  --btn-text: #ffffff;
  --btn-border: #1e3a5f;
  --btn-hover-bg: #2a4f7a;
  --btn-hover-border: #2a4f7a;
  --shadow-panel: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   2. RESET & BASE
============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-active);
}


/* ============================================================
   3. SCANLINE OVERLAY
============================================================ */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 4px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: var(--scanline-opacity);
}


/* ============================================================
   4. LAYOUT SHELL
============================================================ */

.game-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.panel-container {
  flex: 1;
  padding: 14px;
  padding-bottom: 80px; /* space for mobile bottom nav */
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.panel-container--grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}


/* ============================================================
   5. STATUS BAR
============================================================ */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--accent-border);
  font-size: 13px;
  padding: 6px 14px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.status-bar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.status-bar__logo {
  height: 28px;
  width: auto;
}
.status-bar__wordmark {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-primary);
  white-space: nowrap;
}
.status-bar__divider {
  width: 1px;
  height: 20px;
  background: var(--border-dim);
  flex-shrink: 0;
}
.status-bar__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--text-dim);
}
.status-bar__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.status-bar__rank-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
  letter-spacing: 0.5px;
}
.status-bar__faction-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.status-bar__tier-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.tier-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.tier-badge--free { background: rgba(148,163,184,0.15); color: #94a3b8; }
.tier-badge--explorer { background: rgba(34,211,238,0.15); color: #22d3ee; }
.tier-badge--commander { background: rgba(167,139,250,0.15); color: #a78bfa; }
.tier-badge--admiral { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-bar__qt {
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 600;
}
.status-bar__days {
  color: var(--text-dim);
  font-size: 12px;
}

.status-bar__item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sec);
  white-space: nowrap;
}

.status-bar__value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.status-bar__value--accent {
  color: var(--accent);
}

.status-bar__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  padding: 5px 8px;
  border: 1px solid var(--text-dim);
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.status-bar__icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.status-bar__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--negative, #ef4444);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  border-radius: 8px;
}

/* Theme switcher dots */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-btn {
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  padding: 0;
  background: none;
  position: relative;
}
.theme-btn::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.theme-btn--tycho   { background-color: #c9a86a; border-color: rgba(201, 168, 106, 0.4); }
.theme-btn--belta   { background-color: #58a6ff; border-color: rgba(88, 166, 255, 0.4); }
.theme-btn--mcrn    { background-color: #e74c3c; border-color: rgba(231, 76, 60, 0.4); }
.theme-btn--earther { background-color: #f0f2f5; border-color: rgba(30, 58, 95, 0.5); }

.theme-btn.active::after { border-color: currentColor; }
.theme-btn--tycho.active::after   { border-color: #c9a86a; }
.theme-btn--belta.active::after   { border-color: #58a6ff; }
.theme-btn--mcrn.active::after    { border-color: #e74c3c; }
.theme-btn--earther.active::after { border-color: #f0f2f5; }

.theme-btn.active { box-shadow: 0 0 8px currentColor; }
.theme-btn--tycho.active   { box-shadow: 0 0 8px rgba(201, 168, 106, 0.6); }
.theme-btn--belta.active   { box-shadow: 0 0 8px rgba(88, 166, 255, 0.6); }
.theme-btn--mcrn.active    { box-shadow: 0 0 8px rgba(231, 76, 60, 0.6); }
.theme-btn--earther.active { box-shadow: 0 0 8px rgba(240, 242, 245, 0.7); }


/* ============================================================
   6. NAVIGATION
============================================================ */

/* --- Desktop horizontal tabs (hidden on mobile) --- */
.nav-tabs {
  display: none; /* mobile-first: hidden */
  background: var(--bg-panel);
  border-bottom: 1px solid var(--accent-border);
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tab {
  padding: 10px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.nav-tab:hover {
  color: var(--text-sec);
}
.nav-tab--active,
.nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --- Mobile bottom nav (shown by default, hidden on desktop) --- */
.bottom-nav {
  display: block;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border-top: 1px solid var(--accent-border);
  z-index: 100;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.bottom-nav__inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  color: var(--text-dim);
  cursor: pointer;
  min-width: 52px;
  background: none;
  border: none;
  transition: color 0.2s;
}
.bottom-nav__item:hover {
  color: var(--text-sec);
}
.bottom-nav__item--active,
.bottom-nav__item.active {
  color: var(--accent);
}

.bottom-nav__icon {
  width: 22px;
  height: 22px;
}
.bottom-nav__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.bottom-nav__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}


/* ============================================================
   7. PANELS
============================================================ */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--accent-border);
  border-radius: 5px;
  position: relative;
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

/* Top-left accent line */
.panel::before,
.panel__accent {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 0;
}
/* When using explicit .panel__accent element, kill the pseudo */
.panel--no-pseudo::before {
  display: none;
}

.panel__header {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.panel__status {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(63, 185, 80, 0.12);
  color: var(--positive);
}
.panel__status--warning {
  background: rgba(210, 153, 34, 0.12);
  color: var(--warning);
}
.panel__status--negative {
  background: rgba(248, 81, 73, 0.12);
  color: var(--negative);
}
.panel__status--info {
  background: rgba(88, 166, 255, 0.12);
  color: var(--info);
}

.panel__body {
  padding: 0 18px 18px;
}

.panel__footer {
  padding: 10px 18px;
  border-top: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Glow variant */
.panel--glow {
  box-shadow: var(--shadow-panel), 0 0 20px var(--accent-glow);
}

/* Full-width panel (no max-width constraint) */
.panel--full {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* Spacing helper for stacked panels */
.panel + .panel {
  margin-top: 14px;
}


/* ============================================================
   8. STAT / HUD COMPONENTS
============================================================ */

/* --- Stat grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--bg-inset);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 12px;
}

.stat-card__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stat-card__value {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1.2;
}

.stat-card__change {
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 4px;
}
.stat-card__change--up {
  color: var(--positive);
}
.stat-card__change--down {
  color: var(--negative);
}

/* --- HUD bars (hull/fuel/cargo) --- */
.hud-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.hud-bar:last-child {
  margin-bottom: 0;
}

.hud-bar__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  width: 60px;
  flex-shrink: 0;
}

.hud-bar__track {
  flex: 1;
  height: 7px;
  background: var(--bg-inset);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.hud-bar__fill {
  height: 100%;
  border-radius: 4px;
  position: relative;
  transition: width 0.5s ease;
  background: var(--accent);
}
/* Glow effect on fill */
.hud-bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: 0 0 8px currentColor;
  opacity: 0.4;
}

.hud-bar__fill--positive {
  background: var(--positive);
  color: var(--positive);
}
.hud-bar__fill--warning {
  background: var(--warning);
  color: var(--warning);
}
.hud-bar__fill--negative {
  background: var(--negative);
  color: var(--negative);
}
.hud-bar__fill--info {
  background: var(--info);
  color: var(--info);
}
.hud-bar__fill--accent {
  background: var(--accent);
  color: var(--accent);
}

.hud-bar__value {
  font-family: var(--font-mono);
  font-size: 13px;
  width: 55px;
  text-align: right;
  color: var(--text);
  flex-shrink: 0;
}

/* --- Monospace readout display --- */
.hud-readout {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.hud-readout--accent {
  color: var(--accent);
}
.hud-readout--large {
  font-size: 20px;
  font-weight: 600;
}


/* ============================================================
   9. TABLES
============================================================ */

.game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.game-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--accent-border);
  font-weight: 600;
  white-space: nowrap;
}

.game-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.08);
  color: var(--text);
  vertical-align: middle;
}

.game-table tr:last-child td {
  border-bottom: none;
}

.game-table tr:hover td {
  background: var(--accent-glow);
}

.game-table__callsign {
  font-weight: 600;
  color: var(--text);
}

.game-table__detail {
  color: var(--text-dim);
  font-size: 12px;
}

.game-table__mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.game-table__right {
  text-align: right;
}

/* Responsive table wrapper */
.game-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ============================================================
   10. BUTTONS
============================================================ */

/* --- Action button: outline style (primary game actions) --- */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 4px;
  color: var(--btn-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
  line-height: 1;
  white-space: nowrap;
}
.btn-action:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  text-decoration: none;
}
.btn-action:active {
  transform: scale(0.98);
}
.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Danger variant */
.btn-action--danger {
  --btn-text: var(--negative);
  --btn-border: rgba(248, 81, 73, 0.25);
  --btn-hover-bg: rgba(248, 81, 73, 0.12);
  --btn-hover-border: rgba(248, 81, 73, 0.5);
}

/* Positive variant */
.btn-action--positive {
  --btn-text: var(--positive);
  --btn-border: rgba(63, 185, 80, 0.25);
  --btn-hover-bg: rgba(63, 185, 80, 0.12);
  --btn-hover-border: rgba(63, 185, 80, 0.5);
}

/* --- Primary button: solid filled --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--bg-deep);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Secondary button: ghost/subtle --- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(127, 127, 127, 0.2);
  border-radius: 4px;
  color: var(--text-sec);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
  line-height: 1;
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: var(--accent-border);
  color: var(--text);
  text-decoration: none;
}
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Icon-only button --- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.btn-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* --- Action grid (2-col button layout) --- */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}


/* ============================================================
   11. BADGES & TAGS
============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge--positive {
  background: rgba(63, 185, 80, 0.12);
  color: var(--positive);
}
.badge--warning {
  background: rgba(210, 153, 34, 0.12);
  color: var(--warning);
}
.badge--negative {
  background: rgba(248, 81, 73, 0.12);
  color: var(--negative);
}
.badge--info {
  background: rgba(88, 166, 255, 0.12);
  color: var(--info);
}
.badge--neutral {
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-sec);
}
.badge--accent {
  background: var(--accent-glow);
  color: var(--accent);
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--positive { background: var(--positive); }
.status-dot--warning  { background: var(--warning); }
.status-dot--negative { background: var(--negative); }
.status-dot--dim      { background: var(--text-dim); }
.status-dot--accent   { background: var(--accent); }

.status-dot--pulse {
  animation: pulse 2s ease-in-out infinite;
}


/* ============================================================
   12. FORMS
============================================================ */

.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-active);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e7681' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.form-error {
  font-size: 12px;
  color: var(--negative);
  margin-top: 4px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Inline form row */
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.form-row .form-field {
  flex: 1;
  margin-bottom: 0;
}


/* ============================================================
   13. MODALS
============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 600;
}

.modal__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 18px;
}
.modal__close:hover {
  color: var(--text);
  background: var(--accent-glow);
}

.modal__body {
  padding: 20px;
}

.modal__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}


/* ============================================================
   14. GAME: MISSION CARDS
============================================================ */

.mission-card {
  background: var(--bg-inset);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 14px;
}
.mission-card + .mission-card {
  margin-top: 10px;
}

.mission-card__type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--warning);
  margin-bottom: 4px;
}

.mission-card__title {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}

.mission-card__meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-sec);
  flex-wrap: wrap;
}
.mission-card__meta span {
  font-family: var(--font-mono);
  color: var(--text);
}

.mission-card__progress {
  margin-top: 10px;
}

.mission-card__progress-bar {
  height: 4px;
  background: var(--bg-deep);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.mission-card__progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.mission-card__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.mission-card__dest {
  font-size: 12px;
  color: var(--info);
  margin-top: 6px;
}


/* ============================================================
   15. GAME: CREW CARDS
============================================================ */

.crew-card {
  background: var(--bg-inset);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.crew-card + .crew-card {
  margin-top: 8px;
}

.crew-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
  overflow: hidden;
}
.crew-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crew-card__info {
  flex: 1;
  min-width: 0;
}

.crew-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crew-card__role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}

.crew-card__stats {
  font-size: 12px;
  color: var(--text-sec);
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.crew-card__actions {
  flex-shrink: 0;
}

/* Crew dot display (compact) */
.crew-dots {
  display: flex;
  gap: 5px;
}
.crew-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.crew-dot--empty {
  background: transparent;
  border: 1px solid var(--text-dim);
}

/* Rarity colours */
.crew-rarity--common    { color: #aaa; }
.crew-rarity--uncommon  { color: #4ade80; }
.crew-rarity--rare      { color: #60a5fa; }
.crew-rarity--legendary { color: #f59e0b; }


/* ============================================================
   16. GAME: MARKET ROWS
============================================================ */

.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.08);
  gap: 12px;
}
.market-row:last-child {
  border-bottom: none;
}

.market-row__good {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  min-width: 0;
  flex: 1;
}

.market-row__stock {
  font-size: 12px;
  color: var(--text-sec);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.market-row__price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

.market-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}


/* ============================================================
   17. GAME: CARGO BAR
============================================================ */

.cargo-bar {
  margin-bottom: 16px;
}

.cargo-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.cargo-bar__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.cargo-bar__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.cargo-bar__track {
  height: 8px;
  background: var(--bg-inset);
  border-radius: 4px;
  overflow: hidden;
}

.cargo-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.cargo-bar__fill--warning {
  background: var(--warning);
}
.cargo-bar__fill--full {
  background: var(--negative);
}


/* ============================================================
   18. GAME: EVENT CARDS
============================================================ */

.event-card {
  background: var(--bg-inset);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 14px;
}
.event-card + .event-card {
  margin-top: 10px;
}

.event-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.event-card__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.event-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.event-card__desc {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 8px;
  line-height: 1.4;
}

.event-card__meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}

.event-card__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* Event banner (inline notification) */
.event-banner {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.event-banner .cr {
  color: var(--positive);
  font-family: var(--font-mono);
  font-weight: 600;
}
.event-banner--warning {
  background: rgba(210, 153, 34, 0.08);
  border-color: rgba(210, 153, 34, 0.2);
}
.event-banner--negative {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.2);
}


/* ============================================================
   19. GAME: FACTION TAGS
============================================================ */

.faction-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.faction-tag--friendly {
  background: rgba(63, 185, 80, 0.12);
  color: var(--positive);
}
.faction-tag--neutral {
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-sec);
}
.faction-tag--hostile {
  background: rgba(248, 81, 73, 0.12);
  color: var(--negative);
}

.faction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.faction-row__name {
  font-size: 13px;
  color: var(--text);
}


/* ============================================================
   20. GAME: ACTIVITY FEED
============================================================ */

.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.08);
}
.activity-item:last-child {
  border-bottom: none;
}

.activity-item__text {
  font-size: 13px;
  color: var(--text);
}
.activity-item__text .cr {
  color: var(--positive);
  font-family: var(--font-mono);
}

.activity-item__time {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 2px;
}


/* ============================================================
   21. GAME: SYSTEM LIST
============================================================ */

.system-list {
  list-style: none;
}

.system-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.08);
}
.system-item:last-child {
  border-bottom: none;
}

.system-item__name {
  font-size: 14px;
  color: var(--text);
}
.system-item__type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.system-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.system-tag--docked  { background: rgba(63, 185, 80, 0.12); color: var(--positive); }
.system-tag--station { background: rgba(88, 166, 255, 0.1);  color: var(--info); }
.system-tag--planet  { background: rgba(210, 153, 34, 0.1);  color: var(--warning); }
.system-tag--post    { background: rgba(139, 148, 158, 0.1); color: var(--text-sec); }


/* ============================================================
   22. UTILITY CLASSES
============================================================ */

/* Text colours */
.text-positive { color: var(--positive); }
.text-warning  { color: var(--warning); }
.text-negative { color: var(--negative); }
.text-info     { color: var(--info); }
.text-accent   { color: var(--accent); }
.text-dim      { color: var(--text-dim); }
.text-sec      { color: var(--text-sec); }

/* Monospace for numbers */
.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Text truncation */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Spacing helpers */
.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }

/* Display helpers */
.d-none   { display: none; }
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-block  { display: block; }

/* Flex helpers */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Desktop-only / mobile-only */
.desktop-only { display: none; }
.mobile-only  { display: block; }


/* ============================================================
   23. ANIMATIONS
============================================================ */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

.anim-fade-in {
  animation: fadeIn 0.3s ease;
}

.anim-slide-up {
  animation: slideUp 0.3s ease;
}


/* ============================================================
   24. RESPONSIVE BREAKPOINTS
============================================================ */

/* --- Tablet (>=768px) --- */
@media (min-width: 768px) {
  /* Show desktop tabs, hide mobile nav */
  .nav-tabs {
    display: flex;
    gap: 0;
  }
  .bottom-nav-DISABLED {
    display: none;
  }

  /* Panel container gets more breathing room */
  .panel-container {
    padding: 20px;
    padding-bottom: 20px; /* no bottom nav space needed */
  }

  /* 2-column grid */
  .panel-container--grid {
    grid-template-columns: 2fr 1fr;
    gap: 20px;
  }

  /* Stat grid: 4 columns */
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  /* Panel spacing */
  .panel__header {
    padding: 14px 18px 10px;
  }
  .panel__body {
    padding: 0 18px 18px;
  }

  /* Status bar shows all items */
  .status-bar {
    padding: 8px 20px;
    gap: 16px;
  }

  /* Desktop/mobile visibility */
  .desktop-only { display: flex; }
  .mobile-only  { display: none; }
}

/* --- Desktop (>=1024px) --- */
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .panel-container { padding-bottom: 20px; }
}
@media (min-width: 1024px) {
  .panel-container {
    max-width: 1280px;
  }

  /* Action grid can go 4-col on wider screens */
  .action-grid--wide {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Wide (>=1400px) --- */
@media (min-width: 1400px) {
  .panel-container {
    max-width: 1400px;
    padding: 24px 32px;
  }

  /* Stat grid: could go 6 columns for dashboards */
  .stat-grid--wide {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* --- Small mobile (<=480px) --- */
@media (max-width: 480px) {
  .status-bar__ship-name {
    font-size: 12px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card__value {
    font-size: 16px;
  }

  .action-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .btn-action {
    padding: 10px 10px;
    font-size: 11px;
  }

  .panel__body {
    padding: 0 12px 12px;
  }
  .panel__header {
    padding: 10px 12px 8px;
  }

  .crew-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .market-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal {
    max-width: 100%;
    margin: 8px;
    max-height: 95vh;
  }
}


/* ============================================================
   25. EARTHER LIGHT THEME OVERRIDES
============================================================ */

/* Disable scanline — handled by --scanline-opacity: 0 in variables */

[data-theme="earther"] .panel {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="earther"] .event-banner {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.2);
}
[data-theme="earther"] .event-banner--warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
}

[data-theme="earther"] .panel__status {
  background: rgba(22, 163, 74, 0.1);
}
[data-theme="earther"] .panel__status--warning {
  background: rgba(217, 119, 6, 0.1);
}
[data-theme="earther"] .panel__status--negative {
  background: rgba(220, 38, 38, 0.1);
}

[data-theme="earther"] .system-tag--docked  { background: rgba(22, 163, 74, 0.1); }
[data-theme="earther"] .system-tag--station  { background: rgba(37, 99, 235, 0.08); }
[data-theme="earther"] .system-tag--planet   { background: rgba(217, 119, 6, 0.08); }

[data-theme="earther"] .faction-tag--friendly { background: rgba(22, 163, 74, 0.1); }
[data-theme="earther"] .faction-tag--neutral  { background: rgba(74, 85, 104, 0.1); }
[data-theme="earther"] .faction-tag--hostile   { background: rgba(220, 38, 38, 0.1); }

[data-theme="earther"] .badge--positive { background: rgba(22, 163, 74, 0.1); }
[data-theme="earther"] .badge--warning  { background: rgba(217, 119, 6, 0.1); }
[data-theme="earther"] .badge--negative { background: rgba(220, 38, 38, 0.1); }
[data-theme="earther"] .badge--info     { background: rgba(37, 99, 235, 0.08); }

[data-theme="earther"] .form-input,
[data-theme="earther"] .form-select,
[data-theme="earther"] .form-textarea {
  background: #f7f8fa;
  border-color: rgba(30, 58, 95, 0.2);
}
[data-theme="earther"] .form-input:focus,
[data-theme="earther"] .form-select:focus,
[data-theme="earther"] .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

/* Earther: buttons are filled, not outlined */
[data-theme="earther"] .btn-action {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
[data-theme="earther"] .btn-action:hover {
  background: #2a4f7a;
  border-color: #2a4f7a;
}
[data-theme="earther"] .btn-action--danger {
  background: var(--negative);
  border-color: var(--negative);
  color: #fff;
}
[data-theme="earther"] .btn-action--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
[data-theme="earther"] .btn-action--positive {
  background: var(--positive);
  border-color: var(--positive);
  color: #fff;
}
[data-theme="earther"] .btn-action--positive:hover {
  background: #15803d;
  border-color: #15803d;
}

[data-theme="earther"] .modal-overlay {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="earther"] .hud-bar__track {
  background: #dde1e6;
}

[data-theme="earther"] .mission-card,
[data-theme="earther"] .event-card,
[data-theme="earther"] .crew-card {
  background: #f7f8fa;
  border-color: rgba(30, 58, 95, 0.15);
}

[data-theme="earther"] .stat-card {
  background: #f7f8fa;
  border-color: rgba(30, 58, 95, 0.15);
}

[data-theme="earther"] ::-webkit-scrollbar-track {
  background: #e8ecf0;
}
[data-theme="earther"] ::-webkit-scrollbar-thumb {
  background: rgba(30, 58, 95, 0.25);
}
[data-theme="earther"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 58, 95, 0.4);
}

/* ============================================================
   MOBILE FIXES — 2026-04-06
============================================================ */

/* Bottom nav: only hide on actual desktop, not landscape phones */
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}
/* Ensure bottom nav shows on tablets/landscape phones */
@media (max-width: 1023px) {
  .bottom-nav { display: block !important; }
  .nav-tabs { display: none !important; }
}

/* Bigger touch targets on mobile */
@media (max-width: 1023px) {
  .btn-action, .btn-primary, .btn-secondary {
    padding: 14px 20px;
    font-size: 13px;
    min-height: 44px;
  }
  .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }
  .bottom-nav__item {
    padding: 8px 12px;
    min-width: 60px;
  }
  .bottom-nav__icon {
    width: 26px;
    height: 26px;
  }
  .bottom-nav__label {
    font-size: 11px;
  }
}

/* ============================================================
   FIXES — 2026-04-06 batch 2
============================================================ */

/* Status bar: single line, no wrapping */
.status-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  gap: 8px;
}
.status-bar__left, .status-bar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.status-bar__left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}
.status-bar__commander {
  font-weight: 600;
  color: var(--accent);
  font-size: 12px;
}
.status-bar__separator {
  color: var(--text-dim);
  font-size: 10px;
}

/* Theme dots: 20px — not too big, not too small */
.theme-btn {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
}

/* Stat grid: consistent card heights + gap below */
.stat-grid {
  gap: 12px;
  margin-bottom: 14px;
}
.stat-card {
  min-height: auto;
}

/* Mobile status bar: compact */
@media (max-width: 767px) {
  .status-bar {
    font-size: 11px;
    padding: 8px 12px;
  }
  .status-bar__commander {
    font-size: 11px;
  }
  .status-bar__credits {
    font-size: 11px;
  }
  .hidden-mobile {
    display: none !important;
  }
}

/* Force equal stat card heights */
.stat-grid {
  align-items: stretch;
}
.stat-grid .stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}
.stat-grid .stat-card .stat-card__value {
  flex: none;
}

/* ─── 25b. News Ticker ──────────────────────── */
.ticker-bar {
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-dim);
  font-size: 13px;
  overflow: hidden;
  height: 32px;
}
.ticker-bar__label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  color: var(--text-sec);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
  border-right: 1px solid var(--border-dim);
}
.ticker-bar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: ticker-pulse 2s ease-in-out infinite;
}
@keyframes ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.ticker-bar__track {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ticker-bar__scroll {
  display: inline-flex;
  gap: 32px;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  padding-left: 100%;
  color: var(--text);
}
.ticker-bar__scroll:hover {
  animation-play-state: paused;
}
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.ticker-item:hover .ticker-item__title {
  color: var(--text-primary);
}
.ticker-item__tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(148,163,184,0.15);
  color: #a8b1bb;
}
.ticker-item__tag--war { background: rgba(239,68,68,0.15); color: #ef4444; }
.ticker-item__tag--embargo { background: rgba(245,158,11,0.15); color: #f59e0b; }
.ticker-item__tag--alliance { background: rgba(34,197,94,0.15); color: #22c55e; }
.ticker-item__tag--announcement { background: rgba(96,165,250,0.15); color: #60a5fa; }
.ticker-item__tag--discovery { background: rgba(167,139,250,0.15); color: #a78bfa; }
.ticker-item__title {
  font-size: 13px;
  color: var(--text);
  transition: color 0.15s;
}
.ticker-item__when {
  font-size: 11px;
  color: var(--text-sec);
  opacity: 0.75;
}

/* ─── 25c. Location Overview ────────────────── */
.loc-section {
  margin-bottom: 14px;
}
.loc-section:last-child {
  margin-bottom: 0;
}
.loc-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-dim);
}
.loc-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--text-dim);
  border-radius: 6px;
  margin-bottom: 6px;
}
.loc-entry:last-child {
  margin-bottom: 0;
}
.loc-entry__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1;
  color: #22c55e;
}
.loc-entry__planet-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.loc-type-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.loc-spec-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  text-transform: uppercase;
}
.loc-entry__info {
  flex: 1;
  min-width: 0;
}
.loc-entry__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.loc-entry__meta {
  font-size: 11px;
  color: var(--text-dim);
}
.loc-entry__action {
  flex-shrink: 0;
}

/* ─── 26. Ship Status Card ──────────────────── */
.status-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .status-split { grid-template-columns: 1fr; }
}
.status-split__ship {
  min-width: 0;
}
.status-split__cargo {
  min-width: 0;
  border-left: 1px solid var(--border-dim);
  padding-left: 20px;
}
@media (max-width: 768px) {
  .status-split__cargo { border-left: none; padding-left: 0; border-top: 1px solid var(--border-dim); padding-top: 12px; }
}
.ship-header-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}
.ship-hologram {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text-dim);
  border-radius: 6px;
  padding: 8px;
  flex-shrink: 0;
}
.ship-name-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.ship-hologram__img {
  max-height: 80px;
  object-fit: contain;
  opacity: 0.85;
}
.ship-readout__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  text-align: left;
  width: 100%;
}
.ship-role-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid;
  font-weight: 600;
  text-transform: uppercase;
}
.ship-status-line {
  font-size: 12px;
  margin-bottom: 2px;
}
.ship-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.ship-bar__label {
  width: 40px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}
.ship-bar__val {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 100px;
  text-align: right;
}
/* Ship bar track + fill */
.ship-bar__track {
  flex: 1;
  min-width: 60px;
  height: 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
}
.ship-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.ship-bar__fill--hull { background: linear-gradient(90deg, #22c55e, #4ade80); }
.ship-bar__fill--fuel { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.ship-bar__fill--cargo { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* Cargo manifest */
.cargo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cargo-header__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.cargo-header__cap {
  font-size: 11px;
  color: var(--text-dim);
}
.cargo-list {
  max-height: 200px;
  overflow-y: auto;
}
.cargo-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 16px 0;
}
.cargo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.cargo-item:last-child { border-bottom: none; }
.cargo-item__info { display: flex; flex-direction: column; }
.cargo-item__name { color: var(--text-primary); font-weight: 500; }
.cargo-item__weight { color: var(--text-dim); font-size: 10px; }
.cargo-item__qty { color: var(--text-dim); font-weight: 500; white-space: nowrap; }

/* ─── 27. Chat ──────────────────────────────── */
.chat-channel-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chat-channel-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
.chat-channel-btn--active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 201, 168, 106), 0.1);
}
.chat-msg {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.4;
}
.chat-msg--system {
  opacity: 0.7;
}
.chat-msg__time {
  flex-shrink: 0;
}
.chat-msg__name {
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.chat-msg__text {
  color: var(--text-primary);
  word-break: break-word;
}
.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus {
  border-color: var(--accent);
}
.chat-input::placeholder {
  color: var(--text-dim);
}

/* ─── 27. Map Tabs + System List ────────────── */
.map-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
}
.map-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}
.map-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.system-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background 0.1s;
  gap: 8px;
}
.system-row:hover {
  background: rgba(255,255,255,0.03);
}
.system-row--current {
  background: rgba(var(--accent-rgb, 201, 168, 106), 0.06);
  border-left: 3px solid var(--accent);
}
.system-row__main {
  flex: 1;
  min-width: 0;
}
.system-row__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.system-row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.system-row__action {
  flex-shrink: 0;
}

/* ── Shared Tab Styles ────────────────────────────────── */
.mkt-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 12px 24px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.mkt-tab:hover {
  color: var(--text-primary);
}
.mkt-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Player Info (Dashboard Left Side) ─────────────────── */
.status-split__player {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}
.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--text-dim);
  flex-shrink: 0;
}
.player-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-avatar__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-inset);
  color: var(--text-dim);
  font-size: 28px;
  font-weight: 700;
}
.player-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.player-rank {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
/* ── Ship Info Boxes (Status / Crew) ────────────────────── */
.ship-info-box {
  border: 1px solid var(--text-dim);
  border-radius: 6px;
  padding: 10px 14px;
}
.ship-info-box__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.ship-info-box__value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Player Quick Links ─────────────────────────────────── */
.player-quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.player-quick-link:hover {
  color: var(--accent);
}

.ship-bar__fill--xp {
  background: linear-gradient(90deg, #a78bfa, #c4b5fd);
}

/* ── Ship Store Button (Header) ────────────────────────── */
/* ── Header Credits & QT ───────────────────────────────── */
.status-bar__credits-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.status-bar__qt-val {
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
}

.status-bar__store-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--text-dim);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.2s;
}
.status-bar__store-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* -- TOAST NOTIFICATIONS --------------------------------- */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  background: var(--bg-primary, #1a1f2e);
  color: var(--text-primary, #e5e7eb);
  border: 1px solid var(--border-dim, #2a3040);
  border-left: 4px solid var(--text-dim, #6b7280);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  min-width: 200px;
}
.toast--visible {
  opacity: 1;
  transform: translateX(0);
}
.toast--info      { border-left-color: #60a5fa; }
.toast--positive  { border-left-color: #4ade80; }
.toast--success   { border-left-color: #4ade80; }
.toast--warning   { border-left-color: #f59e0b; }
.toast--negative  { border-left-color: #ef4444; }
.toast--error     { border-left-color: #ef4444; }
@media (max-width: 768px) {
  #toast-container {
    bottom: 80px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .toast { font-size: 12px; min-width: 0; }
}

/* Ship detail panels stack tightly by default � add a consistent gap */
#fleet-tab-content > .panel {
  margin-bottom: 12px;
}
#fleet-tab-content > .panel:last-child {
  margin-bottom: 0;
}

/* Dark-theme native select dropdowns — use theme-scoped vars */
select, select option, .chat-input option {
  background-color: var(--bg-inset) !important;
  color: var(--text) !important;
}

/* ═══════════════════════════════════════════════════════════
   Auth Pages — Login, Register, Create Character, Galaxy Select
   Uses Tycho theme variables from panther-v2.css
   ═══════════════════════════════════════════════════════════ */

.auth-body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
}

.auth-container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
  padding: 18px 20px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-panel);
}

.auth-game-title {
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px 0;
  font-weight: 700;
}

.auth-version {
  font-size: 0.85rem;
  color: var(--text-sec);
  letter-spacing: 0.08em;
}

.auth-card {
  padding: 28px 24px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-panel);
}

.auth-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 12px;
}

.auth-tab {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-sec);
  background: transparent;
  border: 1px solid var(--accent-border);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.auth-tab:hover {
  color: var(--text);
  background: var(--accent-glow);
  border-color: var(--accent-active);
}

.auth-tab.active {
  color: var(--bg-deep);
  background: var(--accent);
  border-color: var(--accent);
}

.auth-success {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  color: var(--positive);
  font-size: 0.9rem;
}

.auth-errors {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  color: var(--negative);
}

.auth-errors ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: var(--text-sec);
  gap: 6px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-border);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.auth-form button[type="submit"] {
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg-deep);
  border: 1px solid var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.auth-form button[type="submit"]:hover {
  box-shadow: 0 0 14px var(--accent-glow);
  transform: translateY(-1px);
}

/* Galaxy selection cards */
.galaxy-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.galaxy-card {
  padding: 20px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-panel);
  cursor: pointer;
  transition: all 0.2s ease;
}

.galaxy-card:hover {
  border-color: var(--accent-active);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-2px);
}

.galaxy-card h3 {
  color: var(--accent);
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

.galaxy-card p {
  color: var(--text-sec);
  margin: 0;
  font-size: 0.85rem;
}

/* Character creation */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.avatar-option {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent-border);
  cursor: pointer;
  transition: all 0.2s ease;
  object-fit: cover;
}

.avatar-option:hover,
.avatar-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Links on auth pages */
.auth-card a,
.auth-container a {
  color: var(--accent);
  text-decoration: none;
}

.auth-card a:hover,
.auth-container a:hover {
  text-decoration: underline;
}
