:root {
  --hud-bg: rgba(13, 17, 22, 0.7);
  --hud-border: rgba(255, 255, 255, 0.2);
  --text-main: #f3f6fb;
  --accent: #ffd166;
  --danger: #ff6b6b;
  --ok: #7df9b7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  font-family: "Rajdhani", sans-serif;
  background:
    radial-gradient(1200px 420px at 60% -5%, rgba(171, 214, 255, 0.45), rgba(0, 0, 0, 0)),
    linear-gradient(180deg, #7fb8ff 0%, #8bd6ff 30%, #588f67 100%);
}

canvas {
  display: block;
}

.hud {
  position: fixed;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 20;
  max-width: min(96vw, 860px);
}

.hud-card {
  min-width: 122px;
  padding: 7px 10px 6px;
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  background: var(--hud-bg);
  color: var(--text-main);
  backdrop-filter: blur(8px);
}

.hud-card span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hud-card strong {
  display: block;
  margin-top: 3px;
  font-family: "Orbitron", sans-serif;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

.status {
  position: fixed;
  left: 50%;
  top: 92px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hud-border);
  background: rgba(11, 13, 18, 0.78);
  color: var(--text-main);
  font-size: 18px;
  z-index: 20;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.intro {
  position: fixed;
  right: 14px;
  top: 14px;
  width: min(380px, calc(100vw - 28px));
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--hud-border);
  background: rgba(10, 14, 20, 0.8);
  color: var(--text-main);
  z-index: 21;
  transition: opacity 220ms ease, transform 220ms ease;
}

.intro h1 {
  margin: 0 0 8px;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.03em;
  font-size: 26px;
}

.intro p {
  margin: 5px 0;
  font-size: 18px;
}

.intro .controls {
  font-size: 16px;
  opacity: 0.94;
}

.intro.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.touch-controls {
  position: fixed;
  inset: auto 14px 14px;
  display: none;
  justify-content: space-between;
  align-items: end;
  z-index: 22;
  gap: 22px;
}

.touch-group {
  display: flex;
  gap: 10px;
}

.touch-btn {
  min-width: 76px;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-main);
  background: rgba(8, 12, 18, 0.74);
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  letter-spacing: 0.03em;
  touch-action: none;
}

.touch-btn-wide {
  min-width: 112px;
}

.touch-btn.active {
  transform: scale(0.97);
  background: rgba(52, 84, 135, 0.92);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (hover: none), (pointer: coarse), (max-width: 940px) {
  .touch-controls {
    display: flex;
  }

  .status {
    top: 116px;
    font-size: 16px;
  }

  .hud {
    gap: 8px;
  }

  .hud-card {
    min-width: 96px;
    padding: 6px 8px 5px;
  }

  .hud-card strong {
    font-size: 16px;
  }

  .intro {
    top: auto;
    bottom: 118px;
    right: 12px;
    left: 12px;
    width: auto;
    padding: 12px 14px;
  }

  .intro h1 {
    font-size: 20px;
  }

  .intro p {
    font-size: 15px;
  }
}
