:root {
  --sky-top: #4ec0ca;
  --sky-bot: #8ed7e0;
  --accent: #f7d51d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0a12;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#game-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at top, #1a2333 0%, #0a0a12 70%);
}

#game {
  display: block;
  height: 100%;
  max-height: 100dvh;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  width: auto;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  border-radius: 4px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  touch-action: none;
}

@media (max-width: 480px) {
  #game {
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
  }
}

#hud-overlay {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  pointer-events: none;
  z-index: 5;
}

.hud-pill {
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hud-icon { font-size: 13px; color: #ffd84d; }

.hud-btn {
  pointer-events: auto;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 7px 10px;
  transition: transform 0.08s ease, background 0.15s ease;
}
.hud-btn:hover { background: rgba(0,0,0,0.5); }
.hud-btn:active { transform: scale(0.92); }

#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  background: #4ec0ca;
  transition: opacity 0.3s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
