 :root {
    --tvfp-accent: #ffff66;
    --tvfp-progress: #ffff66;
    --tvfp-player-bg: rgba(18,18,18,.98);
    --tvfp-art-animation-duration: 10s;
    --tvfp-art-animation-state: running;
 }

/* ====CSS=====================================
   TRIBE-VIBEZ PLAYER — CONSOLIDATED STYLES
   ========================================= */


/* -----------------------------------------
   //Section 1: Playlist Controls — "List" Button
   ----------------------------------------- */

#plyr-playlist .plyr__control[data-plyr="list"] {
    background: var(--tvfp-accent);
    color: #111;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,255,102,.22);
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

#plyr-playlist .plyr__control[data-plyr="list"]:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

#plyr-playlist .plyr__control[data-plyr="list"] svg {
    fill: #111;
    color: #111;
}


/* -----------------------------------------
   //Section 2: Fullscreen Trigger Button
   ----------------------------------------- */

#plyr-playlist .tv-fs-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    margin-left: 8px;
    border: 0;
    background: var(--tvfp-accent);
    color: #111;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,255,102,.22);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: transform .18s ease, filter .18s ease;
}

#plyr-playlist .tv-fs-trigger:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

#plyr-playlist .tv-fs-trigger::before {
    content: "▲";
    font-size: 14px;
    line-height: 1;
    color: #111;
    display: block;
}

#plyr-playlist .tv-fs-trigger span,
#plyr-playlist .tv-fs-trigger .label,
#plyr-playlist .tv-fs-trigger svg {
    display: none;
}

#plyr-playlist .tv-main-list-header {
    position: relative;
    padding-right: 60px;
}

#plyr-playlist .tv-main-list-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: 2px solid var(--tvfp-accent);
    border-radius: 50%;
    background: rgba(255,255,102,.10);
    color: var(--tvfp-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px 1px rgba(255,255,102,.72), 0 0 20px 5px rgba(255,220,40,.38);
    cursor: pointer;
    z-index: 4;
    transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}

#plyr-playlist .tv-main-list-close:hover {
    transform: scale(1.05);
    background: rgba(255,255,102,.18);
    box-shadow: 0 0 10px 2px rgba(255,255,102,.90), 0 0 26px 8px rgba(255,220,40,.48);
}

#plyr-playlist .tv-main-list-close:active {
    transform: scale(.94);
}

#plyr-playlist .tv-main-list-close span {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-1px);
}


/* -----------------------------------------
   //Section 3: Playlist Panel (Up Next / List Wrap)
   ----------------------------------------- */

#plyr-playlist .plyr-list-wrap {
    transition: opacity .22s ease, transform .22s ease, max-height .22s ease;
    transform-origin: bottom center;
    backdrop-filter: blur(10px) saturate(1.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,102,.35) rgba(255,255,255,.06);
}

#plyr-playlist .plyr-list-wrap.active,
#plyr-playlist .plyr-list-wrap.open,
#plyr-playlist .plyr-list-wrap.show {
    animation: tvListRise .22s ease;
}

#plyr-playlist .plyr-list-wrap,
#plyr-playlist .plyr-playlist-list,
#plyr-playlist ul.plyr-list {
    background: var(--tvfp-player-bg);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 28px rgba(0,0,0,.30);
    border-top: 1px solid rgba(255,255,255,.05);
}

#plyr-playlist .plyr-list-wrap::-webkit-scrollbar { width: 8px; }
#plyr-playlist .plyr-list-wrap::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 999px; }
#plyr-playlist .plyr-list-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,102,.35); border-radius: 999px; }


/* Panel list items */
#plyr-playlist .plyr-list-wrap li,
#plyr-playlist .plyr-list-wrap .plyr-list-item,
#plyr-playlist .plyr-list-wrap .playlist-item,
#plyr-playlist .plyr-list-wrap a {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background-color .18s ease, color .18s ease, transform .15s ease;
}

