/* ══════════════════════════════════════════════════════════════════
   3 TỪ HÔM NAY 今日三词 — trang /tu-hom-nay (mở từ thông báo màn hình khóa)
   Cùng nét với /moi-ngay: giấy kem ấm, thẻ dán viền đậm #2b1d3a, bóng lệch.
   Mỗi lần 1 thẻ to: mặt trước chữ Hán + pinyin + nút nghe, lật ra nghĩa + Hán Việt + câu ví dụ.
   Chữ: Be Vietnam Pro (tiếng Việt) + Noto Serif SC (chữ Hán).
   ══════════════════════════════════════════════════════════════════ */
:root {
  --th-vien: #2b1d3a;
  --th-nen: #fbf3e4;
  --th-giay: #fffdf8;
  --th-chu: #2b1d3a;
  --th-phu: #6b5d6e;
  --th-py: #8a5a0f;
  --th-do: #c8372d;
  --th-do-nhat: #fdebe7;
  --th-vang: #f6c24a;
  --th-vang-nhat: #fff2cf;
  --th-xanh: #2f8f6a;
  --th-xanh-nhat: #e4f5ec;
  --th-nghe: #2c8c97;
  --th-zh: 'Noto Serif SC', 'Be Vietnam Pro', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.th-body {
  margin: 0; min-height: 100vh;
  font-family: 'Be Vietnam Pro', 'Noto Serif SC', sans-serif;
  color: var(--th-chu); line-height: 1.5;
  background:
    radial-gradient(circle at 10% 6%, rgba(246, 194, 74, .2) 0 110px, transparent 111px),
    radial-gradient(circle at 95% 40%, rgba(200, 55, 45, .07) 0 170px, transparent 171px),
    var(--th-nen);
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
.zh { font-family: var(--th-zh); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--th-nghe); outline-offset: 3px; }

/* ─── đầu trang ─── */
.th-top { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.th-ve, .th-cap {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 2.5px solid var(--th-vien); border-radius: 999px; background: var(--th-giay);
  color: var(--th-chu); font-weight: 700; font-size: .95rem; text-decoration: none; box-shadow: 0 3px 0 var(--th-vien);
}
.th-ve:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--th-vien); }
.th-cap { background: var(--th-vang-nhat); font-size: .85rem; }

.th-khung { max-width: 560px; margin: 0 auto; padding: 8px 16px 0; }
.th-dau { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; }
.th-cuon { width: 84px; height: 84px; flex: none; transform: rotate(-5deg); }
.th-cuon-chu { font-family: var(--th-zh); font-weight: 900; font-size: 21px; fill: var(--th-do); }
.th-dau h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.th-phu { margin: 4px 0 0; color: var(--th-phu); font-weight: 500; }

/* ─── tiến độ: 3 thẻ + đố vui ─── */
.th-tien { list-style: none; display: flex; gap: 8px; margin: 0 0 14px; padding: 0; }
.th-tien li { flex: 1; height: 10px; border: 2px solid var(--th-vien); border-radius: 999px; background: var(--th-giay); transition: background .25s; }
.th-tien li.is-xong { background: var(--th-vang); }
.th-tien li.is-dang { background: linear-gradient(90deg, var(--th-vang) 50%, var(--th-giay) 50%); }

.th-dang { text-align: center; color: var(--th-phu); padding: 40px 0; }

/* ─── thẻ từ (lật) ─── */
.th-the-khung { perspective: 1200px; }
.th-the {
  position: relative; display: grid; width: 100%; min-height: 360px; border: none; padding: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, .7, .3, 1); text-align: center;
}
.th-the.is-lat { transform: rotateY(180deg); }
.th-mat {
  grid-area: 1 / 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 26px 20px; border: 3px solid var(--th-vien); border-radius: 26px; background: var(--th-giay);
  box-shadow: 0 6px 0 var(--th-vien); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
}
.th-mat::before { /* góc giấy: mây lành mờ */
  content: ''; position: absolute; right: -18px; top: -18px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 194, 74, .28) 0 40%, transparent 41%), radial-gradient(circle at 30% 70%, rgba(200, 55, 45, .1) 0 30%, transparent 31%);
  pointer-events: none;
}
.th-sau { transform: rotateY(180deg); background: #fffaf0; justify-content: flex-start; gap: 12px; }
.th-so { position: absolute; left: 16px; top: 14px; font-size: .8rem; font-weight: 800; color: var(--th-phu); letter-spacing: .04em; text-transform: uppercase; }
.th-chu-to { font-family: var(--th-zh); font-weight: 700; font-size: clamp(4rem, 22vw, 6.2rem); line-height: 1.1; color: var(--th-chu); letter-spacing: .04em; }
.th-py { font-size: 1.4rem; font-weight: 700; color: var(--th-py); }
.th-goi { font-size: .9rem; color: var(--th-phu); font-weight: 600; margin-top: 4px; }
.th-goi b { color: var(--th-do); }

.th-nghe {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border: 2.5px solid var(--th-vien); border-radius: 999px; background: var(--th-nghe); color: #fff;
  font-weight: 800; font-size: 1rem; box-shadow: 0 4px 0 var(--th-vien); cursor: pointer;
}
.th-nghe.is-nho { min-height: 40px; padding: 0 14px; font-size: .9rem; box-shadow: 0 3px 0 var(--th-vien); }
.th-nghe:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--th-vien); }
.th-nghe.is-doc { background: var(--th-xanh); }

