/* Big-moment effects (SPEC §8.4.5). Motion is driven by WAAPI (transform/opacity);
   these rules only style the nodes. prefers-reduced-motion is honoured in JS + below. */

/* ---- stage banner (HR / grand slam / score / start / final) ---- */
.fx-banner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px; text-align: center; white-space: nowrap;
  pointer-events: none; z-index: 2; opacity: 0;
}
.fx-banner-title {
  position: relative; z-index: 1;
  font-family: var(--font-num); font-style: italic; font-weight: 900; letter-spacing: 1px;
  font-size: clamp(34px, 9vw, 64px); line-height: 1; color: #fff;
  -webkit-text-stroke: 3px var(--bc); paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 24px color-mix(in srgb, var(--bc) 70%, transparent);
}
.fx-banner-sub {
  position: relative; z-index: 1; max-width: 86vw; overflow: hidden; text-overflow: ellipsis;
  padding: 4px 12px; border-radius: 999px; background: rgba(8, 18, 36, .82); color: #fff;
  font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.fx-banner-rays {
  position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--bc) 55%, transparent) 0deg 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 62%);
  mask: radial-gradient(circle, #000 0 18%, transparent 62%);
  animation: rays-spin 6s linear infinite; opacity: .85;
}
.fx-grandslam .fx-banner-title { font-size: clamp(30px, 8vw, 58px); background: linear-gradient(180deg, #FFF6C2, #FFD54A 50%, #F59E0B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fx-score .fx-banner-title { font-size: clamp(22px, 6vw, 34px); font-style: normal; letter-spacing: 0; font-family: var(--font-sans); }
.fx-score .fx-banner-rays { width: 300px; height: 300px; margin: -150px 0 0 -150px; opacity: .55; }
.fx-start .fx-banner-title { font-size: clamp(28px, 8vw, 50px); }
.fx-final .fx-banner-title { font-size: clamp(30px, 8vw, 48px); font-style: normal; font-family: var(--font-sans); -webkit-text-stroke: 3px #0B1F3A; }
.fx-final .fx-banner-rays { display: none; }
@keyframes rays-spin { to { transform: rotate(360deg); } }

/* particles */
.fx-burst-host { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 1; pointer-events: none; }
.fx-burst-center { position: fixed; }
.fx-p { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 2px; background: var(--pc); transform: translate(-50%, -50%); will-change: transform, opacity; }
.fx-p:nth-child(3n) { border-radius: 50%; }
.fx-p:nth-child(4n) { width: 6px; height: 12px; }

/* stamp (三振 / 雙殺) */
.fx-stamp {
  position: absolute; right: 14%; top: 28%; z-index: 2; opacity: 0;
  padding: 2px 12px; border: 3px solid #FF4D4D; border-radius: 8px; color: #FF4D4D;
  font-weight: 900; font-size: clamp(20px, 5vw, 30px); letter-spacing: 2px;
  background: rgba(255, 255, 255, .08); text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}
.fx-stamp.dp { border-color: #60A5FA; color: #93C5FD; }

/* full-screen burst (walk-off / 百轟紀念) */
.fx-screen {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
  text-align: center; pointer-events: none; opacity: 0; z-index: 2;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bc) 30%, transparent), transparent 60%);
}
.fx-screen-rays {
  position: absolute; left: 50%; top: 50%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--bc) 30%, transparent) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 12%, transparent 50%);
  mask: radial-gradient(circle, #000 0 12%, transparent 50%);
  animation: rays-spin 9s linear infinite;
}
.fx-screen-title {
  position: relative; font-weight: 900; font-size: clamp(40px, 13vw, 96px); line-height: 1.05; color: #fff; font-style: italic;
  -webkit-text-stroke: 5px var(--bc); paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(0, 0, 0, .22), 0 0 40px color-mix(in srgb, var(--bc) 80%, transparent);
}
.fx-screen-sub {
  position: relative; font-weight: 800; font-size: clamp(14px, 4vw, 20px); color: #fff;
  padding: 4px 14px; border-radius: 999px; background: rgba(8, 18, 36, .8);
}

/* confetti (pooled) */
.confetti { position: fixed; left: 0; top: 0; width: 8px; height: 13px; border-radius: 2px; background: var(--cc, #FF5A1F); opacity: 0; will-change: transform, opacity; }
.confetti:nth-child(odd) { width: 10px; height: 7px; }
.confetti:nth-child(5n) { border-radius: 50%; width: 8px; height: 8px; }

@media (prefers-reduced-motion: reduce) {
  .fx-banner-rays, .fx-screen-rays { animation: none; display: none; }
  .fx-p, .confetti { display: none; }
  .ci-cell.today { animation: none; }
}
