/* Solarstorm — pixel-retro theme */
:root {
  --bg-deep: #050018;
  --bg-mid: #0a0030;
  --fg: #e8f4ff;
  --accent: #ffd966;
  --accent2: #ff5577;
  --hull: #6dff6d;
  --shield: #66aaff;
  --fuel: #ffd966;
  --cargo: #ff9966;
  --border: #2a2a55;
  --panel-bg: rgba(10, 0, 30, 0.92);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: var(--bg-deep);
  color: var(--fg);
  font-family: 'Courier New', monospace;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

canvas {
  display: block;
  background: #000010;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  outline: none;
}

/* Game-Canvas füllt das gesamte Viewport — responsive auf Browserfenstergröße.
   UI-Elemente (HUD, Radar, Panels) bleiben position:fixed und liegen darüber. */
canvas#game {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
}

/* ---------- Mini-Radar (top-right of game viewport) ---------- */
#radar {
  position: fixed !important;
  top: 64px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 160px !important;
  height: 160px !important;
  background: rgba(0, 0, 16, 0.78);
  border: 1px solid var(--accent);
  border-radius: 4px;
  image-rendering: pixelated;
  z-index: 11;
  pointer-events: none;
  margin: 0 !important;
}
#radar-label {
  position: fixed;
  top: 50px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  z-index: 11;
  pointer-events: none;
  text-shadow: 0 0 4px #000;
}

/* ---------- Navigations-Compass (unter Radar) ---------- */
#nav-wrap {
  position: fixed !important;
  top: 232px !important;     /* direkt unter Radar (64 + 160 + 8 Gap) */
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  width: 160px !important;
  height: 90px !important;
  z-index: 11;
  pointer-events: none;
}
#nav {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 16, 0.78);
  border: 1px solid var(--accent);
  border-radius: 4px;
  image-rendering: pixelated;
}
#nav-label {
  position: fixed;
  top: 218px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  z-index: 11;
  pointer-events: none;
  text-shadow: 0 0 4px #000;
}

/* ---------- Target-Display (bottom-right, analog Radar) ---------- */
#target-display-wrap {
  position: fixed !important;
  bottom: 50px !important;        /* über HUD-Bottom (~28px + 8px Margin) */
  right: 8px !important;
  top: auto !important;
  left: auto !important;
  width: 240px !important;        /* doppelt so groß wie Radar */
  height: 400px !important;       /* Issue #14: 300 → 400 (mehr Stats) */
  z-index: 11;
  pointer-events: none;
}
#target-display {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 16, 0.78);
  border: 1px solid var(--accent);
  border-radius: 4px;
  image-rendering: pixelated;
}
#target-display-label {
  position: fixed;
  bottom: 440px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  z-index: 11;
  pointer-events: none;
  text-shadow: 0 0 4px #000;
}

#galaxy-canvas {
  position: static !important;
  display: block !important;
  width: 860px;
  height: 520px;
  max-width: 100%;
  margin: 0 auto;
  background: #000020;
  image-rendering: pixelated;
}

/* Force the galaxy panel-body to center its children horizontally. */
#panel-galaxy .panel-body {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: start;
  gap: 8px;
}

/* ---------- Login overlay ---------- */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(0,0,40,0.9), rgba(0,0,0,0.99));
  z-index: 100;
}
.login-card {
  background: var(--panel-bg);
  border: 2px solid var(--accent);
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255,217,102,0.3);
  min-width: 360px;
}
.title {
  margin: 0 0 4px 0;
  font-size: 36px;
  color: var(--accent);
  letter-spacing: 8px;
  text-shadow: 0 0 20px var(--accent);
}
.subtitle {
  margin: 0 0 24px 0;
  font-size: 12px;
  opacity: 0.7;
  letter-spacing: 3px;
}
.login-card input {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
}
.login-card input:focus { outline: 1px solid var(--accent); }
.login-actions { display: flex; gap: 12px; margin-top: 18px; }
.login-actions button { flex: 1; }
.hint { font-size: 11px; opacity: 0.6; margin-top: 18px; line-height: 1.5; }
.error-msg { color: var(--accent2); font-size: 12px; min-height: 16px; margin-bottom: 8px; }

