
  /* ブラウザやスマホの設定で文字だけが勝手に拡大されないようにする（レイアウト崩れ防止） */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* 360x640 の縦長ステージを画面に合わせて拡大縮小。Canvas 2D に川原・石・鬼を描き、HUD とボタンは HTML。 */
  :root {
    --ink: #2b2a27;
    --paper: #f6f2e8;
    --red: #c8402e;
    --moss: #5f7a4a;
    --font-display: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Hiragino Sans", "Yu Gothic", serif;
    --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", system-ui, sans-serif;
    color-scheme: light;
  }
  [hidden] { display: none !important; }
  html, body { height: 100%; margin: 0; }
  body {
    background: #1f2422;
    color: var(--ink);
    font-family: var(--font-body);
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  /* 画面いっぱいの固定枠。中のステージが拡大されてもページ幅が広がらない（広がるとスマホでボタンが画面外に出る） */
  .wrap { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
  .stage { position: absolute; left: 50%; top: 50%; width: 360px; height: 640px; overflow: hidden; background: #cfd8d4; transform-origin: 50% 50%; }
  canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
  .top {
    position: absolute; top: 10px; left: 12px; z-index: 20;
    color: #fff; font-size: 13px; font-weight: 700; text-decoration: none;
    padding: 6px 11px; border-radius: 999px; background: rgba(31, 36, 34, 0.55);
  }
  .rot {
    position: absolute; bottom: 14px; z-index: 4;
    width: 66px; height: 66px; border-radius: 50%;
    border: 0; background: rgba(246, 242, 232, 0.85); color: var(--ink);
    font: 900 30px var(--font-body); line-height: 66px; padding: 0;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); cursor: pointer; touch-action: none;
  }
  .rot.on { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); background: #fff; }
  #rotL { left: 14px; }
  #rotR { right: 14px; }
  .top:focus-visible, .btn:focus-visible, .rot:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
  .result { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(31, 36, 34, 0.55); }
  .card {
    display: grid; gap: 6px; justify-items: center; width: 280px;
    padding: 16px 18px 14px; border-radius: 8px;
    background: var(--paper); text-align: center; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3);
  }
  .card .why { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--red); }
  .card .score { font-family: var(--font-display); font-weight: 900; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
  .card .score small { font-size: 20px; margin-left: 2px; }
  .card .sub { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .card .rank { font-family: var(--font-display); font-weight: 900; font-size: 16px; color: var(--moss); }
  .card .rec { font-weight: 900; font-size: 12px; background: #ffd23f; padding: 2px 12px; border-radius: 999px; }
  .card canvas { position: static; width: 244px; height: 170px; border-radius: 6px; }
  .btns { display: grid; gap: 8px; width: 100%; margin-top: 4px; }
  .btn {
    font: 800 16px var(--font-body); color: #fff; background: var(--red);
    border: 0; border-radius: 999px; padding: 11px 20px; box-shadow: 0 4px 0 #7d2418; cursor: pointer;
  }
  .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #7d2418; }
  .btn.share { background: #16120f; box-shadow: 0 4px 0 #000; font-size: 14px; }
  .btn.share:active { box-shadow: 0 1px 0 #000; }
  .card .note { font-size: 11px; font-weight: 700; color: var(--moss); min-height: 1em; }
  .card .hint { font-size: 11px; opacity: 0.6; }
  /* ---- 遊び方の説明。左上の ? で全画面に開き、× / Esc で閉じる。開いている間はゲームを止める ---- */
  .help {
    position: absolute; top: 10px; left: 90px; z-index: 20;
    width: 31px; height: 31px; padding: 0; border: 0; border-radius: 50%;
    color: #fff; font: 800 16px/31px system-ui, sans-serif; text-align: center; cursor: pointer;
    background: rgba(31, 36, 34, 0.55);
  }
  .help:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
  .guide {
    position: fixed; inset: 0; z-index: 1000;
    overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch;
    background: #F8F4E6; color: #5a4632;
    font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
    line-height: 1.8; line-break: strict;
    user-select: text; -webkit-user-select: text; -webkit-touch-callout: default;
  }
  .guide-close {
    position: fixed; top: 10px; left: 12px; z-index: 1001;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
    background: #5a4632; color: #fff; font: 700 22px/40px system-ui, sans-serif; text-align: center; cursor: pointer;
    box-shadow: 0 2px 6px rgba(90, 70, 50, 0.3);
  }
  .guide-close:focus-visible, .guide-back:focus-visible { outline: 3px solid #AFD4E4; outline-offset: 2px; }
  .guide-in { max-width: 720px; margin: 0 auto; padding: 64px 18px 40px; }
  .guide h2 { margin: 0 0 12px; font-size: 22px; font-weight: 900; line-height: 1.4; }
  .guide h2 span { background: linear-gradient(transparent 62%, #AFD4E4 62%, #AFD4E4 92%, transparent 92%); padding: 0 4px; }
  .guide h3 { margin: 24px 0 6px; font-size: 16px; font-weight: 800; }
  .guide p { margin: 0 0 10px; }
  .guide ul { margin: 0 0 10px; padding-left: 1.4em; }
  .guide li { margin-bottom: 4px; }
  .guide kbd { font: 700 12px/1 ui-monospace, Menlo, monospace; padding: 2px 6px; border: 1px solid #e8e0cb; border-bottom-width: 2px; border-radius: 5px; background: #fff; }
  .guide a { color: #3a7495; }
  .guide-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
  .guide-back {
    border: 0; border-radius: 999px; padding: 10px 24px; cursor: pointer;
    background: #5a4632; color: #fff; font: 700 15px "Hiragino Maru Gothic ProN", "Hiragino Sans", system-ui, sans-serif;
  }
  .guide-foot a { font-weight: 700; text-decoration: none; }

.app>.foot,#btnCdReport{display:none!important}body:not(.game-ready) :is(#btnStart,#btnGo,#bStart,[data-mode],#btnPick){visibility:hidden}html{overflow-x:hidden}button{overflow-wrap:break-word}.res-btns button{line-height:1.12}