/* Root Variables */
:root {
    --primary-purple: #6b21a8;
    --primary-purple-light: #a855f7;
    --primary-purple-dark: #3b0764;
    --accent-pink: #ec4899;
    --accent-magenta: #d946ef;
    --gold: #d4af37;
    --gold-light: #f4d03f;
    --bg-dark: #0f0a1a;
    --bg-purple: #1a0a2e;
    --bg-card: #2d1b4e;
    --text-primary: #f5f5f5;
    --text-secondary: #c4b5d4;
    --text-gold: #d4af37;
    --border-purple: #6b21a8;
    --glow-purple: rgba(168, 85, 247, 0.4);
    --glow-pink: rgba(236, 72, 153, 0.4);
}

/* CA Banner */
.ca-banner {
    width: 100%;
    background: linear-gradient(90deg, var(--primary-purple-dark), var(--primary-purple), var(--primary-purple-dark));
    color: var(--gold);
    text-align: center;
    padding: 8px 15px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    border-bottom: 1px solid var(--gold);
    user-select: all;
    cursor: pointer;
}

.ca-banner:hover {
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-magenta), var(--primary-purple));
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: linear-gradient(180deg, #0f0a1a 0%, #1a0a2e 50%, #2d1054 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    padding-top: 40px;
}

/* ============ LOADING SCREEN ============ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0510 0%, #1a0a2e 50%, #0f0520 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.portal-container {
    position: relative;
    width: 200px;
    height: 280px;
    margin: 0 auto 40px;
}

.portal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 220px;
    background: radial-gradient(ellipse, #ec4899 0%, #a855f7 30%, transparent 70%);
    filter: blur(30px);
    animation: portalPulse 2s ease-in-out infinite;
}

.portal-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 180px;
    border: 3px solid rgba(168, 85, 247, 0.5);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: portalRotate 4s linear infinite;
}

.portal-ring.ring-2 {
    width: 140px;
    height: 200px;
    border-color: rgba(236, 72, 153, 0.3);
    animation-direction: reverse;
    animation-duration: 6s;
}

.portal-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 140px;
    background: linear-gradient(180deg, #f0abfc 0%, #ec4899 50%, #a855f7 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 60px rgba(236, 72, 153, 0.8), inset 0 0 30px rgba(255, 255, 255, 0.3);
    animation: portalPulse 2s ease-in-out infinite;
}

@keyframes portalPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

@keyframes portalRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading-title {
    font-family: 'Cinzel Decorative', 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.loading-title-en {
    font-weight: 700;
}

.loading-title-zh {
    font-size: 1.5rem;
    font-family: 'Cormorant Garamond', serif;
    color: var(--accent-pink);
    font-weight: 400;
}

.loading-quote {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold);
    font-style: italic;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.quote-en, .quote-zh {
    display: block;
}

.quote-zh {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: 'Cormorant Garamond', serif;
}

.loading-hint {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    animation: pulse 2s ease-in-out infinite;
}

.hint-zh {
    font-size: 0.85rem;
    color: var(--accent-pink);
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-pink), var(--primary-purple-light));
    border-radius: 2px;
    animation: loadingProgress 2.5s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ============ CURTAINS ============ */
