:root {
  --bg: #fff8ec; --card: #ffffff; --ink: #2b2a33; --muted: #8a8794;
  --red: #e5383b; --blue: #2f80ed; --green: #2e9e5b; --yellow: #ffc83d;
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d1b24; --card: #2a2733; --ink: #f4f1fa; --muted: #a39fb0; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif; }
#app { max-width: 760px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }

button { font: inherit; color: inherit; border: 0; border-radius: 16px; background: var(--card);
  box-shadow: 0 2px 0 rgba(0,0,0,.12), 0 0 0 2px rgba(0,0,0,.06) inset; cursor: pointer;
  min-height: 52px; min-width: 52px; padding: 10px 18px; font-weight: 800; font-size: 20px; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; }
button.big { background: var(--blue); color: #fff; font-size: 30px; min-width: 88px; }
button.ok { background: var(--green); color: #fff; }
button.warn { background: var(--yellow); color: #3a2f00; }
button.go { background: var(--red); color: #fff; }

header.top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
header.top button { min-height: 44px; font-size: 18px; padding: 6px 12px; }
.steps { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pill { white-space: nowrap; font-size: 13px; font-weight: 800; padding: 6px 10px; border-radius: 999px;
  background: var(--card); color: var(--muted); }
.pill.on { background: var(--red); color: #fff; }
.pill.done { background: var(--green); color: #fff; }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.pic { width: 100%; max-width: 520px; max-height: 52vh; object-fit: contain; border-radius: var(--radius);
  background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.14); }
.pic.small { max-height: 30vh; }
.text { font-size: clamp(26px, 6vw, 40px); font-weight: 900; line-height: 1.2; min-height: 1.2em; }
.text .w { cursor: pointer; border-radius: 8px; padding: 0 3px; }
.text .w:active { background: var(--yellow); }
.vi { color: var(--muted); font-size: 15px; font-weight: 700; }
.word { font-size: clamp(40px, 10vw, 68px); font-weight: 900; }
.hint { color: var(--muted); font-size: 15px; font-weight: 700; }
.badge { font-size: 14px; font-weight: 800; color: var(--muted); }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.bar.center { justify-content: center; flex-wrap: wrap; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(128,128,128,.35); }
.dot.on { background: var(--red); }

.opts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: 110px; min-height: 110px; padding: 10px; font-size: 22px; }
.opt .sw { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(0,0,0,.2); }
.opt .em { font-size: 52px; line-height: 1; }
.opt img { width: 120px; height: 100px; object-fit: contain; }
.opt.right { outline: 5px solid var(--green); }
.opt.wrong { animation: shake .35s; outline: 5px solid var(--red); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.fb { min-height: 40px; font-size: 28px; font-weight: 900; }

.home { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.home h1 { margin: 0; font-size: clamp(34px, 8vw, 54px); }
.home .kids { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.home .kids button { font-size: 28px; padding: 24px 28px; min-width: 190px; }
.home .em { font-size: 64px; }

.sum { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.sum .row { display: flex; justify-content: space-between; background: var(--card); border-radius: 14px; padding: 12px 16px; font-weight: 800; }
textarea { width: 100%; min-height: 90px; border-radius: 14px; border: 2px solid rgba(0,0,0,.12); padding: 10px;
  font: inherit; background: var(--card); color: var(--ink); }

/* ===== iPad là thiết bị chính ===== */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
#app { min-height: 100dvh; }

/* iPad dọc (mini 744, Air/10th 820, Pro 834) và lớn hơn */
@media (min-width: 700px) {
  #app { max-width: 1100px; padding-left: 28px; padding-right: 28px; }
  button { min-height: 68px; min-width: 68px; font-size: 26px; border-radius: 20px; padding: 12px 26px; }
  button.big { font-size: 38px; min-width: 120px; }
  header.top button { min-height: 56px; font-size: 22px; }
  .pill { font-size: 16px; padding: 8px 14px; }
  .pic { max-width: 640px; max-height: 50vh; }
  .pic.small { max-height: 42vh; }
  .text { font-size: clamp(38px, 5.2vw, 56px); }
  .vi, .hint { font-size: 19px; }
  .word { font-size: clamp(56px, 8vw, 92px); }
  .opt { min-width: 170px; min-height: 160px; font-size: 30px; }
  .opt .sw { width: 92px; height: 92px; }
  .opt .em { font-size: 74px; }
  .opt img { width: 170px; height: 140px; }
  .fb { font-size: 38px; min-height: 52px; }
  .dot { width: 12px; height: 12px; }
}

/* iPad ngang: ảnh bên trái, nội dung bên phải */
@media (min-width: 900px) and (orientation: landscape) {
  .stage:has(> .pic) {
    display: grid; grid-template-columns: 1.15fr 1fr; column-gap: 40px; align-content: center; align-items: center;
    text-align: left; justify-items: start;
  }
  .stage:has(> .pic) > .pic { grid-column: 1; grid-row: 1 / span 20; max-width: 100%; max-height: 66vh; justify-self: stretch; }
  .stage:has(> .pic) > :not(.pic) { grid-column: 2; }
  .stage:has(> .pic) .opts { justify-content: flex-start; }
  .home .kids button { min-width: 260px; }
}

/* màn hình thấp (iPad ngang có thanh Safari): giảm chiều cao ảnh */
@media (max-height: 700px) { .pic, .pic.small { max-height: 38vh; } }

/* ===== v2: sao, vocabulary, reading, questions ===== */
button.sm { min-height: 52px; min-width: 52px; font-size: 22px; padding: 6px 14px; }
button.big.sm { font-size: 28px; min-width: 64px; }
button.pill { min-height: 0; box-shadow: none; font-size: 14px; padding: 8px 12px; background: var(--card); color: var(--muted); }
button.pill.on { background: var(--red); color: #fff; }
.starbox { font-weight: 900; font-size: 22px; white-space: nowrap; }
.center { text-align: center; }
.hint b { color: var(--ink); }
.dot.got { background: var(--green); }
.dot.on.got { box-shadow: 0 0 0 3px var(--red); }

.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9; background: var(--yellow); color: #3a2f00;
  font-weight: 900; font-size: 34px; padding: 14px 28px; border-radius: 999px; box-shadow: 0 8px 28px rgba(0,0,0,.3);
  animation: pop .35s ease-out; }
.toast small { font-size: 15px; font-weight: 800; margin-left: 6px; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

.mark { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  font-size: 34px; font-weight: 900; color: #fff; }
.mark.ok { background: var(--green); }
.mark.bad { background: var(--red); }
.markslot { display: inline-flex; width: 52px; height: 52px; }
.acts { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mic { background: var(--red); color: #fff; font-size: 26px; min-width: 64px; }
.mic.rec { animation: pulse .9s infinite; background: #b00020; }
@keyframes pulse { 50% { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(229,56,59,.25); } }
.heard { font-size: 14px; color: var(--muted); min-height: 1.2em; font-weight: 700; }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 12px 0; }
.vcard { background: var(--card); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.vcard img { width: 100%; max-height: 150px; object-fit: contain; border-radius: 14px; background: #fff; }
.word.sm { font-size: 30px; }

.rows { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.rrow { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 10px 14px; }
.rrow img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; flex: none; }
.rrow .rtext { flex: 1; min-width: 0; }
.text.sm { font-size: clamp(22px, 3.4vw, 34px); text-align: left; }
.rrow .acts { flex: none; flex-wrap: nowrap; }

.qline { display: flex; align-items: center; gap: 12px; justify-content: center; }
.optrow { display: flex; align-items: center; gap: 8px; }
.optrow .spk { min-width: 56px; min-height: 56px; padding: 0; background: var(--blue); color: #fff; border-radius: 50%; }
.optrow .opt { flex: 1; flex-direction: row; gap: 14px; min-width: 150px; min-height: 96px; }
.opts { gap: 10px; flex-direction: column; align-items: stretch; width: 100%; max-width: 560px; }

.cong { font-size: 40px; padding: 26px 40px; min-height: 96px; animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 5px 0 #d44a37, 0 0 0 10px rgba(255,107,87,.30), 0 12px 26px rgba(212,74,55,.40); } }
.cong:disabled { animation: none; }
.confetti { font-size: 44px; letter-spacing: 8px; }
.bigstars { font-size: clamp(48px, 10vw, 80px); font-weight: 900; }
.sum .row small { color: var(--muted); }

@media (min-width: 700px) {
  .vgrid { grid-template-columns: repeat(3, 1fr); }
  .rrow img { width: 120px; height: 120px; }
  .optrow .spk { min-width: 72px; min-height: 72px; }
  .optrow .opt { min-height: 120px; }
  .mark, .markslot { width: 64px; height: 64px; font-size: 42px; }
}
@media (min-width: 900px) and (orientation: landscape) {
  .stage:has(> .pic) .opts { max-width: 100%; }
  .vgrid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== v3: giao diện tươi sáng, nút nổi kiểu kẹo (bố cục giữ nguyên) ===== */
:root {
  color-scheme: light;
  --bg: #fff4df; --card: #ffffff; --ink: #2d2a3a; --muted: #7d7690;
  --red: #ff6b57; --blue: #3b82f6; --green: #22b573; --yellow: #ffc83d;
  --edge: #e6dcc8;
}
html, body { background: linear-gradient(180deg, #cdeaff 0%, #e8f5ff 22%, #fff4df 55%) fixed; color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Avenir Next Rounded", "Avenir Next", system-ui, sans-serif; }

button { border-radius: 22px; background: #fff; color: var(--ink); font-weight: 900; letter-spacing: .2px;
  box-shadow: 0 5px 0 var(--edge), 0 10px 18px rgba(60,40,0,.10); transition: transform .08s, box-shadow .08s; }
button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge), 0 3px 8px rgba(60,40,0,.12); }
button.big { background: linear-gradient(180deg, #5b9bff, #3b82f6); color: #fff; box-shadow: 0 5px 0 #1f5fd1, 0 10px 18px rgba(31,95,209,.30); }
button.big:active { box-shadow: 0 1px 0 #1f5fd1; }
button.ok { background: linear-gradient(180deg, #34d28b, #22b573); color: #fff; box-shadow: 0 5px 0 #168a54, 0 10px 18px rgba(22,138,84,.28); }
button.warn { background: linear-gradient(180deg, #ffd45e, #ffc83d); color: #4a3800; box-shadow: 0 5px 0 #d19f00, 0 10px 18px rgba(209,159,0,.25); }
button.go { background: linear-gradient(180deg, #ff8570, #ff6b57); color: #fff; box-shadow: 0 5px 0 #d44a37, 0 10px 18px rgba(212,74,55,.30); }
button:disabled { opacity: .4; box-shadow: 0 3px 0 var(--edge); }
.mic { background: linear-gradient(180deg, #ff8570, #ff6b57); color: #fff; box-shadow: 0 5px 0 #d44a37, 0 10px 18px rgba(212,74,55,.30); }

header.top { background: rgba(255,255,255,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 26px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(40,70,120,.12); position: sticky; top: 8px; z-index: 5; }
header.top > button { box-shadow: 0 3px 0 var(--edge); min-height: 48px; }
button.pill { border-radius: 999px; background: #f3eee3; color: var(--muted); box-shadow: none; padding: 9px 15px; }
button.pill.on { background: var(--red); color: #fff; box-shadow: 0 3px 0 #d44a37; }
.starbox { background: #fff3c2; color: #8a5d00; border-radius: 999px; padding: 8px 16px; box-shadow: inset 0 0 0 2px #ffdd7a; }

.pic { border: 8px solid #fff; border-radius: 32px; box-shadow: 0 14px 34px rgba(40,70,120,.22); background: #fff; }
.text { color: var(--ink); text-shadow: 0 2px 0 rgba(255,255,255,.9); line-height: 1.25; }
.hint { color: var(--muted); }
.hint.center { background: rgba(255,255,255,.7); border-radius: 18px; padding: 10px 16px; margin: 6px 0; }
.dot { background: #d9d2c3; }
.dot.on { background: var(--red); transform: scale(1.35); }
.dot.got { background: var(--green); }

.vcard, .rrow, .sum .row, .optrow .opt, textarea {
  background: #fff; border: 3px solid #f3ead6; border-radius: 28px; box-shadow: 0 8px 20px rgba(60,40,0,.08); }
.vcard { padding: 14px; }
.vcard img { background: #f7fbff; border-radius: 20px; }
.rrow img { border: 4px solid #fff; box-shadow: 0 4px 12px rgba(40,70,120,.2); }
.word { color: #2a56c6; }

.optrow .opt { box-shadow: 0 5px 0 var(--edge), 0 10px 18px rgba(60,40,0,.08); }
.optrow .opt:active { box-shadow: 0 1px 0 var(--edge); }
.optrow .opt.right { background: #e6f9ef; border-color: var(--green); outline: none; box-shadow: 0 5px 0 #168a54; }
.optrow .opt.wrong { background: #ffeceb; border-color: var(--red); outline: none; }
.optrow .spk { background: linear-gradient(180deg, #5b9bff, #3b82f6); color: #fff; box-shadow: 0 4px 0 #1f5fd1; }
.opt .sw { box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.fb { color: var(--green); }

.mark { box-shadow: 0 0 0 5px #fff, 0 6px 14px rgba(0,0,0,.18); }
.mark.ok { background: var(--green); }
.mark.bad { background: var(--red); }
.toast { background: linear-gradient(180deg, #ffe27a, #ffc83d); box-shadow: 0 10px 30px rgba(200,140,0,.45); border: 4px solid #fff; }

.home { gap: 16px; }
.home h1 { background: linear-gradient(90deg, #ff6b57, #ffb02e 50%, #3b82f6); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -1px; }
.home .em { filter: drop-shadow(0 8px 10px rgba(0,0,0,.18)); }
.home .kids button { border-radius: 32px; border: 0; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.home .kids button:nth-child(1) { background: linear-gradient(180deg, #5b9bff, #3b82f6); box-shadow: 0 8px 0 #1f5fd1, 0 16px 26px rgba(31,95,209,.3); }
.home .kids button:nth-child(2) { background: linear-gradient(180deg, #ff8570, #ff6b57); box-shadow: 0 8px 0 #d44a37, 0 16px 26px rgba(212,74,55,.3); }
.home .kids button:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.bigstars { color: #e69a00; text-shadow: 0 3px 0 #fff; }
.sum .row { padding: 14px 18px; }

/* --- sửa sau khi xem ảnh chụp iPad --- */
.steps { gap: 4px; justify-content: center; }
button.pill { font-weight: 800; font-size: 15px; padding: 9px 11px; letter-spacing: 0; }
@media (min-width: 700px) { button.pill { font-size: 16px; padding: 10px 14px; } }
.pic { width: auto; max-width: 100%; }          /* khung ôm sát ảnh, không có viền trắng thừa */
.stage:has(> .pic) > .pic { justify-self: center; }
.vcard { justify-content: flex-start; }
.vcard img { width: 100%; height: 150px; max-height: none; object-fit: contain; }
@media (min-width: 700px) { .vcard img { height: 190px; } }
.heard:empty { display: none; }
.vcard .acts { margin-top: 6px; }

/* ===== v4: menu, tài khoản, nút Back, Vocabulary slide ===== */
button.back { min-height: 48px; padding: 8px 18px 8px 14px; font-size: 20px; border-radius: 999px; white-space: nowrap;
  background: #fff; box-shadow: 0 4px 0 var(--edge), 0 8px 16px rgba(60,40,0,.12); }
button.back.float { position: absolute; top: 4px; left: 4px; z-index: 30; min-height: 56px; font-size: 22px; padding: 10px 22px 10px 16px; }
@media (min-width: 700px) { button.back { min-height: 56px; font-size: 24px; } button.back.float { min-height: 62px; font-size: 26px; } }
header.top .ttl { flex: 1; text-align: center; font-weight: 900; font-size: clamp(20px, 3.4vw, 30px); color: var(--ink); }
.mini-home { display: none; }

.word { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
@media (min-width: 900px) and (orientation: landscape) { .stage:has(> .pic) .word { justify-content: flex-start; } }

/* menu */
.menu { margin: 0 auto; width: 100%; max-width: 760px; text-align: center; display: flex; flex-direction: column; gap: 14px; padding: 6px 0 20px; }
.menu h1 { margin: 0; }
header.menu-top { justify-content: space-between; }
.brand { font-weight: 900; font-size: clamp(22px, 3.6vw, 32px); background: linear-gradient(90deg, #ff6b57, #ffb02e 55%, #3b82f6);
  -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; padding-left: 6px; }

.hello { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-weight: 900;
  font-size: clamp(30px, 6vw, 48px); margin-top: 10px; }
.starbox.big { font-size: clamp(22px, 4vw, 32px); padding: 8px 20px; }
.lesson-title { color: var(--muted); font-weight: 800; font-size: clamp(16px, 2.6vw, 22px); }

/* tài khoản + Sign out */
.av { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%;
  background: #fff; font-size: 28px; box-shadow: 0 2px 5px rgba(0,0,0,.14); }
.av.xl { width: 120px; height: 120px; font-size: 76px; box-shadow: 0 6px 14px rgba(0,0,0,.16); }
.me { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: clamp(16px, 2.6vw, 22px); }
button.signout { min-height: 48px; padding: 8px 18px; font-size: 17px; background: #fff; color: var(--red); border-radius: 999px; }
.spacer { width: 96px; }
@media (min-width: 700px) { button.signout { min-height: 56px; font-size: 20px; } .av { width: 54px; height: 54px; font-size: 32px; } }

/* danh sách hoạt động: nút dài, hẹp, xếp dọc */
.rows { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
button.row-btn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 92px; padding: 12px 22px 12px 16px;
  border-radius: 28px; color: #fff; text-align: left; text-shadow: 0 2px 0 rgba(0,0,0,.16); }
button.row-btn .ico { font-size: 46px; line-height: 1; width: 64px; text-align: center; filter: drop-shadow(0 4px 4px rgba(0,0,0,.2)); }
button.row-btn .nm { flex: 1; font-size: clamp(26px, 4.4vw, 36px); font-weight: 900; }
button.row-btn .pg { font-size: 17px; font-weight: 800; opacity: .95; }
button.row-btn .rw { background: rgba(255,255,255,.96); color: #8a5d00; text-shadow: none; border-radius: 999px; padding: 8px 20px;
  font-size: clamp(18px, 3vw, 26px); font-weight: 900; white-space: nowrap; }
button.row-btn .rw.got { color: #168a54; }
button.row-btn.c-listen { background: linear-gradient(180deg, #5b9bff, #3b82f6); box-shadow: 0 6px 0 #1f5fd1, 0 12px 20px rgba(31,95,209,.25); }
button.row-btn.c-words  { background: linear-gradient(180deg, #34d28b, #22b573); box-shadow: 0 6px 0 #168a54, 0 12px 20px rgba(22,138,84,.25); }
button.row-btn.c-read   { background: linear-gradient(180deg, #ffb35c, #ff9a2e); box-shadow: 0 6px 0 #cf7410, 0 12px 20px rgba(207,116,16,.25); }
button.row-btn.c-quiz   { background: linear-gradient(180deg, #b58bff, #9566ff); box-shadow: 0 6px 0 #6c40d1, 0 12px 20px rgba(108,64,209,.25); }
button.row-btn.done { filter: saturate(.8) brightness(1.02); }
button.row-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
@media (min-width: 700px) { button.row-btn { min-height: 108px; } button.row-btn .ico { font-size: 58px; width: 76px; } }
.menu .cong { width: 100%; }

/* đăng nhập: chọn bé, chọn hình bí mật */
.login { padding-top: 5vh; }
.who { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
button.whocard { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 20px; min-width: 0; border-radius: 36px; background: #fff; }
button.whocard .av.xl { width: 104px; height: 104px; font-size: 66px; }
button.whocard .nm { font-size: clamp(24px, 4.2vw, 34px); font-weight: 900; }
.pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 600px; width: 100%; margin: 8px auto; }
button.pic-btn { font-size: clamp(48px, 10vw, 76px); min-height: 110px; padding: 8px; border-radius: 28px; background: #fff; border: 5px solid transparent; }
button.pic-btn.sel { border-color: var(--blue); background: #eaf3ff; transform: scale(1.06); }
button.pic-btn.wrong { animation: shake .35s; border-color: var(--red); }
#pwfb { color: var(--red); }

/* ===== Listening: xem truyện toàn màn hình, chỉ ảnh + câu chữ ===== */
.listen { position: relative; min-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
.listen .stage { flex: 1; justify-content: center; gap: 14px; }
.listen .pic { width: auto; max-width: 100%; max-height: calc(100dvh - 200px); }
.listen .text { font-size: clamp(38px, 8vw, 68px); line-height: 1.15; padding: 0 8px; }
.mini-home { position: absolute; top: 4px; left: 4px; z-index: 5; min-width: 44px; min-height: 44px; width: 44px; height: 44px;
  padding: 0; font-size: 20px; border-radius: 50%; opacity: .55; background: rgba(255,255,255,.8); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
@media (min-width: 900px) and (orientation: landscape) {
  .listen .stage:has(> .pic) { column-gap: 36px; grid-template-columns: calc(100dvh - 48px) 1fr; }
  .listen .stage:has(> .pic) > .pic { max-height: calc(100dvh - 48px); max-width: 100%; }
  .listen .text { font-size: clamp(34px, 3.9vw, 56px); text-align: left; overflow-wrap: normal; }
}

/* ===== Reading: câu to, từng từ tô sáng khi đọc ===== */
.text.read { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 4px;
  font-size: clamp(36px, 7.4vw, 64px); }
#readText { display: contents; }
.text.read .w { display: inline-block; padding: 2px 11px; border-radius: 18px; cursor: default;
  transition: background .12s, transform .12s, color .12s, box-shadow .12s; }
.w.hl { background: linear-gradient(180deg, #ffec96, #ffc83d); color: #7a4300; text-shadow: none;
  transform: scale(1.15) translateY(-4px); box-shadow: 0 6px 0 #d19f00, 0 12px 20px rgba(209,159,0,.38); }
.w.past { color: #2a56c6; }
.w.ok { color: var(--green); }
.w.miss { color: var(--red); text-decoration: underline wavy; text-decoration-thickness: 3px; text-underline-offset: 9px; }
.markslot.inline { position: static; width: auto; height: auto; margin-left: 10px; }
.markslot.inline:empty { display: none; }
@media (min-width: 900px) and (orientation: landscape) { .stage:has(> .pic) .text.read { justify-content: flex-start; } }

/* ===== v5: tab header, danh sách truyện, màn ngôn ngữ, popup Done ===== */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px auto 4px; width: 100%; max-width: 760px; }
button.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 8px 4px;
  border-radius: 22px; background: rgba(255,255,255,.75); color: var(--muted); box-shadow: 0 4px 0 var(--edge); }
button.tab .ti { font-size: 30px; line-height: 1; }
button.tab .tl { font-size: clamp(13px, 2.2vw, 18px); font-weight: 900; text-align: center; line-height: 1.1; }
button.tab.on { background: linear-gradient(180deg, #ff8570, #ff6b57); color: #fff; box-shadow: 0 4px 0 #d44a37, 0 10px 18px rgba(212,74,55,.28); }
@media (min-width: 700px) { button.tab { min-height: 88px; } button.tab .ti { font-size: 36px; } }

button.story-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 20px 12px 12px; min-height: 104px; border-radius: 28px;
  background: #fff; text-align: left; border: 3px solid #f3ead6; box-shadow: 0 6px 0 var(--edge), 0 12px 20px rgba(60,40,0,.08); }
button.story-row .thumb { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; flex: none; box-shadow: 0 4px 10px rgba(40,70,120,.25); }
button.story-row .info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
button.story-row .nm { font-size: clamp(22px, 3.8vw, 32px); font-weight: 900; color: var(--ink); }
button.story-row .pg { font-size: clamp(14px, 2.4vw, 18px); font-weight: 800; color: var(--muted); }
button.story-row .chev { font-size: 28px; color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip { font-size: clamp(12px, 2vw, 15px); font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #f3eee3; color: var(--muted); }
.chip.mine { background: #fff3c2; color: #8a5d00; box-shadow: inset 0 0 0 2px #ffdd7a; }
.chip.lvl { background: #e3f4e9; color: #1d6b43; }
@media (min-width: 700px) { button.story-row { min-height: 124px; } button.story-row .thumb { width: 100px; height: 100px; } }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 10px; text-align: center; }
.empty h2 { margin: 0; font-size: clamp(24px, 4.4vw, 36px); }
.soon { background: #fff3c2; color: #8a5d00; border-radius: 999px; padding: 8px 22px; font-weight: 900; font-size: clamp(18px, 3vw, 26px); box-shadow: inset 0 0 0 3px #ffdd7a; }
.menu .em { font-size: 64px; }

header.login-top { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: flex-end; }
button.langbtn { min-height: 52px; padding: 8px 20px; font-size: 19px; border-radius: 999px; background: #fff; }
@media (min-width: 700px) { button.langbtn { min-height: 60px; font-size: 22px; } }

.wiz { padding-top: 2vh; }
.wiz-step { align-self: center; background: #fff; color: var(--muted); font-weight: 900; border-radius: 999px; padding: 6px 18px; font-size: 17px; }
.wiz-q { margin: 0; font-size: clamp(24px, 4.6vw, 38px); line-height: 1.25; }
.choices { display: flex; flex-direction: column; gap: 14px; margin: 10px auto 0; width: 100%; max-width: 520px; }
button.choice { display: flex; align-items: center; gap: 18px; min-height: 96px; padding: 12px 26px; border-radius: 28px; background: #fff;
  font-size: clamp(26px, 4.6vw, 36px); border: 5px solid transparent; justify-content: flex-start; }
button.choice .flag { font-size: 52px; line-height: 1; }
button.choice.cur { border-color: var(--blue); background: #eaf3ff; }

/* popup cuối Questions: có nút Done, không tự đóng */
button.reward-done { display: block; margin: 18px auto 0; font-size: 34px; min-height: 82px; min-width: 240px; animation: glow 1.6s ease-in-out infinite; }

/* nút nghe đang chờ (bị khoá ~1,5s sau khi bấm): mờ nhẹ, không nhấp nháy */
button.big:disabled, button.spk:disabled { opacity: .6; filter: saturate(.7); transform: none; }

/* ===== tô sáng từ khi đọc: dùng chung cho Reading và Questions ===== */
.w { display: inline-block; padding: 0 7px; border-radius: 16px; transition: background .12s, transform .12s, color .12s, box-shadow .12s; }
#qText .w { padding: 2px 9px; }
.optlabel .w { padding: 1px 8px; }
.opt.speaking { background: #fff6cf; border-color: var(--yellow); box-shadow: 0 5px 0 #d19f00, 0 0 0 6px rgba(255,200,61,.45); transform: scale(1.03); }

/* ===== hộp thoại giữa màn hình (chỉ đóng bằng OK) ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: rgba(30,20,70,.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: rFade .2s ease-out; }
.modal-card { width: min(92vw, 560px); background: #fff; border: 8px solid #fff; border-radius: 44px; padding: 30px 28px 26px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: 0 0 0 6px rgba(255,107,87,.35), 0 30px 80px rgba(0,0,0,.45); animation: cardPop .45s cubic-bezier(.2,1.6,.4,1) both; }
.modal-ico { font-size: 72px; line-height: 1; }
.modal-msg { font-size: clamp(20px, 3.6vw, 28px); font-weight: 800; line-height: 1.35; color: var(--ink); }
.modal-ok { min-width: 200px; font-size: 30px; min-height: 72px; margin-top: 6px; }

/* ===== popup thưởng sao: to, giữa màn hình ===== */
.reward { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 45%, rgba(255,226,122,.35), rgba(30,20,70,.62) 70%);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: rFade .25s ease-out; }
.reward.out { animation: rFadeOut .26s ease-in forwards; }
@keyframes rFade { from { opacity: 0; } }
@keyframes rFadeOut { to { opacity: 0; } }
.reward-card { position: relative; width: min(88vw, 560px); padding: 38px 28px 30px; text-align: center;
  background: linear-gradient(180deg, #fffbe3 0%, #ffe27a 100%); border: 10px solid #fff; border-radius: 56px;
  box-shadow: 0 0 0 8px rgba(255,200,61,.55), 0 36px 90px rgba(0,0,0,.45);
  animation: cardPop .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes cardPop { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.reward-stars { display: flex; justify-content: center; flex-wrap: nowrap; gap: 2px; font-size: clamp(38px, 9vw, 72px); line-height: 1.1; }
.rstar { display: inline-block; animation: starIn .7s cubic-bezier(.2,1.8,.4,1) both, starFloat 1.6s ease-in-out .9s infinite;
  filter: drop-shadow(0 8px 10px rgba(190,120,0,.45)); }
@keyframes starIn { 0% { transform: scale(0) rotate(-200deg); opacity: 0; } 70% { transform: scale(1.35) rotate(15deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes starFloat { 50% { transform: translateY(-9px) scale(1.06); } }
.reward-n { font-size: clamp(84px, 20vw, 150px); font-weight: 900; line-height: 1; color: #e07b00; margin-top: 4px;
  text-shadow: 0 6px 0 #fff, 0 12px 24px rgba(180,100,0,.4); animation: nPop .55s cubic-bezier(.2,1.8,.4,1) .35s both; }
@keyframes nPop { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.reward-label { font-size: clamp(28px, 6vw, 44px); font-weight: 900; color: #5b3f00; margin-top: 6px; }
.reward-total { display: inline-block; margin-top: 14px; padding: 8px 22px; border-radius: 999px; background: #fff;
  color: #8a5d00; font-weight: 900; font-size: clamp(20px, 4vw, 28px); box-shadow: inset 0 0 0 3px #ffdd7a; }
.spark { position: absolute; left: 50%; top: 38%; font-size: clamp(26px, 5vw, 42px); pointer-events: none;
  animation: burst 1.2s ease-out both; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1) rotate(160deg); opacity: 0; } }

/* vuốt ngang ở Listening: cho phép cuộn dọc, bắt vuốt ngang; hiệu ứng trượt */
.stage { touch-action: pan-y; }
.pic { -webkit-user-drag: none; user-select: none; }
.stage.in-next { animation: slideInNext .28s ease-out; }
.stage.in-prev { animation: slideInPrev .28s ease-out; }
@keyframes slideInNext { from { opacity: 0; transform: translateX(70px); } }
@keyframes slideInPrev { from { opacity: 0; transform: translateX(-70px); } }

/* nền phủ kín khi trang dài hơn màn hình */
html, body { background: linear-gradient(180deg, #cdeaff 0%, #e8f5ff 22%, #fff4df 55%) fixed, #fff4df; min-height: 100%; }

/* dấu ✓/✗ ở thẻ từ vựng nằm góc trên phải thẻ, không chiếm dòng riêng */
.vcard { position: relative; }
.vcard .markslot { position: absolute; top: 10px; right: 10px; width: auto; height: auto; }
.vcard .mark { width: 52px; height: 52px; font-size: 34px; }

/* iPad ngang: cột phải (chữ/đáp án) căn giữa theo chiều dọc cạnh ảnh */
@media (min-width: 900px) and (orientation: landscape) {
  .stage:has(> .pic) { grid-template-rows: 1fr repeat(5, auto) 1fr; }
  .stage:has(> .pic)::before { content: ""; grid-column: 2; grid-row: 1; }
  .stage:has(> .pic) > .pic { grid-row: 1 / -1; align-self: center; }
}

.practice { color: var(--muted); font-weight: 800; font-size: clamp(14px, 2.4vw, 18px); background: rgba(255,255,255,.7); border-radius: 18px; padding: 10px 16px; }
.chip.world { background: #e6efff; color: #2a56c6; }

/* ---- Explore: chủ đề + thẻ truyện ---- */
.cats { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.catbtn { flex: none; min-height: 52px; padding: 8px 18px; border-radius: 999px; border: 0; background: #fff; color: var(--ink); font: inherit; font-weight: 900;
  font-size: clamp(16px, 2.8vw, 22px); box-shadow: inset 0 0 0 3px var(--edge), 0 3px 0 var(--edge); }
.catbtn b { color: var(--muted); font-weight: 800; margin-left: 4px; }
.catbtn.on { background: var(--blue); color: #fff; box-shadow: 0 4px 0 #1f5fd1; }
.catbtn.on b { color: #dbe8ff; }
.cat-h { margin: 18px 4px 8px; font-size: clamp(22px, 4vw, 30px); }
.cat-h small { color: var(--muted); font-weight: 800; font-size: .6em; }
.xgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.xcard { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 0; border-radius: 24px; background: #fff; text-align: left; font: inherit; cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--edge), 0 4px 0 var(--edge); }
.xcard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }
.xcard .xnm { font-weight: 900; font-size: clamp(16px, 2.6vw, 20px); color: var(--ink); line-height: 1.2; }
.xcard .xmeta { font-weight: 800; font-size: 13px; color: var(--muted); }
.xcard.done { opacity: .75; }
.xcard.done .xmeta { color: var(--green); }

/* ---- Rewards: danh sách quà ---- */
.rw-head { padding-bottom: 4px; }
.gwait { background: #fff3c2; color: #8a5d00; border-radius: 18px; padding: 8px 16px; font-weight: 800; box-shadow: inset 0 0 0 3px #ffdd7a; }
.gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 8px; }
.gift { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px; border-radius: 26px; background: #fff; text-align: center;
  box-shadow: inset 0 0 0 3px var(--edge), 0 4px 0 var(--edge); }
.gift.can { box-shadow: inset 0 0 0 4px #ffc83d, 0 4px 0 #e0a800, 0 0 22px rgba(255,200,61,.55); }
.gem { font-size: 56px; line-height: 1; }
.gnm { font-weight: 900; font-size: clamp(18px, 3vw, 24px); }
.gcost { font-weight: 900; color: #e69a00; font-size: 20px; }
.gbar { width: 100%; height: 12px; border-radius: 999px; background: #f0e9d8; overflow: hidden; }
.gbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffc83d, #ff9f1a); border-radius: 999px; }
.gneed { font-weight: 800; color: var(--muted); font-size: 15px; }
.gift button.go { min-height: 52px; font-size: 20px; padding: 6px 18px; }

/* ---- Game: nổ bóng từ vựng ---- */
.game { align-items: center; }
.gprompt { display: flex; align-items: center; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 6px 0 14px; }
.gpic { width: min(34vw, 220px); aspect-ratio: 1; object-fit: cover; border-radius: 24px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.gtext { font-weight: 900; font-size: clamp(22px, 4vw, 32px); text-align: center; }
.balloons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 18px; width: min(100%, 640px); }
.balloons.n3 { grid-template-columns: repeat(3, 1fr); }
.balloon { position: relative; aspect-ratio: 0.86; border: 0; border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; display: grid; place-items: center; padding: 14px; cursor: pointer;
  font: inherit; color: #fff; box-shadow: inset -10px -12px 0 rgba(0,0,0,.12), inset 8px 8px 0 rgba(255,255,255,.25); animation: bob 3s ease-in-out infinite; }
.balloon::after { content: ""; position: absolute; left: 50%; bottom: -26px; width: 3px; height: 26px; background: rgba(0,0,0,.25); transform: translateX(-50%); }
.balloon.b0 { background: #ff6b57; } .balloon.b1 { background: #3b82f6; animation-delay: -.8s; }
.balloon.b2 { background: #22b573; animation-delay: -1.6s; } .balloon.b3 { background: #f5a000; animation-delay: -2.2s; }
.balloon img { width: 78%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: #fff; }
.balloon .bw { font-weight: 900; font-size: clamp(22px, 5vw, 38px); text-shadow: 0 2px 0 rgba(0,0,0,.2); word-break: break-word; }
.balloon.wrong { animation: shake .4s; opacity: .35; }
.balloon.pop { animation: balloonpop .45s forwards; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes balloonpop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(0); opacity: 0; } }
.shelf { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 2px; }
.shelf-i { width: 64px; height: 64px; display: grid; place-items: center; font-size: 40px; background: #fff; border-radius: 18px; box-shadow: inset 0 0 0 3px #ffdd7a; }

/* ---- Lịch sử đã học ---- */
.history { margin-top: 22px; background: #fff; border-radius: 22px; padding: 6px 14px 12px; box-shadow: inset 0 0 0 3px var(--edge); }
.history summary { cursor: pointer; font-weight: 900; font-size: clamp(18px, 3vw, 24px); padding: 10px 2px; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history summary b { color: var(--muted); margin-left: 6px; }
.hday { margin: 12px 2px 6px; font-weight: 900; color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.hrow { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #faf6ec; border-radius: 16px; padding: 8px 12px; margin-bottom: 8px; font: inherit; cursor: pointer; text-align: left; }
.hrow img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.hnm { flex: 1; font-weight: 800; font-size: clamp(16px, 2.6vw, 20px); color: var(--ink); }
.hst { font-weight: 900; color: #e69a00; }

/* ---- Danh sách trò chơi + các trò ---- */
.glist { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.gcard { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 20px 14px 16px; min-height: 96px; border: 0; border-radius: 28px; background: #fff; font: inherit; text-align: left; cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--edge), 0 5px 0 var(--edge); }
.gcard .gico { font-size: 52px; line-height: 1; width: 64px; text-align: center; }
.gcard .ginfo { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gcard .gn { font-weight: 900; font-size: clamp(22px, 3.8vw, 30px); color: var(--ink); }
.gcard .gd { font-weight: 700; font-size: clamp(14px, 2.4vw, 18px); color: var(--muted); }
.gcard .gtag { font-weight: 900; font-size: 14px; background: #f3eee3; color: var(--muted); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.gcard.locked, .gcard.wait { filter: grayscale(.85); opacity: .7; }
.mgrid { display: grid; gap: 12px; width: min(100%, 560px); }
.mgrid.c3 { grid-template-columns: repeat(3, 1fr); } .mgrid.c4 { grid-template-columns: repeat(4, 1fr); }
.mcard { aspect-ratio: 1; border: 0; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(180deg, #5b9bff, #3b82f6); color: #fff; font-size: 44px; padding: 6px; cursor: pointer; box-shadow: 0 5px 0 #1f5fd1; }
.mcard.up { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 4px #ffdd7a; } .mcard.ok { box-shadow: inset 0 0 0 4px #22b573; }
.mcard img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; } .mcard .bw { font-weight: 900; font-size: clamp(16px, 4vw, 28px); }
.slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 16px; }
.slot { width: clamp(40px, 11vw, 62px); height: clamp(52px, 13vw, 74px); border-radius: 14px; background: #fff; box-shadow: inset 0 -5px 0 var(--edge); display: grid; place-items: center; font-weight: 900; font-size: clamp(26px, 7vw, 40px); }
.slot.on { background: #e3f4e9; color: #1d6b43; }
.tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; width: min(100%, 640px); }
.tile { min-width: 64px; min-height: 64px; border: 0; border-radius: 18px; background: linear-gradient(180deg, #ffd35c, #ffc83d); font: inherit; font-weight: 900; font-size: clamp(26px, 6vw, 38px); color: #5a3b00; box-shadow: 0 5px 0 #d49b00; cursor: pointer; padding: 6px 16px; }
.tile.wd { font-size: clamp(18px, 3.6vw, 26px); } .tile:disabled { opacity: .3; box-shadow: none; } .tile.wrong, .gopt.wrong, .ocard.wrong { animation: shake .4s; }
.ansline { min-height: 64px; width: min(100%, 640px); background: #fff; border-radius: 18px; box-shadow: inset 0 -5px 0 var(--edge); padding: 12px 16px; margin-bottom: 14px; font-weight: 900; font-size: clamp(20px, 4vw, 28px); text-align: center; }
.ansline.bad { box-shadow: inset 0 0 0 4px var(--red); } .aw { display: inline-block; margin: 0 3px; }
.clearbtn { margin-top: 14px; border: 0; background: #fff; border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 800; box-shadow: inset 0 0 0 3px var(--edge); cursor: pointer; }
.gsent { font-weight: 900; font-size: clamp(22px, 4.4vw, 32px); text-align: center; line-height: 1.5; margin: 6px 0 18px; width: min(100%, 720px); }
.gap { display: inline-block; min-width: 90px; border-bottom: 5px solid var(--blue); } .filled { color: #1d6b43; }
.gopts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.gopt { min-height: 68px; padding: 8px 28px; border: 0; border-radius: 20px; background: #fff; font: inherit; font-weight: 900; font-size: clamp(22px, 4vw, 30px); box-shadow: inset 0 0 0 3px var(--edge), 0 5px 0 var(--edge); cursor: pointer; }
.gopt.right { background: #e3f4e9; box-shadow: inset 0 0 0 4px #22b573; } .gopt:disabled { opacity: .4; }
.ocards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; width: 100%; }
.ocard { position: relative; display: flex; gap: 10px; align-items: center; border: 0; border-radius: 20px; background: #fff; padding: 8px; font: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 3px var(--edge), 0 4px 0 var(--edge); }
.ocard img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex: none; } .otx { font-weight: 800; font-size: clamp(15px, 2.6vw, 19px); color: var(--ink); }
.ocard.got { box-shadow: inset 0 0 0 4px #22b573; background: #f0fbf4; }
.onum { position: absolute; top: -8px; left: -8px; width: 34px; height: 34px; border-radius: 50%; background: #22b573; color: #fff; font-weight: 900; display: grid; place-items: center; }

/* Bản đồ trò chơi */
.gmap { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 0 40px; }
.mlevel { text-align: center; font-weight: 900; font-size: clamp(18px, 3vw, 24px); background: #fff3c4; border-radius: 999px; padding: 8px 18px; margin: 14px auto 4px; }
.mlevel.locked { background: #eee8da; color: var(--muted); }
.mnode-row { display: flex; align-items: center; gap: 14px; position: relative; padding: 4px 0; }
.mnode-row.l { padding-left: 14%; } .mnode-row.r { padding-left: 42%; }
.mnode-row::before { content: ""; position: absolute; left: 50%; top: -10px; height: 14px; border-left: 6px dotted #e3d9c0; }
.mnode { width: 84px; height: 84px; border-radius: 50%; border: 0; background: #7bd0a0; box-shadow: 0 6px 0 #4aa878; font-size: 40px; cursor: pointer; flex: none; }
.mnode.boss { width: 100px; height: 100px; background: #ffc94d; box-shadow: 0 6px 0 #d9a21c; font-size: 48px; }
.mnode.done { background: #8fd9ff; box-shadow: 0 6px 0 #4aa4d4; }
.mnode.locked { background: #d7d2c6; box-shadow: 0 6px 0 #b3ad9f; filter: grayscale(.8); opacity: .8; }
.mnode.cur { animation: mpulse 1.2s ease-in-out infinite; outline: 5px solid #ff8a3d; outline-offset: 3px; }
@keyframes mpulse { 50% { transform: scale(1.08); } }
.mlabel { display: flex; flex-direction: column; font-size: clamp(15px, 2.6vw, 20px); color: var(--ink); }
.mst { font-style: normal; letter-spacing: 2px; }

.example { margin-top: 10px; font-weight: 700; font-size: clamp(16px, 2.8vw, 22px); color: var(--muted); text-align: center; max-width: 90%; }
.example b { color: var(--ink); background: #ffec96; border-radius: 6px; padding: 0 4px; }
.sec { font-weight: 900; font-size: clamp(18px, 3vw, 24px); margin: 14px 4px 6px; }
.listen .text .w { padding: 0 6px; }

.qnav { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 2px; }
.qchip { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #d9d2c3; background: #fff; font: inherit; font-weight: 900; font-size: 20px; color: var(--ink); cursor: pointer; }
.qchip.got { background: #bff0cf; border-color: #4aa878; }
.qchip.bad { background: #ffd2cf; border-color: #e5645c; }
.qchip.on { transform: scale(1.18); box-shadow: 0 0 0 4px var(--red); }
.opt.sel { outline: 5px solid #ff8a3d; background: #fff3e0; }
.hintbtn { margin-top: 8px; border: 0; border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 900; font-size: 18px; background: #ffec96; cursor: pointer; }
.qinfo { font-weight: 800; color: var(--muted); text-align: center; flex: 1; padding: 0 8px; }
.bar .go[hidden] { display: none; }
