/* © 2026 Thấy Là Nói. Sáng, ấm, chữ to, nút to: mở một tay lúc pha cà phê hay đứng chờ đèn đỏ. */
:root {
  --nen: #f6f1e7; --the: #fffdf8; --chu: #2a2620; --mo: #6f675b; --vien: #e4dccb;
  --nhan: #1f6f63; --tren-nhan: #ffffff; --nhan-nhat: #dcefe9;
  --dung: #2f7d3b; --dung-nhat: #e3f2e3; --gan: #a86a12; --gan-nhat: #faeedb; --sai: #b4442f; --sai-nhat: #f8e3dd;
  --danh-dau: #cfeee0;
  --bong: 0 1px 2px rgba(60, 50, 30, .06), 0 4px 16px rgba(60, 50, 30, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --nen: #171512; --the: #221f1a; --chu: #f1ece2; --mo: #a79f91; --vien: #3a352c;
    --nhan: #3fa592; --tren-nhan: #0d1a17; --nhan-nhat: #1d332e;
    --dung: #6cc77a; --dung-nhat: #1f3322; --gan: #e0a347; --gan-nhat: #3a2d17; --sai: #f08a74; --sai-nhat: #3d221c;
    --danh-dau: #1f4a3c; --bong: none;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--nen); color: var(--chu);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.app {
  max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 28px);
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* thanh trên */
.thanh { display: flex; align-items: center; gap: 10px; height: 48px; }
.nut-lui { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--the); font-size: 26px; line-height: 1; box-shadow: var(--bong); cursor: pointer; }
.thanh-ten { flex: 1; font-size: 15px; color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thanh-phai { font-size: 14px; color: var(--mo); }

/* khung một bước: một dòng chữ chính, hình to, việc rõ */
.buoc { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 8px; text-align: center; }
.dong { font-size: 21px; font-weight: 600; margin: 4px 0 0; line-height: 1.35; }
.phu { font-size: 14px; color: var(--mo); margin: 0; }
.hinh-to { font-size: 112px; line-height: 1.1; }
.hinh-vua { font-size: 56px; line-height: 1; }
.hinh-nho { font-size: 22px; }
.so-to { font-size: 40px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }

.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid var(--vien); background: var(--the); font-size: 16px; font-weight: 500; cursor: pointer;
}
.nut-chinh { background: var(--nhan); color: var(--tren-nhan); border-color: transparent; }
.nut:disabled { opacity: .45; }
.nut-to { min-height: 56px; font-size: 18px; }
.hang-nut { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.hang-nut .nut { flex: 1 1 140px; max-width: 260px; }
.nut-chu { border: 0; background: none; color: var(--nhan); font-size: 15px; padding: 8px; text-decoration: underline; cursor: pointer; }
/* emoji 🔊 của iPhone màu xám: nền tối thì chìm mất, nên nút loa luôn nền sáng */
.nut-loa { border: 0; background: #dcefe9; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; vertical-align: middle; cursor: pointer; flex: none; }
.nut-tron { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--the); box-shadow: var(--bong); font-size: 20px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--vien); background: var(--the); font-size: 15px; cursor: pointer; }
.chip-dung { background: var(--dung-nhat); border-color: transparent; color: var(--dung); }
.chip-khung { background: var(--nhan-nhat); border-color: transparent; font-style: italic; cursor: default; }
.chip.chon { background: var(--nhan); color: var(--tren-nhan); border-color: transparent; }
.hang-chip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* micro: vòng ngoài to nhỏ theo mức tiếng thật đo được (--muc), không phải hình động trang trí */
.mic-to { position: relative; width: 88px; height: 88px; flex: none; border-radius: 50%; border: 0; background: var(--nhan); color: var(--tren-nhan); font-size: 34px; cursor: pointer; }
.mic-to::after, .mic-nho::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--nhan); opacity: 0;
  transform: scale(calc(1 + var(--muc, 0) * .5)); transition: transform .08s linear, opacity .2s;
}
.mic-to.dang-nghe::after, .mic-nho::after { opacity: .5; }
.mic-to.phat { font-size: 30px; }
.mic-nho { position: relative; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--nhan-nhat); font-size: 24px; }
.mic-nho.dang-noi { background: var(--nhan); }
.nghe-ra { min-height: 24px; font-size: 16px; color: var(--mo); margin: 0; max-width: 100%; }

/* thẻ hình */
.the .hinh-the { font-size: 140px; animation: hien .25s ease-out; }
@keyframes hien { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.dap-an { min-height: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tu-dap { font-size: 28px; font-weight: 700; }
.tu-dap.dung { color: var(--dung); }
.tu-dap.sai { color: var(--sai); }
.giay { font-size: 15px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.giay.thang { background: var(--dung-nhat); color: var(--dung); }
.giay.gan { background: var(--gan-nhat); color: var(--gan); }
.giay.dich { background: var(--sai-nhat); color: var(--sai); }
.duoi-the { min-height: 60px; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.cham-tien { display: flex; gap: 6px; justify-content: center; }
.cham-tien i { width: 8px; height: 8px; border-radius: 50%; background: var(--vien); }
.cham-tien i.qua { background: var(--nhan); opacity: .5; }
.cham-tien i.dang { background: var(--nhan); }
.ds-kq { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.ds-kq li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--the); text-align: left; }
.ds-kq li em { margin-left: auto; font-style: normal; color: var(--mo); font-size: 14px; }
.ds-kq li.sai { opacity: .7; }

/* câu: của bạn, máy sửa, đối chiếu */
.cau-ban { font-size: 16px; color: var(--mo); background: var(--the); border-radius: 14px; padding: 10px 14px; max-width: 100%; }
.cau-sua { font-size: 20px; font-weight: 500; background: var(--the); border-radius: 14px; padding: 12px 14px; box-shadow: var(--bong); max-width: 100%; }
.cau-sua mark { background: var(--danh-dau); color: inherit; border-radius: 4px; padding: 0 2px; }
.meo { font-size: 15px; margin: 0; background: var(--gan-nhat); border-radius: 12px; padding: 8px 12px; }
.cach-khac { font-size: 15px; color: var(--mo); margin: 0; }
.doi-chieu { display: block; font-size: 18px; margin-bottom: 4px; }
.doi-chieu .co { color: var(--dung); font-weight: 600; }
.doi-chieu .thieu { color: var(--mo); text-decoration: underline dotted; }
.goi-y { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.gq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; }
.gq-ten { font-size: 13px; color: var(--mo); }
.go-chu { display: flex; gap: 8px; width: 100%; }
.go-chu input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--vien); background: var(--the); font-size: 16px; }
.dang-cho { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--vien); border-top-color: var(--nhan); animation: quay .9s linear infinite; }
@keyframes quay { to { transform: rotate(360deg); } }

