:root {
  --game-bg: radial-gradient(ellipse at 50% 35%, #ffe082 0%, #ffca28 35%, #8d6e63 75%, #4e342e 100%);
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 16px;
  box-sizing: border-box;
  gap: 12px;
  z-index: 30;
}

.top-controls .instruction-banner {
  flex: 1;
  margin: 0;
}

.wind-btn {
  background: linear-gradient(135deg, #4fc3f7 0%, #0288d1 100%);
  color: #ffffff;
  border: 2px solid #b3e5fc;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(2, 136, 209, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  outline: none;
}

.wind-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(2, 136, 209, 0.5);
}

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

.wind-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wind-btn:focus-visible {
  outline: 3px solid #ffee58;
  outline-offset: 2px;
}

.autumn-field {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.autumn-field:focus-visible {
  outline: 4px solid #ffb300;
  outline-offset: -4px;
}

/* Warm Sunlight Rays */
.autumn-sunlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.4) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
  animation: sunlight-glow 6s infinite ease-in-out alternate;
}

@keyframes sunlight-glow {
  0% { opacity: 0.5; }
  100% { opacity: 0.9; }
}

/* Hidden Surprise Box */
.surprise-box {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 5;
  outline: none;
  pointer-events: auto;
}

.surprise-icon {
  font-size: min(34vw, 155px);
  line-height: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.3));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.surprise-revealed .surprise-icon {
  animation: surprise-jump 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}

@keyframes surprise-jump {
  0% { transform: scale(1) translateY(0); filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25)); }
  100% { transform: scale(1.15) translateY(-16px) rotate(6deg); filter: drop-shadow(0 0 28px #ffe082); }
}

.surprise-sparkle {
  position: absolute;
  top: -12px;
  right: -10px;
  font-size: 38px;
  animation: sparkle-pop 0.7s infinite alternate ease-in-out;
}

@keyframes sparkle-pop {
  0% { transform: scale(0.7) rotate(0deg); opacity: 0.6; }
  100% { transform: scale(1.3) rotate(35deg); opacity: 1; }
}

.surprise-box:focus-visible {
  outline: 4px solid #ffee58;
  border-radius: 50%;
}

/* Autumn Leaves Carpet */
.leaves-container {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.autumn-leaf {
  position: absolute;
  font-size: 58px;
  line-height: 1;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(62, 39, 35, 0.3));
}

.leaf-swirling {
  animation: leaf-whirl 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes leaf-whirl {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(180deg) translate(var(--wx, 60px), var(--wy, -40px)); }
  100% { transform: scale(0.9) rotate(360deg) translate(var(--wx, 120px), var(--wy, 20px)); opacity: 0.25; }
}

/* Breeze Gust Effect */
.breeze-gust-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}

.wind-swirl {
  position: absolute;
  font-size: 32px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  animation: wind-pass 0.85s ease-out forwards;
}

@keyframes wind-pass {
  0% { transform: translate(-80px, 0) scale(0.5); opacity: 0; }
  40% { opacity: 0.9; }
  100% { transform: translate(360px, -60px) scale(1.2); opacity: 0; }
}

/* Ambient Falling Leaves */
.ambient-leaves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.falling-leaf {
  position: absolute;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: leaf-sway-fall 5.5s linear forwards;
}

@keyframes leaf-sway-fall {
  0% { transform: translateY(-50px) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  50% { transform: translateY(220px) translateX(var(--sway, 30px)) rotate(180deg); }
  100% { transform: translateY(480px) translateX(calc(var(--sway, 30px) * -1)) rotate(360deg); opacity: 0; }
}

/* Forest Floor Edge Deco */
.forest-floor-deco {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 32px;
  line-height: 1;
  opacity: 0.55;
  pointer-events: none;
  z-index: 3;
}

/* Celebratory floating sparkles */
.celebrate-sparkle {
  position: absolute;
  font-size: 32px;
  line-height: 1;
  pointer-events: none;
  z-index: 25;
  animation: celebrate-float 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes celebrate-float {
  0% {
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  25% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx, 0px) * 0.45), calc(-50% + var(--dy, 0px) * 0.45)) scale(1.3) rotate(35deg);
  }
  100% {
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0.85) rotate(90deg);
    opacity: 0;
  }
}

@media (max-height: 600px) {
  .surprise-icon { font-size: min(28vw, 115px); }
  .autumn-leaf { font-size: 46px; }
  .wind-btn { font-size: 14px; padding: 4px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .autumn-sunlight,
  .surprise-icon,
  .surprise-revealed .surprise-icon,
  .surprise-sparkle,
  .autumn-leaf,
  .leaf-swirling,
  .wind-swirl,
  .falling-leaf,
  .celebrate-sparkle {
    animation: none !important;
    transition: none !important;
  }
  .leaf-swirling {
    opacity: 0.3 !important;
  }
  .falling-leaf {
    display: none !important;
  }
}
