/* Overlay — hidden by default; head inline script + JS will show it when needed */
.modal-overlay-age {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;                 /* default hidden */
    align-items: center;
    justify-content: center;
    z-index: 1050;
    pointer-events: none;          /* block clicks only when active */
}
.modal-overlay-age.active {
    display: flex;
    pointer-events: auto;
}

/* Modal */
.modal-age {
    position: relative;
    width: 90%;
    max-width: 500px;
    min-width: 300px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow-y: auto;
    color: #333333;
    z-index: 1051;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.modal-age-header { margin-bottom: 15px; }

/* Title (support both .modal-age-title and .modal-title used in markup) */
.modal-age-title,
.modal-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #333333;
    text-align: center;
}

/* Footer */
.modal-age-footer {
    width: 100%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Buttons */
.agegate-modal.btn {
    background-color: #b70700;
    color: #ffffff;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    width: 100%;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.agegate-modal.btn:hover { background-color: #e65c00; }

/* Ad toggle */
.ad-free-container {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #333333;
    margin-top: 15px;
}
.js-ad-free-link.ad input { margin-right: 8px; }

/* Backdrop blur helper (if you want a stronger blur you can keep it) */
.modal-overlay-age::before {
    content: "";
    position: fixed;
    inset: 0;
    backdrop-filter: blur(8px);
    z-index: 1049;
}

/* Under-18 full overlay */
#under18Warning {
    text-align: center;
    font-size: 1.2em;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
    backdrop-filter: blur(8px);
    border-radius: 8px;
}

.under18-warning-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    text-align: center;
    backdrop-filter: blur(8px);
}

/* Mobile tweaks – target the actual classes used */
@media (max-width: 600px) {
    .modal-age {
        width: 95%;
        max-width: 350px;
        padding: 15px;
    }
    .modal-title,
    .modal-age-title { font-size: 1.2em; }

    .modal-age-footer { font-size: 0.9em; }

    .agegate-modal.btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .ad-free-container { font-size: 0.8em; }
}
