:root {
  color-scheme: dark;
  --bg: #111827;
  --panel: #1f2937;
  --panel-soft: #374151;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --ok: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0%, #0f172a 60%);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px;
}

#gridCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #111827;
  image-rendering: pixelated;
  cursor: crosshair;
  display: block;
  border: 1px solid rgba(51, 65, 85, 0.9);
}

.floating-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 40;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(4px);
  border-top: 1px solid #334155;
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.floating-bar h2 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.mood-palette,
.recent-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.color-btn:hover {
  transform: scale(1.08);
}

.color-btn.active {
  border-color: #f8fafc;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#customColor {
  border: none;
  background: transparent;
  width: 44px;
  height: 32px;
  padding: 0;
  cursor: pointer;
}

#currentColorText,
#selectedModeLabel,
#cooldownText,
#onlineCountText {
  color: var(--text);
  font-size: 13px;
}

.mode-btn {
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.mode-btn.active {
  border-color: #f8fafc;
  background: #334155;
}

.cooldown-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.cooldown-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22d3ee, var(--ok));
  transition: width 0.1s linear;
}

@media (max-width: 960px) {
  .floating-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .floating-bar {
    grid-template-columns: 1fr;
  }
}
