/* POWER SCORE — 게임 세트 7(네온 골드 스튜디오) · 3안의 공통 연출 (game/set-7-3/roulette.html · ladder.html)
   2안 위에 "시간에 따라 달아오르는 무대"와 "결과 연출"을 얹는다. 움직이는 쪽은 js/s7-show.js. (세븐볼 3안은 먼저 만든 set-7-sevenball3.css · sevenball-s7-show.js 를 쓴다)
   - 기다리는 동안: 천장 조명(.s7s-beams)이 천천히 훑는다. 주인공(휠 · 사다리)에 힘이 모이는 모습은 js 가 캔버스에 그린다
   - 30초 전(.s7s-warm): 조명이 밝아지고 빨라진다.  10초 전(.s7s-hot): 가장자리가 어두워지고 조명이 가운데로 모인다.  3 · 2 · 1(.s7s-count)
   - 결과(.s7s-result): 화면이 흔들리고 잠깐 어두워졌다가, 결과 글자(.s7s-big)가 크게 찍혀 결과 판으로 내려앉는다. 당첨 색 조명 · 색종이
   페이지가 무대(.scene)에 넣는 값: --cx · --cy 주인공의 가운데, --hole 10초 전에 밝게 남는 원의 반지름, --by 결과 글자의 높이, --ty 알림 띠의 높이. --sc 는 js 가 넣는 당첨 색
   자리는 모두 무대 폭 기준(cqw) */
.s7s-beams, .s7s-rays, .s7s-dim, .s7s-fx, .s7s-count, .s7s-big, .s7s-toast { position: absolute; pointer-events: none; }
.s7s-fx { inset: 0; width: 100%; height: 100%; z-index: 6; }

/* ---------- 천장 조명 ---------- */
.s7s-beams { inset: 0; overflow: hidden; --bc: 190,222,255; opacity: .3; transition: opacity .8s; }
.s7s-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: s7sSwing var(--d) ease-in-out var(--dl) infinite alternate; }
@keyframes s7sSwing { from { transform: rotate(var(--a)); } to { transform: rotate(var(--b)); } }
.s7s-warm .s7s-beams { opacity: .55; }
.s7s-warm .s7s-beams i { animation-duration: calc(var(--d) * .45); }
.s7s-hot .s7s-beams { opacity: .8; }
.s7s-hot .s7s-beams i { animation: s7sAim .9s ease-in-out infinite alternate; }
@keyframes s7sAim { from { transform: rotate(calc(var(--aim) - 2deg)); } to { transform: rotate(calc(var(--aim) + 2deg)); } }
.s7s-beams.is-sweep { opacity: .7; }
.s7s-beams.is-sweep i { animation: s7sSweepB 2.4s ease-in-out 1; }
@keyframes s7sSweepB { 0%, 100% { transform: rotate(var(--a)); } 35% { transform: rotate(calc(var(--b) * 2.2)); } 70% { transform: rotate(calc(var(--a) * 2.2)); } }
.s7s-result .s7s-beams { opacity: .9; --bc: var(--sc, 255,196,70); }
.s7s-result .s7s-beams i { animation-duration: .7s; }

/* ---------- 결과: 주인공 뒤에서 당첨 색 빛줄기가 돌며 뻗는다 (룰렛은 2안에 이미 있어 넣지 않는다) ---------- */
.s7s-rays { left: var(--cx); top: var(--cy); width: 110cqw; height: 110cqw; margin: -55cqw 0 0 -55cqw; border-radius: 50%; mix-blend-mode: screen; opacity: 0;
  background: repeating-conic-gradient(rgba(var(--sc, 255,196,70), 0) 0deg, rgba(var(--sc, 255,196,70), .8) 3deg, rgba(var(--sc, 255,196,70), 0) 7deg 20deg); -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent 90%); mask-image: radial-gradient(closest-side, #000 25%, transparent 90%); }
.s7s-result .s7s-rays { animation: s7sRays 3.6s ease-out 1; }
@keyframes s7sRays { 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); } }

/* ---------- 어둠 ---------- */
.s7s-dim { inset: 0; background: radial-gradient(circle at var(--cx) var(--cy), transparent var(--hole, 18cqw), rgba(2,4,24,.82) calc(var(--hole, 18cqw) + 30cqw)); opacity: 0; transition: opacity 1s; }
.s7s-hot .s7s-dim { opacity: 1; animation: s7sBeat .5s ease-in-out infinite alternate; }
@keyframes s7sBeat { from { opacity: .78; } to { opacity: 1; } }
.s7s-result .s7s-dim { background: rgba(2,4,24,.62); animation: s7sBlack 2.4s ease-out 1; }
@keyframes s7sBlack { 0% { opacity: 0; } 6% { opacity: 1; } 22% { opacity: .7; } 100% { opacity: 0; } }

/* ---------- 3 · 2 · 1 ---------- */
.s7s-count { left: var(--cx); top: var(--cy); 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)); }
.s7s-count.is-beat { animation: s7sCount .95s cubic-bezier(.2,1.5,.4,1) 1; }
@keyframes s7sCount { 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); } }

