/* ========== FLOWER FIELD — 8-BIT PIXEL ART SCENE ========== */

/* The success view needs to become a scrollable container */
[data-state="success"] #success-view {
  display: block;
  overflow: hidden; /* wrapper handles scroll */
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

/* Scroll wrapper — creates the tall scrollable container inside fixed view */
.flower-field-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Inner height creates scroll space — this is the "virtual" height */
.flower-field-wrapper::before {
  content: '';
  display: block;
  height: 800vh;
  pointer-events: none;
}

/* The canvas sticks to the viewport while the wrapper scrolls */
#flower-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  /* Crucial: disable smoothing for crisp pixel art */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  image-rendering: -moz-crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  background: #1a1028;
  z-index: 1;
  pointer-events: none; /* let scroll events pass through to wrapper */
}

/* Confetti canvas sits above the flower field */
[data-state="success"] #confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;
}

/* Replay button at the bottom of the scroll */
.flower-replay-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 15vh;
  z-index: 10;
}

.btn-replay-pixel {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #FFD700;
  background: rgba(255, 107, 107, 0.15);
  border: 2px solid #FF6B6B;
  border-radius: 0; /* pixel-art — no rounded corners */
  padding: 12px 32px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  position: relative;
}

.btn-replay-pixel:hover {
  background: rgba(255, 107, 107, 0.3);
  color: #FFFFFF;
  transform: scale(1.05);
}

.btn-replay-pixel:active {
  transform: scale(0.97);
}

/* Pixel-art style box shadow (stepped) */
.btn-replay-pixel::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 107, 107, 0.3);
  pointer-events: none;
}

/* Responsive canvas sizing */
@media (max-width: 480px) {
  #flower-canvas {
    height: 100dvh; /* dynamic viewport height on mobile */
  }

  .flower-field-wrapper::before {
    height: 500vh;
  }

  .btn-replay-pixel {
    font-size: 14px;
    padding: 10px 24px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #flower-canvas {
    transition: none;
  }
}
