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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: #1d1b2f;
  color: #e2e2e2;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

header { text-align: center; }

h1 {
  font-size: 2rem;
  letter-spacing: 0.35em;
  color: #ff004d;
  text-shadow: 0 0 12px rgba(255, 0, 77, 0.6);
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.online { background: #00e436; box-shadow: 0 0 8px #00e436; }
.dot.offline { background: #ff004d; }

#user-count { opacity: 0.8; }

#mute-btn {
  background: none;
  border: 1px solid #33354d;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

#mute-btn:hover { border-color: #29adff; }

#cooldown {
  color: #00e436;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  border: 1px solid #33354d;
  border-radius: 6px;
  padding: 2px 8px;
}

#cooldown.waiting { color: #ffec27; }

#spectate-note {
  color: #ffa300;
  font-size: 0.8rem;
  border: 1px dashed #ffa300;
  border-radius: 6px;
  padding: 2px 8px;
}

.canvas-wrap {
  position: relative;
  width: min(90vmin, 640px);
  aspect-ratio: 1;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

#board {
  z-index: 1;
  border: 2px solid #29adff;
  box-shadow: 0 0 20px rgba(41, 173, 255, 0.25);
  background: #ffffff;
}

#ghost { z-index: 2; pointer-events: none; }

.hidden { display: none; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px;
}

#palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.swatch.active {
  outline: 2px solid #29adff;
  outline-offset: 2px;
  transform: scale(1.1);
}

.active-color {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

#active-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #e2e2e2;
  background: #ff004d;
}
