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

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.control-panel {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.control-panel h2 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

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

.control-group label {
    display: block;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #444;
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

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

.power-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.power-btn.off {
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: #666;
    border: 2px solid #555;
}

.power-btn.on {
    background: linear-gradient(135deg, #00ff00 0%, #00aa00 100%);
    color: #000;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.5); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.8); }
}

.power-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 8px;
    box-shadow: 0 0 8px currentColor;
}

.slide-controls {
    display: flex;
    gap: 10px;
}

.slide-controls button {
    flex: 1;
    padding: 10px;
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.2s;
}

.slide-controls button:hover {
    background: #555;
    border-color: #ffd700;
}

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

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

.upload-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #5aa0f2 0%, #458bcd 100%);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
}

.preset-btn {
    padding: 10px;
    background: #2a2a2a;
    color: #ffd700;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #3a3a3a;
    border-color: #ffd700;
    transform: translateY(-2px);
}

.slide-library {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 15px;
    max-width: 280px;
}

.slide-library h3 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 16px;
    text-align: center;
}

#thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.thumbnail {
    aspect-ratio: 1;
    background: #333;
    border: 2px solid #555;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
}

.thumbnail:hover {
    border-color: #ffd700;
    transform: scale(1.1);
}

.thumbnail.active {
    border-color: #00ff00;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.5);
}

.info-box {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 15px;
    max-width: 280px;
    font-size: 12px;
}

.info-box p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.info-box a {
    color: #ff69b4;
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

.tip {
    color: #ffd700;
    font-style: italic;
    background: rgba(255, 215, 0, 0.1);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    #controls {
        top: 10px;
        right: 10px;
        left: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .control-panel,
    .slide-library,
    .info-box {
        min-width: auto;
        max-width: 100%;
    }
    
    #thumbnails {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Scrollbar styling */
#controls::-webkit-scrollbar {
    width: 8px;
}

#controls::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

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

#controls::-webkit-scrollbar-thumb:hover {
    background: #555;
}