* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #e8e8e8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* no scrolling, zooming or text selection while playing on mobile */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: env(safe-area-inset-top);
}

canvas#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #15181d;
  border-top: 1px solid #2a2f37;
}

.group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.group.grow { flex: 1 1 110px; max-width: 280px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #242931;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: #2d333c; }
.btn.active { border-color: #4fc3f7; background: #1d3440; }

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.size {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.size span { min-width: 48px; }
.size input { flex: 1 1 0; width: 0; min-width: 60px; accent-color: #4fc3f7; }
