* {
    box-sizing: border-box;
}

/* Besondere Türchen ohne Anzeige-Nummer (data-door 5 & 6) */
button[data-door="5"] .door-number,
button[data-door="5"] .door-inside-number,
button[data-door="6"] .door-number,
button[data-door="6"] .door-inside-number {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #ffffff;
    background: #111827;
}

a {
    color: inherit;
}

.top-back-navigation {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 8px 16px 0;
    text-align: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.55);
    font-weight: 800;
    cursor: pointer;
}

.calendar-page {
    min-height: calc(100vh - 70px);
    padding: 4px 20px 10px;
    background-image:
        linear-gradient(rgba(0,0,0,0.16), rgba(0,0,0,0.30)),
        url('/kalender/backgrounds/desktop_bg.png');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
}

.welcome-box {
    width: min(980px, 100%);
    margin: 0 auto 14px;
    padding: 6px 12px 2px;
    background: transparent;
    box-shadow: none;
    border: 0;
    text-align: center;
}

.welcome-box h1 {
    margin: 0 0 8px;
    font-size: clamp(2.4rem, 4.4vw, 4.1rem);
    line-height: 1;
    color: #ffd43b;
    background: linear-gradient(180deg, #fff4a8 0%, #ffd43b 42%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter:
        drop-shadow(0 3px 0 rgba(122, 60, 0, 0.95))
        drop-shadow(0 7px 12px rgba(0, 0, 0, 0.65))
        drop-shadow(0 0 14px rgba(255, 212, 59, 0.75));
}

.welcome-box p {
    margin: 0;
    color: #ffe680;
    font-size: clamp(0.95rem, 1.45vw, 1.18rem);
    font-weight: 850;
    text-shadow:
        0 2px 0 rgba(82, 43, 0, 0.9),
        0 5px 12px rgba(0, 0, 0, 0.62),
        0 0 12px rgba(255, 212, 59, 0.5);
}

.calendar-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 34px 38px;
    align-items: start;
    justify-items: center;
    width: min(1400px, 100%);
    margin: 10px auto 0;
    padding: 10px 24px 8px;
    min-height: auto;
}

.door {
    width: 112px;
    height: 140px;
    position: relative;
    overflow: visible;
    perspective: 1200px;
    transform-style: preserve-3d;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    cursor: pointer;
}

.door:disabled {
    cursor: not-allowed;
}

.door-inside,
.door-front {
    position: absolute;
    inset: 0;
    border-radius: 18px;
}

.door-inside {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 18px 18px 42px;
    overflow: hidden;
    color: #fff7d1;
    background:
        radial-gradient(circle at 50% 32%, rgba(255, 212, 59, 0.42), transparent 48%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.95));
    border: 3px solid rgba(255, 212, 59, 0.92);
    box-shadow:
        inset 0 0 28px rgba(255, 212, 59, 0.22),
        0 12px 0 rgba(0, 0, 0, 0.35);
}

.door-inside-number {
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    color: #ffffff;
    background: radial-gradient(circle at 35% 25%, #fff3a3, #ffd43b 42%, #f59e0b 100%);
    font-size: 1.1rem;
    font-weight: 950;
    line-height: 1;
    text-shadow:
        0 2px 0 rgba(120, 61, 0, 0.95),
        0 4px 8px rgba(0, 0, 0, 0.45);
    box-shadow:
        0 4px 0 rgba(120, 61, 0, 0.75),
        0 0 12px rgba(255, 212, 59, 0.58);
    pointer-events: none;
}

.door-inside-icon {
    font-size: 2.35rem;
    line-height: 1;
    margin: 0 0 8px 20px;
    max-width: 76px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}

.door-inside-label {
    width: auto;
    max-width: 92px;
    margin-left: 10px;
    font-size: 0.88rem;
    line-height: 1.08;
    font-weight: 900;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
    transform: translateX(-6px);
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55);
}

.door-front {
    z-index: 3;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 24%, rgba(255,255,255,0.22), transparent 44%),
        linear-gradient(145deg, #2563eb, #7c3aed);
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 12px 0 rgba(0,0,0,0.35);
    transform-origin: left center;
    transform: rotateY(0deg);
    transition:
        transform 1.35s cubic-bezier(.18,.82,.22,1),
        filter 0.45s ease,
        box-shadow 0.45s ease;
    backface-visibility: hidden;
}

.door:hover:not(:disabled) .door-front {
    filter: brightness(1.08);
}

.door-opening .door-front,
.door-opened .door-front {
    transform: rotateY(-78deg);
    filter: brightness(0.92) saturate(0.95);
    opacity: 1;
    box-shadow:
        14px 14px 24px rgba(0, 0, 0, 0.48),
        0 0 16px rgba(255, 212, 59, 0.22);
}

