/* ==========================================================================
   KINETIC LYRICS & POPUP MODAL STYLES (TikTok & Apple Music Sing Style)
   ========================================================================== */

/* Fullscreen / Floating Lyrics Popup Modal */
.lyrics-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(4, 7, 12, 0.88);
    backdrop-filter: blur(45px) saturate(200%);
    -webkit-backdrop-filter: blur(45px) saturate(200%);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96) translateY(20px);
    transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}

.lyrics-popup-overlay.open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* Background Atmosphere Behind Kinetic Lyrics */
.lyrics-backdrop-art {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(70px) brightness(0.22) saturate(180%);
    opacity: 0.75;
    z-index: 0;
    pointer-events: none;
    transform: scale(calc(1 + var(--beat-bass, 0) * 0.05));
    transition: transform 0.15s ease-out, background-image 0.8s ease;
}

.lyrics-beat-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, calc(var(--beat-kick, 0) * 0.15)) 0%, transparent 70%);
    transition: background 0.08s linear;
}

/* Popup Header */
.lyrics-popup-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 15, 24, 0.4);
}

.popup-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.popup-track-art {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.popup-track-meta {
    min-width: 0;
}

.popup-track-meta strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.popup-track-meta span {
    display: block;
    font-size: 0.75rem;
    color: var(--dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.popup-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Kinetic vs Classic Mode Switcher */
.kinetic-mode-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 99px;
    padding: 3px;
    gap: 3px;
}

.mode-chip {
    background: none;
    border: none;
    color: var(--dim);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.mode-chip.active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.popup-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.popup-close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

.popup-close-btn:active {
    transform: scale(0.92);
}

/* ==========================================================================
   KINETIC TYPOGRAPHY STAGE (TikTok Viral Style)
   ========================================================================== */
.kinetic-stage {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    overflow: hidden;
}

.kinetic-stage.hidden {
    display: none !important;
}

/* Big Kinetic Active Phrase */
.kinetic-phrase-wrap {
    max-width: 820px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 18px;
    padding: 20px;
    perspective: 1000px;
}

/* Individual Kinetic Words */
.kinetic-word {
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.035em;
    color: rgba(255, 255, 255, 0.35);
    display: inline-block;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.2s var(--ease-spring), text-shadow 0.2s ease, filter 0.2s ease;
    filter: blur(0.5px);
}

.kinetic-word:hover {
    color: rgba(255, 255, 255, 0.85);
    transform: scale(1.05);
    filter: blur(0px);
}

/* Kinetic Word Active Hit State (TikTok Pop Effect) */
.kinetic-word.hit {
    color: #ffffff;
    filter: blur(0px);
    transform: translateY(-6px) scale(1.16);
    text-shadow: 0 0 24px var(--c1), 0 0 45px var(--c2), 0 4px 12px rgba(0, 0, 0, 0.7);
    background: linear-gradient(135deg, #ffffff 40%, var(--c1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: kineticPop 0.38s var(--ease-spring);
}

@keyframes kineticPop {
    0% {
        transform: scale(0.85) translateY(12px);
        opacity: 0.4;
    }
    60% {
        transform: scale(1.22) translateY(-8px);
        opacity: 1;
    }
    100% {
        transform: scale(1.16) translateY(-6px);
        opacity: 1;
    }
}

/* Incoming Next Phrase Anticipation */
.kinetic-next-phrase {
    margin-top: 36px;
    font-size: clamp(1rem, 2.4vw, 1.45rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: -0.015em;
    max-width: 600px;
    line-height: 1.35;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Syllable Karaoke Scroll Stage */
.karaoke-scroll-stage {
    position: relative;
    z-index: 5;
    flex: 1;
    overflow-y: auto;
    padding: 40px 24px 80px;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

.karaoke-scroll-stage.hidden {
    display: none !important;
}

.karaoke-scroll-stage .lyric-line {
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    font-weight: 800;
    padding: 18px 12px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.22);
    cursor: pointer;
    border-radius: 18px;
    transition: color 0.25s ease, transform 0.25s var(--ease-out), filter 0.25s ease;
    filter: blur(0.8px);
}

.karaoke-scroll-stage .lyric-line:hover {
    color: rgba(255, 255, 255, 0.65);
    filter: blur(0px);
}

.karaoke-scroll-stage .lyric-line.active {
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.06);
    filter: blur(0px);
}

.karaoke-scroll-stage .syl {
    display: inline-block;
    transition: color 0.12s ease, text-shadow 0.12s ease, transform 0.15s var(--ease-spring);
}

.karaoke-scroll-stage .syl.lit {
    color: #ffffff;
    transform: scale(1.08);
    text-shadow: 0 0 20px var(--c1), 0 0 35px var(--c2);
}

/* Floating Mini Lyric Pill in Player */
.floating-lyric-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--txt-sec);
    transition: all 0.2s var(--ease-out);
    margin: 4px auto;
    max-width: 320px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.floating-lyric-bar:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}