
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5e6e3;
    color: #812e3c;
    font-family: Georgia, serif;
    text-align: center;
    overflow-x: hidden;
}

.welcome {
    width: 90%;
    max-width: 380px;
    padding: 40px 25px;
    background: #fffaf5;
    border: 2px solid #b97c7c;
    border-radius: 20px;
    box-shadow: 0 10px 40px #812e3c20;
}

h1 {
    font-size: 38px;
    font-style: italic;
    margin-bottom: 15px;
}

p {
    font-size: 16px;
    line-height: 1.6;
}

input {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #b97c7c;
    border-radius: 10px;
    background: #ffffff;
    color: #812e3c;
    font-size: 16px;
    text-align: center;
    outline: none;
}

button {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: #812e3c;
    color: white;
    border: none;
    border-radius: 10px;
    font-family: Georgia, serif;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #a64b5c;
}

.decoration {
    font-size: 35px;
    margin-bottom: 15px;
}

.error {
    color: #b52e3e;
    font-size: 14px;
}

/* ADVENTSKALENDER */

.calendar-page {
    display: block;
    background: #e9d4d1;
    padding: 20px 10px;
}

.calendar {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.calendar-header h1 {
    font-size: 42px;
    font-style: italic;
    margin-bottom: 5px;
}

.calendar-header p {
    font-size: 14px;
    margin-bottom: 40px;
}

/* WEIHNACHTSHAUS */

.christmas-house {
    position: relative;
    width: 90%;
    margin: 0 auto;
}

.roof {
    width: 100%;
    height: 110px;
    background: #812e3c;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.house-body {
    position: relative;
    width: 90%;
    min-height: 550px;
    margin: 0 auto;
    background: #fff3df;
    border: 3px solid #812e3c;
    border-radius: 2px;
    box-shadow: 8px 8px 0 #812e3c15;
    padding: 20px;
}

/* GARTEN */

.garden {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 45px;
    padding: 20px 0;
}

/* FENSTER DES ADVENTSKALENDERS */

.house-body {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.window {
    position: relative;
    width: 100%;
    height: 75px;
    margin: 0;
    padding: 0;
    background: #d9b8ad;
    border: 5px solid #812e3c;
    border-radius: 25px 25px 3px 3px;
    color: #812e3c;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 4px 0 #b97c7c;
    transition: 0.3s;
}

.window:hover {
    background: #f5dfb0;
    transform: translateY(-2px);
}

.window:nth-child(3n) {
    height: 90px;
    border-radius: 3px;
}

.window:nth-child(5n) {
    height: 65px;
}

.window.front-door {
    height: 115px;
    background: #812e3c;
    color: #fff3df;
    border-radius: 30px 30px 0 0;
    border-color: #60202d;
}

/* NEUE FENSTERFORMEN */

.window {
    height: 75px;
    background: #d9b8ad;
    border-radius: 3px;
}

/* Runde Fenster */

.window:nth-child(3n) {
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

/* Ovale Fenster */

.window:nth-child(5n) {
    height: 90px;
    aspect-ratio: auto;
    border-radius: 50%;
}

/* Einheitliche Fensterfarbe */

.window:not(.front-door):hover {
    background: #d9b8ad;
}

/* Einzige Eingangstür */

.window.front-door {
    height: 115px;
    aspect-ratio: auto;
    border-radius: 30px 30px 0 0;
    background: #812e3c;
    color: #fff3df;
}

/* ANIMIERTER SCHNEEFALL */

.snow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 100;
}

.snowflake {
    position: absolute;
    top: -30px;
    color: white;
    opacity: 0.8;
    user-select: none;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(-30px) translateX(0) rotate(0deg);
    }

    100% {
        transform: translateY(110vh) translateX(40px) rotate(360deg);
    }
}

/* WEIHNACHTLICHE FENSTERDETAILS */

.window:not(.front-door) {
    background-image:
        linear-gradient(
            to right,
            transparent 47%,
            #812e3c 47%,
            #812e3c 53%,
            transparent 53%
        ),
        linear-gradient(
            to bottom,
            transparent 47%,
            #812e3c 47%,
            #812e3c 53%,
            transparent 53%
        );
    text-shadow:
        2px 2px #fff3df,
        -2px -2px #fff3df,
        -2px 2px #fff3df,
        2px -2px #fff3df;
}

.window:not(.front-door)::after {
    content: "";
    position: absolute;
    bottom: -7px;
    left: -7px;
    right: -7px;
    height: 6px;
    background: #fffaf5;
    border-radius: 8px;
    box-shadow: 0 2px 0 #b97c7c;
}


/* NEUE FENSTERANIMATION MIT SVG */

.window:not(.front-door) {
    background-image: none;
    overflow: visible;

    transition:
        background-color 1.8s ease-in-out,
        box-shadow 1.8s ease-in-out;
}

.window .window-bars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}

