/* 타로 화면 전용 (공통 테마는 /saju/styles.css) */
.lead-text { color: var(--text-soft); text-align: center; margin: 0 0 16px; }

/* 카드 한 장 (뒤집기) */
.tcard { width: 180px; aspect-ratio: 200 / 330; perspective: 1000px; cursor: pointer; flex: none; }
.tcard .inner { position: relative; width: 100%; height: 100%; transition: transform .9s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.tcard.flipped .inner { transform: rotateY(180deg); }
.tcard .side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 26px rgba(201,184,255,.15); }
.tcard .side svg { display: block; width: 100%; height: 100%; }
.tcard .front { transform: rotateY(180deg); }
.tcard .front.rev svg { transform: rotate(180deg); }
.tcard:not(.flipped):hover .inner { transform: translateY(-4px); }
.tcard:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 14px; }

.single { display: flex; gap: 26px; align-items: center; justify-content: center; flex-wrap: wrap; }
.meaning { flex: 1 1 260px; max-width: 420px; color: var(--text-soft); }
.meaning h3 { font-family: var(--serif); color: var(--gold-soft); font-size: 22px; margin: 0 0 4px; }
.meaning .en { color: var(--lilac); font-size: 13px; margin: 0 0 10px; }
.meaning .dir { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); margin-left: 6px; vertical-align: middle; color: var(--gold-soft); }
.meaning .dir.rev { color: #ffb4a8; border-color: rgba(255,138,122,.45); }
.meaning p { margin: 8px 0 0; }
.meaning .chips { justify-content: flex-start; margin-top: 10px; }

/* 질문 */
.q-label { display: block; font-size: 14px; color: var(--text-soft); margin-bottom: 8px; }
#question { width: 100%; max-width: none; }
.q-show { text-align: center; font-family: var(--serif); color: var(--gold-soft); margin: 0 0 16px; }

/* 고르기 */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin: 0 auto 18px; }
.slot { aspect-ratio: 200 / 330; border: 1px dashed var(--line-strong); border-radius: 12px; display: grid; place-items: center; position: relative; overflow: hidden; background: rgba(10,6,35,.35); }
.slot span { font-family: var(--serif); color: var(--muted); font-size: 14px; }
.slot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.slot.filled span { position: absolute; bottom: -24px; }

.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.dk { aspect-ratio: 200 / 330; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; transition: transform .25s, opacity .3s; animation: deal .5s both; }
.dk svg { width: 100%; height: 100%; display: block; border-radius: 8px; }
.dk:hover { transform: translateY(-6px); }
.dk.taken { opacity: .15; pointer-events: none; transform: translateY(8px); }
.dk:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@keyframes deal { from { opacity: 0; transform: translateY(-20px) rotate(-8deg); } to { opacity: 1; transform: none; } }

.shuffling { animation: shuffle .9s ease-in-out; }
@keyframes shuffle { 0%,100% { transform: none; } 25% { transform: translateX(-10px) rotate(-3deg); } 50% { transform: translateX(10px) rotate(3deg); } 75% { transform: translateX(-6px) rotate(-1deg); } }

/* 결과 3장 */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.three .pos { text-align: center; }
.three .pos .label { font-family: var(--serif); color: var(--lilac); font-size: 14px; margin-bottom: 8px; }
.three .tcard { width: 100%; }
.three .pos .nm { font-family: var(--serif); color: var(--gold-soft); font-size: 14px; margin-top: 8px; }
.three .pos .rv { font-size: 11px; color: #ffb4a8; }

@media (max-width: 480px) {
  .tcard { width: 150px; }
  .three { gap: 8px; }
  .deck { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { .tcard .inner, .dk { transition: none; animation: none; } .shuffling { animation: none; } }
