/* deck.css — Ogerpon Meganium Hydrapple's own touches on top of /css/guide.css (the shared base).
 * Theme (in /css/tokens.css): Teal Mask Ogerpon ex crystal-green on green-black paper, the orange mask as the secondary.
 * Signature 1, atmosphere: a fog of drifting leaf and pollen motes (18 on desktop, 8 on phones) over three green mists.
 *        Motes are clearly visible (0.20 to 0.38 alpha) and sit behind the text layer.
 * Signature 2, Wild Growth: on the first load of a session (or on click, or ?launch) two vines grow across the masthead,
 *        each Basic Grass Energy sprouts a second one, and the damage readout flips from 150 to 240.
 *        The static page already shows the finished state; everything is off under prefers-reduced-motion.
 * Motion: transform, scale, rotate and opacity only (the vine uses stroke-dashoffset, one-off, 1.5 s).
 */
[data-deck="ogerpon"] {
  /* three mists: leaf green, deep teal, a warm amber from the mask */
  --fog-a: oklch(46% 0.14 150 / 0.50);
  --fog-b: oklch(40% 0.10 190 / 0.38);
  --fog-c: oklch(50% 0.13 62 / 0.26);
  --mote-leaf: oklch(74% 0.17 146);
  --mote-teal: oklch(72% 0.12 185);
  --mote-pollen: oklch(84% 0.14 88);

  /* card-back mark: a sprouting leaf pair on a stem */
  --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 74V30'/%3E%3Cpath d='M32 44C32 28 20 18 6 18c0 16 10 26 26 26Z'/%3E%3Cpath d='M32 34C32 20 42 10 58 8c0 16-10 26-26 26Z'/%3E%3C/svg%3E");
}

/* ───────── atmosphere: drifting leaf and pollen motes ───────── */
.fog b {
  position: absolute;
  left: var(--x);
  bottom: -6vh;
  width: var(--s);
  height: var(--s);
  opacity: 0;
  background: var(--mote-leaf);
  border-radius: 0 100% 0 100%;
  will-change: transform, opacity;
  animation: mote-rise var(--t) linear var(--dl) infinite;
}
.fog b.leaf { width: calc(var(--s) * 1.7); }
.fog b.teal { background: var(--mote-teal); }
.fog b.pollen { background: var(--mote-pollen); border-radius: 50%; width: calc(var(--s) * 0.5); height: calc(var(--s) * 0.5); box-shadow: 0 0 10px 1px var(--mote-pollen); }
@keyframes mote-rise {
  0%   { opacity: 0;          transform: translate3d(0, 0, 0) rotate(var(--r0)); }
  10%  { opacity: var(--o); }
  30%  {                      transform: translate3d(calc(var(--dx) * 0.35), -34vh, 0) rotate(calc(var(--r0) + var(--rs) * 0.3)); }
  55%  {                      transform: translate3d(calc(var(--dx) * -0.1), -66vh, 0) rotate(calc(var(--r0) + var(--rs) * 0.6)); }
  88%  { opacity: var(--o); }
  100% { opacity: 0;          transform: translate3d(var(--dx), -118vh, 0) rotate(calc(var(--r0) + var(--rs))); }
}
@media (max-width: 40rem) { .fog b:nth-of-type(n + 9) { display: none; } }

/* ───────── masthead: title wraps, it is three words long ───────── */
.masthead__title { display: block; font-size: clamp(2.3rem, 3.4vw + 1.2rem, 4.4rem); line-height: 1.02; overflow-wrap: anywhere; }
.masthead__title .accent { margin-right: 0.22em; }

/* ───────── Wild Growth: vines, Energy that doubles, 150 to 240 ───────── */
.grove {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  max-width: 40rem;
  margin: var(--space-md) 0 var(--space-lg);
  color: var(--color-accent);
}
.grove__field { position: relative; flex: 1 1 auto; min-width: 0; height: 4.8rem; margin-block: 0.3rem; }
.grove__vine { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grove__vine path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.grove__vine .grove__tendril { stroke: var(--color-accent-2); stroke-width: 1.8; opacity: 0.75; }

.orb {
  position: absolute;
  display: block;
  width: 2.3rem;
  height: 1.55rem;
  translate: -50% -50%;
}
.orb i {
  position: absolute;
  top: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, oklch(88% 0.14 148), oklch(48% 0.16 150) 74%);
  box-shadow: 0 0 0 2px var(--color-accent), 0 0 14px oklch(from var(--color-accent) l c h / 0.45);
}
.orb i::after {
  content: "";
  position: absolute;
  inset: 0.38rem 0.3rem;
  border-radius: 0 100% 0 100%;
  background: oklch(20% 0.05 155);
  rotate: -12deg;
}
.orb .e1 { left: 0; }
.orb .e2 { right: 0; background: radial-gradient(circle at 36% 30%, oklch(92% 0.12 140), oklch(54% 0.17 146) 74%); box-shadow: 0 0 0 2px var(--color-accent-2), 0 0 14px oklch(from var(--color-accent-2) l c h / 0.4); }

