:root {
    --bg: #0f1115;
    --panel: #151923;
    --panel-2: #10131b;
    --text: #e7eaf0;
    --muted: #a7adbc;
    --border: rgba(255, 255, 255, 0.08);
    --green: #1db954;
    --green-2: #17a84a;
    --danger: #ff5a6a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.egr-dark {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 700px at 20% -10%, rgba(29, 185, 84, 0.18), transparent 55%),
                radial-gradient(900px 600px at 90% 10%, rgba(59, 130, 246, 0.12), transparent 55%),
                var(--bg);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

.egr-wrap {
    width: calc(100% - 32px);
    max-width: 1600px;
    margin: 0 auto;
}

.egr-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 17, 21, 0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.egr-topbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 12px;
}

.egr-brand {
    font-weight: 800;
    letter-spacing: 0.2px;
}
.egr-brand::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(29, 185, 84, 0.15);
}

.egr-nav {
    display: flex;
    gap: 10px;
}
.egr-nav__link {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
    border: 1px solid transparent;
}
.egr-nav__link:hover { color: var(--text); border-color: var(--border); }
.egr-nav__link.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border);
}

.egr-main {
    padding: 18px 0 70px;
}

.egr-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.egr-title {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.2px;
}

.egr-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.egr-muted {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.egr-alert {
    margin-top: 14px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}
.egr-alert--error { border-color: rgba(255, 90, 106, 0.35); color: #ffd7dc; }
.egr-alert--ok { border-color: rgba(29, 185, 84, 0.35); color: #d6ffe4; }

.egr-form { margin-top: 16px; }
.egr-field { display: block; margin-top: 12px; }
.egr-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.egr-input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(16, 19, 27, 0.85);
    color: var(--text);
    outline: none;
}
.egr-input:focus { border-color: rgba(29, 185, 84, 0.55); box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.15); }

/* Select dropdowns */
.egr-select {
    padding: 10px 32px 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(16, 19, 27, 0.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a7adbc' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    min-width: 140px;
}
.egr-select:hover { border-color: rgba(255, 255, 255, 0.2); }
.egr-select:focus { border-color: rgba(29, 185, 84, 0.55); box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.15); }
.egr-select option {
    background: #1a1d24;
    color: var(--text);
    padding: 8px;
}

/* Category Navigation with Arrows */
.egr-category-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    background: rgba(16, 19, 27, 0.6);
    border-radius: 10px;
    padding: 4px;
    position: relative;
}
.egr-category-arrow {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(29, 185, 84, 0.15);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}
.egr-category-arrow:hover {
    background: rgba(29, 185, 84, 0.3);
    opacity: 1;
}
.egr-category-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    background: transparent;
}
.egr-category-tabs {
    display: flex;
    gap: 4px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    flex: 1;
    padding: 2px 0;
}
.egr-category-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.egr-category-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.egr-category-tab--active {
    background: var(--primary);
    color: #000;
    font-weight: 600;
}
.egr-category-tab--active:hover {
    background: var(--primary);
    color: #000;
}

.egr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 700px) {
    .egr-grid { grid-template-columns: 1fr; }
}

.egr-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.egr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    user-select: none;
}
.egr-btn:hover { background: rgba(255, 255, 255, 0.06); }
.egr-btn--primary {
    border-color: rgba(29, 185, 84, 0.45);
    background: linear-gradient(180deg, var(--green), var(--green-2));
    color: #07130b;
    font-weight: 700;
}
.egr-btn--primary:hover { filter: brightness(1.04); }
.egr-btn--ghost { background: transparent; }

.egr-details {
    margin-top: 14px;
    color: var(--muted);
}
.egr-details summary { cursor: pointer; }

.egr-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.egr-search { min-width: min(360px, 100%); }

.egr-list {
    margin-top: 14px;
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px;
    padding: 0;
}
@media (max-width: 1100px) {
    .egr-list { grid-template-columns: repeat(5, 1fr) !important; }
}
@media (max-width: 900px) {
    .egr-list { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 700px) {
    .egr-list { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 500px) {
    .egr-list { grid-template-columns: repeat(2, 1fr) !important; }
}

.egr-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px 8px;
    transition: background 0.15s ease;
    cursor: pointer;
    min-width: 0;
}
.egr-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.egr-track__num {
    display: none;
}

.egr-track__cover {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1db954 0%, #191414 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.egr-track__play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.egr-track:hover .egr-track__play-overlay {
    opacity: 1;
}
.egr-track__play-overlay::before {
    content: "▶";
    color: #fff;
    font-size: 14px;
}

.egr-track__meta {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.egr-track__title {
    font-weight: 600;
    font-size: 12px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    word-break: break-word;
}
.egr-track__artist {
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.egr-track__duration {
    color: var(--muted);
    font-size: 13px;
    min-width: 45px;
    text-align: right;
}

.egr-track.is-playing {
    background: rgba(29, 185, 84, 0.09);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.5);
}
.egr-track.is-playing .egr-track__title {
    color: rgba(29, 185, 84, 0.5);
}
.egr-track.is-playing .egr-track__play-overlay {
    opacity: 1;
}
.egr-track.is-playing .egr-track__play-overlay::before {
    content: "▐▐";
    font-size: 12px;
    letter-spacing: 2px;
}

.egr-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, #181818 0%, #121212 100%);
    padding: 6px 16px;
    z-index: 100;
    height: 50px;
}
.egr-player__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
}
@media (max-width: 900px) {
    .egr-player__volume { display: none; }
}
@media (max-width: 600px) {
    .egr-player__row { gap: 8px; }
}

