/* 첫 화면 장면(1240×720 무대 좌표). 방 그림 img/scene/room.webp(1536×1024)을 740×493 으로 놓고,
   모니터 화면 · 책상 위 폰 자리는 그 그림 좌표를 0.4818 배 한 값이다. 그림이 없으면 .room-ph 상자가 대신 보인다.
   알림 카드 · 음성 막대 · 순위 · 투표 · 룰렛 · 미션 모양(.al .tts .rank .vote .roul .mis)은 구역 그림(.mock)에서도 같이 쓴다. */
.room { position: absolute; left: 190px; top: 64px; width: 740px; height: 493px; }
.room-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.room-ph { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.room.ok .room-ph { display: none; }
/* 앉은 크리에이터(scene-streamer.js): 방 그림 위 · 모니터 알림(.rmon) · 폰 알림(.push) 아래. 숨쉬기 3.2초, 손 흔들 때 살짝 흔들림 */
.streamer { position: absolute; animation: sbob 3.2s ease-in-out infinite; }
.st-in { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 50% 100%; }
.st-in img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; visibility: hidden; }
.st-in img.on { visibility: visible; }
.st-in.wave { animation: swave .8s ease-in-out 2; }
.room-front { position: absolute; }
@keyframes sbob { 50% { transform: translateY(-2px); } }
@keyframes swave { 0%, 100% { transform: none; } 25%, 75% { transform: rotate(-2deg); } 50% { transform: rotate(1deg); } }
.rp-floor { position: absolute; left: 64px; top: 160px; width: 612px; height: 316px; border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .2); }
.rp-desk { position: absolute; left: 350px; top: 275px; width: 316px; height: 70px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.rp-mon { position: absolute; left: 455px; top: 123px; width: 147px; height: 135px; border-radius: 8px; background: #1b1f27; transform: skewY(16.4deg); transform-origin: 0 0; }
/* 방 안 모니터(기울어진 화면에 맞춤) */
.rmon { position: absolute; left: 461px; top: 129px; width: 136px; height: 122px; display: flex; align-items: center; justify-content: center; transform: skewY(16.4deg); transform-origin: 0 0; border-radius: 4px; opacity: 0; transition: opacity .3s; }
.rmon span { padding: 6px 10px; border: 1.5px solid var(--gold); border-radius: 8px; background: #2F2A24; color: var(--gold); font-size: 13px; font-weight: 700; }
.rmon.on { opacity: 1; }
/* 책상 위 폰에서 뜨는 은행 알림 */
.push { position: absolute; left: 474px; top: 250px; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(14px) scale(.92); transition: opacity .3s, transform .45s cubic-bezier(.2, .9, .3, 1.25); }
.push.on { opacity: 1; transform: none; }
.push em { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold); font-size: 12.5px; font-weight: 800; font-style: normal; }
.push b { display: block; font-size: 16px; line-height: 1.2; }
.push small { display: block; color: var(--sub); font-size: 12.5px; font-weight: 600; }

/* 시청자 그림(384² 를 200 으로, 발이 아래 끝) */
.sprites { position: absolute; left: 0; top: 0; width: 1240px; height: 720px; pointer-events: none; }
.vw { position: absolute; left: 0; top: 0; width: 200px; height: 200px; margin: -200px 0 0 -100px; opacity: 0; will-change: transform; }
.vw img { position: absolute; left: 0; bottom: 0; width: 200px; height: 200px; visibility: hidden; }
.vw img.on { visibility: visible; }
.vw .ph { position: absolute; left: 70px; bottom: 6px; width: 60px; height: 120px; border-radius: 30px 30px 14px 14px; background: rgba(255, 255, 255, .16); }
.vw .ph::before { content: ""; position: absolute; left: 12px; top: -40px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.vw.ok .ph { display: none; }
.vw .shadow { position: absolute; left: 60px; bottom: -6px; width: 80px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0)); }

/* 핀: 점 + 퍼지는 고리 + 빛줄 + 이름표 */
.pins { position: absolute; left: 0; top: 0; width: 1240px; height: 720px; pointer-events: none; }
.pin { position: absolute; width: 0; height: 0; z-index: 5; }
.pin i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 2.5px solid var(--ink); opacity: 0; transition: opacity .3s; }
.pin s { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; }
.pin u { position: absolute; left: -1px; top: 0; width: 2px; height: 0; background: linear-gradient(var(--gold), rgba(245, 196, 0, 0)); opacity: 0; }
.pin .tag { position: absolute; left: 14px; top: -46px; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .3s, transform .4s cubic-bezier(.2, .9, .3, 1.3); }
.pin .tag em { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--gold); font-size: 12px; font-style: normal; }
.pin.on i { opacity: 1; animation: pin 1.6s ease-out; }
.pin.on s { animation: ring 1.4s ease-out; }
.pin.on u { opacity: 1; animation: beam 1.4s ease-out forwards; }
.pin.on .tag { opacity: 1; transform: none; }
@keyframes pin { 0% { transform: scale(1); } 20% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes ring { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes beam { 0% { height: 0; opacity: .9; } 60% { height: 60px; opacity: .7; } 100% { height: 60px; opacity: 0; } }
/* 빛나는 점 */
.sdot { position: absolute; left: 0; top: 0; z-index: 8; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px 5px rgba(245, 196, 0, .75); pointer-events: none; }

/* 오른쪽: 방송 화면 · 오늘 · 최근 후원 */
.side { position: absolute; left: 940px; top: 24px; width: 276px; height: 672px; display: flex; flex-direction: column; gap: 12px; }
.obs { border-radius: 14px; background: #11161F; border: 1px solid rgba(255, 255, 255, .12); overflow: hidden; box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .6); }
.obs-bar { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 10px; color: rgba(255, 255, 255, .6); font-size: 12px; font-weight: 600; }
.livebadge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.livebadge i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.obs-scr { position: relative; height: 155px; margin: 0 6px 6px; border-radius: 8px; background: linear-gradient(160deg, #26324A, #161D2B); overflow: hidden; }
.obs-scr > div:not(.cam) { position: absolute; left: 10px; right: 72px; top: 10px; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .45s var(--ease); }
.obs.sh-al .obs-scr > .al, .obs.sh-tts .obs-scr > .tts, .obs.sh-rank .obs-scr > .rank, .obs.sh-vote .obs-scr > .vote,
.obs.sh-roul .obs-scr > .roul, .obs.sh-mis .obs-scr > .mis, .obs.sh-thx .obs-scr > .thx { opacity: 1; transform: none; }
.obs-scr > div.tts { top: auto; bottom: 10px; right: 10px; }
.cam { position: absolute; right: 8px; top: 10px; width: 56px; height: 56px; border-radius: 10px; background: rgba(255, 255, 255, .1); overflow: hidden; z-index: 3; }
.cam img { position: absolute; left: -6px; top: -1px; width: 68px; height: 68px; }
.cam .c-thx { display: none; }
.obs.sh-thx .cam .c-thx { display: block; }
.obs.sh-thx .cam .c-talk { display: none; }
.cam.talk img { animation: talk .5s steps(2) infinite; }
@keyframes talk { 50% { transform: translateY(-2px) scale(1.02); } }

/* 알림 카드(실제 알림창 기본 모양) */
.al { position: relative; padding: 10px 12px 12px; border: 2px solid var(--gold); border-radius: 12px; background: #2F2A24; color: #fff; text-align: center; }
.al em { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 800; font-style: normal; }
.al p { margin-top: 5px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.al p b { color: var(--gold); }
.al small { display: block; margin-top: 2px; color: #F3E9D2; font-size: 12.5px; }
.coins { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.coins i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE680, var(--gold) 55%, #C99A00); opacity: 0; }
/* 알림 음성 막대 */
.tts { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 10px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.tts span { margin-right: 6px; color: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tts i { width: 3px; height: 18px; border-radius: 2px; background: var(--gold); transform: scaleY(.3); animation: wave .9s ease-in-out infinite; }
.tts i:nth-of-type(2n) { animation-delay: .15s; } .tts i:nth-of-type(3n) { animation-delay: .3s; } .tts i:nth-of-type(4n) { animation-delay: .45s; }
@keyframes wave { 50% { transform: scaleY(1); } }
/* 순위 */
.rank { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .4); color: #fff; }
.rank > b { display: block; margin-bottom: 4px; color: var(--gold); font-size: 12px; }
.rank li { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12.5px; font-weight: 600; }
.rank li em { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: rgba(255, 255, 255, .14); font-size: 10.5px; font-style: normal; }
.rank li:first-child em { background: var(--gold); color: var(--ink); }
.rank li span { margin-left: auto; color: rgba(255, 255, 255, .7); }
/* 투표 */
.vote { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .4); color: #fff; }
.vote > b { display: block; margin-bottom: 6px; font-size: 12.5px; }
.vb { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; font-weight: 600; }
.vb span { width: 62px; flex-shrink: 0; }
.vb i { flex: 1; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.vb s { display: block; width: 0; height: 100%; border-radius: 5px; background: var(--gold); transition: width 1.1s var(--ease); }
.vb s.w64 { width: 64%; } .vb s.w36 { width: 36%; }
/* 룰렛 */
.roul { display: flex; align-items: center; gap: 14px; height: 120px; }
.wheel { width: 100px; height: 100px; flex-shrink: 0; border-radius: 50%; border: 3px solid #fff; background: conic-gradient(var(--gold) 0 60deg, #FF8A65 60deg 120deg, #7EC8E3 120deg 180deg, #fff 180deg 240deg, #A5D6A7 240deg 300deg, #CE93D8 300deg 360deg); }
.roul { position: relative; }
.needle { position: absolute; left: 44px; top: 4px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 14px solid #fff; }
.roul b { color: #fff; font-size: 15px; opacity: 0; transition: opacity .3s; }
.roul.done b { opacity: 1; }
/* 미션 카드 뒤집기 */
.mis { perspective: 600px; }
.card3d { position: relative; height: 84px; transform-style: preserve-3d; transition: transform .8s var(--ease); }
.card3d.flip { transform: rotateY(180deg); }
.card3d > div { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 12px; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card3d .f { background: #fff; color: var(--ink); }
.card3d .b { background: var(--gold); color: var(--ink); transform: rotateY(180deg); }
.card3d small { font-size: 11.5px; font-weight: 600; }
.card3d b { font-size: 15px; }
.thx b { display: block; padding-top: 40px; color: #fff; font-size: 24px; text-align: center; }

/* 오늘 · 최근 후원 */
.kpi { padding: 14px 16px; border-radius: 14px; background: #fff; color: var(--ink); }
.kpi-h { display: flex; align-items: center; justify-content: space-between; }
.kpi-h b { font-size: 16px; }
.kpi-n { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; margin-top: 10px; }
.kpi-n div { color: var(--sub); font-size: 12px; font-weight: 600; }
.kpi-n b { display: block; color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.feed { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); color: #fff; font-size: 14px; font-weight: 700; animation: noteIn .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.note em { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; background: var(--gold); color: var(--ink); font-size: 11.5px; font-style: normal; }
.note small { display: block; color: rgba(255, 255, 255, .6); font-size: 12px; font-weight: 600; }
.note .t { margin-left: auto; align-self: flex-start; color: rgba(255, 255, 255, .45); font-size: 11.5px; }
@keyframes noteIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }

.off *, .off *::before, .off *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .livebadge i, .tts i, .cam.talk img, .streamer, .st-in.wave, .note, .pin.on i, .pin.on s, .pin.on u { animation: none; }
  .push, .pin .tag, .obs-scr > div:not(.cam), .vb s, .card3d { transition: none; }
}
