body {
    font-family: 'Lora', serif;
    background-color: #0A1E12; /* Deep green background */
    color: #f0e68c; /* Pale gold for text */
    text-align: center;
    margin: 0;
    padding: 0; /* Remove body padding */
    background-image: url('images/subtle-prism.svg');
    background-size: cover; /* Cover the entire body */
    background-repeat: no-repeat; /* Do not repeat the image */
    background-attachment: fixed; /* Keep background fixed when scrolling */
    min-width: 300px;
    display: flex; /* Make body a flex container */
    flex-direction: column; /* Stack children vertically */
    min-height: 100vh; /* Ensure body takes full viewport height */
}

h1 {
    color: #ffd700; /* Gold color for the main title */
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 2.8em;
    text-shadow: 0 0 10px #ffd700;
}

.question-section {
    margin: 0 auto 20px auto; /* Center horizontally, maintain bottom margin */
    max-width: 500px; /* Match textarea max-width for centering */
    box-sizing: border-box;
}

.question-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #ffd700;
}

.question-section textarea {
    width: 100%;
    max-width: 500px;
    min-width:280px;
    padding: 10px;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background-color: #1E2B12;
    color: #f0e68c;
    font-family: 'Lora', serif;
    font-size: 1em;
    resize: vertical;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}

.question-section textarea:focus {
    outline: none;
    border-color: #f0e68c;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#card-container {
    display: flex;
    justify-content: center;
    align-items: stretch; /* Make cards same height */
    flex-wrap: wrap;
    margin-top: 20px;
    perspective: 1000px;
}

.card {
    background-color: #1E2B12;
    width: 180px;
    border: 2px solid #ffd700; /* Gold border */
    border-radius: 10px;
    margin: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, box-shadow 0.5s;
}

.card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.card.reversed img {
    transform: rotate(180deg); /* Rotate image for reversed cards */
}

.reversed-icon {
    font-size: 1.5em;
    color: #ffd700;
    margin-top: 5px;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

.card h3 {
    margin: 0 0 15px 0;
    color: #ffd700;
    font-size: 1.4em;
}

.card p {
    margin: 15px 0 0 0;
    font-size: 1.1em;
    font-weight: bold;
    color: #f0e68c;
}

.card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    background-color: #f0f0f0; /* Give the SVG a light background */
    border: 1px solid #ccc;
}

#draw-button {
    background-color: #ffd700; /* Gold */
    color: #0A1E12; /* Dark green text */
    border: 2px solid #f0e68c;
    padding: 15px 30px;
    font-size: 1.2em;
    font-family: 'Lora', serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    font-weight: bold;
    max-width: 250px; /* Limit the width */
    margin: 20px auto; /* Center horizontally and add vertical margin */
}

#draw-button:hover {
    background-color: #f0e68c; /* Lighter gold on hover */
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

#draw-button:disabled {
    background-color: #555;
    color: #bbb;
    border-color: #777;
    cursor: not-allowed;
    box-shadow: none;
}

#explanation-container {
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#explanation-container h2,
#explanation-container p {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#explanation-container.show-text h2,
#explanation-container.show-text p {
    opacity: 1;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .card {
        width: 150px;
        margin: 15px;
        padding: 15px;
    }

    #draw-button {
        padding: 12px 25px;
        font-size: 1em;
    }

    .question-section textarea {
        width: 90%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    .card {
        width: 120px;
        margin: 10px;
        padding: 10px;
    }

    .card h3 {
        font-size: 1.2em;
    }

    .card p {
        font-size: 0.9em;
    }

    #draw-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .question-section textarea {
        width: 95%;
    }
}

/* Spread Selection Styles */
.spread-selection-section {
    margin: 20px auto;
    max-width: 600px;
    padding: 15px;
    color: #f0e68c;
}

.spread-selection-section label {
    display: block;
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ffd700;
}

.spread-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.spread-button {
    background-color: #1E2B12;
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    width: 200px; /* Fixed width for consistency */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.spread-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.spread-button[aria-pressed="true"] {
    background-color: #ffd700; /* Gold background for selected */
    color: #0A1E12; /* Dark green text for selected */
    border-color: #f0e68c;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

.spread-button[aria-pressed="true"] h3,
.spread-button[aria-pressed="true"] p {
    color: #0A1E12; /* Dark green text for selected */
}

.spread-button h3 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: bold;
}

.spread-button p {
    color: #f0e68c;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 0;
    font-weight: bold;
}

.hidden-initial {
    display: none;
}

.hidden-initial {
    display: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex; /* Show when .show class is present */
}

.modal-content {
    background-color: #1E2B12;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    max-width: 500px;
    text-align: center;
}

.modal-content h2 {
    color: #ffd700;
}

.modal-content p {
    color: #f0e68c;
}

.modal-content button {
    background-color: #ffd700;
    color: #0A1E12;
    border: 2px solid #f0e68c;
    padding: 10px 20px;
    font-size: 1em;
    font-family: 'Lora', serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-weight: bold;
}

.modal-content button:hover {
    background-color: #f0e68c;
}

/* Footer Styles */
footer {
    margin-top: auto; /* Push footer to the bottom */
    padding: 20px 1em; /* Add horizontal padding */
    background-color: #1E2B12; /* Dark green background */
    border-top: 2px solid #ffd700; /* Gold border on top */
    color: #f0e68c; /* Pale gold text */
    font-size: 0.9em;
    text-align: center;
}

footer p {
    margin: 0;
}

