:root {
  --bg:#0f1724; --card:#0b1220; --accent:#06b6d4; --muted:#94a3b8;
  --correct:#10b981; --wrong:#ef4444; --glass: rgba(255,255,255,0.03);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg,#071024 0%, #071a2a 100%); color: #e6eef6;
  padding: 24px;
}

.card {
  width: 100%; max-width: 920px; background: var(--card); border-radius: 14px; padding: 22px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.6); border: 1px solid rgba(255,255,255,0.03);
}

header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
header h1 { font-size: 20px; margin: 0; }

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

select, button, input[type="number"] {
  background: var(--glass); border: 1px solid rgba(255,255,255,0.04);
  padding: 8px 10px; color: inherit; border-radius: 8px; font-size: 14px;
}

button { cursor: pointer; }

.meta { display: flex; gap: 14px; margin: 12px 0 18px; flex-wrap: wrap; }

.stat {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 12px; border-radius: 10px; min-width: 110px; text-align: center;
  border: 1px solid rgba(255,255,255,0.02);
}

.stat .value { font-weight: 700; font-size: 18px; }
.stat .label { font-size: 12px; color: var(--muted); }

.passage {
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01));
  padding: 18px; border-radius: 10px; min-height: 120px; line-height: 1.8; font-size: 18px;
  border: 1px solid rgba(255,255,255,0.02); overflow-wrap: break-word;
}

.char { padding: 2px 2px; white-space: pre-wrap; }
.char.correct { color: var(--correct); background: rgba(16,185,129,0.05); border-radius: 4px; }
.char.wrong { color: var(--wrong); background: rgba(239,68,68,0.04); border-radius: 4px; }
.char.current { outline: 2px solid rgba(6,182,212,0.15); border-radius: 4px; }

.input-area { margin-top: 14px; display: flex; gap: 8px; }

textarea {
  flex: 1; min-height: 90px; resize: none; border-radius: 10px; padding: 12px; font-size: 16px;
  border: 1px solid rgba(255,255,255,0.03); background: transparent; color: inherit;
}

footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.hint { font-size: 13px; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }

@media (max-width:640px) {
  .meta { gap: 8px; }
  .stat { min-width: 88px; padding: 10px; }
  header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
