:root {
  --radius: 10px;
  --shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  --main-color: #0078d7;
  --bg-light: #f9f9f9;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg-light);
  margin: 0;
  padding: 15px;
}

.container {
  max-width: 480px; /* gọn hơn trên PC */
  margin: 0 auto;
  background: #fff;
  padding: 15px 10px; /* gọn gàng */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1 {
  text-align: center;
  color: var(--main-color);
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.footer {
  text-align: center;
  font-size: 0.85rem;
  color: #777;
  margin-top: 20px;
}

/* Input row */
.input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap; /* ✅ thêm để tránh tràn khi textarea to */
}

/*
#user-input {
  flex: 1;
  font-size: 1.1rem;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  text-align: center;
  outline: none;
  max-width: 300px; /* gọn hơn trên PC 
}*/
#user-input {
  flex: 1;
  font-size: 1.1rem;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  text-align: center;
  outline: none;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;      /* hiển thị ít nhất 2 dòng */
  max-height: 90px;      /* giới hạn 3 dòng */
  resize: none;          /* không cho kéo thủ công */
  line-height: 1.4;      /* dễ đọc hơn */
  overflow-y: auto;      /* tự có thanh cuộn nếu dài */
}

#user-input:focus {
  border-color: var(--main-color);
  box-shadow: 0 0 5px rgba(0, 120, 215, 0.3);
}

.result {
  font-size: 1.8rem;
  width: 40px;
  text-align: center;
  min-width: 40px;
}

/* Text & ví dụ */
.vietnamese {
  font-size: 1.3rem;
  text-align: center;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

#example {
  font-size: 0.95rem;
  text-align: center;
  white-space: pre-line;
  margin: 8px 0 12px 0;
  color: #444;
}

/* Buttons row */
.button-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}


.button-row button {
  flex: 1 1 45%;      /* 2 nút 1 hàng */
  min-width: 140px;
  height: 48px;        /* đồng đều */
  font-size: 1rem;
  padding: 0 10px;
  text-align: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--main-color); /* màu xanh chủ đạo */
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, background 0.2s ease;
}
.button-row button:hover {
  background: #005fa3;   /* xanh đậm hơn khi hover */
  transform: scale(1.03);
}

.button-row button:active {
  transform: scale(0.98);
}

/* Score 
.score {
  text-align: center;
  font-size: 1.1rem;
  color: #333;
  margin-top: 12px;
}*/

.batch-score {
  text-align: center;
  font-size: 1.1rem;
  color: #333;
  margin-top: 12px;
}

/* Auto play checkbox */
.options {
  text-align: center;
  margin-top: 8px;
}

label {
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 10px 8px;
  }

  #user-input {
    font-size: 1rem;
    max-width: 100%;
    min-height: 70px;       /* ✅ đủ 2 dòng */
    max-height: 110px;      /* ✅ giới hạn 3 dòng */
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
  }

  .button-row button {
    flex: 1 1 48%;          /* 2 nút 1 hàng, vừa hơn */
    min-width: unset;
    height: 45px;
    font-size: 0.95rem;
  }

  .options input[type="number"] {
    width: 38px;
    padding: 2px;
    font-size: 0.9rem;
    text-align: center;
  }
}
