:root {
  color-scheme: dark;
  background: #08090d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #08090d;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  min-height: 100dvh;
}

#game-shell,
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 5;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

.hud-title {
  font-size: clamp(14px, 2.4vw, 22px);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hud-row {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 600;
}

.hud-row strong {
  font-variant-numeric: tabular-nums;
}

#message {
  position: fixed;
  top: 18%;
  left: 50%;
  z-index: 6;
  transform: translate(-50%, -6px);
  opacity: 0;
  pointer-events: none;
  font-size: clamp(18px, 3.2vw, 30px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 1);
  transition: opacity 160ms ease, transform 160ms ease;
}

#message.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#controls-hint {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 5;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(7, 8, 12, 0.45);
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #08090d;
  font-size: 16px;
  letter-spacing: 0.04em;
  transition: opacity 350ms ease;
  pointer-events: none;
}

#loading.hidden {
  opacity: 0;
}

#game canvas {
  cursor: crosshair;
}
