/*
 * DTCDraw (public/js/draw/dtc-draw.js): the drawing surface, its toolbar and the text entry.
 * Colours are the score-keeper-v2 tokens only (public/css/score-keeper-v2/base.css). The
 * fallback values after each var() are those tokens' values, for a page outside the .sv2 shell.
 */
.dtc-draw {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.dtc-draw__stage {
    position: relative;
    width: 100%;
    line-height: 0;
}

.dtc-draw__canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--sv2-border, #2a2d3a);
    border-radius: 10px;
    background: var(--sv2-bg-card, #1a1d27);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.dtc-draw--readonly .dtc-draw__canvas {
    touch-action: auto;
}

.dtc-draw__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}

.dtc-draw__group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.dtc-draw__btn {
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid var(--sv2-border, #2a2d3a);
    border-radius: 8px;
    background: var(--sv2-bg-card, #1a1d27);
    color: var(--sv2-text, #e4e4e7);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.dtc-draw__btn[aria-pressed="true"] {
    border-color: var(--sv2-accent, #818cf8);
    box-shadow: inset 0 0 0 1px var(--sv2-accent, #818cf8);
}

.dtc-draw__btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.dtc-draw__btn:focus-visible,
.dtc-draw__swatch:focus-visible {
    outline: 2px solid var(--sv2-accent, #818cf8);
    outline-offset: 2px;
}

.dtc-draw__swatch {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 3px solid var(--sv2-bg-card, #1a1d27);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--sv2-border, #2a2d3a);
    cursor: pointer;
}

.dtc-draw__swatch--p1 { background: var(--sv2-p1, #06b6d4); }
.dtc-draw__swatch--p2 { background: var(--sv2-p2, #f97316); }
.dtc-draw__swatch--accent { background: var(--sv2-accent, #818cf8); }

.dtc-draw__swatch[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--sv2-text, #e4e4e7);
}

.dtc-draw__text {
    position: absolute;
    transform: translate(-50%, -50%);
    width: min(70%, 220px);
    min-height: 40px;
    padding: 6px 10px;
    border: 2px solid var(--sv2-accent, #818cf8);
    border-radius: 8px;
    background: var(--sv2-bg-card, #1a1d27);
    color: var(--sv2-text, #e4e4e7);
    font: inherit;
    font-size: 16px;
    line-height: 1.2;
    text-align: center;
}
