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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    touch-action: none;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.instructions {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
}

.instructions p {
    font-size: 0.9rem;
    color: #555;
    margin: 5px 0;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 15px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-item:active {
    transform: scale(0.95);
}

.color-box {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 3px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.color-item.selected .color-box {
    border-color: #667eea;
    border-width: 4px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    transform: scale(1.1);
}

.color-number {
    margin-top: 5px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

.canvas-container {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 3px solid #ddd;
    border-radius: 15px;
    margin-bottom: 20px;
    touch-action: none;
    width: 100%;
    height: 60vh;
    max-height: 600px;
}

#paintCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.progress {
    text-align: center;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
}

.progress span {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.celebrating {
    animation: celebrate 0.5s ease-in-out;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .color-box {
        width: 45px;
        height: 45px;
    }
    
    .color-number {
        font-size: 1rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}
