/* Card feel (tilt.js): cards lean toward the finger, legends catch a gold sheen. Light only moves
   when the card moves; the one idle effect is the legend sheen, which passes every few seconds. */
@property --rx { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --ry { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- lean ---------- */
.c2.big { transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .2s steps(3, end); will-change: transform; }
.lore .c2.big { touch-action: none; cursor: grab; }
.c2.big.hello { animation: c2hello 1.4s steps(14, end) .25s 1; }
@keyframes c2hello { 25% { --rx: 5deg; --ry: -10deg; } 60% { --rx: -3deg; --ry: 8deg; } 100% { --rx: 0deg; --ry: 0deg; } }
.card.c2.tilting { transform: perspective(420px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .12s steps(2, end); z-index: 1; }
.hand .card.c2.tilting:not(.sel) { transform: translateY(-8px) perspective(420px) rotateX(var(--rx)) rotateY(var(--ry)); }
.hand .card.c2.sel.tilting { transform: translateY(-14px) scale(1.06) perspective(420px) rotateX(var(--rx)) rotateY(var(--ry)); z-index: 2; }
.codex button { position: relative; transition: transform .12s steps(2, end); }
.codex button.tilting { transform: perspective(420px) rotateX(var(--rx)) rotateY(var(--ry)); z-index: 1; }

/* ---------- light on the full card ---------- */
.c2.big .glare { inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity .2s steps(2, end);
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,.75), rgba(255,255,255,0) 45%); }
.c2.big.tilting .glare { opacity: 1; }
/* legend: a gold band crosses the art every few seconds, and follows the tilt while held */
.c2.big .win .foil { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .9;
  background: linear-gradient(115deg, transparent 40%, rgba(255,226,140,.65) 40% 46%, transparent 46% 50%, rgba(255,226,140,.35) 50% 52%, transparent 52%) 0 0 / 300% 100%;
  animation: c2sheen 4.5s steps(16, end) 1s infinite; }
.c2.big.tilting .win .foil { animation: none; background-position: var(--fx, 50%) 0; }
@keyframes c2sheen { 0% { background-position: 100% 0; } 30%, 100% { background-position: 0 0; } }
.c2.big.legend { animation: c2glow 3s steps(6, end) infinite; }
.c2.big.legend.hello { animation: c2hello 1.4s steps(14, end) .25s 1, c2glow 3s steps(6, end) infinite; }
@keyframes c2glow { 0%, 100% { filter: drop-shadow(0 0 3px rgba(242,193,78,.35)); } 50% { filter: drop-shadow(0 0 10px rgba(242,193,78,.75)); } }

/* ---------- legend sheen on small cards: hand, deck builder, preview, board, codex ---------- */
.card.c2.legend::before, .mn.c2.legend:not(.frozen)::before, .codex button.legend::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 40%, rgba(255,226,140,.7) 40% 47%, transparent 47% 50%, rgba(255,226,140,.35) 50% 52%, transparent 52%) 0 0 / 300% 100%;
  animation: c2sheen 4.5s steps(12, end) infinite; }
.mn.c2.legend:not(.frozen)::before { -webkit-mask: var(--mn-out) 0 0 / 100% 100%; mask: var(--mn-out) 0 0 / 100% 100%; animation-delay: 1.5s; }
.card.c2.legend.tilting::before, .codex button.legend.tilting::after { animation: none; background-position: var(--fx, 50%) 0; }
.codex button.legend { border-color: var(--gold); color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .c2.big { transform: none; animation: none !important; }
  .c2.big .win .foil, .card.c2.legend::before, .mn.c2.legend::before, .codex button.legend::after { animation: none !important; background-position: 50% 0; }
}
