* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #165B33 0%, #0D3B22 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Schneefall-Animation */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1.5em;
    opacity: 0.8;
    animation: fall linear infinite;
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 8s; animation-delay: 4s; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 11s; animation-delay: 1s; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 9s; animation-delay: 3s; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 13s; animation-delay: 5s; }
.snowflake:nth-child(7) { left: 75%; animation-duration: 10s; animation-delay: 2s; }
.snowflake:nth-child(8) { left: 85%; animation-duration: 11s; animation-delay: 6s; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.title {
    text-align: center;
    color: white;
    font-size: 3em;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px #FFD700;
    }
    to {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px #FFD700, 0 0 30px #FFD700;
    }
}

.calendar-grid {
    position: relative;
    width: 100%;
    min-height: 800px;
    padding: 20px;
}

.door {
    position: absolute;
    width: 180px;
    height: 180px;
    perspective: 1000px;
    cursor: grab;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.door:active {
    cursor: grabbing;
    z-index: 1000;
}

.door-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.door.opened .door-inner {
    transform: rotateY(180deg);
    animation: doorBounce 0.6s ease-out;
}

@keyframes doorBounce {
    0% {
        transform: scale(1) rotateY(0deg);
    }
    25% {
        transform: scale(1.15) rotateY(45deg);
    }
    50% {
        transform: scale(1.1) rotateY(135deg);
    }
    75% {
        transform: scale(1.05) rotateY(180deg);
    }
    100% {
        transform: scale(1) rotateY(180deg);
    }
}

/* Glow-Effekt für neu geöffnete Türchen */
.door.just-opened {
    animation: doorGlow 1.5s ease-out;
}

@keyframes doorGlow {
    0%, 100% {
        filter: drop-shadow(0 0 0px transparent);
    }
    50% {
        filter: drop-shadow(0 0 25px #FFD700) drop-shadow(0 0 35px #FFD700);
    }
}

/* Partikel-Animation */
.particle {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 1;
}

.particle.star {
    width: 15px;
    height: 15px;
    font-size: 15px;
}

@keyframes particleExplosion {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(720deg);
        opacity: 0;
    }
}

.door-front, .door-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.door-front {
    background: linear-gradient(135deg, #C41E3A 0%, #8B0000 100%);
    color: white;
    border: 3px solid #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.door-front::before {
    content: '';
    position: absolute;
    top: 10px;
    font-size: 0.4em;
}

.door.locked .door-front::before {
    content: '🔒';
}

.door.opened .door-front::before,
.door.opened:hover .door-front::before {
    display: none;
}

.door-back {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    transform: rotateY(180deg);
    border: 3px solid white;
    font-size: 3em;
    flex-direction: column;
    gap: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8),
                 -1px -1px 2px rgba(0, 0, 0, 0.8),
                 1px -1px 2px rgba(0, 0, 0, 0.8),
                 -1px 1px 2px rgba(0, 0, 0, 0.8),
                 1px 1px 2px rgba(0, 0, 0, 0.8);
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0px;
}

.door-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    border-radius: 12px;
    z-index: -1;
}

.door-back::after {
    display: none;
}

.door:not(.opened):hover .door-front {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.door.locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.door.locked .door-front {
    background: linear-gradient(135deg, #666 0%, #444 100%);
}

.door.locked:hover .door-front {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #12912d 0%, #0a4404 100%);
    margin: 10% auto;
    padding: 30px;
    border: 3px solid #C41E3A;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #C41E3A;
    float: right;
    font-size: 35px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #8B0000;
}

#modal-title {
    color: #000000;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
}

.image-container {
    display: none;
    text-align: center;
    margin: 20px 0;
}

#door-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.audio-player {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#audio-element {
    width: 100%;
    max-width: 400px;
    outline: none;
}

#audio-element::-webkit-media-controls-panel {
    background-color: #C41E3A;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2em;
    }

    .calendar-grid {
        min-height: 1200px;
        padding: 10px;
    }

    .door {
        width: 120px;
        height: 120px;
    }

    .door-front, .door-back {
        font-size: 1.8em;
    }
}
