* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #0f172a;
  color: white;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 1100px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 30px;
  padding: 40px;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  flex-wrap: wrap;
}

h1 {
  font-size: 42px;
  margin-bottom: 10px;
}

.subtitle {
  color: #94a3b8;
}

button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  background: #1d4ed8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.mode-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
  padding: 22px 24px;
  border: 1px solid #334155;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 23, 42, 0.2));
}

.mode-copy {
  max-width: 620px;
}

.mode-kicker {
  margin-bottom: 8px;
  color: #60a5fa;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.mode-copy h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.mode-copy p:last-child {
  color: #94a3b8;
  line-height: 1.5;
}

.mode-switch {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid #334155;
  border-radius: 18px;
  background: #0b1220;
}

.mode-btn {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid transparent;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
}

.mode-btn:hover {
  background: rgba(37, 99, 235, 0.18);
}

.mode-btn.is-active {
  background: #2563eb;
  color: white;
  border-color: rgba(255, 255, 255, 0.12);
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 25px;
}

.card p {
  color: #94a3b8;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 32px;
}

.text-display {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 25px;
  min-height: 180px;
  padding: 35px;
  margin-bottom: 30px;
  font-size: 32px;
  line-height: 1.7;
  font-family: monospace;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.text-display.is-literature {
  font-size: 26px;
  line-height: 1.8;
}

textarea {
  width: 100%;
  height: 180px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 25px;
  padding: 25px;
  color: white;
  font-size: 24px;
  resize: none;
  outline: none;
}

textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.correct {
  color: #4ade80;
}

.incorrect {
  color: #f87171;
}

.default {
  color: #64748b;
}

.result {
  margin-top: 30px;
  padding: 25px;
  background: rgba(34,197,94,0.1);
  border: 1px solid #22c55e;
  border-radius: 20px;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  body {
    align-items: flex-start;
    padding: 12px;
  }

  .container {
    border-radius: 22px;
    padding: 22px;
  }

  .header {
    margin-bottom: 22px;
  }

  h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 15px;
    line-height: 1.4;
  }

  button {
    width: 100%;
    padding: 13px 18px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .mode-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 18px;
  }

  .mode-copy h2 {
    font-size: 24px;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
    width: auto;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .card h2 {
    font-size: 26px;
  }

  .text-display {
    min-height: 150px;
    margin-bottom: 18px;
    padding: 20px;
    border-radius: 18px;
    font-size: 23px;
    line-height: 1.65;
  }

  .text-display.is-literature {
    font-size: 21px;
  }

  textarea {
    height: 150px;
    padding: 18px;
    border-radius: 18px;
    font-size: 20px;
  }

  .result {
    margin-top: 20px;
    padding: 18px;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 16px;
    border-radius: 18px;
  }

  .header {
    gap: 14px;
  }

  h1 {
    font-size: 26px;
  }

  .mode-copy h2 {
    font-size: 21px;
  }

  .mode-copy p:last-child {
    font-size: 14px;
  }

  .card {
    padding: 14px;
  }

  .card p {
    margin-bottom: 6px;
    font-size: 14px;
  }

  .card h2 {
    font-size: 23px;
  }

  .text-display {
    min-height: 130px;
    padding: 16px;
    font-size: 20px;
  }

  .text-display.is-literature {
    font-size: 18px;
  }

  textarea {
    height: 135px;
    padding: 16px;
    font-size: 18px;
  }
}
