/* Pop Eights - feel and juice pieces: flying props, 3D turn, stamp, reactions, hand feel, result ceremony, living world.
   Everything here is presentation; none of it takes taps (pointer-events: none) except the hand cards themselves. */

/* ---------- flying pieces ---------- */
.prop {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 34;
  pointer-events: none;
  height: auto;
  filter: drop-shadow(0 calc(var(--u) * 0.6) calc(var(--u) * 0.7) rgba(30, 40, 110, 0.35));
}
.flip3d {
  position: fixed;
  z-index: 33;
  pointer-events: none;
  perspective: calc(var(--u) * 70);
}
.flip3d-in {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.flip3d-in > * {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip3d-in > .b {
  transform: rotateY(180deg);
  width: var(--cw);
}
.flip3d .f .card {
  --cw: inherit;
  transform-origin: 50% 50%;
}
.shard {
  position: fixed;
  z-index: 34;
  width: calc(var(--u) * 11);
  pointer-events: none;
}
.stamp {
  position: fixed;
  z-index: 37;
  pointer-events: none;
  font-size: calc(var(--u) * 16);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--heart);
  -webkit-text-stroke: calc(var(--u) * 1.3) #fff;
  paint-order: stroke fill;
  text-shadow:
    0 calc(var(--u) * 0.9) 0 #c02a59,
    0 calc(var(--u) * 1.6) calc(var(--u) * 2) rgba(60, 20, 90, 0.35);
}
.float-text.streak {
  font-size: calc(var(--u) * 7);
  color: #fff;
  -webkit-text-stroke: calc(var(--u) * 0.6) #8a5cf6;
  paint-order: stroke fill;
}

/* ---------- table: the suit glows softly under the piles (never a veil over the screen) ---------- */
@property --suit-c {
  syntax: '<color>';
  inherits: true;
  initial-value: #19c3b0;
}
.center {
  transition: --suit-c 0.45s ease;
}
.center::before {
  content: '';
  position: absolute;
  inset: calc(var(--u) * -8) calc(var(--u) * -9);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--suit-c) 42%, transparent) 0%,
    color-mix(in srgb, var(--suit-c) 20%, transparent) 60%,
    transparent 100%
  );
}
.stack-count .tower {
  display: flex;
  justify-content: center;
  transform-origin: 50% 100%;
  font-style: normal;
  pointer-events: none;
}
.stack-count .tower img {
  width: calc(var(--u) * 4.4);
  height: calc(var(--u) * 4.4);
  object-fit: contain;
  margin: 0 calc(var(--u) * -0.5);
}
.stack-count .tower img:nth-child(even) {
  rotate: 8deg;
}
.discard.drop-ok .card:last-child {
  box-shadow:
    0 0 0 calc(var(--u) * 0.7) #fffc,
    0 0 calc(var(--u) * 3.4) #ffe27a;
}
.pop-btn:not([hidden]) {
  animation:
    pop-in 0.38s cubic-bezier(0.2, 1.6, 0.4, 1),
    pop-pulse 1.1s ease-in-out 0.38s infinite;
}
@keyframes pop-in {
  from {
    transform: scale(0.2) rotate(-24deg);
    opacity: 0;
  }
}

/* ---------- the deal: face-down cards above the table; nothing but the pause reacts until it ends (a tap skips it) ---------- */
.dealing .opps {
  z-index: 4;
}
.dealing .hand {
  z-index: 5;
  pointer-events: none;
}
.dealing .hand .card {
  pointer-events: none;
  filter: none;
}
.dealing .actions,
.dealing .pile,
.dealing .pop-btn {
  pointer-events: none;
}
.dealing .msg,
.dealing .suit-chip,
.dealing .center::before {
  opacity: 0;
} /* the suit is only known when the first card turns over */
.suit-chip,
.center::before {
  transition: opacity 0.22s ease;
}
.card > .deal-back {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  background: url(../assets/img/cards/back.webp) center / 100% 100% no-repeat;
}

