/* タイピング練習の配置（色や見た目はサイト全体の base.css に合わせる） */
.ty-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.ty-nav a { font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); background: var(--surface); }
.ty-nav a[aria-current=page] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.ty-settings .row > .field { flex: 1 1 150px; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 12px 0 0; }
.ty-play { margin-top: 16px; outline: none; position: relative; }
.ty-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.ty-status { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.ty-status span { white-space: nowrap; }
.ty-play progress { width: 100%; height: 8px; margin: 6px 0; }
.ty-screen { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px; min-height: 170px; text-align: center; overflow-wrap: anywhere; }
.ty-screen.miss { animation: ty-shake .18s; border-color: var(--danger); }
@keyframes ty-shake { 0%,100% { transform: none; } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
.ty-disp { font-size: 24px; font-weight: 700; line-height: 1.5; }
.ty-kana { font-size: 16px; color: var(--muted); margin-top: 4px; }
.ty-roma { font-size: 20px; margin-top: 8px; letter-spacing: .03em; }
.ty-disp .done, .ty-kana .done, .ty-roma .done { color: var(--muted); opacity: .55; }
.ty-disp .cur, .ty-roma .cur { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.ty-next { margin-top: 10px; }
.ty-msg { margin-top: 8px; font-size: 15px; color: var(--muted); }
.ty-src { margin: 0 0 6px; }
.ty-mobile { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
@media (pointer: coarse) { .ty-mobile { position: static; opacity: 1; width: 100%; height: auto; pointer-events: auto; margin-top: 8px; } }
.ty-finger { min-height: 1.7em; text-align: center; }
body.ty-large .ty-disp { font-size: 32px; } body.ty-large .ty-roma { font-size: 26px; } body.ty-large .ty-kana { font-size: 20px; }
body.ty-xlarge .ty-disp { font-size: 42px; } body.ty-xlarge .ty-roma { font-size: 32px; } body.ty-xlarge .ty-kana { font-size: 24px; }
/* キーボード */
.ty-kb { margin-top: 8px; user-select: none; }
.ty-row { display: flex; gap: 4px; justify-content: center; margin-bottom: 4px; }
.ty-row.r1 { padding-left: 2%; } .ty-row.r2 { padding-left: 4%; } .ty-row.r3 { padding-left: 0; }
.ty-key { flex: 0 1 46px; min-width: 0; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14px; font-family: var(--mono); }
.ty-key.wide { flex-basis: 70px; font-size: 11px; }
.ty-key.space { flex-basis: 300px; font-size: 12px; }
.ty-key.home { box-shadow: inset 0 -3px 0 var(--muted); }
.ty-key.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 使う指ごとの印（キーの上の線の位置で分ける） */
.ty-key.f0, .ty-key.f7 { border-top: 3px solid #c9a227; } .ty-key.f1, .ty-key.f6 { border-top: 3px solid #4caf50; }
.ty-key.f2, .ty-key.f5 { border-top: 3px solid #2f8fd8; } .ty-key.f3, .ty-key.f4 { border-top: 3px solid #e0703a; } .ty-key.f8 { border-top: 3px solid #9b6dd6; }
.ty-heat .ty-key { border-top-width: 1px; border-top-color: var(--line); }
.ty-weak { margin: 0; padding-left: 1.4em; }
.ty-res canvas, #histChart { width: 100%; display: block; }
.ty-scroll { overflow-x: auto; }
.ty-roma-table td { text-align: center; border: 1px solid var(--line); padding: 4px 6px; font-size: 13px; line-height: 1.4; }
.ty-roma-table .ty-k { font-size: 18px; font-weight: 700; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--muted); }
@media (max-width: 600px) {
  .ty-key { height: 30px; font-size: 11px; border-radius: 4px; }
  .ty-row { gap: 2px; }
  .ty-disp { font-size: 20px; } .ty-roma { font-size: 16px; }
  body.ty-large .ty-disp { font-size: 24px; } body.ty-xlarge .ty-disp { font-size: 30px; }
}
@media print {
  .ty-settings, .ty-play, #histBox, .ty-nav { display: none !important; }
  body.ty-print-roma #result, body.ty-print-roma .content { display: none !important; }
  body.ty-print-roma #romaBox { display: block !important; border: none; }
}
