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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02030a;
  color: #f5f5f5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* ══════════════════════════════════════════
   SPLASH SCREEN
══════════════════════════════════════════ */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
}

#splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 0 20px;
}

#splash-logo {
  width: clamp(82px, 13vw, 120px);
  height: clamp(82px, 13vw, 120px);
  border-radius: 26%;
  object-fit: cover;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.25s;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.38), 0 0 60px rgba(139, 92, 246, 0.25);
}

#splash-welcome {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(18px, 3.5vw, 28px);
  color: #a0c4ff;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.75s ease forwards 0.65s;
  text-shadow: 0 0 20px rgba(100, 180, 255, 0.7), 0 0 60px rgba(60, 120, 255, 0.3);
}

#splash-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 6.8vw, 86px);
  line-height: 1.05;
  opacity: 0;
  animation: fadeUp 0.85s ease forwards 1.1s;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.18em;
  align-items: baseline;
  max-width: 100%;
}

#splash-hatty {
  color: #fff;
  position: relative;
  display: inline-block;
  animation: glitch 2.8s infinite 2.2s;
  text-shadow: 0 0 20px rgba(160, 100, 255, 0.9), 0 0 60px rgba(120, 60, 255, 0.5);
}

#splash-universe {
  color: #c4b5fd;
  text-shadow: 0 0 30px rgba(180, 120, 255, 0.8), 0 0 80px rgba(140, 80, 255, 0.4);
}

#splash-byline {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(13px, 2.2vw, 18px);
  color: rgba(200, 210, 255, 0.75);
  letter-spacing: 0.14em;
  opacity: 0;
  animation: fadeUp 0.75s ease forwards 1.5s;
  margin-top: 2px;
}

#splash-hattyname {
  color: #a78bfa;
  display: inline-block;
  animation: glitch 3.2s infinite 2.6s;
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.8);
}

#splash-pilot-box {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  animation: fadeUp 0.75s ease forwards 1.85s;
  z-index: 4;
}

.pilot-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #7dd3fc;
  text-transform: uppercase;
}

.pilot-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}
.pilot-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.5);
}
.pilot-icon { font-size: 14px; margin-right: 6px; }

#splash-pilot-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  width: 170px;
  text-align: center;
}

#splash-dice-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  transition: all 0.15s ease;
  margin-left: 4px;
}
#splash-dice-btn:hover {
  background: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  transform: rotate(15deg);
}

#splash-enter {
  margin-top: 14px;
  position: relative;
  padding: 14px 48px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(160, 120, 255, 0.9);
  border-radius: 4px;
  cursor: not-allowed;
  opacity: 0;
  animation: fadeUp 0.75s ease forwards 2.15s;
  transition: all 0.2s ease;
  box-shadow: 0 0 18px rgba(140, 80, 255, 0.6), 0 0 50px rgba(120, 60, 255, 0.25), inset 0 0 18px rgba(140, 80, 255, 0.08);
}
#splash-enter:hover:not(:disabled) {
  background: rgba(120, 60, 255, 0.3);
  box-shadow: 0 0 32px rgba(160, 100, 255, 0.9), 0 0 90px rgba(120, 60, 255, 0.45);
  transform: translateY(-2px) scale(1.03);
}
#splash-enter:active:not(:disabled) { transform: translateY(0) scale(0.99); }

.pwa-install-pill {
  margin-top: 4px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(15, 23, 42, 0.78);
  color: #7dd3fc;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 0.75s ease forwards 2.4s;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
}
.pwa-install-pill:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}
body.pwa-installed #splash-install-btn,
body.pwa-installed #install-app-btn,
body.pwa-installed #inst-install-wrap {
  display: none !important;
}

#splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.07) 3px, rgba(0, 0, 0, 0.07) 4px);
  pointer-events: none;
  z-index: 3;
}

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

@keyframes glitch {
  0%, 90%, 100% { clip-path: none; transform: translate(0); text-shadow: inherit; }
  91% { clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); transform: translate(-4px, 0); text-shadow: 3px 0 #ff00ff, -3px 0 #00ffff; }
  92% { clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%); transform: translate(4px, 0); text-shadow: -3px 0 #ff00ff, 3px 0 #00ffff; }
  93% { clip-path: polygon(0 0%, 100% 0%, 100% 15%, 0 15%); transform: translate(-2px, 2px); text-shadow: 2px 0 #ff0055, -2px 0 #00ffcc; }
  94% { clip-path: none; transform: translate(0); }
}

#splash.exiting { animation: splashExit 0.65s ease forwards; pointer-events: none; }
@keyframes splashExit {
  0% { opacity: 1; transform: scale(1); }
  60% { opacity: 0.8; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.08); pointer-events: none; }
}

