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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 30px 20px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.toolbar {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.tool-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tool-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tool-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.color-btn.active {
    border-color: #333;
    border-width: 4px;
    transform: scale(1.1);
}

.size-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.size-control label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.size-control input {
    width: 120px;
    cursor: pointer;
}

.size-control span {
    font-weight: 600;
    color: #333;
    min-width: 25px;
    text-align: center;
}

canvas {
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
    height: auto;
}

.clear-btn {
    background: #FF3B30;
    color: white;
    border: none;
}

.clear-btn:hover {
    background: #e02e24;
}

.download-btn {
    background: #34C759;
    color: white;
    border: none;
}

.download-btn:hover {
    background: #2db04c;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .toolbar {
        padding: 15px;
        gap: 15px;
    }
    
    .tool-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .color-btn {
        width: 36px;
        height: 36px;
    }
    
    .size-control input {
        width: 100px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .toolbar {
        gap: 10px;
    }
    
    .tool-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .color-btn {
        width: 32px;
        height: 32px;
    }
}
