:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --text-color: #333;
    --border-color: #ddd;
    --toolbar-bg: #fafafa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    width: 95%;
}

header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #222;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    background-color: var(--toolbar-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="color"] {
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: none;
}

select {
    padding: 0.3rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

button {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

button:hover {
    background-color: #eee;
}

button.primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

button.primary:hover {
    background-color: var(--primary-hover);
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-wrapper {
    background-color: white;
    border: 2px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    line-height: 0;
    cursor: crosshair;
    image-rendering: pixelated;
}

canvas {
    display: block;
    max-width: 100%;
    max-height: 70vh;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: #777;
}