/* ハングル間違い探し — A案「原稿用紙」 */
:root{
  --paper:#fbf7ee; --ink:#2b2622; --sub:#6b625a; --red:#b8453a; --line:#d9a192; --line2:#b85c4a;
  --ok:#2e7d4f; --ng:#c0392b; --btn:#b8453a; --btnink:#fff; --card:#fffdf8;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--paper);color:var(--ink)}
body{font-family:"Hiragino Sans","Yu Gothic","Meiryo",sans-serif;font-size:16px;line-height:1.7}
main{max-width:480px;margin:0 auto;padding:16px 16px 8px;min-height:70vh}
a{color:var(--red)}
.kr{font-family:"Nanum Myeongjo","Noto Serif KR",serif;font-weight:800}
.loading{text-align:center;padding:80px 0;color:var(--sub)}
h1{font-size:26px;line-height:1.35;margin:4px 0 2px;color:var(--red);letter-spacing:.02em}
.eyebrow{font-size:15px;color:var(--sub);margin:0}
.lead{font-size:16px;margin:10px 0}
.hero{display:flex;align-items:flex-end;gap:10px}
.hero img{width:110px;height:auto;flex:none}
.banner{border:1.5px solid var(--line2);background:var(--card);border-radius:10px;padding:10px 12px;margin:12px 0;font-size:15px}
.banner b{color:var(--red)}
.test{border-style:dashed}
.label{font-size:15px;color:var(--sub);margin:14px 0 6px}
.divs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.divs button{font:inherit;font-size:16px;padding:12px 4px;border:1.5px solid var(--line2);background:var(--card);color:var(--ink);border-radius:10px;cursor:pointer}
.divs button.on{background:var(--red);color:#fff;border-color:var(--red)}
.btn{display:block;width:100%;font:inherit;font-size:18px;font-weight:700;padding:14px;border:none;border-radius:12px;background:var(--btn);color:var(--btnink);margin:14px 0 0;cursor:pointer;text-align:center;text-decoration:none}
.btn.sub{background:var(--card);color:var(--red);border:1.5px solid var(--line2);font-weight:700}
.btn.x{background:#111;color:#fff}
.btn.line{background:#06C755;color:#fff}
.links{display:flex;justify-content:center;gap:18px;margin:14px 0 0;font-size:15px}
input[type=text]{font:inherit;font-size:16px;width:100%;padding:10px 12px;border:1.5px solid var(--line2);border-radius:10px;background:#fff}
.err{color:var(--ng);font-size:15px;margin:6px 0 0}

/* 出題 */
.qbar{display:flex;justify-content:space-between;align-items:center;font-size:16px;color:var(--red)}
.qbar img{width:44px;height:auto}
.timer{height:8px;background:#efe3d6;border-radius:4px;overflow:hidden;margin:6px 0 10px}
.timer i{display:block;height:100%;background:var(--red);transition:width .1s linear}
.ttl{font-size:20px;color:var(--red);margin:0 0 8px}
.sheet{display:grid;border:2px solid var(--line2);background:var(--card)}
.sheet button{aspect-ratio:1;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:transparent;color:var(--ink);padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.sheet button:active{background:#f6e8df}
.sheet button.hit{background:#e3f1e7;box-shadow:inset 0 0 0 3px var(--ok)}
.sheet button.miss{background:#fbe5e1;box-shadow:inset 0 0 0 3px var(--ng)}
.sheet button.odd{background:#fff4c7;box-shadow:inset 0 0 0 3px #d4a017}
.verdict{margin:12px 0 0;font-size:17px}
.verdict .big{font-size:22px;font-weight:700}
.verdict .ok{color:var(--ok)} .verdict .ng{color:var(--ng)}
.explain{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin:8px 0 0;font-size:16px}
.explain .pair{font-size:20px}

/* 結果 */
.res{text-align:center}
.stamp{width:210px;height:210px;border:6px solid var(--red);border-radius:50%;margin:10px auto 6px;color:var(--red);display:flex;flex-direction:column;align-items:center;justify-content:center;transform:rotate(-7deg);font-weight:700;background:rgba(255,255,255,.4)}
.stamp .t{font-size:44px;line-height:1.1}
.stamp .s{font-size:15px}
.rows{margin:12px 0 0;text-align:left}
.rows div{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:7px 2px;font-size:16px}
.resimg{width:120px;height:auto;display:block;margin:0 auto}
.vs{font-size:17px;margin:10px 0 0}
.note{font-size:15px;color:var(--sub)}

/* 順位表 */
.tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:10px 0}
.tabs button{font:inherit;font-size:15px;padding:8px 2px;border:1.5px solid var(--line2);background:var(--card);border-radius:8px;cursor:pointer}
.tabs button.on{background:var(--red);color:#fff;border-color:var(--red)}
table.rank{width:100%;border-collapse:collapse;font-size:16px}
table.rank td{border-bottom:1px solid var(--line);padding:7px 4px}
table.rank td.n{width:3.2em;color:var(--red);font-weight:700}
table.rank td.t{text-align:right;white-space:nowrap}
table.rank tr.me td{background:#fff4c7}

.foot{max-width:480px;margin:0 auto;padding:8px 16px 28px;font-size:15px;color:var(--sub);text-align:center}
.foot p{margin:4px 0}
.foot .small{font-size:14px}

/* 間違えたとき（同じ問題を続ける） */
.rule{font-size:15px;background:var(--card);border-left:4px solid var(--red);padding:6px 10px;margin:6px 0}
.penrow{display:flex;justify-content:space-between;align-items:center;min-height:24px;font-size:15px;color:var(--ng);margin:-4px 0 4px}
.flash{font-weight:700;font-size:18px;opacity:0}
.flash.show{animation:flash 1s ease-out}
@keyframes flash{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-10px)}}
.sheet button.miss{color:#c9b8ad}

/* 途中でやめる */
.qtop{display:flex;justify-content:flex-start;margin:-6px 0 2px}
.quit{font:inherit;font-size:14px;color:var(--sub);background:transparent;border:1px solid var(--line);border-radius:999px;padding:3px 12px;cursor:pointer}
.modal{position:fixed;inset:0;background:rgba(43,38,34,.45);display:flex;align-items:center;justify-content:center;padding:16px;z-index:10}
.mbox{background:var(--paper);border:2px solid var(--line2);border-radius:14px;padding:18px 16px;width:100%;max-width:360px}
.mbox .mt{font-size:19px;font-weight:700;color:var(--red);margin:0 0 4px}
.mbox .btn{margin-top:10px}

/* 遊び方・ルール */
.rules h2{font-size:18px;color:var(--red);margin:18px 0 4px;border-bottom:1px solid var(--line);padding-bottom:2px}
.rules ul{margin:0;padding-left:1.2em}
.rules li{margin:4px 0}
.links{flex-wrap:wrap}

/* 10問正解までのストップウォッチ（2026-09-29） */
.qtop{justify-content:space-between;align-items:center}
.qno{font-size:16px;color:var(--red);font-weight:700}
.clockrow{display:flex;align-items:center;gap:10px;margin:4px 0 8px;position:relative}
.clockrow img{width:48px;height:auto}
.clabel{display:block;font-size:13px;color:var(--sub);line-height:1.2}
.clock{font-size:30px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;line-height:1.2}
.clockrow .flash{position:absolute;right:0;top:10px;color:var(--ng)}
.btn.pass{font-size:16px;padding:10px;margin-top:12px}

/* マス目を画面に収める（2026-09-29）: 高さは app.js の fitSheet が決める */
.sheet button{aspect-ratio:auto}
.ttl{font-size:18px;margin:0 0 6px}
.clockrow{margin:2px 0 6px}
.clockrow img{width:40px}

/* 正解・間違いの表示は時計の横（「次へ」をスクロールなしで見せるため。2026-09-29） */
.vtop{margin-left:auto;text-align:right;font-weight:700;font-size:20px;line-height:1.25}
.vtop small{display:block;font-size:14px;font-weight:400;color:var(--sub)}
.vtop.ok{color:var(--ok)}
.vtop.ng{color:var(--ng)}

/* トミをフォローする（2026-09-29） */
.btn.follow{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;line-height:1.3}
.btn.follow .fimg{width:36px;height:auto}
.btn.follow small{display:block;width:100%;font-size:14px;font-weight:400;color:var(--sub)}
/* フォローボタンも他のボタンと同じ高さ（画像は字の高さに収める） */
.btn.follow{flex-wrap:nowrap;gap:6px;line-height:1.7}
.btn.follow .fimg{width:auto;height:1.5em;margin:-0.2em 0}
/* 「正解はここです」は正解のマスと同じ黄色で囲む（どこを指しているか分かるように。2026-09-30 山内さん） */
.vtop small.here{color:var(--ink);font-weight:700;background:#fff4c7;box-shadow:inset 0 0 0 2px #d4a017;border-radius:6px;padding:1px 8px;margin-top:2px}
/* 「はじめる」のあとのカウントダウン（2026-09-30） */
.count{text-align:center;font-size:120px;font-weight:800;color:var(--red);line-height:1;padding:28vh 0 0;animation:pop .8s ease-out}
.count.go{font-size:56px}
@keyframes pop{0%{transform:scale(1.4);opacity:0}30%{opacity:1}100%{transform:scale(1);opacity:1}}
