* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0e1a; color: #fff; font-family: -apple-system, system-ui, sans-serif; touch-action: none; }
canvas#game { position: fixed; inset: 0; display: block; }

.overlay {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10, 14, 26, 0.85);
  z-index: 10;
  padding: 20px;
  text-align: center;
}
.overlay h1 { font-size: clamp(48px, 9vw, 96px); letter-spacing: 4px; margin-bottom: 8px; text-shadow: 0 0 30px #4d9bff; }
.overlay h2 { font-size: 48px; margin-bottom: 12px; }
.tagline { opacity: 0.8; margin-bottom: 30px; font-size: 18px; }
.footer { margin-top: 24px; opacity: 0.5; font-size: 13px; }

#name-input {
  font-size: 20px; padding: 14px 20px; border-radius: 10px; border: 2px solid #2a3550;
  background: #131a2e; color: #fff; outline: none; width: 280px; max-width: 90vw; margin-bottom: 16px;
  text-align: center;
}
#name-input:focus { border-color: #4d9bff; }
#play-btn {
  font-size: 24px; font-weight: 700; padding: 16px 56px; border-radius: 12px;
  border: none; background: #4d9bff; color: #fff; cursor: pointer; letter-spacing: 2px;
  box-shadow: 0 6px 20px rgba(77, 155, 255, 0.4);
}
#play-btn:hover { background: #6aaeff; }
#play-btn:active { transform: translateY(1px); }

.hidden { display: none !important; }

/* controls hint (title + in-game) */
.controls-hint {
  display: flex; gap: 16px; margin-top: 28px;
  font-size: 13px; opacity: 0.7;
}
.controls-hint > div { display: flex; align-items: center; gap: 6px; }
#controls-hud {
  position: absolute; bottom: 16px; left: 16px;
  display: flex; gap: 12px;
  font-size: 12px; opacity: 0.45;
  text-shadow: 0 2px 8px #000;
}
#controls-hud > div { display: flex; align-items: center; gap: 5px; }
kbd {
  font-family: ui-monospace, Menlo, monospace;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
}

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#status-top {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 18px; text-shadow: 0 2px 8px #000;
}
#round-timer { font-size: 28px; font-weight: 700; }
#held-powerup {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  font-size: 24px; font-weight: 900; letter-spacing: 2px;
  color: #ff5555; text-shadow: 0 0 20px #ff2020, 0 2px 8px #000;
  opacity: 0; pointer-events: none;
}
#held-powerup.active {
  opacity: 1;
  animation: pulse-held 1s ease-in-out infinite;
}
#held-powerup.heavy {
  color: #5588ff;
  text-shadow: 0 0 20px #3060ff, 0 2px 8px #000;
}
@keyframes pulse-held {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}
#centre-message {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  font-size: 96px; font-weight: 900; text-shadow: 0 0 30px #000, 0 4px 16px #000;
  opacity: 0; transition: opacity 0.2s;
}
#centre-message.show { opacity: 1; }

/* eliminated overlay */
#eliminated { background: rgba(10, 14, 26, 0.75); }
#elim-title { font-size: clamp(36px, 7vw, 72px); color: #ff4d4d; text-shadow: 0 0 30px #ff2020; margin-bottom: 8px; }
#elim-placement { font-size: 28px; opacity: 0.9; margin-bottom: 6px; }
#elim-best { font-size: 18px; opacity: 0.6; margin-bottom: 24px; }
#play-again-btn {
  font-size: 24px; font-weight: 700; padding: 16px 56px; border-radius: 12px;
  border: none; background: #4d9bff; color: #fff; cursor: pointer; letter-spacing: 2px;
  box-shadow: 0 6px 20px rgba(77, 155, 255, 0.4);
  pointer-events: auto;
}
#play-again-btn:hover { background: #6aaeff; }
#play-again-btn:active { transform: translateY(1px); }
.elim-hint { margin-top: 16px; opacity: 0.4; font-size: 14px; }

/* results overlay */
#results { background: rgba(10, 14, 26, 0.8); }
#results-title { font-size: clamp(36px, 7vw, 64px); margin-bottom: 8px; }
#results-sub { font-size: 22px; opacity: 0.8; }

/* round timer urgency */
#round-timer.urgent { color: #ff4d4d; animation: pulse-timer 0.5s ease-in-out infinite; }
@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
