/* タイピング練習 固有の見た目（共通は ../common/base.css） */
[hidden] { display: none !important; }
.hint { color: var(--ink-sub); font-size: 14px; margin: 6px 0 0; }
.status .sm { font-weight: 400; font-size: 15px; color: var(--ink-sub); margin-left: 4px; }
.status ruby rt { font-size: .55em; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; min-width: 72px; text-align: right; margin-left: auto; white-space: nowrap; }
.board-wrap { min-height: 220px; container-type: inline-size; }

/* ---------- お題のカード ---------- */
.card {
  position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px 10px; text-align: center; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tbar { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--line); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .2s linear; }
.touch-note { font-size: 15px; color: var(--ink); background: var(--accent-soft); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 10px; text-align: left; max-width: 560px; }
.touch-note ruby rt { font-size: .55em; }
.surface { font-size: clamp(24px, 6.4cqw, 38px); font-weight: 700; line-height: 1.35; letter-spacing: .03em; word-break: keep-all; overflow-wrap: anywhere; }
.surface .w, .surface .c { transition: color var(--dur); }
.surface .done { color: var(--ink-sub); opacity: .55; }
.surface .now { color: var(--ink); }
.kana { font-size: clamp(17px, 4.2cqw, 22px); color: var(--ink); line-height: 1.5; letter-spacing: .06em; }
.kana .done { color: var(--ok); }
.kana .pend { color: var(--accent); background: var(--accent-soft); }
.kana .now { box-shadow: inset 0 -3px 0 var(--accent); }
.roma {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Segoe UI Mono", Menlo, monospace; font-size: clamp(18px, 4.6cqw, 24px);
  letter-spacing: .04em; line-height: 1.5; min-height: 1.5em; overflow-wrap: anywhere; word-break: break-all; color: var(--ink-sub);
}
.roma .t { color: var(--ok); font-weight: 700; }
.roma .n { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.roma .r { color: var(--ink-sub); }
.roma .caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: -0.15em; margin-left: 1px; animation: blink 1s steps(1) infinite; }
.card.drill .surface { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: clamp(26px, 7cqw, 40px); letter-spacing: .08em; font-weight: 700; }
.card.drill .surface .done { color: var(--ok); opacity: 1; }
.card.drill .surface .now { box-shadow: inset 0 -4px 0 var(--accent); }
.nextline { margin: 6px 0 0; font-size: 15px; color: var(--ink-sub); min-height: 1.5em; }
.nextline .lb { display: inline-block; font-size: 14px; font-weight: 700; border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0 8px; margin-right: 8px; line-height: 1.5; }
.card.shake { animation: shake .25s ease-out; }
.card.pop .surface { animation: pop-in .2s ease-out; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } 100% { transform: none; } }
@keyframes pop-in { from { transform: translateY(4px); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------- キーボードの図 ---------- */
.kb-wrap { margin-top: 8px; }
.kb-note { margin: 0 0 2px; text-align: center; font-size: 15px; color: var(--ink-sub); min-height: 1.6em; }
.kb-note ruby rt { font-size: .55em; }
.kb-box { max-width: 640px; margin: 0 auto; }
.kb-box svg.play-kb { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.play-kb .kb-key.dim, .heat-kb .kb-key.dim { opacity: .45; }
.play-kb .kb-key.tap { cursor: pointer; }
.play-kb.narrow .kb-key.dim { display: none; }
.play-kb .kb-key.tap rect { fill: var(--surface); }
.play-kb .kb-key.tap text { fill: var(--ink); font-weight: 700; }
.play-kb .kb-key.on rect { fill: var(--accent); stroke: var(--accent); }
.play-kb .kb-key.on text { fill: var(--accent-ink); }
.play-kb .kb-key.ng rect { fill: var(--ng); stroke: var(--ng); }
.play-kb .kb-key.ng text { fill: var(--bg); }
.play-kb .kb-key.ok:not(.on) rect { fill: var(--accent-soft); }
.play-kb .bump, .heat-kb .bump { fill: var(--ink-sub); stroke: none; }
.play-kb .kb-key.on .bump { fill: var(--accent-ink); }

/* ---------- 結果 ---------- */
.result-box { position: static; margin: 0 auto; max-width: 600px; border-width: 2px; }
.result-box h2 { font-size: 1.3rem; }
.result-box h2 ruby rt, .result-box ruby rt { font-size: .5em; }
.result-box .big { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.result-box .big b { font-size: 2.2rem; color: var(--accent); font-variant-numeric: tabular-nums; margin: 0 2px; }
.result-box .big .acc { display: inline-block; font-size: 1.1rem; margin-left: 8px; }
.result-box .best { display: inline-block; margin-left: 8px; font-size: 14px; color: var(--ok); border: 1.5px solid var(--ok); border-radius: 999px; padding: 0 8px; vertical-align: middle; }
.stats dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.stats dl div { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; }
.stats dt { font-size: 14px; color: var(--ink-sub); }
.stats dd { margin: 0; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.heat-h { margin: 0 0 4px; font-size: 15px; }
.heat-h b { display: inline-block; min-width: 1.6em; border: 1.5px solid var(--ng); color: var(--ng); border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.heat svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto 8px; }
.heat-kb .kb-key rect { fill: var(--surface); }
.heat-kb .kb-key text { fill: var(--ink); }
.heat-kb .kb-key.h1 rect { fill: color-mix(in srgb, var(--warn) 22%, var(--surface)); stroke: var(--warn); }
.heat-kb .kb-key.h2 rect { fill: color-mix(in srgb, var(--ng) 40%, var(--surface)); stroke: var(--ng); }
.heat-kb .kb-key.h3 rect { fill: var(--ng); stroke: var(--ng); }
.heat-kb .kb-key.h3 text { fill: var(--bg); font-weight: 700; }
.result-box .note { text-align: left; font-size: 14px; }
.result-box .note b { color: var(--ng); }
.history .hh { margin: 4px 0 2px; font-size: 14px; color: var(--ink-sub); text-align: left; }
.history ol { list-style: none; padding: 0; margin: 0 0 8px; display: block; text-align: left; }
.history li { display: grid; grid-template-columns: 4em 4em 1fr; gap: 8px; font-size: 15px; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); }
.history li.cur { font-weight: 700; color: var(--accent); }
.callout { z-index: 5; top: 30%; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.stage > .setup-modal { background: none; }
kbd { font-family: inherit; font-weight: 700; border: 1.5px solid var(--line-strong); border-radius: 4px; padding: 0 6px; background: var(--surface); }

/* 端末のキーボード用の見えない入力欄 */
.dev-input { position: fixed; -webkit-appearance: none; appearance: none; opacity: 0; color: transparent; caret-color: transparent; background: transparent; border: 0; padding: 0; margin: 0; font-size: 16px; z-index: -1; pointer-events: none; outline: none; }
.dev-input::-webkit-search-cancel-button, .dev-input::-webkit-search-decoration { display: none; -webkit-appearance: none; } /* type=search（iPhone の連絡先の自動入力を出さない・要望No.87）*/
#softkb { display: inline-flex; align-items: center; gap: 4px; }
#softkb svg { flex: none; width: 20px; height: 20px; }
#softkb[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { #softkb { display: none; } }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .card { min-height: 170px; padding: 14px 8px 6px; }
  .stats dl { grid-template-columns: repeat(2, 1fr); }
  .controls .btn.icon { padding: 0 9px; }
  .result-box { padding: 16px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .roma .caret, .card.shake, .card.pop .surface { animation: none; }
  .tbar i { transition: none; }
}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 3; --tb-st-lines: 2; --tb-rt: 11px; --tb-st-rt: 11px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; } }
/* 上のバーの高さ ここまで */
