/* Chinese Typing Speed Test — RT-FUN-083
   Widget styling. The form shell + ad/section styling come from the platform
   tool layout; this file scopes the ty-* components. BLUE theme (accent
   #1D4ED8). Loaded automatically by show.blade.php when present. */

.ty-form { display: flex; flex-direction: column; gap: 14px; }

.ty-helper {
  padding: 10px 14px; background: #eff6ff; border-left: 3px solid #1D4ED8;
  border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--rt-ink-muted); line-height: 1.5;
}

/* Sample passage display */
.ty-passage-wrap {
  padding: 16px 18px; background: var(--rt-surface-2);
  border: 1px solid var(--rt-hairline); border-radius: 8px;
}
.ty-passage-title {
  font-family: var(--rt-font-mono); font-size: 11px; color: var(--rt-ink-muted);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700; margin-bottom: 4px;
}
.ty-passage-hint { font-size: 12px; color: var(--rt-ink-muted); margin-bottom: 10px; line-height: 1.5; }
.ty-passage {
  font-family: var(--rt-font-sans); font-size: 19px; line-height: 1.9;
  color: var(--rt-ink); letter-spacing: .02em; word-break: break-all;
}
.ty-ch { border-radius: 2px; transition: background-color 80ms ease, color 80ms ease; }
.ty-ch.ty-correct { color: #16a34a; background: rgba(22,163,74,.10); }
.ty-ch.ty-incorrect { color: #b91c1c; background: rgba(185,28,28,.14); text-decoration: underline; text-decoration-color: rgba(185,28,28,.5); }
.ty-ch.ty-current { background: rgba(29,78,216,.16); box-shadow: inset 0 -2px 0 0 #1D4ED8; }

/* Typing textarea */
.ty-input {
  width: 100%; min-height: 120px; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--rt-hairline); border-radius: 8px; background: #fff;
  font-family: var(--rt-font-sans); font-size: 18px; line-height: 1.8;
  color: var(--rt-ink); box-sizing: border-box;
}
.ty-input:focus { outline: none; border-color: #1D4ED8; box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.ty-input:disabled { background: var(--rt-bg-inset); color: var(--rt-ink-muted); }

/* Live metrics row */
.ty-metrics {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  padding: 14px; background: var(--rt-result-bg); border-radius: 10px;
  border: 1px solid rgba(29,78,216,.22);
}
@media (max-width: 720px) { .ty-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .ty-metrics { grid-template-columns: 1fr; } }
.ty-metric { text-align: center; padding: 6px 4px; }
.ty-metric-num { display: block; font-family: var(--rt-font-sans); font-size: 22px; font-weight: 700; color: var(--rt-result-ink); font-variant-numeric: tabular-nums; }
.ty-metric-lbl { display: block; font-family: var(--rt-font-mono); font-size: 10px; color: var(--rt-result-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-top: 4px; }

/* Controls */
.ty-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ty-btn {
  padding: 10px 18px; font-size: 13px; border-radius: 6px; cursor: pointer;
  font-family: var(--rt-font-mono); text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.ty-btn-new { background: #1D4ED8; color: #fff; border: 1px solid #1e40af; }
.ty-btn-new:hover { background: #1e40af; }
.ty-btn-finish { background: #fff; color: #1D4ED8; border: 1px solid rgba(29,78,216,.4); }
.ty-btn-finish:disabled { opacity: .5; cursor: not-allowed; }
.ty-btn-restart { background: #fff; color: var(--rt-ink-muted); border: 1px solid var(--rt-hairline); }

/* CPM helper note */
.ty-cpm-note { padding: 8px 12px; background: #eff6ff; border-radius: 6px; font-size: 12px; color: var(--rt-ink-muted); line-height: 1.5; }

/* Summary card */
.ty-summary {
  padding: 18px 20px; background: var(--rt-result-bg); color: var(--rt-result-ink);
  border: 1px solid rgba(29,78,216,.3); border-radius: 12px;
}
.ty-summary-head { font-family: var(--rt-font-mono); font-size: 11px; color: var(--rt-result-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: 12px; }
.ty-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 480px) { .ty-summary-grid { grid-template-columns: 1fr 1fr; } }
.ty-summary-cell { text-align: center; padding: 10px 6px; background: rgba(255,255,255,.06); border-radius: 8px; }
.ty-summary-num { display: block; font-family: var(--rt-font-sans); font-size: 24px; font-weight: 700; color: var(--rt-result-ink); font-variant-numeric: tabular-nums; }
.ty-summary-lbl { display: block; font-family: var(--rt-font-mono); font-size: 10px; color: var(--rt-result-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.ty-summary-done { margin-top: 12px; text-align: center; font-size: 14px; font-weight: 600; color: #4ade80; }
