@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Share+Tech+Mono&display=swap");

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

html, body {
  height: 100%;
  background: #050510;
  color: #e8f4ff;
  font-family: "Share Tech Mono", monospace;
  overflow: hidden;
}

#wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #020208;
}

/* Portrait phones: rotate the whole game into synthetic landscape (short edge becomes height). */
html.nebula-virtual-landscape,
html.nebula-virtual-landscape body {
  overflow: hidden;
  touch-action: manipulation;
}

html.nebula-virtual-landscape #wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100vh;
  max-width: 100vh;
  height: 100vw;
  max-height: 100vw;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}

@supports (width: 100dvh) {
  html.nebula-virtual-landscape #wrap {
    width: 100dvh;
    max-width: 100dvh;
    height: 100dvw;
    max-height: 100dvw;
  }
}

#game {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

#hud {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
}

.hud-top {
  width: 100%;
  max-width: min(920px, 100%);
  margin: 0 auto;
}

.hud-row-wave {
  justify-content: center;
}

.hud-vitals {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.07em;
  line-height: 1.35;
  padding: 6px 16px 4px;
  border-radius: 12px;
  background: rgba(2, 8, 20, 0.55);
  border: 1px solid rgba(100, 190, 255, 0.22);
  box-shadow: 0 0 20px rgba(0, 40, 80, 0.45);
  max-width: calc(100vw - 24px);
}

.hud-vitals span {
  white-space: nowrap;
}

.hud-dash-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(100, 190, 255, 0.14);
  width: 100%;
  max-width: 340px;
}

.hud-dash-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(160, 220, 255, 0.75);
  flex-shrink: 0;
}

.hud-dash-track {
  flex: 1 1 auto;
  min-width: 72px;
  max-width: 160px;
  height: 8px;
  border-radius: 999px;
  background: rgba(4, 14, 28, 0.9);
  border: 1px solid rgba(100, 190, 255, 0.2);
  overflow: hidden;
}

.hud-dash-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(40, 160, 255, 0.45), rgba(120, 255, 220, 0.85));
  box-shadow: 0 0 12px rgba(60, 200, 255, 0.35);
  transform-origin: left center;
  transition: width 0.06s linear;
}

.hud-dash-fill.hud-dash-fill--ready {
  background: linear-gradient(90deg, rgba(80, 220, 255, 0.5), rgba(180, 255, 250, 0.95));
  box-shadow: 0 0 14px rgba(100, 240, 255, 0.45);
}

.hud-dash-time {
  font-size: 12px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: rgba(210, 245, 255, 0.92);
  min-width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.hud-meta-row {
  margin-top: 6px;
  font-size: 13px;
  color: #b8e4ff;
}

.hud-progress {
  position: relative;
  margin-top: 8px;
  height: 16px;
  border: 1px solid rgba(110, 190, 255, 0.28);
  background: rgba(4, 14, 28, 0.78);
  border-radius: 999px;
  overflow: hidden;
}

.hud-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(70, 180, 255, 0.92), rgba(80, 255, 220, 0.92));
  box-shadow: 0 0 18px rgba(70, 210, 255, 0.35);
}

.hud-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #e4faff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
}

#hud-boss {
  margin-top: 8px;
  text-align: center;
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #ff3366;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.02); }
}

.hidden {
  display: none !important;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 12, 0.82);
  backdrop-filter: blur(4px);
}

#overlay-auth {
  z-index: 100;
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
  padding: 28px 20px;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  overflow-y: auto;
}

#overlay-pilot-name {
  z-index: 110;
  isolation: isolate;
  padding: 28px 20px;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  overflow-y: auto;
}

#overlay-pilot-name .auth-label {
  width: min(360px, calc(100vw - 40px));
}

#overlay-start {
  justify-content: flex-start;
  align-items: stretch;
  align-content: stretch;
  padding: 0;
  overflow: hidden;
}

#overlay-start .hangar-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 24px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

#overlay-start #btn-start {
  flex-shrink: 0;
  align-self: center;
  width: calc(100% - 32px);
  max-width: min(960px, calc(100% - 32px));
  margin: 10px auto max(14px, env(safe-area-inset-bottom, 14px));
  position: relative;
  z-index: 3;
}

/* Desktop-only hangar chat. Mobile often reports pointer:fine, so require real hover
   and hide touch-primary + nebula phone layout explicitly. */
.hangar-chat {
  display: none !important;
}

@media (min-width: 1024px) and (pointer: fine) and (hover: hover) {
  html:not(.nebula-phone-ui) .hangar-chat {
    display: flex !important;
  }
}

