*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Verdana, sans-serif;
}

body{
    background: linear-gradient(135deg,#0f172a,#1e3a8a);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
    color: white;
}

.container{
    width: 100%;
    max-width: 900px;
    text-align: center;
}

h1{
    margin-bottom: 10px;
}

p{
    margin-bottom: 25px;
    opacity: .9;
}

.toolbar{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

input[type="color"]{
    width: 60px;
    height: 50px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

button{
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    color: white;
    font-size: 15px;
    transition: .2s;
}

button:hover{
    transform: translateY(-2px);
}

#brushBtn{ background: #22c55e; }
#eraserBtn{ background: #ef4444; }
#clearBtn{ background: #f59e0b; }
#saveBtn{ background: #3b82f6; }

/* Fixed CSS to keep the canvas square and crisp on all screen resolutions */
#paintCanvas {
    width: min(90vw, 600px);
    height: min(90vw, 600px);
    background: white;
    border: 4px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    touch-action: none; /* Prevents mobile screen scrolling while drawing */
    image-rendering: pixelated; /* Keeps zoomed pixels sharp */
}

@media(max-width:700px){
    button{
        padding: 10px 14px;
        font-size: 14px;
    }
}
