body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    touch-action: none;
    /* Prevents default touch behaviors */
}

.container {
    background-color: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5rem;
}

.tools {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-picker {
    padding: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.canvas-container {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto;
    touch-action: none;
}

#pixelCanvas {
    background-color: white;
    cursor: crosshair;
    max-width: 100%;
    touch-action: none;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    min-width: 60px;
    touch-action: manipulation;
}

button:hover {
    background-color: #2980b9;
}

.size-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

input[type="number"] {
    width: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.palette {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.palette-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.palette-color.selected {
    border-color: #2c3e50;
}

/* Media Queries for Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.2rem;
    }

    button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .color-picker {
        width: 35px;
        height: 35px;
    }

    .palette-color {
        width: 25px;
        height: 25px;
    }
}