* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  background: radial-gradient(circle at top, #141a33 0%, #070b16 60%);
  color: #eef2ff;
  display: grid;
  place-items: center;
  min-height: 100vh;
}
.wrap { width: min(92vw, 460px); text-align: center; }
h1 { margin: 0 0 6px; font-size: 1.7rem; }
.hint { margin: 0 0 10px; color: #b9c3ff; font-size: .92rem; }
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 700;
}
#startBtn {
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: #7c3aed;
  color: white;
  font-weight: 700;
  cursor: pointer;
}
#startBtn:hover { filter: brightness(1.08); }
canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #2e3a68;
  background: linear-gradient(#0b1022, #111936);
  box-shadow: 0 10px 35px rgba(0,0,0,.4);
}
.touch { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.touch button {
  width: 80px;
  height: 44px;
  border: 1px solid #2e3a68;
  border-radius: 10px;
  background: #1a2450;
  color: #fff;
  font-size: 1.1rem;
}
.statusbar {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .92rem;
  color: #dbe4ff;
}
.leaderboard {
  margin-top: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid #2e3a68;
  border-radius: 12px;
  padding: 10px;
  text-align: left;
}
.leaderboard h2 { margin: 0 0 8px; font-size: 1rem; }
#scoreForm { display: flex; gap: 8px; margin-bottom: 8px; }
#playerName {
  flex: 1;
  border-radius: 8px;
  border: 1px solid #2e3a68;
  background: #0f1737;
  color: #fff;
  padding: 8px;
}
#scoreForm button {
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  padding: 8px 10px;
  cursor: pointer;
}
#leaderboardList {
  margin: 0;
  padding-left: 20px;
  max-height: 220px;
  overflow: auto;
}

@media (min-width: 900px) {
  .touch { display: none; }
}