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

body {
  overflow: hidden;
  background: #0a0e27;
  font-family: 'JetBrains Mono', monospace;
  color: #e0e0e0;
  user-select: none;
}

#scene-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

#hud-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10,14,39,0.92) 0%, rgba(10,14,39,0) 100%);
  pointer-events: none;
}

#game-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #00d4ff, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

#mode-badge {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(0,212,255,0.15);
  border: 1px solid #00d4ff;
  color: #00d4ff;
  letter-spacing: 2px;
  animation: badge-glow 2s infinite alternate;
}

@keyframes badge-glow {
  0% { box-shadow: 0 0 5px rgba(0,212,255,0.3); }
  100% { box-shadow: 0 0 15px rgba(0,212,255,0.6); }
}

/* BUILD UI */
#build-ui {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 50;
  pointer-events: none;
}

#build-ui > * { pointer-events: auto; }

#parts-panel {
  position: absolute;
  left: 10px;
  top: 60px;
  bottom: 80px;
  width: 200px;
  background: rgba(10,14,39,0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 12px;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

#parts-panel::-webkit-scrollbar { width: 4px; }
#parts-panel::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.3); border-radius: 2px; }

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: #00d4ff;
  margin-bottom: 10px;
  text-align: center;
}

.part-category {
  margin-bottom: 8px;
}

.category-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #ff6b35;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.part-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #ccc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.part-btn:hover {
  background: rgba(0,212,255,0.12);
  border-color: rgba(0,212,255,0.4);
  color: #fff;
  transform: translateX(3px);
}

.part-btn .part-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}

.part-btn .part-info {
  flex: 1;
  min-width: 0;
}

.part-btn .part-name {
  font-weight: 700;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.part-btn .part-stats {
  font-size: 8px;
  color: #888;
  margin-top: 1px;
}

#stats-panel {
  position: absolute;
  right: 10px;
  top: 60px;
  width: 190px;
  background: rgba(10,14,39,0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 12px;
  padding: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-label { color: #888; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { color: #fff; font-weight: 700; }
.stat-value.green { color: #00ff88; }
.stat-value.yellow { color: #ffcc00; }
.stat-value.red { color: #ff3344; }

.rating-stars {
  font-size: 14px;
  letter-spacing: 2px;
  text-align: center;
  padding: 8px 0 4px;
}

#launch-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 3px;
  padding: 14px 48px;
  background: linear-gradient(135deg, #ff3344, #ff6b35);
  border: 2px solid #ff6b35;
  border-radius: 50px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  animation: pulse-launch 1.5s infinite;
}

#launch-btn:hover {
  transform: translateX(-50%) scale(1.08);
  box-shadow: 0 0 40px rgba(255,107,53,0.6);
}

#launch-btn:disabled {
  opacity: 0.3;
  animation: none;
  cursor: not-allowed;
}

@keyframes pulse-launch {
  0%, 100% { box-shadow: 0 0 15px rgba(255,107,53,0.4); }
  50% { box-shadow: 0 0 30px rgba(255,107,53,0.7); }
}

#build-hint {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #666;
  text-align: center;
  pointer-events: none;
}

/* FLIGHT UI */
#flight-ui {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 50;
  pointer-events: none;
}

#flight-ui > * { pointer-events: auto; }

#flight-hud-left {
  position: absolute;
  left: 12px;
  top: 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-item {
  background: rgba(10,14,39,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 140px;
}

.hud-label {
  font-size: 8px;
  letter-spacing: 2px;
  color: #00d4ff;
  font-weight: 700;
  text-transform: uppercase;
}

.hud-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

#flight-hud-right {
  position: absolute;
  right: 12px;
  top: 60px;
  bottom: 60px;
  display: flex;
  gap: 10px;
  align-items: stretch;
}

#altimeter-bar {
  width: 32px;
  background: rgba(10,14,39,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#altimeter-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, #00d4ff, #00ff88);
  transition: height 0.1s;
  border-radius: 0 0 8px 8px;
}

.alt-marker {
  position: absolute;
  left: 0; right: 0;
  font-size: 6px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  border-top: 1px dashed rgba(255,255,255,0.15);
  padding-top: 2px;
}

#fuel-bar-container, #throttle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#fuel-bar, #throttle-bar {
  width: 24px;
  flex: 1;
  background: rgba(10,14,39,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#fuel-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(0deg, #ff3344, #ffcc00, #00ff88);
  border-radius: 0 0 8px 8px;
  transition: height 0.1s;
}

#throttle-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(0deg, #ff6b35, #ffcc00);
  border-radius: 0 0 8px 8px;
  transition: height 0.05s;
}

#throttle-pct {
  font-size: 9px;
  font-weight: 700;
  color: #ff6b35;
}

#flight-controls-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  white-space: nowrap;
}

/* SUMMARY */
#summary-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: rgba(10,14,39,0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#summary-box {
  background: rgba(20,25,50,0.95);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  text-align: center;
}

#summary-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 4px;
  margin-bottom: 24px;
  background: linear-gradient(90deg, #00d4ff, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summary-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}

.summary-stat .label { color: #888; }
.summary-stat .value { color: #fff; font-weight: 700; }

.summary-milestone {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.summary-milestone.great {
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3);
  color: #00ff88;
}

.summary-milestone.ok {
  background: rgba(255,204,0,0.1);
  border: 1px solid rgba(255,204,0,0.3);
  color: #ffcc00;
}

.summary-milestone.bad {
  background: rgba(255,51,68,0.1);
  border: 1px solid rgba(255,51,68,0.3);
  color: #ff3344;
}

#summary-buttons {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.summary-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 10px 24px;
  border-radius: 30px;
  border: 1px solid #00d4ff;
  background: rgba(0,212,255,0.1);
  color: #00d4ff;
  cursor: pointer;
  transition: all 0.15s;
}

.summary-btn:hover {
  background: rgba(0,212,255,0.25);
  transform: scale(1.05);
}

/* MOBILE NOTICE */
#mobile-notice {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 999;
  background: rgba(10,14,39,0.97);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: #00d4ff;
  text-align: center;
  padding: 20px;
}

@media (max-width: 768px) {
  #mobile-notice { display: flex; }
  #parts-panel { width: 150px; font-size: 9px; }
  #stats-panel { width: 140px; }
  .hud-value { font-size: 13px; }
  #launch-btn { font-size: 14px; padding: 10px 32px; }
  #game-title { font-size: 12px; letter-spacing: 1px; }
}

/* FOOTER */
#footer-link {
  position: fixed;
  bottom: 6px;
  right: 12px;
  z-index: 300;
  font-size: 9px;
  color: rgba(255,255,255,0.15);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  transition: color 0.2s;
}

#footer-link:hover { color: rgba(0,212,255,0.5); }