* {
  box-sizing: border-box;
}

body {
  background-color: rgb(68, 123, 149);
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.container {
  background-color: #fff;
  width: min(900px, 92%);
  border-radius: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 18px;
}

h1 {
  text-align: center;
  font-weight: 800;
  font-size: clamp(24px, 3.5vw, 40px); /* was 3rem */
  margin: 6px 0 16px;
}

.content {
  color: #000;
}

/* typing paragraph box */
.text {
  height: clamp(160px, 24vh, 240px);
  overflow-y: auto;
  font-size: clamp(14px, 2vw, 18px); /* was 1.5rem */
  line-height: 1.6;
  padding: 14px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  margin: 0 0 14px;
}

/* highlight states */
.text span.correct {
  color: #4caf50;
}
.text span.incorrect {
  color: red;
}
.text span.active {
  border-bottom: 2px solid #1da1b8;
}

/* keep textarea hidden (your logic uses it) */
textarea {
  position: absolute;
  left: -9999px;
}

/* stats row */
.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap; /* important for small screens */
  justify-content: space-between;
  font-size: clamp(14px, 2vw, 18px); /* was 1.5rem */
  margin: 0;
}

.stats > div {
  margin: 6px 0;
}

.btun {
  margin-left: auto; /* push button to the end */
}

/* button */
button {
  background-color: rgb(32, 146, 222);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: clamp(14px, 2vw, 16px); /* was 1.4rem */
  cursor: pointer;
}

button:hover {
  background-color: rgb(14, 117, 168);
}