.curtain-left, .curtain-right {
    position: fixed;
    top: 0;
    width: 120px;
    height: 100%;
    background: linear-gradient(90deg, #3b0764 0%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

.curtain-left {
    left: 0;
    background: linear-gradient(90deg, #3b0764 0%, transparent 100%);
}

.curtain-right {
    right: 0;
    background: linear-gradient(-90deg, #3b0764 0%, transparent 100%);
}

/* ============ STARS & CONSTELLATION ============ */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.constellation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
    background-image:
        radial-gradient(1px 1px at 100px 50px, #fff, transparent),
        radial-gradient(1px 1px at 200px 150px, #fff, transparent),
        radial-gradient(1px 1px at 300px 80px, #fff, transparent),
        radial-gradient(1px 1px at 400px 200px, #fff, transparent),
        radial-gradient(1px 1px at 500px 120px, #fff, transparent),
        radial-gradient(2px 2px at 600px 300px, #a855f7, transparent),
        radial-gradient(1px 1px at 700px 180px, #fff, transparent),
        radial-gradient(2px 2px at 150px 400px, #ec4899, transparent);
}

/* ============ CONTAINER ============ */
.container {
    position: relative;
    z-index: 5;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ============ PAGE SECTIONS ============ */
.page {
    display: none;
    animation: fadeIn 0.6s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ HEADER ============ */
.header {
    text-align: center;
    padding: 40px 20px 30px;
}

.sun-moon-icon {
    margin-bottom: 20px;
}

.celestial-icon {
    width: 100px;
    height: 100px;
    animation: celestialFloat 4s ease-in-out infinite;
}

@keyframes celestialFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.main-title {
    font-family: 'Cinzel Decorative', 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-gold);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.subtitle-script {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-style: italic;
    color: var(--text-gold);
    opacity: 0.8;
    margin-bottom: 25px;
}

.intro-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.intro-text p {
    margin: 5px 0;
}

/* ============ INPUT SECTION ============ */
.input-section {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 20px;
}

.input-wrapper {
    background: rgba(45, 27, 78, 0.6);
    border: 2px solid var(--border-purple);
    border-radius: 10px;
    padding: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(107, 33, 168, 0.3);
}

.input-wrapper:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--glow-purple);
}

#questionInput {
    width: 100%;
    background: transparent;
    border: none;
    padding: 15px 20px;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    text-align: center;
}

#questionInput::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* ============ SUGGESTIONS ============ */
.suggestions-section {
    padding: 20px;
    text-align: center;
}

.suggestions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

.suggestion-btn {
    background: rgba(45, 27, 78, 0.5);
    border: 1px solid var(--border-purple);
    padding: 10px 20px;
    border-radius: 25px;
    color: var(--text-secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: rgba(107, 33, 168, 0.5);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.2);
}

/* ============ START BUTTON ============ */
.start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 30px auto;
    padding: 18px 50px;
    background: linear-gradient(135deg, #d946ef 0%, #a855f7 50%, #7c3aed 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(168, 85, 247, 0.6);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sparkles {
    font-size: 1.3rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

/* ============ SECONDARY BUTTON ============ */
.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-purple);
    padding: 15px 35px;
    border-radius: 15px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.secondary-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.2);
}

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.twitter-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-purple));
    border: 1px solid var(--border-purple);
    border-radius: 25px;
    color: var(--text-primary);
    text-decoration: none;
    font-style: normal;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.twitter-link:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.twitter-link .twitter-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.twitter-link .twitter-text {
    letter-spacing: 1px;
}

/* ============ DRAWING PAGE ============ */
.drawing-header, .result-header {
    text-align: center;
    padding: 30px 20px;
}

.drawing-header h2, .result-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.question-text {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-style: italic;
    max-width: 500px;
    margin: 0 auto;
}

.cards-instruction {
    text-align: center;
    margin-bottom: 25px;
}

.cards-instruction p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.selected-count {
    margin-top: 10px;
    color: var(--accent-pink);
    font-weight: 600;
}

/* ============ CARD DECK ============ */
.card-deck {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.deck-card {
    width: 55px;
    height: 80px;
    background: linear-gradient(135deg, #3b0764 0%, #1e0533 100%);
    border: 2px solid var(--gold);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.deck-card::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.deck-card::after {
    content: '\2726';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: var(--gold);
    opacity: 0.5;
}

.deck-card:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--accent-pink);
    box-shadow: 0 15px 30px rgba(236, 72, 153, 0.4);
}

.deck-card.selected {
    border-color: var(--accent-pink);
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.6);
    transform: translateY(-12px) scale(1.1);
}

.deck-card.selected::after {
    content: '\2713';
    color: var(--accent-pink);
    opacity: 1;
    font-size: 1.5rem;
}

.deck-card.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.reveal-btn {
    margin-top: 30px;
}

/* ============ RESULT CARDS ============ */
.result-cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px;
    margin-bottom: 30px;
}

.result-card {
    width: 160px;
    text-align: center;
    animation: cardReveal 0.8s ease-out forwards;
    opacity: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: scale(1.05);
}

.result-card:nth-child(1) { animation-delay: 0.2s; }
.result-card:nth-child(2) { animation-delay: 0.5s; }
.result-card:nth-child(3) { animation-delay: 0.8s; }

@keyframes cardReveal {
    0% { opacity: 0; transform: rotateY(180deg) scale(0.5); }
    100% { opacity: 1; transform: rotateY(0) scale(1); }
}

.card-position {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #3b0764 0%, #1e0533 100%);
    border-radius: 10px;
    border: 3px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.card-image.reversed {
    transform: rotate(180deg);
}

.card-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.card-reversed-label {
    font-size: 0.8rem;
    color: var(--accent-pink);
    font-style: italic;
}

.card-meaning {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* ============ INTERPRETATION ============ */
.interpretation-section {
    background: rgba(45, 27, 78, 0.5);
    border: 1px solid var(--border-purple);
    border-radius: 20px;
    padding: 35px;
    max-width: 700px;
    margin: 0 auto 30px;
    animation: fadeIn 1s ease-out 1.2s forwards;
    opacity: 0;
}

.interpretation-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.interpretation-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.interpretation-content p {
    margin-bottom: 18px;
}

.interpretation-content strong {
    color: var(--gold);
}

/* Intelligent Interpretation Sections */
.reading-opening {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

.cosmic-opening {
    font-style: italic;
    color: var(--accent-pink);
    font-size: 1.1rem;
    line-height: 1.7;
}

.card-interpretations {
    margin: 25px 0;
}

.position-reading {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(59, 7, 100, 0.3);
    border-radius: 12px;
    border-left: 3px solid var(--gold);
}

.position-reading h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.position-reading p {
    margin-bottom: 0;
    line-height: 1.8;
}

.past-reading {
    border-left-color: #a78bfa;
}

.present-reading {
    border-left-color: var(--accent-pink);
}

.future-reading {
    border-left-color: #34d399;
}

.synthesis-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 15px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.synthesis-section h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 2px;
}

.synthesis-section p {
    margin-bottom: 0;
    line-height: 1.9;
}

.guidance-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(52, 211, 153, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.guidance-section p {
    margin-bottom: 0;
    line-height: 1.8;
}

.prediction-section {
    margin-top: 25px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 15px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}

.prediction-section p {
    margin-bottom: 15px;
    line-height: 1.9;
}

.prediction-section p:last-child {
    margin-bottom: 0;
}

.prediction-section em {
    display: block;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--accent-pink);
    font-size: 0.95rem;
}

/* ============ RESULT ACTIONS ============ */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px;
}

/* ============ MODAL ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0a2e 100%);
    border: 2px solid var(--border-purple);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-pink);
}

.modal-content h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 25px;
}

.share-preview {
    background: #0f0a1a;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 25px;
    min-height: 200px;
    max-height: 60vh;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.share-preview img {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 10px;
    object-fit: contain;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 25px;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.twitter-btn {
    background: #000;
    color: white;
}

.twitter-btn:hover {
    background: #333;
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.instagram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(225, 48, 108, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--glow-purple);
}

.copy-btn {
    background: rgba(45, 27, 78, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border-purple);
}

.copy-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-purple));
    border: 2px solid var(--primary-gold);
    padding: 15px 30px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    z-index: 99999;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Card placeholder when image fails to load */
.card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--bg-purple));
    border-radius: 8px;
    color: var(--primary-gold);
}

.card-placeholder span:first-child {
    font-size: 3rem;
    margin-bottom: 10px;
}

.card-placeholder .card-name-fallback {
    font-size: 0.9rem;
    font-family: 'Cinzel', serif;
    text-align: center;
    padding: 0 10px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .curtain-left, .curtain-right {
        width: 60px;
    }

    .main-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .subtitle-script {
        font-size: 1.3rem;
    }

    .intro-text {
        font-size: 0.95rem;
    }

    .suggestions-grid {
        gap: 8px;
    }

    .suggestion-btn {
        padding: 8px 15px;
        font-size: 0.75rem;
    }

    .start-btn {
        padding: 15px 35px;
        font-size: 1rem;
    }

    .result-cards {
        gap: 15px;
    }

    .result-card {
        width: 130px;
    }

    .card-image {
        height: 200px;
    }

    .interpretation-section {
        padding: 25px 20px;
        margin: 0 10px 30px;
    }

    .deck-card {
        width: 45px;
        height: 65px;
    }

    .modal-content {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.6rem;
    }

    .result-card {
        width: 110px;
    }

    .card-image {
        height: 170px;
    }

    .card-name {
        font-size: 0.85rem;
    }

    .celestial-icon {
        width: 70px;
        height: 70px;
    }

    .loading-quote {
        font-size: 1.1rem;
        padding: 0 20px;
    }
}

/* ============ LANGUAGE TOGGLE ============ */
.lang-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--bg-purple));
    border: 2px solid var(--primary-purple);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

.lang-toggle .lang-icon {
    font-size: 1.1rem;
}

.lang-toggle .lang-text {
    letter-spacing: 1px;
}

/* ============ AI STATUS INDICATOR ============ */
.ai-status-indicator {
    position: fixed;
    top: 50px;
    right: 20px;
    padding: 8px 15px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--bg-purple));
    border: 2px solid var(--text-secondary);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
    transform: translateY(0);
    transition: all 0.3s ease;
    pointer-events: auto;
    cursor: help;
}

