/* =============================================
   KALENDER-WRAPPER – SAUBER & RESPONSIV
   ============================================= */
#apal-calendar-wrapper {
    position: relative;
    width: 100%;
    max-width: 1406px;
    margin: 0 auto;
    aspect-ratio: 1406 / 1580;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* =============================================
   TÜREN (DESKTOP)
   ============================================= */
.apal-door {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 0;
    background: #A7B964;
    border: 4px solid #ffffff;
    color: #ffffff;
    font-size: 26px;
    line-height: 70px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
    z-index: 20;
}

/* Vergangene Tage */
.apal-door-past {
    opacity: 0.5;
}

/* Heute */
.apal-door-today {
    box-shadow: 0 0 0 4px gold;
}

/* Zukünftige Tür */
.apal-door-locked {
    opacity: 0.6;
}

/* Schloss aus */
.apal-door-locked::after {
    display: none !important;
}

/* Klick-Effekt */
.apal-door.clicked {
    transform: rotateY(-110deg);
    opacity: 0.3;
}

/* Hover */
.apal-door:hover {
    box-shadow: 0 0 10px rgba(255,255,255,0.7);
}

/* =============================================
   POPUPS
   ============================================= */
.apal-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
}

.apal-popup-inner {
    max-width: 90vw;
    width: 90vw;
    background: white;
    padding: 20px;
    max-height: 90vh;
    overflow: auto;
    border-radius: 10px;
    margin: 40px auto;
}

.apal-popup-image {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 15px;
}

.apal-popup-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.apal-popup-button {
    display: inline-block;
    padding: 10px 16px;
    background: #A7B964;
    color: white;
    border-radius: 5px;
    text-decoration: none;
}

/* Close */
.apal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    font-size: 26px;
    border: none;
    cursor: pointer;
}

/* =============================================
   SCHNEE
   ============================================= */
.apal-snowflake {
    position: absolute;
    top: -20px;
    pointer-events: none;
    animation: fall 6s linear infinite;
}

@keyframes fall {
    to { transform: translateY(120vh); }
}

@media (max-width: 768px) {

    /* Wrapper bleibt sauber */
    #apal-calendar-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 1406 / 1580;
        background-size: cover;
        background-position: center;
        margin: 0 auto;
        padding: 0;
    }

    /* TÜREN ENDLICH KORREKT MOBILE KLEIN */
    .apal-door {
        width: 8vw !important;
        height: 8vw !important;
        line-height: 8vw !important;

        font-size: 4vw !important;
        border-width: 2px !important;

        /* ZENTRIERUNG – DER ABSOLUT WICHTIGE PART */
        transform: translate(-50%, -50%) !important;
    }
}
