/* AFKify "Build a macro" playground: try.html (afkify.com/try) only, with assets/js/try.js.
   Builds on site.css: its tokens, .page-head, .night (the tile stays night in both themes, like every
   picture of the app), .hero-stars, .btn, .cta-row and .icon. Everything here is scoped to .pg. All
   motion is inside prefers-reduced-motion: no-preference; every moving part also has a still end
   state. Linked as try.css?v=...: bump that in try.html when this changes. */

/* Under the page's heading; the footer's own margin is the space below. */
.pg-section {
  padding-block: clamp(24px, 4vw, 48px) 0;
}

/* ---------- The tile and its two halves ---------- */

.pg {
  /* Colours of the little game (it is always night). */
  --pg-shore: #0b1331;
  --pg-water-top: #15255a;
  --pg-water-bottom: #0a1026;
  --pg-wood: #2c3b6b;
  --pg-wood-dark: #1a254d;
  --pg-bucket: #3a4b7f;
  --pg-bucket-rim: #5b6fa9;
  --pg-skin: #ffd27a;
  --pg-shirt: #5379e0;
  --pg-shirt-dark: #3f62c4;
  --pg-pants: #27355f;
  --pg-rod: #c9d6f2;
  --pg-bobber: #ff8a8a;
  --pg-no: #ff8a8a;
  --pg-no-soft: rgba(255, 138, 138, 0.12);

  padding: clamp(14px, 3vw, 36px);
}

.pg-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(16px, 3vw, 36px);
  align-items: start;
}

@media (max-width: 900px) {
  .pg-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* On phones the game comes first, so it stays in view above the steps while they run. */
  .pg-game {
    order: -1;
  }
}

@media (max-width: 640px) {
  .pg-section > .container {
    padding-inline: 8px;
  }
  .pg {
    --radius-tile: 24px;
  }
}

/* ---------- The macro panel (the app) ---------- */

.pg-panel {
  padding: 16px 14px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface);
}

.pg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 14px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid var(--border-strong);
}

.pg-name {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.pg-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Without JavaScript nothing can run, so there is no status to show. */
.pg:not(.is-ready) .pg-state {
  display: none;
}

.pg-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
}

.pg.is-running .pg-dot {
  background: var(--accent);
}

.pg.is-running .pg-state-text {
  color: var(--accent-text);
}

.pg-start {
  min-height: 44px;
  padding: 8px 18px 8px 14px;
  gap: 8px;
}

.pg-start[hidden] {
  display: none;
}

.pg-start .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

/* The steps */

.pg-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 6px 4px 6px 2px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
  transition: transform 0.22s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pg.is-ready .pg-step {
  -webkit-user-select: none;
  user-select: none;
}

@media (hover: hover) and (pointer: fine) {
  .pg.is-ready:not(.is-running) .pg-step {
    cursor: grab;
  }
}

.pg-grip {
  display: none;
  flex: none;
  place-items: center;
  width: 30px;
  height: 44px;
  border-radius: 8px;
  color: var(--text-faint);
  touch-action: none;
  cursor: grab;
}

.pg.is-ready .pg-grip {
  display: grid;
}

.pg-grip .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.pg.is-ready:not(.is-running) .pg-step:hover .pg-grip {
  color: var(--text-muted);
}

.pg-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pg.is-ready .pg-num {
  margin-left: 0;
}

.pg-label {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  min-width: 0;
  padding: 4px 4px 4px 6px;
  font-size: 1rem;
}

.pg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--surface-3);
  font-size: 0.88rem;
  white-space: nowrap;
}

.pg-chip .icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.pg-chip-img {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent-line);
}

.pg-chip-img .icon {
  color: var(--accent-text);
}