#plyr-playlist .plyr-list-wrap li:hover,
#plyr-playlist .plyr-list-wrap .plyr-list-item:hover,
#plyr-playlist .plyr-list-wrap .playlist-item:hover,
#plyr-playlist .plyr-list-wrap a:hover {
    background: rgba(255,255,102,.06);
    transform: translateX(4px);
}

#plyr-playlist .plyr-list-wrap li.active,
#plyr-playlist .plyr-list-wrap li.current,
#plyr-playlist .plyr-list-wrap .plyr-list-item.active,
#plyr-playlist .plyr-list-wrap .playlist-item.active,
#plyr-playlist .plyr-list-wrap .current {
    background: rgba(255,255,102,.12);
    box-shadow: inset 3px 0 0 var(--tvfp-accent), 0 0 12px rgba(255,255,102,.08);
}


/* Panel text */
#plyr-playlist .plyr-list-wrap .title,
#plyr-playlist .plyr-list-wrap .track-title,
#plyr-playlist .plyr-list-wrap strong {
    color: #fff;
    font-weight: 600;
}

#plyr-playlist .plyr-list-wrap small,
#plyr-playlist .plyr-list-wrap .artist,
#plyr-playlist .plyr-list-wrap .meta {
    color: rgba(255,255,255,.66);
}


/* -----------------------------------------
   //Section 4: Player Position & Ticker Bar
   ----------------------------------------- */

#plyr-playlist {
    bottom: 0;
    background: var(--tvfp-player-bg);
}

#plyr-playlist .plyr__controls {
    background: var(--tvfp-player-bg);
    padding-bottom: 26px;
}

#plyr-playlist .plyr__progress input[type="range"] {
    color: var(--tvfp-progress) !important;
    --plyr-range-fill-background: var(--tvfp-progress) !important;
    accent-color: var(--tvfp-progress);
}

/* Ticker — content doubled so translateX(-50%) loops seamlessly */
#plyr-playlist::after {
    content: "144 THE REBEL \2022  ONLY ON TRIBE-VIBEZ \2022  \2022  144 THE REBEL \2022  ONLY ON TRIBE-VIBEZ \2022  \2022";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 18px;
    background: #111;
    color: var(--tvfp-accent);
    font-size: 11px;
    letter-spacing: 2px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    animation: tvScroll 12s linear infinite;
}


/* -----------------------------------------
   //Section 5: Fullscreen Overlay — Base & Background
   ----------------------------------------- */

#tv-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    /* FIX: Use visibility+opacity instead of display:none/block.
       This allows CSS transitions on open/close and avoids the
       layout flash that caused the list to jump on entry. */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    background: #000;
    /* Smooth fade-in/out on the whole overlay */
    transition: opacity .28s ease, visibility 0s linear .28s;
}

#tv-fullscreen-overlay.tv-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    /* Delay visibility:hidden until after opacity fades out */
    transition: opacity .28s ease, visibility 0s linear 0s;
}

/* Blurred background — album art, heavily processed */
#tv-fullscreen-overlay .tv-fs-bg {
    position: absolute;
    inset: 0;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(60px) saturate(1.6) brightness(.55);
    transform: scale(1.22);
    opacity: 1;
    animation: tvBgDrift 18s ease-in-out infinite alternate;
    will-change: transform;
}

/* Main gradient overlay — deep black at bottom, warm gold at top */
#tv-fullscreen-overlay .tv-fs-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(180,140,20,.18)  0%,
        rgba(90,70,10,.28)   18%,
        rgba(20,16,4,.55)    36%,
        rgba(0,0,0,.82)      58%,
        rgba(0,0,0,.97)      78%,
        #000                100%
    );
}

