:root {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  color: #244c43;
  background: #dff3ed;
  font-synthesis: none;
  --text: #244c43;
  --surface: #fafffc;
  --rim: #b8d9cd;
  --base: #80afa0;
  --focus: #1e6554;
  --dock-space: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(ellipse at 50% 38%, #f5fff9 0, #e4f5ee 48%, #cfe9df 100%);
}
.playroom { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.playroom::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #7cafa0 1px, transparent 1.5px) 50% 50% / 2rem 2rem;
  opacity: .13;
  mask-image: linear-gradient(transparent 42%, #000 100%);
}
.playroom i { position: absolute; width: .5rem; height: .5rem; border-radius: 50%; background: #fff; opacity: .75; }
.playroom i:nth-child(1) { left: 12%; top: 19%; width: 1rem; height: 1rem; background: transparent; border: .25rem solid #fff; }
.playroom i:nth-child(2) { right: 18%; top: 12%; }
.playroom i:nth-child(3) { right: 9%; top: 40%; width: .75rem; height: .75rem; }
.playroom i:nth-child(4) { left: 7%; top: 61%; }
.playroom i:nth-child(5) { left: 28%; top: 9%; width: .375rem; height: .375rem; }
main { position: fixed; inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) var(--dock-space) env(safe-area-inset-left, 0px); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
canvas.is-pressing { cursor: grabbing; }
footer {
  position: fixed;
  z-index: 2;
  inset: auto 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
button {
  min-width: 7.5rem;
  min-height: 3.5rem;
  padding: .75rem 1.75rem;
  border: 2px solid var(--rim);
  border-radius: 2rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 .375rem 0 var(--base), 0 .625rem 1rem #507d6e14;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-indent: .12em;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  pointer-events: auto;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
@media (hover: hover) { button:hover:not(:disabled) { background: #edfff5; transform: translateY(-1px); } }
button:active:not(:disabled) { transform: translateY(.25rem); box-shadow: 0 .125rem 0 var(--base); }
button:disabled { opacity: .45; cursor: wait; }
button:focus-visible, canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 6px; }
canvas:focus-visible { outline-offset: -6px; }
#loading, #error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.loading-puffs { display: flex; gap: .5rem; padding: 1rem 1.5rem; background: #fafffcd9; border-radius: 2rem; }
.loading-puffs i { width: .75rem; height: .75rem; border-radius: 50%; background: #739d8e; animation: puff 1.2s ease-in-out infinite; }
.loading-puffs i:nth-child(2) { animation-delay: .15s; }
.loading-puffs i:nth-child(3) { animation-delay: .3s; }
#error { background: #e4f5eef0; color: var(--text); font-size: 1rem; line-height: 1.6; padding: 1.5rem; }
#error p { margin: .25rem 0; }
#error p:first-child { font-weight: 650; }
#debug { position: fixed; top: calc(.75rem + env(safe-area-inset-top, 0px)); left: .75rem; right: .75rem; pointer-events: none; font: .75rem/1.5 ui-monospace, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@keyframes puff { 0%, 75%, 100% { transform: translateY(0); opacity: .5; } 35% { transform: translateY(-.375rem); opacity: 1; } }
@media (max-height: 500px) {
  :root { --dock-space: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
  footer { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  button { min-height: 3rem; padding-block: .5rem; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } .loading-puffs i { animation: none; } }
