/* ==========================================================
   POWER SCORE — 파워룰렛 중계화면
   배경 그림(img/roulette-bg.svg) 위에 조명 · 불꽃놀이 · 룰렛 휠 · 색종이 · 연출 레이어를 겹친다.
   무대 공통(.scene, 제목, 타이머, 알림 띠, 결과 칩)은 game.css 에 있다.
   컬러: 골드 / 퍼플 (바깥 링), 홀 / 짝 (안쪽 링)
   ========================================================== */
.cast[data-g="rl"] .scene { background-image: url(../img/roulette-bg.svg); }
:root { --gold: #F5B301; --gold-l: #FFD23F; --gold-ink: #2A1B00; --purple: #7C4DE8; --purple-l: #C4A8FF; }

/* 조명 빔 */
.rl-beam { position: absolute; bottom: 0; width: 26cqw; height: 62cqw; transform-origin: 50% 100%; background: linear-gradient(to top, rgba(255,225,74,.3), rgba(255,225,74,0) 82%); clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0); mix-blend-mode: screen; pointer-events: none; animation: beam 6s ease-in-out infinite alternate; }
.rl-beam--l { left: -4cqw; --a: 8deg; --b: 34deg; }
.rl-beam--r { right: -4cqw; --a: -8deg; --b: -34deg; animation-duration: 7.5s; background: linear-gradient(to top, rgba(177,140,255,.4), rgba(177,140,255,0) 82%); }
@keyframes beam { from { transform: rotate(var(--a)); } to { transform: rotate(var(--b)); } }

/* 불꽃놀이 */
.fw { transform-box: fill-box; transform-origin: center; opacity: 0; animation: fw var(--d) ease-out var(--w) infinite; }
.fw line { stroke: var(--c); stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--c)); }
@keyframes fw { 0% { transform: scale(.05); opacity: 0; } 8% { opacity: 1; } 35% { transform: scale(1); opacity: 1; } 55%, 100% { transform: scale(1.12); opacity: 0; } }