/* Gold dust / grain canvas layer — pure CSS noise texture animated */
#tv-fullscreen-overlay .tv-fs-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    /* SVG feTurbulence noise baked as a data-URI — gives the gold
       dust / speckle texture without a JS canvas */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    /* Gold tint over the noise */
    mix-blend-mode: soft-light;
    opacity: .22;
    animation: tvDustShift 8s ease-in-out infinite alternate;
    pointer-events: none;
    will-change: transform;
}


/* -----------------------------------------
   //Section 5b: Gold Pulsating Square — sits behind the album art
   Same rounded-corner shape as the art itself, animates like
   a heartbeat to give the impression it pulses with the music.
   Positioned absolutely inside .tv-fs-inner (which is relative).
   ----------------------------------------- */

#tv-fullscreen-overlay .tv-fs-gold-halo {
    position: absolute;
    /* Horizontally centred, vertically aligned to match art position.
       top value accounts for: top-bar (~60px) + art-wrap margin (10px) */
    left: 50%;
    top: 60px;
    transform: translateX(-50%);

    /* Slightly larger than the art so it peeks out as a glow border */
    width: min(72vw, 300px);
    aspect-ratio: 1 / 1;

    /* Rounded to match .tv-fs-art border-radius */
    border-radius: 24px;

    /* Gold gradient fill — rich centre, darker edges */
    background: linear-gradient(
        135deg,
        rgba(255, 210, 30, .55)  0%,
        rgba(200, 150, 10, .40) 40%,
        rgba(120,  80,  0, .25) 70%,
        rgba( 60,  40,  0, .15) 100%
    );

    /* Soft diffused shadow so it bleeds onto the background */
    box-shadow:
        0  0 40px 12px rgba(220, 170,  10, .38),
        0  0 80px 24px rgba(180, 120,   0, .22),
        0 16px 60px 8px rgba(0, 0, 0, .50);

    /* Pulse animation — breathes in and out like a heartbeat */
    animation: tvSquarePulse 3s ease-in-out infinite;
    will-change: transform, opacity;

    /* Behind art-wrap (z-index 3) but above bg (z-index 1) */
    z-index: 2;
    pointer-events: none;
}

/* No ::after conic spinner on the square — keep it clean */

@keyframes tvSquarePulse {
    0%   { transform: translateX(-50%) scale(1.00); opacity: .80; }
    30%  { transform: translateX(-50%) scale(1.04); opacity: .95; }
    55%  { transform: translateX(-50%) scale(1.02); opacity: .88; }
    80%  { transform: translateX(-50%) scale(1.05); opacity: 1.0; }
    100% { transform: translateX(-50%) scale(1.00); opacity: .80; }
}


/* -----------------------------------------
   //Section 6: Fullscreen Overlay — Inner Layout & Top Bar
   ----------------------------------------- */

/* Inner layout — full-height flex column, positioning context for halo */
#tv-fullscreen-overlay .tv-fs-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    padding: 16px 18px 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: #fff;
    overflow: hidden;
}

/* Top bar */
#tv-fullscreen-overlay .tv-fs-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    /* FIX: flex-shrink:0 prevents the top bar from being
       compressed when the list grows, which caused a jump. */
    flex-shrink: 0;
}

#tv-fullscreen-overlay .tv-fs-label {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.78);
}

#tv-fullscreen-overlay .tv-fs-close {
    width: 42px;
    height: 42px;
    /* Round to match the other glow buttons */
    border: 2px solid var(--tvfp-accent);
    border-radius: 50%;
    background: rgba(255,255,102,.10);
    color: var(--tvfp-accent);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px 1px rgba(255,255,102,.70), 0 0 18px 4px rgba(255,220,40,.35);
    transition: box-shadow .18s ease, background-color .18s ease, transform .12s ease;
}

#tv-fullscreen-overlay .tv-fs-close:hover {
    background: rgba(255,255,102,.18);
    box-shadow: 0 0 10px 2px rgba(255,255,102,.90), 0 0 26px 8px rgba(255,220,40,.50);
}
#tv-fullscreen-overlay .tv-fs-close:active { transform: scale(.93); }


