/* ============ Scene Image Layer ============ */
/* AI-generated scene images in a contained video-frame area */

.scene-layer {
    position: absolute;
    top: 8%;
    left: 5%;
    right: 5%;
    bottom: 30%;
    z-index: 1;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.scene-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    background: #000;
}

.scene-img.active {
    opacity: 1;
}

/* Subtle Ken Burns zoom */
@keyframes ken-burns {
    0% {
        transform: scale(1.0);
    }

    100% {
        transform: scale(1.03);
    }
}

.scene-img.active {
    animation: ken-burns 12s ease-in-out alternate infinite;
}

.scene-img:nth-child(2) {
    animation-direction: alternate-reverse;
}

/* ---- Headline Overlay (rendered by browser, not Pillow) ---- */
.scene-headline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 28px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    font-size: clamp(18px, 2.8vw, 32px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    z-index: 2;
    opacity: 0;
    transform: translateY(12px);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    /* Prevent overly long text */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Fade-in animation triggered by JS */
@keyframes headlineFadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.scene-headline.fade-in {
    animation: headlineFadeIn 0.6s ease-out forwards;
}

/* ---- Z-index layering when scene is active ---- */
.scene-layer~.messages-container {
    position: relative;
    z-index: 2;
}

.scene-layer~.live-controls {
    position: relative;
    z-index: 3;
}

.scene-layer~.bullet-chat-container {
    z-index: 2;
}

.scene-layer~.live-controls .live-current-subtitle {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}