* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { display: grid; place-items: center; background: #efeee4; font: 16px system-ui, "Microsoft YaHei", sans-serif; }
#stage {
  position: relative;
  width: min(100vw, calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .67), 740px);
  height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  container-type: inline-size;
  color: #211e17;
}
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#timer {
  position: absolute; top: max(16px, 10.9%); left: 2.5%; pointer-events: none;
  font-size: clamp(17px, 5.05cqw, 37px); font-weight: 850; font-variant-numeric: tabular-nums;
  line-height: 1.15; letter-spacing: -.03em;
}
#timer.urgent { color: #ab2f20; }
footer {
  position: absolute; right: 4%; bottom: max(12px, 3%);
  display: flex; align-items: center; gap: 12px; font-size: 13px; color: #615747;
}
button {
  min-height: 44px; min-width: 58px; padding: 0 11px; touch-action: manipulation; cursor: pointer;
  border: 1px solid #c7bba2; border-radius: 9px; background: #fffdf2; color: #443729; font: inherit;
}
button:focus-visible { outline: 2px solid #856129; outline-offset: 3px; }
#result {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 14px; min-width: 145px; padding: 21px;
  border: 1px solid #cabd9e; border-radius: 15px; background: #fff9e9f2;
  box-shadow: 0 8px 34px #34271033;
}
#outcome { margin: 0; font-size: 22px; font-weight: 750; }
#continue { background: #fbe4a6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body.reference #stage { width: 100vw; max-width: none; }
body.reference #timer { top: 6.7%; left: 2.45%; font-size: 5.05cqw; }
body.reference footer { display: none; }
