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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.container {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#canvas-container {
    flex: 1;
    min-height: 600px;
    position: relative;
    background: #f0f0f0;
}

.controls {
    width: 280px;
    padding: 30px 20px;
    background: #f9f9f9;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    max-height: 600px;
}

.controls h1 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.btn {
    padding: 10px 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-active {
    background: #667eea;
    color: white;
}

.btn-active:hover {
    background: #764ba2;
    border-color: #764ba2;
}

.legend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.legend h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #555;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    #canvas-container {
        min-height: 500px;
    }

    .controls {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        max-height: none;
        padding: 20px;
    }

    .controls h1 {
        font-size: 18px;
    }

    .button-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 100px;
    }
}
