* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font: 600 clamp(14px,4vw,24px)/1.5 "Yu Gothic", Meiryo, sans-serif; color: #252638; }
main { position: relative; background: #f5f5fc; }
canvas, #inputs, #loading { position: absolute; inset: 0; width: 100%; height: 100%; }
#inputs button { position: absolute; padding: 0; border: 0; background: transparent; color: transparent; cursor: pointer; touch-action: manipulation; }
#inputs button:focus-visible { outline: 3px solid #fc3; outline-offset: -4px; }
#loading { display: grid; align-content: center; justify-items: center; background: #f5f5fc; }
#loading img { position: absolute; inset: 0; width: 100%; height: 100%; }
#sound-toggle {
  position: fixed; top: 6px; right: 6px; z-index: 1; width: 32px; height: 32px;
  display: grid; place-items: center; padding: 5px; border: 1px solid #686179; border-radius: 50%;
  background: #fff; color: #32294a; box-shadow: 0 1px 4px #0004; cursor: pointer;
}
#sound-toggle svg { display: block; width: 100%; height: 100%; }
#sound-toggle[aria-pressed="true"] .sound-cross, #sound-toggle[aria-pressed="false"] .sound-waves { display: none; }
#sound-toggle:focus-visible { outline: 3px solid #fc3; outline-offset: -3px; }
[hidden] { display: none !important; }
dialog {
  width: min(76%, 17em); margin: auto; padding: 1.35em 1.6em;
  border: 1px solid #d9d6e7; border-radius: 14px; background: #fff; color: #252638;
  box-shadow: 0 6px 24px rgb(20 16 43 / 20%); text-align: center; font: inherit;
}
dialog[open] { display: grid; justify-items: stretch; gap: .7em; }
dialog::backdrop { background: rgb(12 12 25 / 73%); }
body[data-game-folder="fire_rope"] dialog::backdrop { background: rgb(255 255 255 / 85%); }
dialog p { margin: 0 0 .25em; }
dialog a, #loading button {
  border-radius: 7px; padding: .55em 1.6em; border: 1px solid #5d52ae; background: #fff;
  color: #514891; text-decoration: none; font: inherit; cursor: pointer;
}
dialog a { background: #514891; color: white; }
dialog :focus-visible { outline: 3px solid #fc3; outline-offset: -4px; }
