* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7ff;
  color: #222;
}

.wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.site-header,
.site-footer {
  background: #4f46e5;
  color: #fff;
}

.site-header .wrapper,
.site-footer .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  margin: 0.5rem 0;
  font-size: 1.4rem;
}

.main-nav a {
  color: #e0e7ff;
  margin-left: 1rem;
  text-decoration: none;
  font-weight: 500;
}

.main-nav a:hover {
  text-decoration: underline;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.home-card h2 {
  font-size: 1.8rem;
}

.home-buttons {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.home-tip {
  font-size: 0.9rem;
  color: #555;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn.primary {
  background: #4f46e5;
  color: #fff;
}

.btn.secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn.big {
  font-size: 1.1rem;
}

.btn:hover {
  filter: brightness(1.05);
}

.word-form textarea {
  width: 100%;
  font-family: monospace;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

.form-buttons {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.flash-container {
  margin-top: 1rem;
}

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #b91c1c;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.voice-control-item {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.voice-control-item select {
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #cbd5f5;
  font-size: 0.9rem;
}

.progress-label {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.prompt-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.underscore-box {
  margin: 1rem 0;
}

.underscore-label {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.underscore-display {
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  padding: 0.4rem 0.6rem;
  background: #eef2ff;
  border-radius: 8px;
  min-height: 2.1rem;
}

.input-area {
  margin-top: 1rem;
}

#answerInput {
  width: 100%;
  font-size: 1.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
}

.typed-feedback {
  margin-top: 0.4rem;
  min-height: 1.5rem;
  font-size: 1.2rem;
}

.letter.correct-letter {
  color: #16a34a;
}

.letter.wrong-letter {
  color: #dc2626;
}

.success-message,
.finished-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
}

.finished-message {
  background: #eff6ff;
  color: #1d4ed8;
}

.hidden {
  display: none;
}

.finished-buttons {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.play-controls {
  margin-top: 1rem;
}

.site-footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  text-align: center;
}
