body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    margin: 0;
    padding: 10px;
}

h1 {
    margin-top: 0;
    text-align: center;
}

.controls {
    display: flex;
    flex-wrap: wrap; /* Allow controls to wrap on smaller screens */
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 780px; /* Match canvas max-width */
    box-sizing: border-box;
}

.controls label,
.controls button,
.controls input {
    font-size: 14px;
}

.controls input[type="color"] {
    width: 35px;
    height: 35px;
    border: none;
    padding: 0;
    cursor: pointer;
}

.controls input[type="range"] {
    cursor: pointer;
    max-width: 100px;
}

.controls button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.controls button:hover {
    background-color: #45a049;
}

#eraserBtn.active {
    background-color: #f44336;
}

#brushSizeValue {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

canvas {
    border: 2px solid #333;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    /* Make canvas responsive */
    max-width: 100%;
    height: auto;
}

/* Media query for smaller screens */
@media (max-width: 600px) {
    .controls {
        gap: 10px;
        padding: 10px;
    }

    .controls button {
        padding: 6px 10px;
    }
}
