* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  overflow: hidden;
  background: #77c6f2;
  font-family: "Segoe UI", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
}
#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}
#app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
  cursor: pointer;
}
#hud {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  color: #fff;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
}
#hud.hidden {
  display: none;
}
#score {
  margin-top: clamp(12px, 4vh, 40px);
  font-size: clamp(48px, 10vh, 96px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 3px rgba(30, 60, 20, 0.55);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(30, 60, 20, 0.35);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.overlay,
#fallback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  pointer-events: none;
  background: rgba(20, 30, 15, 0.45);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: clamp(20px, 4vh, 36px) clamp(24px, 6vw, 52px);
  text-align: center;
  max-width: min(90vw, 480px);
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.overlay.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.overlay h1 {
  font-size: clamp(28px, 5vh, 44px);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  text-transform: capitalize;
}
.overlay h1 span {
  color: #ffd447;
}
#gameover-screen h2 {
  font-size: clamp(26px, 4.5vh, 40px);
  font-weight: 800;
  color: #ff6b5e;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
#new-best {
  margin-top: 6px;
  font-weight: 700;
  color: #ffd447;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
#new-best.hidden {
  display: none;
}
.hint {
  margin-top: 14px;
  font-size: clamp(14px, 2.2vh, 17px);
  opacity: 0.92;
  text-transform: capitalize;
}
.sub {
  margin-top: 6px;
  font-size: clamp(12px, 1.8vh, 14px);
  opacity: 0.75;
}
.hint kbd {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 1px 8px;
  font-family: inherit;
  text-transform: none;
}
#fallback code {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  padding: 1px 6px;
}
.scores {
  display: flex;
  gap: clamp(24px, 8vw, 56px);
  justify-content: center;
  margin-top: 18px;
}
.scores > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scores .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.75;
}
.scores span:last-child {
  font-size: clamp(30px, 5vh, 46px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
#fallback {
  display: none;
  max-width: min(90vw, 520px);
}
#fallback.visible {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#fallback h2 {
  font-size: clamp(22px, 4vh, 32px);
  font-weight: 800;
  text-transform: capitalize;
}
#fallback p {
  margin-top: 14px;
  font-size: clamp(13px, 2vh, 15px);
  line-height: 1.5;
  opacity: 0.92;
}
#fallback strong {
  color: #ffd447;
}