html.nebula-phone-ui .hangar-chat,
html.nebula-virtual-landscape .hangar-chat {
  display: none !important;
}

@media (pointer: coarse) {
  #wrap .hangar-chat {
    display: none !important;
  }
}

#overlay-start .hangar-chat {
  position: absolute;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  z-index: 25;
  flex-direction: column;
  width: min(320px, calc(100vw - 360px));
  min-width: 260px;
  max-height: min(52vh, 420px);
  border-radius: 14px;
  border: 1px solid rgba(110, 200, 255, 0.28);
  background: rgba(4, 12, 26, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  overflow: hidden;
  pointer-events: auto;
}

.hangar-chat-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(8, 24, 48, 0.85);
  border-bottom: 1px solid rgba(100, 180, 255, 0.18);
  flex-shrink: 0;
}

.hangar-chat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hangar-chat-presence {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(160, 210, 245, 0.85);
  border-radius: 8px;
  background: rgba(2, 10, 22, 0.65);
  border: 1px solid rgba(80, 150, 220, 0.18);
  padding: 2px 8px 8px;
}

.hangar-chat-presence-summary {
  cursor: pointer;
  padding: 6px 4px 4px;
  list-style: none;
  font-family: "Share Tech Mono", monospace;
}

.hangar-chat-presence-summary::-webkit-details-marker {
  display: none;
}

.hangar-chat-presence-summary::before {
  content: "▸ ";
  opacity: 0.65;
  font-size: 9px;
}

.hangar-chat-presence[open] .hangar-chat-presence-summary::before {
  content: "▾ ";
}

.hangar-chat-presence--inactive {
  opacity: 0.72;
}

.hangar-chat-online-list {
  margin: 4px 0 0;
  padding: 4px 6px 2px 18px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(200, 235, 255, 0.92);
}

.hangar-chat-online-list li {
  margin-bottom: 2px;
}

.hangar-chat-title {
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(190, 235, 255, 0.95);
}

.hangar-chat-toggle {
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 200, 255, 0.35);
  background: rgba(20, 60, 100, 0.35);
  color: rgba(210, 245, 255, 0.9);
  cursor: pointer;
}

.hangar-chat-toggle:hover {
  background: rgba(30, 90, 130, 0.45);
  border-color: rgba(160, 230, 255, 0.5);
}

.hangar-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 10px 10px;
}

.hangar-chat--collapsed .hangar-chat-body {
  display: none;
}

.hangar-chat-owner-line {
  margin: 0;
  padding: 0 2px 2px;
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.35;
  color: rgba(170, 210, 245, 0.72);
  font-family: "Share Tech Mono", monospace;
}

.hangar-chat-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-top: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(60, 100, 140, 0.15);
}

.hangar-chat-line-main {
  flex: 1 1 auto;
  min-width: 0;
}

.hangar-chat-badge {
  display: inline-block;
  margin: 0 4px 0 2px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: middle;
  color: #0a1020;
  background: linear-gradient(180deg, #ffe08a, #e8b030);
  border: 1px solid rgba(255, 220, 140, 0.6);
}

.hangar-chat-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}

.hangar-chat-actions button {
  font-family: "Share Tech Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(120, 180, 255, 0.35);
  background: rgba(12, 32, 56, 0.75);
  color: rgba(200, 230, 255, 0.9);
  cursor: pointer;
  pointer-events: auto;
}

.hangar-chat-actions button:hover {
  border-color: rgba(180, 220, 255, 0.55);
  background: rgba(24, 56, 88, 0.85);
}

.hangar-chat-actions .hangar-chat-btn-ban {
  border-color: rgba(255, 120, 100, 0.45);
  color: rgba(255, 200, 190, 0.95);
}

.hangar-chat-form--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hangar-chat-messages {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(210, 235, 255, 0.92);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.5);
}

.hangar-chat-line + .hangar-chat-line {
  margin-top: 8px;
}

.hangar-chat-time {
  color: rgba(140, 180, 210, 0.65);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.hangar-chat-who {
  color: rgba(120, 220, 255, 0.95);
  font-weight: 700;
}

.hangar-chat-who-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: rgba(140, 235, 255, 0.98);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hangar-chat-who-link:hover {
  color: #ffffff;
}

.hangar-chat-online-pilot {
  cursor: pointer;
  color: rgba(150, 230, 255, 0.95);
}

.hangar-chat-online-pilot:hover {
  text-decoration: underline;
}

.hangar-chat-text {
  color: rgba(230, 245, 255, 0.9);
  word-break: break-word;
}

.hangar-chat-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.hangar-chat-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(100, 170, 255, 0.28);
  background: rgba(4, 14, 28, 0.85);
  color: #e8f4ff;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
}

