/* Only on this page: let the stage own everything down to the player bar. */
body.live2k26-page #pageContent.page {
    margin-bottom: 0;
    overflow: hidden;
}

#live2k26 {
    /* JS overwrites --stage-h with an exact measured px value.
       86px = your real player-bar height, used only as a fallback. */
    --stage-h: calc(100vh - 86px);

    --stage-width: 75%;
    --chat-width: 25%;
    --crossfade: 1.2s;
    --overlay-opacity: 0.30;
    --accent: #ED6A2A;

    position: relative;
    z-index: 0;
    display: flex;
    width: 100%;
    height: var(--stage-h);      /* NOT 100% — parent has no height, it collapses */
    background: #000;
    color: #fff;
    overflow: hidden;
}

/* ---------- 3/4 stage ---------- */
#live2k26 .stage {
    position: relative;
    flex: 0 0 var(--stage-width);
    max-width: var(--stage-width);
    height: 100%;
    overflow: hidden;
    /* Base wash, so the layout is verifiable even before real media exists. */
    background: #05070c radial-gradient(120% 90% at 20% 15%, #16202e 0%, #05070c 70%);
}

#live2k26 .layer { position: absolute; inset: 0; }

/* Layer 1 — slideshow */
#live2k26 .layer-bg { z-index: 1; }
#live2k26 .layer-bg .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--crossfade) ease;
}
#live2k26 .layer-bg .slide.is-active { opacity: 1; }
#live2k26 .layer-bg .slide img,
#live2k26 .layer-bg .slide video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Layer 2 — overlay. Tiling texture => background-repeat, not an <img>.
   Drop asfalt-dark.png at themes/REKORD/assets/img/. If it's missing the
   layer just renders empty — harmless. */
#live2k26 .layer-overlay {
    z-index: 2;
    pointer-events: none;
    opacity: var(--overlay-opacity);
    background-image: url('/themes/REKORD/assets/img/asfalt-dark.png');
    background-repeat: repeat;
}

/* Layer 3 — content */
#live2k26 .layer-content {
    z-index: 3;
    pointer-events: none;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#live2k26 .row-top,
#live2k26 .row-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
#live2k26 .row-top    { align-items: flex-start; }
#live2k26 .row-bottom { align-items: flex-end; }

#live2k26 .clock {
    font-size: 2.6rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 14px rgba(0,0,0,.75);
}
#live2k26 .date {
    margin-top: 6px;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .7;
    text-shadow: 0 1px 6px rgba(0,0,0,.8);
}

#live2k26 .live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px 7px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    box-shadow: 0 0 6px rgba(237,106,42,.5);
}
#live2k26 .live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    animation: live2k26-pulse 1.6s infinite;
}
@keyframes live2k26-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(237,106,42,.7); }
    70%  { box-shadow: 0 0 0 9px rgba(237,106,42,0); }
    100% { box-shadow: 0 0 0 0   rgba(237,106,42,0); }
}

/* Now playing — these nodes belong to metadata.js */
#live2k26 .now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    max-width: 480px;
    padding: 10px 18px 10px 10px;
    border-radius: 14px;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
}
#live2k26 .display-currentart {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #1b1b1b;
}
/* Beats additional.css's `.currentartimg { height:50px; width:auto !important }`
   AND the inline style="width:100%;max-width:400px" metadata.js injects. */
#live2k26 .display-currentart .currentartimg {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    box-shadow: none;
}
#live2k26 .now-playing-text { min-width: 0; }
#live2k26 .np-label {
    margin-bottom: 2px;
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
}
#live2k26 .display-currentsong {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#live2k26 .display-currentalbum {
    font-size: .78rem;
    opacity: .6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ticker */
#live2k26 .ticker {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    padding: 7px 0;
    border-radius: 8px;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
}
#live2k26 .ticker-track {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    font-size: .78rem;
    opacity: .8;
    animation: live2k26-ticker 22s linear infinite;
}
@keyframes live2k26-ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

/* ---------- 1/4 chat rail ---------- */
#live2k26 .chat-panel {
    flex: 0 0 var(--chat-width);
    max-width: var(--chat-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0b0c10;
    border-left: 1px solid rgba(255,255,255,.08);
}
#live2k26 .chat-header {
    flex: 0 0 auto;
    padding: 14px 18px;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
#live2k26 .chat-embed { flex: 1 1 auto; min-height: 0; }
#live2k26 .chat-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 991px) {
    #live2k26 { flex-direction: column; height: auto; }
    #live2k26 .stage {
        flex: 0 0 auto;
        max-width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    #live2k26 .layer-content { padding: 16px; }
    #live2k26 .clock  { font-size: 1.6rem; }
    #live2k26 .ticker { display: none; }
    #live2k26 .chat-panel {
        flex: 0 0 auto;
        max-width: 100%;
        height: 60vh;
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    #live2k26 .live-dot,
    #live2k26 .ticker-track    { animation: none; }
    #live2k26 .layer-bg .slide { transition: none; }
}