/* -----------------------------------------
   //Section 7: Fullscreen Overlay — Album Art
   ----------------------------------------- */

/* Album art */
#tv-fullscreen-overlay .tv-fs-art-wrap {
    display: flex;
    justify-content: center;
    margin: 10px 0 14px;
    flex-shrink: 0;
    /* Sit above the gold halo (z-index 1) */
    position: relative;
    z-index: 3;
}

#tv-fullscreen-overlay .tv-fs-art {
    width: min(72vw, 300px);
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    background: #1b1b1b;
    /* Deeper shadow + subtle gold tint underneath */
    box-shadow:
        0 24px 60px rgba(0,0,0,.60),
        0  8px 24px rgba(180,140,10,.18);
    animation: tvArtFloat var(--tvfp-art-animation-duration) ease-in-out infinite alternate;
    animation-play-state: var(--tvfp-art-animation-state);
    will-change: transform;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

#tv-fullscreen-overlay .tv-fs-art-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #1b1b1b;
    z-index: 0;
}

#tv-fullscreen-overlay .tv-fs-art-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    object-fit: cover;
    object-position: center;
    background: transparent;
    z-index: 1;
}

.tvfp-card-motion-shell {
    position: relative;
    overflow: hidden;
}

.tvfp-card-motion-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 2;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
}

.tvfp-card-motion-video.tvfp-is-playing {
    opacity: 1;
}

.tvfp-card-motion-soft-fail {
    opacity: 0 !important;
}

/* Shimmer sweep — rotating arc of yellow light around the border */
#tv-fullscreen-overlay .tv-fs-art::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255,255,102,.70) 40deg,
        transparent 90deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    padding: 2px;
    animation: tvShimmerSweep 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Faint static border so the frame is always visible between sweeps */
#tv-fullscreen-overlay .tv-fs-art::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,102,.10);
    pointer-events: none;
    z-index: 1;
}


/* -----------------------------------------
   //Section 8: Fullscreen Overlay — Track Meta & Progress
   ----------------------------------------- */

/* Track meta */
#tv-fullscreen-overlay .tv-fs-meta {
    margin-top: 6px;
    margin-bottom: 8px;
    /* FIX: Prevent meta block from collapsing under flex pressure */
    flex-shrink: 0;
}

#tv-fullscreen-overlay .tv-fs-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 4px;
}

#tv-fullscreen-overlay .tv-fs-artist {
    font-size: 14px;
    color: rgba(255,255,255,.75);
}

/* Progress bar */
#tv-fullscreen-overlay .tv-fs-progress {
    margin-top: 10px;
    flex-shrink: 0;
}

#tv-fullscreen-overlay .tv-fs-times {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255,255,255,.70);
}

/* Force the Plyr range track fill to yellow. */
#tv-fullscreen-overlay .plyr__progress input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    color: var(--tvfp-progress) !important;
    --plyr-range-fill-background: var(--tvfp-progress) !important;
    height: 14px;
    padding: 0;
    border: 0;
    /* Remove any opaque background Plyr sets on the input itself */
    background: transparent !important;
    box-shadow: none !important;
}

/* Webkit: runnable track — yellow fill up to thumb, transparent after */
#tv-fullscreen-overlay .plyr__progress input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(
        to right,
        var(--tvfp-progress) 0%,
        var(--tvfp-progress) var(--value, 30%),
        rgba(255,255,255,.15) var(--value, 30%),
        rgba(255,255,255,.15) 100%
    ) !important;
    border-radius: 999px !important;
}

/* Container — transparent so nothing grey shows behind the track */
#tv-fullscreen-overlay .plyr__progress,
#tv-fullscreen-overlay .plyr__progress__container {
    background: transparent !important;
    --plyr-range-fill-background: var(--tvfp-progress);
}

/* Buffer progress element — make it transparent so it doesn't overlay the track */
#tv-fullscreen-overlay .plyr__progress__buffer {
    color: transparent !important;
    background: transparent !important;
    opacity: 0 !important;
}

