*, *::before, *::after { box-sizing: border-box; }

:root {
  --blue: #2563eb;
  --green: #16a34a;
  --ink: #1f2937;
  --line: #e5e7eb;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Noto Sans Thai", "Sarabun", "Hiragino Sans",
               "Noto Sans JP", "Meiryo", system-ui, sans-serif;
  font-size: 18px;                 /* ★ ฐานใหญ่พอสำหรับมือถือ */
  line-height: 1.75;
  color: var(--ink);
  background: #f4f7f6;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 60px;
}

h1 { font-size: 1.6rem; margin: 12px 0 16px; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.2rem; margin-top: 28px; }

.card {
  background: #fff;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ★ ข้อความภาษาญี่ปุ่นต้องใหญ่เป็นพิเศษ */
.prompt {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 14px;
  word-break: break-word;
}
.sub, .jp {
  font-size: 1.6rem;
  letter-spacing: .04em;
  margin: 10px 0;
}
.no { color: #6b7280; font-size: .95rem; margin-bottom: 8px; }

/* ปุ่มตัวเลือก — เรียงเป็นแถวเต็มความกว้าง แตะง่าย */
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choices .ch {
  display: block;
  width: 100%;
  min-height: 56px;                /* ★ นิ้วแตะสบาย */
  padding: 14px 16px;
  font-size: 1.3rem;
  font-family: inherit;
  text-align: center;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.choices .ch:active { background: #eff6ff; border-color: var(--blue); }

/* ปุ่มลำโพง */
.spk {
  font-size: 1.1rem;
  min-width: 46px; min-height: 40px;
  padding: 6px 12px; margin-left: 6px;
  background: #fde68a; border: none; border-radius: 8px; cursor: pointer;
}
.big-spk {
  display: block; width: 100%;
  padding: 22px; margin: 10px 0;
  font-size: 1.3rem; font-family: inherit;
  color: #fff; background: var(--green);
  border: none; border-radius: 12px; cursor: pointer;
}

/* ช่องพิมพ์คำตอบ */
.txt {
  width: 100%;
  font-size: 1.3rem;               /* ★ ต่ำกว่า 16px มือถือจะซูมเอง */
  font-family: inherit;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
}
.go {
  display: inline-block; width: 100%;
  padding: 16px; margin-top: 8px;
  font-size: 1.15rem; font-family: inherit;
  color: #fff; background: var(--blue);
  border: none; border-radius: 12px;
  text-align: center; text-decoration: none; cursor: pointer;
}
.go.ghost { background: #6b7280; margin-top: 10px; }

/* เรียงประโยค */
.slot {
  min-height: 60px; padding: 14px;
  font-size: 1.4rem;
  background: #f9fafb; border: 2px dashed var(--line); border-radius: 12px;
}
.tokens { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tokens .tk {
  padding: 12px 16px; font-size: 1.2rem; font-family: inherit;
  background: #fff; border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.tokens .tk:disabled { opacity: .35; }

/* จับคู่คำ */
.match .row {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: 1.25rem;
}
.match select {
  flex: 1 1 160px; min-height: 48px;
  font-size: 1.05rem; font-family: inherit;
  padding: 10px; border: 2px solid var(--line); border-radius: 10px;
}

/* แถบความคืบหน้า */
#bar { height: 12px; background: #e5e7eb; border-radius: 6px; margin-bottom: 20px; }
#fill { height: 100%; width: 0; background: var(--blue); border-radius: 6px; transition: .3s; }

/* รายการบทเรียน */
.lesson-card {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.lesson-title { font-weight: 700; font-size: 1.15rem; }
.lesson-card small { color: #6b7280; font-size: .95rem; }
.btn-go {
  padding: 12px 20px; font-size: 1.05rem;
  color: #fff; background: var(--blue);
  border-radius: 10px; text-decoration: none; white-space: nowrap;
}

/* หน้าจอใหญ่ค่อยขยายเพิ่ม */
@media (min-width: 720px) {
  body { font-size: 19px; }
  .wrap { padding: 28px 24px 80px; }
}