:root {
  background: #ffffff;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background: #ffffff;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

#board {
  display: block;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.toolbar {
  position: fixed;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
  transform: translateX(-50%);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.tool {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid #d7d7d7;
  border-radius: 999px;
  background: var(--tool-color, #ffffff);
  cursor: pointer;
  touch-action: manipulation;
}

.tool.active {
  border-color: #111111;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #111111;
}

.tool[data-color="#111111"] {
  --tool-color: #111111;
}

.tool[data-color="#d62828"] {
  --tool-color: #d62828;
}

.tool[data-color="#1d4ed8"] {
  --tool-color: #1d4ed8;
}

.tool[data-color="#15803d"] {
  --tool-color: #15803d;
}

.eraser {
  position: relative;
  border-radius: 8px;
  background: #ffffff;
}

.eraser::before {
  content: "";
  position: absolute;
  inset: 8px 7px;
  border: 2px solid #111111;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffffff 0 48%, #111111 49% 53%, #ffffff 54% 100%);
  transform: rotate(-18deg);
}
