:root {
  --ivp-blue: #0079ff;
  --ivp-dark-blue: #002667;
  --ivp-light-blue: #6dc3ff;
  --ivp-orange-red: #f15a29;
  --ivp-bg: #f8f9fa;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background: #0a0a1a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: var(--font-sans);
  overflow: hidden;
  touch-action: manipulation;
}

/* Starfield background with parallax on resize */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(2px 2px at 10vw 20vh, white, transparent),
    radial-gradient(3px 3px at 80vw 10vh, white, transparent),
    radial-gradient(2px 2px at 30vw 80vh, white, transparent),
    radial-gradient(3px 3px at 90vw 60vh, white, transparent),
    radial-gradient(2px 2px at 50vw 50vh, white, transparent),
    radial-gradient(2.5px 2.5px at 20vw 70vh, white, transparent),
    radial-gradient(2px 2px at 70vw 30vh, white, transparent),
    radial-gradient(3px 3px at 5vw 90vh, white, transparent),
    radial-gradient(2px 2px at 95vw 85vh, white, transparent),
    radial-gradient(2.5px 2.5px at 40vw 15vh, white, transparent),
    radial-gradient(2px 2px at 60vw 95vh, white, transparent),
    radial-gradient(2px 2px at 15vw 45vh, white, transparent),
    radial-gradient(3px 3px at 85vw 75vh, white, transparent),
    radial-gradient(2px 2px at 25vw 5vh, white, transparent),
    radial-gradient(2.5px 2.5px at 75vw 55vh, white, transparent),
    radial-gradient(2px 2px at 45vw 35vh, white, transparent),
    radial-gradient(2px 2px at 55vw 65vh, white, transparent),
    radial-gradient(3px 3px at 35vw 25vh, white, transparent),
    radial-gradient(2px 2px at 65vw 85vh, white, transparent),
    radial-gradient(2.5px 2.5px at 8vw 55vh, white, transparent),
    radial-gradient(2px 2px at 92vw 35vh, white, transparent),
    radial-gradient(2px 2px at 48vw 8vh, white, transparent),
    radial-gradient(3px 3px at 12vw 78vh, white, transparent),
    radial-gradient(2px 2px at 88vw 92vh, white, transparent),
    radial-gradient(2.5px 2.5px at 28vw 42vh, white, transparent);
}

header {
  text-align: center;
  margin-bottom: 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

#game-title {
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#game-container {
  position: relative;
  width: 400px;
  height: 600px;
  max-width: 100vw;
  max-height: 100vh;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

#game-canvas {
  display: block;
  touch-action: manipulation;
}

#score {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 600;
  color: white;
  z-index: 10;
}

#pitfall-msg {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(180, 80, 40, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
  white-space: nowrap;
}

#pitfall-msg.visible {
  opacity: 1;
}

#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(10, 10, 26, 0.85);
  z-index: 20;
}

#game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
}

#game-over h1 {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  color: white;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#game-over p {
  font-size: 18px;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

#game-over .personal-best {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
}

#start-screen p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

#start-screen .instructions {
  font-weight: 600;
}

#start-screen .controls {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

/* Device-specific controls: desktop by default */
#start-screen .controls.mobile {
  display: none;
}

@media (pointer: coarse) {
  #start-screen .controls.mobile {
    display: block;
  }
  #start-screen .controls.desktop {
    display: none;
  }
}

#start-rocket {
  vertical-align: middle;
  margin: 0 4px;
}

button {
  background: var(--ivp-blue);
  color: white;
  border: none;
  padding: 12px 32px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  margin: 8px;
  transition: background 0.2s;
}

button:hover {
  background: var(--ivp-light-blue);
}

button:active {
  background: var(--ivp-dark-blue);
}

.hidden {
  display: none !important;
}

footer {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

footer a {
  display: inline-flex;
  align-items: center;
}

.ivp-logo {
  height: 24px;
  margin-top: 2px;
  width: auto;
}

.claude-logo {
  margin-left: 2px;
  height: 18px;
  width: auto;
}
