:root {
  --bg: #f5f3f0;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.8);
  --accent: #06b6d4;
  --accent2: #7c3aed;
  --font: ui-rounded, 'Nunito', 'Varela Round', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  height: 100%;
  height: 100dvh;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  user-select: none;
}

#wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  max-height: -webkit-fill-available;
}

#game-bg,
#game-shadow,
#game-3d,
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#game-bg {
  z-index: 0;
  background: var(--bg);
}

#game-shadow {
  z-index: 1;
  pointer-events: none;
}

#game-3d {
  z-index: 2;
  pointer-events: none;
  background: transparent;
}

#game-canvas {
  z-index: 3;
  touch-action: none;
  background: transparent;
}

/* Match Planet Destroyer: grid HUD, score centered in middle column */
#hud {
  position: absolute;
  top: 48px;
  left: calc(20px + env(safe-area-inset-left, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

#hud-center {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#score-wrap {
  min-width: 6ch;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--text);
  font-family: var(--font);
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: -0.02em;
}

#score-wrap.pulse {
  animation: scoreBounce 0.3s ease-out;
}

@keyframes scoreBounce {
  0% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1.25);
  }
}

.hint {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  text-align: center;
  font-size: clamp(0.78rem, 2.8vw, 0.95rem);
  line-height: 1.35;
  color: var(--muted);
  z-index: 2;
  text-shadow:
    0 0 10px rgba(0, 0, 0, 0.9),
    0 1px 4px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.hint.hidden {
  visibility: hidden;
}
