*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(243,199,104,0.08), transparent 40%),
    linear-gradient(180deg,#05060a,#0b0f18 55%,#05060a);
  color:#fff;
  min-height:100vh;
}

.game-page{
  width:min(1180px,94%);
  margin:0 auto;
  padding:28px 0 40px;
}

.top-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:24px;
  flex-wrap:wrap;
}

.top-bar h1{
  font-size:clamp(1.5rem,4vw,2.6rem);
  letter-spacing:.08em;
  color:#f3c768;
  text-transform:uppercase;
}

.back-btn{
  text-decoration:none;
  color:#111;
  background:linear-gradient(135deg,#f3c768,#ffd97a);
  padding:12px 18px;
  border-radius:999px;
  font-weight:800;
  transition:.25s ease;
}

.back-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 22px rgba(243,199,104,.22);
}

.game-shell{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(243,199,104,.18);
  border-radius:26px;
  padding:20px;
  box-shadow:0 20px 55px rgba(0,0,0,.35);
}

.hud{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-bottom:18px;
}

.hud-box{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
  border-radius:18px;
  padding:14px;
  text-align:center;
}

.hud-label{
  display:block;
  font-size:.78rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#c9c9c9;
  margin-bottom:6px;
}

.hud-box strong{
  font-size:1.35rem;
  color:#fff;
}

#hearts{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
}

#hearts img{
  width:28px;
  height:28px;
  object-fit:contain;
}

#gameCanvas{
  width:100%;
  height:auto;
  display:block;
  border-radius:22px;
  background:#0b1018;
  border:2px solid rgba(243,199,104,.18);
  box-shadow:
    inset 0 0 25px rgba(0,0,0,.45),
    0 18px 38px rgba(0,0,0,.35);
}

.game-controls{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:18px;
}

.game-controls button{
  border:none;
  cursor:pointer;
  padding:14px 26px;
  border-radius:999px;
  font-size:1rem;
  font-weight:900;
  letter-spacing:.04em;
  transition:.25s ease;
}

#startBtn{
  background:linear-gradient(135deg,#f3c768,#ffd97a);
  color:#111;
}

#restartBtn{
  background:rgba(255,255,255,.08);
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
}

.game-controls button:hover{
  transform:translateY(-2px);
}

.game-tip{
  text-align:center;
  margin-top:16px;
  color:#bdbdbd;
  font-size:.92rem;
}

@media (max-width:780px){

  .hud{
    grid-template-columns:1fr;
  }

  .top-bar{
    justify-content:center;
    text-align:center;
  }

  .game-controls button{
    width:100%;
  }

  .game-shell{
    padding:14px;
  }

}

.leaderboard-box{
  margin-top:28px;
  padding:22px;
  border-radius:22px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(243,199,104,.22);
  text-align:center;
}

.username-box{
  display:flex;
  justify-content:center;
  gap:10px;
  margin:16px auto;
  flex-wrap:wrap;
}

.username-box input{
  width:240px;
  padding:12px 14px;
  border-radius:999px;
  border:1px solid rgba(243,199,104,.25);
  background:rgba(0,0,0,.35);
  color:#fff;
  outline:none;
}

.username-box button{
  padding:12px 16px;
  border-radius:999px;
  border:none;
  background:linear-gradient(135deg,#f3c768,#ffd97a);
  color:#111;
  font-weight:900;
  cursor:pointer;
}

#leaderboardList{
  margin-top:14px;
  padding-left:0;
  list-style-position:inside;
}

#leaderboardList li{
  margin:8px 0;
  font-weight:800;
  color:#fff;
}
@media (max-width: 780px) {
  #gameCanvas {
    height: auto;
    max-width: 100%;
  }
}