.egr-player__meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 200px;
}
.egr-player__thumb {
    display: none; /* Hidden in compact mode */
}
.egr-player__info {
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.egr-player__title {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    max-width: 120px;
}
.egr-player__artist {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}
.egr-player__separator {
    display: inline;
    color: var(--muted);
    font-size: 12px;
}

.egr-player__controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}
.egr-player__buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}
.egr-ctrl-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.egr-ctrl-btn:hover {
    color: var(--text);
    transform: scale(1.1);
}
.egr-ctrl-btn--main {
    background: #fff;
    color: #000;
    width: 32px;
    height: 32px;
    font-size: 14px;
}
.egr-ctrl-btn--main:hover {
    transform: scale(1.08);
    background: #fff;
    color: #000;
}

.egr-player__progress {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 400px;
}
.egr-player__time {
    font-size: 10px;
    color: var(--muted);
    min-width: 32px;
    text-align: center;
}
.egr-player__bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.egr-player__bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}
.egr-player__bar:hover .egr-player__bar-fill {
    background: #1ed760;
}

.egr-player__volume {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}
.egr-volume-slider {
    width: 70px;
    height: 3px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    cursor: pointer;
}
.egr-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.egr-audio { display: none; }

/* Persistent Playback Badge */
.egr-persistent-badge {
    font-size: 14px;
    opacity: 0.4;
    cursor: help;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.egr-persistent-badge:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* DSP Button */
#btnDSP {
    font-size: 16px;
}
/* Lyrics Button */
#btnLyrics {
    font-size: 16px;
}
.egr-persistent-badge.is-active {
    opacity: 1;
    animation: persistPulse 2s ease-in-out infinite;
}
@keyframes persistPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Video Modal for Karaoke */
.egr-video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.egr-video-modal.is-open {
    display: flex;
}
.egr-video-modal__content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.egr-video-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.egr-video-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.egr-video-modal__video {
    width: 100%;
    max-height: 80vh;
    background: #000;
}
.egr-video-modal__info {
    padding: 16px 20px;
    background: #181818;
}
.egr-video-modal__title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.egr-video-modal__artist {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
}

/* Video track indicator - Enhanced */
.egr-track--video .egr-track__cover {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    position: relative;
}
.egr-track--video .egr-track__cover::after {
    content: "VIDEO";
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 7px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}
.egr-track--video .egr-track__title {
    color: #ff9ec4;
}
.egr-track--video:hover .egr-track__cover {
    box-shadow: 0 0 12px rgba(255, 107, 157, 0.5);
}
.egr-track--video.is-playing {
    background: rgba(255, 107, 157, 0.18);
    box-shadow: 0 0 0 2px #ff6b9d;
}
.egr-track--video.is-playing .egr-track__title {
    color: #ff6b9d;
}
.egr-track--video .egr-track__play-overlay::before {
    content: "PLAY";
    font-size: 10px;
    letter-spacing: 1px;
}

/* ========================================
   DSP Equalizer Panel - 10-Band + 3D Spatial
   ======================================== */
.egr-dsp {
    position: fixed;
    right: 20px;
    bottom: 120px;
    width: 520px;
    max-height: calc(100vh - 160px);
    background: linear-gradient(180deg, #1e2128 0%, #15181e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
    overflow: hidden;
    overflow-y: auto;
    pointer-events: auto;
}
.egr-dsp.is-open {
    display: block;
    animation: dspSlideIn 0.2s ease;
}
@keyframes dspSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.egr-dsp__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}
.egr-dsp__title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.egr-dsp__close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.egr-dsp__close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

/* DSP Section */
.egr-dsp__section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.egr-dsp__section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

/* Crossfade Control */
.egr-crossfade {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.egr-crossfade__row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.egr-crossfade__label {
    font-size: 12px;
    color: var(--muted);
    min-width: 100px;
}
.egr-crossfade__slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}
.egr-crossfade__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.egr-crossfade__slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
    border: none;
    cursor: pointer;
}
.egr-crossfade__slider::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(to right, var(--green) 0%, var(--green) var(--fill, 42%), rgba(255,255,255,0.2) var(--fill, 42%));
    border-radius: 4px;
}
.egr-crossfade__value {
    font-size: 12px;
    color: var(--text);
    min-width: 45px;
    text-align: right;
}
.egr-crossfade__hint {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.4;
}

