/* ===== 할매 타로: 금색 보자기 덮인 상 + 수정 구슬 + 부채꼴 카드 ===== */
.altarPanel { padding-bottom: 18px; }
.altar { position: relative; width: 100%; max-width: 720px; margin: 6px auto 0; aspect-ratio: 1 / 1.2; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse 60% 40% at 50% 18%, rgba(255,190,90,.35), transparent 70%), linear-gradient(180deg, #1A0F0B 0%, #2A170F 38%, #4A2614 39%, #3A1D10 100%); box-shadow: inset 0 0 60px rgba(0,0,0,.7); }
/* 금색 보자기 (비단 광택 + 구름 무늬) */
.cloth { position: absolute; left: -4%; right: -4%; top: 36%; bottom: -4%; border-radius: 46% 46% 0 0 / 14% 14% 0 0;
  background:
    radial-gradient(circle at 20% 40%, rgba(255,250,220,.22) 0 2px, transparent 3px) 0 0 / 34px 34px,
    radial-gradient(ellipse 14px 7px at 50% 50%, transparent 60%, rgba(120,80,10,.28) 62% 70%, transparent 72%) 0 0 / 46px 30px,
    linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,244,200,.45) 46%, rgba(255,255,255,0) 60%),
    linear-gradient(160deg, #8C6418 0%, #E8C25A 22%, #B8862A 40%, #F4D98A 58%, #A87A22 78%, #7A5512 100%);
  box-shadow: inset 0 18px 30px rgba(255,240,190,.25), inset 0 -30px 60px rgba(60,30,0,.55), 0 -6px 20px rgba(0,0,0,.4); }
