* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, sans-serif; background: #1a1a2e; overflow: hidden; }
.hidden { display: none !important; }

#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2d1b4e, #1a1a2e, #16213e);
}
.login-box {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px; padding: 32px;
  text-align: center; color: white;
  border: 1px solid rgba(255,255,255,0.2);
}
.login-box h1 { font-size: 1.8rem; margin-bottom: 4px; }
.login-box p { opacity: 0.7; margin-bottom: 20px; font-size: 0.9rem; }
#login-form { display: flex; flex-direction: column; gap: 10px; }
#login-form input {
  padding: 12px 16px; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; background: rgba(255,255,255,0.1);
  color: white; font-size: 1rem;
}
#login-form input::placeholder { color: rgba(255,255,255,0.5); }
#login-form input:focus { outline: none; border-color: #a78bfa; }
#login-form button {
  padding: 12px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white; font-size: 1rem; font-weight: 600; cursor: pointer;
  margin-top: 8px;
}
#login-form button:hover { transform: translateY(-1px); }
#error { color: #f87171; font-size: 0.85rem; min-height: 1em; }

#game-screen { position: fixed; inset: 0; }
#game-container { width: 100%; height: 100%; }
#game-container canvas { display: block; }

#ui { position: fixed; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 10; }
#players {
  background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
  border-radius: 8px; padding: 10px 14px; color: white; font-size: 0.85rem;
}
.player-entry { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.player-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
#logout {
  padding: 8px 14px; border: none; border-radius: 6px;
  background: rgba(255,255,255,0.1); color: white;
  font-size: 0.85rem; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
}
#logout:hover { background: rgba(255,255,255,0.2); }

#joystick {
  position: fixed; bottom: 24px; left: 24px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; z-index: 20;
}
#knob {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.05s;
}

#loading {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #1a1a2e; color: white;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (hover: hover) and (pointer: fine) {
  #joystick { display: none !important; }
}
