* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: #0a0a0a;
  color: white;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ===== CANVAS ===== */
#gameCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 1;
}

/* ===== MENU ===== */
#menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 40% 30%, #1a3a0a 0%, #0a1a04 50%, #050505 100%);
  z-index: 100;
}

#menu.hidden {
  display: none;
}

.menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.game-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(3rem, 10vw, 6rem);
  background: linear-gradient(135deg, #ff4e00, #ffcc00, #39ff14, #ff4e00);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShift 3s ease infinite, bounce 1.8s ease-in-out infinite alternate;
  letter-spacing: 2px;
}

@keyframes titleShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes bounce {
  from { transform: translateY(0px);  filter: drop-shadow(0 0 12px #ffcc00aa); }
  to   { transform: translateY(-8px); filter: drop-shadow(0 0 30px #39ff14aa); }
}

.tagline {
  color: #aaddaa;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.8;
}

.hs-box {
  color: #ffd700;
  font-size: 1.2rem;
  font-family: 'Fredoka One', cursive;
  text-shadow: 0 0 10px #ffd70066;
}

.hint-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0.8rem 1.5rem;
  color: #99ddff;
  font-size: 0.9rem;
  line-height: 1.9;
  text-align: center;
  max-width: 340px;
}

#startBtn {
  padding: 0.9rem 3rem;
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #ff6b00, #ffcc00);
  color: #111;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 30px #ff6b0066, 0 0 60px #ffcc0033;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 1px;
  position: relative;
  z-index: 101;
}
#startBtn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 50px #ff6b0099, 0 0 80px #ffcc0055;
}

/* ===== GAME OVER ===== */
#gameOver {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
}

#gameOver.show {
  display: flex;
}

.go-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  box-shadow: 0 0 60px rgba(255,100,0,0.2);
}

.go-box h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 3rem;
  color: #ff5544;
  text-shadow: 0 0 20px #ff000077;
  animation: shake 0.4s ease 0s 2;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-10px); }
  75%       { transform: translateX(10px); }
}

.go-box p { font-size: 1.2rem; color: #eee; }
.go-box span {
  color: #ffd700;
  font-size: 1.5rem;
  font-family: 'Fredoka One', cursive;
}

#newRecord {
  color: #39ff14;
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  text-shadow: 0 0 15px #39ff1499;
  animation: pulse 0.8s ease-in-out infinite alternate;
  display: none;
}
#newRecord.show { display: block; }

@keyframes pulse {
  from { opacity: 0.6; transform: scale(0.97); }
  to   { opacity: 1;   transform: scale(1.03); }
}

#restartBtn {
  margin-top: 0.5rem;
  padding: 0.8rem 2.5rem;
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  color: #111;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 20px #ffd70044;
  transition: transform 0.15s;
}
#restartBtn:hover { transform: scale(1.08); }