:root {
    --bg-black: #05070a;
    --deep-blue: #0a0d22;
    --mystic-gold: #c9a84c;
    --gold-glow: rgba(201, 168, 76, 0.3);
    --gold-dim: #7a6230;
    --text-primary: #b8c4e0;
    --text-secondary: #6e7a9e;
    --accent-cream: #e8dfc8;
    --glass-bg: rgba(10, 13, 34, 0.7);
    --glass-border: rgba(201, 168, 76, 0.2);
    --card-back-bg: #0a1035;
    --transition-slow: 0.85s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: var(--bg-black);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(ellipse at 50% 30%, #111b4a 0%, #070a1e 55%, var(--bg-black) 100%);
    background-attachment: fixed;
    line-height: 1.6;
}

/* --- STAR BACKGROUND --- */
.stars-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: var(--opacity); transform: scale(1); }
}

/* --- LAYOUT --- */
.page-wrapper {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page-header h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--mystic-gold);
    letter-spacing: 0.2em;
    text-shadow: 0 0 30px var(--gold-glow);
    text-transform: uppercase;
}

.page-header .subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: 1.8rem;
    color: var(--gold-dim);
    margin-top: -0.5rem;
}

.header-ornament {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    opacity: 0.6;
}

.header-ornament::before, .header-ornament::after {
    content: '';
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--mystic-gold), transparent);
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* --- CARDS PANEL --- */
.cards-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-label {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    color: var(--gold-dim);
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.cards-row {
    display: flex;
    gap: 2.5rem;
    perspective: 1500px;
    margin-bottom: 3rem;
}

.card-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.card-inner {
    position: relative;
    width: 180px;
    height: 380px;
    transform-style: preserve-3d;
    transition: transform var(--transition-slow);
    cursor: default;
}

.card-inner.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 2px solid var(--mystic-gold);
    box-shadow: 0 15px 45px rgba(0,0,0,0.8);
    overflow: hidden;
}

.card-back {
    background-color: #050714; /* Handige fallback-kleur tijdens het laden */
    background-image: url("card-back.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Behoudt de mooie goudrand en afgeronde hoeken uit je spread */
    border: 2px solid var(--mystic-gold);
    border-radius: 12px;
    
    /* Deze schaduw zorgt ervoor dat de afbeelding mooi diepte krijgt aan de binnenkant */
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.85), 
        0 15px 45px rgba(0, 0, 0, 0.9);
}
.card-front {
    background: #b8c8dd;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-img-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ccd9e8;
    position: relative;
    padding: 1.25rem;
    overflow: hidden;
    min-height: 0;
}

.card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity var(--transition-med);
}

.card-img.loaded {
    opacity: 1;
}

.img-placeholder {
    position: absolute;
    font-size: 3rem;
    color: var(--mystic-gold);
    opacity: 0.3;
}

.card-info {
    flex-shrink: 0;
    height: 80px;
    background: #b8c8dd;
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.card-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.85rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.card-type {
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-pos-label {
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.8rem;
    color: var(--gold-dim);
    letter-spacing: 0.1em;
}

/* --- BUTTONS --- */
.action-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.primary-btn {
    background: linear-gradient(135deg, #9a7830, var(--mystic-gold), #9a7830);
    color: #08091a;
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.85rem;
    padding: 1rem 3rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(201,168,76,0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201,168,76,0.5);
    filter: brightness(1.1);
}

.secondary-btn {
    background: transparent;
    color: var(--mystic-gold);
    border: 1px solid var(--mystic-gold);
    padding: 0.8rem 2rem;
    font-family: 'Cinzel Decorative', serif;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.secondary-btn:hover {
    background: rgba(201, 168, 76, 0.1);
}

.hidden { display: none; }

.instruction {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* --- READING PANEL --- */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    padding: 3rem;
    min-height: 400px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
}

.glass-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.reading-title {
    font-family: 'Cinzel Decorative', serif;
    color: var(--mystic-gold);
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.reading-title-sub {
    font-family: 'Great Vibes', cursive;
    color: var(--gold-dim);
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 3rem;
}

.reading-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.reading-section:last-child { border-bottom: none; }

.reading-position-title {
    font-family: 'Cinzel Decorative', serif;
    color: var(--mystic-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.card-drawn-name {
    font-family: 'Great Vibes', cursive;
    color: var(--accent-cream);
    font-size: 1.5rem;
}

.reading-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.reading-text p { margin-bottom: 1rem; }

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.modal-box {
    background: var(--deep-blue);
    border: 1px solid var(--mystic-gold);
    padding: 4rem;
    max-width: 500px;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.modal-glyph {
    font-size: 3rem;
    color: var(--mystic-gold);
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: 'Cinzel Decorative', serif;
    color: var(--mystic-gold);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: 1.8rem;
    color: var(--gold-dim);
    margin-bottom: 2rem;
}

.modal-text {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    .cards-row {
        flex-direction: column;
        align-items: center;
    }
    .card-inner {
        width: 220px;
        height: 460px;
    }
    .page-wrapper { padding: 1rem; }
    .glass-panel { padding: 1.5rem; }
}

/* --- SPECIAL INFLUENCES --- */
#interaction-container {
    margin-top: 2rem;
}

.special-influence {
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid var(--mystic-gold);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px var(--gold-glow);
    animation: fadeIn 1.2s ease-out forwards;
}

.special-influence-content {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--accent-cream);
    line-height: 1.6;
    text-align: center;
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}
