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

:root {
    --primary-color: #c9a95c;
    --secondary-color: #8b7355;
    --background-dark: #1a1a2e;
    --background-light: #16213e;
    --text-color: #ffffff;
    --card-width: 280px;
    --gold-gradient: linear-gradient(135deg, #ffd700, #b8860b);
    --diamond-gradient: linear-gradient(45deg, 
        rgba(255,255,255,0.2) 0%,
        rgba(255,255,255,0.4) 25%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.4) 75%,
        rgba(255,255,255,0.2) 100%);
}

body {
    font-family: 'Playfair Display', serif;
    background: linear-gradient(135deg, var(--background-dark), var(--background-light));
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

#game-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

#game-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--diamond-gradient);
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
    animation: shimmer 10s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -1000px -1000px; }
    100% { background-position: 1000px 1000px; }
}

.screen {
    display: none;
    width: 100%;
    padding: 30px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, h2 {
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Cinzel', serif;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--primary-color);
}

.input-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(201, 169, 92, 0.3);
}

input[type="text"] {
    width: 100%;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    font-size: 1.2em;
    font-family: 'Playfair Display', serif;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(201, 169, 92, 0.3);
    transform: translateY(-2px);
}

.theme-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px auto;
    max-width: 1000px;
    padding: 0 20px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
    border: none;
    border-radius: 15px;
    background: var(--gold-gradient);
    color: var(--background-dark);
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--diamond-gradient);
    transition: all 0.6s ease;
}

.theme-btn:hover::before {
    left: 100%;
}

.theme-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(201, 169, 92, 0.3);
}

.theme-btn .icon {
    font-size: 3em;
    position: relative;
    z-index: 1;
}

.theme-btn .text {
    font-size: 1.4em;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

#canvas-container {
    width: 100%;
    height: 50vh;
    margin: 30px 0;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(201, 169, 92, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--card-width), 1fr));
    gap: 40px;
    padding: 30px;
    margin: 30px 0;
}

.card-container {
    position: relative;
    width: 100%;
    padding-bottom: 150%;
    background: var(--gold-gradient);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--diamond-gradient);
    opacity: 0.5;
    animation: shimmerCard 3s linear infinite;
}

@keyframes shimmerCard {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.card-container:hover {
    transform: translateY(-15px) rotate(5deg);
    box-shadow: 0 20px 40px rgba(201, 169, 92, 0.4);
}

.card-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    transition: all 0.5s ease;
}

.card-meaning {
    margin: 25px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    text-align: left;
    transition: all 0.4s ease;
    border: 1px solid rgba(201, 169, 92, 0.2);
}

.card-meaning:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.card-meaning h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5em;
    font-family: 'Cinzel', serif;
}

.card-meaning p {
    font-size: 1.1em;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    text-align: justify;
}

.reading-conclusion {
    margin-top: 40px;
    padding: 35px;
    background: linear-gradient(45deg, 
        rgba(201, 169, 92, 0.1), 
        rgba(139, 115, 85, 0.1));
    border-radius: 15px;
    border: 1px solid rgba(201, 169, 92, 0.3);
    position: relative;
    overflow: hidden;
}

.reading-conclusion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--diamond-gradient);
    opacity: 0.1;
    animation: shimmer 5s linear infinite;
}

.reading-conclusion h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8em;
    font-family: 'Cinzel', serif;
    position: relative;
}

.reading-conclusion p {
    font-size: 1.2em;
    line-height: 1.8;
    position: relative;
    text-align: justify;
}

button {
    padding: 20px 40px;
    font-size: 1.3em;
    border: none;
    border-radius: 12px;
    background: var(--gold-gradient);
    color: var(--background-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--diamond-gradient);
    transition: all 0.6s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(201, 169, 92, 0.3);
}

#reset-button {
    background: linear-gradient(45deg, #e24a4a, #bd3535);
    margin-top: 30px;
}

@media (max-width: 768px) {
    :root {
        --card-width: 220px;
    }

    body {
        padding: 10px;
    }

    .screen {
        padding: 20px;
    }

    .theme-buttons {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #canvas-container {
        height: 40vh;
    }

    .cards-grid {
        gap: 20px;
        padding: 15px;
    }

    .card-meaning {
        padding: 20px;
    }

    .reading-conclusion {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    :root {
        --card-width: 160px;
    }

    h1 {
        font-size: 1.8em;
    }

    .theme-btn {
        padding: 20px;
    }

    .theme-btn .icon {
        font-size: 2em;
    }

    .theme-btn .text {
        font-size: 1.2em;
    }

    .card-meaning h3 {
        font-size: 1.3em;
    }

    .reading-conclusion {
        padding: 20px;
    }

    button {
        padding: 15px 30px;
        font-size: 1.1em;
    }
}

/* Ad Container Styles */
.ad-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(201, 169, 92, 0.2);
    overflow: hidden;
    position: relative;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.ad-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--diamond-gradient);
    opacity: 0.05;
    pointer-events: none;
}

.ad-container ins.adsbygoogle {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100px;
}

/* Specific Ad Placements */
.ad-top {
    margin-bottom: 30px;
}

.ad-middle {
    margin: 30px auto;
}

.ad-before-cards {
    margin: 20px auto;
}

.ad-before-results {
    margin: 30px auto;
}

.ad-bottom {
    margin: 30px auto 20px;
}

/* Responsive Ad Containers */
@media (max-width: 768px) {
    .ad-container {
        padding: 10px;
        margin: 15px auto;
    }

    .ad-top, .ad-middle, .ad-before-cards,
    .ad-before-results, .ad-bottom {
        margin: 15px auto;
    }
}

@media (max-width: 480px) {
    .ad-container {
        padding: 8px;
        margin: 10px auto;
        min-height: 80px;
    }

    .ad-container ins.adsbygoogle {
        min-height: 80px;
    }
}

/* Ensure ads don't break layout on small screens */
@media (max-width: 320px) {
    .ad-container {
        min-height: 60px;
    }

    .ad-container ins.adsbygoogle {
        min-height: 60px;
    }
} 