.leafy {
  position: absolute;
  width: 1rem;
  height: 0.56rem;
  translate: -50% -50%;
  rotate: var(--rot);
  border-radius: 0 100% 0 100%;
  background: var(--color-accent);
  box-shadow: 0 0 10px oklch(from var(--color-accent) l c h / 0.4);
}

.grove__dmg { flex: none; display: grid; gap: 2px; justify-items: end; width: 8.4rem; text-align: right; }
.grove__dmg-n { display: flex; align-items: baseline; gap: 0.35rem; font-family: var(--font-mono); line-height: 1; }
.grove__dmg-n b { font-weight: 600; font-size: var(--text-xl); }
.grove__dmg-n .d0 { color: var(--color-muted); font-size: var(--text-md); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: oklch(from var(--color-accent-2) l c h / 0.8); }
.grove__dmg-n .d1 { color: var(--color-accent); font-size: var(--text-2xl); text-shadow: 0 0 22px oklch(from var(--color-accent) l c h / 0.5); }
.grove__dmg-n i { font-style: normal; color: var(--color-muted); font-size: var(--text-sm); }
.grove__dmg small { font-size: var(--text-xs); line-height: 1.25; color: var(--color-muted); }
.grove__btn { position: absolute; inset: -6px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-card); }
.grove__btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

html.launch-play .grove__vine .grove__stem { animation: vine-grow 1.5s var(--ease-in-out) 0.35s backwards; }
html.launch-play .grove__vine .grove__tendril { animation: vine-grow 1.5s var(--ease-in-out) 0.6s backwards; }
html.launch-play .orb .e1 { animation: orb-pop 0.5s var(--ease-out) calc(0.45s + var(--k) * 0.37s) backwards; }
html.launch-play .leafy { animation: leaf-sprout 0.55s var(--ease-out) calc(0.55s + var(--k) * 0.38s) backwards; }
html.launch-play .orb .e2 { animation: e2-grow 0.7s var(--ease-out) calc(2.1s + var(--k) * 0.12s) backwards; }
html.launch-play .grove__dmg .d0 { animation: d0-fade 0.5s ease-out 2.5s both; }
html.launch-play .grove__dmg .d1 { animation: d1-pop 0.7s var(--ease-out) 2.55s backwards; }
@keyframes vine-grow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes orb-pop { from { opacity: 0; scale: 0.2; } 70% { scale: 1.12; } to { opacity: 1; scale: 1; } }
@keyframes leaf-sprout { from { opacity: 0; scale: 0; } 70% { scale: 1.2; } to { opacity: 1; scale: 1; } }
@keyframes e2-grow { from { opacity: 0; scale: 0.1; translate: -0.7rem 0; } 65% { opacity: 1; scale: 1.18; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes d0-fade { from { opacity: 1; color: var(--color-ink); } to { opacity: 1; color: var(--color-muted); } }
@keyframes d1-pop { from { opacity: 0; scale: 0.5; } 60% { opacity: 1; scale: 1.12; } to { opacity: 1; scale: 1; } }
.grove__dmg .d1 { transform-origin: right center; }

@media (max-width: 30rem) {
  .grove { gap: var(--space-sm); }
  .grove__dmg { width: 6.6rem; }
  .grove__dmg-n b { font-size: var(--text-lg); }
  .grove__dmg-n .d0 { font-size: var(--text-base); }
  .grove__dmg-n .d1 { font-size: var(--text-xl); }
  .orb { width: 1.8rem; height: 1.2rem; }
  .orb i { width: 1.2rem; height: 1.2rem; }
  .orb i::after { inset: 0.3rem 0.24rem; }
  .leafy { width: 0.8rem; height: 0.44rem; }
}

/* ───────── Energy art on the mat ───────── */
.energy-art--grass { border-color: oklch(40% 0.12 150); }
.energy-art--grass .energy-art__orb {
  background: radial-gradient(circle at 38% 34%, oklch(86% 0.15 145), oklch(44% 0.16 150) 72%);
  box-shadow: 0 0 0 3px oklch(68% 0.17 148), 0 0 24px oklch(68% 0.17 148 / 0.4);
}

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

/* ───────── tables: upgrade list vs supplied list, and setup of list variants ───────── */
.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 caption { text-align: left; padding: 0 0 var(--space-xs); font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }
.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__hi { color: var(--color-accent); font-weight: 600; }

/* ───────── options: what-it-costs line under a swap ───────── */
.tagline { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }

@media (prefers-reduced-motion: reduce) {
  .fog b { animation: none; opacity: 0; }
  html.launch-play .grove__vine path, html.launch-play .orb .e1, html.launch-play .orb .e2, html.launch-play .leafy,
  html.launch-play .grove__dmg .d0, html.launch-play .grove__dmg .d1 { animation: none; }
}
