:root {
    /* --- FARBVARIABLEN --- */
    --color-bg-dark: #1f3627;
    --color-bg-light: #2c5437;
    --color-red: #c40000;
    --color-gold: #ffd700;
    --color-white: #f8f8f8;
    --color-door-text: var(--color-white);
    --color-modal-bg: #fff;
    --color-form-button: #008000;
    --color-wood-frame: #b8860b;
    /* Angepasst: Fensterscheiben etwas undurchsichtiger, da der Hintergrund heller ist */
    --color-window-glass: rgba(255, 255, 255, 0.2); 
    --color-window-glass-back: transparent;
}

/* --- Grundlegendes Box-Modell für alle Elemente --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------- */
/* --- GRUNDLAGEN & HINTERGRUND --- */
/* ---------------------------------------------------- */

body {
    font-family: 'Open Sans', sans-serif;
    /* ENTFERNT: Grüner Farbverlauf */
    background: transparent; 
    text-align: center;
    padding: 0;
    color: var(--color-white);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Hintergrundbild (statisch) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* GEÄNDERT: Ihr Bild, fixiert und volle Deckkraft */
    background: url('weihnachten back.jpg') no-repeat center center fixed; 
    background-size: cover;
    opacity: 1.0; 
    z-index: -2;
}

/* Schneefall-Animation (statisch) - Beibehalten */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="1.5" fill="white" opacity="0.8" /></svg>') repeat;
    background-size: 15px 15px;
    opacity: 0.7;
    animation: snowfall 20s linear infinite;
}
@keyframes snowfall {
    from { background-position: 0 0; }
    to { background-position: 100% 100%; }
}

h1, h2 {
    font-family: 'Mountains of Christmas', cursive;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8); /* Textschatten für bessere Lesbarkeit auf hellem Hintergrund */
    margin-top: 30px;
    color: var(--color-gold);
}
h1 { font-size: 3.8em; color: var(--color-white); }
h2 { font-size: 2em; color: var(--color-red); }

/* --- ADVENTKRANZ / DEKORATION --- */

.adventkranz {
    color: var(--color-red);
    margin: 0 10px;
    font-size: 0.8em;
    vertical-align: middle;
    position: relative;
    top: -5px;
    display: inline-block;
}

/* Korrigierte Unicode-Zeichen */
.adventkranz::before {
    content: '\2728'; /* Stern */
    display: inline-block;
    transform: rotate(0deg);
    position: absolute;
    left: -15px;
    top: 0;
    font-size: 1.2em;
    color: var(--color-gold);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8); /* Schatten angepasst */
}
.adventkranz::after {
    content: '\1F381'; /* Geschenk */
    display: inline-block;
    transform: rotate(-15deg);
    position: absolute;
    right: -5px;
    top: 2px;
}

/* ---------------------------------------------------- */
/* --- KALENDER GRID & TÜRELEMENTE --- */
/* ---------------------------------------------------- */

.kalender-container {
    display: grid;
    /* Basis: 4 Spalten auf großem Bildschirm */
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; 
    max-width: 1400px; 
    margin: 50px auto;
    padding: 30px;
    /* Hintergrund leicht angepasst, falls das Bild zu hell ist */
    background: rgba(0, 0, 0, 0.5); 
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    position: relative;
    backdrop-filter: blur(8px);
    border: 2px solid var(--color-gold);
}

.tuerchen {
    position: relative;
    width: 100%; 
    height: 0; 
    padding-bottom: 75%; 
    
    margin: 0;
    border: 10px solid var(--color-wood-frame);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.4s ease;
    perspective: 1000px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    overflow: hidden;
    /* GEÄNDERT: Hintergrund der Türchen ist nun transparent, um den Haupt-Hintergrund durchscheinen zu lassen */
    background: transparent; 
}
.tuerchen:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}
.tuerchen-hintergrund-text {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Hinzugefügt: Schwarzer Overlay, um den Text hinter der Tür besser lesbar zu machen */
    background: rgba(0, 0, 0, 0.2); 
    color: var(--color-white); /* Textfarbe auf weiß, da es nun vor einem dunkleren Overlay ist */
    font-size: 1.2em;
    padding: 10px;
    box-sizing: border-box;
    z-index: 5;
    text-align: center;
}

