/* Timed typing test UI */
.tt-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 32px) clamp(14px, 4vw, 24px) 48px;
}

.tt-hero { text-align: center; margin-bottom: 24px; }

.tt-hero h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(26px, 5vw, 38px);
  margin-bottom: 10px;
}

.tt-hero p {
  color: var(--muted);
  font-size: clamp(14px, 2.5vw, 16px);
  max-width: 54ch;
  margin: 0 auto;
}

.tt-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tt-stat {
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.tt-stat span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 4px;
}

.tt-stat strong {
  font-size: clamp(18px, 4vw, 24px);
  color: var(--accent2);
  font-weight: 700;
}

.tt-duration {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.tt-duration button {
  min-height: 44px;
  min-width: 88px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tt-duration button.active {
  border-color: rgba(81, 255, 240, 0.5);
  background: rgba(31, 232, 218, 0.12);
  color: var(--focus);
}

.tt-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: clamp(14px, 3vw, 20px);
  margin-bottom: 16px;
}

.tt-words {
  font-size: clamp(18px, 4.5vw, 24px);
  line-height: 1.75;
  letter-spacing: 0.02em;
  min-height: 120px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  word-wrap: break-word;
  user-select: none;
  -webkit-user-select: none;
}

.tt-words .done { color: var(--dim); }
.tt-words .curr { background: rgba(81, 255, 240, 0.18); border-radius: 3px; }
.tt-words .err { color: var(--bad); text-decoration: underline; }

.tt-input-wrap { position: relative; }

.tt-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(81, 255, 240, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: var(--txt);
  font-size: 16px;
  font-family: inherit;
}

.tt-input:disabled { opacity: 0.55; cursor: not-allowed; }

.tt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.tt-results {
  text-align: center;
  padding: clamp(20px, 4vw, 32px);
}

.tt-results h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(24px, 5vw, 32px);
  color: var(--accent2);
  margin-bottom: 20px;
}

.tt-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tt-result-card {
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.tt-result-card span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 6px;
}

.tt-result-card strong {
  font-size: clamp(28px, 6vw, 36px);
  color: var(--accent);
}

.tt-hidden { display: none !important; }

.tt-hint {
  text-align: center;
  font-size: 13px;
  color: var(--dim);
  margin-top: 10px;
}

@media (max-width: 520px) {
  .tt-stats { grid-template-columns: repeat(2, 1fr); }
  .tt-duration button { flex: 1 1 calc(33% - 8px); min-width: 0; }
}
