/* Keep the shadow and hit area on the counter while the foil moves in the hand. */
#counter-pack {
  display: block;
  width: calc(var(--pack-height) * .5994);
  pointer-events: auto;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
#counter-pack[data-handled="held"] { cursor: grabbing; }
#counter-pack .counter-wrapper {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 75%;
  transform: perspective(700px) translate3d(var(--pack-x,0px),var(--pack-y,0px),0)
    rotateX(var(--pack-pitch,0deg)) rotateY(var(--pack-yaw,0deg));
  transition: transform 320ms cubic-bezier(.2,.83,.26,1);
}
#counter-pack[data-handled] .counter-wrapper { transition-duration: 105ms; }
#counter-pack[data-handled="held"] .counter-wrapper { transition-duration: 52ms; }
#counter-pack img { display: block; width: 100%; height: 100%; pointer-events: none; }
#counter-pack .counter-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(104deg, transparent 23%, #fcf9c990 45%, #eefcffb0 49%, transparent 66%);
  background-size: 190% 100%;
  background-position: var(--pack-sheen,43%) 50%;
  mask: url("/assets/club-pack.webp") center / 100% 100% no-repeat;
  opacity: 0;
  mix-blend-mode: soft-light;
  transition: opacity 180ms;
}
#counter-pack[data-handled] .counter-wrapper::after { opacity: .65; }
@media (prefers-reduced-motion: no-preference) {
  #counter-pack:not([data-touched]) .counter-wrapper::after { animation: foil-arrival 1.65s .4s both; }
  #counter-pack:focus-visible .counter-wrapper { transform: translateY(-4px) rotate(-1deg); }
  @keyframes foil-arrival {
    0% { opacity: 0; background-position: 98% 50%; }
    32% { opacity: .45; }
    100% { opacity: 0; background-position: 6% 50%; }
  }
}
.stock-stage::before { opacity: var(--pack-shadow-opacity,1); transition: opacity 180ms; }
.stock-caption button { min-width: 44px; }
.stock-caption [data-counter-sound], #holo-inspector [data-counter-sound] {
  display: inline-grid; place-items: center; min-height: 44px; min-width: 44px; padding: 0;
}
[data-counter-sound] svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-counter-sound] .sound-cross, [data-counter-sound][aria-pressed="false"] .sound-waves { display: none; }
[data-counter-sound][aria-pressed="false"] .sound-cross { display: inline; }
.inspect-actions { display: flex; gap: 6px; align-items: center; }
@media (prefers-reduced-motion: reduce) {
  #counter-pack .counter-wrapper { transform: none; }
  #counter-pack .counter-wrapper, #counter-pack .counter-wrapper::after, .stock-stage::before { transition: none; }
  #counter-pack[data-handled] .counter-wrapper::after { opacity: .22; }
}