/* nghe nhại */
.cau-nhai { font-size: 24px; line-height: 1.5; min-height: 80px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.cau-nhai .nhan, .ds-cau .nhan { color: var(--nhan); font-weight: 800; }
.vung-buoc { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 120px; width: 100%; }

/* gọi tên */
.dong-ho { font-size: 28px; font-weight: 700; color: var(--nhan); font-variant-numeric: tabular-nums; }
.chip-vung { min-height: 44px; }
.ds-goi-ten { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; }
.ds-goi-ten li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--the); border-radius: 12px; padding: 8px 12px; text-align: left; }
.ds-goi-ten li b { font-size: 18px; }
.ds-goi-ten .dung { color: var(--dung); font-weight: 700; }
.ds-goi-ten .meo { flex-basis: 100%; }
.cau-goi-y { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }

/* 60 giây: vòng tô theo số giây đã qua */
.vong-60 {
  --da: 0; position: relative; width: 168px; height: 168px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: conic-gradient(var(--nhan) calc(var(--da) * 360deg), var(--vien) 0);
}
.vong-60::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--nen); }
.vong-60 > * { position: relative; }
.vong-60 .dem { font-size: 22px; font-weight: 700; color: var(--mo); font-variant-numeric: tabular-nums; }

/* màn chính */
.man-chinh { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.dau { display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: var(--mo); }
.dau-phai { display: flex; align-items: center; gap: 10px; }
.chuoi { font-weight: 600; color: var(--gan); }
.man-chinh .dong { text-align: center; }
.the-bay-gio { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; border-radius: 24px; background: var(--the); box-shadow: var(--bong); }
.the-bay-gio .nut { width: 100%; max-width: 280px; }
.dai-ngay { display: flex; justify-content: space-between; gap: 6px; }
.ngay-kk { width: 48px; height: 48px; border-radius: 50%; border: 2px solid transparent; background: var(--the); font-size: 22px; position: relative; cursor: pointer; padding: 0; }
.ngay-kk.chon { border-color: var(--nhan); }
.ngay-kk.xong::after {
  content: '✓'; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--dung); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700;
}
.luoi-bai { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.luoi-bai a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 16px; background: var(--the); font-size: 14px; font-weight: 500; box-shadow: var(--bong); }
.luoi-bai a span { font-size: 28px; }
.huy-hieu { position: absolute; top: 6px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sai); color: #fff; font-size: 12px; line-height: 20px; }
.phan-xa { text-align: center; color: var(--mo); font-size: 15px; margin: 0; }

/* kho từ */
.kho, .cai-dat { align-items: stretch; text-align: left; }
.kho .dong { text-align: center; }
.tab { display: flex; gap: 6px; background: var(--the); padding: 4px; border-radius: 14px; }
.tab a { flex: 1; text-align: center; padding: 8px; border-radius: 10px; font-size: 15px; color: var(--mo); }
.tab a.chon { background: var(--nhan); color: var(--tren-nhan); }
.nhom { font-size: 13px; color: var(--mo); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 0; text-align: left; width: 100%; }
.luoi-tu { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.o-tu { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; border: 0; background: var(--the); font-size: 13px; cursor: pointer; }
.o-tu span { font-size: 30px; }
.o-tu::after { content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; }
.o-tu.thuoc::after, .chu-thich i.thuoc { background: var(--dung); }
.o-tu.hoc::after, .chu-thich i.hoc { background: var(--gan); }
.o-tu.sai::after, .chu-thich i.sai { background: var(--sai); }
.chu-thich i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 4px 0 10px; }
.ds-cau { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.ds-cau li { display: flex; align-items: center; gap: 8px; background: var(--the); border-radius: 12px; padding: 8px 10px; }
.ds-cau .cau-chon, .ds-cau .cau-chu { flex: 1; text-align: left; border: 0; background: none; font-size: 16px; padding: 4px; cursor: pointer; }
.bieu-do { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 8px; background: var(--the); border-radius: 16px; }
.bieu-do .cot { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bieu-do .cot i { display: block; width: 70%; background: var(--nhan); border-radius: 6px 6px 0 0; }
.bieu-do .gia { font-size: 12px; font-weight: 600; }
.bieu-do .tuan { font-size: 11px; color: var(--mo); text-align: center; }

/* cài đặt */
.dong-cai { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.dong-cai select { min-height: 44px; border-radius: 12px; border: 1px solid var(--vien); background: var(--the); padding: 8px; }
.dong-cai.dong-hang { flex-direction: row; align-items: center; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
