/* 見た目は紙に黒線。色は意味のあるところだけ（自分の返事の緑・失敗の赤・相手ごとの体の色）。影とグラデーションなし。
   文字 #1d1d1f・補助 #6b6f76・紙 #fffdf7・トーク #e9eef3・緑 #06c755・赤 #e0364d */
* { box-sizing: border-box; }
:root { --ink: #1d1d1f; --sub: #6b6f76; --paper: #fffdf7; --talk: #e9eef3; --green: #06c755; --red: #e0364d; }
html, body { margin: 0; overscroll-behavior: none; background: #ecebe4; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
#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; gap: 4px; width: 100%; min-height: 50px; margin: 10px 0 0; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 800; font-size: 16px; text-align: center; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--green); color: #fff; }
.btn.ghost { border-color: transparent; color: var(--sub); font-weight: 600; }
.btn.xpost { background: var(--ink); color: #fff; }
.btn.xpost svg { width: 18px; height: 18px; fill: #fff; }
.btn.xpost { flex-direction: column; gap: 0; line-height: 1.2; }
.btn.xpost span { display: flex; align-items: center; gap: 4px; }
.btn.xpost small { font-size: 11px; font-weight: 700; opacity: .85; }
.btn.xpost.big { min-height: 64px; margin-top: 14px; font-size: 20px; }
.btn.xpost.big svg { width: 22px; height: 22px; }
.btn.xpost.big small { font-size: 12px; }
.result.endless .rsub { font-size: 14px; color: var(--ink); font-weight: 800; }
.av { display: inline-flex; flex: none; width: 36px; height: 36px; }
.av svg { width: 100%; height: 100%; }

/* タイトル */
.title { padding: 36px 24px 32px; text-align: center; }
.tstage { display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 150px; }
.tbub { margin-bottom: 70px; }
.tbub .bub { font-size: 14px; }
.tbot { width: 120px; }
.title h1 { font-size: 52px; margin: 18px 0 4px; letter-spacing: .02em; font-weight: 900; }
.catch { font-size: 19px; font-weight: 800; margin: 0 0 18px; }
.title .btn.primary { margin-top: 22px; font-size: 18px; min-height: 56px; }
.best { color: var(--sub); font-size: 14px; margin: 12px 0 0; }
.guide { margin-top: 14px; font-size: 13px; }
.note { font-size: 11px; color: var(--sub); margin-top: 18px; }

/* プレイ */
.play { height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.top { flex: none; height: 112px; position: relative; display: flex; align-items: stretch; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.left { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.status { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.status b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lives i { font-style: normal; color: #d6d4cc; font-size: 17px; }
.lives i.on { color: var(--red); }
.pts { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--sub); }
/* その日の10通（色は結果、枠はいまの通） */
.pips { display: flex; align-items: center; gap: 4px; }
.pips i { width: 14px; height: 14px; border: 1.5px solid #c9c7bf; border-radius: 3px; flex: none; }
.pips i.cur { border: 2.5px solid var(--ink); }
.pips i.ok { background: var(--green); border-color: var(--ink); }
.pips i.suru { background: #3b82f6; border-color: var(--ink); }
.pips i.thru { background: var(--red); border-color: var(--ink); }
.pips i.nanaame { background: #f5c518; border-color: var(--ink); }
.pips i.kaeshi { background: #f28c28; border-color: var(--ink); }
.pips small { margin-left: 6px; font-size: 13px; font-weight: 800; color: var(--sub); white-space: nowrap; }
/* 制限時間: ゲージ（減っていく） */
.gauge { height: 22px; border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; background: #fff; }
.gauge i { display: block; height: 100%; width: 100%; background: var(--ink); }
.gauge.low i { background: var(--red); }
/* 制限時間: カラオケ（だるまさんがころんだ が左から塗られる） */
.karaoke { position: relative; height: 30px; border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; background: #fff; font-size: 17px; font-weight: 900; line-height: 25px; white-space: nowrap; }
.karaoke .kbase, .karaoke .kover > span { position: absolute; left: 0; top: 0; width: 240px; padding-left: 14px; letter-spacing: .06em; }
.karaoke .kbase { color: #b9b7af; }
.karaoke .kover { position: absolute; left: 0; top: 0; bottom: 0; width: 0; overflow: hidden; background: var(--ink); color: #fff; }
.karaoke.low .kover { background: var(--red); }
/* 制限時間: 字（初版） */
.chant { margin: 0; font-size: 23px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.chant span { color: #d6d4cc; }
.chant span.on { color: var(--ink); }
.chant.done span { color: var(--red); }
.bot { width: 92px; height: 96px; flex: none; align-self: flex-end; transform-origin: 50% 100%; }
.bot svg { width: 100%; height: 100%; display: block; }
.bot.spin { animation: spin var(--spin, 220ms) linear; }
@keyframes spin { 50% { transform: scaleX(.06); } }
.bot.fidget { animation: fidget .18s linear infinite; }
@keyframes fidget { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.pop { position: absolute; right: 112px; top: 8px; font-size: 18px; font-weight: 900; color: var(--green); animation: pop .9s ease-out forwards; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-6px); opacity: 0; } }
.banner { position: absolute; left: 8px; right: 8px; top: 6px; display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; transform: translateY(-130%); z-index: 6; pointer-events: none; }
.banner .av { width: 30px; height: 30px; }
.banner p { margin: 0; font-size: 14px; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.banner b { display: block; font-size: 12px; }
.banner.show { animation: banner 1.1s ease-out; }
@keyframes banner { 0% { transform: translateY(-130%); } 18%, 70% { transform: translateY(0); } 100% { transform: translateY(-130%); } }

.thead { flex: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; border-bottom: 1px solid #cfd3d8; }
.thead .back { font-size: 26px; line-height: 1; color: var(--sub); }
.thead b { font-size: 16px; }
.chat { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; padding: 12px 10px 16px; background: var(--talk); display: flex; flex-direction: column; gap: 8px; }
.chat > * { flex-shrink: 0; }
.msg { display: flex; gap: 6px; align-items: flex-end; animation: in .16s ease-out; }
.msg .av { align-self: flex-start; width: 34px; height: 34px; }
.msg .body { min-width: 0; max-width: 74%; }
.nm { display: block; font-size: 11px; color: var(--sub); margin: 0 0 2px 4px; }
.bub { margin: 0; padding: 8px 12px; background: #fff; border: 1.5px solid var(--ink); border-radius: 4px 18px 18px 18px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.tm { font-size: 10px; color: var(--sub); flex: none; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.me { display: flex; justify-content: flex-end; align-items: flex-end; gap: 6px; animation: in .16s ease-out; }
.me .bub { background: var(--green); color: #fff; border-color: var(--ink); border-radius: 18px 4px 18px 18px; font-weight: 700; }
.me .rd { font-size: 10px; color: var(--sub); text-align: right; line-height: 1.3; }
.mystamp { display: flex; flex-direction: column; align-items: center; padding: 4px 6px; }
.mystamp .e { font-size: 46px; line-height: 1.1; }
.mystamp .t { font-size: 12px; font-weight: 800; padding: 1px 8px; border: 1.5px solid var(--ink); border-radius: 99px; background: #fff; }
.me.small .mystamp .e { font-size: 26px; }
.me.small .mystamp .t { display: none; }

.reply { flex: none; min-height: 112px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--ink); display: flex; flex-direction: column; justify-content: center; }
.inputbar { height: 40px; border: 1.5px solid #cfd3d8; border-radius: 99px; display: flex; align-items: center; padding: 0 16px; color: #b5b9be; font-size: 15px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { flex: 1 1 30%; min-height: 52px; padding: 6px 10px; border: 2px solid var(--green); border-radius: 99px; background: #fff; color: #058a3c; font-weight: 800; font-size: 16px; cursor: pointer; }
.stamp { flex: 1 1 0; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; cursor: pointer; padding: 4px; position: relative; }
.stamp .e { font-size: 38px; line-height: 1.1; }
.stamp .t { font-size: 13px; font-weight: 800; }
.stamp.big { min-height: 92px; flex-direction: row; gap: 10px; }
.stamp.big .e { font-size: 46px; }
.stamp.big .t { font-size: 17px; }
.cnt { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--green); font-variant-numeric: tabular-nums; }
.opts button:disabled { opacity: .45; cursor: default; }
.opts button.sent { opacity: 1; background: var(--green); color: #fff; border-color: var(--ink); }
.opts .stamp:active:not(:disabled), .opts .chip:active:not(:disabled) { transform: scale(.96); }

.stampfx { position: absolute; left: 0; right: 100px; top: 30px; display: flex; justify-content: center; pointer-events: none; z-index: 5; }
.hanko { display: inline-block; padding: 4px 14px; border: 4px solid currentColor; border-radius: 10px; font-size: 30px; font-weight: 900; letter-spacing: .04em; background: #fffdf7ee; transform: rotate(-10deg); }
.stampfx .hanko { animation: hanko .9s ease-out forwards; }
.hanko.red { color: var(--red); }
.hanko.green { color: var(--green); }
@keyframes hanko { 0% { transform: rotate(-8deg) scale(1.8); opacity: 0; } 14% { transform: rotate(-8deg) scale(1); opacity: 1; } 100% { transform: rotate(-8deg); opacity: 1; } }
.stampfx .hanko { transform: rotate(-8deg); }
.play.miss .chat { animation: shake .35s; }
@keyframes shake { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

/* 結果（1画面目に 称号 → 今日の絵 → シェア → 次 が入るように詰める） */
.result { padding: 14px 16px 32px; text-align: center; }
.rtop { display: flex; align-items: center; gap: 10px; text-align: left; }
.rbot { width: 76px; flex: none; }
.rtext { min-width: 0; }
.rh { margin: 0; font-size: 13px; font-weight: 800; color: var(--sub); }
.ttl { margin: 2px 0 0; font-size: 28px; font-weight: 900; line-height: 1.2; }
.ttl small { font-size: 12px; color: var(--sub); margin-right: 6px; vertical-align: middle; }
.rsub { margin: 2px 0 0; font-size: 12px; font-weight: 700; color: var(--sub); }
.score { margin: 2px 0 0; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.score small { font-size: 13px; margin-left: 1px; }
.score .sub { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--sub); }
.sub b { color: var(--red); }
.sharebtns { display: flex; gap: 8px; margin-top: 8px; }
.sharebtns .btn { flex: 1; }
.rcard { display: block; width: 100%; height: auto; margin: 16px 0 0; border: 2px solid var(--ink); border-radius: 12px; }
.talk { margin-top: 18px; text-align: left; }
.talk h3 { font-size: 14px; margin: 0 0 6px; }
.talk ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid #cfd3d8; }
.talk li { display: flex; gap: 8px; align-items: center; padding: 7px 2px; border-bottom: 1px solid #cfd3d8; font-size: 13px; }
.talk .tt { width: 3em; color: var(--sub); font-variant-numeric: tabular-nums; flex: none; }
.talk .mk { flex: none; }
.talk b { flex: none; }
.talk .qq { color: var(--sub); }
.talk li { align-items: baseline; }

/* 画像のメッセージ（小さくて読めない。タップで拡大） */
.imgmsg { display: flex; flex-direction: column; gap: 3px; width: 210px; padding: 12px 14px; background: #fff; border: 1.5px solid var(--ink); border-radius: 8px; font-size: 15px; font-weight: 700; line-height: 1.35; text-align: left; cursor: zoom-in; }
.imgmsg b { font-size: 16px; border-bottom: 1.5px solid var(--ink); padding-bottom: 3px; margin-bottom: 3px; }
.over { display: none; }
.over.zoom, .over.call, .over.dayc, .over.draw { display: flex; position: absolute; left: 0; right: 0; top: 112px; bottom: 0; z-index: 7; align-items: center; justify-content: center; }
.over.zoom { background: #1d1d1fcc; cursor: zoom-out; }
.zimg { display: flex; flex-direction: column; gap: 8px; min-width: 240px; padding: 22px 26px; background: #fff; border: 3px solid var(--ink); border-radius: 10px; font-size: 24px; font-weight: 700; }
.zimg b { font-size: 26px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.over.call { background: var(--paper); }
.callbox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.av.big { width: 96px; height: 96px; }
.callbox b { font-size: 24px; margin-top: 6px; }
.callbox small { font-size: 14px; color: var(--sub); min-height: 1.2em; }
.cbtns { display: flex; gap: 48px; margin-top: 30px; }
.cbtn { width: 84px; height: 84px; border-radius: 50%; border: 2.5px solid var(--ink); color: #fff; font-weight: 900; font-size: 17px; cursor: pointer; }
.cbtn.no { background: var(--red); }
.cbtn.yes { background: var(--green); }
.over.dayc { background: var(--paper); }
.over.dayc p { margin: 0; display: flex; flex-direction: column; align-items: center; animation: in .3s ease-out; }
.over.dayc b { font-size: 44px; font-weight: 900; }
.over.dayc small { font-size: 18px; color: var(--sub); font-weight: 700; }
.sys { align-self: center; margin: 4px 0; padding: 3px 12px; background: #d3d9df; border-radius: 99px; font-size: 12px; color: #4a4f55; }
/* 写真を選ぶ */
.photo { flex: 1 1 0; min-height: 84px; display: flex; align-items: center; justify-content: center; gap: 2px; border: 2px solid var(--ink); border-radius: 10px; background: #f3f1ea; font-size: 28px; font-weight: 900; cursor: pointer; }
.myphoto { display: flex; align-items: center; justify-content: center; gap: 4px; width: 120px; height: 90px; border: 2px solid var(--ink); border-radius: 12px; background: #f3f1ea; font-size: 34px; font-weight: 900; }
/* 打つ */
.typed { display: flex; align-items: center; height: 38px; margin-bottom: 8px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 99px; font-size: 18px; font-weight: 800; }
.typed i { width: 2px; height: 20px; background: var(--green); margin-left: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.keys { gap: 6px; }
.key { flex: 1 1 18%; min-height: 46px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font-size: 20px; font-weight: 800; cursor: pointer; }
.key:disabled { opacity: .3; }
/* 結果 */
.rh .mode { display: inline-block; margin-right: 6px; padding: 1px 8px; border: 1.5px solid var(--ink); border-radius: 99px; color: var(--ink); font-size: 12px; }
.btn.next { flex-direction: column; gap: 0; line-height: 1.2; }
.btn.next small { font-size: 11px; font-weight: 700; opacity: .9; }
/* 下に続きがあるときの「↓」（LINE と同じ。押すといちばん下へ） */
.chatwrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.down { position: absolute; right: 12px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer; z-index: 3; display: none; }
.down.show { display: block; }
/* 描く（画用紙はトーク欄の上に開く） */
.over.draw { background: var(--talk); padding: 10px; touch-action: none; overscroll-behavior: none; }
.drawbox { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 360px; height: 100%; justify-content: center; }
.dq { display: flex; gap: 6px; align-items: center; align-self: stretch; max-width: 100%; }
.dq .av { width: 30px; height: 30px; flex: none; }
.dq .bub { margin: 0; font-weight: 700; }
.padwrap { position: relative; width: min(100%, calc(100dvh - 112px - 150px)); max-width: 340px; }
.dhow { position: absolute; left: 0; right: 0; top: 50%; margin: 0; transform: translateY(-50%); text-align: center; font-size: 15px; font-weight: 700; color: #a3a6ab; pointer-events: none; padding: 0 16px; }
.cq { margin: 14px 0 0; max-width: 260px; text-align: center; font-weight: 700; }
#pad { width: 100%; display: block; aspect-ratio: 1; height: auto; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; touch-action: none; cursor: crosshair; }
.dbtns { display: flex; gap: 8px; width: min(100%, 340px); }
.dbtns .btn { margin: 0; min-height: 46px; }
.dbtns .btn:first-child { flex: 0 0 34%; }
#dsend:not(.ready) { opacity: .45; }
#pad.more { animation: shake .35s; }
.mydraw { width: 132px; height: 132px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; display: block; }
/* 結果の「今日の絵」 */
.gallery { margin-top: 12px; text-align: left; }
.gallery h3 { font-size: 14px; margin: 0 0 8px; }
.gallery > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery figure { margin: 0; }
.gallery img { display: block; width: 100%; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.gallery figcaption { margin-top: 4px; font-size: 13px; font-weight: 800; }
.gallery figcaption small { display: block; font-size: 11px; font-weight: 600; color: var(--sub); }
.pic { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
/* 絵を大きく開く（この絵だけシェアはこの中だけ） */
.picview { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: #1d1d1fcc; }
.pvbox { width: min(100%, 420px); }
.pvbox img { display: block; width: 100%; height: auto; border: 2px solid var(--ink); border-radius: 14px; background: #fff; }
.pvbtns { display: flex; gap: 8px; }
.pvbtns .btn { flex: 1; }
/* 言語（2026-10-22）: タイトルの切り替え、言語ごとの字、単語で書く言語の折り返し */
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) .bub, :lang(es) .bub, :lang(pt) .bub, :lang(fr) .bub, :lang(de) .bub, :lang(ko) .bub { word-break: normal; overflow-wrap: anywhere; }
:lang(en) .title h1, :lang(es) .title h1, :lang(pt) .title h1, :lang(fr) .title h1, :lang(de) .title h1 { font-size: 40px; }
.ks-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--sub); }
.ks-row .sn-chip { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 12px; color: var(--ink); text-decoration: none; }
.ks-row .sn-chip small { font-size: 11px; color: var(--sub); }
