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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #333;
}

h1 {
    text-align: center;
    color: #ffffff;
    padding: 30px 0;
    background: #111;
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 30px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

label {
    font-weight: 600;
    color: #cccccc;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 255, 136, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 255, 136, 0.3);
}

select {
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 8px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

input[type="color"] {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #333;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#drawBtn {
    background: #00ff88;
    color: #000;
    font-weight: 700;
}

#drawBtn:hover {
    background: #00cc6a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 136, 0.4);
}

#clearBtn {
    background: #ff4444;
    color: white;
}

#clearBtn:hover {
    background: #cc0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.4);
}

#animateBtn {
    background: #00aaff;
    color: white;
}

#animateBtn:hover {
    background: #0088cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 170, 255, 0.4);
}

.canvas-container {
    display: flex;
    justify-content: center;
    padding: 30px;
    background: #1a1a1a;
}

#hilbertCanvas {
    border: 2px solid #333;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: #000000;
}

.info {
    padding: 20px 30px;
    background: #1e1e1e;
    color: #cccccc;
    font-size: 0.95em;
    line-height: 1.6;
}

.info p {
    margin-bottom: 10px;
}

#pointCount {
    font-weight: bold;
    color: #00ff88;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .buttons {
        margin-left: 0;
        justify-content: center;
    }
    
    #hilbertCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    h1 {
        font-size: 2em;
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 15px;
    }
    
    .controls, .canvas-container, .info {
        padding: 20px;
    }
}