:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  background: #05090f;
  color: #fef6d8;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #0b1430, #030407 70%);
  overflow: hidden;
}

.app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top) 1.25rem env(safe-area-inset-bottom);
  touch-action: none;
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.status-bar {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 0;
}

.status-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex: 1;
  text-align: center;
}

.reward-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.trail-layer {
  width: min(320px, 80vw);
  height: 12px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.trail-layer.active {
  opacity: 0.9;
}

.trail-layer.rainbow {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #6cf0ff, #a3ff96, #b68cff);
  box-shadow: 0 0 20px rgba(166, 255, 236, 0.6);
}

.trail-layer.comet {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #6cf0ff, #ffffff);
  box-shadow: 0 0 18px rgba(108, 240, 255, 0.8);
}

.reward-message {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: #ffe8a3;
  text-shadow: 0 0 14px rgba(255, 215, 120, 0.7);
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 0.8s ease-out forwards;
}

.meteor {
  position: absolute;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
  opacity: 0;
  animation: meteor 1s ease-out forwards;
}

.sticker {
  position: absolute;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #0c1420;
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  animation: sticker-pop 1s ease-out forwards;
}

@keyframes sparkle {
  0% {
    transform: scale(0.4) translateY(0);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: scale(1.6) translateY(-40px);
    opacity: 0;
  }
}

@keyframes meteor {
  0% {
    transform: translateX(-20px) translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(120px) translateY(40px);
    opacity: 0;
  }
}

@keyframes sticker-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: scale(1.1) translateY(-20px);
    opacity: 0;
  }
}
.ring-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
}

.ring {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 10;
}

.ring-progress {
  fill: none;
  stroke: #6cf0ff;
  stroke-linecap: round;
  stroke-width: 10;
  stroke-dasharray: 326;
  stroke-dashoffset: 0;
  transition: stroke 0.2s ease;
}

.number {
  font-size: clamp(3.5rem, 6vw, 5rem);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(108, 240, 255, 0.6);
}

.fuel {
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 999px;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffad33, #ff5b5b);
  color: #1a0f05;
  box-shadow: 0 16px 30px rgba(255, 126, 48, 0.3);
}

.fuel:active {
  transform: scale(0.98);
}

.message {
  font-size: 1.1rem;
  min-height: 1.4rem;
  color: rgba(255, 255, 255, 0.75);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 15, 0.82);
  z-index: 3;
  padding: 2rem;
}

.overlay.hidden {
  display: none;
}

.card {
  max-width: 320px;
  background: rgba(16, 24, 38, 0.9);
  padding: 2rem;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
}

.card h1,
.card h2 {
  margin-top: 0;
}

.primary {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: #6cf0ff;
  color: #081017;
  font-weight: 700;
  font-size: 1rem;
}

.parent-trigger {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 64px;
  height: 64px;
  z-index: 4;
}

.parent-bar {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(12, 20, 32, 0.9);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  display: flex;
  gap: 0.5rem;
}

.parent-bar.hidden {
  display: none;
}

.parent-button {
  border: none;
  background: #ffcf5b;
  color: #1c1404;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.5rem 1rem;
}

.success {
  color: #8cff9f;
}

.miss {
  color: #ff9aa8;
}

@media (min-width: 720px) {
  .ring-wrapper {
    width: 240px;
    height: 240px;
  }
}