/* ---------- a panel never leaves something half-covered behind it ---------- */
.menu-buttons,
.menu-hero .logo,
.actions,
.quick,
.map-card,
.msg,
.stack-banner {
  transition: opacity 0.18s ease;
}
#app:has(#overlays .ov-opts, #overlays .ov-help) :is(.menu-buttons, .menu-hero .logo, .quick, .map-card, .place-arrows),
#app:has(#overlays .ov-result) .actions,
#app:has(#overlays .ov) :is(.suit-chip, .stack-banner, .msg) {
  opacity: 0;
  pointer-events: none;
}

/* ---------- the hand ---------- */
.hand .card {
  touch-action: none;
}
.hand:has(.dragging) {
  z-index: 8;
}
.hand .card.dragging {
  z-index: 20;
  cursor: grabbing;
  transition: filter 0.15s;
  filter: drop-shadow(0 calc(var(--u) * 2) calc(var(--u) * 2) rgba(30, 40, 110, 0.45));
}
/* a soft light that follows the finger on the chosen card */
.hand .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  background: radial-gradient(
    circle at var(--gx, 35%) var(--gy, 22%),
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0) 58%
  );
}
.hand .card.sel::after,
.hand .card.dragging::after {
  opacity: 1;
}
@media (hover: hover) {
  .hand .card:hover::after {
    opacity: 1;
  }
}

/* ---------- living characters ---------- */
.opp.turn .face {
  animation: turn-lean 1.4s ease-in-out infinite;
}
@keyframes turn-lean {
  0%,
  100% {
    transform: translateY(calc(var(--u) * 0.4)) scale(1.03);
  }
  50% {
    transform: translateY(calc(var(--u) * 0.9)) scale(1.06);
  }
}
.opp .face img,
.res-face img {
  transform-origin: 50% 100%;
}
.opp .face img.m-happy,
.res-face img.m-happy {
  animation: f-happy 0.52s ease-in-out infinite;
}
.opp .face img.m-surprised,
.res-face img.m-surprised {
  animation: f-surprised 0.4s cubic-bezier(0.2, 1.5, 0.5, 1) 1;
}
.opp .face img.m-cheer,
.res-face img.m-cheer {
  animation: f-cheer 0.5s ease-in-out infinite;
}
@keyframes f-happy {
  50% {
    scale: 1.035 1.06;
  }
}
@keyframes f-surprised {
  0% {
    scale: 1;
  }
  40% {
    scale: 0.96 1.08;
  }
  100% {
    scale: 1;
  }
}
@keyframes f-cheer {
  0%,
  100% {
    scale: 1;
    translate: 0 0;
  }
  50% {
    scale: 1.06 1.04;
    translate: 0 -3%;
  }
}
.opp .face .bubble {
  position: absolute;
  z-index: 3;
  right: -8%;
  top: -6%;
  min-width: calc(var(--u) * 7);
  height: calc(var(--u) * 7);
  padding: 0 calc(var(--u) * 1.5);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #5a3fd0;
  font-size: calc(var(--u) * 3.8);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 calc(var(--u) * 0.5) calc(var(--u) * 1) rgba(30, 40, 110, 0.35);
  transform-origin: 20% 100%;
  pointer-events: none;
}
.opp .face .bubble::after {
  content: '';
  position: absolute;
  left: 16%;
  bottom: calc(var(--u) * -1);
  width: calc(var(--u) * 2.2);
  height: calc(var(--u) * 2.2);
  background: #fff;
  rotate: 45deg;
  border-radius: 22%;
  z-index: -1;
}
.opp .face .bubble img {
  width: calc(var(--u) * 4.4);
  height: calc(var(--u) * 4.4);
  border-radius: 0;
  object-fit: contain;
  animation: none;
}
/* a rival on the last card: only that card rocks */
.opp.last .fan .card {
  animation: last-rock 1.6s ease-in-out infinite;
}
@keyframes last-rock {
  0%,
  100% {
    rotate: -5deg;
  }
  50% {
    rotate: 5deg;
  }
}

