/* =====================================================
   AstroOracle Matrix — Tarot Card Styles
   3D flip, card layout, reading panel
   ===================================================== */

/* === Card Base === */
.tarot-card {
    width: 140px;
    height: 220px;
    perspective: 800px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s var(--ease);
}

.tarot-card:hover {
    transform: translateY(-8px) scale(1.03);
    z-index: 10;
}

.tarot-card.reversed .card-front {
    transform: rotateZ(180deg);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(167, 139, 250, 0.15);
}

/* === Card Back === */
.card-back {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* === Card Front === */
.card-front {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-front-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    border-radius: 0 0 12px 12px;
    text-align: center;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.card-number {
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.card-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-art {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.art-emoji {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.art-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.card-footer {
    text-align: center;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-name-zh {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.card-name-en {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.reversed-badge {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 6px;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 4px;
    font-size: 0.55rem;
    color: #fca5a5;
    font-weight: 700;
}

.card-position-label {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* === Tarot Table Layout === */
.tarot-table {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 2rem 0;
    perspective: 1200px;
    min-height: 300px;
}

/* === Reading Panel === */
.tarot-reading {
    max-width: 900px;
    margin: 1rem auto 0;
}

.reading-question {
    padding: 0.8rem 1rem;
    background: rgba(167, 139, 250, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--crystal-purple);
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.reading-cards {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.reading-card-item {
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(13, 5, 32, 0.4);
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.reading-pos {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.reading-pos-en {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.3rem;
}

.reading-card-name {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.reading-en {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.rev-tag {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    font-size: 0.65rem;
    color: #fca5a5;
    font-weight: 700;
}

.upright-tag {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(45, 212, 191, 0.15);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 4px;
    font-size: 0.65rem;
    color: #5eead4;
    font-weight: 700;
}

.reading-keywords {
    font-size: 0.8rem;
    color: var(--crystal-purple);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.reading-interp {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.reading-summary {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(251, 191, 36, 0.05));
    border-radius: var(--radius-md);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.reading-summary h4 {
    color: var(--gold);
    font-family: var(--font-serif);
    margin-bottom: 0.5rem;
}

.reading-summary p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
