/* 白い紙と黒い線。色はまな板・ご飯・手（draw.js）と、熱さとお手本から外れたときの赤だけ */
* { box-sizing: border-box; }
:root { --ink: #1a1a1a; --sub: #6b6b6b; --paper: #fff; --line: #ddd; --red: #d8392b; }
html, body { margin: 0; background: #f2f2f2; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
html { touch-action: manipulation; } /* ダブルタップで拡大しない（ピンチは viewport の user-scalable=no） */
html, body { overscroll-behavior: none; } /* X のアプリ内ブラウザを、寄せる指の上下で閉じさせない */
#play, #title { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus:not(:focus-visible) { outline: none; }
#app { max-width: 440px; margin: 0 auto; height: 100dvh; background: var(--paper); position: relative; overflow: hidden; }
button { font: inherit; color: inherit; }
.btn { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 0 6px; width: 100%; min-height: 52px; margin: 10px 0 0; padding: 10px 14px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 17px; text-align: center; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.xpost { background: #0f1419; border-color: #0f1419; color: #fff; }
.btn.xpost svg { width: 18px; height: 18px; fill: #fff; }

/* 遊ぶ画面 */
#play { height: 100%; padding: 6px 12px 12px; display: flex; flex-direction: column; }
#hud { flex: none; display: flex; align-items: center; gap: 10px; min-height: 60px; }
#model { flex: none; width: 56px; height: 56px; border: 2px solid var(--ink); border-radius: 10px; }
#hud-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#which { font-size: 20px; font-weight: 900; white-space: nowrap; }
#timer { height: 10px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
#timer i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; }
#score { flex: none; text-align: right; line-height: 1.1; }
#score small { display: block; font-size: 11px; font-weight: 800; color: var(--sub); }
#score b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
#stage { flex: 1 1 auto; min-height: 0; position: relative; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* 握り終わりの札（判子）: 上に「そこまで／できた」、真ん中に型、下におむすび度 */
#banner { position: absolute; left: 50%; top: 17%; width: max-content; max-width: 86%; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 22px 12px; border: 4px solid var(--ink); outline: 2px solid var(--ink); outline-offset: -10px; border-radius: 16px; background: var(--paper);
  text-align: center; pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg); animation: stamp .28s cubic-bezier(.2, 1.6, .4, 1) both; }
#banner[hidden] { display: none; }
#banner small { font-size: 14px; font-weight: 900; letter-spacing: .25em; color: var(--sub); }
#banner b { font-size: min(34px, 9vw); font-weight: 900; line-height: 1.15; }
#banner span { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
#banner.red { border-color: var(--red); outline-color: var(--red); color: var(--red); }
#banner.red small { color: var(--red); }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-4deg) scale(1.6); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-4deg) scale(1); opacity: 1; } }
#bar { flex: none; }
#bar .btn { margin-top: 6px; }
#bar .btn:disabled { opacity: .35; }

/* はじめての 1 回: 指が外からご飯へ寄る */
#hint { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
#hint[hidden] { display: none; }
#hint span { position: absolute; left: 0; top: 0; animation: yose 1.3s ease-in-out infinite; }
#hint i { position: absolute; width: 30px; height: 38px; margin: -19px -15px; border-radius: 50% 50% 46% 46%; border: 3px solid var(--ink); background: rgba(255,255,255,.9); }
#hint b { position: absolute; left: -62px; top: 120px; width: 124px; text-align: center; font-size: 20px; white-space: nowrap; -webkit-text-stroke: 5px #fff; paint-order: stroke; }
@keyframes yose { 0% { transform: translate(150px, 0); opacity: 0; } 20% { opacity: 1; } 70% { transform: translate(78px, 0); opacity: 1; } 100% { transform: translate(78px, 0); opacity: 0; } }

/* タイトル */
.panel { position: absolute; inset: 0; background: var(--paper); overflow-y: auto; overscroll-behavior: contain; }
#title { padding: 18px 20px 24px; text-align: center; }
#hero { display: block; width: 100%; aspect-ratio: 1.5; margin: 8px auto 0; }
#title h1 { font-size: 50px; margin: 8px 0 0; font-weight: 900; letter-spacing: .04em; }
.catch { font-size: 19px; font-weight: 800; margin: 2px 0 14px; }
#title .btn.primary { font-size: 19px; min-height: 58px; }
.guide { margin-top: 14px; font-size: 13px; }
/* 文言は文節で折る（docs/game-guidelines.md「文言」） */
.catch, #banner b, #r-row, #r-after { word-break: auto-phrase; text-wrap: pretty; }

/* 結果 */
#result { padding: 14px 18px 0; }
#result.wait { pointer-events: none; }
.shot { display: block; width: 100%; height: auto; margin: 4px 0 0; border: 1px solid var(--line); border-radius: 10px; }
/* 「Xでポスト」の行は結果の末尾に置き、いつも画面の下に固定する（コロモバナ・ネンリンと同じ） */
.shares { display: flex; gap: 8px; position: sticky; bottom: 0; z-index: 3; margin: 10px -18px 0; padding: 8px 18px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); box-shadow: 0 -8px 10px -8px rgba(26,26,26,.28); }
.shares .btn { flex: 1 1 0; min-width: 0; margin-top: 0; }
.rows { list-style: none; margin: 16px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.rows li { display: flex; align-items: baseline; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 800; }
.rows li em { font-style: normal; color: var(--red); }
.rows li.ok em { color: var(--ink); }
.rows li span { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
