/* deck.css — Dragapult ex's own touches on top of /css/guide.css.
 * Theme: Dragon-type gold on a midnight-indigo ground (the gold frame of the Dragon cards, a stealth jet's night sky),
 *        with steel-blue, violet and magenta mist; magenta is the damage counter.
 * Signature: Phantom Dive. A Dreepy parks beside the title; on the first load of a session (or on click) it launches
 *        across the masthead like a missile and 6 damage counters rain onto a bench graphic. Static under prefers-reduced-motion.
 * Atmosphere: three mists (--fog-a/b/c) plus two faint contrails that cross the sky now and then.
 */
[data-deck="dragapult"] {
  --color-paper:      oklch(12.5% 0.022 265);
  --color-paper-2:    oklch(16.5% 0.024 265);
  --color-paper-3:    oklch(20.5% 0.026 265);
  --color-ink:        oklch(95% 0.01 265);
  --color-ink-2:      oklch(75% 0.012 265);
  --color-rule:       oklch(31% 0.024 265);
  --color-rule-2:     oklch(24% 0.02 265);
  --color-muted:      oklch(64% 0.016 265);
  --color-neutral:    oklch(46% 0.016 265);

  --color-accent:     oklch(83% 0.14 90);
  --color-accent-ink: oklch(14% 0.03 265);
  --color-focus:      oklch(88% 0.15 92);
  --color-accent-2:   oklch(66% 0.2 340);

  --color-mat:        oklch(15% 0.03 268);
  --color-mat-line:   oklch(36% 0.05 255);
  --foil-a: oklch(from var(--color-accent) 90% 0.14 h / 0.55);
  --foil-b: oklch(82% 0.13 215 / 0.4);
  --foil-c: oklch(from var(--color-accent-2) 80% 0.14 h / 0.45);
  --color-glow: oklch(from var(--color-accent) l c h / 0.30);

  /* the three mists: steel blue, violet, magenta, strong enough to read on the midnight ground */
  --fog-a: oklch(50% 0.13 235 / 0.46);
  --fog-b: oklch(42% 0.15 292 / 0.36);
  --fog-c: oklch(52% 0.18 340 / 0.26);

  /* card-back mark: a delta-wing stealth silhouette with its spine */
  --deck-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80' fill='none' stroke='%23000' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 6 61 68 43 61 32 74 21 61 3 68Z'/%3E%3Cpath d='M32 24V52M25 41l7-9 7 9'/%3E%3C/svg%3E");
}

/* ───────── Phantom Dive: Dreepy launch + damage counters on the Bench ───────── */
.strike {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 4.4rem;
  max-width: 40rem;
  margin: var(--space-md) 0 var(--space-lg);
  container-type: inline-size;
  color: var(--color-accent);
}
.strike__defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.strike__pad, .strike__shot { flex: none; width: 3.4rem; }
.strike__pad svg, .strike__shot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: oklch(from var(--color-accent) l c h / 0.2);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.strike svg .eye { fill: currentColor; stroke: none; }
.strike__trail {
  flex: 1 1 auto;
  min-width: 0;
  height: 0;
  border-top: 2px dashed oklch(from var(--color-accent) l c h / 0.38);
  transform-origin: left center;
}
.strike__shot { position: absolute; left: 0; top: 50%; margin-top: -0.85rem; opacity: 0; will-change: transform; }
.strike__flash {
  position: absolute;
  right: 9.6rem;
  top: 50%;
  width: 2.6rem;
  height: 2.6rem;
  margin-top: -1.3rem;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.strike__bench { flex: none; display: flex; gap: 0.4rem; margin-left: auto; }
.strike .sl {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 0.62rem);
  place-content: center;
  gap: 2px;
  width: 1.8rem;
  aspect-ratio: 63 / 88;
  border: 2px solid var(--color-rule);
  border-radius: 4px;
  background: var(--color-paper-2);
}
.strike .sl::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 4px;
  box-shadow: 0 0 14px 2px oklch(from var(--color-accent-2) l c h / 0.7);
  opacity: 0;
  pointer-events: none;
}
.strike .ct {
  display: block;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--color-accent-2);
  box-shadow: inset 0 0 0 1.5px oklch(0% 0 0 / 0.28), 0 0 6px oklch(from var(--color-accent-2) l c h / 0.6);
}
.strike .ct:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; }
.strike__btn {
  position: absolute;
  inset: -4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-card);
}
.strike__btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

