html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #f3e9d8;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink, #2a2733);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* no double-tap or pinch zoom anywhere on the page */
  touch-action: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#brand, #count {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  font-weight: 700;
  font-size: 15px;
  opacity: 0.55;
  pointer-events: none;
}
#brand { left: 16px; letter-spacing: 0.02em; }
#count { right: 16px; font-variant-numeric: tabular-nums; }

#hint {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(42, 39, 51, 0.78);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
#hint.show { opacity: 1; }
#hint .arrow { display: inline-block; animation: nudge 1.1s ease-in-out infinite; }

@keyframes nudge {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(-4px); }
}

#score {
  position: fixed;
  left: 50%;
  top: max(44px, calc(env(safe-area-inset-top) + 30px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
#score.show { opacity: 1; }
#score .num {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #ffd84d;
  -webkit-text-stroke: 2px #2a2733;
  paint-order: stroke fill;
}
#score .hang {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

#mute {
  position: fixed;
  right: 10px;
  top: max(40px, calc(env(safe-area-inset-top) + 26px));
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(42, 39, 51, 0.08);
  font-size: 20px;
  line-height: 40px;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#mute:focus-visible { outline: 2px solid #2a2733; }

#unlock {
  position: fixed;
  left: 16px;
  top: max(36px, calc(env(safe-area-inset-top) + 22px));
  font-size: 13px;
  font-weight: 700;
  opacity: 0.45;
  pointer-events: none;
}

#toast {
  position: fixed;
  left: 50%;
  top: max(160px, calc(env(safe-area-inset-top) + 146px));
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: #2a2733;
  color: #ffd84d;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
#toast.show { animation: toast 2.6s ease-out forwards; }

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -8px) scale(0.9); }
  10%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 0) scale(1); }
}
