@font-face { font-family: "Baloo 2"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/baloo-2-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/baloo-2-latin-800-normal.woff2") format("woff2"); }
:root {
  --cream: #fffdf3;
  --shadow: 0 1px 0 rgba(38, 68, 70, 0.55), 0 2px 4px rgba(38, 68, 70, 0.45), 0 0 18px rgba(38, 68, 70, 0.4);
  --font: "Baloo 2", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #a9c97f;
  font-family: var(--font); font-weight: 700;
  color: var(--cream); text-shadow: var(--shadow);
  user-select: none; -webkit-user-select: none;
  touch-action: none; overscroll-behavior: none;
}
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* score: plain number */
#hud {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none;
}
#score {
  display: flex; align-items: center; gap: 6px;
  font-size: 40px; font-weight: 800; line-height: 1.2;
  transition: transform 0.15s ease-out;
}
#score.pop { transform: scale(1.18); }
.duck-ico { width: 24px; height: 24px; flex: none; opacity: 0.95; filter: drop-shadow(0 2px 0 rgba(61, 74, 58, 0.25)); }
#score-num { min-width: 0.7em; text-align: center; font-variant-numeric: tabular-nums; }

/* mute: subtle translucent circle */
#mute {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255, 253, 243, 0.55); color: #4a5a48; text-shadow: none;
  display: grid; place-items: center; cursor: pointer; z-index: 5; padding: 0;
}
#mute:active { transform: scale(0.94); }
#mute.off { opacity: 0.6; }

/* overlays: upper part of the screen */
.overlay {
  position: fixed; left: 0; right: 0; top: 0;
  padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 20px 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; text-align: center;
  pointer-events: none; z-index: 3;
}
.overlay h1 {
  margin: 0; font-size: clamp(54px, 16vw, 92px); font-weight: 800; line-height: 1;
  letter-spacing: 0.01em; white-space: nowrap;
}
.overlay .sub { margin: 4px 0 0; font-size: 22px; font-weight: 800; line-height: 1.15; }
.overlay .big { font-size: clamp(64px, 18vw, 96px); font-weight: 800; line-height: 0.95; }
.overlay .best { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.15; }
.overlay .best:empty { display: none; }
.overlay .hint {
  margin: 14px 0 0; font-size: 20px; font-weight: 800;
  animation: breathe 2.4s ease-in-out infinite;
}
.overlay .hint2 { margin: 2px 0 0; font-size: 15px; font-weight: 800; opacity: 0.92; }
@keyframes breathe { 0%,100% { opacity: 0.82; } 50% { opacity: 1; } }
#over { padding-top: max(28px, calc(env(safe-area-inset-top) + 24px)); }
#over .hint { margin-top: 8px; }
/* title: minimal block, vertically centred (a touch above middle) */
#title {
  top: 0; bottom: 0; padding: 0 20px 8vh; justify-content: center;
}
#title::before {
  top: 50%; height: 360px; margin-top: -220px;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(38, 68, 70, 0.3), rgba(38, 68, 70, 0) 100%);
}
#title .sub { margin-top: 6px; font-size: 20px; font-weight: 600; }
#title .hint { margin-top: 26px; font-size: 24px; }
@media (max-height: 420px) {
  #title { padding: 0 20px 4vh; }
  #title .hint { margin-top: 12px; font-size: 20px; }
  .overlay { padding-top: 44px; }
  .overlay h1 { font-size: 48px; }
  .overlay .big { font-size: 64px; }
  .overlay .hint { margin-top: 8px; }
}

#stick {
  position: fixed; width: 96px; height: 96px; margin: -48px 0 0 -48px;
  border-radius: 50%; border: 2px solid rgba(255, 253, 243, 0.5);
  pointer-events: none; z-index: 2;
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; background: rgba(255, 253, 243, 0.6);
}

/* soft borderless darkening behind overlay text (no card) */
.overlay::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 330px; z-index: -1;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(38, 68, 70, 0.38), rgba(38, 68, 70, 0) 100%);
}
#over::before { height: 250px; }