.window .window-number {
    position: relative;
    z-index: 2;
}

.window-bars line {
    stroke: #812e3c;
    stroke-width: 6;
    transition: transform 1.8s ease-in-out;
}

.bar-top {
    transform-origin: 50px 0px;
}

.bar-bottom {
    transform-origin: 50px 100px;
}

.bar-left {
    transform-origin: 0px 50px;
}

.bar-right {
    transform-origin: 100px 50px;
}

.window.opened .bar-top,
.window.opened .bar-bottom {
    transform: scaleY(0);
}

.window.opened .bar-left,
.window.opened .bar-right {
    transform: scaleX(0);
}

.window.opened:not(.front-door) {
    background-color: #ffe4a0;
    box-shadow:
        0 0 15px #ffd77a,
        inset 0 0 12px #fff3df;
}

.window.opened:not(.front-door):hover {
    background-color: #ffe4a0;
}

/* EINGANGSTÜR */

.window.front-door {
    background-color: #812e3c;
    border: 5px solid #60202d;
    transition:
        background-color 1.8s ease-in-out,
        box-shadow 1.8s ease-in-out;
}

/* Goldener Türknauf */

.window.front-door::after {
    content: "";
    position: absolute;
    right: 10%;
    top: 60%;
    width: 7px;
    height: 7px;
    background: #d4af37;
    border-radius: 50%;
}

/* Geöffnete Eingangstür */

.window.front-door.opened {
    background-color: #ffe4a0;
    color: #812e3c;
    box-shadow: 0 0 20px #ffd77a;
}

/* EINGANGSTÜR - ÖFFNUNGSANIMATION */

.window.front-door {
    overflow: hidden;
    background: #ffe4a0;
    color: #fff3df;
    isolation: isolate;
}

/* Bewegliches Türblatt */

.window.front-door::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #812e3c;
    border-radius: 0;
    z-index: -1;
    transform: translateX(0);
    transition: transform 1.8s ease-in-out;
}

/* Beweglicher Türknauf */

.window.front-door::after {
    transition: transform 1.8s ease-in-out,
                opacity 1.8s ease-in-out;
}

/* Tür gleitet nach links */

.window.front-door.opened::before {
    transform: translateX(-105%);
}

.window.front-door.opened::after {
    transform: translateX(-150px);
    opacity: 0;
}

.window.front-door.opened {
    background: #ffe4a0;
    color: #812e3c;
    box-shadow: 0 0 20px #ffd77a;
}

/* HINWEIS-POP-UP */

.hint-overlay {
    position: fixed;
    inset: 0;
    background: rgba(65, 25, 30, 0.45);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 20px;
}

.hint-overlay[hidden] {
    display: none;
}

.hint-box {
    width: 100%;
    max-width: 340px;
    background: #fffaf5;
    border: 2px solid #b97c7c;
    border-radius: 25px;
    padding: 30px 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: hintAppear 0.5s ease-out;
}

.hint-box h2 {
    color: #812e3c;
    font-size: 24px;
    font-weight: normal;
    line-height: 1.4;
}

#hintNo {
    background: transparent;
    border: 1px solid #b97c7c;
    color: #812e3c;
}

