/* ------------------------------
   Grund-Layout & Performance
   ------------------------------ */
:root {
    --accent1: #a18fff;
    --accent2: #eebf63;
    --bg-dark: #181c2f;
    --card-bg: rgba(36,40,60,0.12);
}

/* Hintergrund: ganz unten, keine Interaktion */
.background {
    position: fixed;
    inset: 0;
    z-index: -10;
    background: url('bilder/background.jpg') no-repeat center center fixed;
    background-size: cover;
    pointer-events: none;
    will-change: transform;
}

/* Grund-Schrift */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Mountains of Christmas', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #fffbe6;
    background: transparent;
}

/* Headline */
.headline-box {
    width: 90vw;
    max-width: 340px;
    margin: 2vh auto 1vh auto;
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

/* Countdown */
.xmas-countdown {
    margin: 0 auto 12px auto;
    text-align: center;
    font-size: 1.05rem;
    max-width: 460px;
    z-index: 20;
    position: relative;
    background: rgba(36,40,60,0.85);
    color: #fffbe6;
    padding: 7px 14px;
    border-radius: 10px;
}

/* Kalender-Grid */
.calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 14px;
    width: 95vw;
    max-width: 1200px;
    margin: 2vh auto 6vh auto;
    padding: 16px;
    box-sizing: border-box;
    background: var(--card-bg);
    border-radius: 18px;
    z-index: 20;
    position: relative;
    justify-items: center;
}

/* Tür (Geschenk) - HIGH z-index, clickable */
.door.gift-door {
    width: 98px;
    height: 98px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0;
    position: relative;
    z-index: 60 !important; /* wichtig: oben */
    pointer-events: auto !important; /* wichtig: anklickbar */
    transition: transform .14s ease, box-shadow .18s ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
}

    /* Bild im Türchen */
    .door.gift-door img {
        width: 92px;
        height: 92px;
        object-fit: contain;
        user-select: none;
        display: block;
        pointer-events: none;
    }

/* Nummer */
.door .door-number {
    position: absolute;
    bottom: 6px;
    right: 8px;
    color: #fffbe6;
    font-weight: bold;
    text-shadow: 0 2px 8px #000;
    pointer-events: none;
}

/* Hover / Fokus */
.door.gift-door:hover, .door.gift-door:focus {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 18px var(--accent1);
    outline: none;
}

/* Heutiges Türchen */
.door.gift-door.today {
    animation: wiggle 0.8s infinite;
    filter: brightness(1.02) drop-shadow(0 0 12px #fffbe6cc);
}

/* Tooltip */
.door-tooltip {
    position: fixed;
    z-index: 120;
    background: rgba(36,40,60,0.97);
    color: #fffbe6;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6);
    max-width: 320px;
    font-size: 1rem;
    line-height: 1.3;
    white-space: pre-line;
    display: none;
    pointer-events: none;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(36,40,60,0.45);
    backdrop-filter: blur(2px);
}

    .modal .modal-content {
        background: rgba(36,40,60,0.98);
        color: #fffbe6;
        padding: 26px;
        border-radius: 14px;
        min-width: 260px;
        max-width: 92vw;
        box-shadow: 0 10px 36px rgba(0,0,0,0.6);
    }

    .modal .close {
        position: absolute;
        right: 12px;
        top: 8px;
        background: none;
        border: none;
        color: #fffbe6;
        font-size: 1.6rem;
        cursor: pointer;
    }

/* Snow canvas should never block clicks */
#snow-canvas {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    will-change: transform;
}

/* Santa & Schneemann behind doors */
#santa-wrapper, #snowman-wrapper {
    position: fixed;
    pointer-events: none;
    z-index: 6;
}

/* Lights (slightly interactive) */
#xmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 8;
    pointer-events: none; /* default none to avoid blocking */
}

/* individual bulbs may re-enable pointer-events if desired (but below doors) */
.xmas-bulb {
    pointer-events: auto;
}

/* Footer */

#xmas-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    z-index: 15;
    pointer-events: none;
}

#xmas-footer img {
    width: 100vw;
    height: 64px;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

.footer-copyright {
    width: 100vw;
    text-align: center;
    position: absolute;
    left: 0;
    bottom: 8px;
    color: #5637f1;
    font-size: 0.98em;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 2px 8px #000a;
}

    #xmas-footer img {
        width: 100vw;
        height: 64px;
        object-fit: cover;
        pointer-events: none;
    }

/* accessibility focus outline */
.door:focus {
    outline: 3px dashed var(--accent1);
    outline-offset: 3px;
}

/* responsive adjustments */
@media (max-width:480px) {
    .door.gift-door {
        width: 84px;
        height: 84px;
    }

        .door.gift-door img {
            width: 74px;
            height: 74px;
        }
}

/* small animations */
@keyframes wiggle {
    0% {
        transform: rotate(-3deg) scale(1.03);
    }

    50% {
        transform: rotate(3deg) scale(1.06);
    }

    100% {
        transform: rotate(-3deg) scale(1.03);
    }
}

/* minimal helpers */
.loading {
    text-align: center;
    padding: 18px 6px;
    color: var(--accent1);
}

.win {
    text-align: center;
    font-size: 1.05rem;
    color: var(--accent2);
}

.error {
    color: #f88;
    text-align: center;
}
/* FESTE WEIHNACHTSBOX FÜR HEADLINE – klassische Version */
.headline-box.xmas-headline {
    background: linear-gradient(135deg, #232946 0%, #181c2f 60%, #3a2e6c 100%);
    border-radius: 22px 22px 30px 30px / 16px 16px 24px 24px;
    box-shadow: 0 4px 18px rgba(80, 60, 180, .13), 0 0 16px #fff6, 0 0 0 3px #fffbe6aa inset;
    padding: 12px 16px 10px;
    border: 1.5px solid #a18fff;
    backdrop-filter: blur(6px);
    min-width: 180px;
    min-height: 60px;
}
/* Headline kleiner */
.headline-box.xmas-headline h1.xmas-anim {
    font-size: 1.25rem;
    margin: 0 0 4px 0;
    letter-spacing: 0.01em;
}
.headline-box.xmas-headline h2.xmas-anim2 {
    font-size: 1rem;
    margin: 0;
    font-weight: normal;
}
@media (max-width: 600px) {
    .headline-box {
        max-width: 96vw;
        padding-left: 1vw;
        padding-right: 1vw;
    }
    .headline-box.xmas-headline {
        padding: 8px 2vw 8px;
        min-width: unset;
        min-height: 40px;
    }
    .headline-box.xmas-headline h1.xmas-anim {
        font-size: 1.05rem;
    }
    .headline-box.xmas-headline h2.xmas-anim2 {
        font-size: 0.92rem;
    }
}
.modal .modal-content {
    background: rgba(36, 40, 60, 0.98);
    border-radius: 18px;
    box-shadow: 0 4px 32px #0008, 0 0 0 4px #eebf63 inset;
    border: 2px solid #a18fff;
    padding: 32px 22px;
    color: #fffbe6;
    max-width: 360px;
}