html.launch-play .strike__shot { animation: shot-fly 1.35s cubic-bezier(0.55, 0, 0.9, 0.45) 0.45s both; }
html.launch-play .strike__trail { animation: trail-draw 1.35s linear 0.45s backwards; }
html.launch-play .strike__flash { animation: impact 0.8s var(--ease-out) 1.75s backwards; }
html.launch-play .strike__bench { animation: bench-jolt 0.45s var(--ease-out) 1.78s; }
html.launch-play .strike .ct { animation: counter-drop 0.55s var(--ease-out) calc(1.8s + var(--k, 0) * 0.11s) backwards; }
html.launch-play .strike .sl:has(.ct)::after { animation: slot-hit 0.9s ease-out 1.78s backwards; }
@keyframes shot-fly {
  0%   { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  14%  { opacity: 1; transform: translate3d(3cqw, -0.9rem, 0) rotate(-8deg) scale(1.04); }
  100% { opacity: 1; transform: translate3d(calc(100cqw - 13.4rem), 0.2rem, 0) rotate(5deg) scale(0.7); }
}
@keyframes trail-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes impact { 0% { opacity: 0; transform: scale(0.2); } 10% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes bench-jolt { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(3px); } 55% { transform: translateX(-2px); } 80% { transform: translateX(1px); } }
@keyframes counter-drop { from { opacity: 0; transform: translateY(-3.2rem) scale(1.25); } 70% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes slot-hit { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
/* the missile is parked out of view once the animation is over: its final keyframe above is where it ends, then it fades */
html.launch-play .strike__shot { animation-name: shot-fly, shot-out; animation-duration: 1.35s, 0.2s; animation-delay: 0.45s, 1.8s; animation-fill-mode: both, forwards; animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.45), ease-out; }
@keyframes shot-out { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 30rem) {
  .strike { height: 4rem; gap: var(--space-xs); }
  .strike__pad, .strike__shot { width: 2.7rem; }
  .strike .sl { width: 1.6rem; grid-template-columns: repeat(2, 0.55rem); }
  .strike .ct { width: 0.55rem; height: 0.55rem; }
  .strike__bench { gap: 0.3rem; }
  .strike__flash { right: 8.4rem; }
  @keyframes shot-fly {
    0%   { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    14%  { opacity: 1; transform: translate3d(3cqw, -0.8rem, 0) rotate(-8deg) scale(1.04); }
    100% { opacity: 1; transform: translate3d(calc(100cqw - 11.3rem), 0.2rem, 0) rotate(5deg) scale(0.7); }
  }
}

/* ───────── atmosphere: two contrails that cross the sky now and then ───────── */
.fog::before, .fog::after {
  content: "";
  position: absolute;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, oklch(90% 0.05 250 / 0.55) 55%, transparent);
  opacity: 0;
  transform: translate3d(-70vmax, 0, 0) rotate(-12deg);
  will-change: transform;
  animation: contrail 38s linear infinite;
}
.fog::before { top: 30%; width: 62vmax; }
.fog::after { top: 66%; width: 44vmax; animation-delay: -19s; }
@keyframes contrail {
  0%   { opacity: 0; transform: translate3d(-70vmax, 0, 0) rotate(-12deg); }
  6%   { opacity: 0.6; }
  38%  { opacity: 0.5; }
  46%  { opacity: 0; transform: translate3d(150vw, -32vw, 0) rotate(-12deg); }
  100% { opacity: 0; transform: translate3d(150vw, -32vw, 0) rotate(-12deg); }
}

/* ───────── Energy art on the mat ───────── */
.energy-art--psychic { border-color: oklch(from var(--color-accent-2) 40% 0.12 h); }
.energy-art--psychic .energy-art__orb {
  background: radial-gradient(circle at 38% 34%, oklch(from var(--color-accent-2) 84% 0.12 h), oklch(from var(--color-accent-2) 42% 0.18 h) 72%);
  box-shadow: 0 0 0 3px var(--color-accent-2), 0 0 24px oklch(from var(--color-accent-2) l c h / 0.4);
}
.energy-art--fire { border-color: oklch(42% 0.12 40); }
.energy-art--fire .energy-art__orb {
  background: radial-gradient(circle at 38% 34%, oklch(82% 0.15 65), oklch(44% 0.17 35) 72%);
  box-shadow: 0 0 0 3px oklch(62% 0.19 40), 0 0 24px oklch(62% 0.19 40 / 0.4);
}
.energy-art--darkness { border-color: oklch(34% 0.05 290); }
.energy-art--darkness .energy-art__orb {
  background: radial-gradient(circle at 38% 34%, oklch(42% 0.07 290), oklch(14% 0.03 280) 72%);
  box-shadow: 0 0 0 3px oklch(52% 0.09 290), 0 0 22px oklch(52% 0.09 290 / 0.35);
}

/* ───────── matchups: the mirror row is shown, not weighted ───────── */
.mu--mirror { opacity: 0.8; }
.mu--mirror .mu__fill { background: var(--color-neutral); }
.mu--mirror .mu__name::after { content: ""; }

/* ───────── options: variant comparison ───────── */
.variants { margin: var(--space-lg) 0 0; max-width: 62rem; }
.variants__row {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 9.5rem) minmax(0, 10rem) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--text-sm);
}
.variants__row--head {
  padding: 0 0 var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}
