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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #e0e0e0;
    overflow: hidden;
    user-select: none;
}

#header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid #444;
    backdrop-filter: blur(5px);
}

#header h1 {
    font-size: 24px;
    color: #ff6b6b;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

#header p {
    font-size: 14px;
    color: #ccc;
    opacity: 0.8;
}

#scene-container {
    width: 100vw;
    height: 100vh;
}

#controls-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #444;
    border-radius: 10px;
    transition: transform 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#controls-panel.collapsed {
    transform: translateX(240px);
}

#toggle-controls {
    position: absolute;
    left: -40px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #444;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

#toggle-controls:hover {
    background: rgba(255, 107, 107, 0.2);
}

#controls-content {
    padding: 20px;
}

#controls-content h3 {
    color: #ff6b6b;
    margin-bottom: 20px;
    text-align: center;
    font-size: 18px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 14px;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    accent-color: #ff6b6b;
}

.control-group span {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 12px;
}

#color-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.color-btn {
    padding: 8px 12px;
    border: 2px solid #444;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.color-btn:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
}

.color-btn.active {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.3);
    color: #fff;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #ff6b6b;
}

#reset-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#reset-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff4444);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

#cursor-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#virtual-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
    transition: all 0.1s ease;
}

#cursor-trail-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.trail-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 107, 107, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#speed-indicator {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 200px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #444;
    border-radius: 8px;
    padding: 15px;
    z-index: 100;
}

#speed-indicator span {
    display: block;
    color: #ccc;
    font-size: 12px;
    margin-bottom: 8px;
}

#speed-bar {
    height: 8px;
    background: #44ff44;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px currentColor;
}

#instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #444;
    z-index: 100;
}

#instructions p {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 5px;
}

#instructions p:last-child {
    margin-bottom: 0;
}

footer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #444;
    z-index: 100;
}

footer p {
    color: #888;
    font-size: 12px;
}

footer a {
    color: #ff6b6b;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #header {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
    }
    
    #header h1 {
        font-size: 18px;
    }
    
    #header p {
        font-size: 12px;
    }
    
    #controls-panel {
        top: 10px;
        right: 10px;
        width: 240px;
    }
    
    #controls-panel.collapsed {
        transform: translateX(200px);
    }
    
    #speed-indicator {
        bottom: 120px;
        left: 10px;
        width: 160px;
        padding: 10px;
    }
    
    #instructions {
        bottom: 60px;
        left: 10px;
        right: 10px;
        transform: none;
        padding: 10px;
    }
    
    footer {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
}

/* Retro CRT effect for the whole app */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 0, 0.03) 2px,
            rgba(0, 255, 0, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1000;
}