/* 白い紙と黒い線。色はお題の色と、点の色（90〜 緑・70〜 黄・それより下 赤。card.js と同じ）だけ */
* { box-sizing: border-box; }
:root { --ink: #111; --sub: #6b6b6b; --paper: #fff; --line: #ddd; --g: #1e9e4a; --y: #d9a400; --r: #d0021b; }
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 のアプリ内ブラウザを、長押し中の指の上下で閉じさせない */
.title, .play { -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; min-height: 100dvh; background: var(--paper); position: relative; overflow-x: clip; }
button { font: inherit; color: inherit; }
.btn { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; 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; cursor: pointer; }
.btn small { font-weight: 600; font-size: 12px; opacity: .7; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:disabled { cursor: default; }
.btn.xpost { background: #0f1419; border-color: #0f1419; color: #fff; }
.btn.xpost svg { width: 18px; height: 18px; fill: #fff; }
.shares { display: flex; gap: 8px; margin-top: 16px; }
.shares .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 15px; }
.kicker { margin: 0; font-size: 14px; font-weight: 900; letter-spacing: .12em; }

/* タイトル */
.title { padding: 40px 24px 28px; text-align: center; }
.hero { display: flex; height: 150px; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
.hero i { flex: 1; }
.title h1 { font-size: 56px; margin: 22px 0 4px; font-weight: 900; letter-spacing: .04em; }
.catch { font-size: 22px; font-weight: 800; margin: 0 0 26px; }
.catch b { font-size: 26px; }
.title .btn.primary { font-size: 19px; min-height: 58px; }
.guide { margin-top: 14px; font-size: 13px; }

/* 遊ぶ画面（縦 530px でも主ボタンまで見える: 色見本だけが縮む） */
.play { height: 100dvh; min-height: 480px; padding: 10px 18px 16px; display: flex; flex-direction: column; }
.hud { display: flex; align-items: center; min-height: 32px; }
.dots { display: flex; gap: 6px; margin: 0 auto; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.dots i.now { border-color: var(--ink); }
.hud .sc { position: absolute; right: 18px; font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ask { margin: 6px 0 8px; text-align: center; font-size: 24px; font-weight: 900; }
.swatch { position: relative; flex: 1 1 auto; min-height: 120px; border: 3px solid var(--ink); border-radius: 16px; }
.ctl { flex: none; margin-top: 4px; }
.btn.gas { min-height: 76px; font-size: 22px; letter-spacing: .1em; flex-direction: column; touch-action: none; }
.btn.gas small { letter-spacing: 0; }
.btn.gas.on { background: #444; border-color: #444; }
.btn.gas:disabled { background: #bbb; border-color: #bbb; }

.dots i.g { background: var(--g); border-color: var(--g); }
.dots i.y { background: var(--y); border-color: var(--y); }
.dots i.r { background: var(--r); border-color: var(--r); }
.m.g { color: var(--g); } .m.y { color: var(--y); } .m.r { color: var(--r); }

/* 答え合わせ */
.ask .m { font-size: 34px; }
.ask small { font-size: 16px; margin: 0 10px 0 2px; }
.ask .dir { font-size: 18px; color: var(--sub); }
.pair { flex: 1 1 auto; min-height: 140px; display: flex; flex-direction: column; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; }
.pair div { flex: 1; display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 14px; }
.pair div + div { border-top: 3px solid var(--ink); }
.pair b { font-size: 15px; }
.pair code { font: 700 14px ui-monospace, "SF Mono", Menlo, Consolas, monospace; opacity: .85; }
.bar { flex: none; position: relative; height: 26px; margin: 14px 0 16px; border: 2.5px solid var(--ink); border-radius: 8px; }
.aim { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; background: var(--ink); }
.you { position: absolute; top: 100%; width: 0; height: 0; margin: 2px 0 0 -9px; border: 9px solid transparent; border-bottom: 12px solid var(--ink); border-top: 0; }

/* 結果 */
.result { padding: 28px 20px 30px; }
.result .kicker { text-align: center; }
.ttl { margin: 6px 0 0; text-align: center; font-size: 32px; font-weight: 900; }
.total { margin: 2px 0 16px; text-align: center; font-size: 18px; font-weight: 800; }
.total b { font-size: 44px; font-variant-numeric: tabular-nums; margin-right: 2px; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.rows li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows .chip { flex: none; width: 34px; height: 34px; border: 2.5px solid var(--ink); border-radius: 8px; }
.rows .chip + .chip { margin-left: -14px; }
.rows code { line-height: 1.35; font: 600 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--sub); }
.rows .dir { font-size: 13px; color: var(--sub); }
.rows b { margin-left: auto; font-size: 24px; font-weight: 900; }
.shot { display: block; width: 100%; height: auto; margin: 18px 0 0; border: 1px solid var(--line); border-radius: 10px; }

/* 挑戦状（?s=&p=） */
.title .kicker { margin-bottom: 10px; }
.hero.cards { gap: 8px; border: 0; border-radius: 0; }
.hero.cards i { display: flex; align-items: center; justify-content: center; border: 3px solid var(--ink); border-radius: 10px; background: #f2f2f2; font: 900 34px/1 system-ui, sans-serif; font-style: normal; color: #bbb; }
.hud .vs { position: absolute; left: 18px; font-size: 14px; font-weight: 800; color: var(--sub); font-variant-numeric: tabular-nums; }
.ask .rv { margin-left: 10px; font-size: 15px; color: var(--sub); }
.rows .rv { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--sub); }
.rows .rv + b { margin-left: 10px; }
.versus { margin: -8px 0 16px; text-align: center; font-size: 16px; font-weight: 800; }
.versus b { margin-left: 6px; font-size: 22px; }
.versus.win b { color: var(--g); }
.versus.lose b { color: var(--r); }

/* 言語（src/lang.js）。日本語のほかは、表を読み込むまで隠す */
html.lang-wait #app { visibility: hidden; }
.langsw { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; padding: 5px 10px; border: 1.5px solid var(--ink); border-radius: 99px; font-size: 13px; font-weight: 800; }
.langsw svg { width: 15px; height: 15px; }
.langsw select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
:lang(ko) body { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif; }
:lang(zh-Hans) body { font-family: "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
:lang(zh-Hant) body { font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif; }
:lang(en) body, :lang(es) body, :lang(pt) body, :lang(fr) body, :lang(de) body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
:lang(en) .ask, :lang(es) .ask, :lang(pt) .ask, :lang(fr) .ask, :lang(de) .ask { font-size: 21px; }
:lang(en) .ttl, :lang(es) .ttl, :lang(pt) .ttl, :lang(fr) .ttl, :lang(de) .ttl { font-size: 28px; }
