*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Wrapper, damit der Kalender auf Desktop mittig ist */
.page-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Adventskalender-Auflösung 9:16 */
.calendar-wrapper {
    position: relative;
    width: 100vw;
    max-width: 1080px;
    aspect-ratio: 9 / 16;
    background: url("bg.jpg") center center / cover no-repeat;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

.calendar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to bottom,
            rgba(0,0,0,0.6),
            rgba(0,0,0,0.75)
    );
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}

.calendar-title {
    margin: 0 0 12px;
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Grid der 24 Tage */
.days-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    gap: 10px;
    flex: 1;
}

/* Buttons */
.day-button {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    background: rgba(84,100,48,0.1);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s ease;
}

.day-button.available:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.day-button.locked {
    opacity: 0.35;
    cursor: default;
    border-style: dashed;
    transform: none !important;
}

.day-button.today {
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 10px rgba(255,255,255,0.6);
}

.hint-text {
    margin-top: 10px;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.85;
}

/* ---------------------------------------------------
   RANDLOSES FULLSCREEN OVERLAY (ohne jeden Abstand)
   --------------------------------------------------- */

.media-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;      /* volle Breite */
    height: 100vh;     /* volle Höhe */
    background: #000;  /* komplett schwarz */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.media-overlay.hidden {
    display: none;
}

/* Innencontainer füllt exakt das Overlay */
.media-overlay-inner {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Schließen-Button */
.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 10000;
}

/* Der Inhalts-iframe soll IMMER alles nutzen */
.media-frame {
    width: 100vw;
    height: 100vh;
    border: none;
}

/* --------------------------------------
   Inhalt in viewer.php (img/video):
   soll FULLSCREEN SCALE bekommen
   -------------------------------------- */

/* Für Images */
img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;  /* oder: cover */
    /* cover = immer randlos, aber evtl. Beschnitt
       contain = ganze Datei sichtbar, schwarze Ränder */
}

/* Für Videos */
video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;     /* Fullscreen Video */
    background: #000;
}

/* Responsive Kleinkram */
@media (max-width: 480px) {
    .calendar-overlay {
        padding: 18px 12px;
    }
    .calendar-title {
        font-size: 1.4rem;
    }
    .day-button {
        font-size: 1.1rem;
        border-radius: 10px;
    }
}