* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    color: #00d9ff;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    margin-bottom: 1.5rem;
}

/* Visualization */
.visualization {
    position: relative;
    margin-bottom: 1.5rem;
}

#visualizer {
    width: 100%;
    height: 200px;
    background: #0d0d1a;
    border-radius: 12px;
    border: 2px solid #333;
}

/* Hypnotic Background */
.hypnotic-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

#hypnotic {
    width: 100vmin;
    height: 100vmin;
    opacity: 0.15;
    transition: transform 0.1s ease-out;
    object-fit: contain;
}

/* Crossfader Section */
.crossfader-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    padding-top: 0.5rem;
    background: rgba(13, 13, 26, 0.5);
    border-radius: 12px;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.crossfader-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.fader-label {
    font-size: 0.875rem;
    color: #888;
    text-transform: uppercase;
}

.crossfader {
    width: 100%;
    height: 40px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #00ff88, #444 45%, #444 55%, #ff00ff);
    border-radius: 20px;
    outline: none;
    cursor: pointer;
    margin: 10px 0;
    position: relative;
    z-index: 11;
}

.crossfader::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 3px solid #00d9ff;
}

.crossfader::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.crossfader::-moz-range-thumb {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 3px solid #00d9ff;
}

.crossfader-value {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #00d9ff;
    font-family: monospace;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.play-btn, .stop-btn {
    padding: 1rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.play-btn {
    background: linear-gradient(135deg, #00d9ff 0%, #00ff88 100%);
    color: #000;
}

.play-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
}

.stop-btn {
    background: #333;
    color: #fff;
}

.stop-btn:hover:not(:disabled) {
    background: #ff4444;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status */
.status {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #0d0d1a;
    border-radius: 8px;
    font-size: 0.875rem;
}

#statusText {
    color: #00ff88;
}

/* Line Controls */
.line1-controls,
.line2-controls {
    background: rgba(13, 13, 26, 0.5);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.line2-controls {
    margin-top: 1rem;
    margin-bottom: 0;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-row + .control-row {
    margin-top: 0.5rem;
}

.control-row label {
    color: #00d9ff;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 50px;
}

.or-label {
    color: #666;
    font-size: 0.75rem;
    min-width: 50px;
    text-align: right;
    padding-right: 0.5rem;
}

#micSelect {
    flex: 1;
    padding: 0.5rem;
    background: #1a1a2e;
    border: 2px solid #333;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.875rem;
    cursor: pointer;
}

#micSelect:focus {
    outline: none;
    border-color: #00d9ff;
}

#line1Url,
#customUrl {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: #1a1a2e;
    border: 2px solid #333;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.875rem;
}

#line1Url:focus,
#customUrl:focus {
    outline: none;
    border-color: #00d9ff;
}

#line1Url::placeholder,
#customUrl::placeholder {
    color: #666;
}

#loadLine1Btn,
#loadCustomBtn {
    padding: 0.5rem 1rem;
    background: #333;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

#loadLine1Btn:hover,
#loadCustomBtn:hover {
    background: #00d9ff;
    color: #000;
}

/* Responsive */
@media (max-width: 600px) {
    .crossfader::-webkit-slider-thumb {
        width: 40px;
        height: 40px;
    }

    h1 {
        font-size: 2rem;
    }
}
