.drawing-board__stage {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.drawing-board__canvas-wrapper {
    position: relative;
    width: 492px;
    max-width: 100%;
}

.drawing-board__stage canvas {
    border: 1px solid #d4d4d4;
    width: 490px;
    height: 490px;
    max-width: 100%;
    background: #ffffff;
    cursor: crosshair;
    touch-action: none;
}

.drawing-board__canvas-wrapper.has-result canvas {
    display: none;
}

.drawing-board__canvas-spinner {
    width: 492px;
    height: 492px;
}

@media (max-width: 620px) {
    .drawing-board__stage canvas {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .drawing-board__canvas-spinner {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
    }
}

.drawing-board__stage canvas.is-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.drawing-board__canvas-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drawing-board__canvas-wrapper.is-loading .drawing-board__canvas-spinner {
    opacity: 1;
}

.drawing-board__canvas-spinner-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 6px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000000;
    animation: drawing-board-spinner 0.7s linear infinite;
}

.drawing-board__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin-top: 12px;
}

.drawing-board__status-text {
    font-size: 14px;
    color: #4c4c4c;
}

.drawing-board__error-text {
    font-size: 20px;
    color: var(--white);
    margin-top: 0;
}

.drawing-board__result {
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawing-board__canvas-wrapper:not(.has-result) .drawing-board__result {
    display: none;
}

.drawing-board__result-image {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.drawing-board__stage a {
    color: white;
}

.drawing-board__stage a:hover,
.drawing-board__stage a:focus-visible {
    color: #ddd;
    text-decoration: underline;
}

.drawing-board__result-reset {
    font-size: 14px;    
    font-weight: 200;
}

.drawing-board__controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    width: calc(100% - 8px);
}

.drawing-board__group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drawing-board__colors {
    flex-direction: row;
    gap: 8px;
}

.drawing-board__color {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.drawing-board__color--black {
    background: #000000;
}

.drawing-board__color--white {
    background: #ffffff;
    border-color: #d0d0d0;
}

.drawing-board__color.is-active {
    border-color: #1c1c1c;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.drawing-board__color--white.is-active {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5);
}

.drawing-board__brush input[type="range"] {
    width: 200px;
}

@media (max-width: 620px) {
    .drawing-board__brush input[type="range"] {
        width: 100px;
    }
}

.drawing-board__history {
    flex-direction: row;
    gap: 12px;
}

.drawing-board__action {
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    background: #ffffff;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.drawing-board__action:hover,
.drawing-board__action:focus-visible {
    background: #f0f0f0;
    border-color: #9b9b9b;
}

.drawing-board__action:active {
    background: #e0e0e0;
}

@keyframes drawing-board-spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 570px) {
    .drawing-board__stage {
        flex-direction: column;
    }
}

.key-examples-popup {
    position: relative;
    background: #FFF;
    padding: 30px;
    width: auto;
    max-width: 650px;
    margin: 20px auto;
    color: black;
}

.key-examples-popup > p {
    margin-bottom: 20px;
}

.key-examples-popup img {
    width: 200px;
    border: 1px solid #ccc;
}

@media (max-width: 570px) {
    .key-examples-popup p {
        font-size: 16px;
    }

    .key-examples-popup img {
        width: 30%;
    }
}

a.open-key-examples-popup-link,
a.open-key-examples-popup-link:hover,
a.open-key-examples-popup-link:focus {
    text-decoration: none;
    border-bottom: 1px dashed white;
}

.drawing-board__process-text {
    margin-top: -12px;
    font-size: 14px;
}