:root {
    --bg: #0c0a10;
    --glass: rgba(26, 15, 46, 0.7);
    --glass-border: rgba(212, 175, 55, 0.2);
    --gold: #d4af37;
    --accent: #528aff;
    --text: #F3F1ED;
    --muted: #9E9B96;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.glass-header {
    text-align: center;
    padding: 25px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--gold);
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
}

/* 3D Scene */
.scene {
    width: 260px;
    height: 420px;
    perspective: 1000px;
    cursor: pointer;
}

.tarot-card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.tarot-card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    overflow: hidden;
}

.card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front {
    transform: rotateY(180deg);
}

/* Result Panel */
.result-panel {
    width: 100%;
    padding: 30px;
    text-align: center;
}

#arcana-name {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    margin-bottom: 20px;
}

.ai-response {
    text-align: left;
    line-height: 1.8;
    color: #ddd;
    font-style: italic;
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 12px;
    border-left: 3px solid var(--accent);
}

.loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--accent);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(82, 138, 255, 0.2);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.share-btn {
    margin-top: 25px;
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

/* Floating Navigation */
.floating-dock {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dock-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    cursor: pointer;
}

@media (max-width: 600px) {
    .scene { width: 200px; height: 320px; }
    .title { font-size: 1.8rem; }
}