/* Presets */
.egr-dsp__presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.egr-dsp__presets--row2 {
    padding-top: 0;
    border-bottom: none;
}
.egr-dsp__preset {
    padding: 5px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.egr-dsp__preset:hover {
    border-color: var(--green);
    color: var(--text);
}
.egr-dsp__preset.is-active {
    background: var(--green);
    border-color: var(--green);
    color: #000;
}

/* 10-Band Sliders */
.egr-dsp__sliders {
    display: flex;
    justify-content: space-between;
    padding: 16px 12px;
    gap: 2px;
}
.egr-dsp__sliders--10band {
    padding: 14px 10px;
}
.egr-dsp__band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 36px;
}
.egr-dsp__band label {
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 0.3px;
}

/* Vertical sliders - Enhanced for better touch/click response */
.egr-dsp__band input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 6px;
    background: linear-gradient(to right, rgba(255,255,255,0.15) 0%, rgba(29,185,84,0.3) 50%, rgba(255,255,255,0.15) 100%);
    border-radius: 3px;
    transform: rotate(-90deg);
    transform-origin: center;
    margin: 35px 0;
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
    z-index: 10;
}
.egr-dsp__band input[type="range"]:focus {
    outline: none;
}
.egr-dsp__band input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--green), #17a34a);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.5), 0 0 0 3px rgba(29, 185, 84, 0.2);
    transition: transform 0.1s, box-shadow 0.1s;
}
.egr-dsp__band input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(29, 185, 84, 0.6), 0 0 0 4px rgba(29, 185, 84, 0.3);
}
.egr-dsp__band input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}
.egr-dsp__band input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--green), #17a34a);
    border-radius: 50%;
    cursor: grab;
    border: none;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.5);
}
.egr-dsp__band input[type="range"]::-moz-range-track {
    background: transparent;
}

