.x-game {
  --bg: #f2f2f2;
  --ink: #222;
  --accent: #e0e0e0;
  --accent-ink: #111;
  --field: #fff;
  --line: #999;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .x-game {
    --bg: #1b1b1b;
    --ink: #eee;
    --accent: #3a3a3a;
    --accent-ink: #eee;
    --field: #262626;
    --line: #666;
  }
}
* { box-sizing: border-box; }
.x-game { margin: 0; background: var(--bg); color: var(--ink); }
.x-game { font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans", sans-serif; }
#app { max-width: 480px; margin: 0 auto; padding: 8px 16px 24px; }
#cv { display: block; width: 100%; width: min(100%, calc((100vh - 60px) * 9 / 16)); width: min(100%, calc((100svh - 60px) * 9 / 16)); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#msg { min-height: 1.5em; margin: 10px 2px 0; font-weight: 700; }
body.rec #msg, body.rec .howto { display: none; }
body.rec #app { max-width: none; padding: 0; }
body.rec #cv { border-radius: 0; }
.howto { margin: 8px 2px 0; font-size: 15px; line-height: 1.7; opacity: .85; }
#app { position: relative; }
.modal { position: fixed; inset: 0; display: grid; place-items: end center; padding: 16px 16px 20px; background: linear-gradient(rgba(20, 20, 22, 0) 45%, rgba(20, 20, 22, .45)); z-index: 10; }
.modal[hidden] { display: none; }
.modal-box { width: min(100%, 360px); display: grid; gap: 8px; padding: 14px 16px 14px; background: var(--field); color: var(--ink); border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); text-align: center; }
.modal-label { margin: 0; font-size: 13px; letter-spacing: .1em; opacity: .7; }
.modal-main { margin: 0; font-size: 21px; font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }
.modal-sub { margin: 0; white-space: pre-line; font-size: 13px; font-weight: 700; opacity: .8; }
.modal-sub:empty { display: none; }
.modal-post { display: block; padding: 11px; border-radius: 4px; background: #111; color: #fff; font-weight: 900; font-size: 18px; text-decoration: none; }
.modal-post:focus-visible, .modal-again:focus-visible { outline: 3px solid #5d7d96; outline-offset: 2px; }
.modal-again { padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--ink); font-weight: 700; font-size: 16px; line-height: 1; font-family: inherit; cursor: pointer; }
body.rec .modal { display: none; }
.modal.guard .modal-post, .modal.guard .modal-again { pointer-events: none; opacity: .55; }
body.rec #cv { width: 100%; }
.replay-stop { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); z-index: 5; padding: 12px 18px; border: 0; border-radius: 999px; background: rgba(20, 20, 22, .78); color: #fff; font-weight: 700; font-size: 16px; line-height: 1; font-family: inherit; cursor: pointer; }
.replay-stop[hidden] { display: none; }
body.rec .replay-stop { display: none; }

.result-ok { position: absolute; left: 50%; transform: translate(-50%, -50%); min-width: 160px; min-height: 52px; padding: 0 28px; border: 1px solid var(--line); border-radius: 4px; background: #111; color: #fff; font-weight: 900; font-size: 20px; line-height: 1; font-family: inherit; cursor: pointer; z-index: 5; }
.result-ok[hidden] { display: none; }
body.rec .result-ok { display: none; }


.x-game { max-width: 480px; margin: 0 auto; }
body.rec .x-game { max-width: none; }
html, body { margin: 0; padding: 0; }