/* Hide the native progress element Plyr injects as a buffer indicator */
#tv-fullscreen-overlay progress.plyr__progress__buffer {
    display: none !important;
}

/* Thumb */
#tv-fullscreen-overlay .plyr__progress input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--tvfp-progress) !important;
    border: 0 !important;
    width: 14px !important;
    height: 14px !important;
    margin-top: -4px !important;
    border-radius: 50% !important;
    box-shadow: 0 0 6px rgba(255,255,102,.60) !important;
}

#tv-fullscreen-overlay .plyr__progress input[type="range"]::-moz-range-thumb {
    background: var(--tvfp-progress) !important;
    border: 0 !important;
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
}

/* Moz filled portion */
#tv-fullscreen-overlay .plyr__progress input[type="range"]::-moz-range-progress {
    background: var(--tvfp-progress) !important;
    height: 6px !important;
    border-radius: 999px !important;
}

/* Moz unfilled portion — subtle instead of grey */
#tv-fullscreen-overlay .plyr__progress input[type="range"]::-moz-range-track {
    height: 6px !important;
    background: rgba(255,255,255,.15) !important;
    border-radius: 999px !important;
}


/* -----------------------------------------
   //Section 9: Fullscreen Overlay — Transport & Extra Controls
   ----------------------------------------- */

/* Main transport controls row */
#tv-fullscreen-overlay .tv-fs-main {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

#tv-fullscreen-overlay .tv-fs-main-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

/* Extra controls row — hidden */
#tv-fullscreen-overlay .tv-fs-extra {
    display: none;
}

/* All cloned plyr controls — transparent base, white icons */
#tv-fullscreen-overlay .plyr__control,
#tv-fullscreen-overlay button:not(.tv-fs-close):not(.tv-fs-toggle-btn):not(.tv-fs-play-btn) {
    background: transparent !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Prev / Next — explicit size so they don't rely on Plyr's scale */
#tv-fullscreen-overlay .tv-fs-main-row .plyr__control[data-plyr="prev"],
#tv-fullscreen-overlay .tv-fs-main-row .plyr__control[data-plyr="previous"],
#tv-fullscreen-overlay .tv-fs-main-row .plyr__control[data-plyr="rewind"],
#tv-fullscreen-overlay .tv-fs-main-row .plyr__control[data-plyr="next"],
#tv-fullscreen-overlay .tv-fs-main-row .plyr__control[data-plyr="fast-forward"] {
    width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
}

#tv-fullscreen-overlay .tv-fs-main-row .plyr__control svg {
    width: 22px !important;
    height: 22px !important;
}

/* -----------------------------------------
   //Section 9b: Toggle Buttons (Shuffle & Repeat)
   Displayed inline after the Next button.
   Active state = solid yellow border + glow.
   ----------------------------------------- */

#tv-fullscreen-overlay .tv-fs-toggle-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    /* Default border is transparent so the active border swap
       doesn't cause a layout shift (same total width either way) */
    border: 2px solid transparent;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.65);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Include border in transition so the yellow ring fades in smoothly */
    transition:
        color            .18s ease,
        background-color .18s ease,
        border-color     .18s ease,
        box-shadow       .18s ease,
        transform        .14s ease;
}

#tv-fullscreen-overlay .tv-fs-toggle-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
    transform: scale(1.06);
}

/* Active state — yellow border ring */
#tv-fullscreen-overlay .tv-fs-toggle-btn.tv-active {
    color: var(--tvfp-accent) !important;
    background: rgba(255,255,102,.10) !important;
    border-color: var(--tvfp-accent) !important;
    box-shadow: 0 0 10px 2px rgba(255,230,40,.35) !important;
}

#tv-fullscreen-overlay .tv-fs-toggle-btn.tv-active:hover {
    background: rgba(255,255,102,.18) !important;
    box-shadow: 0 0 16px 4px rgba(255,220,40,.50) !important;
    transform: scale(1.06);
}

