:root {
    --primary: #00ffcc;
    --secondary: #ff007f;
    --accent: #ffaa00;
    --bg-dark: #0a0a15;
    --panel: rgba(20, 25, 40, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e0e0e0;
    --text-dim: #888;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow-x: hidden;
}

/* Анимированный фон */
.bg-glow {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0,255,204,0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255,0,127,0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 20%, rgba(255,170,0,0.1) 0%, transparent 40%);
    z-index: -1;
    transition: all 0.5s;
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0,255,204,0.3);
}

header h1 span { font-weight: 300; }

.subtitle {
    color: var(--text-dim);
    margin: 5px 0 0;
    font-size: 0.9em;
}

.player-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
}

@media (max-width: 1000px) {
    .player-grid { grid-template-columns: 1fr; }
}

.panel {
    background: var(--panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1em;
    color: var(--primary);
}

.badge {
    background: var(--primary);
    color: #000;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
}

/* DROP ZONE */
.drop-zone {
    border: 2px dashed #444;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-dim);
    font-size: 0.9em;
}
.drop-zone:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0,255,204,0.05);
}

/* PLAYLIST */
.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 500px;
    overflow-y: auto;
}

.playlist::-webkit-scrollbar { width: 6px; }
.playlist::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
.playlist::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }

.playlist li {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 4px;
    font-size: 0.9em;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist li:hover {
    background: rgba(255,255,255,0.05);
}

.playlist li.active {
    background: rgba(0,255,204,0.1);
    border-left-color: var(--primary);
    color: var(--primary);
}

.playlist li .track-num {
    color: var(--text-dim);
    font-size: 0.8em;
    min-width: 20px;
}

.playlist li.active .track-num { color: var(--primary); }

/* MAIN PANEL */
.now-playing {
    text-align: center;
    margin-bottom: 20px;
}

.album-art {
    width: 180px;
    height: 180px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,255,204,0.1);
    transition: 0.3s;
}

.album-art.playing {
    animation: spin 8s linear infinite;
    box-shadow: 0 10px 60px rgba(0,255,204,0.4), inset 0 0 20px rgba(0,255,204,0.2);
}

@keyframes spin {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

.vinyl {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: 
        radial-gradient(circle, transparent 30%, rgba(0,0,0,0.3) 31%, transparent 32%),
        radial-gradient(circle, transparent 40%, rgba(0,0,0,0.3) 41%, transparent 42%),
        radial-gradient(circle, transparent 50%, rgba(0,0,0,0.3) 51%, transparent 52%);
}

.note-icon {
    font-size: 50px;
    z-index: 2;
    filter: drop-shadow(0 0 10px var(--primary));
}

#trackTitle {
    font-size: 1.4em;
    margin: 10px 0 5px;
    color: #fff;
}

#trackInfo {
    color: var(--text-dim);
    margin: 0;
    font-size: 0.85em;
}

canvas {
    width: 100%;
    height: 80px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    margin: 15px 0;
    display: block;
}

/* PROGRESS BAR */
.progress-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--text-dim);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-thumb { opacity: 1; }

/* CONTROLS */
.main-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.ctrl-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    width: 50px; height: 50px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover:not(:disabled) {
    background: rgba(0,255,204,0.1);
    border-color: var(--primary);
    transform: scale(1.1);
}

.ctrl-btn.active {
    background: rgba(0,255,204,0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.ctrl-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.play-main {
    width: 70px; height: 70px;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), #00aa88);
    color: #000;
    border: none;
    box-shadow: 0 5px 20px rgba(0,255,204,0.4);
}

.play-main:hover:not(:disabled) {
    transform: scale(1.15);
    box-shadow: 0 5px 30px rgba(0,255,204,0.6);
}

/* STATUS */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--primary);
}

.note-display { color: #fff; font-weight: bold; }

/* SETTINGS */
.setting-block {
    margin-bottom: 18px;
}

.setting-block label {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 0.85em;
    margin-bottom: 6px;
}

select, input[type="range"] {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0,0,0,0.4);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    font-size: 0.9em;
}

select { cursor: pointer; }

input[type="range"] {
    padding: 0;
    height: 6px;
    background: rgba(255,255,255,0.1);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; height: 16px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    cursor: pointer;
    border: none;
}

/* EQUALIZER */
.eq-block {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.eq-block h3 {
    margin: 0 0 10px;
    font-size: 0.9em;
    color: var(--text-dim);
}

.eq-controls {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    height: 100px;
}

.eq-slider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.eq-slider input[type="range"] {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    writing-mode: bt-lr;
    width: 8px;
    height: 80px;
    padding: 0;
}

.eq-slider label {
    font-size: 0.75em;
    color: var(--text-dim);
}

/* TOGGLE */
.toggle-row {
    flex-direction: row !important;
    align-items: center;
    cursor: pointer;
}

.toggle-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 40px; height: 22px;
    background: #333;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px; left: 2px;
    transition: 0.3s;
}

.toggle-switch:checked {
    background: var(--primary);
}

.toggle-switch:checked::after {
    left: 20px;
}

.reset-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,0,127,0.1);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    transition: 0.2s;
}

.reset-btn:hover {
    background: var(--secondary);
    color: #fff;
}

/* FOOTER */
footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-dim);
    font-size: 0.85em;
}

.hotkeys {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid var(--border);
}

kbd {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8em;
    color: var(--primary);
}

/* LOADING */
.loading {
    color: var(--accent) !important;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* OPTGROUP стилизация */
optgroup {
    background: #1a1a2e;
    color: var(--primary);
    font-weight: bold;
    font-style: normal;
}

option {
    background: #16213e;
    color: var(--text);
    padding: 5px;
}