/* ══════════════════════════════════════════
   MAIN UNIVERSE LAYOUT & LEFT HUD
══════════════════════════════════════════ */
#universe-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}
canvas { display: block; }

#left-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-height: calc(100vh - 24px);
  width: 336px;
  max-width: calc(100vw - 24px);
  z-index: 9995;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
body.universe-entered #left-panel { z-index: 200; }
#left-panel::-webkit-scrollbar { display: none; }

.left-nav-row {
  display: flex;
  gap: 5px;
  width: 336px;
  max-width: 100%;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}
body:not(.universe-entered) .left-nav-row,
body:not(.universe-entered) .dropdown-panel {
  opacity: 0;
  pointer-events: none;
}

.panel-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e2e8f0;
  padding: 7px 8px;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  position: relative;
  white-space: nowrap;
}
.panel-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}
.panel-toggle-btn.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}
.battle-toggle-btn {
  border-color: rgba(244, 63, 94, 0.45);
}
.battle-toggle-btn:hover {
  border-color: #f43f5e;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.5);
}
.battle-toggle-btn.battle-active {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.45), rgba(190, 18, 60, 0.6));
  border-color: #fb7185;
  color: #fff;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.7);
  animation: battlePulse 1.8s infinite ease-in-out;
}
@keyframes battlePulse {
  0%, 100% { box-shadow: 0 0 14px rgba(244, 63, 94, 0.55); }
  50% { box-shadow: 0 0 24px rgba(251, 113, 133, 0.9); }
}
.btn-arrow { font-size: 9px; color: #94a3b8; transition: transform 0.2s ease; }
.panel-toggle-btn.active .btn-arrow { transform: rotate(180deg); color: #38bdf8; }

.chat-unread-dot {
  width: 7px;
  height: 7px;
  background: #38bdf8;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 5px;
  box-shadow: 0 0 6px #38bdf8;
  animation: pulse-dot 1.5s infinite;
}
.chat-unread-dot.hidden { display: none !important; }
@keyframes pulse-dot {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

.dropdown-panel {
  pointer-events: auto;
  width: 292px;
  max-width: 100%;
  animation: dropdown-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dropdown-panel.hidden { display: none !important; }
@keyframes dropdown-appear {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hud {
  padding: 11px 14px;
  background: rgba(10, 15, 30, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}
.hud-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #38bdf8;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
}
.hud-body { color: #cbd5e1; }
.hud-body strong { color: #fff; font-weight: 600; }
.hud-keyboard { display: block; }
.hud-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hud-keyboard { display: none; }
  .hud-touch { display: block; }
}

.hud-pilot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #94a3b8;
}
.hud-pilot-row strong { color: #38bdf8; }
.hud-edit-name-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  color: #38bdf8;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hud-edit-name-btn:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: #38bdf8;
  color: #fff;
}

/* ── Live Chat Box ── */
.chat-container {
  background: rgba(10, 15, 30, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}
.chat-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.6px;
}
.chat-pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}
.chat-pilot-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  cursor: pointer;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-pilot-btn:hover { background: rgba(56, 189, 248, 0.28); color: #fff; }
.chat-messages-box {
  height: 185px;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  line-height: 1.4;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}
.chat-system-msg {
  color: #94a3b8;
  font-style: italic;
  background: rgba(56, 189, 248, 0.08);
  border-left: 2px solid #38bdf8;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 10px;
}
.chat-msg-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.chat-msg-row.my-msg { background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.22); }
.chat-msg-meta { display: flex; justify-content: space-between; font-size: 10px; }
.chat-msg-sender { font-weight: 600; color: #38bdf8; font-family: 'Share Tech Mono', monospace; }
.chat-msg-row.my-msg .chat-msg-sender { color: #4ade80; }
.chat-msg-time { color: #64748b; font-size: 9px; }
.chat-msg-text { color: #f1f5f9; word-break: break-word; }
.chat-input-bar {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
}
#chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
}
#chat-input:focus { border-color: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }
#chat-send-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 4px;
  color: #fff;
  padding: 0 10px;
  font-size: 11px;
  cursor: pointer;
}
#chat-send-btn:hover { background: #0ea5e9; }

/* ── Affizy 480x320 Ad Slot (Preserved) ── */
#affizy-ad-wrap {
  width: 280px;
  max-width: 100%;
  pointer-events: auto;
  margin-top: 4px;
  flex-shrink: 0;
  line-height: 0;
}
#affizy-ad-wrap .affizy-ad {
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
#affizy-ad-placeholder {
  width: 100%;
  aspect-ratio: 480 / 320;
  border-radius: 8px;
  border: 1px dashed rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 58, 138, 0.6));
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  color: #7dd3fc;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  line-height: 1.35;
  padding: 10px;
  user-select: none;
}
#affizy-ad-placeholder.hidden { display: none !important; }
#affizy-ad-placeholder .affizy-ph-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #94a3b8;
}

/* ══════════════════════════════════════════
   TOP-RIGHT CONTROLS, SETTINGS & TARGETING
══════════════════════════════════════════ */
#top-right-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 180;
  pointer-events: none;
}

