/* Suck Vac Cleaning Game - Standalone page */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.game-page {
  font-family: 'Nunito', -apple-system, sans-serif;
  background: linear-gradient(180deg, #e8f4fc 0%, #d4e8f7 100%);
  min-height: 100vh;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

body.game-page.game-dragging {
  overflow: hidden;
  touch-action: none;
  -ms-touch-action: none;
}

.hidden {
  display: none !important;
}

.game-close {
  position: fixed;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  z-index: 10003;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.game-close:hover {
  color: #333;
}

#game-instructions {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid #5b9bd5;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  z-index: 10002;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#game-instructions.hidden {
  display: none !important;
}

.game-progress {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #5b9bd5;
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  z-index: 10002;
}

.game-progress.game-complete {
  background: #6ab187;
  animation: progress-bounce 0.5s ease-in-out;
}

@keyframes progress-bounce {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.12); }
  100% { transform: translateX(-50%) scale(1); }
}

#dirt-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10002;
}

.dirt-spot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #8b7355, #5c4033);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  animation: dirt-pulse 2.5s ease-in-out infinite;
  transform: translate(-50%, -50%);
}

.dirt-spot.dirt-red {
  background: radial-gradient(circle at 30% 30%, #c0392b, #8b0000);
  box-shadow: 0 1px 2px rgba(139,0,0,0.4);
  width: 18px;
  height: 18px;
}


.dirt-spot.vacuuming {
  animation: dirt-sucked 0.4s ease-out forwards;
}

@keyframes dirt-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
}

@keyframes dirt-sucked {
  from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* Game vacuum - user drags */
.game-vacuum {
  position: fixed;
  width: 95px;
  height: 115px;
  bottom: 80px;
  cursor: grab;
  z-index: 10003;
}

.game-vacuum:active {
  cursor: grabbing;
}

.game-vacuum.vacuum-suck .game-vacuum-img {
  animation: vacuum-suck 0.15s ease-out;
}

@keyframes vacuum-suck {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.game-vacuum-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Secret message when game complete */
.game-secret-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: secret-fade-in 0.5s ease-out;
}

.game-secret-text {
  color: #f00;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  padding: 2rem;
  max-width: 90%;
  text-shadow: 0 0 20px #f00;
}

@keyframes secret-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile - touch-friendly */
@media (max-width: 768px) {
  .game-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    font-size: 1.75rem;
    padding: 12px;
    min-width: 48px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }

  #game-instructions {
    top: max(12px, env(safe-area-inset-top));
    padding: 10px 16px;
    font-size: 0.85rem;
    max-width: calc(100% - 32px);
    line-height: 1.3;
  }

  .game-progress {
    top: 56px;
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .game-vacuum {
    width: 80px;
    height: 96px;
    bottom: max(60px, env(safe-area-inset-bottom));
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .game-secret-text {
    font-size: 1.25rem;
    padding: 1.5rem;
    line-height: 1.4;
  }

  .dirt-spot {
    width: 16px;
    height: 16px;
  }

  .dirt-spot.dirt-red {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .game-vacuum {
    width: 70px;
    height: 84px;
  }

  #game-instructions {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .game-progress {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}
