body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #030712;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at center, #0b1020 0%, #030712 70%);
  touch-action: none;
  cursor: crosshair;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.4); border-radius: 2px; }

.glass-panel {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.vortex-glow { box-shadow: 0 0 35px rgba(139, 92, 246, 0.35); }

/* Lobby */
.color-swatch {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 12px currentColor;
  transform: scale(1.1);
}

.tab-btn {
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  transition: all 0.2s ease;
}
.tab-btn:hover { background: #1e293b; }
.tab-btn.tab-on {
  background: #7c3aed;
  border-color: #a78bfa;
  color: #fff;
  box-shadow: 0 8px 20px rgba(46, 16, 101, 0.5);
}

.status {
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  min-height: 18px;
  color: rgba(216, 180, 254, 0.8);
}
.status.busy { color: #c4b5fd; animation: pulse 1.2s ease-in-out infinite; }
.status.err { color: #f87171; }

@keyframes pulse { 50% { opacity: 0.45; } }

/* Active power-up chips (stackable) */
.pw-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #fff;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--c);
  overflow: hidden;
}
.pw-chip i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--c);
  transition: width 0.25s linear;
}

/* Death overlay */
#deathOverlay { background: radial-gradient(circle, rgba(127, 29, 29, 0.35), rgba(3, 7, 18, 0.7)); }
.death-card { animation: deathIn 0.35s ease-out; }
@keyframes deathIn {
  from { opacity: 0; transform: scale(1.25); }
  to { opacity: 1; transform: scale(1); }
}

#minimap { border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  .death-card, .status.busy { animation: none; }
}