/* Bé tập nói + Lời nhắn của ba mẹ (js/game-talk.js). Mọi lớp bắt đầu bằng gv- (gt- đã là của trò Tập tô).
   js đo chỗ còn lại dưới thanh trên rồi đặt --gv-h (chiều cao cả màn chơi); mỗi khung hình đặt --gv-l (độ to của micro 0..1)
   và --gv-m (độ mở miệng lúc nhại 0..1) lên .gv-box. data-state trên .gv-wrap: gate, wait, model, listen, parrot, cheer, miss, turn, paused, nomic, idle. */
body[data-scene="be-noi"] { --sky1: #FF8FC0; --sky2: #FFE8F2; }
body[data-scene="loi-nhan"] { --sky1: #FFB36B; --sky2: #FFF1DC; }
@media (min-width: 1040px) and (min-height: 561px) { body[data-scene="be-noi"] { --wide: 1280px; } }
/* trò này không chấm đúng sai: dòng khen chung ("Đúng rồi!", "Chính xác!") ẩn đi, lời khen riêng hiện trong ô lời của Gấu Con */
body[data-scene="be-noi"] #fx .praise { display: none; }

.gv-wrap { --gv-h: 520px; display: grid; grid-template: "tabs" auto "play" minmax(0, 1fr) "note" auto / minmax(0, 1fr); height: var(--gv-h); min-height: 0; }

/* ---------- hai thẻ chọn kiểu chơi ---------- */
.gv-tabs { grid-area: tabs; display: flex; justify-content: center; gap: clamp(8px, 2vw, 16px); margin-bottom: 10px; }
.gv-tab { flex: 1 1 0; min-width: 0; max-width: 440px; min-height: 68px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 10px;
  border-radius: 24px; background: rgba(255, 255, 255, .62); border: 4px solid rgba(255, 255, 255, .9); box-shadow: 0 5px 0 rgba(30, 42, 94, .14);
  color: var(--navy); -webkit-tap-highlight-color: transparent; transition: transform .12s, background .2s; }
.gv-tab .gv-tabpic { display: flex; font-size: clamp(30px, 8.4vw, 46px); filter: grayscale(.45); opacity: .8; }
.gv-tab .gv-tablabel { font-weight: 800; font-size: clamp(.9rem, 3.5vw, 1.25rem); line-height: 1.1; text-align: left; opacity: .75; }
.gv-tab.gv-on { background: #fff; border-color: var(--pink); box-shadow: 0 6px 0 color-mix(in srgb, var(--pink) 60%, #000), 0 10px 14px rgba(30, 42, 94, .18); transform: translateY(-2px); }
.gv-tab.gv-on .gv-tabpic { filter: none; opacity: 1; }
.gv-tab.gv-on .gv-tablabel { opacity: 1; }
.gv-tab:active { transform: translateY(2px); }

/* ---------- khu chơi ---------- */
.gv-play { grid-area: play; min-width: 0; min-height: 0; display: grid; gap: 10px; }
.gv-say { grid-template: "card" minmax(0, 1.12fr) "side" minmax(0, 1fr) "dots" auto / minmax(0, 1fr); }
.gv-say .dots { grid-area: dots; }
.gv-parrot { grid-template: "side" minmax(0, 1fr) "ctl" auto / minmax(0, 1fr); gap: 12px; }

/* thẻ hình của từ cần nói: ảnh thật phủ kín thẻ, hoặc hình 3D thật to */
.gv-card { grid-area: card; position: relative; container-type: size; display: grid; place-items: center; min-width: 0; min-height: 0; width: 100%; height: 100%; overflow: hidden;
  border-radius: 30px; border: 6px solid #fff; background: radial-gradient(circle at 50% 42%, #FFFDF2 0 38%, #FFE3A6 100%); box-shadow: var(--lift); -webkit-tap-highlight-color: transparent; }
.gv-card .gv-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.gv-card .gv-emo { font-size: min(66cqw, 62cqh); margin-bottom: 14cqh; filter: drop-shadow(0 .05em 0 rgba(30, 42, 94, .16)); pointer-events: none; }
.gv-name { position: absolute; left: 50%; bottom: clamp(6px, 4cqh, 16px); transform: translateX(-50%); box-sizing: border-box; max-width: calc(100% - 16px); padding: .04em .7em .1em; border-radius: 999px;
  background: rgba(255, 255, 255, .96); color: var(--navy); font: 700 clamp(24px, min(11cqw, 15cqh), 62px)/1.2 var(--font-letter); white-space: nowrap; box-shadow: 0 4px 0 rgba(30, 42, 94, .28); pointer-events: none; }
.gv-again { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: clamp(40px, 13cqh, 54px); aspect-ratio: 1; border-radius: 50%; background: var(--orange); border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(30, 42, 94, .25); pointer-events: none; }
.gv-again svg { width: 56%; height: 56%; fill: var(--navy); }
.gv-credit { position: absolute; left: 10px; top: 8px; max-width: 62%; padding: 1px 7px; border-radius: 999px; background: rgba(30, 42, 94, .45); color: #fff; font: 600 10px/1.4 var(--font-ui);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gv-card.gv-in { animation: gv-in .4s cubic-bezier(.3, 1.4, .5, 1); }
[data-state="model"] .gv-card { border-color: var(--yellow); }
[data-state="parrot"] .gv-card, [data-state="cheer"] .gv-card { border-color: var(--green); }

/* Gấu Con + ô lời + cột sóng */
.gv-side { grid-area: side; min-width: 0; min-height: 0; display: grid; grid-template: "bub" auto "box" minmax(0, 1fr) "live" auto / minmax(0, 1fr); gap: 8px; justify-items: center; align-items: center; }
.gv-live { grid-area: live; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-width: 0; }
.gv-bub { grid-area: bub; position: relative; z-index: 4; display: grid; place-items: center; box-sizing: border-box; width: 100%; max-width: 560px; min-height: 2.5em; margin: 0; padding: 4px 16px; border-radius: 22px; background: #FFFBE6; border: 4px solid var(--yellow);
  box-shadow: 0 5px 0 rgba(30, 42, 94, .18); font-weight: 800; font-size: clamp(1rem, min(4.2vw, 3.6vh), 1.5rem); line-height: 1.15; text-align: center; }
.gv-bub.gv-pop { animation: gv-in .3s cubic-bezier(.3, 1.5, .6, 1); }
[data-state="listen"] .gv-bub, [data-state="turn"] .gv-bub { background: #FFE6F1; border-color: var(--pink); }
[data-state="parrot"] .gv-bub, [data-state="cheer"] .gv-bub { background: #E8FBE6; border-color: var(--green); }
.gv-box { grid-area: box; position: relative; container-type: size; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gv-fig { position: relative; z-index: 1; display: block; width: min(94cqw, 94cqh); aspect-ratio: 1; transition: filter .2s, opacity .2s; }
.gv-fig.gv-in { animation: gv-in .4s cubic-bezier(.3, 1.4, .5, 1); }
.gv-puff { position: relative; display: block; width: 100%; height: 100%; transform-origin: 50% 92%; animation: bd-breathe 3.6s ease-in-out infinite; }
.gv-bear .mascot { animation: none; }
.gv-char .gv-puff { display: grid; place-items: center; font-size: min(78cqw, 78cqh); }
.gv-char img.emo { width: 86%; height: 86%; }
.gv-char .emo { filter: drop-shadow(0 .04em 0 rgba(30, 42, 94, .16)); }
/* lúc nghe: Gấu Con phồng lên theo tiếng bé; lúc nhại: nhún theo tiếng đang phát */
[data-state="listen"] .gv-puff { animation: none; transform: scale(calc(1 + var(--gv-l, 0) * .11)) rotate(calc(var(--gv-l, 0) * -3deg)); }
[data-state="parrot"] .gv-puff { animation: none; transform: translateY(calc(var(--gv-m, 0) * -3.5%)) scale(calc(1 + var(--gv-m, 0) * .05), calc(1 + var(--gv-m, 0) * .09)); }
/* cái miệng vẽ đè lên hình Gấu Con: mở theo tiếng đang phát (--gv-m), hoặc mấp máy đều khi trang đang đọc */
.gv-mouth { position: absolute; left: 49.6%; top: 37%; width: 9.5%; height: 8%; margin-left: -4.75%; border-radius: 46% 46% 50% 50% / 30% 30% 70% 70%;
  background: radial-gradient(ellipse at 50% 96%, #FF8A9B 0 42%, #5A2112 46%); transform: scaleY(0); transform-origin: 50% 0; opacity: 0; pointer-events: none; }
[data-state="parrot"] .gv-mouth { opacity: 1; transform: scaleY(calc(.12 + var(--gv-m, 0) * 1.1)); }
.gv-talk .gv-mouth { opacity: 1; animation: gv-chat .3s ease-in-out infinite alternate; }
/* vầng sáng sau lưng Gấu Con: to nhỏ theo tiếng bé */
.gv-halo { position: absolute; left: 50%; top: 50%; width: min(100cqw, 100cqh); aspect-ratio: 1; border-radius: 50%; opacity: 0; transition: opacity .25s;
  transform: translate(-50%, -50%) scale(calc(.72 + var(--gv-l, 0) * .42)); background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 44%, rgba(255, 210, 63, .6) 58%, rgba(255, 109, 179, .28) 66%, transparent 72%); pointer-events: none; }
[data-state="listen"] .gv-halo { opacity: 1; }
[data-state="parrot"] .gv-halo { opacity: .8; transform: translate(-50%, -50%) scale(calc(.72 + var(--gv-m, 0) * .36)); background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 44%, rgba(60, 203, 107, .5) 58%, transparent 70%); }
/* cái tai "đang nghe" và chiếc micro "đến lượt bé" */
.gv-ear, .gv-turn { position: absolute; z-index: 2; display: none; font-size: clamp(34px, min(30cqw, 30cqh), 110px); pointer-events: none; filter: drop-shadow(0 4px 0 rgba(30, 42, 94, .2)); }
.gv-ear { left: 0; top: 2%; }
.gv-turn { right: 0; bottom: 2%; }
[data-state="listen"] .gv-ear { display: block; animation: gv-wig .5s ease-in-out infinite alternate; }
[data-state="turn"] .gv-turn { display: block; animation: gv-bob .45s ease-in-out infinite alternate; }
[data-state="miss"] .gv-ear { display: block; }

.gv-meter { position: relative; box-sizing: border-box; display: flex; align-items: center; gap: 10px; flex: 0 1 400px; min-width: 0; height: clamp(54px, 9.5vh, 78px); padding: 6px 18px 6px 8px; overflow: hidden;
  border-radius: 999px; background: #fff; border: 4px solid #fff; box-shadow: 0 6px 0 rgba(30, 42, 94, .18); opacity: .5; transition: opacity .2s, border-color .2s; }
.gv-mic { display: grid; place-items: center; flex: none; font-size: clamp(32px, 6.4vh, 50px); filter: grayscale(.85); }
.gv-bars { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.gv-bars i { flex: 1 1 0; max-width: 20px; height: 100%; border-radius: 999px; background: var(--pink); transform: scaleY(.14); will-change: transform; }
.gv-bars i:nth-child(4n+1) { background: var(--orange); } .gv-bars i:nth-child(4n+2) { background: var(--pink); } .gv-bars i:nth-child(4n+3) { background: var(--purple); } .gv-bars i:nth-child(4n) { background: var(--blue); }
[data-state="listen"] .gv-meter { opacity: 1; border-color: var(--red); animation: gv-live .7s ease-in-out infinite alternate; }
[data-state="listen"] .gv-mic { filter: none; animation: gv-bob .45s ease-in-out infinite alternate; }
[data-state="parrot"] .gv-meter { opacity: 1; border-color: var(--green); }
[data-state="parrot"] .gv-bars i { background: var(--green); }
/* không có micro: thanh thời gian "đến lượt bé" chạy trong ô sóng */
[data-state="turn"] .gv-meter { opacity: 1; border-color: var(--pink); }
[data-state="turn"] .gv-meter::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: color-mix(in srgb, var(--pink) 30%, transparent); transform-origin: 0 50%; animation: gv-count 9s linear forwards; /* 9 giây: bằng thời gian chờ bé chạm vào Gấu Con (js/game-talk.js, selfTurn) */ }

/* nút ▶ thật to khi đang tạm nghỉ */
.gv-resume { position: absolute; left: 50%; top: 50%; z-index: 3; display: none; place-items: center; width: clamp(88px, min(50cqw, 50cqh), 160px); aspect-ratio: 1; margin: 0; border-radius: 50%;
  background: var(--green); border: 6px solid #fff; box-shadow: 0 8px 0 color-mix(in srgb, var(--green) 60%, #000), 0 0 0 12px rgba(255, 255, 255, .5); transform: translate(-50%, -50%); animation: gv-pulse .8s ease-in-out infinite alternate; }
.gv-resume svg { width: 52%; height: 52%; fill: #fff; }
[data-state="paused"] .gv-resume { display: grid; }
[data-state="paused"] .gv-fig, [data-state="nomic"] .gv-fig { filter: grayscale(.55); opacity: .65; }
[data-state="paused"] .gv-puff { animation: none; }
[data-state="wait"] .gv-fig { opacity: .8; }

/* bốn giọng nhại + nút tạm nghỉ */
.gv-ctl { grid-area: ctl; display: flex; justify-content: center; }
.gv-voices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 2.4vw, 20px); width: 100%; max-width: 560px; padding-top: 6px; }
.gv-voice { display: grid; place-items: center; min-width: 0; width: 100%; max-width: 124px; aspect-ratio: 1; justify-self: center; border-radius: 26%; background: #fff; border: 5px solid var(--c);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 60%, #000); font-size: clamp(40px, min(13.5vw, 11vh), 78px); -webkit-tap-highlight-color: transparent; transition: transform .12s, background .2s; }
.gv-voice img.emo { width: 74%; height: 74%; pointer-events: none; }
.gv-voice.gv-on { background: color-mix(in srgb, var(--c) 30%, #fff); transform: translateY(-6px) scale(1.06); box-shadow: 0 10px 0 color-mix(in srgb, var(--c) 60%, #000), 0 0 0 5px #fff; }
.gv-voice.gv-in { animation: gv-in .4s cubic-bezier(.3, 1.4, .5, 1); }
.gv-voice:active { transform: translateY(2px); }
.gv-pause { flex: none; display: grid; place-items: center; width: clamp(64px, 9.5vh, 78px); aspect-ratio: 1; border-radius: 50%; background: var(--red); border: 5px solid #fff;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--red) 60%, #000); -webkit-tap-highlight-color: transparent; }
.gv-pause svg { width: 50%; height: 50%; fill: #fff; }
.gv-pause:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--red) 60%, #000); }
[data-state="paused"] .gv-pause, [data-state="nomic"] .gv-pause, [data-state="wait"] .gv-pause { opacity: .3; pointer-events: none; }
/* thiếu micro: màn nhại giọng chỉ còn Gấu Con và lời giải thích (các nút giọng lúc này không làm được gì) */
[data-state="nomic"] .gv-ctl, [data-state="nomic"] .gv-live { display: none; }
[data-state="nomic"] .gv-parrot { grid-template: "side" minmax(0, 1fr) / minmax(0, 1fr); }

/* ---------- thẻ xin phép ba mẹ, thẻ "lần sau nhé" ---------- */
.gv-gateplay { place-items: center; }
.gv-gate { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 2vh, 16px); width: min(100%, 760px); max-height: 100%; padding: clamp(12px, 3vh, 26px) clamp(14px, 4vw, 30px); overflow: auto;
  border: 6px solid transparent; border-radius: 34px; background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; box-shadow: var(--lift); text-align: center; }
.gv-gatepic { display: flex; align-items: flex-end; justify-content: center; gap: 4px; font-size: clamp(44px, 11vh, 88px); }
.gv-gatepic .buddy { width: clamp(84px, 22vh, 180px); }
.gv-gatetext { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.8vh, 14px); min-width: 0; }
.gv-gate h2 { font-weight: 800; font-size: clamp(1.25rem, 5.4vw, 2rem); line-height: 1.15; }
.gv-gate p { font-weight: 600; font-size: clamp(.98rem, 3.8vw, 1.25rem); line-height: 1.35; max-width: 34em; }
.gv-gate p b { font-weight: 800; color: color-mix(in srgb, var(--green) 62%, var(--navy)); }
.gv-gatebtns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.gv-allow { display: inline-flex; align-items: center; gap: 10px; min-height: 76px; font-size: clamp(1.5rem, 6vw, 2rem); animation: gv-pulse .8s ease-in-out infinite alternate; }
.gv-allow .emo { font-size: 1.3em; }
.gv-skip { font-size: .95rem; }
/* thẻ "lần sau nhé": hai nút nằm chung một hàng cho gọn */
.gv-soft .gv-gatepic { font-size: clamp(36px, 8vh, 76px); }
.gv-soft .gv-gatepic .buddy { width: clamp(72px, 17vh, 160px); }
.gv-soft .gv-gatebtns { flex-wrap: nowrap; gap: 10px; }
.gv-soft .btn { min-height: 64px; padding-inline: clamp(12px, 4vw, 30px); font-size: clamp(1.2rem, 5.2vw, 1.6rem); white-space: nowrap; }

/* dòng báo cho ba mẹ khi micro không dùng được */
.gv-note { grid-area: note; display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 5px 8px 5px 12px; border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: 0 4px 0 rgba(30, 42, 94, .12);
  font-size: clamp(.8rem, 3.3vw, .95rem); font-weight: 600; line-height: 1.25; }
.gv-note[hidden], .gv-retry[hidden] { display: none; }
.gv-note > .emo { flex: none; font-size: 24px; filter: grayscale(1); opacity: .7; }
.gv-note > span { flex: 1; min-width: 0; }
.gv-retry { flex: none; min-height: 44px; padding: 4px 14px; font-size: .9rem; white-space: nowrap; }

/* ---------- màn ngang thấp (điện thoại nằm ngang): thẻ chọn thành một cột bên trái ---------- */
@media (min-aspect-ratio: 1/1) {
  .gv-say { grid-template: "card side" minmax(0, 1fr) "dots dots" auto / minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px clamp(10px, 2vw, 24px); }
  .gv-bub { min-height: 2.6em; }
  .gv-parrot { grid-template: "side ctl" minmax(0, 1fr) / minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(12px, 2.4vw, 30px); }
  .gv-ctl { align-items: center; }
  .gv-voices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 22px); max-width: min(100%, calc(var(--gv-h) - 110px)); padding: 0; }
  .gv-voice { max-width: none; }
}
@media (max-aspect-ratio: 1/1) {
  /* màn dọc: Gấu Con bên trái, ô lời và cột sóng bên phải */
  .gv-say .gv-side { grid-template: "box bub" minmax(0, 1fr) "box live" minmax(0, 1fr) / minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 10px; }
  .gv-say .gv-bub { align-self: end; }
  .gv-say .gv-live { align-self: start; }
}
@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .gv-wrap { grid-template: "tabs play" minmax(0, 1fr) "tabs note" auto / clamp(92px, 14vw, 124px) minmax(0, 1fr); column-gap: 10px; }
  .gv-tabs { flex-direction: column; justify-content: stretch; margin: 0; gap: 8px; }
  .gv-tab { flex-direction: column; gap: 2px; padding: 4px 6px; border-radius: 20px; max-width: none; }
  .gv-tab .gv-tabpic { font-size: clamp(28px, 9vh, 40px); }
  .gv-tab .gv-tablabel { font-size: .82rem; text-align: center; }
  .gv-play { gap: 6px; }
  .gv-say { gap: 6px 12px; }
  .gv-parrot { gap: 12px; }
  .gv-voices { gap: 12px; max-width: min(100%, calc(var(--gv-h) - 20px)); }
  .gv-side { gap: 5px; }
  .gv-bub { min-height: 2.2em; padding: 2px 12px; border-width: 3px; font-size: 1rem; }
  .gv-meter { height: 52px; padding-block: 4px; border-width: 3px; }
  .gv-mic { font-size: 30px; }
  .gv-pause { width: 64px; border-width: 4px; }
  .gv-gate { flex-direction: row; text-align: left; gap: 16px; padding: 10px 18px; border-radius: 26px; }
  .gv-gatetext { align-items: flex-start; gap: 6px; }
  .gv-gate h2 { font-size: 1.25rem; } .gv-gate p { font-size: .95rem; line-height: 1.25; }
  .gv-gatebtns { justify-content: flex-start; }
  .gv-allow { min-height: 64px; font-size: 1.4rem; }
  .gv-note { margin-top: 6px; font-size: .8rem; }
}
/* điện thoại nhỏ, màn dọc thấp */
@media (max-height: 700px) and (max-aspect-ratio: 1/1) {
  .gv-tabs { margin-bottom: 8px; }
  .gv-tab { min-height: 64px; }
  .gv-play { gap: 8px; }
  .gv-voices { padding-top: 4px; }
}

/* ================= Lời nhắn của ba mẹ ================= */
.gv-pv { box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(14px, 4vw, 28px); border: 6px solid transparent; border-radius: 34px;
  background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; box-shadow: var(--lift); -webkit-user-select: text; user-select: text; }
.gv-pvhead { display: flex; align-items: center; gap: 12px; font-size: clamp(44px, 12vw, 64px); }
.gv-pvhead h2 { font-weight: 800; font-size: clamp(1.5rem, 6vw, 2.2rem); line-height: 1.1; }
.gv-pvlead { font-weight: 600; font-size: clamp(1rem, 3.8vw, 1.2rem); line-height: 1.4; }
.gv-pvlead b { font-weight: 800; color: color-mix(in srgb, var(--pink) 70%, var(--navy)); white-space: nowrap; }
.gv-pvlist { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-weight: 600; font-size: clamp(.95rem, 3.5vw, 1.1rem); line-height: 1.35; }
.gv-pvlist li { display: flex; align-items: flex-start; gap: 10px; }
.gv-pvlist .emo { flex: none; font-size: 28px; }
.gv-pvbox { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border-radius: 26px; background: #FFF6E3; border: 4px solid var(--yellow); }
.gv-pvstatus { font-weight: 800; font-size: clamp(1.05rem, 4.2vw, 1.3rem); text-align: center; }
.gv-pv .gv-meter { flex: none; width: 100%; max-width: 460px; height: 64px; opacity: .45; }
.gv-pv[data-state="rec"] .gv-meter { opacity: 1; border-color: var(--red); animation: gv-live .7s ease-in-out infinite alternate; }
.gv-pv[data-state="rec"] .gv-mic { filter: none; }
.gv-pvtime { width: 100%; max-width: 460px; height: 12px; overflow: hidden; border-radius: 999px; background: rgba(30, 42, 94, .12); }
.gv-pvtime[hidden], .gv-pvmsg[hidden] { display: none; }
.gv-pvtime i { display: block; width: 100%; height: 100%; border-radius: 999px; background: var(--red); transform-origin: 0 50%; }
.gv-pvbtns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 14px; min-height: 68px; }
.gv-pvbtns .btn { display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding-inline: 24px; font-size: clamp(1.2rem, 5vw, 1.5rem); }
.gv-ico { display: grid; width: 1.1em; height: 1.1em; }
.gv-ico svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 2px 0 var(--navy)); }
.gv-pvmsg { font-weight: 700; font-size: clamp(.95rem, 3.6vw, 1.1rem); line-height: 1.3; text-align: center; color: color-mix(in srgb, var(--blue) 55%, var(--navy)); }
.gv-pv .gv-note { margin: 0; background: #EEF4FF; box-shadow: none; }

@keyframes gv-in { 0% { transform: scale(.72); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes gv-chat { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
@keyframes gv-wig { from { transform: rotate(-12deg) scale(1); } to { transform: rotate(8deg) scale(1.12); } }
@keyframes gv-bob { from { transform: translateY(0) scale(1); } to { transform: translateY(-8%) scale(1.1); } }
@keyframes gv-live { from { box-shadow: 0 6px 0 rgba(30, 42, 94, .18), 0 0 0 0 rgba(255, 89, 100, .45); } to { box-shadow: 0 6px 0 rgba(30, 42, 94, .18), 0 0 0 9px rgba(255, 89, 100, 0); } }
@keyframes gv-pulse { from { transform: translate(var(--gv-px, 0), var(--gv-px, 0)) scale(1); } to { transform: translate(var(--gv-px, 0), var(--gv-px, 0)) scale(1.07); } }
@keyframes gv-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.gv-resume { --gv-px: -50%; }

/* máy đặt "giảm chuyển động": giữ cột sóng (đó là tín hiệu "Gấu Con nghe thấy"), bỏ các chuyển động nhún nhảy */
@media (prefers-reduced-motion: reduce) {
  .gv-card.gv-in, .gv-fig.gv-in, .gv-voice.gv-in, .gv-bub.gv-pop, .gv-allow, .gv-resume, .gv-ear, .gv-turn, .gv-mic, .gv-meter, .gv-pv .gv-meter { animation: none !important; }
  .gv-puff { animation: none !important; transform: none !important; }
  .gv-halo { transform: translate(-50%, -50%) scale(.9) !important; }
  .gv-talk .gv-mouth { animation: none; transform: scaleY(.6); }
  .gv-tab, .gv-voice { transition: none; }
}

/* ---------- wave 7: hình khối (3D) ---------- */
/* Gấu Con to gần hết bề ngang màn hình; lúc nó nghiêng người chỉ tay (gợi ý) thì phần thò ra ngoài không được làm trang cuộn ngang */
@supports (overflow: clip) { body[data-scene="be-noi"] main { overflow-x: clip; } }
/* hai thẻ chọn kiểu chơi: phím nổi; thẻ đang chọn bật lên, mặt bóng, cạnh hồng dày */
.gv-tab { background: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, .5)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 5px 0 rgba(30, 42, 94, .16), 0 9px 10px rgba(30, 42, 94, .12); }
.gv-tab.gv-on { background: linear-gradient(#fff, #FFE6F1); box-shadow: inset 0 2px 0 #fff, inset 0 -4px 0 rgba(200, 40, 120, .1), 0 6px 0 #C2468C, 0 12px 14px rgba(30, 42, 94, .22); }
.gv-tab .gv-tabpic .emo { filter: drop-shadow(0 2px 0 rgba(30, 42, 94, .2)); }

/* thẻ hình của từ: một tấm thẻ dày (cạnh dưới, bóng đổ); ảnh thật lõm vào khung và có vệt sáng chéo; hình 3D đổ bóng mềm xuống nền */
.gv-card { box-shadow: 0 8px 0 #C6CFE8, 0 9px 0 #A9B5D6, 0 12px 4px rgba(30, 42, 94, .22), 0 24px 24px rgba(30, 42, 94, .26); }
.gv-card.gv-hasphoto::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 24px; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .3) 0, rgba(255, 255, 255, .05) 22%, rgba(255, 255, 255, 0) 38%);
  box-shadow: inset 0 10px 16px rgba(0, 0, 0, .2), inset 0 -6px 12px rgba(0, 0, 0, .12); }
.gv-card .gv-emo { filter: drop-shadow(0 .05em .045em rgba(60, 40, 10, .32)); }
.gv-name, .gv-again, .gv-credit { z-index: 1; }
.gv-name { background: linear-gradient(#fff, #EEF2FF); border: 2px solid #fff; box-shadow: inset 0 -3px 0 rgba(30, 42, 94, .1), 0 4px 0 rgba(30, 42, 94, .32), 0 8px 12px rgba(30, 42, 94, .3); }
/* nút "nghe lại": chiếc loa 3D trên một đĩa trắng bóng */
.gv-again { background: radial-gradient(circle at 35% 25%, #fff 0, #E4EAFA 100%); border: 3px solid #fff; box-shadow: inset 0 -3px 0 rgba(30, 42, 94, .12), 0 3px 0 rgba(30, 42, 94, .3), 0 6px 8px rgba(30, 42, 94, .26); }
.gv-again img.emo { width: 74%; height: 74%; }

/* ô lời của Gấu Con: mặt vồng sáng, cạnh dưới dày */
.gv-bub { background: linear-gradient(#FFFEF4, #FFF5C6); box-shadow: inset 0 2px 0 #fff, inset 0 -3px 0 rgba(200, 150, 0, .12), 0 5px 0 rgba(160, 110, 0, .3), 0 10px 12px rgba(30, 42, 94, .18); }
[data-state="listen"] .gv-bub, [data-state="turn"] .gv-bub { background: linear-gradient(#FFF6FA, #FFDAEA); box-shadow: inset 0 2px 0 #fff, 0 5px 0 rgba(190, 50, 120, .32), 0 10px 12px rgba(30, 42, 94, .18); }
[data-state="parrot"] .gv-bub, [data-state="cheer"] .gv-bub { background: linear-gradient(#F6FFF4, #D6F6D2); box-shadow: inset 0 2px 0 #fff, 0 5px 0 rgba(30, 130, 70, .34), 0 10px 12px rgba(30, 42, 94, .18); }
.gv-bub img.gv-inl { width: 1.6em; height: 1.6em; margin: -.35em .15em -.25em; vertical-align: middle; filter: drop-shadow(0 2px 0 rgba(20, 60, 150, .4)); }

/* sân khấu: Gấu Con (hay nhân vật nhại giọng) đứng trên một bục tròn có bề dày */
.gv-box::after { content: ""; position: absolute; z-index: 0; left: calc(50% - min(38cqw, 38cqh)); top: calc(50% + min(27cqw, 27cqh)); width: min(76cqw, 76cqh); height: min(18cqw, 18cqh); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 28%, #FFFEF4 0, #FFE9B0 52%, #F5C253 100%);
  box-shadow: inset 0 -3px 5px rgba(170, 100, 0, .3), 0 3px 0 #FFF3CF, 0 9px 0 #DE9F2E, 0 11px 0 #B97B17, 0 20px 16px rgba(30, 42, 94, .3); }
[data-state="paused"] .gv-box::after, [data-state="nomic"] .gv-box::after { opacity: .7; }
.gv-char .emo { filter: drop-shadow(0 .03em .03em rgba(60, 40, 10, .3)); }

/* ô sóng của micro: một cái máng lõm, các cột sóng là những thanh tròn bóng */
.gv-meter { background: linear-gradient(#E9EEFA, #fff); box-shadow: inset 0 3px 6px rgba(30, 42, 94, .24), 0 6px 0 rgba(30, 42, 94, .18), 0 12px 12px rgba(30, 42, 94, .14); }
.gv-bars i { box-shadow: inset 3px 0 2px rgba(255, 255, 255, .55), inset -3px 0 2px rgba(0, 0, 0, .2), 0 1px 2px rgba(30, 42, 94, .3); }
.gv-mic .emo { filter: drop-shadow(0 2px 1px rgba(30, 42, 94, .3)); }
@keyframes gv-live { from { box-shadow: inset 0 3px 6px rgba(30, 42, 94, .24), 0 6px 0 rgba(30, 42, 94, .18), 0 0 0 0 rgba(255, 89, 100, .45); } to { box-shadow: inset 0 3px 6px rgba(30, 42, 94, .24), 0 6px 0 rgba(30, 42, 94, .18), 0 0 0 9px rgba(255, 89, 100, 0); } }

/* nút ▶ (chơi tiếp) và ⏸ (tạm nghỉ): phím 3D, có cạnh dày và bóng đổ */
.gv-resume { border: 0; border-radius: 24%; background: none; box-shadow: 0 0 0 10px rgba(255, 255, 255, .55); }
.gv-resume img.emo { display: block; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 7px 0 rgba(20, 60, 150, .6)) drop-shadow(0 14px 10px rgba(30, 42, 94, .35)); }
.gv-pause { border: 0; border-radius: 24%; background: none; box-shadow: none; }
.gv-pause img.emo { display: block; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 5px 0 rgba(20, 60, 150, .6)) drop-shadow(0 9px 7px rgba(30, 42, 94, .3)); }
.gv-pause:active { box-shadow: none; }

/* bốn nút giọng: khối nhựa màu, mặt hơi ngả màu của viền, có vệt sáng; giọng đang chọn bật lên */
.gv-voice { position: relative; border-color: transparent;
  --gv-bg: linear-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 46%) padding-box, linear-gradient(rgba(255, 255, 255, .93), rgba(255, 255, 255, .86)) padding-box, linear-gradient(var(--c), var(--c)) padding-box,
    linear-gradient(165deg, rgba(255, 255, 255, .62) 0, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, .2) 100%) border-box, linear-gradient(var(--c), var(--c)) border-box;
  background: var(--gv-bg);
  box-shadow: inset 0 2px 4px rgba(30, 42, 94, .16), 0 7px 0 rgba(0, 0, 0, .36), 0 7px 0 var(--c), 0 11px 3px rgba(30, 42, 94, .24), 0 18px 16px rgba(30, 42, 94, .26); }
.gv-voice.gv-on { background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 46%) padding-box, linear-gradient(rgba(255, 255, 255, .66), rgba(255, 255, 255, .56)) padding-box, linear-gradient(var(--c), var(--c)) padding-box,
    linear-gradient(165deg, rgba(255, 255, 255, .62) 0, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, .2) 100%) border-box, linear-gradient(var(--c), var(--c)) border-box;
  box-shadow: inset 0 2px 4px rgba(30, 42, 94, .16), 0 11px 0 rgba(0, 0, 0, .36), 0 11px 0 var(--c), 0 0 0 5px #fff, 0 24px 18px rgba(30, 42, 94, .3); }
.gv-voice img.emo { filter: drop-shadow(0 .05em .04em rgba(60, 40, 10, .32)); }

/* lời nhắn của ba mẹ: hộp thu là một chiếc máy thu âm nhỏ — vỏ nhựa có khe loa, màn hình sóng tối màu, phím 3D */
.gv-pvbox { position: relative; padding: 28px 16px 18px; border: 4px solid #fff; background: linear-gradient(#FFF8E4, #FFE6AC);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -8px 0 rgba(180, 120, 20, .16), 0 8px 0 #D9A944, 0 10px 0 #B98A2E, 0 22px 22px rgba(30, 42, 94, .25); }
.gv-pvbox::before { content: ""; position: absolute; left: 22px; right: 22px; top: 10px; height: 10px; opacity: .85; background: radial-gradient(circle, rgba(140, 90, 10, .42) 0, rgba(140, 90, 10, .42) 2.4px, rgba(140, 90, 10, 0) 3px) 0 0 / 12px 10px repeat-x; }
.gv-pv .gv-meter { opacity: 1; border-color: #C9D3F2; background: linear-gradient(#18204C, #2B3878); box-shadow: inset 0 4px 8px rgba(0, 0, 0, .5), 0 2px 0 #fff, 0 6px 8px rgba(30, 42, 94, .2); }
.gv-pv .gv-bars i { opacity: .45; }
.gv-pv .gv-mic { filter: none; }
.gv-pv[data-state="rec"] .gv-bars i { opacity: 1; }
.gv-pv .gv-ico { width: 1.5em; height: 1.5em; }
.gv-pv .gv-ico img.emo { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 0 rgba(30, 42, 94, .3)); }
.gv-pvhead .emo, .gv-pvlist .emo { filter: drop-shadow(0 2px 1px rgba(30, 42, 94, .22)); }

/* ---------- wave 6: compat (trình duyệt cũ) ---------- */
/* Bản dự phòng cho máy cũ của các luật phía trên (giải thích ở cuối css/style.css); sửa luật gốc thì sửa luôn dòng tương ứng ở đây. */
/* chưa có color-mix(): thẻ, nút giọng, nút ▶ ⏸ nay nằm ở khối "wave 7" (không dùng color-mix) */
@supports not (color: color-mix(in srgb, red, blue)) {
  [data-state="turn"] .gv-meter::after { background: rgba(255, 109, 179, 0.3); }
  .gv-gate p b { color: #318E66; }
  .gv-pvlead b { color: #BC599A; }
  .gv-pvmsg { color: #2E69B7; }
}
/* chưa có đơn vị cqw/cqh, @container */
@supports not (width: 1cqw) {
  .gv-card { --cq: size; contain: size; }
  .gv-card .gv-emo { font-size: min(calc(66 * var(--cqw)), calc(62 * var(--cqh))); margin-bottom: calc(14 * var(--cqh)); }
  .gv-name { bottom: clamp(6px, calc(4 * var(--cqh)), 16px); font: 700 clamp(24px, min(calc(11 * var(--cqw)), calc(15 * var(--cqh))), 62px)/1.2 var(--font-letter); }
  .gv-again { width: clamp(40px, calc(13 * var(--cqh)), 54px); }
  .gv-box { --cq: size; contain: size; }
  .gv-fig { width: min(calc(94 * var(--cqw)), calc(94 * var(--cqh))); }
  .gv-char .gv-puff { font-size: min(calc(78 * var(--cqw)), calc(78 * var(--cqh))); }
  .gv-halo { width: min(calc(100 * var(--cqw)), calc(100 * var(--cqh))); }
  .gv-ear, .gv-turn { font-size: clamp(34px, min(calc(30 * var(--cqw)), calc(30 * var(--cqh))), 110px); }
  .gv-resume { width: clamp(88px, min(calc(50 * var(--cqw)), calc(50 * var(--cqh))), 160px); }
  .gv-box::after { left: calc(50% - min(calc(38 * var(--cqw)), calc(38 * var(--cqh)))); top: calc(50% + min(calc(27 * var(--cqw)), calc(27 * var(--cqh)))); width: min(calc(76 * var(--cqw)), calc(76 * var(--cqh))); height: min(calc(18 * var(--cqw)), calc(18 * var(--cqh))); }
}
