/* deck.css — N's Zoroark ex's own touches on top of /css/guide.css (the shared base):
 *   1. dark smoke instead of the default mists (--fog-a/b/c/d/e), clearly visible but dark enough to keep text AA
 *   2. the "illusion": on the first load of a session N's Zorua stands where Zoroark ex does, then dissolves into it
 *      (click the fox mark to replay, ?illusion forces it). Everything is static under prefers-reduced-motion.
 *   3. the fox mark on card backs (--deck-mark) and a mirror row for the matchup list.
 * Animation uses opacity and transform; the one-off dissolve also blurs, for about 2 seconds.
 */

[data-deck="zoroark"] {
  /* smoke, in the card's own palette: teal haze, pale grey wisp, crimson ember. Peak colours are kept dark so the
     brightest point of the page behind text still passes 4.5:1 for --color-muted. */
  --fog-a: oklch(40% 0.085 195 / 0.54);
  --fog-b: oklch(60% 0.03 205 / 0.28);
  --fog-c: oklch(36% 0.12 25 / 0.46);
  --fog-d: oklch(36% 0.07 200 / 0.44);
  --fog-e: oklch(42% 0.09 22 / 0.28);
  /* fox head: two ears, a pointed muzzle, slanted eyes and a mane streak; drawn as a stroke, used as a mask */
  --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='M9 8l17 17q6-2 12 0l17-17 2 30q-4 20-25 36Q11 58 7 38z'/%3E%3Cpath d='M18 40l9 4M46 40l-9 4M32 27v9M32 74v-9'/%3E%3Cpath d='M4 44l-3 14M60 44l3 14'/%3E%3C/svg%3E");
}

/* two more smoke layers; the base ships three */
.fog i:nth-child(4),
.fog i:nth-child(5) { top: 20%; left: -70%; width: 150%; height: 44vh; background: radial-gradient(closest-side, var(--fog-d), transparent); animation-duration: 52s; animation-direction: alternate-reverse; animation-delay: -14s; }
.fog i:nth-child(5) { top: 58%; left: -10%; width: 130%; height: 40vh; background: radial-gradient(closest-side, var(--fog-e), transparent); animation-duration: 70s; animation-direction: alternate; animation-delay: -41s; }
@media (prefers-reduced-motion: reduce) { .fog i { animation: none; } }

/* ───────── masthead: the name, the fox button, the fan ───────── */
.masthead__title { flex-wrap: wrap; align-items: flex-end; column-gap: 0.14em; font-size: clamp(2.4rem, 3.6vw + 1.2rem, 4.6rem); }
.masthead__title .accent { animation: none; }

/* the name is two stacked states in one grid cell: the cell is as wide as the longer name, so nothing jumps */
.nz-name { display: inline-grid; justify-items: start; }
.nz-name > * { grid-area: 1 / 1; }
.nz-name__a { visibility: hidden; opacity: 0; pointer-events: none; user-select: none; color: var(--color-ink); }
.nz-name__a b { font-weight: inherit; color: var(--color-accent-2); }

.fox {
  position: relative;
  flex: none;
  width: 0.56em;
  height: 0.7em;
  margin: 0 0 0.05em 0.06em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-2);
  font: inherit;
  cursor: pointer;
}
.fox::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: var(--deck-mark) center / contain no-repeat;
  mask: var(--deck-mark) center / contain no-repeat;
  transition: transform var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.fox:hover::before { transform: rotate(-8deg) scale(1.08); color: var(--color-accent); }
.fox:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 6px; border-radius: 6px; }
.fox:active::before { transform: scale(0.94); }

/* the Zorua standing in for the centre card, and the smoke that covers the swap */
.fan__card--c .fan__zorua { position: absolute; inset: 0; opacity: 0; }
.fan__puff {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78%;
  aspect-ratio: 1;
  margin: -39% 0 0 -39%;
  border-radius: 50%;
  background: radial-gradient(closest-side, oklch(68% 0.04 200 / 0.75), oklch(42% 0.09 195 / 0.45) 55%, transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.fan__puff--2 { background: radial-gradient(closest-side, oklch(50% 0.14 25 / 0.6), transparent); width: 60%; margin: -30% 0 0 -30%; }

html.illusion-play .nz-name__a { visibility: visible; animation: nz-a 2.7s var(--ease-in-out) 0.15s both; }
html.illusion-play .nz-name__b { animation: nz-b 2.7s var(--ease-in-out) 0.15s both; }
html.illusion-play .fan__card--c .fan__zoroark { animation: zoroark-in 2.7s var(--ease-in-out) both; }
html.illusion-play .fan__card--c .fan__zorua { animation: zorua-out 2.7s var(--ease-in-out) both; }
html.illusion-play .fan__puff { animation: puff 1.7s var(--ease-out) 1.15s backwards; }
html.illusion-play .fan__puff--2 { animation-delay: 1.35s; animation-duration: 1.5s; }

/* Zorua shimmers (the old trick: colour and a 3px jitter), then lets go */
@keyframes nz-a {
  0%    { opacity: 1; transform: translateX(0); }
  10%   { transform: translateX(-3px); }
  20%   { transform: translateX(3px); }
  30%   { transform: translateX(-2px); }
  40%   { opacity: 1; transform: translateX(0); filter: blur(0); }
  66%, 100% { opacity: 0; transform: translateY(-8px) scale(0.97); filter: blur(10px); }
}
@keyframes nz-b {
  0%, 40% { opacity: 0; transform: translateY(8px) scale(1.03); filter: blur(12px); }
  78%, 100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes zorua-out {
  0%, 38% { opacity: 1; transform: scale(1); filter: blur(0); }
  68%, 100% { opacity: 0; transform: scale(0.93); filter: blur(5px); }
}
@keyframes zoroark-in {
  0%, 40% { opacity: 0; transform: scale(1.07); filter: blur(6px); }
  80%, 100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes puff {
  0%   { opacity: 0; transform: scale(0.25); }
  30%  { opacity: 0.85; }
  100% { opacity: 0; transform: scale(1.7); }
}

@media (prefers-reduced-motion: reduce) {
  html.illusion-play .nz-name__a,
  html.illusion-play .nz-name__b,
  html.illusion-play .fan__card--c .fan__zoroark,
  html.illusion-play .fan__card--c .fan__zorua,
  html.illusion-play .fan__puff { animation: none; }
  html.illusion-play .nz-name__a { visibility: hidden; }
  .fox { display: none; }
}

/* ───────── matchups: the mirror is 50% by symmetry and stays out of the average ───────── */
.mu--mirror .mu__fill { display: none; }
.mu--mirror .mu__pct { color: var(--color-muted); font-size: var(--text-sm); }
.mu--mirror .mu__mid { background: var(--color-neutral); }
.mu__tag { display: inline-block; margin-left: var(--space-xs); padding: 1px 6px; border: 1px solid var(--color-rule); border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.04em; color: var(--color-muted); vertical-align: 0.1em; white-space: nowrap; }

/* hits: the blocked target has no bar to draw */
.hit--blocked .hit__bar { background: repeating-linear-gradient(135deg, var(--color-paper-3) 0 4px, transparent 4px 8px); outline: 1px dashed var(--color-neutral); outline-offset: -1px; }
.hit--blocked .hit__n strong { color: var(--color-chart-neg); }
