:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #4ade80;
  --err: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.app {
  width: 100%;
  max-width: 820px;
}

.app__header h1 { margin: 0 0 .25rem; }
.app__header p  { margin: 0 0 1.5rem; color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}

.stat {
  background: var(--surface);
  padding: .75rem 1rem;
  border-radius: .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat__label { color: var(--muted); font-size: .8rem; }
.stat__value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }

.controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.controls select,
.controls button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #334155;
  border-radius: .5rem;
  padding: .5rem .75rem;
  cursor: pointer;
}
.controls button:hover { border-color: var(--accent); }

.text-display {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: .75rem;
  font-size: 1.25rem;
  line-height: 1.8;
  letter-spacing: .3px;
  min-height: 120px;
  margin-bottom: 1rem;
  word-break: break-word;
}
.text-display span.correct { color: var(--ok); }
.text-display span.wrong   { color: var(--err); text-decoration: underline; }
.text-display span.current { background: #334155; border-radius: 3px; }

.input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #334155;
  border-radius: .75rem;
  padding: 1rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.input:focus { border-color: var(--accent); }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
