
:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #101521; color: #edf2fa; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.maker { width: min(100%, 520px); margin: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
h1 { margin: 0; font-size: clamp(17px, 4.5vw, 21px); }
a { color: #b3dfff; }
#editor-grid { display: block; width: 100%; height: auto; aspect-ratio: 1; background: #182234; border: 1px solid #52677f; border-radius: 4px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
button { font: inherit; color: inherit; border: 1px solid #52677f; border-radius: 7px; background: #213149; cursor: pointer; min-height: 44px; touch-action: manipulation; }
button:focus-visible, canvas:focus-visible, a:focus-visible { outline: 2px solid #b3dfff; outline-offset: 2px; }
button:disabled { opacity: .4; cursor: default; }
.palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.palette button { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 7px 2px; font-size: clamp(11px, 3.2vw, 14px); }
.palette button[aria-pressed="true"] { background: #244a60; border-color: #82ebff; box-shadow: inset 0 0 0 1px #82ebff; }
.swatch { width: 25px; height: 25px; flex-shrink: 0; background-size: contain; background-position: center; background-repeat: no-repeat; }
.eraser { font-size: 24px; line-height: 1; }
.primary { width: 100%; margin: 8px 0 0; background: #8ce7f2; color: #102033; border-color: #8ce7f2; font-weight: 700; padding: 9px; }
#status { font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
#status:empty { display: none; }
#status[data-error="true"] { color: #ffb4be; }

#help { display: inline-flex; align-items: center; justify-content: flex-end; flex-shrink: 0; min-width: 44px; min-height: 32px; color: #afbdd0; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
#help[aria-disabled="true"] { color: #94a3b8; cursor: default; }

.header-links { display: flex; align-items: center; gap: 8px; }
#share-stage { padding: 4px 10px; min-height: 32px; font-size: 13px; }
#stage-share-dialog { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid #8dcde9; border-radius: 12px; padding: 18px; background: #182234; color: #edf2fa; text-align: center; }
#stage-share-dialog::backdrop { background: #0009; }
#stage-share-dialog h2 { font-size: 20px; margin: 0 0 10px; }
#stage-share-dialog p { font-size: 13px; line-height: 1.5; }
#stage-qr { display: block; width: min(100%, 300px); height: auto; margin: 12px auto; image-rendering: pixelated; }
#stage-share-dialog label { display: block; text-align: left; font-size: 12px; }
#stage-share-url { width: 100%; box-sizing: border-box; padding: 8px; font-size: 16px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.share-actions button, .share-actions a, #close-stage-share { padding: 10px 12px; min-height: 44px; font-size: 14px; }
.share-actions a { display: inline-flex; align-items: center; border: 1px solid #52677f; border-radius: 7px; background: #213149; text-decoration: none; }