.hangar-chat-form button[type="submit"] {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(100, 200, 255, 0.4);
  background: rgba(30, 100, 160, 0.4);
  color: rgba(220, 245, 255, 0.95);
  font-family: Orbitron, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.hangar-chat-form button[type="submit"]:hover {
  background: rgba(40, 120, 190, 0.5);
}

#overlay-start h1 {
  margin-bottom: 8px;
}

#overlay-start .sub {
  max-width: 700px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.35;
}

#overlay-start .menu-stats {
  gap: 8px;
  width: min(960px, calc(100vw - 36px));
  margin-bottom: 12px;
}

#overlay-start .menu-stat {
  padding: 9px 10px;
}

#overlay-start .menu-grid {
  grid-template-columns: minmax(300px, 395px) minmax(360px, 500px);
  gap: 12px;
  width: min(960px, calc(100vw - 36px));
  margin-bottom: 14px;
}

#overlay-start .menu-panel {
  padding: 14px;
}

#overlay-start .menu-panel h3 {
  margin-bottom: 8px;
  font-size: 0.88rem;
}

#overlay-start .menu-note {
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.35;
}

#overlay-start .ship-picker {
  gap: 8px;
  margin-bottom: 14px;
}

#overlay-start .ship-stats-panel {
  margin-bottom: 14px;
}

#overlay-start .ship-btn {
  padding: 8px 12px;
  font-size: 0.68rem;
}

#overlay-start .color-picker,
#overlay-start .meta-upgrades,
#overlay-start .attachment-shop {
  gap: 8px;
}

#overlay-start .color-card,
#overlay-start .meta-card,
#overlay-start .attachment-card {
  padding: 9px 10px;
}

#overlay-start #btn-start {
  margin-bottom: 6px;
  padding: 12px 32px;
}

.menu-account-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: min(960px, calc(100vw - 36px));
  margin: 0 auto 14px;
  padding: 8px 12px;
  border: 1px solid rgba(90, 180, 255, 0.2);
  border-radius: 8px;
  background: rgba(6, 16, 32, 0.55);
  font-size: 13px;
}

.menu-account-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  color: #8fb0c6;
}

.menu-account-name {
  color: #9ff2ff;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.menu-account-spacer {
  flex: 1 1 auto;
  min-width: 6px;
}

#overlay-start #btn-sign-out.btn-ghost {
  margin-left: 0;
}

#overlay-start .btn-ghost {
  margin-left: 0;
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  border-width: 1px;
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.12);
}

#overlay-start .btn-ghost.btn-hangar-bar {
  padding: 6px 12px;
}

#overlay-auth .auth-brand {
  margin-bottom: 4px;
}

#overlay-auth .auth-sub {
  max-width: 28rem;
  margin-bottom: 8px;
}

.auth-msg {
  min-height: 1.35rem;
  margin: 4px 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #8ad4ff;
  text-align: center;
  border-radius: 6px;
  border: 1px solid transparent;
  max-width: 340px;
}

.auth-msg:empty {
  display: none;
}

.auth-msg-error {
  color: #ffd0dc;
  background: rgba(80, 12, 28, 0.88);
  border-color: rgba(255, 90, 130, 0.55);
  box-shadow: 0 0 16px rgba(255, 60, 100, 0.2);
}

.auth-msg-ok {
  color: #c8ffe8;
  background: rgba(8, 48, 36, 0.75);
  border-color: rgba(80, 220, 160, 0.35);
}

.auth-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  pointer-events: auto;
}

.auth-help {
  font-size: 12px;
  line-height: 1.4;
  color: #8fa9bb;
  margin: 0 0 4px;
  max-width: 20rem;
  text-align: center;
}

.auth-heading {
  font-family: Orbitron, sans-serif;
  font-size: 1.15rem;
  color: #ffb347;
  margin-bottom: 2px;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fa9bb;
}

.auth-label input {
  text-transform: none;
  padding: 11px 12px;
  border-radius: 6px;
  border: 1px solid rgba(90, 160, 255, 0.35);
  background: rgba(4, 12, 24, 0.96);
  color: #e8f4ff;
  font-family: "Share Tech Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.auth-primary {
  margin-top: 6px;
  min-height: 48px;
  padding: 14px 22px;
  -webkit-tap-highlight-color: rgba(124, 240, 255, 0.15);
}