.cloth::before { content: ''; position: absolute; left: 4%; right: 4%; top: 3%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #FFF2C2, #C8452F 30%, #FFF2C2 50%, #C8452F 70%, #FFF2C2, transparent); opacity: .85; }
.tassel { position: absolute; top: 6%; width: 10px; height: 46px; background: linear-gradient(#C8452F, #8E2416); border-radius: 0 0 5px 5px; box-shadow: 0 0 0 2px #E8C25A; }
.tassel.l { left: 9%; } .tassel.r { right: 9%; }
/* 촛불 */
.candle { position: absolute; top: 22%; width: 5.5%; height: 15%; background: linear-gradient(90deg, #E9DCC0, #FFF8E6 45%, #CDBB98); border-radius: 3px 3px 2px 2px; box-shadow: 0 0 22px rgba(255,170,60,.35); }
.candle.l { left: 10%; } .candle.r { right: 10%; }
.candle i { position: absolute; left: 50%; top: -42%; width: 70%; height: 46%; transform: translateX(-50%); border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%; background: radial-gradient(ellipse at 50% 75%, #FFF6D0 0 20%, #FFB443 45%, rgba(255,90,20,0) 75%); filter: blur(.4px); animation: flick 1.6s infinite ease-in-out; box-shadow: 0 0 26px 8px rgba(255,160,50,.35); }
@keyframes flick { 0%,100% { transform: translateX(-50%) scale(1) rotate(-2deg); } 50% { transform: translateX(-48%) scale(1.08, .94) rotate(2deg); } }
/* 수정 구슬 */
.orb { position: absolute; left: 50%; top: 5%; width: 34%; transform: translateX(-50%); z-index: 2; }
.orb-glass { position: relative; z-index: 1; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.95) 0 3%, rgba(214,234,255,.75) 7%, rgba(120,140,210,.55) 26%, rgba(52,34,92,.85) 58%, #140A22 82%);
  box-shadow: 0 0 40px 10px rgba(150,170,255,.25), 0 0 90px 20px rgba(255,190,90,.12), inset -10px -14px 30px rgba(0,0,0,.6), inset 6px 8px 20px rgba(255,255,255,.18); animation: orbGlow 4s infinite ease-in-out; }
@keyframes orbGlow { 0%,100% { box-shadow: 0 0 40px 10px rgba(150,170,255,.22), 0 0 90px 20px rgba(255,190,90,.1), inset -10px -14px 30px rgba(0,0,0,.6), inset 6px 8px 20px rgba(255,255,255,.18); } 50% { box-shadow: 0 0 60px 18px rgba(170,190,255,.38), 0 0 120px 30px rgba(255,190,90,.18), inset -10px -14px 30px rgba(0,0,0,.6), inset 6px 8px 20px rgba(255,255,255,.18); } }
.mist { position: absolute; inset: 12%; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255,255,255,0), rgba(220,200,255,.35), rgba(255,255,255,0) 40%, rgba(180,210,255,.3) 70%, rgba(255,255,255,0)); filter: blur(10px); animation: swirl 9s linear infinite; mix-blend-mode: screen; }
.mist.m2 { inset: 22%; animation-duration: 6s; animation-direction: reverse; opacity: .7; }
@keyframes swirl { to { transform: rotate(360deg); } }
.shine { position: absolute; left: 18%; top: 12%; width: 28%; height: 18%; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(4px); transform: rotate(-30deg); }
.orb-stand { width: 72%; aspect-ratio: 4.2 / 1; margin: -9% auto 0; border-radius: 50% 50% 10px 10px / 70% 70% 10px 10px; background: linear-gradient(180deg, #F4D98A, #B8862A 45%, #6E4A10); box-shadow: 0 8px 14px rgba(0,0,0,.5), inset 0 3px 0 rgba(255,250,220,.6); position: relative; z-index: 0; }
/* 카드 자리 (과거·현재·미래) */
.slots { position: absolute; left: 6%; right: 6%; top: 39%; display: flex; justify-content: space-around; z-index: 3; }
.slot { position: relative; width: 22%; aspect-ratio: 2 / 3; border-radius: 8px; border: 1.5px dashed rgba(90,50,0,.55); background: rgba(80,40,0,.12); }
.slot em { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-style: normal; font-family: 'Song Myung', serif; font-size: 13px; color: #5A3405; text-shadow: 0 1px 0 rgba(255,240,190,.6); }
.slot .tc { position: absolute; inset: 0; width: 100%; height: 100%; animation: drop .45s ease-out; }
@keyframes drop { from { transform: translateY(80px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
/* 부채꼴 카드 */
.fan { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; z-index: 4; }
.fan .tc { position: absolute; left: 50%; bottom: 22%; width: 13%; margin-left: -6.5%; aspect-ratio: 2 / 3; transform-origin: 50% 250%; transform: rotate(var(--a)); transition: transform .35s ease, opacity .35s ease; }
.fan .tc:hover, .fan .tc:focus-visible { transform: rotate(var(--a)) translateY(-14%); outline: none; }
.fan .tc.gone { transform: rotate(var(--a)) translateY(-160%); opacity: 0; pointer-events: none; }
.altar.done .fan .tc:not(.gone) { opacity: .25; pointer-events: none; }
/* 카드 한 장: 뒷면(붉은 비단·금테·占 도장) ↔ 앞면(한지) */
.tc { padding: 0; border: 0; background: none; cursor: pointer; perspective: 600px; }
.tc-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,.7,.3,1); }
.tc.flip .tc-in { transform: rotateY(180deg); }
.tc-back, .tc-front { position: absolute; inset: 0; border-radius: 7px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tc-back { display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(232,194,90,0) 0 28%, rgba(232,194,90,.9) 29% 31%, transparent 32%), repeating-linear-gradient(45deg, rgba(255,215,130,.08) 0 3px, transparent 3px 7px), linear-gradient(160deg, #8E1F14, #5E0F0A);
  box-shadow: inset 0 0 0 2px #E8C25A, inset 0 0 0 4px #5E0F0A, inset 0 0 0 5px rgba(232,194,90,.7), 0 6px 12px rgba(0,0,0,.5); }
.tc-back i { font-style: normal; font-family: 'Noto Serif KR', serif; font-weight: 900; color: #F4D98A; font-size: clamp(11px, 2.6vw, 18px); text-shadow: 0 1px 0 #5E0F0A; }
.tc-front { transform: rotateY(180deg); }
.cface { position: relative; width: 100%; height: 100%; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8% 4%;
  background: radial-gradient(ellipse at 50% 40%, #FBF1D6, #EAD7A7 80%); color: #3A2418; box-shadow: inset 0 0 0 2px #9E2B1F, inset 0 0 0 4px #F3E4BC, inset 0 0 0 5px rgba(158,43,31,.55), 0 6px 14px rgba(0,0,0,.45); }
.cface.rev { transform: rotate(180deg); }
.cnum { font-family: 'Song Myung', serif; font-size: clamp(9px, 2.2vw, 13px); color: #9E2B1F; }
.csym { font-size: clamp(18px, 6vw, 40px); line-height: 1; color: #9E2B1F; }
.cname { font-family: 'Song Myung', serif; font-size: clamp(9px, 2.3vw, 14px); text-align: center; line-height: 1.15; }
.ckey { font-size: clamp(7px, 1.8vw, 11px); color: #7A5A44; }
/* 결과 목록 */
.tslot .cface { flex: none; width: 92px; height: 138px; }
@media (max-width: 720px) { .tslot .cface { width: 78px; height: 117px; } .slot em { font-size: 12px; bottom: -19px; } }

/* ---- SVG 장면 위치 맞춤 (viewBox 600x720) ---- */
.altar { aspect-ratio: 600 / 720; background: #140B08; }
.altar .scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.altar .slots { top: 50%; left: 7%; right: 7%; }
.altar .slot { width: 21%; border-color: rgba(110,60,0,.6); background: rgba(90,50,0,.14); box-shadow: inset 0 0 12px rgba(80,40,0,.25); }
.altar .slot em { color: #4A2A04; }
.altar .fan { height: 36%; }
.altar .fan .tc { bottom: 24%; width: 12.5%; margin-left: -6.25%; transform-origin: 50% 230%; }
/* 그림 카드: 그림이 있으면 앞면 가득 깔고, 번호·이름은 위아래 띠로 얹는다 */
.cface { overflow: hidden; }
.cface .cart { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: cover; border-radius: 4px; z-index: 0; }
.cface .cart ~ .cnum, .cface .cart ~ .cname, .cface .cart ~ .ckey { position: relative; z-index: 1; background: rgba(251,241,214,.88); padding: 0 6px; border-radius: 3px; }
.cface .cart ~ .csym { visibility: hidden; }

/* ===== 고급 카드 (자줏빛 비단 + 금테 + 금 매화) & 뽑는 손맛 ===== */
.tc-back { background: none; box-shadow: 0 6px 14px rgba(0,0,0,.55), 0 0 0 1px rgba(255,220,150,.25); overflow: hidden; }
.tc-back svg { width: 100%; height: 100%; display: block; }
.tc-back::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,240,200,.45) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.fan .tc:hover .tc-back::after, .fan .tc:focus-visible .tc-back::after { transform: translateX(120%); transition: transform .7s ease; }
.fan .tc:hover, .fan .tc:focus-visible { filter: drop-shadow(0 0 10px rgba(255,205,110,.85)); }
/* 앞면도 같은 금테로 */
.cface { background: radial-gradient(ellipse at 50% 40%, #FBF1D6, #E9D3A0 80%); box-shadow: inset 0 0 0 2px #C9973A, inset 0 0 0 4px #5A1018, inset 0 0 0 5px #E8C25A, 0 6px 14px rgba(0,0,0,.5); }
.cnum, .csym { color: #6E1620; }
/* 날아가는 카드 */
.flying { position: absolute; z-index: 20; pointer-events: none; will-change: transform; }
.flying .tc { width: 100%; height: 100%; cursor: default; }
.fan .tc.gone { transition: none; opacity: 0; transform: rotate(var(--a)); }
/* 반짝이 가루 */
.spark { position: absolute; z-index: 25; width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2) 0 0 calc(var(--sz) / -2); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #FFFBE6 0 30%, #FFD36E 55%, rgba(255,180,60,0) 72%); box-shadow: 0 0 8px 2px rgba(255,210,110,.7); animation: spark 1.1s ease-out forwards; }
@keyframes spark { 0% { transform: translate(0,0) scale(.4); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }
/* 자리 빛남 */
.altar .slot { transition: box-shadow .5s, border-color .5s; }
.altar .slot.lit { border: 1.5px solid rgba(255,214,120,.9); box-shadow: 0 0 18px 4px rgba(255,200,90,.55), inset 0 0 12px rgba(255,220,140,.35); animation: litPulse 2.4s ease-in-out infinite; }
@keyframes litPulse { 50% { box-shadow: 0 0 26px 7px rgba(255,200,90,.7), inset 0 0 12px rgba(255,220,140,.35); } }
.altar .slot .tc { animation: land .38s cubic-bezier(.3,1.6,.5,1); }
@keyframes land { from { transform: scale(1.08); } to { transform: none; } }
/* 뒤집힐 때 빛이 한 번 스친다 */
.slot .tc.flip .tc-front::after { content: ''; position: absolute; inset: 0; border-radius: 7px; background: linear-gradient(115deg, transparent 30%, rgba(255,250,225,.85) 50%, transparent 70%); animation: sweep 1s .45s ease-out both; pointer-events: none; z-index: 3; }
@keyframes sweep { from { transform: translateX(-110%); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }
/* 수정 구슬이 깨어난다 (구슬: viewBox 300,215 r95) */
.orbAura { position: absolute; left: 50%; top: 29.9%; width: 34%; aspect-ratio: 1; transform: translate(-50%,-50%) scale(.9); border-radius: 50%; pointer-events: none; z-index: 1; opacity: 0;
  background: radial-gradient(circle, rgba(255,240,255,.55) 0 20%, rgba(200,160,255,.35) 45%, rgba(255,200,110,.18) 62%, transparent 72%); mix-blend-mode: screen; transition: opacity 1.2s ease, transform 1.2s ease; }
.altar.awake .orbAura { opacity: 1; transform: translate(-50%,-50%) scale(1.25); animation: aura 2.6s 1.2s ease-in-out infinite; }
@keyframes aura { 50% { transform: translate(-50%,-50%) scale(1.4); opacity: .75; } }
/* 배경 사진(assets/tarot/scene.webp)이 있으면 SVG 대신 사진 */
.scenePhoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.altar.photo .scene { display: none; }
@media (prefers-reduced-motion: reduce) { .spark, .altar.awake .orbAura, .altar .slot.lit { animation: none; } }

/* ===== 앞면: 자줏빛 테 + 금 매화 모서리 + 위 숫자 띠 / 아래 이름 띠 + 가운데 그림 창 ===== */
.cface { display: block; padding: 0; container-type: inline-size; overflow: hidden; color: #F6DD9A;
  background: radial-gradient(ellipse at 50% 30%, #7A1A22, #4A0C12 85%);
  box-shadow: inset 0 0 0 1.5px #E8C25A, inset 0 0 0 3px #4A0C12, inset 0 0 0 3.8px rgba(232,194,90,.75), 0 6px 14px rgba(0,0,0,.55); }
.cface .cwin { position: absolute; left: 7%; right: 7%; top: 12%; bottom: 14%; border-radius: 2px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 35%, #FBF1D6, #E2C98F 85%); box-shadow: 0 0 0 1.2px #E8C25A, 0 0 0 2.4px #4A0C12, 0 0 0 3px rgba(232,194,90,.6); }
.cface .cwin .cart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 0; z-index: 1; }
.cface .csym { visibility: visible; font-size: 34cqw; color: #7A1A22; line-height: 1; }
.cface .cnum, .cface .cname { position: absolute; left: 0; right: 0; text-align: center; background: none; padding: 0; z-index: 2; color: #F6DD9A;
  font-family: 'Song Myung', 'Noto Serif KR', serif; text-shadow: 0 1px 0 #2A0508, 0 0 6px rgba(255,200,100,.35); line-height: 1; white-space: nowrap; }
.cface .cnum { top: 2.6%; font-size: 9cqw; letter-spacing: .06em; }
.cface .cname { bottom: 3%; font-size: 10.5cqw; }
.cface .ckey { display: none; }
.cface .cfc { position: absolute; width: 24%; height: auto; aspect-ratio: 1; z-index: 3; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.cface .cfc:nth-of-type(1) { left: 1%; top: 1%; }
.cface .cfc:nth-of-type(2) { right: 1%; top: 1%; transform: scaleX(-1); }
.cface .cfc:nth-of-type(3) { left: 1%; bottom: 1%; transform: scaleY(-1); }
.cface .cfc:nth-of-type(4) { right: 1%; bottom: 1%; transform: scale(-1,-1); }
.tslot .cface { width: 96px; height: 144px; }
@media (max-width: 720px) { .tslot .cface { width: 84px; height: 126px; } }
