/* Lyrics panel — desktop only */
@media (max-width: 768px) {
    #lyrics-panel, #lyrics-toggle-btn { display: none !important; }
}

/* Toggle button */
#lyrics-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

#lyrics-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
}

#lyrics-toggle-btn.active {
    color: rgba(203, 166, 247, 0.95);
}

#lyrics-toggle-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.star-glitcher-theme #lyrics-toggle-btn.active {
    color: rgba(var(--sg-primary-rgb), 0.9);
}

.token-theme #lyrics-toggle-btn {
    color: rgba(255, 45, 149, 0.6);
    font-family: 'VT323', monospace;
}

.token-theme #lyrics-toggle-btn:hover {
    color: var(--token-neon-pink);
    background: rgba(255, 45, 149, 0.08);
    box-shadow: 0 0 10px rgba(255, 45, 149, 0.3);
}

.token-theme #lyrics-toggle-btn.active {
    color: var(--token-neon-pink);
    box-shadow: 0 0 12px rgba(255, 45, 149, 0.4);
}

/* ── Panel (default / star glitcher) ─────────────────────────────────────── */

#lyrics-panel {
    position: fixed;
    bottom: calc(max(15px, 2vh) + 76px + 12px);
    left: 25px;
    width: 340px;
    max-height: 280px;
    overflow: hidden;
    border-radius: 16px;
    z-index: 19;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    background: linear-gradient(
        145deg,
        rgba(22, 22, 28, 0.94) 0%,
        rgba(12, 12, 16, 0.9) 100%
    );
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(203, 166, 247, 0.15);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

#lyrics-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.star-glitcher-theme #lyrics-panel {
    border-color: rgba(var(--sg-primary-rgb), 0.15);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(var(--sg-primary-rgb), 0.04),
        inset 0 1px 0 rgba(var(--sg-primary-rgb), 0.08);
}

/* Fade masks */
#lyrics-panel::before,
#lyrics-panel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 56px;
    pointer-events: none;
    z-index: 2;
}

#lyrics-panel::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(18, 18, 23, 0.96), transparent);
}

#lyrics-panel::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(12, 12, 16, 0.96), transparent);
}

/* Scrollable inner */
#lyrics-scroll {
    height: 280px;
    overflow-y: auto;
    padding: 48px 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

#lyrics-scroll::-webkit-scrollbar { display: none; }

/* Lines */
.lyrics-line {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: 0.1px;
    color: rgba(255, 255, 255, 0.22);
    padding: 5px 0;
    transition: color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), font-size 0.35s ease;
    cursor: default;
    transform-origin: left center;
    will-change: transform, color;
    white-space: pre-wrap;
}

.lyrics-line.prev {
    color: rgba(255, 255, 255, 0.35);
    font-size: 14.5px;
}

.lyrics-line.active {
    color: rgba(255, 255, 255, 0.97);
    font-size: 16px;
    transform: scale(1.03);
}

.star-glitcher-theme .lyrics-line.active {
    color: rgba(var(--sg-primary-rgb), 1);
}

/* empty state */
#lyrics-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    padding: 24px;
    text-align: center;
}

/* ── TOKEN theme overrides ────────────────────────────────────────────────── */

/* VHS scanlines + noise layer via pseudo-elements */
.token-theme #lyrics-panel {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.18) 2px,
            rgba(0, 0, 0, 0.18) 4px
        ),
        linear-gradient(
            160deg,
            rgba(10, 0, 8, 0.97) 0%,
            rgba(6, 0, 14, 0.96) 50%,
            rgba(10, 0, 8, 0.97) 100%
        );
    backdrop-filter: blur(8px) saturate(1.8) contrast(1.1);
    -webkit-backdrop-filter: blur(8px) saturate(1.8) contrast(1.1);
    border: 1px solid rgba(255, 45, 149, 0.25);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(0, 243, 255, 0.08),
        0 0 30px rgba(255, 45, 149, 0.12),
        0 0 60px rgba(0, 243, 255, 0.06),
        inset 0 0 40px rgba(153, 0, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.7);
}

/* VHS tape header stripe */
.token-theme #lyrics-panel::before {
    background: linear-gradient(
        to bottom,
        rgba(10, 0, 8, 0.98) 0%,
        rgba(255, 45, 149, 0.04) 60%,
        transparent 100%
    );
}

/* VHS tape footer stripe */
.token-theme #lyrics-panel::after {
    background: linear-gradient(
        to top,
        rgba(6, 0, 14, 0.98) 0%,
        rgba(0, 243, 255, 0.03) 60%,
        transparent 100%
    );
}

/* Animated noise grain overlay */
.token-theme #lyrics-panel .lyrics-vhs-noise {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    animation: vhs-noise-drift 0.4s steps(1) infinite;
    mix-blend-mode: overlay;
}

@keyframes vhs-noise-drift {
    0%   { background-position: 0 0; }
    25%  { background-position: -30px 10px; }
    50%  { background-position: 15px -20px; }
    75%  { background-position: -10px 30px; }
    100% { background-position: 0 0; }
}

/* TOKEN lyrics lines */
.token-theme .lyrics-line {
    font-family: 'VT323', 'Monoton', monospace;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.18);
    text-transform: uppercase;
    line-height: 1.7;
    transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                font-size 0.25s ease, text-shadow 0.2s ease;
}

.token-theme .lyrics-line.prev {
    color: rgba(255, 255, 255, 0.28);
    font-size: 15px;
}

.token-theme .lyrics-line.active {
    color: var(--token-neon-pink);
    font-size: 19px;
    transform: scale(1.04);
    text-shadow:
        0 0 8px var(--token-neon-pink),
        0 0 20px rgba(255, 45, 149, 0.5),
        0 0 40px rgba(255, 0, 255, 0.2);
    letter-spacing: 2px;
}

/* glitch flicker on the whole panel */
.token-theme #lyrics-panel.glitch-flicker {
    filter: brightness(1.15) hue-rotate(10deg);
    transform: translateY(0) scale(1) translateX(1px);
}

.token-theme #lyrics-panel.glitch-flicker #lyrics-scroll {
    filter: blur(0.4px);
}

.token-theme #lyrics-empty {
    font-family: 'VT323', monospace;
    color: rgba(255, 45, 149, 0.4);
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-style: normal;
}