.auth-switch {
  text-align: center;
  margin-top: 4px;
}

.link-btn {
  font-family: "Share Tech Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 0;
  border: none;
  background: none;
  color: #7cf0ff;
  box-shadow: none;
  text-decoration: underline;
}

.link-btn:hover {
  transform: none;
  box-shadow: none;
  color: #aff;
}

@media (max-width: 560px) {
  .menu-account-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #overlay-start .btn-ghost {
    margin-left: 0;
  }
}

#overlay-start .submenu-tabs {
  margin-bottom: 10px;
}

.overlay button,
#overlay-auth button,
#overlay-auth input,
#overlay-pilot-name button,
#overlay-pilot-name input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(124, 240, 255, 0.12);
}

#overlay-auth button,
#overlay-pilot-name button {
  cursor: pointer;
}

.overlay h1 {
  font-family: Orbitron, sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.15em;
  color: #7cf0ff;
  text-shadow: 0 0 24px rgba(0, 255, 255, 0.5);
  margin-bottom: 12px;
}

.overlay h2 {
  font-family: Orbitron, sans-serif;
  font-size: 1.5rem;
  color: #ffb347;
  margin-bottom: 8px;
}

.sub {
  max-width: 520px;
  text-align: center;
  color: #9ab;
  margin-bottom: 24px;
  line-height: 1.5;
}

.menu-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  width: min(960px, calc(100vw - 48px));
  margin-bottom: 18px;
}

.menu-stat {
  padding: 12px 14px;
  border: 1px solid rgba(90, 180, 255, 0.25);
  background: rgba(8, 22, 42, 0.74);
  border-radius: 8px;
  text-align: center;
}

.menu-stat-label {
  display: block;
  font-size: 11px;
  color: #8fb0c6;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.menu-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(380px, 520px);
  gap: 18px;
  align-items: start;
  width: min(980px, calc(100vw - 48px));
  margin-bottom: 22px;
}

.menu-panel {
  padding: 18px;
  border: 1px solid rgba(90, 180, 255, 0.2);
  background: linear-gradient(180deg, rgba(8, 20, 36, 0.82), rgba(3, 12, 24, 0.92));
  border-radius: 12px;
  box-shadow: inset 0 0 40px rgba(0, 180, 255, 0.05);
}

.menu-panel h3 {
  font-family: Orbitron, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: #9ff2ff;
  margin-bottom: 10px;
}

.submenu-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.submenu-tab {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.submenu-tab.active {
  border-color: #6fc;
  color: #8ff;
  box-shadow: 0 0 18px rgba(0, 255, 220, 0.2);
}

.hangar-pane {
  min-height: 0;
}

html.nebula-phone-ui #hangar-tabs.submenu-tabs {
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-bottom: 10px;
}

html.nebula-phone-ui #hangar-tabs .submenu-tab {
  flex: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  text-align: left;
}

html.nebula-phone-ui #hangar-tabs .submenu-tab::after {
  content: "▸";
  font-size: 11px;
  opacity: 0.55;
  flex-shrink: 0;
  margin-left: 10px;
}

html.nebula-phone-ui #hangar-tabs .submenu-tab.active::after {
  content: "▾";
  opacity: 0.85;
}

.menu-note {
  font-size: 12px;
  color: #8fa9bb;
  line-height: 1.5;
  margin-bottom: 12px;
}

button {
  pointer-events: auto;
  font-family: Orbitron, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  padding: 14px 36px;
  border: 2px solid #3de;
  background: linear-gradient(180deg, rgba(0, 80, 120, 0.4), rgba(0, 20, 40, 0.9));
  color: #dff;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.25);
  transition: transform 0.12s, box-shadow 0.12s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(0, 255, 255, 0.45);
}

#upgrade-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  max-width: 900px;
  pointer-events: auto;
}

.upgrade-card {
  width: 240px;
  padding: 16px;
  border: 1px solid #3a6;
  background: rgba(0, 30, 40, 0.85);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s;
}

.upgrade-card:hover {
  border-color: #6fc;
  transform: scale(1.03);
}

.upgrade-card h3 {
  font-family: Orbitron, sans-serif;
  font-size: 0.95rem;
  color: #8f8;
  margin-bottom: 8px;
}

.upgrade-card p {
  font-size: 12px;
  color: #abc;
  line-height: 1.45;
}

.ship-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  max-width: 640px;
}

