* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    width: 100%;
    background: #000;
    color: #eee;
    font-family: system-ui, sans-serif;
    overflow: hidden;
}

/* Full-viewport media container */
#media {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* Images: contain inside the viewport, keep aspect ratio */
#media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Videos: fill the viewport */
#media .video-wrap {
    position: absolute;
    inset: 0;
}

#media .video-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Caption overlay at the bottom */
#caption {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    pointer-events: none;
    z-index: 10;
}

#caption:empty { display: none; }

/* Tiny status indicator in the corner — fades after each update */
#status {
    position: fixed;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#status.visible { opacity: 1; }

/* Hide the cursor after a moment of inactivity for a cleaner display */
body.idle { cursor: none; }