/* Mobile DSP - 10-band responsive */
@media (max-width: 600px) {
    .egr-dsp {
        right: 5px;
        left: 5px;
        bottom: 100px;
        width: auto;
        max-height: calc(100vh - 140px);
    }
    .egr-dsp__sliders {
        padding: 10px 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .egr-dsp__sliders--10band {
        min-width: 400px;
    }
    .egr-dsp__band input[type="range"] {
        width: 60px;
        height: 5px;
        margin: 26px 0;
    }
    .egr-dsp__band input[type="range"]::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    .egr-dsp__band {
        min-width: 32px;
    }
    .egr-dsp__band label {
        font-size: 7px;
    }
    .egr-dsp__presets {
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 10px;
    }
    .egr-dsp__preset {
        padding: 4px 8px;
        font-size: 9px;
    }
}

.egr-toast {
    position: fixed;
    right: 18px;
    bottom: 86px;
    z-index: 80;
    max-width: min(420px, calc(100% - 36px));
    background: rgba(21, 25, 35, 0.96);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}
.egr-toast.is-show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */

/* Safe area for notched phones (iPhone X+) */
@supports (padding: max(0px)) {
    .egr-player {
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }
    .egr-video-modal {
        padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    }
}

/* Touch-friendly improvements */
@media (max-width: 600px) {
    /* Larger wrap padding on mobile */
    .egr-wrap {
        width: calc(100% - 16px);
    }

    /* Compact main area with more space for player */
    .egr-main {
        padding: 10px 0 70px;
    }

    /* Smaller card padding */
    .egr-card {
        padding: 12px;
        border-radius: 12px;
    }

    /* Stack toolbar on mobile */
    .egr-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .egr-toolbar > div:first-child {
        text-align: center;
    }
    .egr-title {
        font-size: 18px;
    }
    .egr-subtitle {
        font-size: 13px;
    }

    /* Full-width search */
    .egr-search {
        min-width: 100%;
    }
    .egr-input {
        padding: 14px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Controls responsive */
    .egr-controls {
        justify-content: center;
    }
    .egr-select {
        font-size: 14px;
        min-width: 120px;
        flex: 1;
    }
    #btnShuffleAlbum {
        flex: 1;
        justify-content: center;
    }

    /* Category tabs responsive */
    .egr-category-nav {
        margin-top: 8px;
        padding: 3px;
    }
    .egr-category-arrow {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
    .egr-category-tab {
        padding: 5px 10px;
        font-size: 10px;
        max-width: 90px;
    }

    /* Smaller gap in grid */
    .egr-list {
        gap: 8px;
        margin-top: 12px;
    }

    /* Compact track cards */
    .egr-track {
        padding: 8px 6px;
        border-radius: 6px;
    }
    .egr-track__cover {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 6px;
        border-radius: 4px;
    }
    .egr-track__play-overlay {
        border-radius: 4px;
    }
    .egr-track__title {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }
    .egr-track__artist {
        font-size: 9px;
    }

    /* Mobile player - compact single row */
    .egr-player {
        height: 50px;
        padding: 6px 10px;
    }
    .egr-player__row {
        flex-direction: row;
        gap: 8px;
    }
    .egr-player__meta {
        flex: 0 1 auto;
        max-width: 100px;
        background: none;
        padding: 0;
        margin: 0;
    }
    .egr-player__info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    .egr-player__title {
        font-size: 11px;
        max-width: 100px;
        color: #fff;
    }
    .egr-player__artist {
        font-size: 10px;
        max-width: 100px;
    }
    .egr-player__separator {
        display: none;
    }
    .egr-player__controls {
        flex: 1;
        flex-direction: row;
    }
    .egr-player__buttons {
        gap: 10px;
    }

    /* Touch targets */
    .egr-ctrl-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
        font-size: 14px;
    }
    .egr-ctrl-btn--main {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Progress bar */
    .egr-player__progress {
        max-width: 150px;
        gap: 4px;
    }
    .egr-player__time {
        font-size: 9px;
        min-width: 28px;
    }
    .egr-player__time {
        font-size: 10px;
        min-width: 32px;
    }

    /* Video modal fullscreen on mobile */
    .egr-video-modal {
        padding: 0;
        background: #000;
    }
    .egr-video-modal__content {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    .egr-video-modal__video {
        flex: 1;
        max-height: none;
        object-fit: contain;
    }
    .egr-video-modal__close {
        top: 8px;
        right: 8px;
        width: 44px;
        height: 44px;
    }
    .egr-video-modal__info {
        padding: 12px 16px;
    }
    .egr-video-modal__title {
        font-size: 15px;
    }
    .egr-video-modal__artist {
        font-size: 12px;
    }

    /* Toast position for mobile */
    .egr-toast {
        left: 12px;
        right: 12px;
        bottom: 150px;
        max-width: none;
    }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 380px) {
    .egr-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
    }
    .egr-track {
        padding: 6px 4px;
    }
    .egr-track__cover {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    .egr-track__title {
        font-size: 10px;
    }
    .egr-player__buttons {
        gap: 14px;
    }
    .egr-ctrl-btn {
        min-width: 40px;
        min-height: 40px;
    }
    .egr-ctrl-btn--main {
        width: 48px;
        height: 48px;
    }
}

/* Tablet landscape */
@media (min-width: 601px) and (max-width: 900px) {
    .egr-player__meta {
        gap: 10px;
    }
    .egr-player__thumb {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    .egr-player__title {
        font-size: 26px;
    }
    .egr-player__artist {
        font-size: 14px;
    }
}

/* Touch device hover states */
@media (hover: none) and (pointer: coarse) {
    .egr-track:hover {
        background: rgba(255, 255, 255, 0.04);
    }
    .egr-track:active {
        background: rgba(255, 255, 255, 0.12);
    }
    .egr-track:hover .egr-track__play-overlay {
        opacity: 0;
    }
    .egr-track:active .egr-track__play-overlay {
        opacity: 1;
    }
    .egr-ctrl-btn:hover {
        transform: none;
    }
    .egr-ctrl-btn:active {
        transform: scale(0.95);
    }
    .egr-ctrl-btn--main:hover {
        transform: none;
    }
    .egr-ctrl-btn--main:active {
        transform: scale(0.95);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection on buttons */
.egr-ctrl-btn,
.egr-track,
.egr-nav__link,
.egr-btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .egr-main {
        padding-bottom: 100px;
    }
    .egr-player {
        padding: 6px 16px 8px;
    }
    .egr-player__row {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
    .egr-player__meta {
        display: flex !important;
        flex: 1;
        max-width: 250px;
    }
    .egr-player__thumb {
        display: none;
    }
    .egr-player__info {
        flex-direction: row;
        gap: 6px;
    }
    .egr-player__title {
        font-size: 20px;
        max-width: 180px;
    }
    .egr-player__artist {
        font-size: 13px;
        max-width: 140px;
        margin-top: 0;
    }
    .egr-player__separator {
        display: inline;
    }
    .egr-player__controls {
        width: auto;
    }
    .egr-player__progress {
        max-width: 300px;
    }
    .egr-ctrl-btn--main {
        width: 44px;
        height: 44px;
    }

    /* Video modal in landscape */
    .egr-video-modal__content {
        flex-direction: row;
    }
    .egr-video-modal__video {
        flex: 1;
    }
    .egr-video-modal__info {
        width: 200px;
        flex-shrink: 0;
    }
}

/* Track type separator (Audio vs Karaoke/Video) */
.egr-track-separator {
    grid-column: 1 / -1;
    padding: 16px 12px 8px;
    color: #a7adbc;
    font-size: 13px;
    font-weight: 600;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
}
.egr-track-separator span {
    background: linear-gradient(90deg, rgba(255,107,157,0.2), transparent);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

/* ========================================
   LYRICS MODAL - Spotify-style Karaoke
   ======================================== */
.egr-lyrics-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 50%, #000 100%);
    flex-direction: column;
}
.egr-lyrics-modal.is-open {
    display: flex;
}

/* Header - Hidden (controls moved to bottom player bar) */
.egr-lyrics-modal__header {
    display: none;
}
.egr-lyrics-modal__track-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.egr-lyrics-modal__title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.egr-lyrics-modal__artist {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}
/* Sync status - hidden */
.egr-lyrics-sync-status {
    display: none;
}
.egr-lyrics-modal__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.egr-lyrics-modal__btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.egr-lyrics-modal__btn:hover {
    background: rgba(255,255,255,0.2);
}
.egr-lyrics-modal__btn--primary {
    background: var(--green);
    color: #000;
}
.egr-lyrics-modal__btn--primary:hover {
    background: #1ed760;
}
.egr-lyrics-modal__close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.egr-lyrics-modal__close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Lyrics Content - Centered with vertical padding */
.egr-lyrics-modal__content {
    flex: 1;
    overflow-y: auto;
    padding: 35vh 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    scroll-behavior: smooth;
}
.egr-lyrics-modal__content::-webkit-scrollbar {
    width: 6px;
}
.egr-lyrics-modal__content::-webkit-scrollbar-track {
    background: transparent;
}
.egr-lyrics-modal__content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Lyrics Lines - Karaoke Style */
.egr-lyrics-line {
    text-align: center;
    padding: 14px 24px;
    font-size: 32px;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.2s ease, font-size 0.2s ease;
    max-width: 800px;
    line-height: 1.4;
    border-radius: 8px;
    position: relative;
}
.egr-lyrics-line:hover {
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.05);
}
/* Active line - currently being sung */
.egr-lyrics-line.is-active {
    color: #1db954;
    font-size: 42px;
    transform: scale(1.12);
    text-shadow: 0 0 60px rgba(29, 185, 84, 1), 0 0 100px rgba(29, 185, 84, 0.6), 0 4px 30px rgba(0,0,0,0.7);
    background: linear-gradient(90deg,
        rgba(29, 185, 84, 0.25) calc(var(--line-progress, 0) * 100%),
        rgba(29, 185, 84, 0.08) calc(var(--line-progress, 0) * 100%));
    border-radius: 12px;
    padding: 18px 32px;
    margin: 8px 0;
    box-shadow: 0 0 40px rgba(29, 185, 84, 0.3), inset 0 0 20px rgba(29, 185, 84, 0.1);
    transition: none;
}
/* Past lines - already sung */
.egr-lyrics-line.is-past {
    color: rgba(255,255,255,0.5);
}
/* Upcoming line - next to be sung */
.egr-lyrics-line.is-upcoming {
    color: rgba(255,255,255,0.4);
}

/* Pre-highlight - about to become active (smooth transition) */
.egr-lyrics-line.is-pre-highlight {
    color: rgba(255, 255, 255, calc(0.4 + var(--pre-progress, 0) * 0.5));
    transform: scale(calc(1 + var(--pre-progress, 0) * 0.03));
    text-shadow: 0 0 calc(var(--pre-progress, 0) * 20px) rgba(29, 185, 84, calc(var(--pre-progress, 0) * 0.4));
    transition: none;
}
/* Pre-highlight when about to become active */
.egr-lyrics-line.is-next {
    color: rgba(255, 215, 0, calc(0.5 + var(--upcoming-progress, 0) * 0.5));
    text-shadow: 0 0 25px rgba(255, 215, 0, calc(var(--upcoming-progress, 0) * 0.5));
    transform: scale(calc(1 + var(--upcoming-progress, 0) * 0.04));
    transition: none;
}

/* Vocal-reactive glow - pulses with detected singing */
.egr-lyrics-line.is-singing {
    animation: vocalPulse 0.15s ease-out;
    text-shadow:
        0 0 40px rgba(29, 185, 84, calc(0.8 + var(--vocal-energy, 0) * 0.5)),
        0 0 80px rgba(29, 185, 84, calc(var(--vocal-energy, 0) * 0.6)),
        0 2px 20px rgba(0,0,0,0.5);
}

@keyframes vocalPulse {
    0% { transform: scale(1.08); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1.08); }
}

/* Plain Lyrics - No sync timing, just readable text */
.egr-lyrics--plain .egr-lyrics-line {
    color: rgba(255,255,255,0.9);
    font-size: 40px;
    font-weight: 500;
    padding: 18px 28px;
    line-height: 1.5;
    cursor: default;
    transform: none;
    text-shadow: none;
    background: none;
}
.egr-lyrics--plain .egr-lyrics-line:hover {
    color: #fff;
    background: none;
}

/* Word-Level Sync Styles (Enhanced LRC) */
.egr-lyrics--word-sync .egr-lyrics-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15em;
    justify-content: center;
}

.egr-lyrics-word {
    display: inline-block;
    transition: all 0.15s ease;
    cursor: pointer;
}

.egr-lyrics-word:hover {
    color: #1db954;
}

/* Word-level active state */
.egr-lyrics-line.is-active .egr-lyrics-word.is-word-active {
    color: #1db954;
    text-shadow:
        0 0 30px rgba(29, 185, 84, 0.8),
        0 0 60px rgba(29, 185, 84, 0.5);
    transform: scale(1.05);
    transition: transform 0.08s ease;
}

.egr-lyrics-line.is-active .egr-lyrics-word.is-word-past {
    color: rgba(29, 185, 84, 0.6);
    text-shadow: 0 0 10px rgba(29, 185, 84, 0.3);
}

.egr-lyrics-line.is-active .egr-lyrics-word.is-word-upcoming {
    color: rgba(255, 255, 255, 0.85);
}

/* Word fill animation (karaoke-style) */
.egr-lyrics-word::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: calc(var(--word-progress, 0) * 100%);
    overflow: hidden;
    color: #1db954;
    transition: width 0.05s linear;
}

.egr-lyrics--word-sync .egr-lyrics-line--words {
    position: relative;
}

/* Enhanced karaoke highlight effect */
@keyframes wordPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1.05); }
}