.ai-status-indicator:hover {
    opacity: 1;
    transform: scale(1.05);
}

.ai-status-indicator.online {
    opacity: 1;
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.ai-status-indicator.online:hover {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}

.ai-status-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-left: 2px;
}

.ai-status-indicator.online .ai-status-label {
    color: #10b981;
}

.ai-status-indicator .ai-icon {
    font-size: 1rem;
    animation: sparkle 2s ease-in-out infinite;
}

.ai-status-indicator .ai-icon-img {
    width: 18px;
    height: 18px;
    animation: sparkle 2s ease-in-out infinite;
}

.ai-status-indicator .ai-text {
    font-weight: 600;
    letter-spacing: 1px;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ============ AI LOADING STATE ============ */
.interpretation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.ai-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-purple);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.interpretation-loading p {
    color: var(--text-secondary);
    font-style: italic;
}

/* AI-generated interpretation styling */
.ai-interpretation {
    border-left: 3px solid var(--gold);
    padding-left: 15px;
}

.ai-interpretation strong {
    color: var(--gold);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-magenta));
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: white;
    margin-bottom: 15px;
}

.ai-badge::before {
    content: '✨';
}

/* Full response from AI with market data */
.full-response {
    line-height: 1.8;
    font-size: 1.05rem;
}

.full-response p {
    margin-bottom: 1em;
}