.ship-btn {
  font-family: Orbitron, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  border: 1px solid rgba(100, 200, 255, 0.35);
  background: rgba(0, 25, 45, 0.75);
  color: #bde;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.ship-btn span {
  display: block;
  margin-top: 4px;
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  color: #8fb7cd;
}

.ship-btn:hover {
  border-color: rgba(120, 255, 255, 0.6);
  color: #eff;
}

.ship-btn.selected {
  border-color: #6fc;
  box-shadow: 0 0 18px rgba(0, 255, 220, 0.25);
  color: #8ff;
}

.ship-btn.locked {
  border-color: rgba(170, 120, 120, 0.35);
  color: #c9b7bd;
}

.ship-btn.locked span {
  color: #c1a6ae;
}

.ship-btn.available {
  border-color: rgba(255, 210, 110, 0.55);
  box-shadow: 0 0 14px rgba(255, 205, 90, 0.16);
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.ship-stats-panel {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.pause-stats-panel {
  width: min(540px, calc(100vw - 48px));
  margin-bottom: 16px;
}

.ship-stat {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #cfe8f8;
}

.ship-stat-label,
.ship-stat-value {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ec4d8;
}

.ship-stat-value {
  color: #e6fbff;
  text-align: right;
}

.ship-stat-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16, 36, 54, 0.88);
  border: 1px solid rgba(100, 180, 255, 0.14);
}

.ship-stat-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(80, 180, 255, 0.95), rgba(92, 255, 220, 0.95));
  box-shadow: 0 0 12px rgba(80, 220, 255, 0.26);
}

.color-card {
  border: 1px solid rgba(100, 180, 255, 0.25);
  background: rgba(10, 24, 42, 0.7);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.color-card:hover {
  transform: translateY(-1px);
  border-color: rgba(140, 240, 255, 0.45);
}

.color-card.locked {
  opacity: 0.8;
}

.color-card.selected {
  border-color: #6fc;
  box-shadow: 0 0 18px rgba(0, 255, 220, 0.18);
}

.color-swatch {
  width: 100%;
  height: 26px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.color-name {
  font-size: 12px;
  color: #d9eef7;
}

.color-cost {
  margin-top: 4px;
  font-size: 11px;
  color: #88a9bf;
}

.meta-upgrades {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 10px;
}

.attachment-shop {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.meta-card {
  border: 1px solid rgba(100, 180, 255, 0.18);
  background: rgba(8, 20, 36, 0.78);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.meta-card:hover {
  transform: translateY(-1px);
  border-color: rgba(140, 240, 255, 0.4);
}

.meta-card.maxed {
  opacity: 0.72;
}

.attachment-card {
  border: 1px solid rgba(100, 180, 255, 0.18);
  background: rgba(8, 20, 36, 0.78);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, opacity 0.12s;
}

.attachment-card:hover {
  transform: translateY(-1px);
  border-color: rgba(140, 240, 255, 0.4);
}

.attachment-card.installed {
  border-color: rgba(110, 255, 200, 0.42);
  box-shadow: 0 0 16px rgba(0, 255, 180, 0.1);
}

.attachment-card.unaffordable {
  opacity: 0.78;
}

.attachment-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fb2c8;
  margin-bottom: 6px;
}

.attachment-card h4 {
  font-family: Orbitron, sans-serif;
  font-size: 0.82rem;
  color: #c9fbff;
  margin-bottom: 6px;
}

.attachment-desc {
  font-size: 11px;
  line-height: 1.4;
  color: #b0c7d8;
}

.attachment-cost {
  margin-top: 8px;
  font-size: 11px;
  color: #d7faff;
}

.attachment-rarity {
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.rarity-common { color: #9db8c7; }
.rarity-uncommon { color: #72f0b1; }
.rarity-rare { color: #6fb9ff; }
.rarity-epic { color: #cd90ff; }
.rarity-legendary { color: #ffd06d; }

.meta-card h4 {
  font-family: Orbitron, sans-serif;
  font-size: 0.8rem;
  color: #bafcff;
  margin-bottom: 6px;
}

.meta-rank,
.meta-cost {
  font-size: 11px;
  color: #8ea9bb;
  margin-top: 6px;
}

.overlay-actions {
  display: flex;
  gap: 12px;
}

.overlay-actions-stack {
  flex-direction: column;
  min-width: min(320px, calc(100vw - 48px));
}

.overlay-actions-stack button {
  width: 100%;
}

@media (max-width: 900px) {
  .menu-stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .ship-stats-panel {
    grid-template-columns: 1fr;
  }

  .meta-upgrades,
  .color-picker {
    grid-template-columns: 1fr;
  }
}

/* Phones: hangar uses full rotated/shorter width — avoid 100vw clipping */
html.nebula-phone-ui #overlay-start .hangar-body {
  padding: 10px 12px 8px;
}

html.nebula-phone-ui #overlay-start #btn-start {
  width: calc(100% - 24px);
  margin-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  padding: 11px 26px;
  font-size: 0.82rem;
}

html.nebula-phone-ui #overlay-start .menu-stats,
html.nebula-phone-ui #overlay-start .menu-grid,
html.nebula-phone-ui #overlay-start .menu-account-bar {
  width: 100%;
  max-width: none;
}

html.nebula-phone-ui #overlay-start h1 {
  font-size: clamp(1.2rem, 4.5vw, 1.85rem);
  margin-bottom: 6px;
}

html.nebula-phone-ui #overlay-start .sub {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 10px;
}

html.nebula-phone-ui #overlay-start .menu-stat {
  padding: 7px 8px;
  font-size: 11px;
}

html.nebula-phone-ui #overlay-start .menu-panel {
  padding: 10px 11px;
}

html.nebula-phone-ui #overlay-start .ship-picker {
  gap: 8px;
  margin-bottom: 12px;
  max-width: none;
}

/* Natural landscape on phone: two hangar columns when horizontal space allows */
html.nebula-phone-ui:not(.nebula-virtual-landscape) #overlay-start .menu-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  html.nebula-phone-ui:not(.nebula-virtual-landscape) #overlay-start .menu-grid {
    grid-template-columns: 1fr;
  }
}

