/* gacha.css — 소환 의식 연출(gacha-fx.js): 성당 무대 캔버스 두 장, 카드, 공개 화면, 결과 */
.gx { position: absolute; inset: 0; z-index: 40; overflow: hidden; cursor: pointer; background: #05040a; font-family: var(--pixel-font, 'Galmuri11', sans-serif); touch-action: none; user-select: none; -webkit-user-select: none; }
.gx-stage { position: absolute; inset: 0; will-change: transform; }
.gx canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.gx-fg { z-index: 3; pointer-events: none; }
.gx-skip { position: absolute; right: 14px; top: 12px; z-index: 8; padding: 6px 14px; font-family: inherit; font-size: 12px; font-weight: 900; color: #f5e6ba; background: rgba(10,8,20,.72); border: 2px solid #f5e6ba; cursor: pointer; }

/* 자막(의식 문구·전조) 과 안내 */
.gx-cap, .gx-hint { position: absolute; left: 0; right: 0; z-index: 6; margin: 0; text-align: center; pointer-events: none; opacity: 0; }
.gx-cap { bottom: 12%; font-size: clamp(14px, 3.4vh, 20px); font-weight: 900; letter-spacing: .08em; color: #e8e2ff; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.gx-cap.on { opacity: 1; animation: gxCapIn .6s steps(6, end) both; }
.gx-cap.gold { color: #ffe27a; } .gx-cap.white { color: #ffffff; }
.gx-cap.rb { color: #fff4d6; animation: gxCapIn .8s steps(8, end) both; }   /* 성광: 색이 돌지 않는 백금 */
@keyframes gxCapIn { from { opacity: 0; transform: translateY(8px); letter-spacing: .5em; } }
.gx-hint { bottom: 5%; font-size: 11px; color: #cfc8e8; }
.gx-hint.on { opacity: .8; animation: gxBlink 1s steps(2, jump-none) infinite; }
.gx-hint.tap { bottom: 15%; font-family: 'Black Han Sans', var(--pixel-font), sans-serif; font-size: clamp(26px, 8vh, 46px); color: #fff3b0; text-shadow: 3px 3px 0 #000, 0 0 0 #000; letter-spacing: .12em; animation: gxBlink 1s steps(2, jump-none) infinite; }
@keyframes gxBlink { 50% { opacity: .25; } }

/* 카드 */
.gx-cards { position: absolute; inset: 0; z-index: 1; transition: opacity .2s steps(3); }
.gx-cards.hide { opacity: 0; }
.gxc { position: absolute; width: min(12.5vw, 16vh, 108px); aspect-ratio: 3 / 4; transform: translate(-50%, -50%); perspective: 600px; transition: left .45s cubic-bezier(.2, 1.2, .4, 1), top .45s cubic-bezier(.2, 1.2, .4, 1), transform .45s cubic-bezier(.2, 1.3, .4, 1), opacity .2s steps(3), filter .2s steps(3); }
.gxc.solo { width: min(20vw, 30vh, 170px); }
.gxc.land { animation: gxcLand .32s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes gxcLand { from { transform: translate(-50%, -50%) scale(1.5); filter: brightness(3); } }
.gxc-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .42s cubic-bezier(.3, 1.35, .5, 1); }
.gxc.open .gxc-in { transform: rotateY(180deg); }
.gxc-back, .gxc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6px; overflow: hidden; }
.gxc-back { border: 2px solid var(--rc); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rc) 35%, #120d28) 0 6px, #120d28 6px 12px); box-shadow: 0 0 14px color-mix(in srgb, var(--rc) 70%, transparent), inset 0 0 18px color-mix(in srgb, var(--rc) 50%, transparent); }
.gxc-back i { position: absolute; inset: 22% 18%; border: 2px solid var(--rc); transform: rotate(45deg); opacity: .8; }
.gxc-back i::after { content: ''; position: absolute; inset: 30%; background: var(--rc); box-shadow: 0 0 12px var(--rc); }
.gxc.charge .gxc-in { animation: gxcShake .09s steps(2) infinite; }
.gxc.charge .gxc-back { filter: brightness(1.35); }
.gxc.r-SSR.charge .gxc-in { animation-duration: .06s; }
@keyframes gxcShake { 0% { transform: translate(-1px, 1px); } 100% { transform: translate(1px, -1px); } }
.gxc-face { transform: rotateY(180deg); border: 2px solid var(--rc); background: linear-gradient(color-mix(in srgb, var(--c) 45%, #1a1430), #0d0b14); }
.gxc-face img { position: absolute; left: 50%; top: 2%; height: 150%; transform: translateX(-50%); image-rendering: pixelated; }
.gxc.recruit .gxc-face img { top: 19%; width: 72%; height: auto; image-rendering: pixelated; }
.gxc-face .rar { position: absolute; left: 4px; top: 2px; font-size: 11px; font-weight: 900; font-style: italic; color: var(--rc); text-shadow: 0 1px 2px #000; }
.gxc-face b { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.gxc-face small, .gxc-face em { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 10px; font-weight: 900; font-style: normal; background: rgba(0,0,0,.78); color: #ffd84a; padding: 1px 0; }
.gxc-face em { background: linear-gradient(90deg, #8a1a24, #b0562a); color: #fff4d6; }
.gxc.r-R { --rc: #5ab8ff; } .gxc.r-SR { --rc: #c07aff; } .gxc.r-SSR { --rc: #ffc84a; }
/* SSR 집중: 가운데로 떠올라 커지고, 나머지는 어두워진다 */
.gx-cards.focusing .gxc:not(.focus) { opacity: .28; filter: brightness(.45); }
.gxc.focus { left: 50% !important; top: 46% !important; transform: translate(-50%, -50%) scale(2.05); z-index: 2; }
.gxc.solo.focus { transform: translate(-50%, -50%) scale(1.35); }
.gxc.focus .gxc-in { animation: gxcShake .045s steps(2) infinite; }
.gxc.gone { opacity: 0; transition: none; }
/* 결과: 아래 결과 막대에 가리지 않게 카드가 살짝 올라가고, 금 카드에는 빛이 한 번씩 지나간다 */
.gx-cards.done .gxc:not(.solo) { transform: translate(-50%, calc(-50% - 6vh)); }
.gx-cards.done .gxc.solo { transform: translate(-50%, calc(-50% - 4vh)); }
.gx-cards.done .gxc.r-SSR .gxc-face::after, .gx-cards.done .gxc.r-SR .gxc-face::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.55) 46%, transparent 54%); background-size: 300% 100%; animation: gxShine 2.2s steps(12) infinite; pointer-events: none; }
.gx-cards.done .gxc.r-SR .gxc-face::after { animation-duration: 3.2s; opacity: .6; }
@keyframes gxShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.gx-cards.done .gxc.r-SSR { animation: gxcGlow 1.2s steps(4) infinite; }
.gx-cards.done .gxc.rb .gxc-face { animation: gxRbBorder 3.2s steps(8) infinite; }
@keyframes gxcGlow { 50% { filter: brightness(1.18); } }
@keyframes gxRbBorder { 50% { border-color: #fff6dc; } }

/* 공개 화면: 배경 햇살은 뒤 캔버스, 여기는 일러스트와 이름 */
.gx-feat { position: absolute; inset: 0; z-index: 2; display: none; overflow: hidden; pointer-events: none; }
.gx-feat.on { display: block; }
.gf-art { position: absolute; left: 3%; bottom: -10%; height: 122%; max-width: 62%; object-fit: contain; object-position: bottom; animation: gfArtIn .55s cubic-bezier(.15, 1.25, .35, 1) both; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
@keyframes gfArtIn { from { transform: translateX(-26%) scale(1.12); opacity: 0; } }
/* 실루엣: 역광 속 검은 몸 + 등급 색 테두리(번짐 없는 그림자 네 겹) */
.gx-feat { --rim: #ffe27a; } .gx-feat.r-SR { --rim: #e8c0ff; } .gx-feat.rb { --rim: #ffffff; }
.gx-feat.sil .gf-art { filter: brightness(0) drop-shadow(3px 0 0 var(--rim)) drop-shadow(-3px 0 0 var(--rim)) drop-shadow(0 3px 0 var(--rim)) drop-shadow(0 -3px 0 var(--rim)); }
.gx-feat.lit .gf-art { animation: gfArtIn .55s cubic-bezier(.15, 1.25, .35, 1) both, gfPop .35s steps(4) both; }
@keyframes gfPop { 0% { filter: brightness(3) saturate(0); transform: scale(1.06); } 100% { filter: none; } }
.gf-name { position: absolute; right: 5%; top: 50%; width: 40%; transform: translateY(-50%); text-align: center; opacity: 0; }
.gx-feat.lit .gf-name { opacity: 1; }
.gf-stamp { height: clamp(40px, 15vh, 96px); }
.gf-stars { height: clamp(22px, 8vh, 52px); margin-bottom: 4px; }
.gf-name b { display: block; font-family: 'Black Han Sans', var(--pixel-font), sans-serif; font-weight: 400; font-size: clamp(34px, 12vh, 84px); line-height: 1.05; color: #fff; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; visibility: hidden; }
.gx-feat.named .gf-name b { visibility: visible; animation: gfName .3s steps(4) both; }
.gx-feat.r-SSR .gf-name b { color: #fff6d0; }
@keyframes gfName { from { transform: scale(1.8); opacity: 0; } }
.gf-cls { display: block; font-size: clamp(12px, 2.6vh, 16px); font-weight: 900; color: #f0e8ff; text-shadow: 2px 2px 0 #000; visibility: hidden; }
.gf-name p { margin: 8px 0 0; font-size: clamp(11px, 2.4vh, 14px); color: #fff; text-shadow: 2px 2px 0 #000; visibility: hidden; }
.gx-feat.named .gf-cls { visibility: visible; animation: gxEndIn .3s steps(3) .05s both; }
.gx-feat.named .gf-name p { visibility: visible; animation: gxEndIn .3s steps(3) .25s both; }
.gf-tags { min-height: 30px; margin-top: 8px; }
.gf-tags em { display: inline-block; font-style: normal; font-weight: 900; font-size: clamp(14px, 3.4vh, 20px); padding: 2px 10px; color: #ffe27a; background: rgba(10,6,20,.8); border: 2px solid currentColor; opacity: 0; }
.gx-feat.ready .gf-tags em, .gx-feat.newin .gf-tags em { opacity: 1; animation: gfSeal .3s steps(3) both; }
.gf-tags .gf-new { color: #fff4d6; background: #8a1a24; border-color: #d8b45a; box-shadow: 3px 3px 0 #000; transform: rotate(-6deg); }
.gx-feat.newin .gf-tags .gf-new { animation: gfSeal .3s steps(3) both; }
@keyframes gfSeal { from { transform: scale(2.6) rotate(-6deg); opacity: 0; } }
.gf-pick { display: inline-block; margin-bottom: 6px; padding: 2px 12px; font-family: 'Black Han Sans', var(--pixel-font), sans-serif; font-size: clamp(14px, 3.4vh, 20px); letter-spacing: .1em; color: #1a0a02; background: linear-gradient(#fff3b0, #ffc040); border: 2px solid #000; box-shadow: 3px 3px 0 #000; animation: gfSeal .3s steps(3) .9s both; }
.gf-next { position: absolute; left: 0; right: 0; bottom: 3%; margin: 0; text-align: center; font-size: 11px; color: #fff; opacity: 0; text-shadow: 1px 1px 0 #000; }
.gx-feat.ready .gf-next { animation: gxBlink 1s steps(2, jump-none) 1.2s infinite; opacity: .85; }

/* 결과 */
.gx-end { position: absolute; left: 0; right: 0; bottom: 3%; z-index: 7; display: none; flex-direction: column; align-items: center; gap: 6px; }
.gx-end.on { display: flex; animation: gxEndIn .35s steps(4) both; }
@keyframes gxEndIn { from { transform: translateY(16px); opacity: 0; } }
.gx-end p { margin: 0; display: flex; gap: 12px; font-size: 13px; font-weight: 900; padding: 4px 14px; background: rgba(10,8,20,.84); border: 2px solid rgba(255,255,255,.25); }
.gx-end p .r-SSR { color: #ffd84a; } .gx-end p .r-SR { color: #d0a0ff; } .gx-end p .r-R { color: #8ad8ff; } .gx-end p span { color: #f0d8a0; }
.gx.t-RB .gx-end p .r-SSR { color: #fff4d6; }
.gx-end div { display: flex; gap: 10px; }
.gx-end button { min-width: 120px; height: 40px; font-size: 14px; }
@media (max-height: 460px) { .gxc { width: min(11vw, 19vh, 96px); } .gxc.solo { width: min(18vw, 30vh, 140px); } .gf-name p { display: none; } .gx-cap { bottom: 16%; } }
@media (prefers-reduced-motion: reduce) { .gxc.charge .gxc-in, .gxc.focus .gxc-in { animation: none; } }

/* ---------- 신규 SSR PV(src/summon-pv.js): 깨짐 섬광에서 떠올라 흰빛으로 사라진다 ---------- */
.gx-hold { position: absolute; left: 0; top: 0; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; }
.gx-hold video { width: 2px; height: 2px; }
.gx-pv { position: absolute; inset: 0; z-index: 20; background: #000; cursor: default; overflow: hidden; }
.gx-pv-frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gx-pv video { width: 100%; height: 100%; object-fit: contain; background: #000; animation: gxPvIn .6s cubic-bezier(.2,.8,.3,1) both; }
@keyframes gxPvIn { from { transform: scale(1.06); filter: brightness(1.8); } }
.gx-pv-white { position: absolute; inset: 0; z-index: 4; background: #fff; pointer-events: none; animation: gxPvWhiteIn .5s ease-out forwards; }
@keyframes gxPvWhiteIn { from { opacity: 1; } to { opacity: 0; } }
.gx-pv.out .gx-pv-white { animation: gxPvWhiteOut .24s ease-in forwards; }
@keyframes gxPvWhiteOut { from { opacity: 0; } to { opacity: 1; } }
.gx-pv-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255,255,255,.12); }
.gx-pv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe38a, #ffb629); }
.gx-pv-skip, .gx-pv-sound { position: absolute; top: 12px; z-index: 5; padding: 6px 14px; font-family: inherit; font-size: 12px; font-weight: 900; color: #f5e6ba; background: rgba(10,8,20,.72); border: 2px solid #f5e6ba; cursor: pointer; }
.gx-pv-skip { right: max(14px, env(safe-area-inset-right)); }
.gx-pv-sound { left: max(14px, env(safe-area-inset-left)); color: #1b1206; background: #ffd24a; border-color: #fff3c4; }
.gx-pv-sound[hidden] { display: none; }
.gx-pv-wait { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; }
.gx-pv.loading .gx-pv-wait { display: grid; }
.gx-pv-wait i { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: #ffd24a; animation: gxPvSpin .8s steps(8) infinite; }
@keyframes gxPvSpin { to { transform: rotate(360deg); } }
/* 공개 화면: PV 다시 보기(공개 화면은 탭으로 넘기므로 버튼만 눌리게) */
.gf-pv { pointer-events: none; margin-top: 10px; padding: 6px 14px; font-family: inherit; font-size: clamp(11px, 2.4vh, 14px); font-weight: 900; color: #fff3cf; background: rgba(10,6,20,.78); border: 2px solid #ffd84a; box-shadow: 2px 2px 0 #000; cursor: pointer; opacity: 0; }
.gx-feat.ready .gf-pv { pointer-events: auto; opacity: 1; transition: opacity .2s steps(3); }
html.vp-touch .gx-pv :is(.gx-pv-skip, .gx-pv-sound) { font-size: max(12px, calc(12px / var(--vs, 1))); min-height: calc(36px / var(--vs, 1)); }
html.vp-touch .gf-pv { font-size: max(12px, calc(12px / var(--vs, 1))); min-height: calc(34px / var(--vs, 1)); }
@media (prefers-reduced-motion: reduce) { .gx-pv video, .gx-pv-white, .gx-pv.out .gx-pv-white { animation-duration: .01s; } }
