:root {
    --bg-color: #0a0a1a;
    --text-color: #e1e1ff;
    --accent-color: #9370DB;
    --card-color: #1a1a2e;
    --gold: #ffd700;
    --silver: #c0c0c0;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Georgia', serif;
    min-height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 50L80 90M50 50L20 90M50 50L50 10M50 50L90 50M50 50L10 50' stroke='%232a2a4a' stroke-width='0.5'/%3E%3C/svg%3E");
    overflow-x: hidden;
}

/* 
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}
*/

.lang-btn {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn.active {
    background: rgba(128, 0, 128, 0.7);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    text-align: center;
    padding: 2rem 0;
    position: relative;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: normal;
    letter-spacing: 2px;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.subtitle {
    font-style: italic;
    margin-bottom: 2rem;
    color: var(--silver);
}

.moon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--silver), #fff);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 4s infinite;
    opacity: 0.7;
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    50% { opacity: 0.8; }
    100% { opacity: 0.2; }
}

.reading-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

select, button {
    background-color: var(--card-color);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    cursor: pointer;
    margin: 1rem 0;
    min-width: 250px;
    max-width: 100%;
    transition: all 0.3s ease;
}

select:hover, button:hover {
    background-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

button {
    background: linear-gradient(135deg, var(--accent-color), #4b0082);
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    perspective: 1000px;
}

.card {
    width: 180px;
    height: 300px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s;
    cursor: pointer;
}

.card.flipped {
    transform: rotateY(180deg);
    background-color: #23233d;
    backface-visibility: visible;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.3);
}

.card-back {
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border: 2px solid var(--gold);
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20L30 10M20 20L10 10M20 20L10 30M20 20L30 30' stroke='%23ffd700' stroke-width='0.5'/%3E%3C/svg%3E");
}

.card-back::after {
    content: '★';
    font-size: 2rem;
    color: var(--gold);
}

.card-front {
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border: 2px solid var(--silver);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    text-align: center;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-weight: normal;
}

.card-image {
    width: 100px;
    height: 150px;
    margin: 0.5rem auto;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gold);
}

.card-meaning {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--silver);
}

.reading-result {
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 15px;
    background-color: rgba(26, 26, 46, 0.7);
    border: 1px solid var(--accent-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.reading-result.visible {
    opacity: 1;
}

.interpretation-title {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.interpretation-text {
    line-height: 1.6;
    text-align: left;
}

footer {
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
    color: var(--silver);
    margin-top: 2rem;
    border-top: 1px solid rgba(147, 112, 219, 0.3);
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .cards-container {
        gap: 1rem;
    }
    
    .card {
        width: 140px;
        height: 230px;
    }
    
    .reading-result {
        padding: 1rem;
    }
    
    .moon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .card {
        width: 120px;
        height: 200px;
    }
    
    .card-image {
        width: 80px;
        height: 120px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-meaning {
        font-size: 0.8rem;
    }
}

/* Animation for magical effects */
.magical-glow {
    animation: glow 4s infinite alternate;
}

@keyframes glow {
    0% { box-shadow: 0 0 10px rgba(147, 112, 219, 0.3); }
    100% { box-shadow: 0 0 25px rgba(147, 112, 219, 0.7); }
}

.fade-in {
    animation: fadeIn 1.5s ease forwards;
}

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