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

/* =============================================
   TÜREN
   ============================================= */
.apal-door {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.18);
    cursor: pointer;
    transition: 
        transform 0.5s ease, 
        opacity 0.3s ease, 
        box-shadow 0.3s ease;
    z-index: 10;
}

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

/* Heutige Tür */
.apal-door-today {
    box-shadow: 0 0 0 4px gold;
}

/* Zukunft: gesperrt */
.apal-door-locked {
    background: rgba(0,0,0,0.25);
}

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

/* Klickanimation */
.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;
}

/* NEU: Popup passt sich Viewport an – nichts wird abgeschnitten */
.apal-popup-inner {
    position: relative;

    max-width: 90vw;   /* niemals breiter als der Bildschirm */
    width: 90vw;
    margin: 40px auto;

    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-sizing: border-box;

    max-height: 90vh;  /* maximale Höhe */
    overflow: auto;    /* Inhalt kann scrollen */
}

/* NEU: Bild skaliert IMMER korrekt */
.apal-popup-image {
    display: block;
    width: 100%;       /* passt sich Popup an */
    height: auto;
    margin-bottom: 15px;
}

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

.apal-popup-text {
    margin-bottom: 15px;
}

.apal-popup-button {
    display: inline-block;
    padding: 10px 18px;
    background: #a7b964;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
}

.apal-popup-button:hover {
    background: #8c9f4f;
}

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

/* =============================================
   SCHNEE
   ============================================= */
.apal-snowflake {
    position: absolute;
    top: -20px;
    pointer-events: none;
    animation-name: apal_snow_fall;
    animation-timing-function: linear;
    animation-iteration-count: 1;
}

@keyframes apal_snow_fall {
    0% { transform: translateY(0); }
    100% { transform: translateY(120vh); }
}