.full-response strong {
    color: var(--gold);
    display: block;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    font-size: 1.1em;
}

/* ============ CONTROL PANEL ============ */
.control-panel {
    position: fixed;
    top: 50px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.control-btn {
    padding: 10px 14px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--bg-purple));
    border: 2px solid var(--primary-purple);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

.control-btn .ctrl-icon {
    font-size: 1.1rem;
}

.control-btn .ctrl-text {
    font-weight: 600;
    letter-spacing: 1px;
}

.control-btn.sound-off .ctrl-icon {
    opacity: 0.5;
}

/* ============ SPREAD SELECTION ============ */
.spread-selection {
    margin: 20px 0;
    text-align: center;
}

.spread-label {
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 15px;
}

.spread-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.spread-btn {
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 2px solid var(--border-purple);
    color: var(--text-secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    min-width: 100px;
}

.spread-btn:hover {
    border-color: var(--primary-purple-light);
    color: var(--text-primary);
    transform: translateY(-3px);
}

.spread-btn.active {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--primary-purple));
    color: var(--gold);
    box-shadow: 0 0 20px var(--glow-purple);
}

.spread-icon {
    font-size: 1.5rem;
}

.spread-name {
    font-size: 0.8rem;
}

/* ============ HISTORY MODAL ============ */
.history-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.history-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border-purple);
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: var(--gold);
    transform: translateX(5px);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.history-question {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-style: italic;
}

.history-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-card-mini {
    padding: 5px 10px;
    background: var(--primary-purple-dark);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--gold);
}

.history-card-mini.reversed {
    color: var(--accent-pink);
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.clear-history-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--accent-pink);
    color: var(--accent-pink);
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.clear-history-btn:hover {
    background: var(--accent-pink);
    color: white;
}

/* ============ CARD DETAIL MODAL ============ */
.card-detail-modal {
    max-width: 500px;
}

.card-detail-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.detail-card-image {
    width: 180px;
    height: auto;
    margin: 15px auto;
}

.detail-card-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.detail-card-image.reversed img {
    transform: rotate(180deg);
}

.detail-card-info {
    width: 100%;
    text-align: left;
}

