html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; background: #9bcd4d; }
body {
  font-family: 'Rajdhani', sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

/* Game fills the entire screen; the navbar sits on top of it */
#wrap { position: fixed; inset: 0; z-index: 0; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* --hud-top is set from JS so the HUD always sits just below the navbar */
.hud {
  position: absolute;
  top: var(--hud-top, 90px);
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.score {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 12px rgba(0,0,0,.35);
}
.best {
  font-weight: 700;
  letter-spacing: .12em;
  font-size: .95rem;
  color: #fff;
  text-align: right;
  text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 10px rgba(0,0,0,.35);
}

#ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(12, 24, 12, .55);
  backdrop-filter: blur(3px);
  transition: opacity .4s;
  padding: var(--hud-top, 90px) 1rem 1rem;
  box-sizing: border-box;
}
#ui.hide { opacity: 0; pointer-events: none; }
#ui h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  margin: 0 0 .6rem;
  font-size: clamp(1.8rem, 8vw, 3rem);
  letter-spacing: .08em;
  background: linear-gradient(180deg, #fff 10%, #d9b8ff 50%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(168,85,247,.7));
}
#ui p { margin: .2rem 0; color: #e6f2dc; font-size: 1.05rem; letter-spacing: .04em; }
#ui .big { font-family: 'Orbitron', sans-serif; font-size: 2.4rem; color: #fff; margin: .4rem 0; }
#go {
  margin-top: 1.2rem;
  font: 700 1.1rem 'Rajdhani', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  padding: .7rem 2rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 0 20px rgba(124,58,237,.6);
}
#go:hover { transform: translateY(-2px); }

/* ---------- music control ---------- */
.music {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 24, 12, .55);
  backdrop-filter: blur(4px);
}
#mute { background: none; border: 0; padding: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: #fff; }
#vol { width: 110px; accent-color: #a855f7; cursor: pointer; }