:root {
  --bg: #0f1724;
  --card: #071027;
  --accent: #7c3aed;
  --muted: #9aa4b2;
  --white: #e6eef6;
  --danger: #ef4444;
  --ok: #10b981;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #002252;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.card {
  width: min(900px, 96%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #22c1c3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 18px;
}

.lead {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small {
  font-size: 13px;
  color: var(--muted)
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(90deg, var(--accent), #22c1c3);
  color: white;
  font-weight: 600;
  cursor: pointer
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted)
}

.stats {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03)
}

.label {
  font-size: 11px;
  color: var(--muted)
}

.value {
  font-weight: 700;
  font-family: ui-monospace, monospace
}

.test-area {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.quote {
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.005));
  border: 1px solid rgba(255, 255, 255, 0.03);
  min-height: 92px;
  line-height: 1.7;
  font-size: 18px;
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
  color: var(--white);
  user-select: none;
  white-space: pre-wrap;
}

.quote .char {
  padding: 0 1px;
}

.quote .char.current {
  background: rgba(124, 58, 237, 0.12);
  border-radius: 4px;
}

.quote .char.correct {
  color: var(--ok);
}

.quote .char.incorrect {
  color: var(--danger);
  text-decoration: underline wavy rgba(239, 68, 68, 0.25);
}

textarea#input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: var(--white);
  outline: none;
  font-size: 16px;
  font-family: inherit;
}

textarea#input:focus {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.6);
}

.hint {
  font-size: 13px;
  color: var(--muted)
}

.final {
  margin-top: 18px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03)
}

.hidden {
  display: none
}

.final-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 12px 0
}

.final .big {
  font-size: 22px;
  font-weight: 700;
  font-family: ui-monospace, monospace
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

@media (max-width:720px) {
  .stats {
    gap: 8px
  }

  .final-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .quote {
    font-size: 16px
  }
}