/* 白い紙と黒い線。色は岩の灰（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 { 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; }

/* 遊ぶ画面（縦 530px でも岩と「できた」まで見える: 岩だけが縮む） */
#play { height: 100%; padding: 6px 12px 12px; display: flex; flex-direction: column; }
#hud { flex: none; display: flex; align-items: center; gap: 12px; min-height: 46px; }
#pref { flex: none; font-size: 26px; font-weight: 900; letter-spacing: .02em; }
#timer { flex: 1; 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; }
#stage { flex: 1 1 auto; min-height: 0; position: relative; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#hint { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0; text-align: center; font-size: 16px; font-weight: 800; pointer-events: none; }
#banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-3deg); margin: 0; padding: 6px 18px; border: 4px solid var(--ink); background: var(--paper); font-size: 40px; font-weight: 900; white-space: nowrap; pointer-events: none; }
#banner.red { border-color: var(--red); color: var(--red); }
#bar { flex: none; }
#bar .btn { margin-top: 6px; }
#bar .btn:disabled { opacity: .35; }

/* タイトル */
.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: min(100%, max(200px, calc(100dvh - 300px))); aspect-ratio: 1; margin: 0 auto; }
#title h1 { font-size: 50px; margin: 8px 0 0; font-weight: 900; letter-spacing: .04em; }
.catch { font-size: 20px; font-weight: 800; margin: 2px 0 14px; }
#title .btn.primary { font-size: 19px; min-height: 58px; }
.guide { margin-top: 14px; font-size: 13px; }

/* 結果 */
#result { padding: 14px 18px 30px; }
.kicker { margin: 0; text-align: center; font-size: 17px; font-weight: 900; letter-spacing: .08em; }
.ttl { margin: 0; text-align: center; font-size: 36px; font-weight: 900; line-height: 1.2; color: var(--red); }
.pct { margin: 0; text-align: center; font-size: 17px; font-weight: 800; }
.pct b { font-size: 34px; font-variant-numeric: tabular-nums; }
.shot { display: block; width: 100%; height: auto; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 10px; }
.shares { display: flex; gap: 8px; margin-top: 10px; }
.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 span { margin-left: auto; color: var(--red); white-space: nowrap; }
.rows li.ok span { color: var(--sub); }
.nums { margin: 8px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--sub); }

/* 自己ベストと図鑑 */
.pct em { margin-left: 8px; padding: 1px 7px; border: 2px solid var(--red); border-radius: 6px; color: var(--red); font-size: 13px; font-style: normal; font-weight: 900; vertical-align: 6px; }
.pct em.sub { border: 0; padding: 0; color: var(--sub); }
.zk { margin: 10px 0 0; text-align: center; }
.link { padding: 6px 12px; border: 0; background: none; font-size: 15px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#zukan { padding: 14px 14px 24px; }
.zk-head { margin: 0 0 10px; text-align: center; font-size: 20px; font-weight: 900; }
#z-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#z-list button { width: 100%; padding: 4px 2px 6px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#z-list li.got button { border-color: var(--ink); }
#z-list img, #z-list canvas { display: block; width: 100%; aspect-ratio: 1; }
#z-list b { font-size: 12px; font-weight: 800; }
#z-list small { font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; min-height: 1.3em; }
#z-list li.got small { color: var(--ink); }