.main-site-button {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.72);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.main-site-button:hover {
  background: rgba(37, 99, 235, 0.95);
  border-color: rgba(129, 140, 248, 1);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.75);
  transform: translateY(-1px);
}
.main-site-button.is-muted { border-color: rgba(239, 68, 68, 0.75); color: #fca5a5; }
.main-site-button.is-playing,
.main-site-button.active {
  border-color: #38bdf8;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.25);
}

/* ── Unified Settings Drawer ── */
#settings-panel {
  position: absolute;
  top: 50px;
  right: 12px;
  width: min(300px, calc(100vw - 24px));
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  background: rgba(10, 15, 30, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 12px;
  padding: 14px;
  z-index: 300;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 22px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
}
#settings-panel.hidden { display: none !important; }
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  padding-bottom: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.settings-section:last-child { border-bottom: none; padding-bottom: 0; }
.settings-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.settings-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-btn:hover { border-color: #38bdf8; color: #fff; }
.settings-btn.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #7dd3fc;
}
.settings-select {
  width: 100%;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
}
.settings-slider { width: 100%; accent-color: #38bdf8; cursor: pointer; }
.passport-bar-wrap {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
}
.passport-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  transition: width 0.35s ease;
}

/* ── Jump-To, Sector Select & Search ── */
#jump-wrap {
  position: absolute;
  top: 48px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  z-index: 150;
}
body.universe-entered #jump-wrap:focus-within { z-index: 250; }

#online-explorers-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #7dd3fc;
  white-space: nowrap;
  user-select: none;
  backdrop-filter: blur(6px);
}

#sector-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 26px 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(68, 136, 255, 0.6);
  background: rgba(15, 23, 42, 0.88)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2338bdf8'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
#sector-select:focus { outline: none; border-color: #38bdf8; }

#targeting-system { font-family: 'Orbitron', sans-serif; position: relative; }
#target-search {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid #4488ff;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  width: 170px;
}
#target-search:focus { box-shadow: 0 0 8px #4488ff; border-color: #38bdf8; }

