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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0a0a12;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #eaeaf5;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #0a0a12;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 12, 0.82);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: min(360px, 90vw);
  background: #14141f;
  border: 1px solid #2a2a3d;
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.panel h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #7c7cff, #ff7cd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.tagline {
  color: #9a9ab0;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

#name-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a3d;
  background: #0e0e18;
  color: #eaeaf5;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
}

#name-input:focus {
  border-color: #7c7cff;
}

button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #7c7cff;
  color: #0a0a12;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button:hover:not(:disabled) {
  opacity: 0.88;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.conn-status {
  margin-top: 14px;
  font-size: 13px;
  color: #6a6a80;
}

#death-message {
  color: #9a9ab0;
  font-size: 14px;
  margin-bottom: 20px;
}

.hud {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.hud[hidden] {
  display: none;
}

.hud-top {
  background: rgba(20, 20, 31, 0.75);
  border: 1px solid #2a2a3d;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #9a9ab0;
}

.hud-top span {
  color: #eaeaf5;
  font-weight: 700;
}

.leaderboard {
  background: rgba(20, 20, 31, 0.75);
  border: 1px solid #2a2a3d;
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 160px;
}

.leaderboard h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a6a80;
  margin-bottom: 8px;
}

.leaderboard ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard li {
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.leaderboard li.me {
  color: #7c7cff;
  font-weight: 700;
}
