* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IM Fell English', serif;
    background: #000;
    overflow: hidden;
    color: #ff6600;
}

#main-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 1;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s;
}

.loading-content {
    text-align: center;
    color: #ff6600;
}

.loading-title {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px #ff6600, 0 0 40px #8b0000;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
    width: 400px;
    height: 20px;
    background: #1a1a1a;
    border: 2px solid #ff6600;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

#loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a0e4e, #ff6600, #39ff14);
    transition: width 0.3s;
}

#loading-text {
    font-size: 1.2rem;
    color: #cc5200;
}

/* Lyrics Display */
#lyrics-container {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    width: 90%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff6600;
    border-radius: 15px;
    padding: 20px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

#lyrics-container.hidden {
    display: none;
}

#lyrics-content {
    font-size: 1.5rem;
    line-height: 2rem;
    text-align: center;
}

.lyric-line {
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    margin: 0.5rem 0;
}

.lyric-line.current {
    color: #ff6600;
    font-size: 1.8rem;
    text-shadow: 0 0 10px #ff6600, 0 2px 5px #8b0000;
    animation: lyricPulse 0.5s ease-in-out;
}

.lyric-line.past {
    color: rgba(255, 255, 255, 0.3);
}

@keyframes lyricPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Spider UI Trigger */
#spider-trigger {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    z-index: 9999;
    animation: spiderBob 3s ease-in-out infinite;
    transition: transform 0.3s;
    pointer-events: auto;
}

#spider-trigger:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px #ff6600);
}

#spider-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes spiderBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Control Panel */
#control-panel {
    position: fixed;
    top: 0;
    left: -450px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #1a0f0f 0%, #0a0a0a 100%);
    border-right: 3px solid #ff6600;
    box-shadow: 5px 0 30px rgba(255, 102, 0, 0.5);
    z-index: 500;
    transition: left 0.4s ease-out;
    overflow-y: auto;
}

#control-panel.visible {
    left: 0;
}

.panel-content {
    padding: 20px;
}

.panel-title {
    font-family: 'Creepster', cursive;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #ff6600;
    text-shadow: 0 0 10px #ff6600;
}

.control-section {
    margin-bottom: 2rem;
    padding: 15px;
    background: rgba(26, 15, 15, 0.5);
    border: 1px solid #cc5200;
    border-radius: 8px;
}

.control-section h3 {
    font-family: 'Eater', cursive;
    font-size: 1.3rem;
    color: #ff6600;
    margin-bottom: 1rem;
    text-shadow: 0 0 5px #ff6600;
}

.toggle-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    background: #1a1a1a;
    color: #ff6600;
    border: 2px solid #cc5200;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'IM Fell English', serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: #2a2a2a;
    border-color: #ff6600;
}

.toggle-btn.active {
    background: #ff6600;
    color: #000;
    border-color: #ff6600;
    box-shadow: 0 0 15px #ff6600;
}

.source-controls {
    margin-top: 1rem;
}

.source-controls.hidden {
    display: none;
}

label {
    display: block;
    color: #cc5200;
    margin: 0.8rem 0 0.3rem 0;
    font-size: 1rem;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: #1a1a1a;
    border: 1px solid #cc5200;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ff6600;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #ff6600;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff6600;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #ff6600;
    border: none;
}

input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

select {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    color: #ff6600;
    border: 2px solid #cc5200;
    border-radius: 5px;
    font-family: 'IM Fell English', serif;
    font-size: 1rem;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: #4a0e4e;
    color: #ff6600;
    border: 2px solid #6b1e6f;
    border-radius: 8px;
    font-family: 'IM Fell English', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #6b1e6f;
    border-color: #ff6600;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
}

.meter {
    width: 100%;
    height: 20px;
    background: #1a1a1a;
    border: 1px solid #cc5200;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

#spotify-info {
    margin-top: 1rem;
}

#spotify-info.hidden {
    display: none;
}

#track-info {
    padding: 10px;
    background: rgba(74, 14, 78, 0.3);
    border: 1px solid #6b1e6f;
    border-radius: 5px;
    margin-bottom: 10px;
    color: #ff6600;
    font-size: 0.9rem;
}

.spotify-player-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.spotify-player-controls button {
    padding: 10px 20px;
    background: #1a1a1a;
    color: #ff6600;
    border: 2px solid #cc5200;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.spotify-player-controls button:hover {
    background: #2a2a2a;
    border-color: #ff6600;
    transform: scale(1.1);
}

.spotify-player-controls button:active {
    transform: scale(0.95);
}

#track-info {
    background: rgba(26, 26, 26, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #cc5200;
    margin: 15px 0;
    text-align: center;
}

#track-info strong {
    color: #ff6600;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

#track-info small {
    color: #999;
    font-style: italic;
}

#fps-counter {
    color: #39ff14;
    font-weight: bold;
}

.instructions {
    color: #cc5200;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Browser Warning */
#browser-warning {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 102, 0, 0.9);
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    font-weight: bold;
}

#browser-warning.hidden {
    display: none;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #ff6600;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cc5200;
}

/* Responsive adjustments for 4K */
@media (min-width: 2560px) {
    .loading-title {
        font-size: 6rem;
    }
    
    .panel-title {
        font-size: 3rem;
    }
    
    .control-section h3 {
        font-size: 2rem;
    }
    
    label, select, .toggle-btn, input {
        font-size: 1.5rem;
    }
}

/* Start Overlay */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s;
}

.start-content {
    text-align: center;
    color: #ff6600;
}

.start-title {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    margin-bottom: 3rem;
    text-shadow: 0 0 20px #ff6600, 0 0 40px #8b0000;
    animation: pulse 2s ease-in-out infinite;
}

.start-btn {
    font-family: 'Eater', cursive;
    font-size: 2.5rem;
    padding: 1.5rem 3rem;
    background: #ff6600;
    color: #000;
    border: 3px solid #8b0000;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 30px #ff6600;
    transition: all 0.3s;
    animation: glow 2s ease-in-out infinite;
}

.start-btn:hover {
    background: #ff8800;
    transform: scale(1.1);
    box-shadow: 0 0 50px #ff6600;
}

.start-hint {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: #cc5200;
    font-family: 'IM Fell English', serif;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 30px #ff6600; }
    50% { box-shadow: 0 0 50px #ff6600, 0 0 70px #ff6600; }
}

/* Utility */
.hidden {
    display: none !important;
}

/* Tab Audio UI Styles */
.info-text {
    background: rgba(255, 102, 0, 0.1);
    border-left: 3px solid #ff6600;
    padding: 12px;
    margin: 10px 0;
    font-size: 0.9em;
    line-height: 1.6;
    color: #ffcc99;
}

.status-text {
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid #39ff14;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
    color: #39ff14;
    border-radius: 4px;
}

.status-text.hidden {
    display: none;
}
