@font-face{font-family:Space;src:url('/space.woff2') format('woff2');font-weight:300 700;font-display:swap}
:root{font-family:Space,Helvetica,Arial,sans-serif;color:#111;background:#fff;font-synthesis:none}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;overscroll-behavior:none;background:#fff;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#board{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;display:block;touch-action:none;cursor:crosshair}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;border:0;background:transparent;cursor:pointer;touch-action:manipulation;min-width:44px;min-height:44px;border-radius:14px;display:grid;place-items:center}
button:focus-visible,a:focus-visible{outline:3px solid #2563eb;outline-offset:3px}
button:disabled{opacity:.28;cursor:default}
button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
[data-color="#111111"]{--ink:#111111}[data-color="#c6613f"]{--ink:#c6613f}[data-color="#f2b134"]{--ink:#f2b134}[data-color="#2563eb"]{--ink:#2563eb}
.swatch span{width:20px;height:20px;border-radius:50%;background:var(--ink)}
.swatch[aria-pressed=true] span{outline:2px solid var(--ink);outline-offset:4px}

#tools{position:fixed;z-index:2;display:flex;gap:2px;background:#ffffffe6;border-radius:18px;padding:4px;box-shadow:0 1px 12px #1111}
body:not(.phone) #tools{top:16px;left:16px}
.phone #tools{right:max(6px,env(safe-area-inset-right));top:50%;transform:translateY(-50%);flex-direction:column}

#mac{position:fixed;z-index:2;top:16px;right:16px;display:flex;gap:6px;transition:opacity .4s}
#mac button{padding:0 14px;font-size:14px;font-weight:600;background:#ffffffe6;box-shadow:0 1px 12px #1111}
#mac button[aria-pressed=false]{color:#8a857c}
.phone #mac{display:none}
body.idle:not(.phone) #mac,body.idle:not(.phone) #tools{opacity:0;pointer-events:none}
body.idle:not(.phone) #board{cursor:none}
#tools{transition:opacity .4s}

#status{position:fixed;z-index:3;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);background:#111;color:#fff;padding:8px 16px;border-radius:12px;font-size:14px;white-space:nowrap}
#notice{position:fixed;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);max-width:min(90vw,500px);padding:14px 22px;border-radius:16px;background:#111;color:#fff;font-size:14px;text-align:center;z-index:4}
dialog{border:0;border-radius:24px;padding:46px 34px 30px;width:min(420px,calc(100vw - 32px));text-align:center;background:#fff;color:#111;box-shadow:0 12px 70px #1112}
dialog::backdrop{background:#29251b70}
.close{position:absolute;right:10px;top:10px}
h2{font-size:26px;font-weight:700;letter-spacing:-1px;margin:0 0 14px}
dialog p{font-size:15px;line-height:1.5;margin:0}
#qr{display:block;margin:18px auto;width:228px;height:228px;max-width:100%}
#phone-link{color:#111;font-size:15px;font-weight:600;overflow-wrap:anywhere}
[hidden]{display:none!important}
@media(max-width:760px){body:not(.phone) #mac{top:auto;bottom:16px;left:16px;right:16px;flex-wrap:wrap;justify-content:center}}
#palette{position:fixed;z-index:2;left:max(14px,env(safe-area-inset-left));top:max(14px,env(safe-area-inset-top));width:46px;height:46px;border:1px solid #dcd8cf;background:#fcfaf5;color:#332f28}
body #tools,body.phone #tools{top:max(68px,calc(env(safe-area-inset-top) + 54px));left:max(14px,env(safe-area-inset-left));right:auto;transform:none;flex-direction:row;flex-wrap:wrap;width:204px;gap:5px;padding:10px;background:#fffef9;border:1px solid #e0dbd0;box-shadow:0 4px 16px #34291912}
body:not(.phone) #tools{top:max(68px,calc(env(safe-area-inset-top) + 54px));left:max(14px,env(safe-area-inset-left))}
#brushes{display:flex;width:100%;gap:4px}
#brushes button{font-size:15px;flex:1}
#brushes [aria-pressed=true]{background:#eae7df}
body.idle:not(.phone) #tools{opacity:1;pointer-events:auto}
.viewer #palette,.viewer #mac,.viewer #tools{display:none}
#class-form,#sharing{display:flex;gap:8px;justify-content:center}
#class-settings label{display:block;text-align:left;font-size:13px}
#class-form input{min-width:0;flex:1;border:1px solid #c9c3b7;border-radius:10px;padding:8px;font:inherit}
#class-form button,#sharing button{background:#eeeae1;padding:8px 12px;font-size:14px}
#sharing{margin-top:16px;flex-wrap:wrap}
#class-settings{margin:0 0 14px}
dialog{max-height:90dvh;overflow:auto}
#projection{width:100%;display:grid;grid-template-columns:1fr 1fr;border-top:1px solid #dfdace}
#projection button{font-size:13px}
#projection #full{grid-column:span 2}
.phone #projection{display:none}
body.idle:not(.phone) #mac{opacity:1;pointer-events:auto}
@media(max-width:760px){body:not(.phone) #mac{top:max(14px,env(safe-area-inset-top));right:14px;bottom:auto;left:auto}}
