html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); color: var(--fg, CanvasText);
  font-family: 'Geist', system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
canvas#board { position: fixed; inset: 0; width: 100vw; height: 100vh; touch-action: none; display: block; }

.dock {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: var(--surface-strong); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  max-width: calc(100vw - 32px); touch-action: none;
}
.group { display: flex; gap: 4px; }
.sep { width: 1px; height: 26px; background: var(--border); margin: 0 2px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--bg) inset; }
.tool {
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: inherit;
  font-size: 18px; cursor: pointer;
}
.tool.on { background: var(--accent-glow); color: var(--accent-text); }
#ask input {
  width: min(32vw, 300px); height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-1); color: inherit; padding: 0 12px; font: inherit; font-size: 15px; -webkit-user-select: text; user-select: text;
}
.status { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); margin: 0 4px; }
.status.live { background: oklch(0.75 0.17 150); box-shadow: 0 0 8px oklch(0.75 0.17 150); }

/* LOG lives on the canvas: positioned by JS in screen pixels */
.log { position: fixed; left: 0; top: 0; pointer-events: none; will-change: transform; z-index: 5; }
.log .body { display: block; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.3)); transition: transform 0.2s; }
.log.asleep .body { opacity: 0.45; filter: grayscale(1); }
.log .leg { transform-origin: 50% 82%; transform-box: fill-box; }
.log.walk .l1 { animation: step 0.28s infinite alternate ease-in-out; }
.log.walk .l2 { animation: step 0.28s infinite alternate-reverse ease-in-out; }
.log.walk .body { transform: rotate(-4deg); }
@keyframes step { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
.log .eye { transform-box: fill-box; transform-origin: center; }
.log.blink .eye { transform: scaleY(0.15); }
.log.think .face { animation: think 0.9s infinite ease-in-out; }
@keyframes think { 50% { transform: translateY(-3px); } }
.log.draw .pen { animation: pen 0.18s infinite alternate; }
@keyframes pen { to { transform: translate(2px, 2px); } }
.log .pen { opacity: 0; transition: opacity 0.2s; }
.log.draw .pen { opacity: 1; }

.bubble {
  position: absolute; left: 46px; bottom: 58px; max-width: 280px; width: max-content;
  padding: 8px 12px; border-radius: 14px 14px 14px 4px;
  background: var(--surface-strong); border: 1px solid var(--accent); color: inherit;
  font-size: 15px; line-height: 1.35; box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  opacity: 0; transform: translateY(6px) scale(0.96); transition: opacity 0.2s, transform 0.2s;
}
.bubble.show { opacity: 1; transform: none; }
.bubble.dots::after { content: '…'; animation: think 0.9s infinite; display: inline-block; }

.sheet {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  text-align: center; background: var(--bg); padding: 24px; z-index: 10;
}
.sheet.hidden { display: none; }
.sheet h1 { margin: 6px 0 0; font-size: 24px; font-weight: 600; }
.sheet p { max-width: 420px; color: var(--muted, inherit); opacity: 0.8; line-height: 1.5; margin: 0 0 10px; }
.sheet button { height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-1); color: inherit; font: inherit; }

@media (max-width: 600px) {
  #ask input { width: 30vw; }
  .tool { width: 32px; }
  .swatch { width: 22px; height: 22px; }
}
