html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #f4efe5;
  color: #6b625a;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", "Noto Serif CJK JP", serif;
  -webkit-user-select: none;
  user-select: none;
}

#paper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#title, #count, #hint {
  color: #000;
  position: fixed;
  margin: 0;
  pointer-events: none;
  font-weight: 400;
  letter-spacing: 0.3em;
  opacity: 0;
  transition: opacity 2.5s ease;
}

#title {
  left: max(20px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  font-size: 13px;
}

#count {
  right: max(20px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  font-size: 11px;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

#hint {
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

body.ready #title, body.ready #count { opacity: 0.75; }
#hint.show { opacity: 0.95; }
body.nogl #hint { bottom: 50%; white-space: normal; text-align: center; }

@media (max-width: 560px) {
  #hint { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 26px); }
}

#tilt {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #6b625a55;
  border-radius: 22px;
  background: #f4efe5e6;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

#tilt:focus-visible { outline: 2px solid #6b625a; outline-offset: 3px; }
#tilt:disabled { opacity: 0.6; cursor: wait; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