#target-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 295px;
  width: max-content;
  max-width: min(380px, 90vw);
  background: rgba(10, 15, 30, 0.96);
  border: 1px solid #4488ff;
  border-radius: 6px;
  margin-top: 4px;
  display: none;
  max-height: 290px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
}
.target-sector-heading {
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.target-item {
  padding: 8px 12px;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s;
}
.target-item:hover { background: rgba(68, 136, 255, 0.35); color: #38bdf8; }
.target-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-badge {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   3D FLOATING LABELS & OFF-SCREEN WAYPOINT
══════════════════════════════════════════ */
#planet-labels-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}
.planet-3d-label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  will-change: transform, opacity;
  display: none;
}
.planet-3d-label .lbl-dist { color: #7dd3fc; margin-left: 4px; font-size: 9px; }
.planet-3d-label.is-target {
  border-color: #38bdf8;
  color: #ffffff;
  background: rgba(14, 165, 233, 0.32);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

#target-waypoint {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.25);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 45;
  display: none;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

/* ══════════════════════════════════════════
   GALAXY DIRECTORY DRAWER (VISUAL CATALOG)
══════════════════════════════════════════ */
#directory-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(10px);
  padding: 16px;
}
#directory-modal.open {
  display: flex;
  animation: modalFadeIn 0.2s ease forwards;
}
.directory-shell {
  width: min(980px, 100%);
  height: min(84vh, 760px);
  background: linear-gradient(150deg, rgba(12, 18, 36, 0.97), rgba(22, 18, 56, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 36px rgba(56, 189, 248, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.directory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(2, 6, 23, 0.72);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  flex-wrap: nowrap;
}
.directory-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.directory-header .holo-close {
  flex-shrink: 0;
}
.directory-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.06em;
}
.passport-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #e9d5ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
}
.directory-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.55);
}
#directory-search {
  width: 100%;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  color: #fff;
  padding: 8px 12px;
  font-size: 12.5px;
  outline: none;
}
#directory-search:focus { border-color: #38bdf8; box-shadow: 0 0 12px rgba(56, 189, 248, 0.35); }
.directory-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
}
.directory-tabs::-webkit-scrollbar,
.directory-grid::-webkit-scrollbar,
#settings-panel::-webkit-scrollbar,
#target-dropdown::-webkit-scrollbar {
  width: 6px;
  height: 5px;
}
.directory-tabs::-webkit-scrollbar-track,
.directory-grid::-webkit-scrollbar-track,
#settings-panel::-webkit-scrollbar-track,
#target-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
.directory-tabs::-webkit-scrollbar-thumb,
.directory-grid::-webkit-scrollbar-thumb,
#settings-panel::-webkit-scrollbar-thumb,
#target-dropdown::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 999px;
}
.directory-tabs::-webkit-scrollbar-thumb:hover,
.directory-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.65);
}
.dir-tab {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.dir-tab:hover { border-color: #38bdf8; color: #fff; }
.dir-tab.active {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  color: #7dd3fc;
}
.directory-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  align-content: start;
}
.dir-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.dir-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.dir-card-head { display: flex; align-items: center; gap: 10px; }
.dir-card-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(160, 120, 255, 0.55);
  background: #02030a;
  flex-shrink: 0;
}
.dir-card-meta { flex: 1; min-width: 0; }
.dir-card-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-card-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}
.dir-fav-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  color: #64748b;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}
.dir-fav-btn.is-fav { color: #facc15; border-color: rgba(250, 204, 21, 0.55); background: rgba(250, 204, 21, 0.12); }
.dir-card-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.dir-card-actions { display: flex; gap: 6px; margin-top: 2px; }
.dir-action-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(192, 132, 252, 0.55);
  background: rgba(124, 58, 237, 0.25);
  color: #e9d5ff;
  transition: all 0.15s;
}
.dir-action-btn:hover { background: rgba(124, 58, 237, 0.55); color: #fff; }
.dir-action-btn.primary {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.25);
  color: #bae6fd;
}
.dir-action-btn.primary:hover { background: rgba(14, 165, 233, 0.55); color: #fff; }

/* ══════════════════════════════════════════
   HOLOGRAPHIC HOLODECK MODAL (UPGRADED)
══════════════════════════════════════════ */
#holodeck-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 15, 0.78);
  backdrop-filter: blur(12px);
  padding: 18px;
}
#holodeck-modal.open {
  display: flex;
  animation: modalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.holo-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 27, 75, 0.95));
  border: 1px solid rgba(160, 120, 255, 0.8);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), inset 0 0 20px rgba(139, 92, 246, 0.15);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.holo-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #a78bfa, #38bdf8, transparent);
  animation: scanLine 3s infinite linear;
}
@keyframes scanLine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.holo-top-btns {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.holo-close, .holo-fav {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.holo-close:hover { background: rgba(239, 68, 68, 0.3); border-color: #ef4444; color: #fff; }
.holo-fav.is-fav { color: #facc15; border-color: rgba(250, 204, 21, 0.7); background: rgba(250, 204, 21, 0.15); }
.holo-header { display: flex; align-items: center; gap: 14px; padding-right: 74px; }
.holo-preview-img {
  width: 74px;
  height: 74px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(160, 120, 255, 0.7);
  box-shadow: 0 0 20px rgba(160, 120, 255, 0.45);
  flex-shrink: 0;
  background: #02030a;
}
.holo-title-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.holo-title { font-family: 'Orbitron', sans-serif; font-size: 17px; font-weight: 900; color: #fff; }
.holo-badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.holo-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #d8b4fe;
  text-transform: uppercase;
}
.holo-badge.dist { background: rgba(14, 165, 233, 0.2); border-color: rgba(56, 189, 248, 0.5); color: #7dd3fc; }
.holo-body {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid #8b5cf6;
}
.holo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.holo-btn {
  flex: 1;
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.holo-btn-warp {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(168, 85, 247, 0.85));
  border: 1px solid rgba(192, 132, 252, 0.8);
  color: #fff;
}
.holo-btn-warp:hover { box-shadow: 0 0 22px rgba(168, 85, 247, 0.7); transform: translateY(-1px); }
.holo-btn-launch {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.85), rgba(37, 99, 235, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.8);
  color: #fff;
}
.holo-btn-launch:hover { box-shadow: 0 0 22px rgba(56, 189, 248, 0.7); transform: translateY(-1px); }
.holo-btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e2e8f0;
}
.holo-btn-copy:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.holo-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #94a3b8;
}
.holo-cycle-btn {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  color: #7dd3fc;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}
.holo-cycle-btn:hover { background: rgba(56, 189, 248, 0.25); color: #fff; }

/* ══════════════════════════════════════════
   PLAYABLE LABS MODAL (STELLAR ASSAULT / TRIPPY / NEURAL / AI HUB)
══════════════════════════════════════════ */
#lab-modal {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(12px);
  padding: 14px;
}
#lab-modal.open { display: flex; }
.lab-shell {
  width: min(960px, 100%);
  height: min(86vh, 690px);
  background: rgba(6, 11, 25, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.65);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 32px rgba(56, 189, 248, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}
#lab-title { font-family: 'Orbitron', sans-serif; font-size: 14px; font-weight: 800; color: #38bdf8; }
#lab-subtitle { font-size: 11px; color: #94a3b8; margin-top: 2px; }
#lab-controls {
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
#lab-controls:empty { display: none; }
.lab-hud-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #e2e8f0;
}
.lab-ctrl-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.lab-ctrl-btn:hover, .lab-ctrl-btn.active { border-color: #38bdf8; color: #fff; background: rgba(14, 165, 233, 0.35); }
.lab-ctrl-btn.primary { border-color: #38bdf8; background: rgba(14, 165, 233, 0.3); color: #bae6fd; }
.lab-ctrl-select {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.lab-slider-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #cbd5e1; }
#lab-stage {
  flex: 1;
  position: relative;
  overflow: auto;
  background: #030712;
  touch-action: pan-y;
}
.lab-canvas { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.lab-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
}
.lab-ai-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lab-ai-head { display: flex; align-items: center; gap: 10px; }
.lab-ai-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.lab-ai-name { font-family: 'Orbitron', sans-serif; font-size: 12.5px; font-weight: 700; color: #fff; }
.lab-ai-cat { font-family: 'Share Tech Mono', monospace; font-size: 10px; color: #c084fc; }
.lab-ai-desc { font-size: 11.5px; color: #cbd5e1; line-height: 1.45; flex: 1; }
.lab-ai-actions { display: flex; gap: 6px; }

/* ══════════════════════════════════════════
   CALLSIGN MODAL, TOOLTIP, TOUR HUD & RADAR
══════════════════════════════════════════ */
#name-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
#name-modal.hidden { display: none !important; }
.name-modal-overlay { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.82); backdrop-filter: blur(8px); }
.name-modal-box {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 27, 75, 0.94));
  border: 1px solid rgba(56, 189, 248, 0.6);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(56, 189, 248, 0.35);
  width: min(340px, 90vw);
  overflow: hidden;
  z-index: 2;
}
.name-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(2, 6, 23, 0.8);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
}
.name-modal-close { background: none; border: none; color: #94a3b8; font-size: 14px; cursor: pointer; padding: 2px 6px; }
.name-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.name-modal-body p { font-size: 11px; color: #cbd5e1; line-height: 1.5; }
.name-input-row { display: flex; gap: 8px; }
#modal-name-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
}
.name-dice-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 0 12px;
}
.name-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.name-cancel-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
}
.name-save-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid rgba(56, 189, 248, 0.6);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
}

#hover-tooltip {
  position: absolute;
  width: 255px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10, 15, 30, 0.94);
  color: #e5e7eb;
  font-size: 11px;
  border: 1px solid rgba(160, 120, 255, 0.65);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  z-index: 120;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 15px rgba(140, 80, 255, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tt-header { display: flex; align-items: center; gap: 10px; }
.tt-img {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(160, 120, 255, 0.6);
  flex-shrink: 0;
  background: #02030a;
}
.tt-title-wrap { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.tt-title { font-family: 'Orbitron', sans-serif; font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-badge { font-family: 'Share Tech Mono', monospace; font-size: 9px; color: #a78bfa; text-transform: uppercase; }
.tt-desc { font-size: 11px; line-height: 1.4; color: #cbd5e1; }
.tt-footer { display: flex; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 6px; font-size: 10px; color: #94a3b8; }
.tt-action { color: #38bdf8; font-weight: 600; }

#boost-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(250, 200, 0, 0.18);
  border: 1px solid rgba(250, 200, 0, 0.7);
  color: #fde68a;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 60;
  box-shadow: 0 0 12px rgba(250, 200, 0, 0.4);
}
#boost-indicator.active { opacity: 1; }

#tour-btn {
  position: absolute;
  bottom: 20px;
  right: 16px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(160, 120, 255, 0.8);
  background: rgba(15, 10, 40, 0.88);
  color: #d8b4fe;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 14px rgba(140, 80, 255, 0.35);
  transition: all 0.15s;
  z-index: 80;
}
#tour-btn:hover, #tour-btn.touring {
  background: rgba(109, 40, 217, 0.92);
  border-color: rgba(196, 160, 255, 1);
  color: #fff;
  transform: translateY(-1px);
}

#tour-hud {
  position: absolute;
  bottom: 62px;
  right: 16px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(10, 5, 30, 0.92);
  border: 1px solid rgba(160, 120, 255, 0.65);
  color: #e9d5ff;
  font-size: 11px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 85;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}
#tour-hud.visible { display: flex; }
#tour-label { font-family: 'Share Tech Mono', monospace; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.tour-mini-btn {
  background: rgba(124, 58, 237, 0.35);
  border: 1px solid rgba(196, 160, 255, 0.55);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  cursor: pointer;
}
.tour-mini-btn:hover { background: rgba(124, 58, 237, 0.75); }

#sector-toast-banner {
  position: absolute;
  bottom: 64px;
  right: 16px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(10, 5, 30, 0.88);
  border: 1px solid rgba(160, 120, 255, 0.5);
  color: #c4b5fd;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 75;
}

#joystick-zone {
  position: absolute;
  bottom: 18px;
  left: 16px;
  width: 140px;
  height: 140px;
  display: none;
  z-index: 50;
  pointer-events: none;
}
#mobile-boost-btn {
  position: absolute;
  bottom: 52px;
  left: 166px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(250, 204, 21, 0.75);
  background: rgba(15, 23, 42, 0.82);
  color: #fde047;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 55;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
}
#mobile-boost-btn.active {
  background: rgba(250, 204, 21, 0.35);
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.8);
  transform: scale(0.95);
}

