/* === Metaphorical Cards Page Styles === */
.cards-page { background: linear-gradient(135deg, #0f0c29, #1a1a3e, #24243e); min-height: 100vh; color: #e8e0d8; }
.cards-page .header { background: rgba(15,12,41,0.95); border-bottom-color: rgba(255,255,255,0.06); }
.cards-page .logo { color: #c9856b; }
.cards-page .nav a { color: rgba(255,255,255,0.6); }
.cards-page .nav a:hover, .cards-page .nav a.active { color: #c9856b; }
.cards-page .nav a::after { background: #c9856b; }
.cards-page .nav-toggle span { background: #e8e0d8; }

.cards-hero { padding: 120px 0 60px; text-align: center; }
.cards-hero h1 { font-family: var(--font-heading); font-size: 2.8rem; margin-bottom: 16px; color: #fff; }
.cards-hero p { color: rgba(255,255,255,0.7); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* === Instructions === */
.instructions { padding: 0 0 60px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 30px; text-align: center;
}
.step-num {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #c9856b, #4a7c6f);
    color: #fff; font-weight: 700; display: flex;
    align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 1.1rem;
}
.step h3 { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 8px; color: #fff; }
.step p { color: rgba(255,255,255,0.6); font-size: 0.95rem; }

/* === Draw Section === */
.draw-section { padding: 60px 0; text-align: center; }
.draw-section h2 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 30px; color: #fff; }
.period-selector { display: flex; gap: 16px; justify-content: center; margin-bottom: 40px; }
.period-btn {
    padding: 12px 32px; border-radius: 50px; border: 2px solid rgba(255,255,255,0.2);
    background: transparent; color: rgba(255,255,255,0.7);
    font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
}
.period-btn:hover, .period-btn.active {
    background: linear-gradient(135deg, #c9856b, #4a7c6f);
    border-color: transparent; color: #fff;
}

/* === Card Deck === */
.draw-deck { position: relative; width: 220px; height: 310px; margin: 0 auto 40px; cursor: pointer; perspective: 1000px; }
.draw-deck-back {
    width: 220px; height: 310px; border-radius: 16px;
    background: linear-gradient(135deg, #4a7c6f, #c9856b);
    border: 2px solid rgba(255,255,255,0.15);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4); transition: all 0.3s ease;
}
.draw-deck:hover .draw-deck-back { transform: translateY(-8px); box-shadow: 0 16px 60px rgba(0,0,0,0.5); }
.draw-deck-back .card-ornament { font-size: 40px; margin-bottom: 12px; }
.draw-deck-back .card-label { color: rgba(255,255,255,0.8); font-family: var(--font-heading); font-size: 1.2rem; }

.draw-prompt { color: rgba(255,255,255,0.5); font-size: 0.95rem; }

.cooldown-notice {
    padding: 20px 32px; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    display: inline-block; margin-bottom: 20px; color: rgba(255,255,255,0.7);
}
.cooldown-notice .timer { color: #c9856b; font-weight: 700; font-size: 1.1rem; }

/* === Card Result === */
.card-result { display: none; padding: 60px 0; }
.card-result.active { display: block; }
.card-result-inner { max-width: 700px; margin: 0 auto; text-align: center; }
.result-card {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; padding: 50px 40px; margin-bottom: 40px;
    animation: cardAppear 0.8s ease;
}
@keyframes cardAppear { from { opacity: 0; transform: scale(0.8) rotateY(90deg); } to { opacity: 1; transform: scale(1) rotateY(0); } }

.result-icon { font-size: 60px; margin-bottom: 16px; }
.result-card h3 { font-family: var(--font-heading); font-size: 1.8rem; color: #fff; margin-bottom: 16px; }
.result-card .meaning { font-size: 1.1rem; color: rgba(255,255,255,0.8); line-height: 1.7; }

.unpacking { text-align: left; }
.unpacking h3 { font-family: var(--font-heading); font-size: 1.5rem; color: #fff; margin-bottom: 20px; text-align: center; }
.unpacking-q {
    padding: 16px 20px; background: rgba(255,255,255,0.04); border-left: 3px solid #c9856b;
    border-radius: 0 12px 12px 0; margin-bottom: 12px; color: rgba(255,255,255,0.75);
}

/* === Loading === */
.draw-loading { display: none; text-align: center; padding: 20px; }
.draw-loading.active { display: block; }
.draw-loading .spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #c9856b; border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Responsive === */
@media (max-width: 768px) {
    .steps { grid-template-columns: 1fr; }
    .cards-hero h1 { font-size: 2rem; }
    .result-card { padding: 30px 20px; }
}


/* === 10-Card Spread === */
.draw-hint { color: rgba(255,255,255,0.45); font-size: 0.9rem; margin-top: 12px; }

.spread-grid {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

.spread-card {
    aspect-ratio: 2/3;
    cursor: pointer;
    perspective: 600px;
    animation: cardDeal 0.5s ease both;
    position: relative;
}

@keyframes cardDeal {
    from { opacity: 0; transform: translateY(-40px) scale(0.7) rotateZ(-5deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotateZ(0); }
}

.spread-card-inner {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a7c6f, #c9856b);
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(0,0,0,0.35);
    position: relative;
    overflow: hidden;
}

.spread-card-inner::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    pointer-events: none;
}

.spread-card:hover .spread-card-inner {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 12px 40px rgba(201,133,107,0.35);
    border-color: rgba(255,255,255,0.3);
}

.spread-card.selected .spread-card-inner {
    border-color: #c9856b;
    box-shadow: 0 0 30px rgba(201,133,107,0.5);
}

.spread-card.flipping .spread-card-inner {
    animation: cardFlip 0.6s ease;
}

@keyframes cardFlip {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0); }
}

.card-ornament-mini { font-size: 28px; margin-bottom: 6px; }
.card-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* === Card Reveal Modal === */
.card-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,8,30,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    padding: 20px;
}
.card-modal-overlay.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.card-modal {
    background: linear-gradient(145deg, #1a1a3e, #24243e);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 48px 40px 36px;
    width: 90%;
    max-width: 560px;
    position: relative;
    animation: modalSlide 0.5s ease;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    color: #e8e0d8;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.card-modal-close {
    position: absolute; top: 16px; right: 20px;
    background: none; border: none; font-size: 30px;
    color: rgba(255,255,255,0.5); cursor: pointer;
    line-height: 1; transition: color 0.2s;
}
.card-modal-close:hover { color: #fff; }

.card-modal-icon { font-size: 56px; text-align: center; margin-bottom: 12px; }

.card-modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem; text-align: center;
    color: #fff; margin: 0 0 20px;
}

.card-modal-meaning {
    font-size: 1.1rem; line-height: 1.8;
    color: rgba(255,255,255,0.8);
    text-align: center; margin-bottom: 24px;
    padding: 0 10px;
}

.card-modal-affirmation {
    background: linear-gradient(135deg, rgba(201,133,107,0.15), rgba(74,124,111,0.15));
    border: 1px solid rgba(201,133,107,0.25);
    border-radius: 14px;
    padding: 18px 24px;
    text-align: center;
    font-style: italic;
    color: #c9856b;
    font-size: 1.05rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.card-modal-questions { margin-bottom: 28px; }
.card-modal-questions h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem; color: #fff;
    margin-bottom: 16px; text-align: center;
}
.card-modal-questions ul {
    list-style: none; padding: 0; margin: 0;
}
.card-modal-questions li {
    padding: 14px 18px;
    background: rgba(255,255,255,0.04);
    border-left: 3px solid #c9856b;
    border-radius: 0 12px 12px 0;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-modal-actions {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.card-modal-actions .btn {
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}
.card-modal-actions .btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}
.card-modal-actions .btn-outline:hover {
    border-color: #c9856b; color: #c9856b;
}
.card-modal-actions .btn-primary {
    background: linear-gradient(135deg, #c9856b, #4a7c6f);
    border: none; color: #fff;
}
.card-modal-actions .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(201,133,107,0.4); transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .spread-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
    .card-modal { padding: 36px 20px 28px; }
    .card-modal-title { font-size: 1.6rem; }
    .card-modal-meaning { font-size: 1rem; }
    .card-ornament-mini { font-size: 20px; }
    .card-num { width: 22px; height: 22px; font-size: 11px; }
}
@media (max-width: 400px) {
    .spread-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
}

/* === Enhanced Cards Mobile === */
@media (max-width: 768px) {
    .cards-hero { padding: 100px 0 50px; }
    .cards-hero h1 { font-size: 1.8rem; }
    .cards-hero p { font-size: 0.95rem; }
    .spread-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 100%; padding: 12px 0; }
    .result-card { padding: 24px 16px; }
    .card-modal { padding: 28px 16px 20px; max-height: 85vh; }
    .card-modal-close { top: 10px; right: 10px; }
    .card-modal-title { font-size: 1.4rem; }
    .card-modal-meaning { font-size: 0.95rem; }
    .card-modal-section h4 { font-size: 1rem; }
    .card-modal-questions li { font-size: 0.9rem; padding: 8px 12px; }
    .card-modal-affirmation { font-size: 1rem; padding: 14px 16px; }
    .card-modal-actions { flex-direction: column; gap: 8px; }
    .card-modal-actions .btn { width: 100%; }
}
@media (max-width: 400px) {
    .spread-grid { gap: 4px; }
    .card-modal { padding: 20px 12px 16px; }
    .card-modal-title { font-size: 1.2rem; }
    .card-num { width: 18px; height: 18px; font-size: 10px; }
}