.variants__row--this { background: oklch(from var(--color-accent) l c h / 0.06); box-shadow: -0.9rem 0 0 oklch(from var(--color-accent) l c h / 0.06), 0.9rem 0 0 oklch(from var(--color-accent) l c h / 0.06); }
.variants__row > span { min-width: 0; color: var(--color-ink-2); }
.variants__name { color: var(--color-ink); font-weight: 600; }
.variants__name em { display: block; margin-top: 2px; font-style: normal; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; color: var(--color-accent); }
@media (max-width: 52rem) {
  .variants__row--head { display: none; }
  .variants__row { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
  .variants__row > span[data-l]::before {
    content: attr(data-l);
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
  }
  .variants__row--this { box-shadow: none; padding-left: var(--space-sm); padding-right: var(--space-sm); }
}

/* ───────── building it: the full list cost ───────── */
.cost { margin: var(--space-lg) 0 0; max-width: 46rem; }
.cost table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.cost th, .cost td { padding: 0.45rem 0.6rem; text-align: right; border-bottom: 1px solid var(--color-rule-2); font-variant-numeric: tabular-nums; }
.cost th:first-child, .cost td:first-child { text-align: left; padding-left: 0; }
.cost thead th { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); border-bottom-color: var(--color-rule); }
.cost tbody th { font-weight: 500; color: var(--color-ink); }
.cost td { font-family: var(--font-mono); color: var(--color-ink-2); }
.cost .cost__code { text-align: left; color: var(--color-muted); }
.cost .cost__l--hi { color: var(--color-accent); font-weight: 600; }
.cost tfoot th, .cost tfoot td { border-bottom: 0; border-top: 2px solid var(--color-rule); padding-top: var(--space-sm); font-weight: 600; color: var(--color-ink); font-size: var(--text-md); }
@media (max-width: 34rem) {
  .cost .cost__code, .cost .cost__u { display: none; }
  .cost th, .cost td { padding: 0.45rem 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html.launch-play .strike__shot, html.launch-play .strike__trail, html.launch-play .strike__flash, html.launch-play .strike__bench,
  html.launch-play .strike .ct, html.launch-play .strike .sl::after { animation: none; }
  .fog::before, .fog::after { animation: none; opacity: 0; }
}