@media (hover: none) and (pointer: coarse) {
  #joystick-zone { display: block; pointer-events: auto; }
  #mobile-boost-btn { display: flex; }
}

#galaxy-radar {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.86) 0%, rgba(2, 6, 23, 0.96) 100%);
  border: 2px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3), inset 0 0 15px rgba(56, 189, 248, 0.15);
  pointer-events: auto;
  z-index: 60;
  backdrop-filter: blur(4px);
}
#galaxy-radar canvas { width: 100%; height: 100%; display: block; border-radius: 50%; cursor: crosshair; }
.radar-label {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: #38bdf8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

@media (hover: none) and (pointer: coarse) {
  #galaxy-radar {
    bottom: 68px;
    top: auto;
    right: 14px;
    left: auto;
    width: 88px;
    height: 88px;
  }
  #tour-hud,
  #sector-toast-banner {
    bottom: 184px;
    right: 12px;
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
  }
}

#warp-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92) 0%, rgba(99, 102, 241, 0.55) 42%, transparent 80%);
  opacity: 0;
  transition: opacity 0.25s ease-out;
}
#warp-overlay.active { opacity: 1; }

#pwa-toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 10px;
  background: rgba(10, 15, 30, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 20px rgba(56, 189, 248, 0.25);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  z-index: 10006;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#pwa-toast.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
@media (hover: none) and (pointer: coarse) and (min-height: 500px) {
  #pwa-toast { bottom: 244px; }
}
@media (hover: none) and (pointer: coarse) and (max-height: 499px) {
  #pwa-toast { bottom: 16px; }
}
body:has(#lab-modal.open) #pwa-toast { top: 14px; bottom: auto; }
#pwa-toast strong { display: block; margin-bottom: 3px; font-family: 'Orbitron', sans-serif; font-size: 11px; color: #38bdf8; }

/* ══════════════════════════════════════════
   OPT-IN MULTIPLAYER SPACE BATTLE HUD
══════════════════════════════════════════ */
body.battle-mode #boost-indicator {
  bottom: 122px;
}
body.battle-mode #pwa-toast {
  bottom: 132px;
}
@media (hover: none) and (pointer: coarse) and (min-height: 500px) {
  body.battle-mode #pwa-toast { bottom: 244px; }
}

