/* ==========================================================
   POWER SCORE — 파워세븐볼 중계화면
   배경 그림(img/sevenball-bg.svg) 위에 별 · 별똥별 · 추첨기 · 공 받침 · 합계 게이지 · 연출 레이어를 겹친다.
   무대 공통(.scene, 제목, 타이머, 알림 띠, 결과 칩)은 game.css 에 있다.
   ========================================================== */
.cast[data-g="sb"] .scene { background-image: url(../img/sevenball-bg.svg); }

/* 반짝이는 별 · 별똥별 */
.sb-stars { position: absolute; inset: 0 0 30%; pointer-events: none; }
.sb-stars i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; box-shadow: 0 0 6px #BFE4FF; animation: twinkle var(--d) ease-in-out var(--w) infinite alternate; }
@keyframes twinkle { from { opacity: .15; transform: scale(.6); } to { opacity: 1; transform: scale(1.2); } }
.sb-shoot { position: absolute; left: var(--l); top: var(--t); width: 14cqw; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff); transform: rotate(24deg); opacity: 0; animation: shoot var(--d) linear var(--w) infinite; pointer-events: none; filter: drop-shadow(0 0 4px #8FD8FF); }
@keyframes shoot { 0%, 86% { transform: translate(0, 0) rotate(24deg); opacity: 0; } 88% { opacity: 1; } 100% { transform: translate(38cqw, 17cqw) rotate(24deg); opacity: 0; } }

/* 플랫폼 홀로그램 고리 */
.sb-rings { position: absolute; left: 50%; top: 87%; width: 0; height: 0; pointer-events: none; }
.sb-rings i { position: absolute; left: -30cqw; top: -5cqw; width: 60cqw; height: 10cqw; border-radius: 50%; border: 2px solid rgba(88,182,255,.7); opacity: 0; animation: ring 3.6s ease-out infinite; }
.sb-rings i + i { animation-delay: -1.8s; }
@keyframes ring { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }

/* ---------- 추첨기 ---------- */
#machine .base { fill: #101E5A; stroke: #58B6FF; stroke-width: 2; }
#machine .base2 { fill: #0A1238; stroke: #2B4FB0; stroke-width: 2; }
#machine .glass { fill: rgba(140,200,255,.1); stroke: #BFE4FF; stroke-width: 3; }
#machine .ringm { fill: none; stroke: #58B6FF; stroke-width: 6; filter: drop-shadow(0 0 8px rgba(88,182,255,.8)); }
#machine .shine { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 5; stroke-linecap: round; }
#machine .orbit { fill: none; stroke: rgba(88,182,255,.45); stroke-width: 1.5; stroke-dasharray: 3 9; transform-origin: 450px 200px; animation: orbit 16s linear infinite; }
#machine.is-mix .orbit { animation-duration: 1.6s; stroke: var(--volt); }
@keyframes orbit { to { transform: rotate(360deg); } }
#machine .db { stroke: rgba(10,18,56,.35); stroke-width: 1; }
#machine .chute { fill: #0A1238; stroke: #58B6FF; stroke-width: 2; }
#machine .lamp { fill: #2FE0B0; filter: drop-shadow(0 0 5px #2FE0B0); animation: lampb 1.2s steps(2) infinite; }
#machine.is-mix .lamp { fill: var(--volt); filter: drop-shadow(0 0 6px var(--volt)); animation-duration: .24s; }
@keyframes lampb { 50% { opacity: .35; } }

/* ---------- 공 받침 ---------- */
.sb-tray { position: absolute; left: 50%; top: 62.4%; transform: translateX(-50%); display: flex; gap: .7cqw; padding: .7cqw; border-radius: 4cqw; background: rgba(5,10,38,.72); border: 1px solid rgba(88,182,255,.55); box-shadow: 0 0 2.4cqw rgba(88,182,255,.3), inset 0 0 1.2cqw rgba(88,182,255,.2); }
.sb-slot { position: relative; width: 6cqw; aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(143,216,255,.4); }
.sb-slot::before { content: attr(data-n); position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.8cqw/1 var(--num); color: rgba(143,216,255,.35); }
.sb-ball { position: absolute; inset: -1px; display: grid; place-items: center; border-radius: 50%; font: 800 2.7cqw/1 var(--num); color: #0B1238; box-shadow: inset 0 -.5cqw .8cqw rgba(0,0,0,.35), 0 .5cqw .9cqw rgba(0,0,0,.5); }
.sb-ball::before { content: ""; position: absolute; inset: 19%; border-radius: 50%; background: #fff; box-shadow: inset 0 -.15cqw .3cqw rgba(0,0,0,.2); }
.sb-ball::after { content: ""; position: absolute; left: 18%; top: 10%; width: 30%; height: 18%; border-radius: 50%; background: rgba(255,255,255,.65); transform: rotate(-28deg); }
.sb-ball b { position: relative; font-weight: 800; }
.sb-ball--blue { background: radial-gradient(circle at 34% 26%, #8FC0FF, #2F6FE0 62%, #173F9A); }
.sb-ball--red  { background: radial-gradient(circle at 34% 26%, #FFA5B0, #E0364C 62%, #94142A); }
.sb-ball.is-drop { animation: drop .75s cubic-bezier(.2,.9,.3,1.15) both; }
@keyframes drop { 0% { transform: translate(calc((3 - var(--i)) * 6.7cqw), -9.5cqw) scale(.3) rotate(-420deg); opacity: 0; } 20% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.sb-tray.is-out .sb-ball { transform: translateY(2cqw) scale(.4); opacity: 0; transition: transform .3s ease-in, opacity .3s ease-in; }

/* ---------- 합계 게이지 ---------- */
.sb-gauge { position: absolute; left: 50%; top: 75.6%; transform: translateX(-50%); display: flex; align-items: center; gap: 1.6cqw; white-space: nowrap; }
.sb-sum { display: flex; align-items: baseline; gap: .6cqw; font-size: max(10px, 1.4cqw); font-weight: 600; color: var(--on-ink-2); }
.sb-sum b { min-width: 6.4cqw; font: 800 3.6cqw/1 var(--num); color: #fff; text-align: right; }
.sb-bar { position: relative; width: 30cqw; height: 1.3cqw; border-radius: 1cqw; background: linear-gradient(90deg, #2F6FE0 0 50.2%, #E0364C 50.2% 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.sb-bar::before { content: "LO 28"; position: absolute; left: 0; top: 1.7cqw; font: 600 max(9px, 1.15cqw)/1 var(--num); color: #8FC0FF; }
.sb-bar::after { content: "315 HI"; position: absolute; right: 0; top: 1.7cqw; font: 600 max(9px, 1.15cqw)/1 var(--num); color: #FFA5B0; }
.sb-bar em { position: absolute; left: 50.2%; top: 1.7cqw; transform: translateX(-50%); font: 600 max(9px, 1.15cqw)/1 var(--num); font-style: normal; color: var(--on-ink-3); }
.sb-bar i { position: absolute; left: var(--p, 0%); top: 50%; width: 2.2cqw; height: 2.2cqw; margin: -1.1cqw 0 0 -1.1cqw; border-radius: 50%; background: #fff; border: .45cqw solid var(--volt); box-shadow: 0 0 1.2cqw var(--volt); transition: left .5s cubic-bezier(.2,.9,.3,1); }
.sb-tally { display: flex; align-items: center; gap: .6cqw; font: 800 2.4cqw/1 var(--num); color: #fff; }
.sb-tally i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; }
.sb-tally i.b { background: #2F6FE0; box-shadow: 0 0 .8cqw #2F6FE0; } .sb-tally i.r { background: #E0364C; box-shadow: 0 0 .8cqw #E0364C; }
.sb-tally span { color: var(--on-ink-3); font-size: .8em; }

.cast[data-g="sb"] .scene__count { top: 37%; font-size: 13cqw; }
.cast[data-g="sb"] .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); }

/* ---------- 목록 · 표 ---------- */
.cast__side--sb .cast__thead, .cast__side--sb .cast__list li { grid-template-columns: 1fr 40px 38px 38px 38px; padding-right: 10px; }
.cast__side--sb .cast__list li > span:nth-child(2) { font: 700 15px var(--num); color: var(--on-ink); }
.cast__side--sb .cast__list .chip { min-width: 30px; padding: 0 6px; }
.mb { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: 0 1px; border-radius: 50%; font: 800 12px/1 var(--num); color: #fff; vertical-align: middle; }
.mb--blue { background: #2F6FE0; } .mb--red { background: #E0364C; }
.hist td.sum { font: 700 16px var(--num); color: var(--text); }

/* ---------- 번호별 출현 ---------- */
.heat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; padding: 16px 18px 18px; }
.heat div { display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 10px; background: rgba(47,111,224, calc(.06 + var(--h) * .8)); color: var(--text); }
.heat div.is-hot { color: #fff; }
.heat b { font: 800 15px/1 var(--num); }
.heat span { font: 600 11px/1 var(--num); opacity: .75; }
.heat .is-top { box-shadow: 0 0 0 2px var(--volt); }

@media (max-width: 760px) {
  .heat { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 12px; }
  .mb { width: 22px; height: 22px; font-size: 10px; margin: 0; }
  .sb-gauge { gap: 1.2cqw; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-stars i, .sb-shoot, .sb-rings i, #machine .orbit, #machine .lamp { animation: none !important; }
}
