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

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #0b1220;
  color: #e8eef7;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  z-index: 10;
}

.hud-top {
  pointer-events: auto;
  background: rgba(8, 14, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  backdrop-filter: blur(8px);
  max-width: 420px;
}

.hud-top h1 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  letter-spacing: 0.4px;
}

.badge3d {
  display: inline-block;
  font-size: 0.62rem;
  vertical-align: middle;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  border-radius: 8px;
  padding: 2px 8px;
  margin-left: 6px;
  font-weight: 800;
}

.hud-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }

.pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.pill.lv1 { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.5); color: #7ce8a5; }
.pill.lv2 { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5); color: #ffd28a; }
.pill.lv3 { background: rgba(249, 115, 22, 0.2); border-color: rgba(249, 115, 22, 0.55); color: #ffb37d; }
.pill.lv4 { background: rgba(239, 68, 68, 0.25); border-color: rgba(239, 68, 68, 0.7); color: #ff9d9d; }
.pill.muted { color: #93a1b8; font-weight: 600; }

.meter-label { font-size: 0.76rem; color: #93a1b8; }
.meter {
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 5px;
}
.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #f59e0b 60%, #ef4444);
  transition: width 0.25s ease;
}

.hud-bottom {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

button, .btn-link {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  color: #e8eef7;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, background 0.15s ease;
  backdrop-filter: blur(6px);
}
button:hover, .btn-link:hover { background: rgba(255, 255, 255, 0.18); }
button:active { transform: scale(0.97); }
#btnHeat { background: rgba(249, 115, 22, 0.28); border-color: rgba(249, 115, 22, 0.6); }
#btnErupt { background: rgba(239, 68, 68, 0.3); border-color: rgba(239, 68, 68, 0.65); }
#btnReset { background: rgba(59, 130, 246, 0.22); border-color: rgba(59, 130, 246, 0.5); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.hint {
  font-size: 0.75rem;
  color: #93a1b8;
  line-height: 1.5;
  background: rgba(8, 14, 26, 0.6);
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}

.toast {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  font-weight: 800;
  text-shadow: 0 0 24px rgba(251, 191, 36, 0.9);
  color: #fff;
  pointer-events: none;
  letter-spacing: 1px;
  transition: opacity 0.4s ease;
  z-index: 20;
}
.toast.hidden { opacity: 0; }

@media (max-width: 640px) {
  .hud-top { max-width: 100%; }
  .hud-top h1 { font-size: 1rem; }
  .toast { font-size: 1.15rem; }
}