/* ===== 데일리 타로 ===== */

/* --- 덱(부채꼴) 영역 --- */
.tarot-deck-wrap {
    background: var(--paper-card);
    border: var(--border-ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard-sm);
    padding: 24px 16px 8px;
    margin-bottom: 24px;
    text-align: center;
    overflow: hidden;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.tarot-deck-wrap.deck-leaving {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
}

.tarot-deck-guide {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--ink-muted);
}

.tarot-deck {
    position: relative;
    height: 250px;
    max-width: 640px;
    margin: 0 auto;
}

.tarot-card-back {
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 86px;
    height: 138px;
    margin-left: -43px;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: 10px;
    cursor: pointer;
    transform-origin: 50% 130%;
    transform: translateY(60px) rotate(0deg) scale(0.85);
    opacity: 0;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.16) 0 14%, transparent 15%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 6px, transparent 6px 12px),
        linear-gradient(160deg, #423a5a 0%, #2c2742 55%, #1f1b30 100%);
    box-shadow: 2px 3px 0 0 rgba(0, 0, 0, 0.35);
    transition:
        transform 0.6s cubic-bezier(0.22, 1.1, 0.36, 1),
        opacity 0.45s ease,
        box-shadow 0.25s ease;
    transition-delay: var(--deal-delay, 0ms);
}

.tarot-card-back::after {
    content: '✦';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: rgba(240, 232, 255, 0.85);
    text-shadow: 0 0 10px rgba(186, 162, 255, 0.8);
}

.tarot-card-back::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(240, 232, 255, 0.35);
    border-radius: 7px;
}

.tarot-deck.is-dealt .tarot-card-back {
    transform: rotate(var(--angle)) translateY(0) scale(1);
    opacity: 1;
}

.tarot-deck.is-dealt .tarot-card-back:hover,
.tarot-deck.is-dealt .tarot-card-back:focus-visible {
    transform: rotate(var(--angle)) translateY(-22px) scale(1.04);
    transition-delay: 0ms;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35), 0 0 16px rgba(186, 162, 255, 0.55);
    z-index: 5;
    outline: none;
}

.tarot-deck .tarot-card-back.is-picked {
    transform: rotate(0deg) translateY(-36px) scale(1.12);
    transition-delay: 0ms;
    box-shadow: 0 0 26px rgba(186, 162, 255, 0.9);
    z-index: 10;
}

/* --- 스테이지(플립 공개) 영역 --- */
.tarot-stage[hidden] {
    display: none;
}

.tarot-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    perspective: 1200px;
}

.tarot-flip {
    width: 210px;
    height: 340px;
    perspective: 1200px;
    animation: tarot-stage-in 0.5s ease both;
}

@keyframes tarot-stage-in {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tarot-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.32, 0.72, 0.22, 1);
}

.tarot-flip.is-flipped .tarot-flip-inner {
    transform: rotateY(180deg);
}

.tarot-flip.is-flipped {
    animation: tarot-stage-in 0.5s ease both, tarot-float 4s ease-in-out 1.2s infinite;
}

@keyframes tarot-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tarot-face {
    position: absolute;
    inset: 0;
    border: 2px solid var(--ink);
    border-radius: 14px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.tarot-face-back {
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.16) 0 14%, transparent 15%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 8px, transparent 8px 16px),
        linear-gradient(160deg, #423a5a 0%, #2c2742 55%, #1f1b30 100%);
    box-shadow: var(--shadow-hard-xs);
}

.tarot-face-back::after {
    content: '✦';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: rgba(240, 232, 255, 0.85);
    text-shadow: 0 0 14px rgba(186, 162, 255, 0.8);
}

.tarot-face-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 14px;
    transform: rotateY(180deg);
    background:
        radial-gradient(circle at 50% 14%, rgba(186, 162, 255, 0.22) 0%, transparent 46%),
        var(--paper-card);
    box-shadow: var(--shadow-hard-xs), inset 0 0 0 5px var(--paper-card), inset 0 0 0 6px var(--accent-color);
}

.tarot-face-front.is-reversed {
    transform: rotateY(180deg) rotate(180deg);
}

.tarot-roman {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--ink-muted);
}

.tarot-emoji {
    font-size: 4.2rem;
    line-height: 1.15;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.tarot-name-ko {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-color);
}

.tarot-name-en {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
    text-transform: uppercase;
}

/* --- 카드 캡션(방향 + 키워드) --- */
.tarot-card-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tarot-card-caption.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tarot-orientation-badge {
    display: inline-block;
    padding: 4px 14px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--gradient-btn);
    color: var(--btn-fg);
    font-size: 0.85rem;
    font-weight: 700;
}

.tarot-orientation-badge.reversed {
    background: var(--gradient-btn-warm);
}

.tarot-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.tarot-keyword-chip {
    padding: 4px 12px;
    border: 1px solid var(--ink-muted);
    border-radius: 999px;
    background: var(--paper);
    color: var(--text-color);
    font-size: 0.82rem;
}

/* --- 다시 뽑기 버튼 --- */
.tarot-stage-actions {
    text-align: center;
    margin-bottom: 24px;
}

.tarot-redraw-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid var(--ink);
    border-radius: 12px;
    background: var(--gradient-btn-repeat);
    color: var(--btn-fg);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-hard-xs);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tarot-redraw-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 0 var(--ink);
}

/* --- SEO 안내 콘텐츠 --- */
.tarot-info {
    max-width: 760px;
    margin: 8px auto 28px;
    padding: 0 4px;
    color: var(--text-color);
    line-height: 1.8;
}

.tarot-info-section {
    margin-bottom: 28px;
}

.tarot-info-section h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
}

.tarot-info-section p {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--ink-muted);
}

.tarot-info-steps,
.tarot-info-cards {
    margin: 0;
    padding-left: 1.2em;
    color: var(--ink-muted);
}

.tarot-info-steps li,
.tarot-info-cards li {
    margin-bottom: 10px;
    font-size: 0.98rem;
}

.tarot-info-section strong {
    color: var(--text-color);
}

.tarot-faq {
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 4px 16px;
    margin-bottom: 10px;
    background: var(--paper-card);
}

.tarot-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-color);
    padding: 10px 0;
    list-style: none;
}

.tarot-faq summary::-webkit-details-marker {
    display: none;
}

.tarot-faq summary::before {
    content: 'Q. ';
    color: var(--primary-color);
    font-weight: 800;
}

.tarot-faq[open] summary {
    border-bottom: 1px dashed var(--accent-color);
}

.tarot-faq p {
    margin: 10px 0;
    color: var(--ink-muted);
    font-size: 0.96rem;
    line-height: 1.75;
}

/* --- 모바일 --- */
@media (max-width: 600px) {
    .tarot-deck {
        height: 196px;
    }

    .tarot-info-section h2 {
        font-size: 1.15rem;
    }

    .tarot-card-back {
        width: 64px;
        height: 104px;
        margin-left: -32px;
    }

    .tarot-flip {
        width: 180px;
        height: 292px;
    }

    .tarot-emoji {
        font-size: 3.4rem;
    }

    .tarot-name-ko {
        font-size: 1.15rem;
    }
}

/* 모션 최소화 환경 */
@media (prefers-reduced-motion: reduce) {
    .tarot-card-back,
    .tarot-flip-inner,
    .tarot-deck-wrap,
    .tarot-card-caption {
        transition: none;
    }

    .tarot-flip,
    .tarot-flip.is-flipped {
        animation: none;
    }
}