/* ---------- Buttons (pixel) ---------- */
button {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
}
button:hover:not(:disabled) { background: #fff; }
button:disabled { background: #555; color: #888; cursor: not-allowed; }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  pointer-events: none;
  z-index: 10;
  font-size: 12px;
  letter-spacing: 1px;
}
.hud-top {
  position: fixed; top: 8px; left: 8px; right: 8px;
  display: flex; gap: 16px;
}
.hud-stat {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  padding: 6px 10px;
  flex: 1;
  display: flex; align-items: center; gap: 8px;
}
.hud-stat .lbl { font-weight: bold; min-width: 50px; }
.bar {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid #444;
  position: relative;
}
.bar .fill { height: 100%; transition: width 0.2s; }
.fill-hull  { background: var(--hull); }
.fill-shield{ background: var(--shield); }
.fill-fuel  { background: var(--fuel); }
.fill-cargo { background: var(--cargo); }
/* Issue #13 (2026-08-25): Speed-Balken — gradient von grün (langsam) nach gelb/orange (schnell). */
.fill-speed { background: linear-gradient(90deg, #6dff6d 0%, #ffd966 50%, #ff7766 100%); }
.hud-stat .val { min-width: 80px; text-align: right; opacity: 0.85; }

.hud-bottom {
  position: fixed; bottom: 8px; left: 8px; right: 8px;
  display: flex; gap: 16px;
  font-size: 11px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  padding: 6px 10px;
}
.hud-bottom > * { flex: 1; }

.hud-events {
  position: fixed; left: 8px;
  top: 80px;
  width: 280px;
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
}
.hud-events > div {
  background: rgba(10,0,30,0.7);
  border-left: 3px solid var(--accent);
  padding: 4px 8px;
  font-size: 11px;
  animation: fadeOut 4s forwards;
}
@keyframes fadeOut { 0% { opacity: 1 } 70% { opacity: 1 } 100% { opacity: 0; transform: translateX(-10px); } }

.hud-message {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,80,80,0.9);
  color: #fff;
  padding: 16px 32px;
  font-weight: bold;
  letter-spacing: 2px;
  z-index: 50;
  display: none;
}

/* ---------- Panels ---------- */
.panel {
  position: fixed;
  background: var(--panel-bg);
  border: 2px solid var(--accent);
  padding: 0;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  z-index: 30;
  box-shadow: 0 0 30px rgba(255,217,102,0.4);
  display: flex; flex-direction: column;
}
#panel-character { top: 60px; right: 20px; left: 20px; width: auto; max-width: 1400px; margin: 0 auto; }
#panel-inventory { top: 60px; right: 20px; width: 480px; }
#panel-comm { top: 60px; left: 20px; width: 480px; }
#panel-galaxy { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 960px; }
#trade-modal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 760px; }
#jump-modal { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 400px; }

.panel-header {
  background: var(--accent);
  color: #000;
  padding: 10px 16px;
  font-weight: bold;
  letter-spacing: 2px;
  display: flex; justify-content: space-between; align-items: center;
}
.close-btn {
  background: transparent;
  color: #000;
  padding: 0;
  width: 24px; height: 24px;
  line-height: 1;
}
.panel-body { padding: 16px; overflow: auto; max-height: 70vh; }
.panel-body h3 { color: var(--accent); margin: 16px 0 8px; font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--accent); letter-spacing: 1px; font-size: 11px; }
td button { font-size: 11px; padding: 4px 10px; }

/* Galaxy panel */
.galaxy-controls {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 12px;
}
.galaxy-controls button { padding: 8px 16px; }
#system-controls { gap: 6px; }
#system-controls button {
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  min-width: 36px;
}
#sys-zoom-level {
  font-family: 'Courier New', monospace;
  color: var(--accent);
  min-width: 50px;
  text-align: center;
}
.galaxy-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; opacity: 0.75;
  margin-top: 12px;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-g { background: #fff4e8; }
.dot-k { background: #ffd2a1; }
.dot-m { background: #ffcc6f; }
.dot-d { background: #ffffff; }

/* Comm panel */
.comm-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.galaxy-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab-btn { background: rgba(255,255,255,0.1); color: var(--fg); padding: 6px 12px; font-size: 11px; }
.tab-btn.active { background: var(--accent); color: #000; }
.comm-messages {
  height: 320px; overflow-y: auto;
  border: 1px solid var(--border);
  padding: 8px;
  background: rgba(0,0,0,0.4);
  font-size: 12px;
  margin-bottom: 12px;
}
.comm-messages .msg { margin-bottom: 4px; }
.comm-messages .msg .sender { color: var(--accent); font-weight: bold; }
.comm-messages .msg .time { opacity: 0.5; font-size: 10px; margin-right: 8px; }
.comm-input { display: flex; gap: 8px; }
.comm-input input { flex: 1; background: rgba(255,255,255,0.08); border: 1px solid var(--border); color: var(--fg); padding: 8px; font-family: inherit; }

/* ---------- Entities-Tab (Comm-Panel) ---------- */
.comm-entities {
  height: 360px; overflow-y: auto;
  border: 1px solid var(--border);
  padding: 6px;
  background: rgba(0,0,0,0.35);
  font-size: 11px;
  margin-bottom: 12px;
}

/* Issue #65c-Filter (2026-08-30): Toggle-Chips für Entity-Filter.
   Sci-fi-Look passend zu .tab-btn. Aktiv = accent, inaktiv = border. */
.entity-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 8px 0;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 217, 102, 0.15);
}
.entity-filter-chip {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
  opacity: 0.55;
  user-select: none;
}
.entity-filter-chip:hover {
  opacity: 0.85;
  border-color: var(--accent);
}
.entity-filter-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  opacity: 1;
  font-weight: bold;
}
.entity-filter-chip .chip-count {
  opacity: 0.7;
  margin-left: 4px;
  font-size: 9px;
}
.entity-section-header {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 2px;
  margin: 8px 4px 4px 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 217, 102, 0.2);
}
.entity-section-header:first-child { margin-top: 2px; }
.entity-count { opacity: 0.55; font-size: 10px; }
.entity-empty {
  padding: 6px 8px;
  font-size: 10px;
  opacity: 0.45;
  font-style: italic;
}
.entity-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.entity-row:hover { background: rgba(255, 217, 102, 0.12); }
.entity-row.is-self { background: rgba(255, 217, 102, 0.08); }
.entity-row.is-self:hover { background: rgba(255, 217, 102, 0.18); }
/* Issue #22 (2026-08-25): Selected-State — visuelles Feedback für aktives Target */
/* Issue #65c-Fix (2026-08-30): Deutlich auffälliger (Glow + Border + Target-Marker) */
.entity-row.is-selected {
  background: rgba(255, 217, 102, 0.28) !important;
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 12px rgba(255, 217, 102, 0.35) !important;
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  animation: target-pulse 2s ease-in-out infinite;
}
.entity-row.is-selected:hover {
  background: rgba(255, 217, 102, 0.38) !important;
}
.entity-row.is-selected::before {
  content: '◎';
  color: var(--accent);
  font-weight: bold;
  margin-right: 4px;
  text-shadow: 0 0 6px var(--accent);
}
@keyframes target-pulse {
  0%, 100% { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 12px rgba(255, 217, 102, 0.35); }
  50%      { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 20px rgba(255, 217, 102, 0.55); }
}
.entity-marker {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 4px currentColor;
}
.entity-name {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-meta {
  font-size: 10px;
  opacity: 0.65;
  white-space: nowrap;
}
.entity-dist {
  font-size: 10px;
  color: var(--accent);
  min-width: 50px;
  text-align: right;
}
.entity-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 1px;
}
.entity-badge.you    { background: var(--accent); color: #000; }
.entity-badge.docked { background: #4488ff; color: #fff; }
.entity-badge.dead   { background: #ff5577; color: #fff; }
.entity-hull { display: inline-block; min-width: 40px; }
.hull-bar { display: inline-block; width: 40px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 1px; overflow: hidden; }
.hull-fill { display: block; height: 100%; }
.entity-row.planet, .entity-row.station { grid-template-columns: 10px 1fr auto auto; }


/* Upgrade list */
.upgrade-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px; border: 1px solid var(--border); margin-bottom: 4px;
  font-size: 12px;
}
.upgrade-row .lvl { color: var(--accent); }
.upgrade-row button { padding: 4px 8px; font-size: 10px; }
.upgrade-row .maxed { color: var(--hull); font-weight: bold; }

/* Trade panel */
#trade-table th, #trade-table td { padding: 8px; }
#trade-table .qty-input { width: 50px; background: rgba(255,255,255,0.08); border: 1px solid var(--border); color: var(--fg); padding: 2px 6px; font-family: inherit; }

/* Pixel border helper */
.pixel-border {
  position: relative;
}
.pixel-border::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(255,217,102,0.3);
  pointer-events: none;
}
/* ============= OUTFITTING PANEL ============= */
.outfit-body { max-height: 75vh; }
.outfit-grid {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 16px;
  height: 100%;
}
.outfit-col-left, .outfit-col-center, .outfit-col-right {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 72vh;
  min-width: 0;  /* Verhindert Text-Truncation in flex-children */
}
.outfit-col-center { border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0 12px; }

/* Slot-Liste (links) */
.outfit-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.outfit-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 16, 32, 0.4);
  cursor: pointer;
  font-family: monospace;
  transition: all 0.15s;
}
.outfit-slot-row:hover { border-color: var(--accent); background: rgba(255, 217, 102, 0.05); }
.outfit-slot-row.selected { border-color: var(--accent); background: rgba(255, 217, 102, 0.15); box-shadow: 0 0 8px rgba(255,217,102,0.3); }
.outfit-slot-row.empty { opacity: 0.6; }
.outfit-slot-row .slot-idx {
  display: inline-block;
  width: 22px;
  text-align: center;
  background: rgba(255, 217, 102, 0.2);
  color: var(--accent);
  font-weight: bold;
  font-size: 11px;
  padding: 2px 0;
}
.outfit-slot-row .slot-type {
  font-size: 10px;
  color: #88aaff;
  letter-spacing: 1px;
  width: 50px;
}
.outfit-slot-row .slot-eq-name {
  flex: 1;
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.outfit-slot-row .slot-eq-name.empty { color: #666; font-style: italic; }
.outfit-slot-row.incompatible { border-color: #ff5577; }

/* Slot-Detail (mitte oben) */
.outfit-slot-detail {
  background: rgba(0, 16, 32, 0.5);
  border: 1px solid var(--border);
  padding: 12px;
  font-family: monospace;
  font-size: 11px;
  min-height: 120px;
}
.outfit-slot-detail h4 { color: var(--accent); margin: 0 0 8px; font-size: 13px; letter-spacing: 1px; }
.outfit-slot-detail .stat-row { display: flex; justify-content: space-between; padding: 2px 0; }
.outfit-slot-detail .stat-row .label { color: #88aaff; }
.outfit-slot-detail .stat-row .value { color: #fff; font-weight: bold; }
.outfit-slot-detail .actions { margin-top: 12px; display: flex; gap: 8px; }
.outfit-slot-detail button { background: rgba(255,217,102,0.2); border: 1px solid var(--accent); color: var(--accent); padding: 4px 12px; font-family: monospace; font-size: 11px; cursor: pointer; }
.outfit-slot-detail button:hover { background: var(--accent); color: #000; }
.outfit-slot-detail button.danger { border-color: #ff5577; color: #ff5577; background: rgba(255,85,119,0.1); }
.outfit-slot-detail button.danger:hover { background: #ff5577; color: #000; }

/* Equipment-Liste (mitte unten) */
.outfit-equipment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.outfit-equipment-list::-webkit-scrollbar { width: 6px; }
.outfit-equipment-list::-webkit-scrollbar-track { background: rgba(0,0,16,0.3); }
.outfit-equipment-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.outfit-eq-item {
  padding: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 16, 32, 0.4);
  cursor: pointer;
  font-family: monospace;
  font-size: 11px;
  transition: all 0.15s;
}
.outfit-eq-item:hover { border-color: var(--accent); background: rgba(255, 217, 102, 0.05); }
.outfit-eq-item.compatible { border-left: 3px solid #66ff66; }
.outfit-eq-item.incompatible { border-left: 3px solid #ff5577; opacity: 0.55; cursor: not-allowed; }
.outfit-eq-item .eq-name { color: #fff; font-weight: bold; }
.outfit-eq-item .eq-meta { color: #88aaff; font-size: 10px; margin-top: 2px; }
.outfit-eq-item .eq-stats { color: #ccc; font-size: 10px; margin-top: 4px; }
.outfit-eq-item .eq-reason { color: #ff5577; font-size: 9px; margin-top: 4px; font-style: italic; }

/* Stats-Bar (rechts) */
.outfit-stats {
  background: rgba(0, 16, 32, 0.4);
  border: 1px solid var(--border);
  padding: 10px;
  font-family: monospace;
  font-size: 11px;
}
.outfit-stats .stat-block { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted rgba(255,217,102,0.15); }
.outfit-stats .stat-block:last-child { border-bottom: none; }
.outfit-stats .stat-block .label { color: #88aaff; }
.outfit-stats .stat-block .value { color: #fff; font-weight: bold; }
.outfit-stats .stat-block.warning .value { color: #ffaa00; }
.outfit-stats .stat-block.danger .value { color: #ff5577; }
.outfit-stats .stat-block.good .value { color: #66ff66; }

/* Power/Heat/Mass-Bars */
.outfit-bars { display: flex; flex-direction: column; gap: 8px; }
.outfit-bar {
  background: rgba(0, 16, 32, 0.4);
  border: 1px solid var(--border);
  padding: 8px;
  font-family: monospace;
  font-size: 10px;
}
.outfit-bar .label { display: flex; justify-content: space-between; color: var(--accent); margin-bottom: 4px; }
.outfit-bar .track { background: rgba(0,0,16,0.6); height: 8px; border: 1px solid rgba(255,217,102,0.2); position: relative; }
.outfit-bar .fill { height: 100%; transition: width 0.2s; }
.outfit-bar .fill.power.normal { background: #66ff66; }
.outfit-bar .fill.power.warning { background: #ffaa00; }
.outfit-bar .fill.power.danger { background: #ff5577; }
.outfit-bar .fill.heat.normal { background: #66ccff; }
.outfit-bar .fill.heat.danger { background: #ff5577; }
.outfit-bar .fill.mass.normal { background: #66ff66; }
.outfit-bar .fill.mass.danger { background: #ff5577; }

/* Inventory (rechts unten) */
.outfit-inventory {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 180px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 10px;
}
.outfit-inv-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  background: rgba(0, 16, 32, 0.4);
  border-left: 3px solid var(--accent);
  cursor: pointer;
}
.outfit-inv-item:hover { background: rgba(255, 217, 102, 0.1); }
.outfit-inv-item .qty { color: var(--accent); font-weight: bold; }
/* Issue #65b Phase 2 (2026-09-05): Install/Ablegen-Buttons im Spieler-Inventar */
.outfit-btn-install, .outfit-btn-unequip {
  background: rgba(170, 255, 204, 0.18);
  color: #aaffcc;
  border: 1px solid #4d8a6f;
  font-family: monospace;
  font-size: 9px;
  padding: 2px 6px;
  margin-left: 6px;
  cursor: pointer;
  border-radius: 2px;
}
.outfit-btn-install:hover, .outfit-btn-unequip:hover {
  background: rgba(170, 255, 204, 0.35);
  border-color: #aaffcc;
}
.outfit-btn-unequip {
  background: rgba(255, 136, 85, 0.18);
  color: #ff8855;
  border-color: #8a4d3a;
}
.outfit-btn-unequip:hover {
  background: rgba(255, 136, 85, 0.35);
  border-color: #ff8855;
}

/* Trade-Tabs (Equipment vs Goods) */
.trade-tabs .tab-btn {
  background: rgba(255, 217, 102, 0.1);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 14px;
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}
.trade-tabs .tab-btn:hover { background: rgba(255, 217, 102, 0.2); }
.trade-tabs .tab-btn.active {
  background: var(--accent);
  color: #000;
  font-weight: bold;
}

/#outfit-buy-table { width: 100%; border-collapse: collapse; font-family: monospace; font-size: 11px; }
#outfit-buy-table thead { background: rgba(255, 217, 102, 0.15); color: var(--accent); }
#outfit-buy-table th { padding: 8px; text-align: left; letter-spacing: 1px; }
#outfit-buy-table td { padding: 6px 8px; border-bottom: 1px dotted rgba(255,217,102,0.15); }
#outfit-buy-table tr:hover { background: rgba(255, 217, 102, 0.05); }
#outfit-buy-table button {
  background: rgba(255, 217, 102, 0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  font-family: monospace;
  font-size: 10px;
  cursor: pointer;
}
#outfit-buy-table button:hover:not(:disabled) { background: var(--accent); color: #000; }
#outfit-buy-table button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Ship-Picker im Login-Form */
.ship-picker {
  background: rgba(0, 16, 32, 0.5);
  border: 1px solid var(--border);
  padding: 10px;
  font-family: monospace;
  font-size: 10px;
}
.ship-picker-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ship-btn {
  background: rgba(255, 217, 102, 0.05);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 10px;
  font-family: monospace;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  flex: 1;
  min-width: 120px;
  transition: all 0.15s;
}
.ship-btn:hover { background: rgba(255, 217, 102, 0.15); border-color: var(--accent); }
.ship-btn.active {
  background: var(--accent);
  color: #000;
  font-weight: bold;
}
.ship-btn strong { font-size: 11px; }
.ship-btn small { font-size: 9px; opacity: 0.8; }

/* Issue #6 Fix (2026-08-24): Waffen-Button-Bar */
.weapon-bar {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 11;
  pointer-events: auto;
}
.weapon-btn {
  width: 72px;
  height: 56px;
  background: rgba(0, 0, 16, 0.85);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-family: monospace;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  padding: 2px;
}
.weapon-btn:hover { background: rgba(255, 217, 102, 0.18); border-color: var(--accent); }
.weapon-btn:active,
.weapon-btn.firing {
  background: rgba(255, 100, 50, 0.4);
  border-color: #ff6644;
}
.weapon-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.weapon-btn .key {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background: rgba(255, 217, 102, 0.2);
  border-radius: 2px;
  padding: 1px 5px;
  margin-bottom: 2px;
}
.weapon-btn .name {
  font-size: 8px;
  line-height: 1.1;
  overflow: hidden;
}
.weapon-btn.tractor { border-color: #88aaff; color: #88aaff; }
.weapon-btn.tractor .key { background: rgba(136, 170, 255, 0.3); }

/* =================================================================
   Issue #27 (2026-08-25): Lore-Terminal-Display
   ================================================================= */
.lore-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(90, 240, 255, 0.08);
  color: #5af0ff;
  border: 1px solid #5af0ff;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.lore-btn:hover {
  background: rgba(90, 240, 255, 0.2);
  box-shadow: 0 0 12px rgba(90, 240, 255, 0.5);
}
.lore-btn::before {
  content: '▶ ';
  color: #5af0ff;
}

#lore-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 8, 0.92);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lore-terminal {
  width: min(900px, 92vw);
  max-height: 88vh;
  background: #000814;
  border: 2px solid #5af0ff;
  border-radius: 4px;
  box-shadow:
    0 0 20px rgba(90, 240, 255, 0.4),
    inset 0 0 40px rgba(90, 240, 255, 0.05);
  display: flex;
  flex-direction: column;
  font-family: 'Courier New', monospace;
  color: #5af0ff;
}
.lore-header {
  background: linear-gradient(90deg, #0a3a4a, #062028);
  padding: 10px 18px;
  border-bottom: 1px solid #5af0ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: 2px;
}
.lore-header .title {
  font-weight: bold;
  text-shadow: 0 0 8px rgba(90, 240, 255, 0.8);
}
.lore-header .close-btn {
  background: transparent;
  border: 1px solid #ff5577;
  color: #ff5577;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 10px;
}
.lore-header .close-btn:hover {
  background: rgba(255, 85, 119, 0.2);
}
.lore-status {
  padding: 6px 18px;
  background: rgba(0, 30, 40, 0.6);
  border-bottom: 1px solid rgba(90, 240, 255, 0.3);
  font-size: 10px;
  color: #88aaff;
  display: flex;
  gap: 24px;
  letter-spacing: 1px;
}
.lore-status .ok::before {
  content: '● ';
  color: #6dff6d;
}
.lore-status .warn::before {
  content: '⚠ ';
  color: #ff7766;
}
.lore-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #aaccee;
  scrollbar-width: thin;
  scrollbar-color: #5af0ff #001020;
}
.lore-body::-webkit-scrollbar { width: 8px; }
.lore-body::-webkit-scrollbar-track { background: #001020; }
.lore-body::-webkit-scrollbar-thumb { background: #5af0ff; border-radius: 0; }
.lore-body h1 {
  color: #ffd966;
  font-size: 16px;
  letter-spacing: 4px;
  margin: 0 0 6px;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 217, 102, 0.6);
}
.lore-body h1::before,
.lore-body h1::after {
  content: '═══════════════════════════════';
  display: block;
  font-size: 10px;
  color: #5af0ff;
  margin: 8px 0;
  opacity: 0.6;
}
.lore-body h2 {
  color: #5af0ff;
  font-size: 14px;
  letter-spacing: 3px;
  margin: 22px 0 10px;
  border-left: 3px solid #5af0ff;
  padding-left: 12px;
  text-shadow: 0 0 8px rgba(90, 240, 255, 0.5);
}
.lore-body h3 {
  color: #ffd966;
  font-size: 12.5px;
  margin: 14px 0 6px;
  letter-spacing: 1px;
}
.lore-body p {
  margin: 0 0 10px;
  text-align: justify;
}
.lore-body .ascii-art {
  text-align: center;
  color: #5af0ff;
  font-size: 11px;
  line-height: 1.2;
  margin: 14px 0;
  white-space: pre;
  text-shadow: 0 0 6px rgba(90, 240, 255, 0.4);
}
.lore-body .warning {
  color: #ff7766;
  background: rgba(255, 119, 102, 0.08);
  border: 1px solid rgba(255, 119, 102, 0.3);
  padding: 8px 12px;
  margin: 10px 0;
  text-align: center;
  font-weight: bold;
  letter-spacing: 2px;
}
.lore-body .quote {
  color: #ffd966;
  border-left: 3px solid #ffd966;
  padding: 6px 14px;
  margin: 10px 0;
  background: rgba(255, 217, 102, 0.05);
  font-style: italic;
}
.lore-body ul {
  margin: 6px 0 10px;
  padding-left: 24px;
}
.lore-body li {
  margin: 2px 0;
}

/* =================================================================
   Issue #15 (2026-08-25): XP/Level + Lizenz-Shop CSS
   ================================================================= */
.char-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
}
.char-level-row .lbl {
  color: var(--accent);
  letter-spacing: 1.5px;
  font-size: 11px;
}
.level-badge {
  background: linear-gradient(135deg, #5af0ff 0%, #ffd966 100%);
  color: #000814;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 13px;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
  min-width: 24px;
  text-align: center;
}
.char-level-row .xp-text {
  color: #88aaff;
  font-size: 11px;
  margin-left: auto;
}
.char-xp-bar {
  background: rgba(255, 255, 255, 0.15);
  height: 8px;
  border-radius: 2px;
  margin: 4px 0 2px;
  overflow: hidden;
}
.xp-fill {
  background: linear-gradient(90deg, #5af0ff 0%, #88aaff 50%, #5af0ff 100%);
  height: 100%;
  box-shadow: 0 0 6px rgba(90, 240, 255, 0.6);
  transition: width 0.4s ease;
}
.char-xp-total {
  font-size: 10px;
  color: #6dff6d;
  margin-bottom: 6px;
}

.license-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.license-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid #5af0ff;
  font-size: 11px;
}
.license-row.unlocked { border-left-color: #6dff6d; }
.license-row.locked   { border-left-color: #888; opacity: 0.7; }
.license-row .ship-name { font-weight: bold; color: #ffd966; min-width: 80px; }
.license-row .req { color: #88aaff; }
.license-row .buy-btn {
  background: #5af0ff;
  color: #000814;
  border: none;
  padding: 3px 8px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
}
.license-row .buy-btn:hover { background: #88ffff; }
.license-row .buy-btn:disabled {
  background: #555;
  color: #aaa;
  cursor: not-allowed;
}

/* =================================================================
   Issue #15 (2026-08-25): License-Shop Modal
   ================================================================= */
#license-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 8, 0.85);
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.license-modal {
  width: min(720px, 92vw);
  max-height: 80vh;
  background: #001020;
  border: 2px solid #ffd966;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 217, 102, 0.4);
  display: flex;
  flex-direction: column;
  font-family: 'Courier New', monospace;
  color: #cccccc;
}
.license-modal .modal-header {
  background: linear-gradient(90deg, #4a3a0a, #2a2008);
  padding: 10px 16px;
  border-bottom: 1px solid #ffd966;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffd966;
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 13px;
}
.license-modal .modal-header .close-btn {
  background: transparent;
  border: 1px solid #ff5577;
  color: #ff5577;
  font-family: inherit;
  padding: 2px 10px;
  cursor: pointer;
}
.license-modal .modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  max-height: 65vh;
}
.license-modal h3 {
  color: #ffd966;
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 1px;
}
.license-modal .license-info {
  font-size: 11px;
  color: #88aaff;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ============================================================
   Profile Button + Modal (Issue #37, 2026-08-26)
   ============================================================ */
.profile-btn {
  background: rgba(20, 30, 50, 0.92);
  border: 1px solid #5af0ff;
  color: #5af0ff;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, box-shadow 0.15s;
  text-shadow: 0 0 4px rgba(90, 240, 255, 0.5);
}
.profile-btn:hover {
  background: rgba(40, 60, 100, 0.95);
  box-shadow: 0 0 8px rgba(90, 240, 255, 0.5);
}
.profile-btn:active {
  background: rgba(60, 100, 160, 1);
}
.profile-menu {
  position: absolute;
  top: 36px;
  right: 0;
  background: rgba(10, 20, 36, 0.97);
  border: 1px solid #5af0ff;
  border-radius: 3px;
  min-width: 220px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(90, 240, 255, 0.2);
  font-family: 'Courier New', monospace;
}
.profile-menu-header {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(90, 240, 255, 0.3);
  margin-bottom: 4px;
}
.profile-menu-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #cfe9f5;
  padding: 8px 12px;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.profile-menu-item:hover {
  background: rgba(90, 240, 255, 0.15);
  color: #fff;
}
.profile-menu-item.danger {
  color: #ff7766;
  border-top: 1px solid rgba(255, 80, 80, 0.25);
  margin-top: 4px;
}
.profile-menu-item.danger:hover {
  background: rgba(255, 80, 80, 0.18);
  color: #ffaa99;
}

/* Modals (Password + Delete) */
.modal {
  background: rgba(10, 20, 36, 0.97);
  border: 1px solid #5af0ff;
  border-radius: 4px;
  width: 90%;
  font-family: 'Courier New', monospace;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(90, 240, 255, 0.2);
}
.modal .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(90deg, #0a3a4a, #062028);
  border-bottom: 1px solid #5af0ff;
  color: #5af0ff;
  letter-spacing: 2px;
  font-size: 13px;
}
.modal .close-btn {
  background: transparent;
  border: 1px solid #5af0ff;
  color: #5af0ff;
  font-family: inherit;
  padding: 2px 10px;
  cursor: pointer;
  border-radius: 2px;
}
.modal .close-btn:hover { background: rgba(90, 240, 255, 0.15); }
.modal-body { color: #cfe9f5; }
.modal-btn {
  padding: 8px 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid;
}
.modal-btn.cancel {
  background: transparent;
  border-color: #88aaff;
  color: #88aaff;
}
.modal-btn.cancel:hover { background: rgba(136, 170, 255, 0.15); }
.modal-btn.primary {
  background: #5af0ff;
  border-color: #5af0ff;
  color: #021620;
}
.modal-btn.primary:hover {
  background: #8af6ff;
  box-shadow: 0 0 8px rgba(90, 240, 255, 0.5);
}
.modal-btn.danger {
  background: #ff7766;
  border-color: #ff7766;
  color: #2a0808;
}
.modal-btn.danger:hover {
  background: #ffaa99;
  box-shadow: 0 0 8px rgba(255, 80, 80, 0.5);
}
.success-msg {
  background: rgba(110, 255, 110, 0.15);
  border: 1px solid #6dff6d;
  color: #6dff6d;
  padding: 8px;
  border-radius: 3px;
  font-size: 12px;
  display: none;
}
.success-msg.show { display: block; }
.error-msg.show { display: block; }


/* Profile-Menu Toggle-Switches (Issue #63 + #69, 2026-09-01) */
.profile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin: 2px 0;
  cursor: pointer;
  font-size: 12px;
  color: #d0d8e0;
  border-top: 1px solid rgba(90, 240, 255, 0.15);
  background: transparent;
  font-family: inherit;
  user-select: none;
  transition: background 0.15s;
}
.profile-menu-toggle:hover {
  background: rgba(90, 240, 255, 0.08);
}
.profile-menu-toggle input[type="checkbox"] {
  display: none;
}
.profile-menu-toggle .toggle-slider {
  position: relative;
  width: 36px;
  height: 18px;
  background: #2a3540;
  border-radius: 9px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.profile-menu-toggle .toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #6a7a8a;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.profile-menu-toggle input[type="checkbox"]:checked ~ .toggle-slider {
  background: rgba(90, 240, 255, 0.4);
}
.profile-menu-toggle input[type="checkbox"]:checked ~ .toggle-slider::before {
  transform: translateX(18px);
  background: #5af0ff;
}

/* Issue #82 (2026-09-07): HUD Target-Panel — Action-Buttons (§11) */
.hud-action-btn {
  background: rgba(0, 32, 64, 0.85);
  color: #88ddff;
  border: 1px solid #2c5266;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 2px;
  text-shadow: 0 0 4px #000;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.hud-action-btn:hover { background: rgba(0, 80, 140, 0.95); border-color: #88ddff; }
.hud-action-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.hud-action-btn[disabled]:hover { background: rgba(0, 32, 64, 0.85); border-color: #2c5266; }
.hud-action-btn.primary {
  background: rgba(136, 221, 255, 0.25);
  color: #fff;
  border-color: #88ddff;
}
.hud-action-btn.primary:hover { background: rgba(136, 221, 255, 0.45); }
.hud-action-btn.danger {
  background: rgba(255, 85, 119, 0.25);
  color: #ff5577;
  border-color: #8a3a4d;
}
.hud-action-btn.danger:hover { background: rgba(255, 85, 119, 0.5); border-color: #ff5577; }