.egr-lyrics-word.is-word-singing {
    animation: wordPop 0.12s ease-out;
    text-shadow:
        0 0 40px rgba(29, 185, 84, 0.9),
        0 0 80px rgba(29, 185, 84, 0.6),
        0 2px 20px rgba(0, 0, 0, 0.5);
}

/* No Lyrics State */
.egr-lyrics-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    color: var(--muted);
    text-align: center;
    padding: 40px;
}
.egr-lyrics-empty__icon {
    font-size: 64px;
    opacity: 0.5;
}
.egr-lyrics-empty__title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}
.egr-lyrics-empty__hint {
    font-size: 14px;
    max-width: 400px;
}

/* Mini Player at bottom of lyrics - single row */
.egr-lyrics-modal__player {
    padding: 4px 12px;
    background: rgba(0,0,0,0.5);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
/* Left section: Title + Edit */
.egr-lyrics-modal__left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 100px;
}
/* Title in player */
.egr-lyrics-modal__player .egr-lyrics-modal__title {
    font-size: 11px;
    font-weight: 700;
    color: #1db954;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Buttons in player bar */
.egr-lyrics-modal__player .egr-sync-btn {
    padding: 2px 8px;
    font-size: 10px;
    min-height: 22px;
}
/* Close button style */
.egr-ctrl-btn--close {
    color: #ff9999;
}
.egr-ctrl-btn--close:hover {
    background: rgba(255,100,100,0.3);
    color: #fff;
}
.egr-lyrics-modal__progress {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.egr-lyrics-modal__progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.egr-lyrics-modal__progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}
.egr-lyrics-modal__time {
    font-size: 11px;
    color: var(--muted);
    min-width: 40px;
}

/* Manual Sync Controls - Compact single row */
.egr-lyrics-sync-controls {
    padding: 3px 8px;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}
.egr-sync-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.egr-sync-label {
    font-size: 9px;
    color: var(--muted);
    text-align: right;
}
.egr-sync-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    min-height: 20px;
    line-height: 1.2;
}
.egr-sync-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}
.egr-sync-btn:active {
    transform: scale(0.95);
}
.egr-sync-btn--set {
    background: rgba(29, 185, 84, 0.2);
    border-color: rgba(29, 185, 84, 0.4);
    color: var(--primary);
}
.egr-sync-btn--set:hover {
    background: rgba(29, 185, 84, 0.35);
}
.egr-sync-btn--reset {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.3);
    color: #ff9999;
}
.egr-sync-btn--reset:hover {
    background: rgba(255, 100, 100, 0.3);
}
.egr-sync-btn--plain {
    background: rgba(100, 150, 255, 0.15);
    border-color: rgba(100, 150, 255, 0.3);
    color: #99bbff;
}
.egr-sync-btn--plain:hover {
    background: rgba(100, 150, 255, 0.3);
}