/* --- TÜREN FLÜGEL --- */

.fluegel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    /* GEÄNDERT: Fensterscheiben-Farbe aus der Variablen */
    background-color: var(--color-window-glass); 
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
}
.fluegel.links {
    left: 0;
    border-right: 5px solid var(--color-wood-frame);
    transform-origin: left;
}
.fluegel.rechts {
    right: 0;
    border-left: 5px solid var(--color-wood-frame);
    transform-origin: right;
}
.fluegel-rahmen {
    position: absolute;
    width: 100%; 
    height: 100%;
    border: 5px solid var(--color-wood-frame);
    box-sizing: border-box; 
    pointer-events: none;
}
.tuerchen.is-open .fluegel.links {
    transform: rotateY(-110deg);
}
.tuerchen.is-open .fluegel.rechts {
    transform: rotateY(110deg);
}
.fluegel-text {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5em;
    color: var(--color-door-text);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.tuerchen.is-open .fluegel-text {
    opacity: 0;
    transition: opacity 0.3s;
}

/* --- ZUSTÄNDE --- */

.tuerchen.gesperrt { cursor: not-allowed; filter: grayscale(80%) brightness(0.8); pointer-events: none; }
.tuerchen.gesperrt::after { content: '\1F512'; position: absolute; font-size: 1.5em; top: 5px; right: 5px; text-shadow: none; color: #999; z-index: 11; } /* Schloss */
.tuerchen.abgelaufen { cursor: default; filter: grayscale(70%) brightness(1.0); }
.tuerchen.abgelaufen::after { content: '\2705'; position: absolute; font-size: 1.5em; top: 5px; right: 5px; text-shadow: none; color: #28a745; z-index: 11; } /* Haken */
.tuerchen.abgelaufen:hover { transform: none; box-shadow: 0 5px 15px rgba(0,0,0,0.4); }

.tuerchen.tuerchen-24.offen {
    background: linear-gradient(135deg, var(--color-red), #9c0000);
    color: var(--color-white);
    border-color: var(--color-gold);
    box-shadow: 0 0 40px var(--color-gold), 0 0 20px var(--color-red);
}
.tuerchen.tuerchen-24.offen:hover {
    transform: scale(1.08);
    background: linear-gradient(135deg, #e00000, #c40000);
}

/* ---------------------------------------------------- */
/* --- MODAL, BUTTONS & MESSAGES --- */
/* ---------------------------------------------------- */

.flash-message {
    padding: 15px 20px; margin: 20px auto; max-width: 800px; border-radius: 10px;
    font-size: 1.1em; font-weight: 600; text-align: left; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    color: #333; transition: opacity 1s ease-out;
}
.flash-message.success { background-color: #e6ffe6; border: 2px solid #00c400; color: #008000; }
.flash-message.error { background-color: #ffe6e6; border: 2px solid #c40000; color: #c40000; }

.home-button-container { margin-top: 40px; text-align: center; }
.home-button {
    display: inline-block; padding: 15px 30px; background-color: var(--color-form-button);
    color: var(--color-white); text-decoration: none; border-radius: 10px; font-size: 1.2em;
    font-weight: bold; font-family: 'Open Sans', sans-serif; border: 2px solid var(--color-gold);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}
.home-button:hover { background-color: #006400; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }

.modal {
    display: none; position: fixed; z-index: 2147483647; left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.7); animation: fadeIn 0.5s forwards; backdrop-filter: blur(10px);
}
.modal-content {
    background-color: var(--color-modal-bg); margin: 10% auto; padding: 40px; border: 4px solid var(--color-gold);
    width: 90%; max-width: 600px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center; animation: slideIn 0.6s ease-out; position: relative; color: #333;
}
.modal-girlande {
    position: absolute; top: -20px; left: 0; width: 100%; height: 40px;
    display: flex; justify-content: space-around; pointer-events: none;
}
.weihnachtsbaum { position: relative; width: 30px; height: 30px; display: flex; justify-content: center; align-items: center; transform: translateY(20px); }
.weihnachtsbaum::before { content: ''; position: absolute; width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 30px solid var(--color-bg-dark); top: 0; }
.weihnachtsbaum::after { content: ''; position: absolute; width: 8px; height: 8px; background-color: var(--color-gold); border-radius: 50%; top: -5px; box-shadow: 0 0 10px var(--color-gold); }

.modal-content h2 { font-family: 'Dancing Script', cursive; font-size: 3em; color: var(--color-red); margin-bottom: 20px; text-shadow: 1px 1px 2px rgba(0,0,0,0.1); }
#modalAngebot { font-family: 'Open Sans', sans-serif; font-size: 1.6em; color: var(--color-form-button); font-weight: 600; margin-bottom: 30px; line-height: 1.4; }

.close { color: var(--color-red); float: right; font-size: 40px; font-weight: bold; position: absolute; top: 10px; right: 20px; cursor: pointer; transition: color 0.3s; }
.close:hover, .close:focus { color: #a00000; text-decoration: none; }

.modal-form-input { width: calc(100% - 20px); padding: 14px; margin-bottom: 15px; box-sizing: border-box; border: 2px solid var(--color-bg-dark); border-radius: 10px; font-size: 1.1em; font-family: 'Open Sans', sans-serif; }
.modal-content button[type="submit"] {
    background-color: var(--color-form-button); color: var(--color-white); padding: 16px 30px; border: none;
    border-radius: 10px; cursor: pointer; font-size: 1.2em; font-family: 'Open Sans', sans-serif; font-weight: bold;
    letter-spacing: 0.5px; transition: background-color 0.3s, transform 0.2s;
}
.modal-content button[type="submit"]:hover { background-color: #006400; transform: scale(1.05); }

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(-100px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

.hinweis-klein {
    display: block;
    margin-top: 15px;
    font-size: 1.0em;
    font-weight: 400;
    color: #666;
    line-height: 1.3;
}

/* ---------------------------------------------------- */
/* --- RESPONSIVE ANPASSUNGEN --- */
/* ---------------------------------------------------- */

@media (max-width: 1200px) {
    /* Umschalten von 4 auf 3 Spalten */
    .kalender-container { 
        grid-template-columns: repeat(3, 1fr); 
        max-width: 900px;
        gap: 25px; 
    }
}

@media (max-width: 768px) {
    /* Umschalten von 3 auf 2 Spalten (Tablets) */
    .kalender-container { 
        grid-template-columns: repeat(2, 1fr); 
        max-width: 550px;
        gap: 20px; 
        padding: 15px;
        margin: 20px auto; 
    }
    
    /* Allgemeine Größenanpassung */
    h1 { font-size: 3em; } 
    h2 { font-size: 1.8em; } 
    .fluegel-text { font-size: 2.2em; } 
}

@media (max-width: 500px) {
    /* Mobile Anpassungen */
    .kalender-container { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
        padding: 10px; 
        max-width: 95vw; 
    }
    
    /* Allgemeine Größenanpassung */
    h1 { font-size: 2.2em; } 
    h2 { font-size: 1.4em; } 
    .fluegel-text { font-size: 1.8em; }
    
    /* Modal-Anpassungen */
    .modal-content { margin: 5% auto; padding: 25px; } 
    .modal-content h2 { font-size: 2em; } 
    #modalAngebot { font-size: 1.2em; }
    .modal-form-input { padding: 10px; font-size: 0.9em; } 
    .modal-content button[type="submit"] { padding: 12px 20px; font-size: 1em; }
    .home-button { padding: 10px 20px; font-size: 1em; }
}