:root {
    --ink-1: #3b2f0f;
    --ink-2: #f2b705;
    --ink-3: #e2812b;
    --ink-4: #c8485c;
    --ink-5: #4f8a4a;
    --ink-6: #2f4a6b;
    --paper: #fffdf5;
}

.draw-board {
    width: 100%;
    max-width: 520px;
    min-width: 0;
    margin: 0 auto;
}

.draw-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--paper);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

#drawCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.draw-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    margin-top: 18px;
    padding: 12px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.draw-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.draw-swatch,
.draw-size,
.draw-tool {
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.draw-swatch {
    width: 36px;
    height: 36px;
    border: 2px solid var(--surface-raised);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border-strong);
}

.draw-swatch[data-ink="1"] { background: var(--ink-1); }
.draw-swatch[data-ink="2"] { background: var(--ink-2); }
.draw-swatch[data-ink="3"] { background: var(--ink-3); }
.draw-swatch[data-ink="4"] { background: var(--ink-4); }
.draw-swatch[data-ink="5"] { background: var(--ink-5); }
.draw-swatch[data-ink="6"] { background: var(--ink-6); }

.draw-swatch[aria-pressed="true"] {
    box-shadow: 0 0 0 3px var(--accent);
    transform: scale(1.1);
}

.draw-size {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
}

.draw-size span {
    display: block;
    border-radius: 50%;
    background: var(--text);
}

.draw-size[data-size="0"] span { width: 5px;  height: 5px; }
.draw-size[data-size="1"] span { width: 10px; height: 10px; }
.draw-size[data-size="2"] span { width: 18px; height: 18px; }

.draw-size[aria-pressed="true"] {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.draw-tool {
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
}

.draw-tool[aria-pressed="true"] {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
    color: var(--heading);
}

.draw-tool:disabled {
    opacity: 0.45;
    cursor: default;
}

.draw-swatch:focus-visible,
.draw-size:focus-visible,
.draw-tool:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.draw-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px;
    margin-bottom: 14px;
    font-family: var(--font-display);
    font-size: 17px;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
}

.draw-badge {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 22px;
    line-height: 1;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 50%;
}

.draw-badge[hidden],
.draw-done[hidden] {
    display: none;
}

.draw-board.is-locked #drawCanvas {
    cursor: not-allowed;
}

.draw-board.is-locked .draw-toolbar {
    opacity: 0.55;
}

.draw-note {
    min-height: 22px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--danger);
    text-align: center;
}

.draw-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

.draw-done {
    height: 40px;
    padding: 0 28px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.draw-done:hover:not(:disabled) { background: var(--accent-hover); }
.draw-done:active:not(:disabled) { transform: scale(0.97); }

.draw-done:disabled {
    opacity: 0.45;
    cursor: default;
}

.draw-done:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