/* Pressed */
#tv-fullscreen-overlay .tv-fs-toggle-btn:active {
    transform: scale(.90);
}

/* -----------------------------------------
   //Section 9c: Play / Pause Button
   Matches the toggle button glow-circle style — always on.
   ----------------------------------------- */

#tv-fullscreen-overlay .tv-fs-play-btn {
    width: 56px;
    height: 56px;
    min-width: 56px;
    padding: 0;
    border: 2px solid var(--tvfp-accent);
    border-radius: 50%;
    background: rgba(255,255,102,.10);
    color: var(--tvfp-accent);
    font-size: 0;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px 1px rgba(255,255,102,.80), 0 0 20px 6px rgba(255,220,40,.40);
    transition: box-shadow .18s ease, background-color .18s ease, transform .12s ease;
}

#tv-fullscreen-overlay .tv-fs-play-btn:hover {
    background: rgba(255,255,102,.18);
    box-shadow: 0 0 10px 2px rgba(255,255,102,.90), 0 0 28px 8px rgba(255,220,40,.55);
    transform: scale(1.06);
}

#tv-fullscreen-overlay .tv-fs-play-btn:active {
    transform: scale(.92);
}


/* -----------------------------------------
   //Section 10: Fullscreen Overlay — Scrollable "Up Next" Queue
   -----------------------------------------
   KEY FIXES:
   • flex:1 1 auto + min-height:0 → lets the list fill remaining
     space without pushing the controls off-screen.
   • will-change:transform + contain:strict → GPU-promotes the
     scroll container so it composites independently; eliminates
     the stutter caused by layout reflows from the parent.
   • overscroll-behavior:contain → stops scroll from bubbling to
     body (no more page bounce while scrolling the list).
   • The "Next up" heading is now inside the container so it
     scrolls with the list, avoiding header overlap/jump.
   ----------------------------------------- */

#tv-fullscreen-overlay .tv-fs-list-wrap {
    margin-top: 16px;

    /* FIX: flex:1 makes the list take ALL remaining vertical space.
       min-height:0 is required (flex children default to auto which
       ignores overflow and prevents scrolling). */
    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    /* FIX: Momentum / inertia scrolling on iOS Safari */
    -webkit-overflow-scrolling: touch;

    /* FIX: CSS scroll-behavior:smooth makes programmatic
       scrollIntoView() animate instead of jump */
    scroll-behavior: smooth;

    /* FIX: Contain scroll within this element — prevents
       the outer page from scrolling when user reaches the top
       or bottom of the list (eliminates the "lurch" on iOS) */
    overscroll-behavior: contain;

    /* FIX: GPU-composite the scroll layer independently.
       Without this, every scroll frame triggers a full repaint
       of the overlay, causing visible stutter. */
    will-change: transform;

    /* FIX: contain:layout paint prevents the list's internal
       layout changes (active item highlight, etc.) from
       bubbling up and causing the parent overlay to relayout */
    contain: layout paint;

    background: rgba(8,8,8,.40);
    border-top: 1px solid rgba(255,255,255,.06);
    /* Minimal padding — no large bottom gap after the last track */
    padding: 0 0 20px;
    box-sizing: border-box;

    border-radius: 12px 12px 0 0;

    /* Firefox thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--tvfp-accent) rgba(255,255,255,.08);
}

/* Chrome / Safari scrollbar */
#tv-fullscreen-overlay .tv-fs-list-wrap::-webkit-scrollbar {
    width: 5px;
}

#tv-fullscreen-overlay .tv-fs-list-wrap::-webkit-scrollbar-track {
    background: rgba(255,255,255,.06);
    border-radius: 999px;
}

#tv-fullscreen-overlay .tv-fs-list-wrap::-webkit-scrollbar-thumb {
    background: var(--tvfp-accent);
    border-radius: 999px;
    box-shadow: 0 0 6px rgba(255,255,102,.45);
}

