/* Combo animation (combo-anim.js): a small table that plays a combo's steps. Shared by the app
   (index.html) and the static combo and meta deck pages (combos/, meta/), so it is its own file */
/* The controls' buttons, for the static pages (the app's .btn is in app.css) */
.cba .btn { padding: 8px 16px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; cursor: pointer; font: inherit; }
/* Icons in the captions and on the cards, for the static pages */
.cba .ic { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.15em; padding: 0; background: none; }
.cba .ic svg { width: 100%; height: 100%; fill: currentColor; }
.cba { max-width: 760px; margin: 4px 0 18px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.cba-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.cba-turn { padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }
.cba-count { position: relative; }
.cba-count b { color: var(--text); font-size: 14px; }
.cba-table {
  position: relative; display: grid; gap: 6px; margin-top: 10px; padding: 10px 8px; border-radius: 12px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 10%, var(--surface-2)), var(--surface-2));
}
.cba.no-opp .cba-opp, .cba.no-opp .cba-side:first-child { display: none; }
.cba-side { margin: 0; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; letter-spacing: .1em; }
.cba-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 104px; align-items: center; }
.cba-card {
  --w: 70px; position: relative; display: grid; place-items: center; width: calc(var(--w) * 1.42); height: calc(var(--w) * 1.42);
}
.cba-face { width: var(--w); aspect-ratio: 400 / 558; border-radius: 6px; overflow: hidden; box-shadow: 0 3px 10px #0005; transition: transform .45s ease; }
.cba-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cba-card.is-item { --w: 56px; }
.cba-card.is-loc .cba-face { width: calc(var(--w) * 1.39); aspect-ratio: 558 / 400; }
.cba-card[data-under]:not([data-under=""])::after {
  content: attr(data-under); position: absolute; top: 4px; left: 4px; padding: 1px 5px; border-radius: 999px;
  background: #6b4fb8; color: #fff; font-size: 10px; font-weight: 700;
}
.cba-tags em.at { background: #2a8a43; }
.cba-card.exerted .cba-face { transform: rotate(90deg); }
.cba-card.is-opp .cba-face {
  display: grid; place-content: center; gap: 6px; text-align: center; color: #fff;
  background: repeating-linear-gradient(135deg, #4a3f6b 0 8px, #3e3560 8px 16px); border: 2px solid #8f80c8;
}
.cba-card.is-ally .cba-face { display: grid; place-content: center; text-align: center; color: #fff; background: repeating-linear-gradient(135deg, #2f6a4a 0 8px, #285c40 8px 16px); border: 2px solid #6fbf8f; }
.cba-who { font-size: 10px; line-height: 1.2; padding: 0 4px; margin-top: 8px; }
.cba-sw { display: flex; gap: 3px; justify-content: center; font-size: 12px; font-weight: 700; }
.cba-sw span { display: inline-flex; align-items: center; gap: 2px; }
.cba-sw svg, .cba-sw img { width: 11px; height: 11px; }
.cba-dmg {
  position: absolute; top: 4px; right: 4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: #d9363e; color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 1px 4px #0006;
}
.cba-dmg[hidden] { display: none; }
.cba-tags { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; gap: 2px; justify-items: center; }
.cba-tags em { padding: 1px 6px; border-radius: 999px; background: #1d4f9c; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; white-space: nowrap; }
.cba-cast { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.cba-cast-card { width: 84px; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 18px #0007; }
.cba-cast-card img { display: block; width: 100%; height: auto; }
.cba-cast-card { opacity: 0; }
.cba-cast-card.play { animation: cba-cast 1.8s ease both; }
.cba-card.enter { animation: cba-enter .55s ease both; }
.cba-card.leave { animation: cba-leave .65s ease both; }
.cba-card.shifted .cba-face { animation: cba-shift .6s ease backwards; }
.cba-card.lunge { animation: cba-lunge .6s ease; }
.cba-pop {
  position: absolute; left: 50%; top: 30%; z-index: 2; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; animation: cba-pop 1.4s ease both;
  background: #1d4f9c; color: #fff;
}
.cba-pop.dmg { background: #d9363e; }
.cba-pop.up { background: #2a8a43; top: -6px; }
.cba-pop.down { background: #a1550f; top: -6px; }
.cba-cap { min-height: 3.2em; margin: 10px 2px 8px; line-height: 1.6; }
.cba-cap b { color: var(--accent); }
.cba-ctl { display: flex; align-items: center; gap: 8px; }
.cba-ctl .btn.secondary { background: var(--surface-2); color: var(--text); min-width: 44px; }
.cba-ctl .btn:disabled { opacity: .4; }
.cba-pos { min-width: 44px; text-align: center; font-size: 13px; color: var(--muted); }
.cba-ctl [data-a="play"] { margin-left: auto; }
@media (max-width: 520px) {
  .cba-card { --w: 54px; }
  .cba-card.is-item { --w: 46px; }
  .cba-row { gap: 4px; min-height: 84px; }
}
@keyframes cba-enter { from { opacity: 0; transform: translateY(40px) scale(.7); } }
@keyframes cba-leave { to { opacity: 0; transform: scale(.6) rotate(-12deg); filter: grayscale(1); } }
/* (translate/scale, not transform: a card shifted and exerted in the same step still turns) */
@keyframes cba-shift { 0% { translate: 0 -30px; scale: 1.15; opacity: .3; } 100% { translate: 0 0; scale: 1; opacity: 1; } }
@keyframes cba-lunge { 40% { transform: translateY(-46px); } }
@keyframes cba-cast { 0% { opacity: 0; transform: translateY(60px) scale(.6); } 20% { opacity: 1; transform: scale(1.15); } 70% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: translateY(-20px) scale(.8); } }
@keyframes cba-pop { 0% { opacity: 0; transform: translate(-50%, 8px); } 15% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
@media (prefers-reduced-motion: reduce) {
  .cba-card.enter, .cba-card.leave, .cba-card.shifted .cba-face, .cba-card.lunge, .cba-cast-card.play, .cba-pop { animation-duration: .01s; }
}