/* ---------- 룰렛 휠 ---------- */
#wheel .rim { fill: #2A1650; stroke: #C9A24A; stroke-width: 6; }
#wheel .rim2 { fill: none; stroke: #7A5A1E; stroke-width: 2; }
#wheel .bulb { fill: #6A5320; animation: chase 1.2s steps(1) infinite; animation-delay: calc(var(--i) * -.4s); }
@keyframes chase { 0%, 33% { fill: #FFF3C4; filter: drop-shadow(0 0 5px #FFE14A); } 34%, 100% { fill: #6A5320; filter: none; } }
.cast.is-soon #wheel .bulb, #wheel.is-spin .bulb { animation-duration: .36s; animation-delay: calc(var(--i) * -.12s); }
#wheel .ring { transform-origin: 450px 268px; }
#wheel .w { stroke: #1A0C3A; stroke-width: 1.5; transition: opacity .3s; }
#wheel .w--gold { fill: var(--gold); } #wheel .w--purple { fill: var(--purple); }
#wheel .w--odd { fill: #2F6FE0; } #wheel .w--even { fill: #D93A52; }
#wheel text { text-anchor: middle; dominant-baseline: central; font-family: var(--num); font-weight: 800; }
#wheel .n { font-size: 19px; fill: #fff; }
#wheel .n--gold { fill: var(--gold-ink); }
#wheel .oe { font: 800 14px "Pretendard Variable", sans-serif; fill: #fff; }
#wheel .sep { fill: none; stroke: #C9A24A; stroke-width: 4; }
#wheel.is-done .w:not(.is-hit), #wheel.is-done .n:not(.is-hit), #wheel.is-done .oe:not(.is-hit) { opacity: .38; }
#wheel .w.is-hit { animation: hit .5s steps(2) 6; stroke: #fff; stroke-width: 3; }
@keyframes hit { 50% { filter: brightness(1.7); } }

#wheel .hub { fill: #12062E; stroke: #C9A24A; stroke-width: 5; }
#wheel .hub__n { font-size: 50px; fill: #fff; }
#wheel .hub__n.is-gold { fill: var(--gold-l); } #wheel .hub__n.is-purple { fill: var(--purple-l); }
#wheel .hub__n.is-wait { font: 800 19px "Pretendard Variable", sans-serif; fill: var(--on-ink-2); }
#wheel .hub__n.is-count { fill: var(--volt); font-size: 54px; }
#wheel .hub__s { font: 700 12px "Pretendard Variable", sans-serif; fill: var(--on-ink-2); }
#wheel .pin { fill: var(--volt); stroke: #12143A; stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); transform-origin: 450px 62px; }
#wheel.is-spin .pin { animation: tick .14s linear infinite alternate; }
@keyframes tick { from { transform: rotate(-9deg); } to { transform: rotate(4deg); } }
#wheel .pin2 { fill: #fff; stroke: #12143A; stroke-width: 1.5; stroke-linejoin: round; }
#wheel.is-pop .hub__n { animation: hubpop .5s cubic-bezier(.2,1.5,.4,1) 1; transform-box: fill-box; transform-origin: center; }
@keyframes hubpop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* 색종이 */
.rl-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.rl-confetti i { position: absolute; left: 50%; top: 49%; width: var(--s); height: calc(var(--s) * 1.6); background: var(--c); border-radius: 2px; opacity: 0; animation: conf 1.5s cubic-bezier(.15,.7,.4,1) var(--w) 1 both; }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

.cast[data-g="rl"] .scene__banner { top: 4%; left: 30%; right: 30%; height: 6cqw; font-size: 2.8cqw; border-radius: 3cqw; border: 2px solid var(--volt); background: rgba(8,9,32,.9); }

/* ---------- 골드 · 퍼플 표시 ---------- */
.chip--gold { background: var(--gold); color: var(--gold-ink); }
.chip--purple { background: var(--purple); color: #fff; }
.panel .chip--gold { background: #FFF1C2; color: #8A6200; box-shadow: none; }
.panel .chip--purple { background: #ECE3FF; color: #5B2FD0; box-shadow: none; }
.nb { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font: 800 14px/1 var(--num); }
.nb--gold { background: var(--gold); color: var(--gold-ink); } .nb--purple { background: var(--purple); color: #fff; }
.cast__side--rl .cast__thead, .cast__side--rl .cast__list li { grid-template-columns: 1fr 44px 56px 46px; }
.cast__side--rl .nb { width: 26px; height: 26px; font-size: 13px; }

.is-gp .vs .a strong { color: #B07F00; } .is-gp .vs .b strong { color: #5B2FD0; }
.is-gp .split i { background: var(--gold); } .is-gp .split i + i { background: var(--purple); }
.t-g { color: #B07F00; } .t-p { color: #5B2FD0; }
.pinfo.is-gp .a { background: #FFF1C2; color: #8A6200; } .pinfo.is-gp .a b { color: #8A6200; }
.pinfo.is-gp .b { background: #ECE3FF; color: #5B2FD0; } .pinfo.is-gp .b b { color: #5B2FD0; }
.pgrid.is-gp .a .hd { background: var(--gold); color: var(--gold-ink); } .pgrid.is-gp .b .hd { background: var(--purple); }
.pgrid.is-gp .a li:not(.hd):not(.ct) { background: #FFF1C2; color: #8A6200; }
.pgrid.is-gp .b li:not(.hd):not(.ct) { background: #ECE3FF; color: #5B2FD0; }

/* ---------- 번호별 출현 ---------- */
.freq { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; align-items: end; height: 150px; padding: 18px 18px 0; }
.freq div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.freq i { display: block; width: 100%; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .4s; }
.freq .gold i { background: var(--gold); } .freq .purple i { background: var(--purple); }
.freq span { font: 600 11px/1 var(--num); color: var(--muted); }
.freq .is-top span { color: var(--text); font-weight: 800; }
.freq-x { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; padding: 6px 18px 16px; border-top: 1px solid var(--line); margin-top: 0; }
.freq-x b { display: grid; place-items: center; aspect-ratio: 1; max-height: 28px; border-radius: 50%; font: 800 12px/1 var(--num); }
.freq-x .gold { background: #FFF1C2; color: #8A6200; } .freq-x .purple { background: #ECE3FF; color: #5B2FD0; }
.guide__wheel { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.guide__wheel .nb { width: 24px; height: 24px; font-size: 12px; }

@media (max-width: 760px) {
  .freq { gap: 2px; padding: 14px 12px 0; height: 120px; }
  .freq span { font-size: 8px; }
  .freq-x { gap: 2px; padding: 5px 12px 12px; }
  .freq-x b { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .rl-beam, .fw, #wheel .bulb { animation: none !important; }
}