#hintNo:hover {
    background: #f5e6e3;
}

@keyframes hintAppear {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* DRAMATISCHER COUNTDOWN */

.countdown-overlay {
    position: fixed;
    inset: 0;
    background: #350008;
    color: #ff4545;
    z-index: 300;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    text-align: center;
}

.countdown-overlay[hidden] {
    display: none;
}

#countdownWarning {
    font-size: 40px;
    letter-spacing: 5px;
}

#countdownText {
    font-size: 20px;
}

#countdownNumber {
    font-size: 120px;
    font-weight: bold;
    text-shadow: 0 0 30px red;
    animation: countdownPulse 1s infinite;
}

#countdownMessage {
    color: #fff3df;
    font-size: 24px;
    max-width: 350px;
}

#continuePuzzle {
    max-width: 300px;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* FEUERWERK */

#fireworks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.firework-particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color);
    box-shadow: 0 0 10px var(--color);
    animation: fireworkExplosion 1.4s ease-out forwards;
}

@keyframes fireworkExplosion {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 1;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--x), var(--y)) scale(0.2);
        opacity: 0;
    }
}

/* HERZEN BEI RICHTIGER ANTWORT */

.success-heart {
    position: fixed;
    bottom: -60px;
    z-index: 400;
    pointer-events: none;
    animation: heartRise 3s ease-out forwards;
}

@keyframes heartRise {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(-120vh) scale(1.3);
        opacity: 0;
    }
}

/* LIEBESBRIEF */

.letter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(65, 25, 30, 0.4);
    backdrop-filter: blur(5px);
    z-index: 250;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.letter-overlay[hidden] {
    display: none;
}

.letter-envelope {
    position: relative;
    width: 85%;
    max-width: 340px;
    aspect-ratio: 1.5;
    background: #fff3df;
    border: 2px solid #b97c7c;
    border-radius: 6px;
    box-shadow: 0 15px 40px #00000033;
    overflow: hidden;
    cursor: pointer;
}

.envelope-flap {
    position: absolute;
    inset: 0;
    background: #ead2c1;
    clip-path: polygon(0 0, 100% 0, 50% 65%);
}

.envelope-seal {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: #812e3c;
    color: #fff3df;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 3px 6px #00000033;
}

#closeLetter {
    width: 160px;
}

/* ADMIN-BEREICH */

.admin-page {
    display: block;
    padding: 20px;
}

.admin-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
}

.admin-day {
    width: 100%;
    min-height: 100px;
    margin: 0;
    padding: 12px;
    border-radius: 12px;
}

.admin-day strong {
    display: block;
    font-size: 30px;
}

.admin-day small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
}

/* TÜRCHEN-EDITOR */

#dayEditor {
    width: 100%;
    max-width: 800px;
    margin: 35px auto;
    padding: 30px;
    background: #fffaf5;
    border: 2px solid #b97c7c;
    border-radius: 20px;
    box-shadow: 0 10px 30px #00000015;
    text-align: left;
}

#dayEditor h2 {
    text-align: center;
    font-size: 30px;
    margin-bottom: 30px;
}

#dayEditor label {
    display: block;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 8px;
}

#dayEditor textarea,
#dayEditor input,
#dayEditor select {
    width: 100%;
    padding: 15px;
    margin: 0;
    border: 1px solid #b97c7c;
    border-radius: 10px;
    background: white;
    color: #812e3c;
    font-family: Georgia, serif;
    font-size: 16px;
    text-align: left;
}

#dayEditor textarea {
    min-height: 120px;
    resize: vertical;
}

#dayEditor input[type="file"] {
    padding: 25px;
    border: 2px dashed #b97c7c;
    background: #f5e6e3;
}

#previewDay {
    background: transparent;
    border: 1px solid #812e3c;
    color: #812e3c;
}

@media (max-width: 600px) {
    #dayEditor {
        padding: 18px;
    }
}
.admin-days[hidden],
#dayEditor[hidden] {
    display: none;
}