/* Fine adjustment buttons */
.egr-sync-btn--fine {
    padding: 2px 5px;
    font-size: 9px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    min-height: 18px;
}
.egr-sync-btn--fine:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Auto-calibration button */
.egr-sync-btn--calibrate {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}
.egr-sync-btn--calibrate:hover {
    background: rgba(255, 215, 0, 0.3);
}
.egr-sync-btn--calibrate.is-calibrating {
    animation: calibratePulse 1s ease-in-out infinite;
}
@keyframes calibratePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Close button in sync controls */
.egr-sync-btn--close {
    background: rgba(255, 100, 100, 0.25);
    border-color: rgba(255, 100, 100, 0.5);
    color: #ff6666;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 10px;
    flex-shrink: 0;
}
.egr-sync-btn--close:hover {
    background: rgba(255, 100, 100, 0.5);
    color: #fff;
}

/* Divider between control groups */
.egr-sync-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 9px;
    margin: 0 1px;
}

.egr-sync-input {
    width: 36px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
    text-align: center;
    min-height: 18px;
}
.egr-sync-input--offset {
    width: 28px;
    color: var(--primary);
}
.egr-sync-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0,0,0,0.6);
}
/* .egr-sync-value replaced by input field */

/* ========================================
   LYRICS EDITOR - For pasting & syncing
   ======================================== */
