* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0e1530;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#game {
  display: block;
  background: #2a3a6e;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: none;
}

#hud {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  pointer-events: none;
}

#score, #best {
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

#best {
  font-size: 14px;
  opacity: 0.85;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(14, 21, 48, 0.85);
  backdrop-filter: blur(6px);
  text-align: center;
  padding: 24px;
}

.screen.hidden {
  display: none;
}

.screen h1 {
  font-size: clamp(40px, 8vw, 72px);
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffe170 0%, #ff7a59 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.screen .hint {
  font-size: 16px;
  opacity: 0.85;
}

.screen .control {
  font-size: 15px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px 18px;
  border-radius: 12px;
}

.screen button {
  margin-top: 8px;
  padding: 14px 28px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(180deg, #ffd84d, #ff7a59);
  color: #1a1a2e;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.1s;
}

.screen button:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

#finalScore {
  font-size: 32px;
  font-weight: 700;
  color: #ffd84d;
}
