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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
}

#glcanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

/* Login Screen */
#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#login-screen.hidden {
  display: none;
}

#login-box {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  min-width: 320px;
}

#login-box h1 {
  font-size: 24px;
  margin-bottom: 24px;
  color: #e0e0ff;
}

#login-box input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #0d0d1a;
  color: #fff;
  font-size: 16px;
  outline: none;
}

#login-box input:focus {
  border-color: #6c63ff;
}

#login-box button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #6c63ff;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

#login-box button:hover {
  background: #5a52d5;
}

/* UI Overlay */
#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

#ui-overlay > * {
  pointer-events: auto;
}

/* User Info */
#user-info {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: #ccc;
}

#username-display {
  font-weight: bold;
  color: #fff;
}

/* Chat Panel */
#chat-panel {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 360px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px 8px 0 0;
  max-height: 240px;
  font-size: 13px;
  line-height: 1.5;
}

#chat-messages .msg {
  margin-bottom: 4px;
}

#chat-messages .msg .author {
  font-weight: bold;
  margin-right: 6px;
}

#chat-input {
  padding: 10px 14px;
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: rgba(10, 10, 30, 0.9);
  color: #fff;
  font-size: 14px;
  outline: none;
}

#chat-input:focus {
  border-color: #6c63ff;
}

/* Crosshair */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 5;
}
