:root {
  --game-bg: linear-gradient(180deg, #dbeafe 0%, #fef9c3 45%, #dcfce7 75%, #bbf7d0 100%);
}

.peek-field {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--game-bg);
  touch-action: none;
}

.peek-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 600px;
  min-height: min(75vh, 480px);
  padding: 16px;
  box-sizing: border-box;
}

/* Particle layer within stage */
.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 25;
}

/* Row of 3 Hideouts */
.hideouts-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(14px, 3.5vw, 28px);
  width: 100%;
}

.hideout-slot {
  position: relative;
  width: clamp(96px, 26vw, 145px);
  height: clamp(125px, 32vw, 175px);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 10px 0;
  border-radius: 28px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.15s ease-out;
}

.hideout-slot:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 4px;
}

.hideout-slot:active {
  transform: scale(0.95);
}

.slot-cover {
  font-size: clamp(74px, 19vw, 108px);
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.14));
  z-index: 2;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot-peeker {
  position: absolute;
  top: 14%;
  right: 18%;
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1;
  z-index: 1;
  pointer-events: none;
  animation: peeker-wiggle 1.5s ease-in-out infinite alternate;
}

@keyframes peeker-wiggle {
  0% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
  100% { transform: translateY(-14px) rotate(14deg); }
}

.slot-peeker.peeker-peek {
  animation: peeker-peek 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes peeker-peek {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.35) rotate(14deg); }
  100% { transform: translateY(0) scale(1); }
}

/* Shake on empty knock */
.hideout-slot.shake .slot-cover {
  animation: hideout-shake 0.4s ease-in-out;
}

@keyframes hideout-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px) rotate(-4deg); }
  40%, 80% { transform: translateX(8px) rotate(4deg); }
}

/* Revealed animal card */
.animal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  animation: card-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animal-card.pop-anim {
  animation: card-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes card-pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.peekaboo-badge {
  font-size: 24px;
  font-weight: 800;
  color: #c2410c;
  background: #ffedd5;
  border: 2px solid #fb923c;
  padding: 4px 20px;
  border-radius: 20px;
  margin-bottom: 8px;
  box-shadow: 0 4px 10px rgba(194, 65, 12, 0.15);
  animation: badge-bounce 0.5s ease-out;
}

@keyframes badge-bounce {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.animal-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  touch-action: manipulation;
  transition: transform 0.15s ease-out;
}

.animal-btn:focus-visible {
  outline: 3px solid #ffb300;
  outline-offset: 6px;
}

.animal-btn:active,
.animal-btn.jump {
  animation: animal-jump 0.45s ease-out;
}

@keyframes animal-jump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22) translateY(-18px); }
  70% { transform: scale(0.95) translateY(4px); }
  100% { transform: scale(1); }
}

.animal-emoji {
  font-size: clamp(100px, 26vw, 150px);
  line-height: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
  animation: animal-sway 1.4s ease-in-out infinite alternate;
}

@keyframes animal-sway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

.animal-name {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 800;
  color: #15803d;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 26px;
  border-radius: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.next-round-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  padding: 10px 30px;
  border-radius: 28px;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.next-round-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.45);
}

.next-round-btn:focus-visible {
  outline: 3px solid #ffb300;
  outline-offset: 3px;
}

/* Floating particles inside stage */
.floating-particle {
  position: absolute;
  pointer-events: none;
  font-size: 24px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  animation: particle-rise 0.85s ease-out forwards;
}

@keyframes particle-rise {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translate(var(--pdx, 0px), var(--pdy, -50px)) scale(1.15);
    opacity: 0;
  }
}

/* Compact and landscape mobile viewports */
@media (max-height: 500px) {
  .peek-stage {
    min-height: auto;
    padding: 6px 12px;
  }
  .hideout-slot {
    width: clamp(80px, 20vw, 110px);
    height: clamp(96px, 24vw, 130px);
    padding: 0 0 6px 0;
  }
  .slot-cover {
    font-size: clamp(54px, 14vw, 80px);
  }
  .slot-peeker {
    font-size: clamp(24px, 6vw, 34px);
  }
  .peekaboo-badge {
    font-size: 18px;
    padding: 2px 14px;
    margin-bottom: 4px;
  }
  .animal-emoji {
    font-size: clamp(68px, 17vh, 96px);
  }
  .animal-name {
    font-size: 20px;
    margin-top: 4px;
    padding: 4px 18px;
  }
  .next-round-btn {
    margin-top: 8px;
    font-size: 16px;
    padding: 6px 20px;
  }
}

/* Accessibility / Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .slot-peeker,
  .slot-peeker.peeker-peek,
  .animal-emoji {
    animation: none;
  }
  .hideout-slot.shake .slot-cover {
    animation: none;
  }
  .animal-card,
  .animal-card.pop-anim {
    animation: simple-fade 0.25s ease-out;
  }
  .animal-btn:active,
  .animal-btn.jump {
    animation: none;
  }
  .floating-particle {
    display: none;
  }
  @keyframes simple-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
  }
}
