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

body {
  background: #202124;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e8eaed;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#back-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  z-index: 20;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(95, 99, 104, 0.7);
  transition: background 0.2s;
  line-height: 1;
}

#back-btn:hover {
  background: #80868b;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: pointer;
}

#ui-overlay {
  position: fixed;
  top: 16px;
  right: 70px;
  z-index: 10;
  display: flex;
  gap: 20px;
}

#score-display,
#best-display {
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  font-variant-numeric: tabular-nums;
}

#best-display {
  color: #9aa0a6;
}

#start-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(20, 21, 23, 0.88);
  z-index: 30;
}

#start-screen.hidden {
  display: none;
}

#start-screen h1 {
  font-size: 48px;
  font-weight: 800;
  color: #ffb74d;
  margin-bottom: 12px;
  text-shadow: 0 3px 12px rgba(255,183,77,0.3);
}

#start-screen p {
  font-size: 16px;
  color: #9aa0a6;
  text-align: center;
  line-height: 1.7;
  margin-bottom: 24px;
}

#start-screen .hint {
  font-size: 13px;
  color: #5f6368;
  margin-top: 16px;
  margin-bottom: 0;
}

#start-btn {
  background: #ffb74d;
  border: none;
  padding: 16px 48px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

#start-btn:hover {
  background: #ffc977;
}

#start-btn:active {
  transform: scale(0.95);
}

/* Game over overlay */
#gameover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.gameover-box {
  background: #303134;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.gameover-box h2 {
  font-size: 28px;
  color: #ffb74d;
  margin-bottom: 8px;
}

.gameover-box p {
  font-size: 16px;
  color: #9aa0a6;
  margin-bottom: 20px;
  line-height: 1.7;
}

.gameover-box button {
  background: #ffb74d;
  border: none;
  padding: 12px 36px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.15s;
}

.gameover-box button:hover {
  background: #ffc977;
}