/* Synthetic landscape (portrait hold): wide wrap → two columns */
html.nebula-phone-ui.nebula-virtual-landscape #overlay-start .menu-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

@media (max-width: 380px) {
  html.nebula-phone-ui.nebula-virtual-landscape #overlay-start .menu-grid {
    grid-template-columns: 1fr;
  }
}

html.nebula-phone-ui #overlay-auth,
html.nebula-phone-ui #overlay-pilot-name {
  padding: 20px 14px;
}

@media (max-height: 860px) {
  #overlay-start .hangar-body {
    padding-top: 14px;
    padding-bottom: 8px;
  }

  #overlay-start h1 {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    margin-bottom: 6px;
  }

  #overlay-start .sub {
    margin-bottom: 10px;
    font-size: 12px;
  }

  #overlay-start .menu-stats {
    margin-bottom: 10px;
  }

  #overlay-start .menu-stat {
    padding: 8px 9px;
  }

  #overlay-start .menu-grid {
    gap: 10px;
    margin-bottom: 12px;
  }

  #overlay-start .menu-panel {
    padding: 12px;
  }

  #overlay-start .ship-picker {
    margin-bottom: 10px;
  }

  #overlay-start .ship-stats-panel {
    margin-bottom: 10px;
  }

  #overlay-start .submenu-tabs {
    margin-bottom: 8px;
  }

  .submenu-tab {
    padding: 8px 10px;
    font-size: 0.66rem;
  }

  .ship-stat {
    gap: 6px;
    font-size: 10px;
  }

  .ship-stat {
    grid-template-columns: 50px 1fr auto;
  }

  #overlay-start .color-swatch {
    height: 22px;
    margin-bottom: 6px;
  }

  #overlay-start .meta-card h4 {
    font-size: 0.76rem;
  }

  #overlay-start #btn-start {
    padding: 10px 28px;
  }
}

/* —— Mobile touch controls ——
   Must NOT cover auth/menus: invisible .touch-btn had pointer-events:auto and stole taps on iOS.
   Layer is shown only while .mobile-playing (see updateMobilePlayMode in main.js). */
.mobile-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mobile-controls.mobile-active.mobile-playing {
  display: block;
}

.mobile-controls.mobile-playing .touch-pad,
.mobile-controls.mobile-playing .touch-actions {
  pointer-events: auto;
}

.mobile-ui-toggle {
  pointer-events: auto;
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 14;
  padding: 8px 12px;
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: 1px solid rgba(120, 200, 255, 0.22);
  background: rgba(4, 14, 28, 0.35);
  color: rgba(200, 235, 255, 0.55);
  box-shadow: none;
  opacity: 0.42;
}

.mobile-controls.touch-ui-show .mobile-ui-toggle {
  opacity: 0.72;
  color: rgba(220, 245, 255, 0.9);
  border-color: rgba(120, 220, 255, 0.45);
}

