* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #020205;
  font-family: 'Space Grotesk', sans-serif;
  color: #ffffff;
  user-select: none;
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ui-layer {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.5rem;
  pointer-events: none;
}

header, footer, .main-content, .customizer-container {
  pointer-events: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #00ff66;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff66;
  animation: pulse 2s infinite;
}

.main-content {
  position: absolute;
  top: 10%;
  left: 2rem;
  max-width: 320px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.customizer-container {
  position: absolute;
  top: 22%;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 10;
}

.customizer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.customizer-toggle-btn:hover {
  border-color: #00ffcc;
  color: #00ffcc;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
}

.ship-customizer {
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.2rem;
  backdrop-filter: blur(10px);
  width: 240px;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

.ship-customizer.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.customizer-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: #00ffcc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customizer-group {
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.customizer-label {
  color: #aaa;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.customizer-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 8px;
  color: #ffffff;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}

.customizer-input:focus {
  border-color: #00ffcc;
}

.color-picker-row {
  display: flex;
  gap: 6px;
}

.color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.color-btn:hover {
  transform: scale(1.15);
}

.color-btn.active {
  border-color: #ffffff;
  transform: scale(1.15);
}

.model-select-row {
  display: flex;
  gap: 6px;
}

.model-btn {
  flex: 1;
  padding: 6px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
}

.model-btn.active {
  background: rgba(0, 255, 204, 0.2);
  border-color: #00ffcc;
  color: #00ffcc;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: #777;
}

.moon-label, .ship-nametag {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 6px 12px;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid rgba(0, 255, 204, 0.5);
  color: #00ffcc;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  visibility: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  user-select: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.ship-nametag {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.moon-label:hover {
  border-color: rgba(0, 255, 204, 1);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
}

.moon-label::after, .ship-nametag::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(0, 255, 204, 0.5);
}

.moon-label.music {
  color: #ffaa00;
  border-color: rgba(255, 170, 0, 0.5);
}
.moon-label.music:hover {
  border-color: rgba(255, 170, 0, 1);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}
.moon-label.music::after {
  border-top-color: rgba(255, 170, 0, 0.5);
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

@media (max-width: 768px) {
  .ui-layer { padding: 1.5rem 1rem; }
  .main-content { top: 8%; left: 1rem; }
  .customizer-container { display: none; }
  h2 { font-size: 1.6rem; }
  footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .moon-label { font-size: 0.68rem; padding: 4px 8px; }
}