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

body {
    font-family: 'JetBrains Mono', monospace;
    background: #1a1a2e;
    color: #fff;
    overflow: hidden;
    user-select: none;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#progress-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

#progress-segments {
    display: flex;
    gap: 4px;
}

.progress-segment {
    width: 30px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.progress-segment.completed {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

.progress-segment.current {
    background: #00d9ff;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px #00d9ff; }
    50% { opacity: 0.6; box-shadow: 0 0 20px #00d9ff; }
}

#progress-text {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#instructions-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(13, 13, 26, 0.9);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 280px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#step-title {
    font-size: 14px;
    font-weight: 800;
    color: #00d9ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

#step-instruction {
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
}

#blueprint-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 220px;
    background: rgba(13, 13, 26, 0.9);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#blueprint-title {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #00d9ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

#blueprint-container {
    width: 100%;
    height: 160px;
}

#parts-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to top, rgba(13, 13, 26, 0.95), rgba(13, 13, 26, 0.8));
    border-top: 1px solid rgba(0, 217, 255, 0.3);
    z-index: 100;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

#parts-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 0;
    width: 100%;
    justify-content: center;
}

.part-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    min-width: 80px;
}

.part-item:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
}

.part-item.selected {
    background: rgba(0, 217, 255, 0.2);
    border-color: #00d9ff;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
}

.part-preview {
    width: 50px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.part-studs {
    font-size: 8px;
    color: rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.part-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #00d9ff;
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
}

.part-label {
    font-size: 10px;
    color: #888;
    text-align: center;
}

#controls {
    position: fixed;
    bottom: 160px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

#controls button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(13, 13, 26, 0.9);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: #888;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

#controls button:hover {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
    border-color: #00d9ff;
}

#controls button.active {
    background: #00d9ff;
    color: #000;
}

#completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#completion-modal.hidden {
    display: none;
}

#completion-content {
    text-align: center;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#completion-content h1 {
    font-size: 36px;
    color: #00ff88;
    margin-bottom: 16px;
    text-shadow: 0 0 30px #00ff88;
}

#completion-content p {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 24px;
}

#restart-btn {
    padding: 14px 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 8px;
    background: #00d9ff;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
}

#restart-btn:hover {
    background: #00ff88;
    transform: scale(1.05);
}

#footer {
    position: fixed;
    bottom: 150px;
    left: 20px;
    font-size: 11px;
    color: #444;
    z-index: 99;
}

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

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

/* Mobile adjustments */
@media (max-width: 768px) {
    #instructions-panel {
        top: auto;
        bottom: 150px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    #blueprint-panel {
        width: 150px;
        top: 70px;
        right: 10px;
    }
    
    #blueprint-container {
        height: 100px;
    }
    
    .progress-segment {
        width: 20px;
    }
    
    #parts-tray {
        height: 120px;
    }
    
    .part-item {
        min-width: 70px;
        padding: 8px;
    }
    
    #controls {
        bottom: 130px;
        right: 10px;
    }
    
    #controls button {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    #footer {
        display: none;
    }
}