/* Complete Updated Tarot Styles with Mobile Optimization and Centered Responsive Modal */
:root {
    --primary-color: #3a3a3a;
    --secondary-color: #f0f0f0;
    --accent-color: #6200ee;
    --text-color: #333;
    --background-color: #e6e6fa;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --modal-border-radius: 15px;
}

body, html {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    height: 100%;
    width: 100%;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

#ad {
    position: fixed;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    bottom: 0;
    left: 0;
}

.card-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
    background-color: var(--background-color);
}

.arcana-section {
    position: relative;
    z-index: 2;
    width: 600px;
    height: 100%;
}

.arcana-section img {
    position: absolute;
    width: 100px;
    height: 130px;
    bottom: 5%;
    left: 40%;
    transform-origin: bottom center;
    transition: transform 0.5s, box-shadow 0.3s;
    cursor: pointer;
    transform: translate(-50%, 0) rotateY(0deg);
    border-radius: 5px;
    box-shadow: var(--card-shadow);
}

.arcana-section img:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.flipped {
    transform: translate(-50%, 0) rotateY(180deg);
}

.modal {
    position: fixed;
    z-index: 3;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: padding-top 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    padding-top: 50px; /* Added padding to push the modal down */
}

body.translated .modal {
    padding-top: 110px; /* Increased padding for translated body */
}

.modal-content {
    position: relative;
    background-color: #fff;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--modal-border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    box-sizing: border-box;
}

.modalText {
    margin-top: 30px;
    text-align: center; 
    overflow-y: auto;
}

.close {
    color: var(--primary-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

#selected-cards {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

#selected-cards img {
    border-radius: 5px;
    box-shadow: var(--card-shadow);
}

.interpretation-container {
    text-align: left;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: var(--card-shadow);
}

.interpretation-container h2 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.interpretation-section {
    margin-bottom: 20px;
}

.interpretation-section h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.interpretation-section p {
    color: var(--text-color);
    line-height: 1.6;
}

.interpretation-section ul {
    padding-left: 20px;
    list-style-type: none;
    margin-top: 10px;
}

.interpretation-section li {
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.4;
    position: relative;
}

.interpretation-section li::before {
    content: "•";
    position: absolute;
    left: -15px;
    color: var(--accent-color);
}

#skipButton {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#skipButton:hover {
    background-color: #7c4dff;
}

#google_translate_element {
    position: fixed;
    bottom: 10px;
    right: 5px;
    z-index: 1000;
}

.goog-te-banner-frame {
    top: 0;
    left: 0;
    right: 0;
    position: fixed !important;
}

.goog-te-gadget {
    font-family: 'Roboto', Arial, sans-serif !important;
    font-size: 14px !important;
}

.goog-te-gadget-simple {
    background-color: var(--background-color) !important;
    border: 1px solid var(--secondary-color) !important;
    padding: 8px !important;
    border-radius: 4px !important;
    box-shadow: var(--card-shadow) !important;
}

.button-container {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.button-container button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button-container button:hover {
    background-color: #7c4dff;
}

@media screen and (max-width: 768px) {
    :root {
        --modal-border-radius: 15px;
    }

    .arcana-section {
        width: 100%;
    }

    .arcana-section img {
        width: 80px;
        height: 104px;
    }

    .modal {
        padding: 10px;
        padding-top: 30px; /* Adjusted padding for smaller screens */
    }

    body.translated .modal {
        padding-top: 90px; /* Adjusted padding for translated body on smaller screens */
    }

    .modal-content {
        padding: 15px;
        max-height: 85vh;
    }

    .interpretation-container {
        padding: 10px;
    }

    .interpretation-section ul {
        padding-left: 15px;
    }

    .interpretation-section li::before {
        left: -12px;
    }

    #google_translate_element {
        bottom: 5px;
        right: 5px;
    }

    .close {
        font-size: 24px;
        right: 10px;
        top: 10px;
    }

    .modalText {
        margin-top: 20px;
        font-size: 14px;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .button-container button {
        width: 100%;
        max-width: 200px;
    }
}

@media screen and (max-width: 480px) {
    .modal-content {
        padding: 10px;
        max-height: 80vh;
    }

    .close {
        font-size: 20px;
        right: 8px;
        top: 8px;
    }
}