/* Typing Race: three visible lines of words over an invisible input (so phones open a keyboard). */
.typing { width: min(100%, 760px); display: flex; flex-direction: column; gap: 12px; margin: 4px 0 8px; }
.typing-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.typing-seg { display: inline-flex; background: var(--chip); border: 1px solid var(--card-line); border-radius: 10px; padding: 2px; }
.typing-seg button { border: 0; background: transparent; color: var(--dim); font-family: var(--font); font-size: 14px; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.typing-seg button.on { background: var(--card); color: var(--text); }
.typing-area {
  position: relative; height: calc(3 * 1.6em + 32px); overflow: hidden; cursor: text;
  font-size: clamp(19px, 3.4vw, 25px); line-height: 1.6; padding: 16px 18px;
  background: var(--bg); border: 1px solid var(--card-line); border-radius: 12px;
}
.typing-area.focus { border-color: var(--card-hover-line); }
.typing-words { color: var(--faint); transition: transform .15s ease-out; word-break: keep-all; }
.typing-words .tw { display: inline-block; border-bottom: 2px solid transparent; }
.typing-words .tw.cur { border-bottom-color: var(--dashed); }
.typing-words .tw.wrong { border-bottom-color: color-mix(in srgb, var(--red) 55%, transparent); }
.typing-words .ok { color: var(--text); }
.typing-words .bad { color: var(--red); }
.typing-words .x { color: var(--red); opacity: .7; }
.typing-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; cursor: text; }
.typing-hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 13px; color: var(--faint); pointer-events: none; }
.typing-area.focus .typing-hint { display: none; }
.typing-result { text-align: center; padding: 18px 12px 22px; background: var(--bg); border: 1px solid var(--card-line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.typing-result[hidden] { display: none; }
.tr-big b { font-size: 64px; font-weight: 400; line-height: 1; }
.tr-big span { color: var(--dim); font-size: 20px; }
.tr-line { color: var(--dim); }
.tr-best { color: var(--text); }
.tr-again { color: var(--faint); font-size: 13px; margin: 6px 0 8px; }
kbd { font-family: var(--mono); font-size: 12px; background: var(--chip); border: 1px solid var(--card-line); border-radius: 5px; padding: 1px 5px; }