.pg-quiet {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.pg-label kbd {
  font-size: 0.85rem;
}

.pg-moves {
  display: flex;
  flex: none;
  gap: 2px;
}

.pg-moves[hidden] {
  display: none;
}

.pg-move {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pg-move:hover {
  background: var(--surface-3);
  color: var(--text);
}

.pg-move[aria-disabled="true"] {
  background: transparent;
  color: var(--text-muted);
  opacity: 0.32;
  cursor: default;
}

.pg-move .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

/* While it runs: the step running now is lit, like the hero demo; the order is locked. */
.pg-step.is-current {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.pg-step.is-current .pg-num {
  background: var(--accent);
  color: var(--accent-ink);
}

.pg.is-running .pg-step {
  cursor: default;
}

.pg.is-running .pg-grip {
  opacity: 0.35;
  cursor: default;
}

/* The step where it went wrong. */
.pg-step.is-failed {
  border-color: var(--pg-no);
  background: var(--pg-no-soft);
}

.pg-step.is-failed .pg-num {
  background: var(--pg-no);
  color: var(--accent-ink);
}

/* Being dragged: lifted above the others, which slide aside. */
.pg-step.is-dragging {
  z-index: 2;
  border-color: var(--accent-line);
  background: var(--surface-3);
  box-shadow: 0 18px 34px -14px rgba(2, 5, 18, 0.9);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: grabbing;
}

.pg-step.is-dragging .pg-grip {
  color: var(--accent-text);
  cursor: grabbing;
}

.pg-howto {
  margin: 12px 4px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.pg-howto[hidden],
.pg-nojs[hidden],
.pg-shuffle[hidden] {
  display: none;
}

.pg-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 6px 0 0;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font: 700 0.95rem/1.2 var(--font-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pg-shuffle:hover {
  text-decoration-thickness: 2px;
}

.pg-shuffle .icon {
  width: 18px;
  height: 18px;
}

.pg-nojs {
  margin: 14px 4px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Phones: a little tighter, so all four steps and the game fit on one screen more often. */
@media (max-width: 480px) {
  .pg-panel {
    padding: 12px 8px 10px;
    border-radius: 18px;
  }
  .pg-head {
    padding-bottom: 12px;
    margin-bottom: 10px;
  }
  .pg-name {
    font-size: 1.25rem;
  }
  .pg-steps {
    gap: 6px;
  }
  .pg-step {
    gap: 2px;
    min-height: 54px;
    padding-block: 4px;
  }
  .pg-grip {
    width: 26px;
  }
  .pg-label {
    gap: 3px 6px;
    padding-left: 6px;
    font-size: 0.95rem;
  }
  .pg-chip {
    gap: 5px;
    padding: 2px 7px;
    font-size: 0.82rem;
  }
  .pg-quiet {
    font-size: 0.88rem;
  }
  .pg-move {
    width: 38px;
  }
}

/* ---------- The game ---------- */

.pg-game {
  display: grid;
  gap: 12px;
}

.pg-scene {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 0 0 1.5px var(--border-strong), 0 24px 50px -30px rgba(2, 5, 18, 0.9);
}

/* What happens, step by step, and the result. A polite live region. */
.pg-say {
  display: none;
  align-items: flex-start;
  gap: 10px;
  min-height: 3.3em;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pg.is-ready .pg-say {
  display: flex;
}

.pg-say strong {
  color: var(--text);
}

.pg-say .icon {
  width: 22px;
  height: 22px;
  margin-top: -1px;
  flex: none;
}

.pg-say.is-fail {
  border-color: var(--pg-no);
  background: var(--pg-no-soft);
  color: var(--text);
}

.pg-say.is-fail .icon {
  color: var(--pg-no);
}

.pg-say.is-win {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

.pg-say.is-win .icon {
  color: var(--accent-text);
}

/* After a win: where to get the real thing. */
.pg-next {
  display: grid;
  gap: 12px;
  padding: 2px 4px 0;
}

.pg-next[hidden] {
  display: none;
}

.pg-next p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pg-next .cta-row {
  margin: 0;
}

@media (max-width: 480px) {
  .pg-next .btn {
    flex: 1 1 auto;
  }
}

/* The scene's parts */

.pg-scene text {
  font-family: var(--font-display);
  font-weight: 800;
}

.pg-sky-a { stop-color: var(--night-top); }
.pg-sky-b { stop-color: #142256; }
.pg-water-a { stop-color: var(--pg-water-top); }
.pg-water-b { stop-color: var(--pg-water-bottom); }
.pg-glow-a { stop-color: #7fc4ff; stop-opacity: 0.32; }
.pg-glow-b { stop-color: #7fc4ff; stop-opacity: 0; }
.pg-scan-a { stop-color: var(--accent); stop-opacity: 0; }
.pg-scan-b { stop-color: var(--accent); stop-opacity: 0.22; }
.pg-scan-c { stop-color: var(--accent); stop-opacity: 0.55; }

.pg-moon { fill: var(--moonlight); }
.pg-stars circle,
.pg-star4 { fill: var(--star); opacity: 0.8; }
.pg-shore { fill: var(--pg-shore); }
.pg-glints rect { fill: var(--moonlight); opacity: 0.38; }
.pg-ripples rect { fill: var(--moonlight); opacity: 0.13; }
.pg-deck { fill: var(--pg-wood); }
.pg-post { fill: var(--pg-wood-dark); }
.pg-plank { stroke: var(--pg-wood-dark); stroke-width: 1.5; }
.pg-bucket-body { fill: var(--pg-bucket); }
.pg-bucket-rim { fill: var(--pg-bucket-rim); }
.pg-bucket-handle { fill: none; stroke: var(--pg-bucket-rim); stroke-width: 2; }
.pg-bucket-fish { fill: var(--moonlight); opacity: 0; }
.pg-skin { fill: var(--pg-skin); }
.pg-shirt { fill: var(--pg-shirt); }
.pg-shirt-dark { fill: var(--pg-shirt-dark); }
.pg-pants { fill: var(--pg-pants); }
.pg-eye { fill: var(--bg); }
.pg-smile { fill: none; stroke: var(--bg); stroke-width: 1.6; stroke-linecap: round; }
.pg-rod { stroke: var(--pg-rod); stroke-width: 3; stroke-linecap: round; }
.pg-rod-grip { stroke: var(--pg-wood-dark); stroke-width: 4.5; stroke-linecap: round; }
.pg-line { fill: none; stroke: var(--moonlight); stroke-width: 1.3; opacity: 0.75; }
.pg-bob-top { fill: var(--pg-bobber); }
.pg-bob-bottom { fill: var(--text); }
.pg-bob-ring { fill: none; stroke: var(--moonlight); stroke-width: 1.2; opacity: 0.35; }
.pg-bite-box { fill: var(--moonlight); }
.pg-bite-text { fill: var(--accent-ink); font-size: 17px; }
.pg-found-box { fill: none; stroke: var(--moonlight); stroke-width: 2; stroke-dasharray: 6 4; }
.pg-found-tag { fill: var(--moonlight); }
.pg-found-text { fill: var(--accent-ink); font-size: 11px; }
.pg-splash ellipse { fill: none; stroke: var(--moonlight); stroke-width: 1.6; }
.pg-escape { fill: #05091a; }
.pg-fish-body { fill: var(--moonlight); }
.pg-fish-tail { fill: #7fc4ff; }
.pg-fish-eye { fill: var(--bg); }
.pg-keycap { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.pg-keycap-text { fill: var(--text); font-size: 15px; }
.pg-keyhint-text { fill: var(--text-muted); font-size: 14px; }
.pg-hud-box { fill: rgba(10, 15, 34, 0.72); stroke: var(--night-line); stroke-width: 1.5; }
.pg-hud-fish { fill: var(--moonlight); }
.pg-hud-count { fill: var(--text); font-size: 20px; }
.pg-hud-plus { fill: var(--accent-text); font-size: 15px; }
.pg-burst path { fill: var(--star); }
.pg-tag-box { fill: var(--bg); stroke: var(--accent-line); stroke-width: 1.5; }
.pg-tag-text { fill: var(--text); font-size: 14.5px; }
.pg-arrow { fill: var(--text); stroke: var(--bg); stroke-width: 1.6; stroke-linejoin: round; }
.pg-ripple { fill: none; stroke: var(--accent-text); stroke-width: 2; }

/* Still states. Hidden until their moment; each class says what the game shows at the end of it. */

.pg-scan,
.pg-bite,
.pg-found,
.pg-splash,
.pg-escape,
.pg-fish-path,
.pg-hud-plus,
.pg-burst path,
.pg-tag,
.pg-ripple {
  opacity: 0;
}

.pg-bite {
  transform: scale(0.4);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: opacity calc(0.18s * var(--pace, 1)) ease, transform calc(0.4s * var(--pace, 1)) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.has-bite .pg-bite {
  opacity: 1;
  transform: none;
}

.pg-found {
  transform: scale(1.3);
  transform-box: fill-box;
  transform-origin: 50% 60%;
  transition: opacity calc(0.2s * var(--pace, 1)) ease, transform calc(0.3s * var(--pace, 1)) var(--ease-out);
}

.has-found .pg-found {
  opacity: 1;
  transform: none;
}

.has-splash .pg-splash,
.has-tag .pg-tag {
  opacity: 1;
}

.has-escape .pg-escape {
  opacity: 0.6;
}

.pg-bob-top,
.pg-bob-bottom {
  transform-box: view-box;
}

.is-hooked .pg-bob-top,
.is-hooked .pg-bob-bottom {
  transform: translateY(5px);
}

/* Reeled in: the line shortens towards the rod's tip and the bobber goes with it. */
.pg-line {
  transform-box: view-box;
  transform-origin: 238px 86px;
  transition: transform calc(0.7s * var(--pace, 1)) var(--ease-out);
}

.pg-bobber {
  transition: transform calc(0.7s * var(--pace, 1)) var(--ease-out), opacity calc(0.5s * var(--pace, 1)) ease;
}

.is-reeled .pg-line {
  transform: scale(0.22);
}

.is-reeled .pg-bobber {
  opacity: 0;
  transform: translate(-62px, -98px);
}

.has-catch .pg-bucket-fish {
  opacity: 1;
}

.pg-cursor {
  opacity: 0;
  transform: translate(452px, 312px);
  transition: transform calc(0.6s * var(--pace, 1)) var(--ease-out), opacity 0.25s ease;
}

.cursor-hit .pg-cursor {
  opacity: 1;
  transform: translate(318px, 176px);
}

.cursor-miss .pg-cursor {
  opacity: 1;
  transform: translate(236px, 250px);
}

.pg-keycap,
.pg-keycap-text {
  transition: fill 0.1s ease, transform 0.1s ease;
}

.key-down .pg-keycap {
  fill: var(--accent);
  transform: translateY(2px);
}

.key-down .pg-keycap-text {
  fill: var(--accent-ink);
  transform: translateY(2px);
}

.is-celebrating .pg-hud-box {
  stroke: var(--accent-line);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .pg-next:not([hidden]) {
    animation: pg-next-in 0.5s var(--ease-out) 0.3s both;
  }
  @keyframes pg-next-in {
    from { opacity: 0; transform: translateY(8px); }
  }
  .pg.is-running .pg-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--accent);
    animation: pg-ping 1.6s var(--ease-out) infinite;
  }
  @keyframes pg-ping {
    from { opacity: 0.6; transform: scale(1); }
    to { opacity: 0; transform: scale(2.8); }
  }

  /* A row that just moved flashes. */
  .pg-step.is-moved {
    animation: pg-moved 0.9s ease-out;
  }
  @keyframes pg-moved {
    0%, 30% { border-color: var(--accent-line); background-color: var(--surface-3); }
  }

  .pg-step.is-current[data-step="repeat"] .pg-spin {
    animation: pg-spin 0.7s var(--ease-out);
  }
  @keyframes pg-spin {
    to { transform: rotate(360deg); }
  }

  .pg-step.is-failed {
    animation: pg-shake 0.45s ease-in-out;
  }
  @keyframes pg-shake {
    20% { transform: translateX(-5px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
  }

  /* The bobber floats while the macro runs, nibbles before a bite, and tugs once hooked. */
  .is-bobbing .pg-bob-top,
  .is-bobbing .pg-bob-bottom {
    animation: pg-bob 2.2s ease-in-out infinite;
  }
  @keyframes pg-bob {
    50% { transform: translateY(1.6px); }
  }
  .is-nibble .pg-bob-top,
  .is-nibble .pg-bob-bottom {
    animation: pg-nibble calc(0.5s * var(--pace, 1)) ease-in-out;
  }
  @keyframes pg-nibble {
    25%, 75% { transform: translateY(4px); }
    50% { transform: translateY(0); }
  }
  .is-hooked .pg-bob-top,
  .is-hooked .pg-bob-bottom {
    animation: pg-tug 0.5s ease-in-out infinite alternate;
  }
  @keyframes pg-tug {
    from { transform: translateY(4px); }
    to { transform: translate(2px, 7px); }
  }
  .is-bobbing .pg-bob-ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: pg-ring 2.2s ease-in-out infinite;
  }
  @keyframes pg-ring {
    50% { transform: scale(1.25); opacity: 0.18; }
  }

  /* Wait until: the screen is read, left to right. */
  .is-scanning .pg-scan {
    animation: pg-scan calc(1.1s * var(--pace, 1)) ease-in-out infinite;
  }
  @keyframes pg-scan {
    0% { opacity: 0; transform: translateX(0); }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translateX(570px); }
  }

  /* Click: the mouse presses, with a ripple. */
  .is-clicking .pg-arrow {
    animation: pg-press calc(0.3s * var(--pace, 1)) ease-out;
  }
  @keyframes pg-press {
    40% { transform: scale(0.8); }
  }
  .is-clicking .pg-ripple {
    transform-box: fill-box;
    transform-origin: center;
    animation: pg-ripple calc(0.6s * var(--pace, 1)) ease-out;
  }
  @keyframes pg-ripple {
    0% { opacity: 0.9; transform: scale(0.3); }
    100% { opacity: 0; transform: scale(1.7); }
  }

  /* A missed click splashes. */
  .has-splash .pg-splash ellipse {
    transform-box: fill-box;
    transform-origin: center;
    animation: pg-splash 0.8s ease-out both;
  }
  .has-splash .pg-splash ellipse:last-child {
    animation-delay: 0.12s;
  }
  @keyframes pg-splash {
    0% { opacity: 1; transform: scale(0.2); }
    100% { opacity: 0.25; transform: scale(1); }
  }

  /* A fish that got away swims off. */
  .has-escape .pg-escape {
    animation: pg-swim 1.3s ease-in both;
  }
  @keyframes pg-swim {
    0% { opacity: 0.7; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(120px); }
  }

  /* Press E with a fish on: it leaps out of the water into the bucket. */
  .is-catching .pg-fish-path {
    animation: pg-leap calc(0.95s * var(--pace, 1)) linear both;
  }
  @keyframes pg-leap {
    0% { opacity: 0; transform: translate(318px, 222px) rotate(55deg) scale(-1, 1); }
    8% { opacity: 1; }
    12% { transform: translate(285px, 163px) rotate(48deg) scale(-1, 1); }
    25% { transform: translate(250px, 116px) rotate(36deg) scale(-1, 1); }
    40% { transform: translate(209px, 85px) rotate(16deg) scale(-1, 1); }
    55% { transform: translate(168px, 74px) rotate(0deg) scale(-1, 1); }
    70% { transform: translate(128px, 85px) rotate(-20deg) scale(-1, 1); }
    85% { opacity: 1; transform: translate(87px, 117px) rotate(-42deg) scale(-1, 1); }
    100% { opacity: 0; transform: translate(46px, 168px) rotate(-62deg) scale(-0.7, 0.7); }
  }
  .is-plus .pg-hud-plus {
    animation: pg-plus calc(1s * var(--pace, 1)) ease-out both;
  }
  @keyframes pg-plus {
    0% { opacity: 0; transform: translateY(6px); }
    20% { opacity: 1; }
    70% { opacity: 1; transform: translateY(-6px); }
    100% { opacity: 0; transform: translateY(-10px); }
  }
  .is-plus .pg-hud-count {
    transform-box: fill-box;
    transform-origin: 0 100%;
    animation: pg-count 0.6s var(--ease-out);
  }
  @keyframes pg-count {
    0% { transform: scale(1.3); fill: var(--accent-text); }
  }

  /* Words from the game pop in. */
  .has-tag .pg-tag-in {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: pg-pop calc(0.35s * var(--pace, 1)) cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  @keyframes pg-pop {
    from { opacity: 0; transform: translateY(6px) scale(0.6); }
  }

  /* Three fish: stars burst around the counter, once. */
  .is-celebrating .pg-burst path {
    transform-box: fill-box;
    transform-origin: center;
    animation: pg-burst 1.2s ease-out both;
  }
  .is-celebrating .pg-burst path:nth-child(2) { animation-delay: 0.08s; }
  .is-celebrating .pg-burst path:nth-child(3) { animation-delay: 0.16s; }
  .is-celebrating .pg-burst path:nth-child(4) { animation-delay: 0.24s; }
  .is-celebrating .pg-burst path:nth-child(5) { animation-delay: 0.32s; }
  @keyframes pg-burst {
    0% { opacity: 0; transform: scale(0.2) rotate(0deg); }
    30% { opacity: 1; transform: scale(1.5) rotate(45deg); }
    100% { opacity: 0; transform: scale(0.6) rotate(90deg); }
  }
}
