/* PopeX v135 — Living pockets + compact, integrated POP TIME. */
/* A pocket is a rectangular touch target, but its *membrane* is imperfectly
   round. Keep the same hit bounds for tapping, long press and drag. */
#gameStage > #rack > .piece:not(.used)::before {
  border-radius:47% 53% 49% 51% / 52% 47% 53% 48%!important;
  transform-origin:51% 48%;
  /* Only transform + opacity, not border-radius, filter or shadow: the
     long, staggered breathing cycle can be composited cheaply on iOS. */
  animation:pw135MembraneBreathe 12.8s ease-in-out infinite!important;
  animation-delay:calc(var(--pocket-index,0) * -4.1s)!important;
}
#gameStage > #rack > .piece:nth-child(2):not(.used)::before {
  border-radius:53% 47% 52% 48% / 47% 52% 48% 53%!important;
  transform-origin:47% 52%;
}
#gameStage > #rack > .piece:nth-child(3):not(.used)::before {
  border-radius:49% 51% 46% 54% / 50% 46% 54% 50%!important;
  transform-origin:53% 49%;
}
@keyframes pw135MembraneBreathe {
  0%,100% {transform:translate3d(0,0,0) rotate(-.3deg) scale(1,.99);opacity:.98}
  32% {transform:translate3d(0,-.7px,0) rotate(.45deg) scale(1.017,.983);opacity:1}
  69% {transform:translate3d(.35px,.65px,0) rotate(-.4deg) scale(.988,1.013);opacity:.94}
}
/* Score content still retains its layout box but vanishes throughout POP TIME.
   No reflow of the board or next-shapes rack and no stray divider behind dial. */
body.pop-time-active #gameStage > .stats > .stat {
  visibility:hidden!important;
  opacity:0!important;
  transition:none!important;
}
/* Gentle off-circular membrane on the dial; never animate it constantly. */
@media (orientation:portrait) {
 #gameStage > .stats .pop-time-hud {
   /* Geometry is controlled by --pw128-clock-*, aligned with tagline / sheet. */
   width:var(--pw128-clock-size,76px)!important;
   height:var(--pw128-clock-size,76px)!important;
 }
 #gameStage .pop-time-clock,.moonlit-app .pop-time-clock {
   width:100%!important;height:100%!important;
   border-radius:49% 51% 50% 50% / 48% 50% 52% 50%!important;
 }
}
/* Restore consistent text visibility at reduced dial sizes. */
@media (orientation:portrait) and (min-height:621px) {
 #gameStage .pop-time-clock small {font-size:clamp(7px,calc(var(--pw128-clock-size,76px)*.094),10px)!important}
 #gameStage .pop-time-clock strong {font-size:clamp(29px,calc(var(--pw128-clock-size,76px)*.46),48px)!important}
 #gameStage .pop-time-clock span {font-size:clamp(7px,calc(var(--pw128-clock-size,76px)*.088),9px)!important}
}
@media(prefers-reduced-motion:reduce){
 #gameStage > #rack > .piece:not(.used)::before{animation:none!important;transform:none!important;opacity:1!important}
}
