/* ===== Rocket Ride Game ===== */

#rocketGame {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: none !important;
  background: #0B0B2A;
}

/* ===== Canvas ===== */

#rocketCanvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: none !important;
}

#rocketGame * {
  cursor: none !important;
}

/* ===== Lives ===== */

.rocket-lives {
  position: fixed;
  top: 48px;
  right: 20px;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  z-index: 200;
  pointer-events: none;
  display: none;
  gap: 4px;
}

.rocket-lives.active {
  display: flex;
}

.rocket-heart {
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.rocket-heart .emoji-img {
  width: clamp(1.2rem, 3vw, 1.6rem);
  height: clamp(1.2rem, 3vw, 1.6rem);
}

.rocket-heart.lost {
  opacity: 0.4;
  filter: grayscale(1);
}

.rocket-heart-breaking {
  animation: rocketHeartBreak 0.5s ease-out forwards;
}

@keyframes rocketHeartBreak {
  0%   { transform: scale(1); opacity: 1; }
  30%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

/* ===== HUD ===== */

.rocket-hud {
  display: none;
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 200;
  pointer-events: none;
  gap: 0.6rem;
  font-family: 'Fredoka One', cursive;
  font-size: clamp(0.8rem, 2.2vw, 1.1rem);
  color: rgba(180, 200, 255, 0.9);
}

.rocket-hud span {
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ===== Hint ===== */

.rocket-hint {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.5s ease;
  text-align: center;
}

/* ===== Game Over Overlay ===== */

.rocket-celebrate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: rgba(10, 10, 40, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rocket-celebrate.show {
  opacity: 1;
  pointer-events: auto;
}

.rocket-endcard {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  animation: rocketEndcardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes rocketEndcardIn {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.rocket-endcard-emoji {
  font-size: clamp(4rem, 15vw, 7rem);
  line-height: 1;
}

.rocket-endcard-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: #fff;
}

.rocket-endcard-stats {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: rgba(180, 200, 255, 0.9);
  display: flex;
  gap: 1.5rem;
}

.rocket-endcard-best {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #FFB347;
}

.rocket-endcard-best-small {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: rgba(180, 200, 255, 0.5);
  font-weight: 600;
}

.rocket-endcard-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.rocket-endcard-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.5em 1.5em;
  border: none;
  border-radius: 50px;
  cursor: url("../../assets/emoji/cursors/hand-point-32.png") 16 4, pointer !important;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rocket-btn-again {
  background: #5B4DA0;
  color: #fff;
  box-shadow: 0 4px 15px rgba(91, 77, 160, 0.3);
}

.rocket-endcard-btn:hover {
  transform: scale(1.05) translateY(-2px);
}

.rocket-endcard-btn:active {
  transform: scale(0.95);
}

/* ===== Mobile D-pad Fallback ===== */

.rocket-dpad {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 300;
  pointer-events: auto;
}

.rocket-dpad-btn {
  position: absolute;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer !important;
}

.rocket-dpad-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.rocket-dpad-up    { left: 56px; top: 0; }
.rocket-dpad-left  { left: 0; top: 56px; }
.rocket-dpad-right { left: 112px; top: 56px; }

/* ===== Gyro Prompt ===== */

.rocket-gyro-prompt {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  background: rgba(10, 10, 40, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rocket-gyro-prompt-inner {
  text-align: center;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.rocket-gyro-prompt-emoji {
  font-size: 4rem;
  line-height: 1;
}

.rocket-gyro-prompt-text {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.rocket-gyro-prompt-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.6em 1.8em;
  border: none;
  border-radius: 50px;
  background: #5B4DA0;
  color: #fff;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
}

.rocket-gyro-prompt-skip {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  color: rgba(180, 200, 255, 0.5);
  background: none;
  border: none;
  cursor: pointer !important;
  padding: 0.4em 1em;
}

/* ===== Responsive ===== */

@media (max-width: 480px) {
  .rocket-hud {
    top: 10px;
    right: 12px;
    gap: 0.4rem;
  }
  .rocket-hud span {
    padding: 3px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rocket-endcard {
    animation: none;
    opacity: 1;
  }
}