/* ---------- result ---------- */
.res-star img {
  aspect-ratio: 1;
  object-fit: contain;
} /* full and empty stars keep the same box, so the labels line up */
.res-cards .card.spent {
  opacity: 0.26;
  filter: saturate(0.7);
  transition: opacity 0.2s;
}
.res-star.final img {
  animation: star-hit 0.56s var(--d) both cubic-bezier(0.2, 1, 0.4, 1);
} /* only the star grows: its label and neighbours stay put */
.res-star:not(.on) {
  animation-duration: 0.22s;
}
@keyframes star-hit {
  0% {
    transform: scale(0.5) rotate(-30deg);
  }
  60% {
    transform: scale(1.18) rotate(5deg);
  }
  100% {
    transform: none;
  }
}

/* ---------- the living world, behind every piece of the interface ---------- */
.world {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.less-motion .world {
  display: none;
}
.world > div {
  position: absolute;
  will-change: transform;
}
.world img {
  display: block;
  width: 100%;
  height: auto;
}
.w-gull {
  left: -14%;
  top: calc(3% + var(--y) * 0.17);
  width: calc(var(--u) * 10 * var(--s));
  animation: w-cross var(--d) linear var(--o) infinite;
}
.w-gull img {
  animation: w-bob 2.6s ease-in-out infinite;
}
.w-butterfly {
  left: var(--x);
  top: calc(2% + var(--y) * 0.13);
  width: calc(var(--u) * 6 * var(--s));
  animation: w-wander var(--d) ease-in-out var(--o) infinite;
}
.w-butterfly img {
  animation: w-wing 0.34s ease-in-out infinite;
}
.w-petal,
.w-leaf,
.w-snow {
  left: var(--x);
  top: -8%;
  animation: w-fall var(--d) linear var(--o) infinite;
}
.w-petal {
  width: calc(var(--u) * 2.8 * var(--s));
  opacity: 0.9;
}
.w-leaf {
  width: calc(var(--u) * 3.6 * var(--s));
  opacity: 0.9;
}
.w-snow {
  width: calc(var(--u) * 2.4 * var(--s));
  opacity: 0.85;
}
.w-lantern {
  left: var(--x);
  bottom: -12%;
  width: calc(var(--u) * 4.6 * var(--s));
  opacity: 0.85;
  animation: w-rise var(--d) linear var(--o) infinite;
}
@keyframes w-cross {
  to {
    transform: translateX(130vw);
  }
}
@keyframes w-bob {
  50% {
    transform: translateY(14%) rotate(-3deg);
  }
}
@keyframes w-wing {
  50% {
    transform: scaleX(0.55);
  }
}
@keyframes w-wander {
  25% {
    transform: translate(7vmin, 2vmin) rotate(14deg);
  }
  50% {
    transform: translate(2vmin, 4vmin) rotate(-8deg);
  }
  75% {
    transform: translate(-6vmin, 1.5vmin) rotate(10deg);
  }
}
@keyframes w-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(5vw, 58dvh) rotate(200deg);
  }
  100% {
    transform: translate(-2vw, 118dvh) rotate(380deg);
  }
}
@keyframes w-rise {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  50% {
    transform: translate(3vw, -62dvh);
  }
  88% {
    opacity: 0.85;
  }
  100% {
    transform: translate(-2vw, -125dvh);
    opacity: 0;
  }
}

/* ---------- Japanese, Korean, Chinese: bold like the other fonts, and lines that never leave one syllable alone ---------- */
:lang(ja) body {
  font-family: 'Fredoka', 'Hiragino Maru Gothic ProN', 'Meiryo', 'Yu Gothic UI', sans-serif;
  font-weight: 700;
  word-break: auto-phrase;
  line-break: strict;
  text-wrap: pretty;
}
:lang(ko) body {
  word-break: keep-all;
  text-wrap: pretty;
}
:lang(zh) body {
  line-break: strict;
  text-wrap: pretty;
}
/* End of css/juice.css (complete file). */
