/* anim — card motion layer (agent 06). Pairs with js/anim.js. */

/* overlay for flying clones / ghost pile / caption; never takes input */
.anim-layer { position: absolute; inset: 0; z-index: 45; pointer-events: none; overflow: visible; }
.anim-layer, .anim-layer * { pointer-events: none !important; }
.anim-layer .card { will-change: transform, opacity; }

/* ghost copy of #pile (same .pile/.card rules apply so clones look identical) */
.anim-layer .anim-ghost {
  position: absolute !important; margin: 0 !important; transform-origin: 0 0;
  translate: none !important; rotate: none !important; scale: none !important;
  z-index: 2 !important; background: none !important; border: 0 !important; box-shadow: none !important;
  animation: none !important;
}
.anim-layer .anim-ghost::before, .anim-layer .anim-ghost::after { content: none !important; display: none !important; }
.anim-layer .card { transition: box-shadow 0.22s ease-out; }
.anim-layer .card.anim-air, #pile .card.anim-air {
  box-shadow: 0 18px 30px -6px rgba(40, 25, 10, 0.45), 0 3px 6px rgba(40, 25, 10, 0.25) !important;
}

/* real pile is hidden (still clickable) while queued opponent throws are in the air */
#pile.anim-hold > * { opacity: 0 !important; }

/* my own throw renders above the hand while it flies */
#table.anim-raise .table-center { z-index: 10; }

/* our FLIP replaces the CSS deal-in for fresh hand cards */
html.anim-on .hand .card.dealt { animation: none; }

/* face-down card (deal + opponent draws) */
.anim-back {
  position: absolute; left: 0; top: 0; width: 40px; height: 56px; border-radius: 6px; z-index: 3;
  background: #2cb9e9; border: 3px solid #fff; outline: 1.5px solid #2b2b2b; overflow: hidden;
  box-shadow: 0 10px 18px -4px rgba(40, 25, 10, 0.45);
  will-change: transform, opacity; opacity: 0;
}
.anim-back::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #5ed3f7 0 10deg, #1fa7dd 10deg 20deg);
}
.anim-back::after {
  content: "YANIV"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: Bangers, sans-serif; font-size: 10px; color: #ffe14a;
  -webkit-text-stroke: 0.8px #6b3f00; transform: rotate(-18deg);
}

/* pile highlight when a throw lands */
.anim-glow {
  position: absolute; z-index: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 228, 120, 0.85), rgba(255, 200, 50, 0.4) 55%, rgba(255, 200, 50, 0) 100%);
}

/* "Dana threw 7♥ 7♠" */
.anim-caption {
  position: absolute; left: 50%; top: 0; z-index: 4; transform: translateX(-50%);
  max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 4px 11px 4px 12px; border-radius: 999px;
  background: rgba(32, 22, 12, 0.86); color: #fff;
  font-family: Fredoka, system-ui, sans-serif; font-size: 13px; font-weight: 500; line-height: 20px;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.45);
  opacity: 0;
}
.anim-caption b { font-weight: 700; color: #ffd84a; margin-right: 1px; }
.anim-caption .cc {
  display: inline-block; margin-left: 2px; padding: 0 5px; border-radius: 5px;
  background: #fff; color: #1a1a1a; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 13px; line-height: 18px;
}
.anim-caption .cc.r { color: #d1262f; }

@media (prefers-reduced-motion: reduce) {
  .anim-layer { display: none; }
  #pile.anim-hold > * { opacity: 1 !important; }
}