.door-opened .door-inside,
.door-opening .door-inside {
    z-index: 1;
    filter: brightness(1.12);
}

.door-locked .door-front {
    filter: grayscale(0.85) brightness(0.68);
}

.door-loading {
    pointer-events: none;
}

.door-number {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    transform: translateX(-50%);
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    color: #ffffff;
    background:
        radial-gradient(circle at 35% 25%, #fff3a3, #ffd43b 42%, #f59e0b 100%);
    font-size: 1.65rem;
    font-weight: 950;
    line-height: 1;
    text-shadow:
        0 2px 0 rgba(120, 61, 0, 0.95),
        0 4px 8px rgba(0, 0, 0, 0.45);
    box-shadow:
        0 5px 0 rgba(120, 61, 0, 0.85),
        0 0 16px rgba(255, 212, 59, 0.65);
}

.door-brawler-image-wrap {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 82%;
    height: 78%;
    padding-top: 34px;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.door-brawler-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter:
        drop-shadow(0 7px 0 rgba(0, 0, 0, 0.28))
        drop-shadow(0 10px 14px rgba(0, 0, 0, 0.42));
}

.door-status {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 5;
    font-size: 1.25rem;
}

.calendar-logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 8px auto 6px;
    padding: 0;
    background: transparent;
    pointer-events: none;
}

.calendar-logo {
    display: block;
    width: min(255px, 32vw);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    background: transparent;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.62));
}

.bottom-home-navigation {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 4px 16px 18px;
    background: transparent;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 230px;
    padding: 14px 24px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    font-size: 1.05rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
}

body.modal-is-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.74);
    z-index: 9999;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    width: min(860px, 96vw);
    max-height: 90vh;
    overflow: auto;
    position: relative;
    padding: 30px;
    border: 3px solid rgba(255, 212, 59, 0.95);
    border-radius: 28px;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.42), transparent 42%),
        #10172a;
    color: #ffffff;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.65),
        0 0 34px rgba(255, 212, 59, 0.28);
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #111827;
    background: #ffd43b;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(120, 61, 0, 0.85);
    z-index: 2;
}

.modal-content {
    clear: both;
}

.modal-loading,
.modal-result {
    padding: 30px 14px;
    text-align: center;
}

.modal-result h2,
.modal-loading {
    color: #ffd43b;
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 900;
    text-shadow:
        0 3px 0 rgba(122, 60, 0, 0.9),
        0 8px 16px rgba(0, 0, 0, 0.55);
}

.modal-result p {
    margin: 10px auto;
    max-width: 680px;
    color: #fff7d1;
    font-size: 1.1rem;
    line-height: 1.55;
    font-weight: 700;
}

.modal-info-box {
    width: min(520px, 100%);
    margin: 18px auto;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.10);
    text-align: left;
    line-height: 1.7;
}

.login-page,
.simple-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top, #2451ff, #111827 60%);
}

.login-card,
.text-card,
.phase-card {
    width: min(720px, 100%);
    padding: 28px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1200px) {
    .calendar-board {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
        gap: 28px 28px;
    }
}

@media (max-width: 768px) {
    .calendar-page {
        padding: 4px 14px 10px;
        background-image:
            linear-gradient(rgba(0,0,0,0.16), rgba(0,0,0,0.30)),
            url('/kalender/backgrounds/mobile_bg.png');
        background-attachment: scroll;
    }

    .welcome-box h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .welcome-box p {
        font-size: 0.95rem;
    }

    .calendar-board {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 22px 18px;
        padding: 8px 12px 4px;
    }

    .door {
        width: 100%;
        max-width: 130px;
        min-height: 118px;
        height: auto;
        aspect-ratio: 0.82;
    }

    .door-opening .door-front,
    .door-opened .door-front {
        transform: rotateY(-72deg);
    }

    .door-number {
        width: 40px;
        height: 40px;
        top: 7px;
        font-size: 1.35rem;
    }

    .door-inside {
        padding: 14px 14px 14px 34px;
    }

    .door-inside-number {
        top: 7px;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .door-inside-icon {
        font-size: 2rem;
        margin-left: 16px;
        margin-bottom: 6px;
    }

    .door-inside-label {
        max-width: 78px;
        margin-left: 8px;
        font-size: 0.76rem;
        line-height: 1.08;
        transform: translateX(-5px);
    }

    .calendar-logo {
        width: min(210px, 56vw);
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-box {
        width: 96vw;
        max-height: 92vh;
        padding: 20px;
        border-radius: 22px;
    }
}
