html,
body {
  height: 100%;
}
:root {
  color-scheme: light;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #425d4b;
  --muted: #657c62;
  --cream: #fff8e8;
  --leaf: #537b51;
  --line: #b0c7a0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 30%, #eff5e5, #d9e7cd);
  color: var(--ink);
  overflow: hidden;
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  transition:
    background 0.18s,
    transform 0.18s,
    opacity 0.18s;
}
button:focus-visible,
canvas:focus-visible {
  outline: 3px solid #4e7c57;
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:not(:disabled):active {
  transform: translateY(2px) scale(0.97);
}
button:hover:not(:disabled) {
  filter: brightness(1.04);
}
[hidden] {
  display: none !important;
}
#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 30px;
  background: #edf4df;
  z-index: 10;
  color: var(--leaf);
}
#boot button {
  padding: 15px 30px;
  border-radius: 16px;
  background: var(--leaf);
  color: #fff;
}
#host {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#stage {
  position: absolute;
  width: 720px;
  height: 1280px;
  transform-origin: center;
  background: #edf4df;
  overflow: hidden;
  box-shadow: 0 0 90px #607b5330;
}
canvas {
  position: absolute;
  inset: 0;
  width: 720px;
  height: 1280px;
  touch-action: none;
}
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#hud button {
  pointer-events: auto;
}
.top {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.plain {
  background: transparent;
  color: var(--ink);
  padding: 16px;
  font-size: 26px;
  min-height: 84px;
  min-width: 84px;
}
.plain svg {
  width: 30px;
  height: 30px;
  vertical-align: middle;
}
.top .plain {
  background: #fff8e8ed;
  border: 2px solid #c1d1b1;
  border-radius: 28px;
  box-shadow: 0 3px 0 #b3c6a5;
  min-height: 70px;
  min-width: 80px;
  padding: 14px;
}
.brand {
  font-size: 23px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #4c6e54;
  text-shadow: 0 2px #fff;
}
.scorebox {
  position: absolute;
  top: 96px;
  width: 160px;
  text-align: center;
  background: #fff9e6e8;
  border: 1px solid #c0d0b0;
  border-radius: 16px;
  padding: 5px 6px;
  box-shadow: 0 3px 8px #6b8c5910;
}
.scorebox.left {
  left: 68px;
}
.scorebox.right {
  right: 66px;
}
.label {
  display: block;
  color: var(--muted);
  font-size: 18px;
  letter-spacing: 1.5px;
}
.value {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ball-count {
  position: absolute;
  top: 135px;
  left: 310px;
  width: 100px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #526f50;
}
.round {
  position: absolute;
  top: 232px;
  left: 73px;
  font-size: 21px;
  color: var(--muted);
  letter-spacing: 1px;
}
.boost {
  position: absolute;
  top: 202px;
  right: 68px;
  min-height: 74px;
  min-width: 158px;
  padding: 12px 20px;
  color: #6b6741;
  background: linear-gradient(#fff9dd, #f5e5ac);
  border: 2px solid #dcc78e;
  border-radius: 25px;
  font-size: 25px;
  box-shadow: 0 3px 0 #c9b580;
}
.warning {
  position: absolute;
  top: 278px;
  right: 76px;
  color: #b25654;
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: 700;
}
.hint {
  position: absolute;
  top: 427px;
  left: 90px;
  right: 90px;
  text-align: center;
  font-size: 28px;
  color: #678369;
  line-height: 1.65;
  pointer-events: none;
}
.hint .gesture {
  font-size: 36px;
  color: #779877;
  display: block;
  margin-bottom: 15px;
}
.toolbar {
  position: absolute;
  top: 1010px;
  left: 65px;
  right: 65px;
  display: flex;
  gap: 14px;
}
.tool {
  flex: 1;
  border: 2px solid #cbb990;
  border-radius: 24px;
  min-height: 96px;
  background: linear-gradient(#fff9e9, #f5e8c9);
  box-shadow:
    0 5px 0 #bba57c,
    0 8px 13px #526a4819;
  color: #6a6048;
  font-size: 24px;
  padding: 10px 8px;
}
.tool .glyph {
  display: block;
  height: 32px;
  margin-bottom: 6px;
}
.glyph svg {
  width: 30px;
  height: 30px;
}
.glyph img {
  mix-blend-mode: multiply;
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
}
.tool.primary {
  color: #526e47;
  background: linear-gradient(#f4f9d8, #d9e5b4);
  border-color: #a7b789;
  box-shadow:
    0 5px 0 #94a577,
    0 8px 13px #526a4819;
}
.tool[aria-pressed="true"] {
  background: #a6c588;
  color: #284a30;
}
.footer {
  position: absolute;
  top: 1211px;
  left: 45px;
  right: 45px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #597253;
  font-size: 22px;
}
.footer .plain {
  padding: 10px;
  min-height: 44px;
  font-size: 22px;
  color: #526c4f;
}
.toast {
  position: absolute;
  top: 327px;
  left: 80px;
  right: 80px;
  font-size: 23px;
  text-align: center;
  background: #fff9eaf5;
  border: 2px solid #c3cdaa;
  border-radius: 18px;
  padding: 16px;
  line-height: 1.4;
  box-shadow: 0 8px 20px #5c734422;
}
.modal {
  position: absolute;
  inset: 0;
  background: #2f483761;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 62px;
  z-index: 3;
  backdrop-filter: blur(4px);
}
.panel {
  position: relative;
  width: 100%;
  border: 6px solid #a7bd8d;
  outline: 3px solid #f4f1dc;
  background: linear-gradient(145deg, #fffdf1, #faf0db);
  border-radius: 36px;
  padding: 36px;
  text-align: center;
  box-shadow:
    0 20px 60px #263f3845,
    inset 0 0 0 2px #fff;
}
.panel:before,
.panel:after {
  content: "";
  position: absolute;
  width: 35px;
  height: 20px;
  background: #88aa6d;
  border: 2px solid #779961;
  border-radius: 4px 28px 4px 28px;
  top: -10px;
  transform: rotate(-18deg);
}
.panel:before {
  left: 26px;
}
.panel:after {
  right: 26px;
  transform: rotate(108deg);
}
.panel h1 {
  font-size: 43px;
  line-height: 1.2;
  margin: 0 0 22px;
  color: #516d4e;
}
.panel p {
  font-size: 26px;
  line-height: 1.6;
  color: #68745a;
  margin: 0 0 24px;
  white-space: pre-line;
}
.panel .result {
  font-size: 76px;
  color: #987442;
  line-height: 1.15;
  font-weight: 700;
}
.panel button {
  display: block;
  width: 100%;
  margin-top: 16px;
  min-height: 78px;
  padding: 17px;
  border-radius: 22px;
  background: #ebe7cd;
  border: 1px solid #d2d1ac;
  color: #536847;
  font-size: 27px;
}
.panel button.accent {
  background: #537b51;
  color: #fffdf0;
  border-color: #446643;
  box-shadow: 0 4px 0 #385c38;
  font-weight: 700;
}
.panel button.subtle {
  background: transparent;
  color: #737967;
  border: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.tool {
  position: relative;
}
.tool-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  min-width: 22px;
  height: 22px;
  border-radius: 12px;
  background: #edf3d5;
  border: 1px solid #a8b88e;
  font-size: 15px;
  line-height: 20px;
  color: #4d6643;
}
