* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #1e2430;
  color: #111;
  font-family: "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

body {
  overflow: hidden;
  touch-action: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.canvas-frame {
  position: relative;
  width: min(100vw - 20px, calc((100vh - 20px) * 640 / 1136));
  max-width: 640px;
  aspect-ratio: 640 / 1136;
  background: #f8f1d8;
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.35);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.overlay-input {
  position: absolute;
  display: none;
  border: 2px solid #111827;
  border-radius: 6px;
  background: #fffdf5;
  color: #111827;
  font: 700 18px "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans JP", sans-serif;
  outline: none;
  padding: 8px 10px;
  text-align: center;
  text-transform: uppercase;
}

.overlay-input.is-visible {
  display: block;
}
