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

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #fdf3e7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game-wrap {
  position: fixed;
  inset: 0;
  touch-action: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* HUD — unobtrusive single row at top */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: #b0937b;
  pointer-events: none;
}

#hud-score {
  min-width: 60px;
  font-size: 20px;
  color: #8a715c;
}

#hud-lives {
  color: #ef8f9b;
  letter-spacing: 2px;
}

#hud-best {
  min-width: 60px;
  text-align: right;
  font-weight: 500;
  opacity: 0.7;
}

/* Overlay (start / game over) */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  background: rgba(253, 243, 231, 0.92);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

#overlay-face {
  font-size: 64px;
  line-height: 1;
}

#overlay h1 {
  font-size: 28px;
  font-weight: 700;
  color: #8a715c;
}

#overlay p {
  font-size: 15px;
  line-height: 1.5;
  color: #b0937b;
}

#overlay-button {
  margin-top: 6px;
  padding: 14px 44px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #ef8f9b;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

#overlay-button:active {
  background: #e57c8a;
}