#tv-fullscreen-overlay .tv-fs-list-wrap::-webkit-scrollbar-thumb:hover {
    background: #ffffaa;
}

/* NOTE: No ::before pseudo-element here.
   The cloned Plyr list already contains its own "Next up" header.
   Adding one via CSS caused the duplicate row seen in the screenshot. */

/* Cloned real list — reset chrome applied by base player styles */
#tv-fullscreen-overlay .tv-fs-list-wrap .plyr-list-wrap,
#tv-fullscreen-overlay .tv-fs-list-wrap .plyr-playlist-list,
#tv-fullscreen-overlay .tv-fs-list-wrap ul.plyr-list {
    display: block;
    position: relative;
    inset: auto;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0;
    /* Just enough bottom pad so the last item clears the safe-area edge */
    padding: 0 0 12px;
}

/* Queue list items — full row is tappable */
#tv-fullscreen-overlay .tv-fs-list-wrap li,
#tv-fullscreen-overlay .tv-fs-list-wrap .plyr-list-item,
#tv-fullscreen-overlay .tv-fs-list-wrap .playlist-item {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    color: #fff;
    background: transparent;
    /* Pointer cursor signals the whole row is clickable */
    cursor: pointer;
    /* Only transition background — no transform on hover because
       translateX on a touch target fights the scroll gesture and
       causes the bounce/snap-back the user reported */
    transition: background-color .16s ease;
    will-change: auto;
    /* Make sure nothing inside the row captures the touch event
       before it reaches the row listener */
    user-select: none;
    -webkit-user-select: none;
}

/* Suppress pointer-events on inner anchors so clicks bubble up to the row */

/* Like/heart button — re-enable pointer events so it's independently tappable */
#tv-fullscreen-overlay .tv-fs-list-wrap .btn-like,
#tv-fullscreen-overlay .tv-fs-list-wrap [data-action="like"],
#tv-fullscreen-overlay .tv-fs-list-wrap button[class*="like"] {
    pointer-events: auto;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 6px;
    flex-shrink: 0;
    transition: transform .14s ease;
}

#tv-fullscreen-overlay .tv-fs-list-wrap .btn-like:active,
#tv-fullscreen-overlay .tv-fs-list-wrap [data-action="like"]:active {
    transform: scale(1.3);
}

/* Heart SVG — default white/dim */
#tv-fullscreen-overlay .tv-fs-list-wrap .btn-like svg,
#tv-fullscreen-overlay .tv-fs-list-wrap [data-action="like"] svg {
    fill: rgba(255,255,255,.45);
    transition: fill .18s ease;
}

/* Liked state — heart turns yellow */
#tv-fullscreen-overlay .tv-fs-list-wrap .btn-like.liked svg,
#tv-fullscreen-overlay .tv-fs-list-wrap .btn-like.active svg,
#tv-fullscreen-overlay .tv-fs-list-wrap [data-action="like"].liked svg,
#tv-fullscreen-overlay .tv-fs-list-wrap [data-action="like"].active svg,
#tv-fullscreen-overlay .tv-fs-list-wrap .tv-liked svg {
    fill: var(--tvfp-accent) !important;
}

#tv-fullscreen-overlay .tv-fs-list-wrap li:hover,
#tv-fullscreen-overlay .tv-fs-list-wrap .plyr-list-item:hover,
#tv-fullscreen-overlay .tv-fs-list-wrap .playlist-item:hover {
    background: rgba(255,255,255,.06);
}

/* Pressed / touch-active feedback — instant dark flash */
#tv-fullscreen-overlay .tv-fs-list-wrap li:active,
#tv-fullscreen-overlay .tv-fs-list-wrap .plyr-list-item:active,
#tv-fullscreen-overlay .tv-fs-list-wrap .playlist-item:active {
    background: rgba(255,255,102,.08);
}

