/* Luyện nói với Lisa (public/js/talk.js): màn giới thiệu, sân khấu Lisa, bong bóng hội thoại, khay micro / bàn phím, tổng kết. */
#screen-talk { background: radial-gradient(120% 70% at 50% -10%, #8fe0ff 0%, #2bb3e3 38%, #0d6f9c 100%); overflow: hidden; }
#screen-talk::before { content: ""; position: fixed; inset: 0; background: url("/assets/bg/bg_jungle.webp") center bottom / cover no-repeat; opacity: 0.16; pointer-events: none; }
.tkwrap { position: relative; height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; font-family: var(--font-ui); color: var(--ink); }
.tkwrap.intro { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(14px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); }

/* ---- giới thiệu ---- */
.tk-intro { margin: auto 0; background: var(--paper); border-radius: 30px; padding: 26px 20px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; box-shadow: 0 24px 60px rgba(4, 40, 70, 0.4); animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.tk-badge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #ff9a9a, #e53935); box-shadow: 0 0 0 8px rgba(229, 57, 53, 0.2), 0 12px 24px rgba(120, 0, 0, 0.3); color: #fff; }
.tk-badge .ico { width: 54px; height: 54px; }
.tk-intro .btn-cta { align-self: stretch; }
.tk-intro .btn-cta:disabled { opacity: 0.45; filter: grayscale(0.4); }
.tk-ai { margin: 0; padding: 8px 12px; border-radius: 14px; background: #fff0d6; color: #8a5a10; font-size: 13px; font-weight: 800; line-height: 1.4; }
.tk-ai.on { background: #e3f8eb; color: #1b6e41; }
.tk-sr { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: #fff6e0; text-align: left; }
.tk-sr b { font-size: 14px; color: var(--wood-d); }
.tk-srb { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid #eadfc6; border-radius: 14px; background: #fff; font: 700 14px var(--font-ui); color: var(--ink); text-align: left; cursor: pointer; }
.tk-srb .ico { width: 22px; height: 22px; flex: none; color: #1f8fc4; }
.tk-srb.on { border-color: #2fb36d; box-shadow: 0 0 0 3px rgba(47, 179, 109, 0.2); }
.tk-srb:disabled { opacity: 0.45; }
.tk-note { margin: 0; font-size: 13px; line-height: 1.45; color: #6b5636; display: flex; align-items: center; gap: 6px; justify-content: center; }
.tk-note .ico { width: 18px; height: 18px; }

/* ---- màn hội thoại ---- */
.tkwrap.live { padding: max(8px, env(safe-area-inset-top)) 0 0; }
.tk-top { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; }
.tk-top .icon-btn { flex: none; width: 40px; height: 40px; padding: 9px; }
.tk-prog { flex: 1; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.tk-prog i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #ffd96b, #ff7a1a); transition: width 0.5s ease; }
.tk-timer { flex: none; min-width: 58px; padding: 6px 10px; border-radius: 999px; background: rgba(6, 30, 50, 0.72); color: #fff; font-family: var(--font-display); font-size: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.tk-timer.low { background: var(--red); animation: pulse 1s ease-in-out infinite; }
.tk-stage { position: relative; flex: 0 0 clamp(150px, 30vh, 260px); margin: 0 12px; border-radius: 22px; background: #1fa7d6 center 70% / cover no-repeat; overflow: hidden; box-shadow: 0 10px 26px rgba(4, 40, 70, 0.35); }
.tk-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(4, 22, 40, 0.35)); pointer-events: none; }
.tk-stage.time-night::before, .tk-stage.time-evening::before { content: ""; position: absolute; inset: 0; background: rgba(10, 20, 60, 0.35); }
.tk-stage.time-evening::before { background: rgba(120, 60, 20, 0.2); }
.tk-actor { position: absolute; left: 50%; bottom: 4%; height: 92%; transform: translateX(-50%); z-index: 2; transition: transform 0.4s ease; }
.tk-actor .sprite { height: 100%; }
.tk-actor.talking { transform: translateX(-50%) scale(1.03); }
.tk-actor.listening .sprite { animation: listen 1.2s ease-in-out infinite alternate; }
.tk-ai-tag { position: absolute; top: 10px; right: 10px; z-index: 3; padding: 3px 8px; border-radius: 999px; background: rgba(27, 110, 65, 0.85); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; }
.tk-ai-tag:empty { display: none; }
.tk-chat { flex: 1; min-height: 60px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.tk-b { max-width: 86%; padding: 10px 14px; border-radius: 20px; box-shadow: 0 4px 14px rgba(4, 40, 70, 0.18); animation: tkin 0.3s cubic-bezier(0.2, 1.2, 0.4, 1); }
.tk-b.lisa { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 6px; }
.tk-b.you { align-self: flex-end; background: #dff8e8; border-bottom-right-radius: 6px; }
.tk-bt { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.3; color: var(--wood-d); }
.tk-b.you .tk-bt { color: #15633a; font-size: 17px; }
.tk-bn { margin-top: 5px; padding-top: 5px; border-top: 1px dashed rgba(90, 45, 12, 0.18); font-size: 13.5px; line-height: 1.45; color: #6b5636; font-weight: 700; }
.tk-hits { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--font-ui); font-size: 13px; }
.tk-hits span { padding: 1px 8px; border-radius: 10px; background: #ffe9e5; color: #a3261b; font-weight: 800; }
.tk-hits span.ok { background: #c9f2d8; color: #15633a; }
.tk-sys { align-self: center; max-width: 92%; padding: 6px 12px; border-radius: 999px; background: rgba(6, 30, 50, 0.55); color: #fff; font-size: 12.5px; font-weight: 800; text-align: center; animation: tkin 0.3s ease; }
.tk-choices { align-self: flex-start; display: flex; flex-direction: column; gap: 6px; max-width: 92%; }
.tk-choices small { font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.tk-choice { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 2px solid #ffd96b; border-radius: 16px; background: #fff; font: 600 17px var(--font-display); color: var(--wood-d); text-align: left; cursor: pointer; box-shadow: 0 3px 0 #e7c35a; }
.tk-choice .ico { width: 18px; height: 18px; opacity: 0.6; flex: none; }
.tk-choice.on { background: #fff1c7; }
.tk-choice:disabled:not(.on) { opacity: 0.5; }
@keyframes tkin { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ---- khay dưới ---- */
.tk-dock { flex: none; padding: 6px 12px max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; background: linear-gradient(180deg, rgba(4, 22, 40, 0) 0%, rgba(4, 22, 40, 0.35) 40%); }
.tk-hint { min-height: 1.3em; color: #fff; font-weight: 800; font-size: 13.5px; text-align: center; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); }
.tk-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.tk-row2 { display: flex; justify-content: center; gap: 10px; }
.tk-row2 .tk-small { flex: 0 0 auto; padding: 9px 18px; }
.tk-micwrap { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; flex: none; }
.tk-micwrap[hidden] { display: none; }
.tk-wave { position: absolute; inset: -14px; width: 140px; height: 140px; pointer-events: none; }
.tk-mic { width: 84px; height: 84px; background: linear-gradient(180deg, #ff7a7a, #e53935); box-shadow: 0 6px 0 #a32020, 0 0 0 6px rgba(255, 255, 255, 0.35), 0 14px 28px rgba(0, 0, 0, 0.35); padding: 20px; color: #fff; border-radius: 50%; border: 0; position: relative; }
.tk-mic .ico { width: 100%; height: 100%; }
.tk-mic.on { background: linear-gradient(180deg, #4fd36f, #2e9e4f); box-shadow: 0 2px 0 #1e6b35, 0 0 0 8px rgba(79, 211, 111, 0.35), 0 14px 28px rgba(0, 0, 0, 0.35); transform: scale(1.06); }
.tk-mic:disabled { opacity: 0.45; filter: grayscale(0.5); }
.tk-small { flex: 1; max-width: 150px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; font: 800 12.5px var(--font-ui); cursor: pointer; backdrop-filter: blur(6px); }
.tk-small .ico { width: 18px; height: 18px; flex: none; }
.tk-small:active { transform: scale(0.96); }
.tk-small[hidden] { display: none; }
.tk-type { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.tk-type[hidden] { display: none; }
.tk-type input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border: 2px solid #eadfc6; border-radius: 999px; background: #fff; font: 700 16px var(--font-ui); color: var(--ink); outline: none; }
.tk-type input:focus { border-color: #1fa7d6; box-shadow: 0 0 0 4px rgba(31, 167, 214, 0.2); }
.tk-type input:disabled { opacity: 0.6; }
.tk-type .btn-round { width: 50px; height: 50px; padding: 12px; flex: none; }

/* ---- tổng kết ---- */
.tk-summary { margin: auto 16px; }
.tkwrap:has(.tk-summary) { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(14px, env(safe-area-inset-top)) 0 max(18px, env(safe-area-inset-bottom)); }

/* nút mở luyện nói ở kết quả bài ôn và thẻ ngày trên bản đồ */
.btn-cta.talk { background: linear-gradient(180deg, #ff8a8a, #e53935); box-shadow: 0 6px 0 #a32020, 0 14px 26px rgba(229, 57, 53, 0.35); }
.btn-cta.talk:active { box-shadow: 0 2px 0 #a32020; }
.btn-cta.talk .cta-text { font-size: 21px; }
.qz-talk-lock { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(90, 45, 12, 0.07); color: #8a7a62; font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.qz-talk-lock .ico { width: 16px; height: 16px; }
.mini-btn.big.talk { background: linear-gradient(180deg, #ff9a9a, #e53935); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #a32020; }
.dc-actions .mini-btn.big.talk { flex: 1 1 100%; justify-content: center; padding: 12px 14px; font-size: 15px; }
.dc-actions .mini-btn.big.talk .ico { width: 22px; height: 22px; }
.dc-talk-lock { display: flex; align-items: center; gap: 6px; }

@media (max-height: 640px) {
  .tk-stage { flex-basis: clamp(120px, 24vh, 180px); }
  .tk-micwrap { width: 92px; height: 92px; }
  .tk-mic { width: 70px; height: 70px; padding: 16px; }
  .tk-wave { inset: -10px; width: 112px; height: 112px; }
  .tk-bt { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .tk-b, .tk-sys, .tk-timer.low { animation: none; } }

/* ---- Sảnh Babelisa (public/js/talkhub.js renderMode): cảnh theo giờ, nhân vật sống, thẻ lối chính, thống kê, lối tắt ---- */
#screen-mode { background: #07243d; }
.lobby { background: #0b2a40; overflow: hidden; }
.lobby .scene-layer { transform: scale(1.04); transition: transform 1.6s ease-out; }
.lobby.in .scene-layer { transform: none; }
.lobby-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 25, 45, 0.42) 0%, rgba(5, 25, 45, 0) 22%, rgba(5, 25, 45, 0) 48%, rgba(4, 22, 40, 0.55) 72%, rgba(4, 22, 40, 0.92) 100%); }
.lobby.time-night .lobby-vignette { background: linear-gradient(180deg, rgba(2, 10, 30, 0.3) 0%, rgba(2, 10, 30, 0) 30%, rgba(2, 10, 30, 0.6) 70%, rgba(2, 10, 30, 0.95) 100%); }
/* nhân vật */
.lobby-actors { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lobby-actors .actor { bottom: 41%; height: 33%; pointer-events: auto; cursor: pointer; transition: left 1.8s cubic-bezier(0.3, 0.1, 0.3, 1), bottom 0.6s ease, opacity 0.4s ease, transform 0.6s ease; }
.lobby-actors .actor.lb-pablo { height: 11%; }
.lobby-actors .actor.walking .sprite { animation: walk 0.42s linear infinite; }
.lobby-actors .actor.lb-leo .sprite { transform: scaleX(-1); }
.lb-bubble { position: absolute; left: 48%; bottom: 72%; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 9px 14px 8px; border: 0; border-radius: 20px 20px 20px 6px; background: var(--paper); color: var(--wood-d); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28); cursor: pointer; pointer-events: auto; opacity: 0; transform: translateY(8px) scale(0.9); transition: opacity 0.4s 1s, transform 0.5s 1s cubic-bezier(0.2, 1.4, 0.4, 1); }
.lobby.in .lb-bubble { opacity: 1; transform: none; }
.lb-bubble[hidden] { display: none; }
.lb-bubble b { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 5vmin, 24px); line-height: 1.1; white-space: nowrap; }
.lb-bubble small { font-size: 11px; font-weight: 800; color: #8a7a62; letter-spacing: 0.04em; }
.lb-bubble.pop { animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
/* thanh trên + logo */
.lobby-top { position: absolute; z-index: 6; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lobby-icons { display: flex; align-items: center; gap: 8px; }
.lobby-icons .ui-lang { padding: 3px; }
.lobby-icons .ui-lang button { padding: 5px 9px; font-size: 12px; }
.lobby-logo { position: absolute; z-index: 3; left: 0; right: 0; top: max(60px, calc(env(safe-area-inset-top) + 52px)); display: flex; justify-content: center; pointer-events: none; }
.lobby-logo .logo-img { width: min(58%, 240px); filter: drop-shadow(0 8px 14px rgba(20, 10, 0, 0.35)); transform: translateY(-14px); opacity: 0; transition: transform 0.7s 0.15s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.5s 0.15s; }
.lobby.in .lobby-logo .logo-img { transform: none; opacity: 1; }
/* bảng dưới */
.lobby-panel { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; max-height: 62%; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(255, 246, 230, 0.99)); box-shadow: 0 -16px 50px rgba(2, 24, 44, 0.5), inset 0 1px 0 #fff; transform: translateY(40px); opacity: 0; transition: transform 0.6s 0.1s cubic-bezier(0.2, 1.2, 0.3, 1), opacity 0.4s 0.1s; }
.lobby-panel::-webkit-scrollbar { display: none; }
.lobby.in .lobby-panel { transform: none; opacity: 1; }
.lb-head { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.lb-kicker { font-weight: 900; font-size: 11px; letter-spacing: 0.18em; color: #c27a12; }
.lb-greet { font-family: var(--font-display); font-size: 20px; color: var(--wood-d); }
.lb-greet b { color: var(--orange); }
/* thẻ lối chính */
.lb-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 12px 13px 12px; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 #e7dcc3, 0 10px 24px rgba(90, 45, 12, 0.08); text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font-ui); transition: transform 0.14s, box-shadow 0.14s; opacity: 0; transform: translateY(14px); animation: lbcard 0.5s 0.25s both cubic-bezier(0.2, 1.2, 0.4, 1); }
.lb-card.talk { animation-delay: 0.35s; }
@keyframes lbcard { to { opacity: 1; transform: none; } }
.lb-card:active, .lb-card.chosen { transform: translateY(3px) !important; box-shadow: 0 2px 0 #e7dcc3; }
.lb-card.chosen { background: #fff6e0; }
.lb-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: linear-gradient(135deg, rgba(255, 211, 107, 0.9), rgba(255, 122, 26, 0.5) 40%, rgba(31, 167, 214, 0.5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: 0.9; }
.lb-card.app { animation-delay: 0.45s; }
.lb-card.app::before { background: linear-gradient(135deg, rgba(79, 201, 242, 0.9), rgba(31, 143, 196, 0.55) 40%, rgba(255, 211, 107, 0.6)); }
.lb-card.app .lb-ico { background: linear-gradient(160deg, #4fc9f2, #1f8fc4); box-shadow: 0 5px 0 #146b96, inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.lb-card.rem { animation-delay: 0.5s; }
.lb-card.rem::before { background: linear-gradient(135deg, rgba(255, 211, 107, 0.9), rgba(240, 169, 58, 0.55) 40%, rgba(79, 201, 242, 0.5)); }
.lb-card.rem .lb-ico { background: linear-gradient(160deg, #ffe37a, #f0a93a); box-shadow: 0 5px 0 #b9741a, inset 0 2px 0 rgba(255, 255, 255, 0.45); font-size: 30px; }
.lb-card.rem.on .lb-ico { background: linear-gradient(160deg, #5be08e, #2fb36d); box-shadow: 0 5px 0 #1f7d4b, inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.lb-dot.rem { background: #f0a93a; box-shadow: 0 0 0 3px rgba(240, 169, 58, 0.2); }
.lb-dot.app { background: #1fa7d6; box-shadow: 0 0 0 3px rgba(31, 167, 214, 0.2); }
.lb-card.talk::before { background: linear-gradient(135deg, rgba(255, 138, 138, 0.9), rgba(229, 57, 53, 0.55) 40%, rgba(255, 211, 107, 0.6)); }
.lb-ico { flex: none; width: 60px; height: 60px; border-radius: 19px; display: grid; place-items: center; padding: 14px; color: #fff; background: linear-gradient(160deg, #ffc247, #ff7a1a); box-shadow: 0 5px 0 #c75a0a, inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.lb-card.talk .lb-ico { background: linear-gradient(160deg, #ff9a9a, #e53935); box-shadow: 0 5px 0 #a32020, inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.lb-ico .ico { width: 100%; height: 100%; }
.lb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lb-text b { font-family: var(--font-display); font-size: 19px; line-height: 1.15; color: var(--wood-d); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-text small { font-size: 12.5px; line-height: 1.4; color: #6b5636; font-weight: 700; }
.lb-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; font-weight: 900; color: #1b6e41; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fb36d; box-shadow: 0 0 0 3px rgba(47, 179, 109, 0.2); flex: none; }
.lb-dot.talk { background: #e53935; box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.18); }
.lb-bar { display: block; height: 7px; margin-top: 4px; border-radius: 99px; background: #efe4c9; overflow: hidden; }
.lb-bar[hidden] { display: none; }
.lb-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #ffd96b, #ff7a1a); transition: width 0.8s ease; }
.lb-ai { font: 900 10.5px var(--font-ui); letter-spacing: 0.08em; padding: 3px 7px; border-radius: 999px; background: #1b6e41; color: #fff; font-style: normal; }
.lb-ai[hidden] { display: none; }
.lb-arrow { flex: none; width: 24px; height: 24px; color: #d9c49a; }
.lb-arrow .ico { width: 100%; height: 100%; }
/* thống kê */
.lb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lb-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 6px 8px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #e7dcc3; }
.lb-stat b { font-family: var(--font-display); font-size: 20px; line-height: 1; color: var(--wood-d); }
.lb-stat small { font-size: 11px; font-weight: 800; color: #8a7a62; }
.lb-stat-ico { width: 26px; height: 26px; }
.lb-stat-ico .ico { width: 100%; height: 100%; }
.lb-ring { position: relative; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(#2fb36d calc(var(--p, 0) * 1%), #efe4c9 0); display: grid; place-items: center; }
.lb-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.lb-ring i { position: relative; font: 800 12px var(--font-ui); color: var(--wood-d); font-style: normal; }
/* lối tắt */
.lb-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lb-q { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border: 0; border-radius: 16px; background: rgba(90, 45, 12, 0.06); color: var(--wood-d); font-family: var(--font-ui); cursor: pointer; }
.lb-q:active { transform: scale(0.96); }
.lb-q:disabled { opacity: 0.45; }
.lb-q > span { width: 26px; height: 26px; display: block; }
.lb-q > span .ico { width: 100%; height: 100%; }
.lb-q > span.flag { font-size: 22px; line-height: 26px; text-align: center; }
.lb-q b { font-size: 11.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lb-q em { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font: 900 11px var(--font-ui); display: flex; align-items: center; justify-content: center; font-style: normal; border: 2px solid #fff; }
.lb-q.hot { background: #fff0d6; }
.lb-tip { margin: 0; padding: 8px 12px; border-radius: 14px; background: #eef7f1; color: #2e5d44; font-size: 12.5px; line-height: 1.45; font-weight: 700; }
.lb-tip b { color: #1b6e41; }
@media (max-height: 700px) {
  .lobby-panel { max-height: 57%; gap: 8px; }
  .lobby-actors .actor { bottom: 46%; height: 28%; }
  .lb-bubble { bottom: 75%; }
  .lb-tip { display: none; }
}
@media (min-width: 600px) {
  .lobby-panel { left: 50%; right: auto; width: 520px; transform: translate(-50%, 40px); border-radius: 30px; bottom: 16px; }
  .lobby.in .lobby-panel { transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .lb-card { animation: none; opacity: 1; transform: none; }
  .lobby .scene-layer, .lobby-panel, .lobby-logo .logo-img, .lb-bubble { transition: none; transform: none; opacity: 1; }
}

/* ---- chọn ngôn ngữ + ngày để luyện nói ---- */
.tp-panel h2 { margin: 0 0 4px; }
.tp-sub { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: #6b5636; }
.tp-label { display: block; margin: 10px 0 6px; font-weight: 900; font-size: 11.5px; letter-spacing: 0.14em; color: #c27a12; text-transform: uppercase; }
.tp-langs { flex: none; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.tp-langs::-webkit-scrollbar { display: none; }
.tp-lang { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border: 2px solid #eadfc6; border-radius: 14px; background: #fff; font-family: var(--font-ui); color: var(--ink); cursor: pointer; }
.tp-lang b { font-family: var(--font-display); font-size: 16px; color: var(--wood-d); white-space: nowrap; }
.tp-lang small { font-size: 11px; font-weight: 800; color: #8a7a62; }
.tp-lang.on { border-color: #e53935; background: #fff1f0; box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.18); }
.tp-days { flex: none; display: flex; flex-direction: column; gap: 8px; }
.tp-ch { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 0; padding: 0 4px; }
.tp-ch b { font-family: var(--font-display); font-size: 15px; color: var(--wood-d); }
.tp-ch small { font-size: 12.5px; font-weight: 800; color: #8a7a62; }
.tp-day { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 8px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #e7dcc3; text-align: left; cursor: pointer; font-family: var(--font-ui); color: var(--ink); }
.tp-day:active { transform: translateY(2px); box-shadow: 0 2px 0 #e7dcc3; }
.tp-num { flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: #fff0d6; color: #8a5a10; font-family: var(--font-display); font-size: 18px; }
.tp-day.done .tp-num { background: #dff8e8; color: #15633a; }
.tp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tp-text b { font-family: var(--font-display); font-size: 16px; color: var(--wood-d); display: flex; align-items: center; gap: 4px; }
.tp-text b i { display: inline-flex; width: 16px; height: 16px; color: #2fb36d; }
.tp-text b i .ico { width: 100%; height: 100%; }
.tp-text small { font-size: 12.5px; font-weight: 700; color: #6b5636; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-text .tp-meta { color: #8a7a62; font-size: 11.5px; }
.tp-go { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 8px; color: #fff; background: linear-gradient(180deg, #ff8a8a, #e53935); box-shadow: 0 3px 0 #a32020; }
.tp-go .ico { width: 100%; height: 100%; }
.tp-loading { height: 40px; border-radius: 14px; background: linear-gradient(90deg, #f3ead6, #fff, #f3ead6); background-size: 200% 100%; animation: tpload 1.2s linear infinite; }
@keyframes tpload { to { background-position: -200% 0; } }
/* ---- chọn ngôn ngữ + ngày để luyện nói (renderTalkPicker): rừng theo giờ, Lisa chào bằng tiếng đã chọn, thẻ ngôn ngữ, lọc, gợi ý ---- */
#screen-talkpick { background: #07243d; }
.tpk { background: #0b2a40; overflow: hidden; }
.tpk .scene-layer { transform: scale(1.04); transition: transform 1.6s ease-out; }
.tpk.in .scene-layer { transform: none; }
.tpk-actors { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tpk-actors .actor { bottom: 48%; height: 30%; pointer-events: auto; cursor: pointer; }
.tpk-actors .actor.tpk-pablo { height: 10%; }
.tpk-bubble { left: 44%; bottom: 76%; }
.tpk.in .tpk-bubble { opacity: 1; transform: none; }
.tpk-title { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(6, 30, 50, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; font-family: var(--font-display); font-size: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.tpk-title .ico { width: 20px; height: 20px; }
.tpk-panel { max-height: 54%; gap: 8px; padding-bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px); }
.tpk.in .tpk-panel { transform: none; opacity: 1; }
.tpk-langs { flex: none; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; scroll-snap-type: x proximity; }
.tpk-langs::-webkit-scrollbar { display: none; }
.tpk-lang { flex: none; width: 104px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 10px 8px; border: 2px solid #eadfc6; border-radius: 16px; background: #fff; font-family: var(--font-ui); color: var(--ink); cursor: pointer; text-align: left; scroll-snap-align: start; transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s; }
.tpk-lang:active { transform: scale(0.97); }
.tpk-flag { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.tpk-lang b { font-family: var(--font-display); font-size: 15px; color: var(--wood-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tpk-lang small { font-size: 10.5px; font-weight: 800; color: #8a7a62; }
.tpk-lang em { margin-top: 4px; font: 800 10.5px var(--font-ui); font-style: normal; color: #1b6e41; display: inline-flex; align-items: center; gap: 3px; }
.tpk-lang em.new { color: #c27a12; }
.tpk-lang em .ico { width: 12px; height: 12px; }
.tpk-lang.on { border-color: #e53935; background: linear-gradient(180deg, #fff, #fff1f0); box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.16), 0 6px 14px rgba(229, 57, 53, 0.15); }
.tpk-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.tpk-sum:empty { display: none; }
.tpk-sum span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: #fff; box-shadow: 0 2px 0 #e7dcc3; font-size: 12px; font-weight: 800; color: #6b5636; }
.tpk-sum span .ico { width: 14px; height: 14px; }
.tpk-sum span.rec { background: #fff1c7; color: #8a5a10; }
.tpk-filters { flex: none; display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(90, 45, 12, 0.07); }
.tpk-f { flex: 1; padding: 7px 4px; border: 0; border-radius: 999px; background: none; font: 800 12px var(--font-ui); color: #8a7a62; cursor: pointer; white-space: nowrap; }
.tpk-f.on { background: #fff; color: var(--wood-d); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.tpk-days { gap: 8px; }
.tpk-ch { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; padding: 0 2px; }
.tpk-ch-ico { flex: none; width: 34px; height: 34px; border-radius: 11px; background: #fff; padding: 6px; box-shadow: 0 2px 0 #e7dcc3; }
.tpk-ch-ico .ico { width: 100%; height: 100%; }
.tpk-ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tpk-ch-text b { font-family: var(--font-display); font-size: 15px; color: var(--wood-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpk-ch-text small { font-size: 11.5px; font-weight: 800; color: #8a7a62; }
.tpk-ch-bar { flex: none; width: 54px; height: 7px; border-radius: 99px; background: #efe4c9; overflow: hidden; }
.tpk-ch-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff8a8a, #e53935); }
.tpk-day { transition: transform 0.14s, box-shadow 0.14s; }
.tpk-day.rec { background: linear-gradient(180deg, #fffdf6, #fff4d6); box-shadow: 0 4px 0 #e7c35a, 0 0 0 2px #ffd96b; }
.tpk-day.chosen { transform: translateY(2px); box-shadow: 0 2px 0 #e7dcc3; background: #fff6e0; }
.tpk-day .tp-num { position: relative; flex-direction: column; }
.tpk-stars { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); display: flex; gap: 0; }
.tpk-stars i { width: 12px; height: 12px; filter: grayscale(1) opacity(0.35); }
.tpk-stars i.on { filter: none; }
.tpk-stars .ico { width: 100%; height: 100%; }
.tpk-rec { font: 900 10px var(--font-ui); font-style: normal; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; background: #ffd96b; color: #5a2d0c; }
.tpk-day .tp-text b i { width: 16px; height: 16px; }
.tpk-day .tp-meta b { display: inline; font: inherit; color: #1b6e41; }
.tpk-empty { margin: 8px 0; padding: 14px; border-radius: 14px; background: #fff; text-align: center; font-size: 13px; font-weight: 700; color: #8a7a62; }
.tpk-cta { position: absolute; z-index: 7; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); height: 58px; font-size: 20px; }
.tpk-cta[hidden] { display: none; }
.tpk-cta .cta-icon { width: 28px; height: 28px; }
@media (max-height: 700px) {
  .tpk-panel { max-height: 65%; }
  .tpk-actors .actor { bottom: 57%; height: 24%; }
  .tpk-actors .actor.tpk-pablo { bottom: 74%; }
  .tpk-bubble { bottom: 82%; }
  .tpk-lang { width: 92px; padding: 7px 9px 6px; }
  .tpk-flag { font-size: 18px; margin-bottom: 2px; }
}
@media (min-width: 600px) {
  .tpk-panel { left: 50%; right: auto; width: 520px; transform: translate(-50%, 40px); border-radius: 30px; bottom: 86px; }
  .tpk.in .tpk-panel { transform: translate(-50%, 0); }
  .tpk-cta { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
}

/* bong bóng đang nói: chữ hiện dần khi nhận diện */
.tk-b.you.live { background: #eef7f1; border: 2px dashed #9fd8b5; box-shadow: none; animation: tklive 1.2s ease-in-out infinite alternate; }
.tk-b.you.live .tk-bt { color: #2e7d4f; min-width: 60px; }
.tk-b.you.live small { display: block; margin-top: 2px; font-size: 11px; font-weight: 800; color: #6ea888; }
@keyframes tklive { from { opacity: 0.75; } to { opacity: 1; } }

/* ---- phòng chuẩn bị (màn giới thiệu luyện nói v2) ---- */
.tkwrap.intro2 { padding: 0; overflow: hidden; background: #0b2a40; }
.tk2-scene { position: absolute; inset: 0; background: #1fa7d6 center 60% / cover no-repeat; transform: scale(1.04); transition: transform 1.6s ease-out; }
.intro2.in .tk2-scene { transform: none; }
.tk2-lisa { position: absolute; left: 32%; bottom: 44%; height: 34%; z-index: 2; transform: translateX(-50%); cursor: pointer; }
.tk2-lisa .sprite { height: 100%; }
.tk2-pablo { position: absolute; left: 76%; bottom: 68%; height: 11%; z-index: 2; cursor: pointer; }
.tk2-pablo .sprite { height: 100%; aspect-ratio: 760 / 1200; }
.tk2-bubble { left: 46%; bottom: 74%; z-index: 3; }
.intro2.in .tk2-bubble { opacity: 1; transform: none; }
.intro2 .tk-ai-tag { top: calc(max(10px, env(safe-area-inset-top)) + 54px); right: 14px; }
.tk2-panel { max-height: 58%; gap: 8px; padding-bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px); }
.intro2.in .tk2-panel { transform: none; opacity: 1; }
.tk2-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tk2-head b { font-family: var(--font-display); font-size: 22px; line-height: 1.15; color: var(--wood-d); }
.tk2-head small { font-size: 12.5px; font-weight: 800; color: #8a7a62; }
.tk2-plan { display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; }
.tk2-step { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px 5px 6px; border-radius: 999px; background: #fff; box-shadow: 0 2px 0 #e7dcc3; font-size: 11.5px; font-weight: 900; color: var(--wood-d); animation: tkin 0.4s var(--d, 0s) both; }
.tk2-step i { width: 18px; height: 18px; display: inline-flex; }
.tk2-step i .ico { width: 100%; height: 100%; }
.tk2-plan em { width: 10px; height: 2px; background: #d9c49a; border-radius: 2px; }
.tk2-sub { margin: 0; font-size: 13px; line-height: 1.5; color: #6b5636; text-align: center; }
.tk2-words { display: flex; flex-wrap: wrap; gap: 6px; }
.tk2-word { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px 7px 8px; border: 2px solid #eadfc6; border-radius: 999px; background: #fff; font: 600 15px var(--font-display); color: var(--wood-d); cursor: pointer; animation: tkin 0.4s var(--d, 0s) both; transition: transform 0.12s, border-color 0.15s, background 0.15s; }
.tk2-word.s { font-size: 14px; }
.tk2-word .ico { width: 16px; height: 16px; opacity: 0.55; }
.tk2-word:active { transform: scale(0.96); }
.tk2-word.on { border-color: #e53935; background: #fff1f0; }
.tk2-word.on .ico { opacity: 1; color: #e53935; }
.tk2-sr { display: flex; gap: 6px; }
.tk2-srb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border: 2px solid #eadfc6; border-radius: 16px; background: #fff; font: 800 12px var(--font-ui); color: var(--wood-d); cursor: pointer; }
.tk2-srb .ico { width: 22px; height: 22px; color: #1f8fc4; }
.tk2-srb.on { border-color: #2fb36d; background: #eef9f2; box-shadow: 0 0 0 3px rgba(47, 179, 109, 0.18); }
.tk2-srb:disabled { opacity: 0.4; }
.tk2-srnote { margin: -2px 0 0; font-size: 12px; line-height: 1.4; color: #8a7a62; text-align: center; font-weight: 700; }
.tk2-meta { display: flex; flex-direction: column; gap: 6px; }
.tk2-ai { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 14px; background: #fff0d6; color: #8a5a10; font-size: 12.5px; font-weight: 800; line-height: 1.35; }
.tk2-ai.on { background: #e3f8eb; color: #1b6e41; }
.tk2-ai .ico { width: 16px; height: 16px; flex: none; }
.tk2-best { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 #e7dcc3; }
.tk2-best b { font-family: var(--font-display); font-size: 20px; color: var(--wood-d); }
.tk2-best small { font-size: 12px; font-weight: 800; color: #8a7a62; }
.tk2-stars { display: inline-flex; gap: 1px; }
.tk2-stars i { width: 18px; height: 18px; filter: grayscale(1) opacity(0.35); }
.tk2-stars i.on { filter: none; }
.tk2-stars .ico { width: 100%; height: 100%; }
.tk2-cta:disabled { opacity: 0.5; filter: grayscale(0.4); animation: none; }
@media (max-height: 700px) {
  .tk2-panel { max-height: 64%; }
  .tk2-lisa { bottom: 52%; height: 28%; }
  .tk2-pablo { bottom: 72%; }
  .tk2-bubble { bottom: 80%; }
  .tk2-sub { display: none; }
}
@media (min-width: 600px) {
  .tk2-panel { left: 50%; right: auto; width: 520px; transform: translate(-50%, 40px); border-radius: 30px; bottom: 86px; }
  .intro2.in .tk2-panel { transform: translate(-50%, 0); }
}

/* ---- màn hội thoại v2: dải bước, điểm, chuỗi, Pablo, nút trong bong bóng ---- */
.tk-score { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(6, 30, 50, 0.72); color: #ffd36b; font-family: var(--font-display); font-size: 15px; }
.tk-score .ico { width: 16px; height: 16px; }
.tk-steps { display: flex; align-items: center; gap: 4px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.tk-steps::-webkit-scrollbar { display: none; }
.tk-st { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.75); font-size: 11px; font-weight: 900; border: 1px solid rgba(255, 255, 255, 0.14); }
.tk-st i { width: 14px; height: 14px; display: inline-flex; }
.tk-st i .ico { width: 100%; height: 100%; }
.tk-st.now { background: #ffd36b; color: #5a2d0c; border-color: transparent; box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.3); }
.tk-st.done { background: rgba(47, 179, 109, 0.35); color: #fff; }
.tk-st-count { flex: none; margin-left: auto; font-size: 11px; font-weight: 900; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.tk-pablo { position: absolute; right: 8%; bottom: 46%; height: 13%; z-index: 2; cursor: pointer; }
.tk-pablo .sprite { height: 100%; aspect-ratio: 760 / 1200; }
.tk-combo { position: absolute; left: 10px; top: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 6px; border-radius: 999px; background: linear-gradient(180deg, #ffb13d, #ff7a1a); color: #fff; font-family: var(--font-display); font-size: 15px; box-shadow: 0 4px 0 #c75a0a; }
.tk-combo[hidden] { display: none; }
.tk-combo .ico { width: 18px; height: 18px; }
.tk-combo.bump { animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.tk-b.lisa { position: relative; padding-left: 48px; }
.tk-av { position: absolute; left: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 0 0 2px #ffd36b; }
.tk-av .ico { width: 100%; height: 100%; }
.tk-bacts { display: flex; gap: 6px; margin-top: 6px; }
.tk-bact { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; height: 28px; padding: 0 9px; border: 0; border-radius: 999px; background: rgba(90, 45, 12, 0.08); color: var(--wood-d); font: 800 11.5px var(--font-ui); cursor: pointer; }
.tk-bact .ico { width: 15px; height: 15px; }
.tk-bact:active { transform: scale(0.95); }
.tk-bscore { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 5px; }
.tk-bscore b { font-family: var(--font-display); font-size: 14px; color: #1b6e41; }
.tk-bscore.bad b { color: #a3261b; }
.tk-bstars { display: inline-flex; }
.tk-bstars i { width: 14px; height: 14px; filter: grayscale(1) opacity(0.35); }
.tk-bstars i.on { filter: none; }
.tk-bstars .ico { width: 100%; height: 100%; }
.tk3-lisa { height: 120px; margin: -10px auto -14px; }
.tk3-lisa .sprite { height: 100%; }
@media (max-height: 700px) { .tk-pablo { height: 12%; } .tk3-lisa { height: 96px; } }
/* dải mờ dưới bảng cuộn để nút "Bắt đầu" / "Luyện ngay" không đè lên chữ */
.tpk::after, .intro2::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 100px; z-index: 6; pointer-events: none; background: linear-gradient(180deg, rgba(255, 246, 230, 0) 0%, rgba(255, 246, 230, 0.96) 45%); }
@media (min-width: 600px) { .tpk::after, .intro2::after { display: none; } }