.touch-pad {
  position: absolute;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: 132px;
  height: 132px;
  pointer-events: none;
}

.joystick-zone.touch-pad {
  display: block;
}

.joystick-base {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(6, 20, 40, 0.32);
  border: 1px solid rgba(100, 190, 255, 0.22);
  touch-action: none;
  cursor: grab;
}

.joystick-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(120, 200, 255, 0.14);
  pointer-events: none;
}

.joystick-knob {
  position: absolute;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  margin-top: -23px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: rgba(70, 190, 255, 0.4);
  border: 2px solid rgba(160, 235, 255, 0.55);
  box-shadow: 0 0 14px rgba(0, 200, 255, 0.3);
  pointer-events: none;
  transform: translate(0px, 0px);
  will-change: transform;
}

.touch-actions {
  position: absolute;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.touch-btn {
  pointer-events: none;
  touch-action: none;
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  border-radius: 50%;
  border: 1px solid rgba(100, 190, 255, 0.2);
  background: rgba(6, 20, 40, 0.28);
  color: rgba(180, 230, 255, 0.35);
  box-shadow: none;
  transition: opacity 0.15s ease, background 0.12s ease;
  opacity: 0.14;
}

.mobile-controls.mobile-playing .touch-btn {
  pointer-events: auto;
}

.touch-dir {
  width: 52px;
  height: 52px;
  padding: 0;
  font-size: 14px;
  border-radius: 12px;
}

.touch-dash {
  width: 64px;
  height: 64px;
}

.mobile-controls.mobile-playing.touch-ui-show .touch-btn#touch-btn-dash.touch-dash-on-cd,
.mobile-controls.mobile-playing.touch-ui-hide .touch-btn#touch-btn-dash.touch-dash-on-cd {
  opacity: 0.22;
  filter: saturate(0.7);
}

.touch-fire {
  width: 78px;
  height: 78px;
  font-size: 12px;
}

.mobile-controls.touch-ui-show .touch-btn {
  opacity: 0.5;
  color: rgba(210, 245, 255, 0.85);
  border-color: rgba(110, 210, 255, 0.38);
  background: rgba(8, 28, 52, 0.45);
}

.mobile-controls.touch-ui-hide .joystick-base {
  opacity: 0.2;
  border-color: rgba(100, 180, 255, 0.08);
}

.mobile-controls.touch-ui-hide .joystick-knob {
  opacity: 0.25;
}

.mobile-controls.touch-ui-show .joystick-base {
  opacity: 1;
}

.mobile-controls.touch-ui-hide .touch-btn {
  opacity: 0;
  color: transparent;
  border-color: rgba(100, 180, 255, 0.06);
  background: rgba(4, 12, 24, 0.12);
}

.mobile-controls.touch-ui-hide .touch-btn:active,
.mobile-controls.touch-ui-show .touch-btn:active {
  background: rgba(20, 60, 90, 0.55);
}

body.mobile-touch-mode {
  touch-action: manipulation;
  overscroll-behavior: none;
}

/* Career / friends / pilot profile */
.career-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 14px;
  margin: 10px 0 16px;
}

.career-stat {
  background: rgba(8, 20, 40, 0.55);
  border: 1px solid rgba(100, 180, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.career-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(180, 220, 255, 0.65);
}

.career-stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8f8ff;
}

.friends-list .friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(80, 140, 200, 0.12);
}

.link-friend-name {
  background: none;
  border: none;
  padding: 0;
  color: #8ae8ff;
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-friend-name:hover {
  color: #d4f8ff;
}

.friend-remove {
  flex-shrink: 0;
}

.loot-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: rgba(210, 235, 255, 0.88);
}

.loot-log-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(80, 140, 200, 0.1);
}

.loot-log-list .loot-rarity {
  display: inline-block;
  min-width: 5.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.loot-wave {
  float: right;
  opacity: 0.55;
  font-size: 0.72rem;
}

.pilot-profile-overlay {
  z-index: 60;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 22, 0.72);
}

