:root {
  color-scheme: dark;
  --bg: #0b0d1a;
  --panel: #14172b;
  --accent: #ff5da2;
  --accent2: #4fd1ff;
  --text: #f2f2f7;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
}

#app {
  position: relative;
  height: 100dvh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 2;
  pointer-events: none;
}

#hud div {
  background: rgba(20, 23, 43, 0.7);
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

canvas {
  background: radial-gradient(circle at 50% 20%, #1c2140, #05060c 85%);
  border: 2px solid #2a2f52;
  border-radius: 14px;
  touch-action: none;
  max-height: 100dvh;
  max-width: 100vw;
}

#controls-hint {
  position: absolute;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  color: #7b81a8;
  pointer-events: none;
  z-index: 2;
}

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 12, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5;
  text-align: center;
  padding: 20px;
}

#overlay.hidden {
  display: none;
}

#overlay-title {
  font-size: clamp(24px, 7vw, 36px);
  font-weight: 800;
  color: var(--accent);
}

#overlay-score {
  font-size: clamp(16px, 5vw, 22px);
  color: var(--accent2);
}

#overlay-hint {
  font-size: 14px;
  color: #9aa0c8;
  margin-top: 6px;
}
