/* Typing Speed — test-specific overrides */
:root { --test-accent: #2563eb; }
.t-intro-icon::before {
  content: 'keyboard';
}


/* ── TEXT DISPLAY ── */
.tp-text-box {
  background: var(--color-surface-container-low);
  border: 2.5px solid var(--color-outline);
  border-radius: 22px;
  padding: 28px 24px;
  min-height: 120px;
  line-height: 2;
  font-family: 'Lexend', monospace;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  word-wrap: break-word;
}

.tp-char {
  transition: color 0.08s, opacity 0.08s;
  opacity: 0.45;
  color: var(--text);
}
.tp-correct {
  color: var(--text);
  opacity: 1;
  font-weight: 600;
}
.tp-wrong {
  color: #ef4444;
  background: #fee2e2;
  border-radius: 3px;
  opacity: 1;
}
.tp-cursor {
  border-bottom: 2.5px solid #2563eb;
  animation: cursorBlink 1s step-end infinite;
  opacity: 1;
}

@keyframes cursorBlink {
  50% { border-color: transparent; }
}

/* ── INPUT ── */
.tp-input {
  width: 100%;
  padding: 16px 20px;
  border: 2.5px solid var(--color-outline);
  border-radius: 14px;
  font-family: 'Lexend', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tp-input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,0.15); }

/* ── DARK MODE OVERRIDES ── */
html.dark .tp-text-box {
  background: var(--color-surface-container-low) !important;
  border-color: var(--color-outline-variant) !important;
}

html.dark .tp-input {
  background: var(--color-surface-container) !important;
  border-color: var(--color-outline) !important;
  color: var(--text) !important;
}

html.dark .tp-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.2) !important;
}

html.dark .tp-wrong {
  background: rgba(239, 68, 68, 0.2) !important;
}

/* ── STATS ROW ── */
.tp-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.tp-stat-item {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.tp-stat-item span {
  color: var(--test-accent);
}

/* ── SCORE RANGE TABLE (reuse) ── */
.rt-range-table { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rt-range-row { display: grid; grid-template-columns: 10px 100px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; font-family: 'Lexend', sans-serif; font-size: 13px; }
.rt-range-dot { width: 10px; height: 10px; border-radius: 50%; }
.rt-range-label { font-weight: 700; color: var(--text); }
.rt-range-val { color: var(--text-muted); }
.rt-range-pct { font-weight: 700; text-align: right; }
.rt-range-row.elite  { background: #f0fdf4; } .rt-range-row.elite  .rt-range-dot { background: #2ecc71; } .rt-range-row.elite  .rt-range-pct { color: #2ecc71; }
.rt-range-row.fast   { background: #f0f9ff; } .rt-range-row.fast   .rt-range-dot { background: #0ea5e9; } .rt-range-row.fast   .rt-range-pct { color: #0ea5e9; }
.rt-range-row.avg    { background: #fafafa; } .rt-range-row.avg    .rt-range-dot { background: #f5a623; } .rt-range-row.avg    .rt-range-pct { color: #f5a623; }
.rt-range-row.slow   { background: #fef2f1; } .rt-range-row.slow   .rt-range-dot { background: #e74c3c; } .rt-range-row.slow   .rt-range-pct { color: #e74c3c; }

@media (max-width: 480px) {
  .tp-text-box { font-size: 15px; padding: 20px 16px; }
  .tp-input { font-size: 15px; padding: 14px 16px; }
}

/* ── INTRO VISUAL EXAMPLE ── */
.ts-preview-arena {
  position: relative;
  width: 280px;
  height: 120px;
  background: color-mix(in srgb, var(--test-accent) 2%, rgba(0,0,0,0.35));
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.light .ts-preview-arena {
  background: color-mix(in srgb, var(--test-accent) 4%, rgba(0,0,0,0.04));
}

.ts-preview-paper {
  background: var(--color-surface-container-high);
  border: 1.5px solid var(--color-outline);
  border-radius: 8px;
  padding: 12px 16px;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ts-preview-line {
  font-family: var(--font-b);
  font-size: 11px;
  color: var(--text-muted);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-preview-input {
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 700;
  color: var(--test-accent);
  white-space: nowrap;
}

.ts-preview-input .typed-text::after {
  content: '';
  animation: tsTypeText 5.0s infinite steps(1);
}

@keyframes tsTypeText {
  0%, 12% { content: ''; }
  14%, 17% { content: 'T'; }
  18%, 21% { content: 'Th'; }
  22%, 25% { content: 'The'; }
  26%, 29% { content: 'The '; }
  30%, 33% { content: 'The q'; }
  34%, 37% { content: 'The qu'; }
  38%, 41% { content: 'The qui'; }
  42%, 45% { content: 'The quic'; }
  46%, 49% { content: 'The quick'; }
  50%, 53% { content: 'The quick '; }
  54%, 57% { content: 'The quick b'; }
  58%, 61% { content: 'The quick br'; }
  62%, 65% { content: 'The quick bro'; }
  66%, 69% { content: 'The quick brow'; }
  70%, 86% { content: 'The quick brown'; }
  87%, 100% { content: ''; }
}

.ts-preview-cursor {
  color: var(--test-accent);
  animation: tsCursorBlink 1.0s infinite;
}

@keyframes tsCursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.ts-preview-caption {
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
  line-height: 1.4;
  margin-bottom: 16px;
}

.ts-preview-caption .ts-highlight {
  color: var(--test-accent);
  font-weight: 700;
}
