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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05030f;
  font-family: "Courier New", monospace;
  color: #e8f7ff;
  user-select: none;
}

#game {
  display: block;
  position: fixed;
  inset: 0;
  cursor: crosshair;
}

/* ---------- Fade transition overlay ---------- */
#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 50;
}
#fade.active {
  opacity: 1;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.hud-card {
  pointer-events: auto;
  background: rgba(15, 10, 35, 0.55);
  border: 1px solid rgba(57, 208, 255, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(57, 208, 255, 0.15);
}

#hud-top {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 12px;
}

#hud-bottom {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.hud-label {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #39d0ff;
  opacity: 0.8;
}

.hud-value {
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(57, 208, 255, 0.6);
}

.inventory .inv-row {
  font-size: 13px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.iron   { background: #c9a8ff; box-shadow: 0 0 6px #c9a8ff; }
.dot.carbon { background: #3ad17a; box-shadow: 0 0 6px #3ad17a; }
.dot.fuel   { background: #ffb347; box-shadow: 0 0 6px #ffb347; }

.ship {
  min-width: 180px;
}

.fuel-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0 10px;
}

.fuel-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffb347, #ff5a6e);
  box-shadow: 0 0 10px #ffb347;
  transition: width 0.2s ease;
}

#craft-btn {
  pointer-events: auto;
  width: 100%;
  padding: 8px;
  font-family: inherit;
  font-weight: bold;
  letter-spacing: 1px;
  color: #05030f;
  background: linear-gradient(90deg, #39d0ff, #9a6cff);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(57, 208, 255, 0.5);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
#craft-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(154, 108, 255, 0.7);
}
#craft-btn small {
  display: block;
  font-size: 9px;
  font-weight: normal;
  opacity: 0.8;
}

#hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  background: rgba(15, 10, 35, 0.7);
  border: 1px solid rgba(255, 61, 240, 0.5);
  border-radius: 10px;
  color: #ff8df5;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(255, 61, 240, 0.6);
  box-shadow: 0 0 18px rgba(255, 61, 240, 0.25);
}

.hidden {
  display: none !important;
}