/* ---------- 알림 띠 ---------- */
.s7s-toast { left: 50%; top: var(--ty, 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); }
.s7s-toast b { color: #FFD04A; font-family: Outfit, sans-serif; font-size: 1.3em; margin: 0 .15em; }
.s7s-toast.is-on { animation: s7sToast 2.2s ease-out 1; }
@keyframes s7sToast { 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); } }

/* ---------- 결과 글자: 큰 글자가 먼저 찍히고 나머지가 차례로 찍힌 뒤, 통째로 결과 판 쪽으로 내려앉는다 ---------- */
.s7s-big { left: 50%; top: var(--by, 25.5cqw); z-index: 7; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; opacity: 0; }
.s7s-big.is-on { animation: s7sBig 3s ease-in 1; }
@keyframes s7sBig { 0%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, calc(52cqw - var(--by, 25.5cqw))) scale(.28); } }
.s7s-big .main { display: inline-block; font: 800 11cqw/1 Outfit, Pretendard Variable, Pretendard, 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: s7sStamp .5s cubic-bezier(.2,1.5,.4,1) both; }
/* 큰 글자를 색 원판에 담는 경우(룰렛의 번호, 사다리의 홀 · 짝) */
.s7s-big .main.disc { width: 15cqw; height: 15cqw; line-height: 14.4cqw; border-radius: 50%; font-size: 9cqw; color: #fff; -webkit-background-clip: border-box; background-clip: border-box; text-shadow: 0 .3cqw .6cqw rgba(0,0,30,.7); border: .5cqw solid #FFE9A0;
  background: radial-gradient(circle at 35% 28%, #7FC0FF, #1F5FE0 55%, #0E2E86); box-shadow: 0 0 3cqw rgba(70,140,255,.95), inset 0 -.8cqw 1.4cqw rgba(0,0,40,.5); filter: none; }
.s7s-big .main.disc.red { background: radial-gradient(circle at 35% 28%, #FF9A8A, #E0283C 55%, #7E0E20); box-shadow: 0 0 3cqw rgba(255,80,80,.95), inset 0 -.8cqw 1.4cqw rgba(40,0,0,.5); }
.s7s-big .main.disc.gold { background: radial-gradient(circle at 35% 28%, #FFF0A8, #F2A900 55%, #8A5200); box-shadow: 0 0 3cqw rgba(255,190,60,.95), inset 0 -.8cqw 1.4cqw rgba(60,30,0,.5); }
.s7s-big .main.disc.purple { background: radial-gradient(circle at 35% 28%, #D2B0FF, #7C3FE8 55%, #3A1486); box-shadow: 0 0 3cqw rgba(170,110,255,.95), inset 0 -.8cqw 1.4cqw rgba(20,0,60,.5); }
.s7s-big .row { display: flex; justify-content: center; gap: 1.6cqw; margin-top: 1.2cqw; }
.s7s-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, #5C6C9E, #2A3460 60%, #161C3E); box-shadow: 0 0 2.2cqw rgba(150,170,255,.7), inset 0 .3cqw .5cqw rgba(255,255,255,.35); animation: s7sStamp .45s cubic-bezier(.2,1.5,.4,1) both; }
.s7s-big .w.blue { 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); }
.s7s-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); }
.s7s-big .w.gold { background: linear-gradient(180deg, #FFE488, #F2A900 60%, #A66400); box-shadow: 0 0 2.2cqw rgba(255,190,60,.95), inset 0 .3cqw .5cqw rgba(255,255,255,.45); }
.s7s-big .w.purple { background: linear-gradient(180deg, #C9A2FF, #7C3FE8 60%, #4A1CA6); box-shadow: 0 0 2.2cqw rgba(170,110,255,.95), inset 0 .3cqw .5cqw rgba(255,255,255,.45); }
.s7s-big .w:nth-child(1) { animation-delay: .45s; } .s7s-big .w:nth-child(2) { animation-delay: .75s; } .s7s-big .w:nth-child(3) { animation-delay: 1.05s; }
@keyframes s7sStamp { 0% { opacity: 0; transform: scale(3); } 60% { opacity: 1; transform: scale(.9); } 100% { opacity: 1; transform: scale(1); } }

/* ---------- 결과: 화면이 한 번 흔들린다. 기다리는 동안: 결과 단추가 차례로 반짝인다 ---------- */
.s7 .cast .scene.s7s-result { animation: s7sShake .5s linear 1; }
@keyframes s7sShake { 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); } }
.scene__verdict.s7s-chips .chip, .scene__verdict.s7s-chips .nb { animation: s7sChip .5s ease-out 1; }
.scene__verdict.s7s-chips > :nth-child(3) { animation-delay: .15s; } .scene__verdict.s7s-chips > :nth-child(4) { animation-delay: .3s; } .scene__verdict.s7s-chips > :nth-child(5) { animation-delay: .45s; }
@keyframes s7sChip { 0%, 100% { transform: none; } 40% { transform: scale(1.22); box-shadow: 0 0 1.6cqw #fff; } }

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