@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;
}

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

#hud {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 15;
  width: 100vw;
  padding: 0 16px;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
}

.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-start {
  justify-content: flex-start;
  padding: 18px 24px 20px;
  overflow-y: auto;
}

#overlay-start > * {
  flex-shrink: 0;
}

#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;
}

#overlay-start .btn-ghost {
  margin-left: auto;
  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-auth {
  padding: 28px 20px;
}

#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;
  font-size: 13px;
  color: #8ad4ff;
  text-align: center;
}

.auth-msg-error {
  color: #ff8aa8;
}

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

.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;
}

.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 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;
}

.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;
  }
}

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

  #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;
  }
}