#damage-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  box-shadow: inset 0 0 90px rgba(244, 63, 94, 0.85);
  opacity: 0;
  transition: opacity 0.16s ease;
}
#damage-vignette.active { opacity: 1; }

/* Desktop Free-Look Center Aim Dot (Hidden in Battle Mode & on Touch) */
#center-aim-dot {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(125, 211, 252, 0.85);
  background: rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.75);
  pointer-events: none;
  z-index: 54;
  opacity: 0;
  transition: opacity 0.18s ease;
}
body.pointer-locked:not(.battle-mode) #center-aim-dot {
  opacity: 1;
}

#mouselook-hint {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 15, 30, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #bae6fd;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 260;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}
#mouselook-hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (hover: none) and (pointer: coarse) {
  #center-aim-dot,
  #mouselook-hint {
    display: none !important;
  }
}

#combat-reticle {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
}
#combat-reticle.hidden { display: none !important; }
.reticle-ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.6px solid rgba(56, 189, 248, 0.78);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transition: all 0.12s ease;
}
.reticle-cross-h,
.reticle-cross-v {
  position: absolute;
  background: rgba(56, 189, 248, 0.85);
  transition: background 0.12s ease;
}
.reticle-cross-h { width: 44px; height: 1.5px; }
.reticle-cross-v { width: 1.5px; height: 44px; }
#combat-reticle.locked .reticle-ring {
  width: 40px;
  height: 40px;
  border-color: #f43f5e;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.85);
}
#combat-reticle.locked .reticle-cross-h,
#combat-reticle.locked .reticle-cross-v {
  background: #fb7185;
}
#combat-reticle.hit .reticle-ring {
  border-color: #fde047;
  transform: scale(1.22);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.95);
}
#combat-reticle-label {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fda4af;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

