:root {
  --bg: #040506;
  --accent: #ff9b38;
  --accent-soft: rgba(255, 175, 90, 0.7);
  --text: #f5f5f5;
  --muted: #a7a7a7;
  --panel: rgba(15, 15, 18, 0.76);
  --border: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at top, #101218 0%, #050506 55%, #000 100%);
  color: var(--text);
  font-family: "Rajdhani", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/web_images/black_darkness_orange.jpg");
  background-size: cover;
  background-position: center;
  mix-blend-mode: soft-light;
  opacity: 0.25;
  pointer-events: none;
  z-index: -2;
}

/* Canvas */
#spiralCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* HUD layout */
.hud {
  position: fixed;
  z-index: 2;
  pointer-events: none;
}

.hud-top {
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hud-title h1 {
  margin: 0;
  font-size: 32px;
  text-shadow: 0 0 16px var(--accent-soft);
}

.hud-title p {
  margin: 4px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hud-stats {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.stat-block {
  min-width: 150px;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.45);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stat-value {
  display: inline-block;
  margin-top: 3px;
  font-size: 13px;
}

.bar {
  margin-top: 4px;
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff7d00, #ffd08d);
  box-shadow: 0 0 12px var(--accent-soft);
  transition: width 0.1s linear;
}

.bar-heat .bar-fill {
  background: linear-gradient(90deg, #28c76f, #ffb200, #ff4b4b);
}

/* Center HUD */
.hud-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.message {
  min-height: 32px;
  font-size: 18px;
  text-shadow: 0 0 10px #000;
  opacity: 0;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  transform: translateY(6px);
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

.controls {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.controls button {
  pointer-events: auto;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #15171c, #060608);
  color: var(--text);
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.controls button:hover {
  filter: brightness(1.3);
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.65);
}

/* Right HUD: achievements */
.hud-right {
  top: 80px;
  right: 12px;
  width: 220px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.5);
}

.hud-right h2 {
  margin: 0 0 6px 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.achievements {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.achievements li {
  margin-bottom: 3px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.achievements li.unlocked {
  background: rgba(255, 182, 75, 0.1);
  color: #ffd9a2;
  text-shadow: 0 0 12px var(--accent-soft);
}

/* Footer */
.hud-bottom {
  bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.hud-bottom a {
  color: var(--accent);
  text-decoration: none;
}

.hud-bottom a:hover {
  text-decoration: underline;
}

/* Small screens */
@media (max-width: 720px) {
  .hud-top {
    flex-direction: column;
    align-items: stretch;
  }

  .hud-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hud-right {
    display: none;
  }

  .hud-center {
    top: 55%;
  }
}