/* POWER SCORE — 게임 세트 7(네온 골드 스튜디오) · 파워세븐볼 3안 (game/set-7-3/sevenball.html)
   2안(set-7-sevenball2.css · sevenball-s7-fx.js)에 "연출"을 얹는다. 2안과 다른 점만 여기에 둔다. 움직이는 쪽은 js/sevenball-s7-show.js
   - 기다리는 동안: 천장 조명(.sbs-beams)이 천천히 훑고, 몇 초마다 작은 이벤트(공 받침의 물결 · 유리 테두리를 도는 빛 · 별똥별 · 결과 단추의 반짝임 · 조명 훑기)가 지나간다
   - 30초 전(.sbs-warm): 조명이 밝아지고 빨라진다.  10초 전(.sbs-hot): 무대 가장자리가 어두워지고 조명이 추첨기로 모인다.  3 · 2 · 1(.sbs-321): 큰 숫자
   - 결과(.sbs-result): 화면이 한 번 흔들리고 어두워졌다가, 결과 글자가 크게 찍혀 결과 판으로 내려앉는다. 많이 나온 색의 빛줄기, 색종이, 공 7개의 물결
   자리는 모두 무대 폭 기준(cqw)이다. 유리통의 중심은 49.9cqw · 27.9cqw */
.sbs-beams, .sbs-rays, .sbs-dim, .sbs-fx, .sbs-count, .sbs-big, .sbs-toast { position: absolute; pointer-events: none; }
.sbs-fx { inset: 0; width: 100%; height: 100%; z-index: 6; }

/* ---------- 천장 조명: 위에서 내려오는 빛기둥 넷이 좌우로 천천히 흔들린다 (추첨기 뒤) ---------- */
.sbs-beams { inset: 0; overflow: hidden; --bc: 190,222,255; opacity: .3; transition: opacity .8s; }
.sbs-beams i { position: absolute; left: var(--x); top: -5cqw; width: 11cqw; height: 54cqw; margin-left: -5.5cqw; transform-origin: 50% 0; mix-blend-mode: screen; filter: blur(.5cqw);
  background: linear-gradient(to bottom, rgba(var(--bc), .75), rgba(var(--bc), .28) 55%, transparent 92%); clip-path: polygon(43% 0, 57% 0, 100% 100%, 0 100%);
  animation: sbsSwing var(--d) ease-in-out var(--dl) infinite alternate; }
@keyframes sbsSwing { from { transform: rotate(var(--a)); } to { transform: rotate(var(--b)); } }
.sbs-warm .sbs-beams { opacity: .55; }
.sbs-warm .sbs-beams i { animation-duration: calc(var(--d) * .45); }
.sbs-hot .sbs-beams { opacity: .8; }
.sbs-hot .sbs-beams i { animation: sbsAim .9s ease-in-out infinite alternate; }               /* 추첨기를 겨눈 채 떤다 */
@keyframes sbsAim { from { transform: rotate(calc(var(--aim) - 2deg)); } to { transform: rotate(calc(var(--aim) + 2deg)); } }
.sbs-beams.is-sweep { opacity: .7; }
.sbs-beams.is-sweep i { animation: sbsSweepB 2.4s ease-in-out 1; }
@keyframes sbsSweepB { 0%, 100% { transform: rotate(var(--a)); } 35% { transform: rotate(calc(var(--b) * 2.2)); } 70% { transform: rotate(calc(var(--a) * 2.2)); } }
.sbs-result .sbs-beams { opacity: .9; --bc: var(--hc); }
.sbs-result .sbs-beams i { animation-duration: .7s; }