#tv-fullscreen-overlay .tv-fs-list-wrap li.active,
#tv-fullscreen-overlay .tv-fs-list-wrap li.current,
#tv-fullscreen-overlay .tv-fs-list-wrap .plyr-list-item.active,
#tv-fullscreen-overlay .tv-fs-list-wrap .playlist-item.active,
#tv-fullscreen-overlay .tv-fs-list-wrap .current {
    background: rgba(255,255,102,.08);
    box-shadow: inset 3px 0 0 var(--tvfp-accent);
}

#tv-fullscreen-overlay .tv-fs-list-wrap .title,
#tv-fullscreen-overlay .tv-fs-list-wrap .track-title,
#tv-fullscreen-overlay .tv-fs-list-wrap strong {
    color: #fff;
    font-weight: 600;
}

#tv-fullscreen-overlay .tv-fs-list-wrap small,
#tv-fullscreen-overlay .tv-fs-list-wrap .artist,
#tv-fullscreen-overlay .tv-fs-list-wrap .meta {
    color: rgba(255,255,255,.68);
}


/* -----------------------------------------
   //Section 11: Responsive & Safe Area
   ----------------------------------------- */

@media (max-width: 640px) {
    body { padding-bottom: 120px; }

    #tv-fullscreen-overlay .tv-fs-inner {
        max-width: 100%;
        padding: 14px 16px 20px;
    }

    #tv-fullscreen-overlay .tv-fs-art { width: min(74vw, 285px); }
    #tv-fullscreen-overlay .tv-fs-title { font-size: 20px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(110px + env(safe-area-inset-bottom));
    }

    #plyr-playlist {
        bottom: env(safe-area-inset-bottom);
    }

    #tv-fullscreen-overlay .tv-fs-inner {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    #tv-fullscreen-overlay .tv-fs-list-wrap {
        /* Enough clearance for the iPhone home indicator — no more */
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}


/* -----------------------------------------
   //Section 12: Keyframe Animations
   ----------------------------------------- */

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

@keyframes tvScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes tvArtFloat {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(-6px) scale(1.012); }
}

@keyframes tvBgDrift {
    from { transform: scale(1.22) translateY(0); }
    to   { transform: scale(1.28) translateY(-12px); }
}

@keyframes tvShimmerSweep {
    0%   { transform: rotate(0deg);   opacity: .8; }
    45%  { transform: rotate(180deg); opacity: 1;  }
    50%  { transform: rotate(180deg); opacity: 0;  }
    55%  { transform: rotate(180deg); opacity: 0;  }
    100% { transform: rotate(360deg); opacity: .8; }
}

/* Gold dust grain layer drifts slowly so the speckles feel alive */
@keyframes tvDustShift {
    0%   { transform: translate(0,     0)    scale(1);    opacity: .22; }
    33%  { transform: translate(-6px,  4px)  scale(1.04); opacity: .28; }
    66%  { transform: translate( 4px, -6px)  scale(.97);  opacity: .18; }
    100% { transform: translate(-2px,  8px)  scale(1.02); opacity: .24; }
}

/* FIX: Fade-in animation for list items when the overlay first opens.
   Applied via JS (.tv-list-animate) so it only runs once per open,
   not on every scroll-triggered sync. */
@keyframes tvItemFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li,
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate .plyr-list-item,
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate .playlist-item {
    animation: tvItemFadeIn .26s ease both;
}

/* Stagger each item so they cascade in rather than all appearing at once */
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(1)  { animation-delay: .04s; }
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(2)  { animation-delay: .08s; }
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(3)  { animation-delay: .12s; }
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(4)  { animation-delay: .16s; }
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(5)  { animation-delay: .20s; }
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(6)  { animation-delay: .22s; }
#tv-fullscreen-overlay.tv-open .tv-fs-list-wrap.tv-list-animate li:nth-child(n+7) { animation-delay: .24s; }