.egr-lyrics-editor {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 310;
    background: rgba(0,0,0,0.95);
    flex-direction: column;
}
.egr-lyrics-editor.is-open {
    display: flex;
}
.egr-lyrics-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.egr-lyrics-editor__title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.egr-lyrics-editor__body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Textarea for pasting lyrics */
.egr-lyrics-editor__input {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.egr-lyrics-editor__textarea {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.8;
    resize: none;
    outline: none;
}
.egr-lyrics-editor__textarea:focus {
    border-color: var(--green);
}
.egr-lyrics-editor__textarea::placeholder {
    color: rgba(255,255,255,0.3);
}
.egr-lyrics-editor__hint {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

/* Sync preview */
.egr-lyrics-editor__preview {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.egr-lyrics-editor__preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}
.egr-lyrics-editor__sync-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.egr-lyrics-sync-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
}
.egr-lyrics-sync-line:hover {
    background: rgba(255,255,255,0.08);
}
.egr-lyrics-sync-line.is-active {
    background: rgba(29, 185, 84, 0.2);
    border: 1px solid var(--green);
}
.egr-lyrics-sync-line.is-synced {
    background: rgba(29, 185, 84, 0.1);
}
.egr-lyrics-sync-line__time {
    min-width: 60px;
    font-size: 12px;
    font-family: monospace;
    color: var(--green);
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
}
.egr-lyrics-sync-line__time.is-unset {
    color: var(--muted);
}
.egr-lyrics-sync-line__text {
    flex: 1;
    font-size: 14px;
    color: #fff;
}
.egr-lyrics-sync-line__btn {
    background: var(--green);
    border: none;
    color: #000;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.egr-lyrics-sync-line__btn:hover {
    transform: scale(1.05);
}

/* Editor footer with player controls */
.egr-lyrics-editor__footer {
    padding: 16px 24px;
    background: rgba(0,0,0,0.5);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.egr-lyrics-editor__controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.egr-lyrics-editor__progress {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.egr-lyrics-editor__save-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Offset controls */
.egr-lyrics-editor__offset {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: 20px;
}
.egr-lyrics-editor__offset label {
    font-size: 12px;
    color: var(--muted);
}
.egr-lyrics-editor__offset #offsetValue {
    font-size: 12px;
    font-family: monospace;
    color: var(--green);
    min-width: 50px;
    text-align: center;
}
.egr-offset-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.egr-offset-btn:hover {
    background: var(--green);
    color: #000;
}

/* Intro marker */
#btnSetIntro {
    font-size: 12px;
}

/* Sync feedback flash */
.egr-lyrics-sync-line.flash {
    animation: syncFlash 0.3s ease;
}
@keyframes syncFlash {
    0% { background: var(--green); }
    100% { background: rgba(29, 185, 84, 0.1); }
}

/* Spotify Search */
.egr-spotify-search {
    background: rgba(29, 185, 84, 0.1);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.egr-spotify-search__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 10px;
}
.egr-spotify-search__row {
    display: flex;
    gap: 8px;
}
.egr-spotify-search__input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
}
.egr-spotify-search__input:focus {
    border-color: var(--green);
}
.egr-spotify-results {
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}
.egr-spotify-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.egr-spotify-result:hover {
    background: rgba(29, 185, 84, 0.2);
}
.egr-spotify-result__img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: #333;
}
.egr-spotify-result__info {
    flex: 1;
    min-width: 0;
}
.egr-spotify-result__title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.egr-spotify-result__artist {
    font-size: 12px;
    color: var(--muted);
}
.egr-spotify-result__btn {
    background: var(--green);
    border: none;
    color: #000;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.egr-spotify-result__btn:hover {
    transform: scale(1.05);
}
.egr-spotify-result__status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--muted);
}
.egr-spotify-result__status.synced {
    background: rgba(29, 185, 84, 0.2);
    color: var(--green);
}
.egr-spotify-result__status.unsynced {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}
.egr-lyrics-editor__divider {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin: 12px 0;
    position: relative;
}
.egr-spotify-loading {
    text-align: center;
    padding: 20px;
    color: var(--muted);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .egr-lyrics-modal__header {
        padding: 4px 12px;
    }
    .egr-lyrics-modal__title {
        font-size: 14px;
    }
    .egr-lyrics-modal__content {
        padding: 12px 16px;
    }
    .egr-lyrics-line {
        font-size: 24px;
        padding: 12px 18px;
    }
    .egr-lyrics-line.is-active {
        font-size: 32px;
    }
    .egr-lyrics-editor__body {
        flex-direction: column;
    }
    .egr-lyrics-editor__input {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        max-height: 40vh;
    }
}

/* ==========================================
   Auto-Sync Lyrics Indicator
   ========================================== */
.egr-autosync-indicator {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(29, 185, 84, 0.95);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: egr-autosync-slidein 0.3s ease-out;
}