#combat-hud {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 330px;
  max-width: calc(100vw - 24px);
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(18, 10, 28, 0.9);
  border: 1px solid rgba(244, 63, 94, 0.65);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 22px rgba(244, 63, 94, 0.25);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 90;
  pointer-events: auto;
}
#combat-hud.hidden { display: none !important; }
.combat-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  color: #e2e8f0;
}
.combat-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #fb7185;
  letter-spacing: 0.08em;
}
#combat-kd-text { color: #fde047; font-weight: 700; }
#combat-fighters-count { color: #94a3b8; }

.combat-hp-bar {
  position: relative;
  width: 100%;
  height: 17px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
#combat-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.18s ease, background 0.2s ease;
}
#combat-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.combat-hud-actions {
  display: flex;
  gap: 6px;
}
.combat-mini-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #f1f5f9;
  border-radius: 6px;
  padding: 5px 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.combat-mini-btn:hover {
  background: rgba(225, 29, 72, 0.4);
  border-color: #fb7185;
  color: #fff;
}
.combat-mini-btn.active {
  background: rgba(249, 115, 22, 0.32);
  border-color: #fb923c;
  color: #fed7aa;
}

#mobile-fire-btn {
  position: absolute;
  bottom: 74px;
  right: 112px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(251, 113, 133, 0.88);
  background: radial-gradient(circle, rgba(225, 29, 72, 0.72), rgba(136, 19, 55, 0.88));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 65;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.55);
}
#mobile-fire-btn.active {
  transform: scale(0.93);
  background: radial-gradient(circle, rgba(244, 63, 94, 0.95), rgba(190, 18, 60, 0.95));
  box-shadow: 0 0 28px rgba(251, 113, 133, 0.95);
}
@media (hover: none) and (pointer: coarse) {
  body.battle-mode #mobile-fire-btn { display: flex; }
}

#combat-killfeed {
  position: absolute;
  top: 90px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
  z-index: 125;
  max-width: min(310px, calc(100vw - 24px));
}
.killfeed-item {
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #e2e8f0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  backdrop-filter: blur(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.killfeed-item.highlight {
  border-color: #facc15;
  color: #fef08a;
  background: rgba(30, 20, 45, 0.92);
}
.killfeed-item.fading { opacity: 0; transform: translateX(14px); }

#combat-scoreboard {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  padding: 16px;
}
#combat-scoreboard.hidden { display: none !important; }
.scoreboard-box {
  width: min(460px, 100%);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(35, 14, 38, 0.95));
  border: 1px solid rgba(244, 63, 94, 0.65);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 28px rgba(244, 63, 94, 0.25);
}
.scoreboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(2, 6, 23, 0.78);
  border-bottom: 1px solid rgba(244, 63, 94, 0.3);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #fb7185;
}
.scoreboard-body {
  padding: 12px 16px;
  max-height: 50vh;
  overflow-y: auto;
}
.scoreboard-foot {
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
}
.scoreboard-table th {
  text-align: left;
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
  padding: 6px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.scoreboard-table td {
  padding: 7px 6px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.scoreboard-table tr.sb-mine td {
  color: #7dd3fc;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.1);
}

#respawn-overlay {
  position: fixed;
  inset: 0;
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 4, 16, 0.8);
  backdrop-filter: blur(8px);
  padding: 16px;
}
#respawn-overlay.hidden { display: none !important; }
.respawn-card {
  width: min(440px, 100%);
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(24, 10, 26, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(244, 63, 94, 0.78);
  box-shadow: 0 0 40px rgba(244, 63, 94, 0.35);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.respawn-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #fb7185;
  letter-spacing: 0.08em;
}
#respawn-reason {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12.5px;
  color: #cbd5e1;
}
#respawn-countdown {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
}
.respawn-sb {
  margin-top: 6px;
  text-align: left;
  background: rgba(2, 6, 23, 0.55);
  border-radius: 8px;
}

