:root {
  --bg: #161618;
  --panel: rgba(36, 36, 40, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f2f2f4;
  --muted: #9a9aa2;
  --accent: #0a84ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#gifs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

#gifs img { position: absolute; }

#status {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-weight: 500;
  max-width: calc(100vw - 20px);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9f0a;
  flex: none;
}
.dot.live { background: #ff453a; box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.25); }
.dot.off { background: var(--muted); }

#people { color: var(--muted); white-space: nowrap; }

#name {
  border: 0;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

#tools {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  scrollbar-width: none;
}

#tools button {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
#tools button:hover { background: rgba(255, 255, 255, 0.08); }
#tools button.on { background: rgba(10, 132, 255, 0.28); color: #fff; }
#tools button:disabled { opacity: 0.35; cursor: default; background: transparent; }

#tools svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#tools .sep {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line);
}

#colours { display: flex; gap: 2px; }
#colours button { width: 30px; }
#colours i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
#colours button.on { background: transparent; }
#colours button.on i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

#size span {
  display: block;
  border-radius: 50%;
  background: currentColor;
}

#message {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}
#message[hidden] { display: none; }

#editor {
  position: fixed;
  z-index: 5;
  min-width: 80px;
  padding: 2px 4px;
  border: 1.5px dashed var(--accent);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  font: inherit;
  resize: none;
  outline: none;
  overflow: hidden;
}

@media (max-width: 520px) {
  #tools button { width: 34px; height: 34px; }
  #colours button { width: 24px; }
  #colours i { width: 16px; height: 16px; }
  #tools .sep { margin: 0 2px; }
}
