/* Live end-screen presentation. Scoped so no card, rune or title on the
   live board inherits end-screen geometry. All motion is finite WAAPI. */
.end-stage {
  .scene { position: absolute; inset: 0; overflow: hidden; --accent: #f6cd6d; --halo: #b9792e; color: #fff6dd; }
  .scene.defeat { --accent: #a38bf2; --halo: #5746b3; color: #eadbe0; }
  .scene img { display: block; max-width: none; user-select: none; }
  .nebula { position: absolute; inset: 0; background: linear-gradient(#00111977,#00101888), var(--end-nebula, url('/assets/nebula.webp')) center/cover; }
  .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse, transparent 20%, #01070be6 95%); }
  .painting { width: 100%; height: 100%; object-fit: cover; }
  .caption { position: absolute; z-index: 3; text-align: center; left: 0; right: 0; top: 9%; }
  .result-title { font: 3.9cqw/1.3 Inscription, Georgia, serif; letter-spacing: .04em; text-shadow: 0 2px 4px #000, 0 0 20px #000a; }
  .title-banner { position: absolute; left: 50%; top: 50%; width: 39cqw; height: 7cqw; transform: translate(-50%,-50%); z-index: -1; }
  .ornament { display: flex; justify-content: center; align-items: center; gap: 1cqw; margin: 1.3cqw auto 0; color: #c4a465; }
  .ornament i { display: block; width: 6cqw; height: 1px; background: linear-gradient(90deg, transparent, #ccb37b); }
  .ornament i:last-child { transform: rotate(180deg); }
  .ornament b { font-size: .75cqw; font-weight: normal; }
  .defeat .ornament { color: #b96770; }
  .defeat .ornament i { background: linear-gradient(90deg, transparent, #a54c60); }
  .impact { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 52% 44%, #fff4baaa, transparent 65%); z-index: 4; opacity: 0; }
  .portal-disc { position: absolute; width: 44cqw; height: 44cqw; left: 28%; top: calc(50% - 22cqw); }
  .portal-window { position: absolute; inset: 2%; border-radius: 50%; overflow: hidden; }
  .portal .caption { top: 11%; }
  .memory { position: absolute; inset: 0; opacity: 1; }
  .memory .painting { object-position: 50% 44%; opacity: .43; }
  .type-shade { position: absolute; inset: 0; background: radial-gradient(ellipse,#070c1199,#030a10ed 80%); }
  .type .caption { top: 39%; }
  .type .result-title { font-size: 7cqw; letter-spacing: .15em; color: #f8e2ac; text-shadow: 0 2px 12px #000; padding-left: .15em; }
  .type .result-title span { display: inline-block; }
  .type.defeat .result-title { color: #ddd0d1; }
  .word-rule { width: 41cqw; margin: 1cqw auto 0; display: flex; gap: 0; justify-content: center; }
  .word-rule i { height: 2px; width: 50%; background: linear-gradient(90deg,transparent,#f2cf82); }
  .word-rule i:last-child { transform: rotate(180deg); }
  .type.defeat .word-rule { gap: 1.2cqw; transform: rotate(-1deg); }
  .type.defeat .word-rule i { background: linear-gradient(90deg,transparent,#b15568); }
  .type .ornament { margin-top: 2.2cqw; }
  .seal-motion, .gather-shade, .gather-rays { position: absolute; inset: 0; pointer-events: none; }
  .portal .result-title { font-size: 4.3cqw; letter-spacing: .08em; }
  .gather-shade { background: radial-gradient(ellipse, #01040766, #010407f5 75%); z-index: 1; opacity: 0; }
  .gather-rays { z-index: 2; }
  .gather-rays i { position: absolute; left: 50%; top: 50%; width: 3cqw; height: .08cqw; background: linear-gradient(90deg, transparent, #ffe5a4); box-shadow: 0 0 5px #f5c66e; transform-origin: left center; opacity: 0; }
  .gather-knot { position: absolute; width: 5cqw; height: 5cqw; left: 47.5%; top: calc(50% - 2.5cqw); background: radial-gradient(circle, #ffeec9b3, #f5bc4122 35%, transparent 70%); z-index: 2; opacity: 0; }
  .seal-shock { position: absolute; width: 42cqw; height: 42cqw; left: 29%; top: calc(50% - 21cqw); border: 1px solid #ffdfa1; border-radius: 50%; box-shadow: 0 0 10px #dda74666; opacity: 0; }
  .portal .seal-glint { position: absolute; inset: 11% 0 auto; text-align: center; z-index: 4; color: transparent; text-shadow: none; background: linear-gradient(105deg, transparent 44%, #fff8df 49%, transparent 54%); background-size: 250% 100%; background-clip: text; opacity: 0; }
  .sword-layer { position: absolute; inset: 2%; container-type: inline-size; pointer-events: none; z-index: 2; }
  .sword-glow { position: absolute; left: 36.8%; top: 29.44%; width: 17%; height: 1.2cqw; margin-top: -.6cqw; transform-origin: left center; transform: rotate(17.9deg); border-radius: 50%; background: radial-gradient(ellipse, #fff2cdcc, #f6bd5c44 40%, transparent 75%); box-shadow: 0 0 7px #f8cb6c66; opacity: 0; }
  .sword-ember { position: absolute; left: 0; top: 0; width: .9cqw; height: .9cqw; margin: -.45cqw; border-radius: 50%; background: #fff1cd; box-shadow: 0 0 6px #ffcc68, 0 0 10px #df9a4566; opacity: 0; }
}
