/* ==========================================================
   POWER SCORE — 파워사다리 중계화면 (.scene)
   900×540 비율의 무대. 배경 그림(img/ladder-bg.svg) 위에
   바닥 격자 · 번개 · 송전선 전류 · 입자 · 사다리 · 연출 레이어를 겹친다.
   글자 크기는 무대 폭 기준(cqw)이라 폭이 줄면 함께 줄어든다.
   ========================================================== */

.cast[data-g="ld"] .scene { background-image: url(../img/ladder-bg.svg); }

/* 바닥: 앞으로 흘러오는 격자 */
.scene__floor { position: absolute; inset: 68.9% 0 0; overflow: hidden; perspective: 26cqw; -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); }
.scene__floor i { position: absolute; inset: 0 -70% -160%; transform-origin: 50% 0; transform: rotateX(64deg);
  background-image: linear-gradient(rgba(var(--g-rgb), .5) 2px, transparent 2px), linear-gradient(90deg, rgba(138,77,255,.55) 2px, transparent 2px);
  background-size: 100% 6cqw, 6cqw 100%; animation: floor 1.6s linear infinite; }
@keyframes floor { to { background-position: 0 6cqw, 0 0; } }

/* 번개 · 송전선 전류 */
.bolt { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px #FFE14A) drop-shadow(0 0 16px #B18CFF); opacity: 0; animation: bolt 7s linear infinite; }
.bolt--2 { animation-duration: 11s; animation-delay: 3.4s; }
@keyframes bolt { 0%, 91%, 100% { opacity: 0; } 92% { opacity: 1; } 93.5% { opacity: .15; } 95% { opacity: .9; } 97% { opacity: 0; } }
.pulse { fill: #fff; filter: drop-shadow(0 0 5px #8FD8FF) drop-shadow(0 0 10px #8FD8FF); }
.scene__sky { position: absolute; inset: 0 0 31%; background: radial-gradient(60% 80% at 24% 0, rgba(255,255,255,.35), transparent 70%); opacity: 0; animation: bolt 7s linear infinite; pointer-events: none; mix-blend-mode: screen; }

/* 떠오르는 입자 */
.scene__motes { position: absolute; inset: 0; pointer-events: none; }
.scene__motes i { position: absolute; bottom: 26%; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); opacity: 0; animation: mote var(--d) linear var(--w) infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 100% { transform: translate(var(--x), -34cqw); opacity: 0; } }

/* ---------- 사다리 ---------- */
#board .tube__c { stroke: #0A0C2C; stroke-width: 17; stroke-linecap: round; }
#board .tube__l { stroke: #6A70E8; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 4px #6A70E8); }
#board .rung { transition: opacity .12s; }
#board .rung .tube__c { stroke-width: 14; }
#board .rung.is-off { opacity: 0; }
#board .rung.is-flick { animation: flick .32s steps(2) 1; }
@keyframes flick { 0%, 60% { opacity: .25; } 30%, 100% { opacity: 1; } }

#board .res { transition: opacity .4s; }
#board .path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#board .path--glow { stroke: var(--g); stroke-width: 15; opacity: .5; filter: blur(5px); }
#board .path--core { stroke: #EFFFF9; stroke-width: 5.5; filter: drop-shadow(0 0 5px var(--g)) drop-shadow(0 0 12px var(--g)); }
#board .path--flow { stroke: var(--volt); stroke-width: 3.5; stroke-dasharray: 5 34; opacity: 0; filter: drop-shadow(0 0 4px var(--volt)); }
#board.is-done .path--flow { opacity: 1; animation: flow .9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -39; } }
#board .spark, #board .trail { opacity: 0; }
#board .spark { fill: #fff; stroke: var(--volt); stroke-width: 4; filter: drop-shadow(0 0 8px var(--volt)) drop-shadow(0 0 18px #fff); }
#board .trail { fill: var(--volt); filter: drop-shadow(0 0 6px var(--volt)); }
#board.is-run .spark { opacity: 1; }
#board.is-run .trail { opacity: var(--o); }

#board text { font: 800 22px "Pretendard Variable", sans-serif; text-anchor: middle; dominant-baseline: central; fill: #9AA0DC; }
#board .term__box { fill: #12143F; stroke: #4B51B8; stroke-width: 2.5; transition: fill .15s, stroke .15s; }
#board .term__coil { fill: none; stroke: #4B51B8; stroke-width: 3; }
#board .term.is-on .term__box { fill: var(--g); stroke: #D6FFF3; filter: drop-shadow(0 0 12px var(--g)); }
#board .term.is-on .term__coil { stroke: var(--g); filter: drop-shadow(0 0 6px var(--g)); }
#board .term.is-on text { fill: var(--g-ink); }
#board .term.is-scan .term__box { fill: #FFE14A; stroke: #fff; filter: drop-shadow(0 0 12px #FFE14A); }
#board .term.is-scan text { fill: #12143A; }

#board .bulb__ring { fill: none; stroke: #4B51B8; stroke-width: 2; stroke-dasharray: 6 8; transform-box: fill-box; transform-origin: center; animation: spin 14s linear infinite; }
#board .bulb__core { fill: #12143F; stroke: #4B51B8; stroke-width: 2.5; transition: fill .2s; }
#board .bulb__wave { fill: none; stroke-width: 4; opacity: 0; transform-box: fill-box; transform-origin: center; }
#board .bulb__burst circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
#board .bulb[data-b="o"] { --c: #3B82F6; --c2: #9CC4FF; }
#board .bulb[data-b="e"] { --c: #F0475C; --c2: #FFA5B0; }
#board .bulb.is-on .bulb__core { fill: var(--c); stroke: var(--c2); filter: drop-shadow(0 0 10px var(--c)) drop-shadow(0 0 26px var(--c)); animation: glow 1.4s ease-in-out infinite alternate; }
#board .bulb.is-on .bulb__ring { stroke: var(--c2); animation-duration: 3s; }
#board .bulb.is-on text { fill: #fff; }
@keyframes glow { to { filter: drop-shadow(0 0 16px var(--c)) drop-shadow(0 0 40px var(--c)); } }
#board .bulb.is-hit .bulb__wave { stroke: var(--c2); animation: wave .8s ease-out 2; }
@keyframes wave { from { transform: scale(1); opacity: .95; } to { transform: scale(3.4); opacity: 0; } }
#board .bulb.is-hit .bulb__burst circle { fill: var(--c2); animation: burst .75s ease-out 1; }
@keyframes burst { from { transform: rotate(var(--a)) translateX(30px) scale(1.4); opacity: 1; } to { transform: rotate(var(--a)) translateX(118px) scale(.3); opacity: 0; } }

/* 추첨 임박: 직전 결과를 흐리게 하고 숫자를 띄운다 */
.cast.is-soon #board.is-done .res { opacity: .16; }





@media (prefers-reduced-motion: reduce) {
  .scene__floor i, .bolt, .scene__sky, .scene__motes i { animation: none !important; }
}
