
  /* ブラウザやスマホの設定で文字だけが勝手に拡大されないようにする（レイアウト崩れ防止） */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* 360x640 の縦長ステージを画面に合わせて拡大縮小。紙・和室は Canvas 2D、ボタンは HTML。 */
  :root {
    --sumi: #1b1916;
    --paper: #f3ecdc;
    --shu: #b8322a;
    --wood: #3a2a1e;
    --gold: #c9a758;
    --font-body: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Hiragino Sans", "Yu Gothic", "Meiryo", serif;
    --font-ui: "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: #17120e; color: var(--sumi); font-family: var(--font-ui);
    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: #2b2119; transform-origin: 50% 50%; }
  #cv { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
  .top {
    position: absolute; top: 10px; left: 12px; z-index: 50;
    color: #f3ecdc; font-size: 13px; font-weight: 700; text-decoration: none;
    padding: 6px 11px; border-radius: 999px; background: rgba(20, 16, 12, 0.6);
  }
  .top:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  .title { position: absolute; top: 12px; left: 0; right: 0; text-align: center; z-index: 2; pointer-events: none;
    font-family: var(--font-body); font-weight: 700; font-size: 19px; color: #f3ecdc; letter-spacing: 0.4em; }
  .done {
    position: absolute; top: 8px; right: 12px; z-index: 5;
    font: 800 14px var(--font-ui); color: #fff; background: var(--shu); border: 0; border-radius: 999px;
    padding: 7px 14px; box-shadow: 0 3px 0 #6e1a14; cursor: pointer;
  }
  .done:active { transform: translateY(2px); box-shadow: 0 1px 0 #6e1a14; }
  .hint {
    position: absolute; left: 50%; top: 250px; transform: translateX(-50%); z-index: 3; pointer-events: none;
    width: 250px; text-align: center; line-height: 1.6;
    background: rgba(27, 25, 22, 0.78); color: #f3ecdc; border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700;
    transition: opacity 0.5s;
  }
  .hint.off { opacity: 0; }
  .panel { position: absolute; left: 0; right: 0; bottom: 0; height: 128px; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 10px; }
  .pot { width: 92px; display: grid; justify-items: center; gap: 3px; color: #f3ecdc; font-size: 12px; font-weight: 700; }
  .pot canvas { width: 70px; height: 70px; display: block; }
  .pbtn {
    width: 80px; height: 64px; border: 0; border-radius: 14px; cursor: pointer; touch-action: manipulation;
    font: 800 14px var(--font-ui); line-height: 1.25; padding: 0;
    box-shadow: 0 4px 0 rgba(0,0,0,0.4);
  }
  .pbtn .k { display: block; font-size: 10px; font-weight: 700; opacity: 0.7; margin-top: 2px; }
  .pbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }
  .pbtn.ink { background: var(--sumi); color: #f3ecdc; box-shadow: 0 4px 0 #000; }
  .pbtn.water { background: #cfe0e6; color: #234; box-shadow: 0 4px 0 #7f9aa5; }
  .pbtn.clear { width: 52px; height: 40px; font-size: 11px; background: #5a4a3c; color: #f3ecdc; box-shadow: 0 3px 0 #241a12; align-self: flex-end; margin-bottom: 26px; }
  .pbtn.clear.arm { background: var(--shu); }

  /* 鑑定結果 */
  .result { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 30;
    background: rgba(250, 245, 233, 0.97); border-radius: 14px; padding: 12px 14px 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45); display: grid; gap: 7px; animation: up 0.5s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
  .result .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .result .lbl { font-size: 12px; font-weight: 800; color: #6b5a48; letter-spacing: 0.1em; }
  .result .rank { font-family: var(--font-body); font-size: 15px; font-weight: 700; color: var(--shu); white-space: nowrap; }
  .result .price { font-family: var(--font-body); font-weight: 700; font-size: 36px; line-height: 1.05; text-align: center; font-variant-numeric: tabular-nums; }
  .result .price small { font-size: 18px; margin-left: 2px; }
  .result .say { font-family: var(--font-body); font-size: 13.5px; line-height: 1.55; background: #efe5cf; border-radius: 10px; padding: 7px 10px; }
  .result .say b { display: block; font-family: var(--font-ui); font-size: 10.5px; color: #6b5a48; margin-bottom: 1px; }
  .bars { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .bar { display: grid; grid-template-columns: 44px 1fr 24px; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; }
  .bar .t { height: 7px; border-radius: 999px; background: #ddd0b4; overflow: hidden; }
  .bar .t { display: block; } .bar .f { display: block; height: 100%; background: var(--sumi); border-radius: 999px; }
  .bar .n { text-align: right; font-variant-numeric: tabular-nums; color: #6b5a48; }
  .best { font-size: 11px; color: #6b5a48; text-align: center; font-weight: 700; }
  .rbtns { display: flex; gap: 8px; }
  .rbtns button { flex: 1; height: 42px; border: 0; border-radius: 12px; font: 800 13px var(--font-ui); cursor: pointer; }
  .rbtns .share { background: var(--sumi); color: #fff; box-shadow: 0 3px 0 #000; }
  .rbtns .again { background: var(--shu); color: #fff; box-shadow: 0 3px 0 #6e1a14; }
  .rbtns button:active { transform: translateY(2px); box-shadow: none; }
  .note { font-size: 10.5px; color: #6b5a48; text-align: center; min-height: 0; }
  @media (prefers-reduced-motion: reduce) { .result { animation: none; } }
  /* ---- 遊び方の説明。左上の ? で全画面に開き、× / 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(20, 16, 12, 0.6);
  }
  .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}