/* ---------- 결과: 추첨기 뒤에서 많이 나온 색의 빛줄기가 돌며 뻗는다 ---------- */
.sbs-rays { left: 49.9cqw; top: 27.9cqw; width: 110cqw; height: 110cqw; margin: -55cqw 0 0 -55cqw; border-radius: 50%; mix-blend-mode: screen; opacity: 0;
  background: repeating-conic-gradient(rgba(var(--hc), 0) 0deg, rgba(var(--hc), .8) 3deg, rgba(var(--hc), 0) 7deg 20deg); -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent 90%); mask-image: radial-gradient(closest-side, #000 25%, transparent 90%); }
.sbs-result .sbs-rays { animation: sbsRays 3.6s ease-out 1; }
@keyframes sbsRays { 0% { opacity: 0; transform: rotate(0deg) scale(.5); } 10% { opacity: 1; transform: rotate(8deg) scale(1); } 70% { opacity: .7; } 100% { opacity: 0; transform: rotate(80deg) scale(1.05); } }

/* ---------- 기다리는 동안: 유리 위를 빛줄기가 비스듬히 훑고 지나간다 (추첨 중에는 숨긴다). 나머지 추첨기 효과는 js 가 캔버스에 그린다 ---------- */
.sbs-shine { position: absolute; pointer-events: none; left: 49.9cqw; top: 27.9cqw; width: 22.2cqw; height: 22.2cqw; margin: -11.1cqw 0 0 -11.1cqw; border-radius: 50%; overflow: hidden; mix-blend-mode: screen; }
.sbs-shine::before { content: ""; position: absolute; left: -60%; top: -20%; width: 34%; height: 140%; transform: rotate(20deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.8) 45%, rgba(190,225,255,.5) 60%, transparent); animation: sbsShine 4.2s ease-in-out infinite; }
@keyframes sbsShine { 0%, 45% { left: -60%; } 80%, 100% { left: 130%; } }
.sbs-warm .sbs-shine::before { animation-duration: 2.2s; }
.sbs-hot .sbs-shine::before { animation-duration: 1s; }
.scene:has(#machine.is-mix) .sbs-shine { display: none; }

/* ---------- 어둠: 10초 전에는 가장자리가 어두워져 추첨기만 밝게 남는다. 결과가 나오는 순간에는 한 번 깜깜해졌다 풀린다 (추첨기 앞, 제목 · 타이머 · 결과 판 뒤) ---------- */
.sbs-dim { inset: 0; background: radial-gradient(circle at 49.9cqw 27.9cqw, transparent 15cqw, rgba(2,4,24,.82) 44cqw); opacity: 0; transition: opacity 1s; }
.sbs-hot .sbs-dim { opacity: 1; animation: sbsBeat .5s ease-in-out infinite alternate; }
@keyframes sbsBeat { from { opacity: .78; } to { opacity: 1; } }
.sbs-result .sbs-dim { background: rgba(2,4,24,.62); animation: sbsBlack 2.4s ease-out 1; }
@keyframes sbsBlack { 0% { opacity: 0; } 6% { opacity: 1; } 22% { opacity: .7; } 100% { opacity: 0; } }

/* ---------- 3 · 2 · 1: 추첨기 위에 큰 숫자가 쿵 찍힌다 (원래의 작은 초읽기는 그동안 숨긴다) ---------- */
.sbs-count { left: 49.9cqw; top: 27.9cqw; z-index: 7; transform: translate(-50%, -50%); font: 800 24cqw/1 Outfit, sans-serif; letter-spacing: -.02em; opacity: 0;
  background: linear-gradient(180deg, #FFFFFF 8%, #FFE48A 38%, #FFB21E 62%, #C96A00 92%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 .25cqw #5A2A00) drop-shadow(0 .4cqw 0 rgba(60,20,0,.9)) drop-shadow(0 0 2.4cqw rgba(255,170,40,.95)); }
.sbs-count.is-beat { animation: sbsCount .95s cubic-bezier(.2,1.5,.4,1) 1; }
@keyframes sbsCount { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } 16% { opacity: 1; transform: translate(-50%, -50%) scale(.92); } 26% { transform: translate(-50%, -50%) scale(1.06); } 34%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
.s7 .cast[data-g="sb"] .scene.sbs-321 #count { opacity: 0 !important; }

/* ---------- 알림 띠: "추첨 30초 전" · "추첨 10초 전" · "마지막 공" ---------- */
.sbs-toast { left: 50%; top: 38.6cqw; z-index: 7; transform: translateX(-50%); padding: .7cqw 3.2cqw; border-radius: 3cqw; white-space: nowrap; font: 800 2.3cqw/1.2 Pretendard Variable, Pretendard, sans-serif; color: #FFF3C4; letter-spacing: .04em; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(6,10,50,.92) 14% 86%, transparent); border-top: .14cqw solid rgba(255,206,96,.9); border-bottom: .14cqw solid rgba(255,206,96,.9); text-shadow: 0 0 1cqw rgba(255,190,60,.9); }
.sbs-toast b { color: #FFD04A; font-family: Outfit, sans-serif; font-size: 1.3em; margin: 0 .15em; }
.sbs-toast.is-on { animation: sbsToast 2.2s ease-out 1; }
.sbs-toast.is-quick.is-on { animation-duration: 1s; }
@keyframes sbsToast { 0% { opacity: 0; transform: translateX(-50%) scaleX(.3); } 12% { opacity: 1; transform: translateX(-50%) scaleX(1.06); } 18%, 80% { opacity: 1; transform: translateX(-50%) scaleX(1); } 100% { opacity: 0; transform: translateX(-50%) scaleX(1) translateY(-1cqw); } }

/* ---------- 결과 글자: 합계가 먼저 찍히고 하이로우 · 컬러 · 홀짝이 차례로 찍힌 뒤, 통째로 결과 판 쪽으로 내려앉는다 ---------- */
.sbs-big { left: 50%; top: 25.5cqw; z-index: 7; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; opacity: 0; }
.sbs-big.is-on { animation: sbsBig 3s ease-in 1; }
@keyframes sbsBig { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, 24cqw) scale(.28); } }
.sbs-big .sum { display: block; font: 800 10.5cqw/1 Outfit, sans-serif; letter-spacing: -.01em; background: linear-gradient(180deg, #FFFFFF 8%, #FFE48A 38%, #FFB21E 62%, #C96A00 92%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 .2cqw #5A2A00) drop-shadow(0 .3cqw 0 rgba(60,20,0,.9)) drop-shadow(0 0 2cqw rgba(255,170,40,.95)); animation: sbsStamp .5s cubic-bezier(.2,1.5,.4,1) both; }
.sbs-big .sum small { font: 800 .42em/1 Pretendard Variable, Pretendard, sans-serif; margin-right: .2em; }
.sbs-big .row { display: flex; justify-content: center; gap: 1.6cqw; margin-top: 1cqw; }
.sbs-big .w { min-width: 11cqw; padding: .7cqw 2cqw .8cqw; border-radius: 3cqw; font: 800 4.4cqw/1.1 Pretendard Variable, Pretendard, sans-serif; color: #fff; text-shadow: 0 .2cqw .4cqw rgba(0,0,30,.7); border: .22cqw solid rgba(255,226,150,.95);
  background: linear-gradient(180deg, #6FB6FF, #1F5FE0 60%, #123C9E); box-shadow: 0 0 2.2cqw rgba(70,140,255,.95), inset 0 .3cqw .5cqw rgba(255,255,255,.45); animation: sbsStamp .45s cubic-bezier(.2,1.5,.4,1) both; }
.sbs-big .w.red { background: linear-gradient(180deg, #FF8A7A, #E0283C 60%, #9A1226); box-shadow: 0 0 2.2cqw rgba(255,80,80,.95), inset 0 .3cqw .5cqw rgba(255,255,255,.45); }
.sbs-big .w:nth-child(1) { animation-delay: .45s; } .sbs-big .w:nth-child(2) { animation-delay: .75s; } .sbs-big .w:nth-child(3) { animation-delay: 1.05s; }
@keyframes sbsStamp { 0% { opacity: 0; transform: scale(3); } 60% { opacity: 1; transform: scale(.9); } 100% { opacity: 1; transform: scale(1); } }

/* ---------- 결과: 화면이 한 번 흔들리고, 공 7개가 차례로 튀어 오른다 ---------- */
.s7 .cast[data-g="sb"] .scene.sbs-result { animation: sbsShake .5s linear 1; }
@keyframes sbsShake { 0%, 100% { transform: none; } 15% { transform: translate(-.5cqw, .3cqw); } 30% { transform: translate(.45cqw, -.3cqw); } 45% { transform: translate(-.3cqw, -.2cqw); } 60% { transform: translate(.25cqw, .2cqw); } 80% { transform: translate(-.1cqw, 0); } }
.sbs-result .sb-slot, .sbs-wave .sb-slot { animation: sbsHop .55s cubic-bezier(.3,0,.3,1) 2; }
.sbs-wave .sb-slot { animation-iteration-count: 1; }
@keyframes sbsHop { 0%, 100% { transform: none; filter: none; } 40% { transform: translateY(-1.5cqw) scale(1.12); filter: brightness(1.5); } }
.sb-slot:nth-child(2) { animation-delay: .08s !important; } .sb-slot:nth-child(3) { animation-delay: .16s !important; } .sb-slot:nth-child(4) { animation-delay: .24s !important; }
.sb-slot:nth-child(5) { animation-delay: .32s !important; } .sb-slot:nth-child(6) { animation-delay: .4s !important; } .sb-slot:nth-child(7) { animation-delay: .48s !important; }

/* 공이 받침에 꽂힐 때마다 받침이 살짝 눌리고 합계 숫자가 튄다 */
.sb-tray.sbs-thump { animation: sbsThump .28s ease-out 1; }
@keyframes sbsThump { 0% { transform: translateX(-50%) translateY(0); } 35% { transform: translateX(-50%) translateY(.5cqw); } 100% { transform: translateX(-50%) translateY(0); } }
#sum.sbs-tick { animation: sbsTick .3s ease-out 1; display: inline-block; }
@keyframes sbsTick { 0% { transform: scale(1.7); filter: brightness(1.8); } 100% { transform: none; filter: none; } }

/* 기다리는 동안: 결과 단추가 차례로 반짝인다 */
.scene__verdict.sbs-chips .chip { animation: sbsChip .5s ease-out 1; }
.scene__verdict.sbs-chips .chip:nth-of-type(3) { animation-delay: .15s; } .scene__verdict.sbs-chips .chip:nth-of-type(4) { animation-delay: .3s; } .scene__verdict.sbs-chips .chip:nth-of-type(5) { animation-delay: .45s; }
@keyframes sbsChip { 0%, 100% { transform: none; } 40% { transform: scale(1.22); box-shadow: 0 0 1.6cqw #fff; } }

@media (prefers-reduced-motion: reduce) {
  .sbs-beams i { animation: none !important; }
  .sbs-fx, .sbs-dim, .sbs-rays, .sbs-count, .sbs-big, .sbs-toast, .sbs-shine { display: none; }
}
