/* ===================================================
   Adventskalender – Frontend CSS
   =================================================== */

#ac-wrapper {
    font-family: 'Segoe UI', sans-serif;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 30px 20px 50px;
    border-radius: 12px;
    position: relative;
}

/* ---- Kalender-Gitter ---- */
#ac-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px;
    max-width: 960px;
    margin: 0 auto 40px;
}

/* ---- Einzelnes Türchen ---- */
.ac-door {
    position: relative;
    height: 130px;
    perspective: 1000px;
    cursor: pointer;
    outline: none;
}

.ac-door-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(.4, .2, .2, 1);
}

.ac-door.open .ac-door-inner {
    transform: rotateY(-180deg);
}

.ac-door .front,
.ac-door .back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ac-door .front {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: background 0.2s;
}

.ac-door:not(.locked):hover .front {
    background: rgba(255, 255, 255, 0.38);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.ac-door .back {
    background: linear-gradient(135deg, #c0392b, #922b21);
    transform: rotateY(180deg);
    font-size: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.day-number {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---- Gesperrte Türchen ---- */
.ac-door.locked {
    cursor: not-allowed;
}

.ac-door.locked .front {
    background: rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.15);
}

.ac-door.locked .day-number {
    color: rgba(255, 255, 255, 0.5);
}

.ac-lock-overlay {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 16px;
    opacity: 0.7;
}

/* ---- Leere Türchen (keine Gewinne) ---- */
.ac-door.empty .front {
    border-style: dashed;
    opacity: 0.7;
}

/* ---- Focus-Stil für Tastaturnavigation ---- */
.ac-door:focus-visible .front {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* ================================================
   Modal
   ================================================ */
#ac-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ac-modal.hidden {
    display: none;
}

.ac-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ac-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 18px;
    padding: 36px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: acPopIn 0.35s cubic-bezier(.2, .9, .3, 1.2) both;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes acPopIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

.ac-modal-box h2 {
    margin: 0 0 20px;
    font-size: 1.6rem;
    color: #2c3e50;
}

.ac-prize-item {
    background: #fdf3f3;
    border-left: 4px solid #c0392b;
    padding: 10px 14px;
    margin: 8px 0;
    border-radius: 6px;
    text-align: left;
    animation: acFadeUp 0.3s ease both;
}

@keyframes acFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ac-prize-item .prize-name { font-weight: 600; color: #2c3e50; }
.ac-prize-item .prize-num  { font-size: 0.8rem; color: #7f8c8d; margin-top: 2px; }

.ac-modal-close {
    margin-top: 22px;
    padding: 10px 28px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ac-modal-close:hover {
    background: #a93226;
}

/* ================================================
   Nummernprüfung
   ================================================ */
#ac-checker {
    max-width: 420px;
    margin: 30px auto 0;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    padding: 24px 28px;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

#ac-checker h3 {
    margin: 0 0 14px;
    font-size: 1.1rem;
}

#ac-win-number {
    padding: 10px 14px;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    width: 180px;
    margin-right: 8px;
    text-align: center;
    letter-spacing: 2px;
}

#ac-checker button {
    padding: 10px 20px;
    font-size: 1rem;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#ac-checker button:hover {
    background: #a93226;
}

#ac-check-result {
    margin-top: 14px;
    font-size: 1rem;
    font-weight: 600;
    min-height: 28px;
}

#ac-check-result.success { color: #2ecc71; }
#ac-check-result.error   { color: #e74c3c; }

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 600px) {
    #ac-calendar {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 12px;
    }

    .ac-door {
        height: 90px;
    }

    .day-number {
        font-size: 26px;
    }

    .ac-modal-box {
        padding: 24px 20px;
    }
}
