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

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 8px;
}

header p {
    color: #718096;
    font-size: 1.1rem;
}

.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.controls {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

label {
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

input[type="number"],
input[type="color"] {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="number"]:focus,
input[type="color"]:focus {
    outline: none;
    border-color: #000000;
}

input[type="color"] {
    height: 45px;
    cursor: pointer;
}

.btn-clear {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.btn-clear:hover {
    background-color: #dc2626;
}

.canvas-container {
    flex: 2;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#gridCanvas {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .control-group {
        flex: 1;
        min-width: 120px;
    }
    
    .btn-clear {
        flex-basis: 100%;
    }
}
