* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #e9edd7; }
body {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  display: grid;
  place-items: center;
  color: #243c32;
  font: 16px "Microsoft YaHei", "PingFang SC", sans-serif;
}
[hidden] { display: none !important; }
#stage {
  position: relative;
  width: min(100%, 56.25vh);
  width: min(100%, calc((100dvh - var(--safe-top) - var(--safe-bottom)) * .5625));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #f0f4dd;
  container-type: inline-size;
}
#board { display: block; width: 100%; height: 100%; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible { outline: max(2px, .55cqw) solid #9d4d29; outline-offset: -3px; }
.hit {
  position: absolute;
  padding: 0;
  color: transparent;
  background: transparent;
  border: 0;
  font-size: 2.8cqw;
}
.slot { border-radius: 50%; }
.quantity { left: 83.0556%; width: 16.8056%; height: 7.7%; border-radius: 1.7cqw; }
#one { top: 68.0%; }
#two { top: 75.735%; }
#actions {
  position: absolute;
  bottom: 4.4%;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 2.2cqw;
}
#actions button, #back {
  min-height: max(44px, 6.8cqw);
  min-width: 15cqw;
  border: 1px solid #7d987a;
  border-radius: 2cqw;
  padding: .5cqw 2.1cqw;
  background: #f3f5e5;
  color: #365342;
  font-size: max(12px, 2.6cqw);
}
#next { background: #d4f1d9 !important; }
#level-menu {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 3.6cqw;
  background: #eff3dc;
}
#level-menu h2 { margin: 0; font-size: 5.6cqw; }
#levels { display: grid; grid-template-columns: repeat(2, 38cqw); gap: 2.6cqw; }
.level {
  display: grid;
  overflow: hidden;
  padding: 0;
  border: 1px solid #8b9d7e;
  border-radius: 2.4cqw;
  background: #f6f6e8;
  color: #2e4c3b;
  font-size: 3.1cqw;
}
.level canvas { width: 100%; height: auto; }
.level span { padding: 1.5cqw 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


@media (max-width: 480px) {
  #actions { bottom: 2.6%; }
}
