/* Native good/normal receipt tiers only. Finite local light, no idle particles. */
.pxc-reveal-overlay .hw-card:is(.good,.normal) .hw-face {
  transition-duration: var(--pxr-rare-flip);
  transition-timing-function: cubic-bezier(.32,.02,.2,1);
}

/* Anticipation lights the closed back without moving or exposing the reward. */
.pxc-reveal-overlay .hw-card.pxr-rare-pending::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid var(--pxr-card-edge);
  border-radius: inherit;
  box-shadow: 0 0 14px rgba(var(--pxr-card-rgb),.4), inset 0 0 16px rgba(var(--pxr-card-rgb),.2);
  animation: pxr-rare-awaken var(--pxr-rare-prepare) ease-out 1 both;
}

/* Replace the fast generic white flash on rare cards with a slower face sheen. */
.pxc-reveal-overlay[data-pxc-phase="revealing"]:not(.pxc-reveal-instant) .hw-card:is(.good,.normal).open::before {
  content: none;
  animation: none;
}
.pxc-reveal-overlay .hw-card.pxr-rare-revealed .hw-front::before,
.pxc-reveal-overlay .hw-card.pxr-rare-revealed .hw-front::after {
  content: '';
  position: absolute;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  animation-duration: var(--pxr-rare-shine);
  animation-delay: var(--pxr-rare-flip);
  animation-timing-function: ease-in-out;
  animation-iteration-count: 1;
  animation-fill-mode: both;
}
.pxc-reveal-overlay .hw-card.pxr-rare-revealed .hw-front::after {
  inset: -25% -65%;
  background: linear-gradient(112deg, transparent 38%, rgba(var(--pxr-card-rgb),.12) 45%,
    rgba(255,251,225,.65) 49%, rgba(var(--pxr-card-rgb),.18) 53%, transparent 61%);
  animation-name: pxr-rare-sheen;
}
/* Four small crosses sit near the frame, leaving the item/name readable. */
.pxc-reveal-overlay .hw-card.pxr-rare-revealed .hw-front::before {
  inset: 7%;
  background:
    linear-gradient(90deg,transparent, #fff5d6,transparent) 9% 16% / 15px 2px,
    linear-gradient(transparent, #fff5d6,transparent) 13% 12% / 2px 16px,
    linear-gradient(90deg,transparent, #fff5d6,transparent) 97% 39% / 13px 2px,
    linear-gradient(transparent, #fff5d6,transparent) 92% 36% / 2px 14px,
    linear-gradient(90deg,transparent, var(--pxr-card-edge),transparent) 8% 71% / 10px 1px,
    linear-gradient(transparent, var(--pxr-card-edge),transparent) 11% 69% / 1px 11px,
    linear-gradient(90deg,transparent, var(--pxr-card-edge),transparent) 94% 85% / 9px 1px,
    linear-gradient(transparent, var(--pxr-card-edge),transparent) 91% 83% / 1px 10px;
  background-repeat: no-repeat;
  animation-name: pxr-rare-glints;
}
.pxc-reveal-overlay.many .hw-card.pxr-rare-revealed .hw-front::before { content: none; }

@keyframes pxr-rare-awaken {
  from { opacity: 0; }
  to { opacity: .85; }
}
@keyframes pxr-rare-sheen {
  0% { opacity: 0; transform: translateX(-60%); }
  25% { opacity: .62; }
  55% { opacity: .8; }
  100% { opacity: 0; transform: translateX(60%); }
}
@keyframes pxr-rare-glints {
  0%,100% { opacity: 0; transform: scale(.94); }
  32% { opacity: .9; transform: scale(1); }
  64% { opacity: .32; transform: scale(1.025); }
}

/* Skip/fallback must also suppress pseudo-elements on the faces immediately. */
.pxc-reveal-overlay.pxc-reveal-instant .hw-front::before,
.pxc-reveal-overlay.pxc-reveal-instant .hw-front::after {
  animation: none !important;
  opacity: 0 !important;
}
@media (prefers-reduced-motion: reduce) {
  .pxc-reveal-overlay .hw-card::after,
  .pxc-reveal-overlay .hw-front::before,
  .pxc-reveal-overlay .hw-front::after { animation: none !important; opacity: 0 !important; }
}

/* ---- the card back ---------------------------------------------------------
   Added 2026-11-05 with the rest of the prize art. What a player stares at for the whole ceremony
   was `repeating-linear-gradient(45deg, #e0832a 0 6px, #2b1a12 6px 12px)` - diagonal stripes, nothing
   else (js/halloween_gacha.js:546, and a blue twin at js/wing_gacha.js:583). That is the thing the
   owner meant by "ของเราเหมือนทำมาแบบงั้นๆไม่ใส่ใจ".
   assets/fx/prize/prize_back.png is a 4,680 B white-on-transparent ornament, so one file serves both
   boxes and the box's own colour still comes through underneath.
   SPECIFICITY: both of those rules are injected into <head> at runtime by hwStyle() / wgStyle(), which
   lands AFTER this linked sheet and wins any tie. `#hwReveal .hw-card > .hw-back` is (1,2,0) against
   their (0,1,0), so the id is doing real work here - do not simplify it to `.hw-back`. */
#hwReveal .hw-card > .hw-back,
#wgReveal .hw-card > .hw-back {
  background:
    url("../assets/fx/prize/prize_back.png") center / 86% no-repeat,
    linear-gradient(160deg, var(--pxb-a, #4a2d16), var(--pxb-b, #190f08));
  border: 1px solid var(--pxb-edge, rgba(224, 131, 42, 0.55));
  box-sizing: border-box;
}
/* the wing box is the blue one (js/wing_gacha.js:583) */
#wgReveal .hw-card > .hw-back { --pxb-a: #1b3a5e; --pxb-b: #0b1424; --pxb-edge: rgba(63, 154, 224, 0.55); }