.detail-card-name {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 8px;
    text-align: center;
}

.detail-reversed-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-pink);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.detail-section {
    margin: 15px 0;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 3px solid var(--gold);
}

.detail-section h3 {
    color: var(--gold);
    font-family: 'Cinzel', serif;
    margin-bottom: 10px;
    font-size: 1rem;
}

.detail-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ============ LIGHT THEME OVERRIDES ============ */
.theme-light {
    background: linear-gradient(180deg, #f8f5ff 0%, #ede9fe 50%, #ddd6fe 100%);
}

.theme-light .loading-screen {
    background: linear-gradient(180deg, #f8f5ff 0%, #ede9fe 50%, #f8f5ff 100%);
}

.theme-light .card-back,
.theme-light .tarot-card {
    background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 50%, #a78bfa 100%);
}

.theme-light .modal-content {
    background: linear-gradient(135deg, #f8f5ff 0%, #ede9fe 100%);
}

.theme-light .control-btn,
.theme-light .spread-btn {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

/* ============ ENHANCED ANIMATIONS ============ */
/* Card flip animation */
@keyframes cardFlip {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateY(90deg) scale(1.1);
    }
    100% {
        transform: rotateY(180deg) scale(1);
    }
}

@keyframes cardReveal {
    0% {
        transform: scale(0.8) rotateY(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotateY(90deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 0 20px var(--glow-purple), 0 0 40px var(--glow-pink);
    }
    50% {
        box-shadow: 0 0 40px var(--glow-purple), 0 0 60px var(--glow-pink);
    }
}

@keyframes floatCard {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.card-flipping {
    animation: cardFlip 0.6s ease-in-out;
}

.card-revealing {
    animation: cardReveal 0.8s ease-out forwards;
}

.card-glowing {
    animation: cardGlow 2s ease-in-out infinite;
}

.card-floating {
    animation: floatCard 3s ease-in-out infinite;
}

/* Result card enhanced animation */
.result-card {
    animation: cardReveal 0.8s ease-out forwards;
    animation-delay: calc(var(--card-index, 0) * 0.2s);
    opacity: 0;
}

.result-card:nth-child(1) { --card-index: 0; }
.result-card:nth-child(2) { --card-index: 1; }
.result-card:nth-child(3) { --card-index: 2; }
.result-card:nth-child(4) { --card-index: 3; }
.result-card:nth-child(5) { --card-index: 4; }
.result-card:nth-child(6) { --card-index: 5; }
.result-card:nth-child(7) { --card-index: 6; }
.result-card:nth-child(8) { --card-index: 7; }
.result-card:nth-child(9) { --card-index: 8; }
.result-card:nth-child(10) { --card-index: 9; }

/* Card hover effects */
.tarot-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.4);
}

.tarot-card.selected {
    animation: cardGlow 1.5s ease-in-out infinite;
}

/* Shimmer effect for loading */
.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--primary-purple-light) 50%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============ RESPONSIVE CONTROL PANEL ============ */
@media (max-width: 768px) {
    .control-panel {
        top: 45px;
        left: 10px;
        gap: 8px;
    }

    .control-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .control-btn .ctrl-text {
        display: none;
    }

    .spread-options {
        gap: 8px;
    }

    .spread-btn {
        padding: 10px 15px;
        min-width: 80px;
    }

    .spread-icon {
        font-size: 1.2rem;
    }

    .spread-name {
        font-size: 0.7rem;
    }
}

/* ============ FIVE CARD LAYOUT ============ */
.result-cards.five-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 20px;
    max-width: 600px;
}

.result-cards.five-card .result-card:nth-child(4) {
    grid-column: 1;
}

.result-cards.five-card .result-card:nth-child(5) {
    grid-column: 3;
}

/* ============ CELTIC CROSS LAYOUT ============ */
.result-cards.celtic-cross {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 15px;
    max-width: 800px;
}

.result-cards.celtic-cross .result-card {
    font-size: 0.85rem;
}

.result-cards.celtic-cross .card-image img {
    max-height: 120px;
}

/* ============ SINGLE CARD LAYOUT ============ */
.result-cards.single {
    justify-content: center;
}

.result-cards.single .result-card {
    max-width: 250px;
}

.result-cards.single .card-image img {
    max-height: 300px;
}