.th-sau-dau { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.th-sau-dau .zh { font-size: 2.4rem; font-weight: 700; }
.th-sau-dau .th-py { font-size: 1.1rem; }
.th-nghia { font-size: 1.35rem; font-weight: 800; line-height: 1.3; text-wrap: balance; }
.th-hv { display: inline-block; padding: 3px 12px; border: 2px solid var(--th-vien); border-radius: 999px; background: var(--th-vang-nhat); font-size: .85rem; font-weight: 700; }
.th-vd { width: 100%; margin-top: 4px; padding: 12px 14px; border: 2px dashed rgba(43, 29, 58, .35); border-radius: 16px; text-align: left; background: var(--th-giay); }
.th-vd-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: .78rem; font-weight: 800; color: var(--th-phu); text-transform: uppercase; letter-spacing: .05em; }
.th-vd .zh { font-size: 1.25rem; font-weight: 600; line-height: 1.45; }
.th-vd .th-vd-py { color: var(--th-py); font-size: .9rem; }
.th-vd .th-vd-vn { color: var(--th-phu); font-size: .92rem; }

/* ─── nút điều hướng ─── */
.th-hang { display: flex; gap: 10px; margin-top: 18px; }
.th-nut {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 18px;
  border: 2.5px solid var(--th-vien); border-radius: 18px; background: var(--th-giay); color: var(--th-chu);
  font-weight: 800; font-size: 1.02rem; text-decoration: none; box-shadow: 0 4px 0 var(--th-vien); cursor: pointer;
}
.th-nut.is-chinh { background: var(--th-do); color: #fff; }
.th-nut.is-vang { background: var(--th-vang); }
.th-nut:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--th-vien); }
.th-nut[disabled] { opacity: .5; cursor: default; }
.th-nut.is-phu { flex: none; }

/* ─── đố nhanh ─── */
.th-do { padding: 22px 18px 20px; border: 3px solid var(--th-vien); border-radius: 26px; background: var(--th-giay); box-shadow: 0 6px 0 var(--th-vien); text-align: center; }
.th-do-nhan { margin: 0 0 4px; font-size: .8rem; font-weight: 800; color: var(--th-phu); text-transform: uppercase; letter-spacing: .05em; }
.th-do-hoi { margin: 0 0 14px; font-weight: 700; }
.th-do .th-chu-to { font-size: clamp(3.4rem, 18vw, 5rem); }
.th-ds { display: grid; gap: 10px; margin-top: 16px; }
.th-chon {
  min-height: 56px; padding: 10px 16px; border: 2.5px solid var(--th-vien); border-radius: 16px; background: #fff;
  font-weight: 700; font-size: 1.02rem; text-align: left; box-shadow: 0 3px 0 var(--th-vien); cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.th-chon:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--th-vien); }
.th-chon .th-ky { flex: none; width: 30px; height: 30px; border: 2px solid var(--th-vien); border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 800; background: var(--th-vang-nhat); }
.th-chon.is-dung { background: var(--th-xanh-nhat); border-color: var(--th-xanh); }
.th-chon.is-dung .th-ky { background: var(--th-xanh); color: #fff; border-color: var(--th-xanh); }
.th-chon.is-sai { background: var(--th-do-nhat); border-color: var(--th-do); }
.th-chon.is-sai .th-ky { background: var(--th-do); color: #fff; border-color: var(--th-do); }
.th-chon[disabled] { cursor: default; }
.th-phan-hoi { min-height: 1.6em; margin: 12px 0 0; font-weight: 800; }
.th-phan-hoi.is-dung { color: var(--th-xanh); }
.th-phan-hoi.is-sai { color: var(--th-do); }

/* ─── xong ─── */
.th-xong { position: relative; padding: 26px 20px 22px; border: 3px solid var(--th-vien); border-radius: 26px; background: var(--th-giay); box-shadow: 0 6px 0 var(--th-vien); text-align: center; overflow: hidden; }
.th-xong h2 { margin: 6px 0 4px; font-size: 1.6rem; line-height: 1.2; }
.th-xong p { margin: 0 0 4px; color: var(--th-phu); font-weight: 500; }
.th-sao { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.th-sao svg { width: 46px; height: 46px; }
.th-sao .is-tat path { fill: #eadfca; }
.th-on { display: grid; gap: 8px; margin: 16px 0 6px; text-align: left; }
.th-on-dong { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid rgba(43, 29, 58, .18); border-radius: 14px; background: #fff; }
.th-on-dong .zh { font-size: 1.5rem; font-weight: 700; min-width: 3.2em; }
.th-on-dong small { display: block; color: var(--th-py); font-weight: 700; }
.th-on-dong span { font-weight: 600; }
.th-hoa { position: absolute; width: 12px; height: 12px; border-radius: 3px; top: -14px; animation: th-roi 2.4s ease-in forwards; pointer-events: none; }
@keyframes th-roi { to { transform: translateY(420px) rotate(540deg); opacity: 0; } }

.th-the-o { padding: 22px 18px; border: 3px solid var(--th-vien); border-radius: 22px; background: var(--th-giay); box-shadow: 0 5px 0 var(--th-vien); text-align: center; }
.th-the-o p { margin: 0 0 12px; }

@media (prefers-reduced-motion: reduce) {
  .th-the { transition: none; }
  .th-hoa { display: none; }
}
@media (max-width: 380px) {
  .th-the { min-height: 330px; }
  .th-dau h1 { font-size: 1.45rem; }
  .th-cuon { width: 68px; height: 68px; }
}
.th-xong .th-hang { flex-direction: column; }
/* nhan cho trinh doc man hinh (cac o tien do 1-2-3-Đố nhanh): an voi mat, van doc duoc */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