.egr-autosync-indicator.egr-autosync-fadeout {
    animation: egr-autosync-fadeout 0.3s ease-out forwards;
}

.egr-autosync-icon {
    font-size: 16px;
    font-weight: bold;
}

.egr-spin {
    animation: egr-spin 1s linear infinite;
    display: inline-block;
}

@keyframes egr-autosync-slidein {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes egr-autosync-fadeout {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100px); opacity: 0; }
}

@keyframes egr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   UPLOAD MODAL
   ======================================== */
.egr-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.egr-upload-modal__content {
    background: linear-gradient(180deg, #1a1d24 0%, #0f1115 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.egr-upload-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.egr-upload-modal__header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.egr-upload-modal__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.egr-upload-modal__close:hover {
    opacity: 1;
}

.egr-upload-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.egr-upload-dropzone {
    border: 2px dashed rgba(29, 185, 84, 0.4);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(29, 185, 84, 0.05);
}

.egr-upload-dropzone:hover,
.egr-upload-dropzone.dragover {
    border-color: var(--green);
    background: rgba(29, 185, 84, 0.1);
}

.egr-upload-dropzone__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.egr-upload-dropzone__text {
    color: #e7eaf0;
    font-size: 14px;
}

.egr-upload-dropzone__text small {
    color: var(--muted);
    font-size: 12px;
}

.egr-upload-options {
    margin-top: 20px;
}

.egr-upload-options label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.egr-upload-queue {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.egr-upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.egr-upload-item__icon {
    font-size: 20px;
}

.egr-upload-item__info {
    flex: 1;
    min-width: 0;
}

.egr-upload-item__name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #e7eaf0;
}

.egr-upload-item__size {
    font-size: 11px;
    color: var(--muted);
}

.egr-upload-item__progress {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.egr-upload-item__progress-bar {
    height: 100%;
    background: var(--green);
    width: 0%;
    transition: width 0.3s;
}

.egr-upload-item__status {
    font-size: 16px;
}

.egr-upload-item--success .egr-upload-item__name {
    color: var(--green);
}

.egr-upload-item--error .egr-upload-item__name {
    color: #ff5a6a;
}

.egr-upload-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.egr-upload-status.success {
    background: rgba(29, 185, 84, 0.15);
    color: var(--green);
}

.egr-upload-status.error {
    background: rgba(255, 90, 106, 0.15);
    color: #ff5a6a;
}

.egr-upload-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   LYRICS SCAN MODAL
   ========================================== */
.egr-scan-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.egr-scan-modal.is-open {
    display: flex;
}

.egr-scan-modal__content {
    background: var(--card);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.egr-scan-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.egr-scan-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.egr-scan-modal__close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.egr-scan-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.egr-scan-modal__body {
    padding: 20px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.egr-scan-modal__status {
    font-size: 14px;
    color: var(--text);
    text-align: center;
}

.egr-scan-modal__progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.egr-scan-modal__progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green), #1ed760);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.egr-scan-modal__stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

.egr-scan-modal__log {
    flex: 1;
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: var(--muted);
}

.egr-scan-modal__log-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.egr-scan-modal__log-item.success {
    color: var(--green);
}

.egr-scan-modal__log-item.error {
    color: #ff5a6a;
}

.egr-scan-modal__log-item.skip {
    color: var(--muted);
    opacity: 0.7;
}

.egr-scan-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.egr-scan-modal__btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.egr-scan-modal__btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.egr-scan-modal__btn--primary {
    background: var(--green);
    color: #000;
}

.egr-scan-modal__btn--primary:hover {
    background: #1ed760;
    transform: scale(1.02);
}

/* ==========================================
   MISSING LYRICS BADGE
   ========================================== */
.egr-track__no-lyrics {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 10px;
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border-radius: 50%;
    margin-left: 6px;
    flex-shrink: 0;
    cursor: help;
}

.egr-track__has-lyrics {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 10px;
    background: rgba(29, 185, 84, 0.2);
    color: var(--green);
    border-radius: 50%;
    margin-left: 6px;
    flex-shrink: 0;
}

/* Scan button pulse animation when scanning */
#btnScanLyrics.scanning {
    animation: pulse-scan 1.5s infinite;
}

@keyframes pulse-scan {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==========================================
   Category Lock Button & Indicator
   ========================================== */
.egr-category-lock-btn {
    transition: all 0.2s ease;
}

.egr-category-lock-btn--active {
    background: rgba(29, 185, 84, 0.15) !important;
    color: var(--green) !important;
    border-color: rgba(29, 185, 84, 0.3) !important;
}

.egr-category-lock-btn--active:hover {
    background: rgba(29, 185, 84, 0.25) !important;
}

/* Locked indicator on active category tab */
.egr-category-tab--locked {
    position: relative;
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.4);
}

.egr-category-tab--locked::after {
    content: '🔒';
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 10px;
    background: var(--panel);
    border-radius: 50%;
    padding: 2px;
    line-height: 1;
}

