/* 직접 터뜨리는 행운 볼 */

.pop-panel {
  overflow: hidden;
}

.pop-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.pop-count {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-red);
  font-variant-numeric: tabular-nums;
}

.pop-arena {
  position: relative;
  height: min(62vw, 340px);
  min-height: 260px;
  margin-top: 0.35rem;
  border-radius: 28px;
  overflow: hidden;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 186, 206, 0.85), transparent 36%),
    radial-gradient(circle at 84% 22%, rgba(176, 214, 255, 0.9), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(255, 224, 150, 0.75), transparent 42%),
    linear-gradient(180deg, #f4f7ff 0%, #fff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), inset 0 -18px 30px rgba(90, 110, 160, 0.06);
}

.pop-ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #3d4454;
  font-weight: 800;
  font-size: 1.05rem;
  font-family: inherit;
  background:
    radial-gradient(circle at 32% 28%, #fff 0%, rgba(255, 255, 255, 0.15) 28%, transparent 42%),
    radial-gradient(circle at 50% 55%, var(--c), var(--d));
  box-shadow:
    inset -5px -7px 10px rgba(0, 0, 0, 0.08),
    0 8px 14px rgba(30, 40, 70, 0.14);
  will-change: transform;
}

.pop-ball:hover {
  filter: brightness(1.05);
}

.pop-ball:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 3px;
}

.pop-ball.is-pop {
  pointer-events: none;
  animation: pop-burst 0.38s ease forwards;
}

.pop-ball.is-dim {
  opacity: 0.28;
  filter: grayscale(0.4);
  pointer-events: none;
}

.pop-arena.is-static {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.7rem;
  height: auto;
  padding: 1rem;
}

.pop-arena.is-static .pop-ball {
  position: static;
}

@keyframes pop-burst {
  0% {
    transform: translate(var(--x), var(--y)) scale(1);
  }
  45% {
    transform: translate(var(--x), var(--y)) scale(1.28);
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0.2);
    opacity: 0;
  }
}

.pop-tray {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.85rem;
  min-height: 52px;
}

.pop-slot {
  display: flex;
  justify-content: center;
}

.pop-hole {
  width: clamp(32px, 10vw, 48px);
  height: clamp(32px, 10vw, 48px);
  border-radius: 50%;
  border: 2px dashed rgba(212, 25, 61, 0.28);
  background: #f3f5f8;
}

.pop-got {
  width: clamp(32px, 10vw, 48px);
  height: clamp(32px, 10vw, 48px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(0.78rem, 3vw, 1rem);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  animation: ball-lock-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pop-got--y {
  color: #1e1b16;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 32% 28%, #ffffffaa 0%, transparent 42%),
    linear-gradient(155deg, #ffe066, #e2a800);
}

.pop-got--b {
  background: radial-gradient(circle at 32% 28%, #ffffffaa 0%, transparent 42%),
    linear-gradient(155deg, #7ecbff, #1f7fd4);
}

.pop-got--r {
  background: radial-gradient(circle at 32% 28%, #ffffffaa 0%, transparent 42%),
    linear-gradient(155deg, #ff8b8b, #c92525);
}

.pop-got--gr {
  background: radial-gradient(circle at 32% 28%, #ffffffaa 0%, transparent 42%),
    linear-gradient(155deg, #d9dee6, #8e96a3);
}

.pop-got--gn {
  background: radial-gradient(circle at 32% 28%, #ffffffaa 0%, transparent 42%),
    linear-gradient(155deg, #c9ef7a, #6fad28);
}

.pop-status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.pop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.85rem;
}

.pop-actions .btn {
  min-width: 8.5rem;
}

.pop-actions .btn[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .pop-ball {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pop-ball.is-pop,
  .pop-got {
    animation: none;
  }
}