.pilot-profile-dialog {
  position: relative;
  width: min(420px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 22px 18px;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(16, 36, 64, 0.96), rgba(8, 14, 28, 0.98));
  border: 1px solid rgba(120, 200, 255, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.pilot-profile-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(120, 200, 255, 0.2);
  background: rgba(8, 20, 40, 0.5);
  color: #dff6ff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pilot-profile-title {
  margin: 0 40px 6px 0;
  font-size: 1.35rem;
}

.pilot-profile-sub {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: rgba(180, 220, 255, 0.72);
}

.pilot-profile-stats .career-stats-grid {
  margin-top: 0;
}

.pilot-profile-actions {
  margin-top: 16px;
}

.pilot-profile-actions .auth-primary {
  width: 100%;
}

.hangar-self-loot-heading {
  margin: 18px 0 0;
  font-size: 1rem;
}

.hangar-self-loot-note {
  margin-top: 4px;
  margin-bottom: 8px;
}

.hangar-friends-dialog.pilot-profile-dialog {
  width: min(760px, 96vw);
  max-height: 90vh;
}

.hangar-friends-layout {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(280px, 1.4fr);
  gap: 16px 20px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .hangar-friends-layout {
    grid-template-columns: 1fr;
  }
}

.hangar-friends-side-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(160, 210, 255, 0.75);
}

.hangar-friends-dm-peer {
  margin-bottom: 8px;
}

.hangar-dm-messages {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(4, 14, 28, 0.55);
  border: 1px solid rgba(100, 180, 255, 0.14);
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.hangar-dm-line {
  margin-bottom: 8px;
  line-height: 1.35;
}

.hangar-dm-line.hangar-dm-me .hangar-dm-who {
  color: #7cf0c2;
}

.hangar-dm-who {
  display: inline-block;
  min-width: 4.5rem;
  font-weight: 700;
  color: #9ad8ff;
  margin-right: 6px;
}

.hangar-dm-text {
  color: rgba(220, 240, 255, 0.92);
}

.hangar-dm-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.hangar-dm-form input {
  flex: 1;
  min-width: 0;
}

.hangar-incoming-gifts {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.82rem;
}

.hangar-gift-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(80, 140, 200, 0.12);
}

.hangar-gift-meta {
  flex: 1;
  min-width: 0;
}

.hangar-gift-from {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  opacity: 0.75;
}

.hangar-gift-send-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.hangar-gift-send-row select {
  flex: 1;
  min-width: 160px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(100, 180, 255, 0.2);
  background: rgba(6, 16, 32, 0.75);
  color: #e8f4ff;
}

.hangar-friends-dm-status {
  margin-top: 8px;
  min-height: 1.2em;
}

.friend-profile-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 4px 8px;
}

.ship-salvage-sub {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}

.ship-salvage-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ship-salvage-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 22, 44, 0.55);
  border: 1px solid rgba(100, 180, 255, 0.14);
}

.ship-salvage-slot-label {
  min-width: 8.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(150, 200, 255, 0.85);
}

.ship-salvage-slot-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ship-salvage-slot-name {
  color: rgba(220, 240, 255, 0.95);
  font-size: 0.88rem;
}

.ship-salvage-inventory {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ship-salvage-inv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(6, 18, 36, 0.45);
  border: 1px solid rgba(80, 140, 200, 0.12);
}

.ship-salvage-inv-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
}

.ship-salvage-inv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ship-salvage-slot-pick {
  min-width: 140px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(100, 180, 255, 0.2);
  background: rgba(6, 16, 32, 0.75);
  color: #e8f4ff;
  font-size: 0.8rem;
}

.btn-compact {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.ship-salvage-tip-target {
  cursor: help;
  outline: none;
}

.salvage-tooltip {
  position: fixed;
  z-index: 120;
  max-width: min(340px, 94vw);
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(10, 24, 48, 0.97);
  border: 1px solid rgba(120, 200, 255, 0.32);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  font-size: 0.8rem;
  line-height: 1.42;
  color: rgba(220, 244, 255, 0.95);
}

.salvage-tooltip.hidden {
  display: none !important;
}

.salvage-tooltip-head {
  margin-bottom: 6px;
  font-weight: 600;
  color: #e8f8ff;
}

.salvage-tooltip-tier {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.82;
  font-size: 0.78rem;
  font-weight: 500;
}

.salvage-tooltip-ul {
  margin: 0;
  padding-left: 18px;
}

.salvage-tooltip-ul li {
  margin: 4px 0;
}

.hangar-gift-effect-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(6, 18, 36, 0.55);
  border: 1px solid rgba(100, 180, 255, 0.14);
  font-size: 0.8rem;
}

.hangar-gift-effect-preview .salvage-tooltip-head {
  margin-top: 4px;
}

.hangar-gift-preview-label {
  margin: 0 0 6px;
  font-size: 0.74rem;
  color: rgba(160, 210, 255, 0.78);
}

.hangar-gift-effect-preview.hidden {
  display: none !important;
}