/* ══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (SHORT / TABLET / MOBILE)
══════════════════════════════════════════ */
@media (max-height: 620px) {
  #affizy-ad-wrap { width: 210px; }
  #left-panel { gap: 6px; }
}
@media (max-height: 460px) {
  #affizy-ad-wrap { width: 150px; }
  #combat-hud { width: 290px; bottom: 10px; padding: 6px 9px; gap: 5px; }
  body.battle-mode #boost-indicator { bottom: 102px; }
}

/* Tablet */
@media (max-width: 900px) {
  #left-panel { width: 300px; top: 10px; left: 10px; }
  .left-nav-row { width: 300px; }
  .panel-toggle-btn { font-size: 9.5px; padding: 6px 5px; }
  #top-right-controls { top: 10px; right: 10px; gap: 5px; }
  .main-site-button { font-size: 10.5px; padding: 5px 8px; }
  #jump-wrap { top: 48px; right: 10px; gap: 6px; }
  #sector-select { font-size: 10px; padding: 5px 22px 5px 8px; max-width: 144px; }
  #target-search { width: 136px; font-size: 10.5px; padding: 5px 8px; }
  #target-dropdown { min-width: 265px; max-width: min(320px, 88vw); }
  #combat-hud { width: 296px; }
}

/* Mobile */
@media (max-width: 650px) {
  #splash-content { gap: 8px; }
  #splash-logo { width: 66px; height: 66px; }
  #splash-title { font-size: clamp(24px, 7vw, 38px); }
  #splash-pilot-box { margin-top: 8px; }
  #splash-pilot-input { width: 145px; }
  #splash-enter { margin-top: 8px; padding: 11px 24px; letter-spacing: 0.14em; }

  #install-app-btn { display: none; }
  .btn-text-long { display: none; }

  #top-right-controls { top: 8px; right: 8px; gap: 4px; }
  .main-site-button { font-size: 10px; padding: 5px 7px; }
  #online-explorers-badge { display: none; }

  #jump-wrap { top: 42px; right: 8px; gap: 4px; }
  #sector-select { max-width: 114px; font-size: 10px; padding: 4px 18px 4px 6px; }
  #target-search { width: 114px; font-size: 10px; padding: 4px 6px; }

  #left-panel { width: 256px; top: 8px; left: 8px; }
  .left-nav-row { width: fit-content; max-width: 174px; gap: 4px; }
  .panel-toggle-btn { font-size: 10px; padding: 5px 6px; flex: 0 0 auto; }

  #left-panel > .dropdown-panel:not(.hidden) { margin-top: 38px; }
  #affizy-ad-wrap { width: 168px; margin-top: 38px; }
  #affizy-ad-placeholder { font-size: 9.5px; padding: 6px; }
  #affizy-ad-placeholder .affizy-ph-sub { font-size: 8.5px; }
  #left-panel > .dropdown-panel:not(.hidden) ~ #affizy-ad-wrap { margin-top: 4px; }

  #combat-hud {
    top: 76px;
    right: 8px;
    left: auto;
    bottom: auto;
    transform: none;
    width: min(172px, calc(100vw - 192px));
    padding: 7px 8px;
    gap: 5px;
  }
  .combat-hud-top { font-size: 9px; flex-wrap: wrap; }
  .combat-hud-actions { flex-wrap: wrap; gap: 4px; }
  .combat-mini-btn { font-size: 8.5px; padding: 4px 4px; }
  #combat-killfeed {
    top: 212px;
    left: 8px;
    right: auto;
    align-items: flex-start;
  }
  body.battle-mode #boost-indicator { bottom: 20px; }

  #joystick-zone {
    left: 10px;
    bottom: 14px;
    width: 126px;
    height: 126px;
  }
  #mobile-boost-btn {
    left: 142px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    font-size: 9px;
  }
  #mobile-fire-btn {
    right: 106px;
    bottom: 76px;
    width: 58px;
    height: 58px;
    font-size: 9.5px;
  }
  #galaxy-radar {
    bottom: 66px;
    top: auto;
    right: 12px;
    left: auto;
    width: 84px;
    height: 84px;
  }
  #tour-btn { bottom: 16px; right: 12px; padding: 7px 14px; font-size: 11px; }
  #tour-hud,
  #sector-toast-banner {
    bottom: 180px;
    right: 12px;
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
  }
  #settings-panel { top: 44px; right: 8px; }
  .directory-grid { grid-template-columns: 1fr; }
}
