* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  color: #e8ecf4;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  background: #0b0e14;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#leaderboard {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 190px;
  background: rgba(15, 18, 28, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  backdrop-filter: blur(4px);
}
.lbTitle {
  font-size: 12px;
  letter-spacing: 1px;
  color: #9aa4b8;
  margin-bottom: 6px;
}
#lbList { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
#lbList li span.sc { float: right; color: #7fd3ff; }

#killFeed {
  position: absolute;
  top: 96px;
  right: 16px;
  width: 220px;
  text-align: right;
  font-size: 12.5px;
  color: #d7dce6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#killFeed div {
  background: rgba(15,18,28,0.6);
  border-radius: 6px;
  padding: 4px 8px;
  animation: fadeOut 4.5s forwards;
}
@keyframes fadeOut {
  0% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

#minimap {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(15, 18, 28, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}

#dashBtn {
  position: absolute;
  right: 26px;
  bottom: 26px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(79, 195, 247, 0.25);
  color: #eaf6ff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  display: none;
  touch-action: none;
}
body.touch #dashBtn { display: block; }

/* Media queries re-evaluate live on resize/rotation (no JS needed), so
   the leaderboard hides/shows immediately as the viewport crosses the
   breakpoint - e.g. rotating a phone, or resizing a desktop window down. */
@media (max-width: 820px) {
  #leaderboard { display: none; }
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #131826 0%, #06070b 100%);
  z-index: 10;
}
.overlay.hidden { display: none; }

.panel {
  text-align: center;
  padding: 28px 32px;
  max-width: 92vw;
}
.panel h1 {
  font-size: 44px;
  margin: 0 0 6px;
  letter-spacing: 1px;
  color: #eaf6ff;
}
.panel h1 span { color: #4fc3f7; }
.tagline { color: #9aa4b8; font-size: 14px; margin-bottom: 20px; }

#nameInput {
  display: block;
  margin: 0 auto 14px;
  width: 260px;
  max-width: 80vw;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #161b28;
  color: #fff;
  font-size: 15px;
  text-align: center;
}

button#playBtn, button#respawnBtn {
  padding: 12px 36px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #4fc3f7, #29e0a0);
  color: #08131a;
  cursor: pointer;
}

.hint {
  margin-top: 18px;
  font-size: 12px;
  color: #6d7688;
  line-height: 1.6;
}

#deathTitle { color: #ff6b6b; }
#deathBy { color: #b7c0d1; margin-top: -8px; }
#finalStats { margin: 14px 0 20px; color: #9aa4b8; font-size: 13px; }
