/* styles.css — khung shell tối thiểu (DA-6.1); giao diện màn hình viết ở DA-7+. */
/* DA-37: MỌI màn hình dùng chung một bối cảnh thế giới khủng long (trời
 * xanh, mây trôi, cỏ xanh) — bỏ nền vàng kem trơn ở các màn phụ. Lớp nền
 * cố định (fixed) phủ viewport, nội dung cuộn bên trên. */
body { margin: 0; font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif; color: #333; overflow-x: hidden; background-color: #a5dcf7; background-image: url("assets/bg-scene.svg"); background-size: cover; background-position: center bottom; background-repeat: no-repeat; background-attachment: fixed; }
button { font: inherit; }
#app { max-width: 820px; margin: 0 auto; padding: 16px; text-align: center; }
h1 { text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65); }

/* Khu phụ huynh (DA-17, DA-5 §5): ô tiến độ từng số/chữ + nút đang chọn.
 * DA-37: thêm tấm nền trắng mờ để chữ dày đặc dễ đọc trên nền thế giới. */
.parent-sec { text-align: left; max-width: 640px; margin: 0 auto; background: rgba(255, 255, 255, 0.88); border-radius: 18px; padding: 10px 18px 16px; box-shadow: 0 4px 0 rgba(74, 47, 29, 0.18); }
.parent-sec h2 { margin: 18px 0 6px; }
.pcell { display: inline-block; min-width: 44px; margin: 2px; padding: 4px 2px; border-radius: 8px; font-size: 14px; line-height: 1.4; text-align: center; }
.st-mastered { background: #c8e6c9; }
.st-learning { background: #fff9c4; }
.st-new { background: #eeeeee; color: #999; }
button.sel { outline: 3px solid #ff9800; font-weight: bold; }
table.pgames { margin: 0 auto; border-collapse: collapse; }
table.pgames td { padding: 4px 10px; border-bottom: 1px solid #ddd; text-align: left; }

/* Onboarding (DA-7, DA-5 §1): tên bạn đang chọn + danh sách chọn bạn. */
#onb-name { font-size: 20px; font-weight: bold; }
#onb-list button { margin: 4px; padding: 8px 10px; }
#onb-list button.locked { opacity: 0.65; }

/* DA-37: nền thế giới đã áp cho body ở mọi màn (xem đầu file); sân chơi
 * chỉ cần chiều cao tối thiểu để Rex đứng trên thảm cỏ của nền. */
body.is-hub #app { min-height: 100vh; }

/* Tro Cho an / Dem (DA-11, DA-5 §3.1): mon an lon de cham, mat vui, nut chon man. */
.feed-item { font-size: 44px; min-width: 64px; min-height: 64px; margin: 4px; padding: 6px 10px; }
#feed-mood { font-size: 40px; min-height: 48px; margin: 4px 0; }
[data-feed-level] { min-width: 40px; min-height: 40px; margin: 2px; font-size: 16px; }
[data-feed-level]:disabled { opacity: 0.45; }

/* DA-44: trứng thay ổ khóa trên hàng chọn màn — vừa ô 40px. */
.lvl-egg { width: 22px; height: 22px; vertical-align: -5px; }

/* Tro Bang so (DA-12, DA-5 §3.2): o so lon de cham, muc tieu lon. */
.num-choice { font-size: 36px; min-width: 64px; min-height: 64px; margin: 4px; padding: 6px 14px; }
.num-free { font-size: 28px; min-width: 56px; min-height: 56px; margin: 3px; padding: 4px 10px; }
#num-target { font-size: 32px; font-weight: bold; min-height: 40px; margin: 8px 0; }
#num-mood { font-size: 40px; min-height: 48px; margin: 4px 0; }
#num-stars { font-size: 28px; min-height: 34px; margin: 4px 0; }
[data-num-level] { min-width: 40px; min-height: 40px; margin: 2px; font-size: 16px; }
[data-num-level]:disabled { opacity: 0.45; }

/* Tro Bang chu (DA-13, DA-5 §3.3): o chu lon de cham, muc tieu lon. */
.kana-choice { font-size: 36px; min-width: 64px; min-height: 64px; margin: 4px; padding: 6px 14px; }
.kana-free { font-size: 28px; min-width: 56px; min-height: 56px; margin: 3px; padding: 4px 10px; }
#kana-target { font-size: 32px; font-weight: bold; min-height: 40px; margin: 8px 0; }
#kana-mood { font-size: 40px; min-height: 48px; margin: 4px 0; }
#kana-stars { font-size: 28px; min-height: 34px; margin: 4px 0; }
[data-kana-level] { min-width: 40px; min-height: 40px; margin: 2px; font-size: 16px; }
[data-kana-level]:disabled { opacity: 0.45; }

/* Tro To chu (DA-14, DA-5 §3.4): trang vo + canvas to net. */
#trace-wrap { position: relative; width: 300px; max-width: 100%; height: 300px; margin: 8px auto; }
#trace-wrap canvas { position: absolute; left: 0; top: 0; width: 300px; height: 300px; max-width: 100%; touch-action: none; }
#trace-guide { background: #fffdf5; border: 2px solid #e8dcc0; border-radius: 12px; }
#trace-ink { background: transparent; }
#trace-target { font-size: 32px; font-weight: bold; min-height: 40px; margin: 8px 0; }
#trace-mood { font-size: 40px; min-height: 48px; margin: 4px 0; }
#trace-stars { font-size: 28px; min-height: 34px; margin: 4px 0; }
[data-trace-level] { min-width: 40px; min-height: 40px; margin: 2px; font-size: 16px; }
[data-trace-level]:disabled { opacity: 0.45; }
.trace-btns button { min-height: 44px; margin: 2px; font-size: 16px; }

/* Tro Hinh & Mau (DA-15, DA-5 §3.5): muc tieu + lua chon hinh/mau. */
#shape-target { font-size: 32px; font-weight: bold; min-height: 40px; margin: 8px 0; }
#shape-target svg { width: 72px; height: 72px; vertical-align: middle; margin-right: 8px; }
#shape-mood { font-size: 40px; min-height: 48px; margin: 4px 0; }
#shape-stars { font-size: 28px; min-height: 34px; margin: 4px 0; }
.shape-choice { min-width: 96px; min-height: 96px; margin: 6px; padding: 10px; }
.shape-choice svg { width: 72px; height: 72px; display: block; margin: 0 auto; }
[data-shape-level] { min-width: 40px; min-height: 40px; margin: 2px; font-size: 16px; }
[data-shape-level]:disabled { opacity: 0.45; }

/* Tro Lat the (DA-16, DA-5 §3.6): luoi the khung long. */
#cards-preview { font-size: 28px; font-weight: bold; min-height: 34px; margin: 4px 0; }
#cards-mood { font-size: 40px; min-height: 48px; margin: 4px 0; }
#cards-stars { font-size: 28px; min-height: 34px; margin: 4px 0; }
#cards-board { display: grid; gap: 8px; max-width: 480px; margin: 8px auto; }
#cards-board.cards-n4 { grid-template-columns: repeat(2, 1fr); }
#cards-board.cards-n6 { grid-template-columns: repeat(3, 1fr); }
#cards-board.cards-n8 { grid-template-columns: repeat(4, 1fr); }
.dino-card { position: relative; min-height: 110px; padding: 6px; font-size: 40px; }
.dino-card .card-face { display: none; }
.dino-card.open .card-face, .dino-card.matched .card-face { display: block; }
.dino-card.open .card-back, .dino-card.matched .card-back { display: none; }
.dino-card .card-face img { width: 72px; height: 72px; display: block; margin: 0 auto; }
.dino-card .card-face span { font-size: 15px; font-weight: bold; display: block; }
/* DA-33.5: chữ cái đầu hiragana to ở góc trên của thẻ (huy hiệu để không đè tranh). */
.dino-card .card-face .card-letter { position: absolute; top: 4px; left: 4px; min-width: 34px; height: 34px; line-height: 30px; text-align: center; font-size: 26px; font-weight: 800; color: #d84315; background: #fff8e1; border: 2px solid #d84315; border-radius: 10px; z-index: 1; }
.dino-card.matched { border: 3px solid #43A047; background: #E8F5E9; }
[data-cards-level] { min-width: 40px; min-height: 40px; margin: 2px; font-size: 16px; }
[data-cards-level]:disabled { opacity: 0.45; }

/* ===== DA-36: Nâng cấp giao diện sân chơi (yêu cầu CEO 19/11) ===== */

/* Bong bóng thoại dùng chung: hộp trắng viền đậm bo tròn; rỗng thì ẩn. */
#bubble { background: #ffffff; border: 3px solid #4a2f1d; border-radius: 18px; padding: 10px 16px; font-weight: 700; max-width: 86%; margin: 10px auto; position: relative; box-shadow: 0 3px 0 rgba(74, 47, 29, 0.35); }
#bubble:empty { display: none; }

/* Rex nhún nhảy liên tục ở màn bắt đầu / onboarding / sân chơi. */
@keyframes dino-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
#companion-img, #start-companion-img, #onb-img { animation: dino-bob 2.4s ease-in-out infinite; }

/* Hàng trên sân chơi: sao/tim bên trái, cụm nút tròn bên phải. */
/* DA-46 (theo DA-39): cụm nút góc trên không còn sát mép trên — đệm trên
 * theo safe-area (tai thỏ) để nút không dính mép màn hình. */
.hub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-top: 4px; padding-top: max(4px, env(safe-area-inset-top)); }
.hub-top > p { margin: 4px 0 0; font-size: 17px; font-weight: 700; text-shadow: 0 1px 0 #ffffff; white-space: nowrap; }
.hub-actions { display: flex; gap: 9px; }
.rb { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.rb > span { font-size: 10px; font-weight: 800; color: #4a2f1d; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9); white-space: nowrap; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; background: #ffffff; border: 3px solid #4a2f1d; box-shadow: 0 4px 0 #4a2f1d; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: #4a2f1d; }
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a2f1d; }
.round-btn svg { width: 28px; height: 28px; display: block; }
.round-btn.holding { outline: 4px solid #ff9800; outline-offset: 1px; }

/* DA-46: cổng phụ huynh lớp 2 — hộp câu hỏi phép tính (overlay giữa màn). */
#parent-gate { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(43, 30, 18, 0.55); padding: 20px; box-sizing: border-box; }
#parent-gate .pg-q { background: #ffffff; border: 3px solid #4a2f1d; border-radius: 20px; box-shadow: 0 5px 0 #4a2f1d; font-size: 44px; font-weight: 800; color: #4a2f1d; padding: 14px 26px; margin: 0; }
#parent-gate .pg-opts { display: flex; gap: 12px; margin: 0; }
#parent-gate .pg-opts button { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #4a2f1d; background: #ffd94d; font-size: 30px; font-weight: 800; color: #4a2f1d; box-shadow: 0 4px 0 #4a2f1d; cursor: pointer; }
#parent-gate .pg-opts button:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a2f1d; }
#parent-gate .pg-opts button:disabled { opacity: 0.55; cursor: default; }
#parent-gate .pg-msg { min-height: 26px; font-size: 18px; font-weight: 800; color: #ffffff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); margin: 0; }
#parent-gate #btn-gate-back { border-radius: 999px; border: 3px solid #4a2f1d; background: #ffffff; color: #4a2f1d; padding: 10px 22px; font-size: 17px; font-weight: 800; box-shadow: 0 4px 0 #4a2f1d; cursor: pointer; }

/* DA-34.3: hộp xác nhận xóa bản thu ở khu phụ huynh — overlay giữa màn,
 * cùng ngôn ngữ thị giác với cổng phụ huynh (#parent-gate). */
#speak-confirm { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(43, 30, 18, 0.55); padding: 20px; box-sizing: border-box; }
#speak-confirm p { margin: 0; }
#speak-confirm p:first-child { background: #ffffff; border: 3px solid #4a2f1d; border-radius: 20px; box-shadow: 0 5px 0 #4a2f1d; font-size: 22px; font-weight: 800; color: #4a2f1d; padding: 14px 22px; text-align: center; }
#speak-confirm button { border-radius: 999px; border: 3px solid #4a2f1d; background: #ffffff; color: #4a2f1d; padding: 10px 22px; font-size: 17px; font-weight: 800; box-shadow: 0 4px 0 #4a2f1d; cursor: pointer; }
#speak-confirm #btn-speak-del-yes { background: #ff8a80; color: #ffffff; }
#speak-confirm button:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a2f1d; }

/* Sân khấu: bong bóng thoại trên đầu Rex, Rex đứng ở đáy sân khấu (trên cỏ).
 * DA-37: bong bóng THU GỌN và LỆCH PHẢI, đuôi chỉ xuống gần miệng Rex
 * (không che núi lửa ở trái-giữa, không chĩa vào trán). */
.hub-stage { min-height: 44vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding-top: 6px; }
.hub-stage #bubble { align-self: flex-end; margin: 0 2% 4px 0; max-width: 56%; font-size: 15px; line-height: 1.45; padding: 8px 12px; border-radius: 16px; }
.hub-stage #bubble::after { content: ""; position: absolute; left: 24%; bottom: -13px; transform: translateX(-50%); border: 7px solid transparent; border-top: 9px solid #4a2f1d; border-bottom: 0; }
.hub-rex { margin: 0; line-height: 0; }
/* DA-37: tên Rex trong BẢNG TÊN GỖ nổi bật dưới chân (vân gỗ nâu ấm, 2 đinh
 * trang trí, hơi nghiêng) — không bị viền cỏ của nền đè lên. */
.hub-name { position: relative; z-index: 2; display: inline-block; margin: 8px 0 0; padding: 6px 24px 8px; font-size: 20px; font-weight: 800; letter-spacing: 0.04em; color: #fff7e6; background: linear-gradient(180deg, #c08b52, #9c6b3d); border: 3px solid #7a4e26; border-radius: 14px; box-shadow: 0 4px 0 #7a4e26, inset 0 2px 0 rgba(255, 255, 255, 0.3); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); transform: rotate(-1.2deg); }
.hub-name::before, .hub-name::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #6d4520; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55); }
.hub-name::before { left: 8px; }
.hub-name::after { right: 8px; }
/* DA-33.5: chữ cái đầu hiragana to trước tên loài trên bảng tên sân chơi. */
.hub-letter { font-size: 34px; color: #ffe9a8; margin-right: 8px; vertical-align: middle; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }

/* Nút dạng viên thuốc (đổi màu / chơi / bắt đầu). */
.pill-btn { border-radius: 999px; border: 3px solid #4a2f1d; background: #ffffff; color: #4a2f1d; padding: 10px 22px; font-size: 17px; font-weight: 800; box-shadow: 0 4px 0 #4a2f1d; cursor: pointer; }
.pill-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a2f1d; }
.pill-btn.primary { background: linear-gradient(180deg, #8ee06a, #57b93c); border-color: #35791f; color: #ffffff; box-shadow: 0 5px 0 #35791f; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.pill-btn.primary:active { box-shadow: 0 2px 0 #35791f; }
.pill-btn.big { font-size: 20px; padding: 14px 30px; }

/* Thẻ bài chọn trò chơi (Juicy cards): to, bo tròn, viền đậm, bóng cứng, nhấn lún. */
.hub-today { font-size: 19px; font-weight: 800; color: #4a2f1d; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9); margin: 14px 0 2px; }
.game-cards { display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 560px; margin: 10px auto 14px; padding: 0 2px; }
.game-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 22px; border: 3px solid; font-weight: 800; font-size: 17px; line-height: 1.35; cursor: pointer; text-align: left; width: 100%; box-sizing: border-box; }
.game-card .gc-icon { font-size: 36px; line-height: 1; flex: 0 0 auto; }
/* DA-37: icon thẻ trò chơi là SVG vẽ tay (class .gi trong GAME_META). */
.game-card .gc-icon svg { width: 46px; height: 46px; display: block; }
svg.gi { width: 34px; height: 34px; vertical-align: -8px; }
table.pgames svg.gi { width: 30px; height: 30px; vertical-align: -7px; }
.gc-0 { background: linear-gradient(180deg, #ffb03a, #ff8a1e); border-color: #b25f00; color: #ffffff; box-shadow: 0 6px 0 #b25f00; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16); }
.gc-1 { background: linear-gradient(180deg, #ffe066, #ffd11e); border-color: #c79a00; color: #5b4300; box-shadow: 0 6px 0 #c79a00; }
.gc-2 { background: linear-gradient(180deg, #6fd3f2, #2fb3e8); border-color: #15779e; color: #ffffff; box-shadow: 0 6px 0 #15779e; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16); }
.game-card:active { transform: translateY(4px); }
.gc-0:active { box-shadow: 0 2px 0 #b25f00; }
.gc-1:active { box-shadow: 0 2px 0 #c79a00; }
.gc-2:active { box-shadow: 0 2px 0 #15779e; }
@media (max-width: 480px) {
  /* DA-50: thu hep hang tren san choi de vua 390px (truoc tran ~7-17px,
     nut toan man hinh bi day sat mep phai) */
  .hub-top { gap: 6px; }
  .hub-top > p { font-size: 12px; }
  .hub-actions { gap: 5px; }
  .round-btn { width: 46px; height: 46px; }
  .round-btn svg { width: 23px; height: 23px; }
}
@media (min-width: 600px) {
  .game-cards { grid-template-columns: repeat(3, 1fr); max-width: 780px; }
  .game-card { flex-direction: column; text-align: center; gap: 8px; padding: 18px 12px; }
  .game-card .gc-icon { font-size: 44px; }
  .game-card .gc-icon svg { width: 60px; height: 60px; }
}

/* Thanh công cụ trong trò: bo tròn + bóng cứng đồng bộ. */
#game-toolbar button { border-radius: 999px; border: 2.5px solid #4a2f1d; background: #ffffff; padding: 8px 14px; font-weight: 700; box-shadow: 0 3px 0 #4a2f1d; cursor: pointer; }
#game-toolbar button:active { transform: translateY(2px); box-shadow: 0 1px 0 #4a2f1d; }
/* DA-37: icon loa SVG trong thanh công cụ (nghe lại + tắt tiếng). */
#game-toolbar button svg { width: 20px; height: 20px; vertical-align: -4px; }

/* ===== DA-37: Ehon soft style — lưới trò chơi, cho ăn, màn thắng ===== */

/* Danh sách trò chơi (#/games): LƯỚI 2 CỘT — thẻ lớn gần vuông, minh họa
 * to ở giữa, nhãn ở dưới, trẻ dễ nhìn dễ bấm.
 * DA-38: cột minmax(0,1fr) + min-width 0 cho thẻ để lưới không bị min-content
 * đội rộng tràn lề phải ở 390px; padding-bottom 110px chừa chỗ cho nút về
 * sân chơi (pill-btn) không đè lên thẻ cuối khi cuộn tới đáy. */
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin: 10px auto 14px; padding: 0 2px 110px; box-sizing: border-box; width: 100%; }
.games-grid .game-card { flex-direction: column; align-items: center; justify-content: center; text-align: center; aspect-ratio: 1 / 1.02; padding: 14px 10px; gap: 10px; min-width: 0; height: 100%; }
.games-grid .game-card .gc-icon svg { width: 84px; height: 84px; }
.games-grid .game-card .gc-label { font-size: 16px; }
@media (min-width: 600px) {
  .games-grid { max-width: 640px; gap: 16px; }
  .games-grid .game-card .gc-icon svg { width: 104px; height: 104px; }
  .games-grid .game-card .gc-label { font-size: 18px; }
}

/* Trò cho ăn: món ăn là hình SVG (food-*.svg) trong nút bo tròn nổi. */
.feed-item { background: #ffffff; border: 3px solid #4a2f1d; border-radius: 18px; box-shadow: 0 4px 0 #4a2f1d; cursor: pointer; }
.feed-item:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a2f1d; }
.feed-item img { width: 52px; height: 52px; display: block; pointer-events: none; }
/* Bản sao của món ăn đang bay vào miệng Rex (DA-37, feedFlyToMouth). */
.feed-fly { position: fixed; z-index: 10000; pointer-events: none; margin: 0; background: #ffffff; border: 3px solid #4a2f1d; border-radius: 18px; box-shadow: 0 4px 0 #4a2f1d; }
.feed-fly img { width: 100%; height: 100%; display: block; pointer-events: none; }

/* Rex nhún nhảy vui vẻ khi được cho ăn đúng (mạnh hơn nhún thường). */
@keyframes dino-happy { 0%, 100% { transform: translateY(0) scale(1) rotate(0deg); } 30% { transform: translateY(-16px) scale(1.05) rotate(-2deg); } 55% { transform: translateY(0) scale(1) rotate(0deg); } 75% { transform: translateY(-11px) scale(1.03) rotate(2deg); } }
.dino-happy { animation: dino-happy 0.6s ease-in-out 2; }

/* DA-55 (PT-01 cua Hien): phan hoi sai nhe nhang — bong bong thoai cua
 * ban dong hanh lac nhe; dap an dung duoc goi y bang vien nhip nhe.
 * Man choi khong co anh ban dong hanh nen lac bong bong thay cho lac dau. */
@keyframes bubble-gentle-shake { 0%, 100% { transform: rotate(0deg); } 20% { transform: rotate(-2.5deg) translateX(-2px); } 45% { transform: rotate(2.5deg) translateX(2px); } 70% { transform: rotate(-1.5deg); } }
#bubble.bubble-shake { animation: bubble-gentle-shake 0.9s ease-in-out; }
@keyframes hint-pulse { 0%, 100% { outline: 4px solid rgba(34, 163, 85, 0.95); box-shadow: 0 0 0 6px rgba(34, 163, 85, 0.25); } 50% { outline: 4px solid rgba(34, 163, 85, 0.45); box-shadow: 0 0 0 2px rgba(34, 163, 85, 0.12); } }
.hint-correct { animation: hint-pulse 0.75s ease-in-out 3; }

/* Màn thắng (やったー！): Rex nhảy mừng ở trung tâm. */
@keyframes dino-jump { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-26px) rotate(-3deg); } 50% { transform: translateY(0) rotate(0deg); } 70% { transform: translateY(-17px) rotate(3deg); } }
.win-rex { margin: 2px 0 0; line-height: 0; }
.win-rex img { width: 190px; animation: dino-jump 1.15s ease-in-out infinite; }
.win-dots { font-size: 22px; letter-spacing: 3px; color: #35791f; margin: 6px 0 0; }

/* 3 huy chương vàng lớn lấp lánh (SVG trong app.js); huy chương xám mờ. */
.win-medals { display: flex; justify-content: center; gap: 14px; margin: 10px 0 4px; }
.medal { position: relative; width: 68px; height: 84px; }
.medal svg { width: 68px; height: 84px; display: block; }
.medal::after { content: "✦"; position: absolute; top: -8px; right: -4px; color: #fff3b0; font-size: 21px; text-shadow: 0 0 7px #ffd94d, 0 0 2px #ffd94d; animation: medal-twinkle 1.3s ease-in-out infinite; }
.medal.m2::after { animation-delay: 0.4s; }
.medal.m3::after { animation-delay: 0.8s; }
.medal.grey { filter: grayscale(1); opacity: 0.5; }
.medal.grey::after { display: none; }
@keyframes medal-twinkle { 0%, 100% { transform: scale(0.5) rotate(0deg); opacity: 0.35; } 50% { transform: scale(1.15) rotate(25deg); opacity: 1; } }

/* Pháo giấy rơi ở màn thắng (sfx.js celebrate): phủ màn, không chặn chạm. */
#sfx-confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 9998; }
.sfx-cf { position: absolute; top: -18px; pointer-events: none; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  #companion-img, #start-companion-img, #onb-img, .win-rex img, .dino-happy, .dino-dance, #bubble.bubble-shake, .hint-correct, .bubble-dot, .sort-card, .maze-rex { animation: none; }
}

/* Pháo giấy/sao của sfx.js: phủ toàn màn, không chặn chạm, không tràn ngang. */
#sfx-particles { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 9999; }
.sfx-p { position: absolute; transform: translate(-50%, -50%); pointer-events: none; line-height: 1; }

/* ===== DA-38: tinh chỉnh hiển thị điện thoại (CEO duyệt DA-37) =====
 * Sân chơi: thu gọn thẻ gợi ý "hôm nay" (padding dọc + icon + chữ nhỏ lại,
 * chiều cao mỗi thẻ giảm ~28%) để lộ ao nước của bối cảnh phía dưới.
 * Chỉ áp ở khổ điện thoại; thẻ ở màn danh sách trò chơi giữ nguyên. */
@media (max-width: 599px) {
  .game-cards { gap: 10px; margin: 8px auto 12px; }
  .game-cards .game-card { padding: 7px 14px; gap: 10px; font-size: 15px; line-height: 1.3; }
  .game-cards .game-card .gc-icon svg { width: 34px; height: 34px; }
}

/* Đua khủng long (DA-25, đặc tả v2 §7): đường đua 5 ô, 2 làn (Rex trên,
   Gallimimus dưới), cờ đích bên phải. Vị trí tay đua = left % theo ô. */
.race-track { position: relative; height: 172px; border-radius: 16px;
  overflow: hidden; border: 3px solid #6aa84f;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 19.5%, rgba(255,255,255,.55) 19.5%, rgba(255,255,255,.55) 20%), linear-gradient(#b7e39a, #8ecf6e); }
.race-track::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 3px dashed rgba(255,255,255,.7); }
.race-runner { position: absolute; width: 64px; height: 64px; transition: left .6s ease; z-index: 2; }
#race-rex { top: 10px; }
#race-galli { top: 94px; }
.race-flag { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 38px; z-index: 1; }
#race-target { font-size: 36px; font-weight: 800; }

/* ===== DA-56: màn mở đầu mới (khung cảnh + logo theo mockup) ===== */
/* Màn title phủ kín viewport 9:16, khung cảnh SVG làm nền, nội dung xếp
 * dọc: logo trên, Rex giữa, bong bóng + nút bắt đầu phía dưới (DA-57 sẽ
 * thay Rex vẫy tay + bong bóng mới + nút CTA cam + nối ✕/☰). */
.title-screen { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; overflow-y: auto; overflow-x: hidden; text-align: center; }
.title-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; pointer-events: none; }
.title-corners { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; padding: 14px 14px 0; padding-top: max(14px, env(safe-area-inset-top)); pointer-events: none; }
.title-corner-btn { pointer-events: auto; background: #fff7e6; }
.title-logo { position: relative; z-index: 2; margin-top: 86px; line-height: 1.02; filter: drop-shadow(0 4px 0 rgba(74, 47, 29, 0.28)); }
/* DA-56 sua logo 23:56: bo text-shadow (12 ban sao #4a2f1d lech 2-3px che kin lop gradient background-clip:text nen chu hien nau dac thay vi vang->cam nhu mockup); giu -webkit-text-stroke 2px lam vien nau + filter drop-shadow tren .title-logo. */
.title-logo-line { display: block; font-weight: 900; font-size: 54px; letter-spacing: 0.01em; color: transparent; -webkit-text-stroke: 2px #4a2f1d; background-clip: text; -webkit-background-clip: text; }
.title-logo-l1 { background-image: linear-gradient(180deg, #ffe066, #ffb703); }
.title-logo-l2 { background-image: linear-gradient(180deg, #ffa62b, #ff6b1a); }
.title-logo-deco { position: absolute; z-index: 3; line-height: 0; }
.title-logo-deco svg { display: block; width: 100%; height: auto; }
.deco-leaf-1 { top: -6px; left: 18px; width: 26px; transform: rotate(-18deg); }
.deco-leaf-2 { bottom: 6px; right: 6px; width: 22px; transform: rotate(14deg); }
.deco-foot-1 { top: 34px; right: -6px; width: 26px; transform: rotate(12deg); }
.deco-foot-2 { bottom: -4px; left: -2px; width: 22px; transform: rotate(-10deg); }
.title-rex { position: relative; z-index: 2; margin: 26px 0 0; line-height: 0; }
.title-rex img { width: 200px; max-width: 52vw; filter: drop-shadow(0 6px 8px rgba(74,47,29,.25)); }
/* DA-68: bong duoi chan Rex nhu demo da66. */
.title-rex-shadow { width: 170px; height: 22px; margin: 2px auto 0; background: radial-gradient(ellipse at center, rgba(46,90,30,.35), rgba(46,90,30,0) 70%); }
.title-screen #bubble { position: relative; z-index: 2; }
/* DA-57: bong bong man title — mui nhon huong len Rex (2 lop: vien nau + ruot trang). */
/* DA-68: bong bong man title theo demo da66 (chu 21px, dem 18px 20px, vien 22px). */
.title-screen #bubble { margin: 18px auto 0; width: calc(100% - 40px); max-width: 480px; padding: 14px 18px; font-size: 21px; border-radius: 22px; box-shadow: 0 4px 0 rgba(74,47,29,.25); }
.title-screen #bubble::before { content: ""; position: absolute; left: 50%; top: -13px; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 10px solid #4a2f1d; border-top: 0; }
.title-screen #bubble::after { content: ""; position: absolute; left: 50%; top: -7px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 8px solid #ffffff; border-top: 0; }
/* DA-57: nut CTA cam->vang theo mockup — vien nau + vong trang ngoai, chu trang. */
.title-cta-btn { background: linear-gradient(180deg, #ffc53d, #ff7b00); border: 3px solid #4a2f1d; color: #ffffff; box-shadow: 0 0 0 3px #ffffff, 0 5px 0 3px #4a2f1d; text-shadow: 0 2px 0 rgba(74, 47, 29, 0.35); }
.title-cta-btn:active { box-shadow: 0 0 0 3px #ffffff, 0 2px 0 3px #4a2f1d; }
/* DA-68: nut CTA theo demo da66 (cao 76px, chu 30px) — de rieng de thang .pill-btn.big. */
.title-cta .title-cta-btn { width: 100%; min-height: 76px; font-family: inherit; font-size: 30px; font-weight: 900; }
.title-cta-play { margin-left: 8px; }
.title-cta { position: relative; z-index: 2; width: 100%; max-width: 520px; margin: auto auto 96px; padding: 12px 20px 0; }
/* DA-68: moc media theo demo da66 (380px/700px thay cho 480px/600px cu). */
@media (max-width: 380px) {
  .title-logo { margin-top: 76px; }
  .title-logo-line { font-size: 46px; }
  .title-rex img { width: 180px; }
  .title-screen #bubble { font-size: 20px; }
  .title-cta .title-cta-btn { font-size: 26px; min-height: 70px; }
  .title-cta { margin-bottom: 84px; }
}
@media (min-width: 700px) {
  .title-logo { margin-top: 96px; }
  .title-logo-line { font-size: 64px; }
  .title-rex img { width: 230px; }
  .title-screen #bubble { font-size: 24px; }
  .title-cta { margin-bottom: 110px; }
}

/* Trò Nối điểm (DA-25, §8): bảng vuông, điểm 64px, đường nối xanh. */
.dots-board { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; border: 3px solid #6aa84f; background: linear-gradient(#dff5c2, #a5dc7e); }
.dots-board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dots-dot { position: absolute; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; font-size: 28px; font-weight: 800; color: #4a2f1d; background: #fff; border: 3px solid #4a2f1d; z-index: 2; }
.dots-dot.done { background: #8fd07e; color: #fff; border-color: #2e7d32; }
.dots-dot.dim { opacity: .35; }
.dots-done { text-align: center; }
.dots-done-img { width: 140px; height: 140px; vertical-align: middle; }
.dots-done-name { font-size: 32px; font-weight: 800; color: #4a2f1d; margin-left: 8px; }

/* Trò Đồng hồ (DA-25, §9): mặt đồng hồ SVG + thẻ giờ. */
.clock-wrap { text-align: center; }
.clock-face { width: min(320px, 72vw); height: auto; }
.clock-rim { fill: #fff; stroke: #4a2f1d; stroke-width: 4; }
.clock-dial { fill: #fffdf5; }
.clock-num { font-size: 20px; font-weight: 800; fill: #4a2f1d; text-anchor: middle; }
.clock-hour { stroke: #4a2f1d; stroke-width: 7; stroke-linecap: round; }
.clock-min { stroke: #4a2f1d; stroke-width: 5; stroke-linecap: round; }
.clock-pin { fill: #ff8a5e; }
.clock-hands { transform-box: view-box; transform-origin: 100px 100px; }
.clock-hands.spin { animation: clock-spin 1s ease; }
@keyframes clock-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.clock-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.clock-choices .num-choice { font-size: 28px; }
.clock-choices .num-choice:disabled { opacity: .45; }
.clock-choices .num-choice.sel:disabled { opacity: 1; }

/* Trò Lớn–bé (DA-25, §16): các bạn đứng cạnh nhau, cao theo tỉ lệ thật. */
.size-row { display: flex; align-items: flex-end; justify-content: space-evenly; gap: 8px; min-height: 120px; padding: 12px 4px 0; border-radius: 16px; background: linear-gradient(#dff5c2, #a5dc7e); border: 3px solid #6aa84f; }
.size-dino { background: none; border: none; padding: 0; min-width: 76px; min-height: 76px; display: flex; align-items: flex-end; justify-content: center; }
.size-dino img { display: block; width: auto; }
.size-dino.sel { outline: 4px solid #ffb300; outline-offset: 2px; border-radius: 12px; }
.size-dino:disabled { opacity: .45; }
.size-dino.sel:disabled { opacity: 1; }

/* Trò Ghép âm katakana (DA-25, §11): mảnh âm tiết + tên đang ghép. */
.kata-stage { text-align: center; }
.kata-dino { width: 140px; height: 140px; }
.kata-name { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 32px; font-weight: 800; }
.kata-slot { min-width: 44px; padding: 4px 8px; border: 3px dashed #b9a58a; border-radius: 10px; color: #b9a58a; }
.kata-slot.filled { border-style: solid; border-color: #2e7d32; color: #2e7d32; background: #e8f5e9; }
.kata-pieces { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.kata-piece { font-size: 28px; }
.kata-pieces .num-choice.dim { opacity: .45; }
.kata-pieces .num-choice.sel:disabled { opacity: 1; }

/* Trò Ghép câu (DA-25, §12): câu có chỗ trống + 3 thẻ từ. */
.sentence-stage { text-align: center; }
.sentence-dino { width: 140px; height: 140px; }
.sentence-food { width: 64px; height: 64px; vertical-align: bottom; margin-left: 8px; }
.sentence-text { font-size: 24px; font-weight: 800; line-height: 1.6; }
.sentence-blank { display: inline-block; min-width: 80px; padding: 2px 10px; border: 3px dashed #b9a58a; border-radius: 10px; color: #b9a58a; }
.sentence-blank.filled { border-style: solid; border-color: #2e7d32; color: #2e7d32; background: #e8f5e9; }
.sentence-words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sentence-words .num-choice { font-size: 28px; }
.sentence-words .num-choice:disabled { opacity: .45; }
.sentence-words .num-choice.sel:disabled { opacity: 1; }

/* Trò Tắm bong bóng (DA-25, §10): bong bóng nổi chậm trong ao. */
.bubble-target { text-align: center; }
.bubble-target span { display: inline-block; min-width: 72px; min-height: 72px; line-height: 72px; font-size: 48px; font-weight: 800; color: #4a2f1d; background: #fff3b0; border: 3px solid #4a2f1d; border-radius: 50%; }
.bubble-pond { position: relative; height: 320px; border-radius: 18px; border: 3px solid #6aa84f; background: linear-gradient(#bfe8ff, #7cc4f0 55%, #4da3d8); overflow: hidden; }
.bubble-dot { position: absolute; width: 72px; height: 72px; border-radius: 50%; font-size: 32px; font-weight: 800; color: #1a4a6b; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.98), rgba(190,225,255,.65) 55%, rgba(255,255,255,.35)); border: 2px solid rgba(255,255,255,.95); box-shadow: inset 0 0 14px rgba(255,255,255,.8), 0 2px 6px rgba(0,0,0,.15); animation: bubble-rise 7s ease-in-out infinite alternate; }
@keyframes bubble-rise { from { transform: translateY(0); } to { transform: translateY(-44px); } }
.bubble-dot.dim { opacity: .35; }
.bubble-dot.popped { transform: scale(1.5); opacity: 0; transition: transform .3s ease, opacity .3s ease; animation: none; }
.bubble-dot:disabled { cursor: default; }

/* Trò Phân loại (DA-25, §13): thẻ vật + nhà nhóm. */
.sort-houses { display: flex; gap: 12px; justify-content: center; }
.sort-house { flex: 1; max-width: 200px; min-height: 150px; border: 3px solid #4a2f1d; border-radius: 16px; background: #fff8e1; padding: 10px; text-align: center; cursor: pointer; }
.sort-house-emoji { font-size: 44px; display: block; }
.sort-house-label { font-size: 24px; font-weight: 800; display: block; }
.sort-house-items { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; min-height: 44px; }
.sort-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; }
.sort-card { width: 96px; min-height: 96px; padding: 6px; animation: sort-bob 4s ease-in-out infinite alternate; }
.sort-card img { width: 64px; height: 64px; }
.sort-card-emoji { font-size: 48px; display: block; line-height: 1.2; }
.sort-card-label { display: block; font-size: 18px; font-weight: 700; }
@keyframes sort-bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.sort-card.dim { opacity: .45; }
.sort-card.sel { outline: 3px solid #ff9800; }
.sort-card.placed { animation: none; width: 44px; min-height: 44px; padding: 2px; }
.sort-card.placed img { width: 36px; height: 36px; }
.sort-card.placed .sort-card-emoji { font-size: 24px; }
.sort-card.placed .sort-card-label { display: none; }

/* Trò Mê cung (DA-25, §14): lưới mê cung + nút hướng. */
.maze-grid { display: grid; gap: 4px; justify-content: center; margin: 8px auto; }
.maze-cell { width: 64px; height: 64px; border-radius: 10px; background: #c8e6a0; display: flex; align-items: center; justify-content: center; }
.maze-cell.wall { background: #5d8a4a; }
.maze-cell.rock { background: #c8e6a0; font-size: 40px; }
.maze-cell img { width: 56px; height: 56px; }
.maze-cell.goal img { width: 48px; height: 48px; }
.maze-rex { width: 56px; height: 56px; }
.maze-shake { animation: maze-shake .5s ease-in-out 2; }
@keyframes maze-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-4deg); } 75% { transform: translateX(6px) rotate(4deg); } }
.maze-pad { display: grid; grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(2, 72px); gap: 6px; justify-content: center; margin-top: 10px; }
.maze-pad .maze-dir { width: 72px; height: 72px; font-size: 32px; }
.maze-pad .dir-up { grid-column: 2; grid-row: 1; }
.maze-pad .dir-left { grid-column: 1; grid-row: 2; }
.maze-pad .dir-down { grid-column: 2; grid-row: 2; }
.maze-pad .dir-right { grid-column: 3; grid-row: 2; }
.maze-retry { font-size: 20px; padding: 8px 18px; }

/* Trò Nghe & đoán (DA-25, §15): nghe tiếng kêu, chọn bạn. */
.guess-listen { font-size: 24px; padding: 10px 20px; }
.guess-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; }
.guess-card { width: 140px; padding: 8px; }
.guess-card img { width: 110px; height: 110px; }
.guess-card span { display: block; font-size: 20px; font-weight: 700; }
.guess-card.dim { opacity: .45; }
.guess-card.sel { outline: 3px solid #ff9800; }
.game-card-locked { opacity: .75; }
.gc-lock { display: block; font-size: 16px; font-weight: 700; color: #8d6e63; }

/* DA-27: chủ đề mùa + đồ trang trí sân chơi (v2 §4–§5). */
.hub-stage.season-spring { background: rgba(255, 183, 213, 0.20); border-radius: 18px; }
.hub-stage.season-summer { background: rgba(255, 217, 77, 0.20); border-radius: 18px; }
.hub-stage.season-autumn { background: rgba(255, 157, 111, 0.22); border-radius: 18px; }
.hub-stage.season-winter { background: rgba(191, 232, 255, 0.30); border-radius: 18px; }
.season-badge { display: inline-block; margin: 2px 0 0; padding: 3px 14px; font-size: 16px; font-weight: 800; color: #4a2f1d; background: rgba(255, 255, 255, 0.85); border: 2px solid #4a2f1d; border-radius: 999px; }
.season-fall { position: relative; width: 100%; height: 26px; overflow: hidden; }
.season-fall span { position: absolute; top: -8px; font-size: 20px; animation: season-fall 5s linear infinite; }
.season-fall span:nth-child(1) { left: 4%; animation-delay: 0s; }
.season-fall span:nth-child(2) { left: 20%; animation-delay: 1s; }
.season-fall span:nth-child(3) { left: 36%; animation-delay: 0.5s; }
.season-fall span:nth-child(4) { left: 52%; animation-delay: 1.6s; }
.season-fall span:nth-child(5) { left: 68%; animation-delay: 0.8s; }
.season-fall span:nth-child(6) { left: 84%; animation-delay: 1.3s; }
@keyframes season-fall { 0% { transform: translateY(-10px) rotate(0deg); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(34px) rotate(40deg); opacity: 0.2; } }
.hub-rex { position: relative; }
.hub-rex-wrap { display: inline-block; position: relative; animation: dino-bob 2.4s ease-in-out infinite; }
.hub-rex-wrap #companion-img { animation: none; }
.season-hat { position: absolute; left: 50%; top: -8px; width: 62px; margin-left: -31px; pointer-events: none; }
.pg-decor { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 92%; margin-top: 8px; }
.pg-chip { display: inline-block; padding: 4px 10px; font-size: 15px; font-weight: 700; color: #4a2f1d; background: rgba(255, 255, 255, 0.88); border: 2px solid #4a2f1d; border-radius: 999px; }
/* DA-26 §3: màn chia đôi Hai bé (tuyến #/two) — dọc: 2 nửa trên/dưới;
 * ngang: 2 nửa trái/phải. Mỗi nửa là 1 iframe phiên app độc lập.
 * Tiêu chí: nút chạm ≥ 64px trong mỗi nửa (trò đã dùng nút ≥ 64px sẵn),
 * không tràn ngang, 0 lỗi JS. */
body.is-two { overflow: hidden; }
body.is-two #app { max-width: none; height: 100dvh; padding: 8px; box-sizing: border-box; }
.two-wrap { display: flex; flex-direction: column; height: 100%; gap: 8px; }
.two-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.two-head h1 { margin: 0; font-size: 20px; }
.two-head .pill-btn { padding: 8px 16px; font-size: 15px; }
.two-panes { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.two-pane { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.9); border: 3px solid #4a2f1d; border-radius: 16px; overflow: hidden; }
.two-pane iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; display: block; }
.two-kid { margin: 0; padding: 6px 10px; font-weight: 800; font-size: 16px; background: #ffe0b2; border-bottom: 2px solid #4a2f1d; text-align: left; }
@media (orientation: landscape) {
  .two-panes { flex-direction: row; }
}
/* DA-26: khung con trong nửa màn — gọn lề để trò vừa nửa hẹp. */
body.two-pane #app { padding: 8px; }
body.two-pane .games-grid { padding-bottom: 24px; }
/* DA-31 — Trò Đuổi bướm (v3 §2.1): sân bướm bay + số trên cánh. */
.chase-yard { position: relative; height: 340px; border-radius: 18px; border: 3px solid #6aa84f; background: linear-gradient(#dff5c0, #bfe8a0 60%, #a5d68a); overflow: hidden; }
.chase-fly { position: absolute; width: 72px; height: 72px; font-size: 44px; line-height: 72px; text-align: center; background: rgba(255, 255, 255, 0.85); border: 3px solid #4a2f1d; border-radius: 50%; cursor: pointer; animation: chase-drift 6s ease-in-out infinite alternate; }
.chase-fly .chase-num { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; background: #ffd94d; border: 2px solid #4a2f1d; font-size: 20px; font-weight: 800; color: #4a2f1d; }
.chase-fly:disabled { opacity: 0.45; }
.chase-fly.sel { outline: 4px solid #22a355; }
.chase-fly.caught { animation: chase-flyup 0.9s ease-in forwards; }
@keyframes chase-drift { from { transform: translate(0, 0); } to { transform: translate(10px, -12px); } }
@keyframes chase-flyup { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-70px) scale(1.15); opacity: 0.9; } }
@keyframes fish-swim { from { transform: translate(0, 0); } to { transform: translate(10px, -10px); } }
@keyframes fish-caught { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-70px) scale(1.15); opacity: 0.9; } }
@keyframes fish-dive { 30% { transform: translateY(14px) scale(0.92); opacity: 0.7; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
.fish-pond { position: relative; height: 340px; border-radius: 18px; border: 3px solid #4a2f1d; background: linear-gradient(#8fd0f2, #4aa8e0 55%, #2f8fd0); overflow: hidden; }
.fish-pond .mosa-bank { position: absolute; right: 2%; bottom: 2%; width: 96px; z-index: 4; }
#fish-yard { position: absolute; inset: 0; }
.fish-swim { position: absolute; width: 72px; height: 72px; font-size: 40px; line-height: 72px; text-align: center; background: rgba(255, 255, 255, 0.85); border: 3px solid #4a2f1d; border-radius: 50%; cursor: pointer; animation: fish-swim 6s ease-in-out infinite alternate; }
.fish-swim .fish-num { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; background: #ffd94d; border: 2px solid #4a2f1d; font-size: 20px; font-weight: 800; color: #4a2f1d; }
.fish-swim:disabled { opacity: 0.45; }
.fish-swim.sel { outline: 4px solid #22a355; }
.fish-swim.caught { animation: fish-caught 0.7s ease-in forwards; }
.fish-swim.fish-dive { animation: fish-dive 0.8s ease-in; }
.rhythm-dots { text-align: center; margin: 8px 0; }
.rhythm-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: #e8e0d0; border: 2px solid #4a2f1d; margin: 0 5px; }
.rhythm-dot.lit { background: #ffd94d; }
.rhythm-comp { text-align: center; margin: 4px 0; }
.rhythm-comp img { width: 110px; }
.rhythm-comp img.comp-jump { animation: dino-jump 0.7s ease-in-out; }
.rhythm-drum { position: relative; display: block; width: 220px; height: 220px; margin: 10px auto; border-radius: 50%; border: 4px solid #4a2f1d; background: radial-gradient(circle at 50% 35%, #fff3d6, #e85d4a 70%); cursor: pointer; }
.rhythm-drum.shake { animation: rhythm-shake 0.25s ease-in-out; }
@keyframes rhythm-shake { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.rhythm-beat-point { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 4px solid #ffd94d; background: rgba(255, 217, 77, 0.35); }
.rhythm-ring { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 4px solid #22a355; animation: rhythm-shrink linear forwards; pointer-events: none; }
@keyframes rhythm-shrink { from { transform: scale(2.4); opacity: 0.85; } to { transform: scale(1); opacity: 1; } }
.rhythm-ring.hit { animation: none; transform: scale(1); opacity: 0; transition: opacity 0.3s; }
.rhythm-ring.missed { opacity: 0.15; }
/* DA-31 §6 — cảnh báo bản lưu hỏng ở khu phụ huynh. */
.parent-warn { background: #fff3cd; border: 2px solid #e6a700; border-radius: 12px; padding: 10px 14px; font-weight: 700; color: #7a5b00; }
/* DA-34.2 Bé nói (§5): bảng micro trong màn Ghép cặp + hàng bản thu ở
 * khu phụ huynh (§8). Nút micro to cho bé 4 tuổi chạm trúng (>=64px);
 * đang thu thì nút nhấp nháy (sóng âm, nguyên tắc 9). */
.speak-panel { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin: 12px 0; }
.speak-panel .speak-mic { font-size: 20px; padding: 14px 26px; min-width: 64px; min-height: 64px; }
.speak-wave .speak-mic { animation: speak-pulse 0.9s ease-in-out infinite; }
@keyframes speak-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.speak-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.build-model-wrap { text-align: right; margin: 4px 0; }
.build-model .blk { display: block; width: 100%; height: 100%; }
.build-model svg { display: block; width: 100%; height: 100%; }
.build-model { position: relative; display: inline-block; width: 120px; height: 112px; border: 3px solid #4a2f1d; border-radius: 12px; background: #e8f6ff; }
.build-house { position: relative; width: 320px; height: 300px; margin: 8px auto; }
.build-slot { position: absolute; }
.build-slot .blk { display: block; width: 100%; height: 100%; }
.build-slot .blk.ghost { background: transparent; border: 3px dashed #4a2f1d; opacity: 0.45; }
.build-slot .blk.ghost.blk-circle { border-radius: 50%; }
.build-slot .blk.ghost.blk-square { border-radius: 8px; }
.build-slot.need .blk.ghost { opacity: 1; animation: build-pulse 1s ease-in-out infinite; }
@keyframes build-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.build-slot .placed { display: block; width: 100%; height: 100%; animation: build-pop 0.4s ease-out; }
.build-slot .placed .blk { display: block; width: 100%; height: 100%; }
@keyframes build-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.blk-square { border-radius: 8px; border: 4px solid #4a2f1d; }
.blk-circle { border-radius: 50%; border: 4px solid #4a2f1d; }
.build-tray { display: flex; gap: 14px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.build-choice { width: 84px; height: 84px; padding: 8px; background: #fff8e2; border: 3px solid #4a2f1d; border-radius: 14px; cursor: pointer; }
.build-choice .blk { display: block; width: 100%; height: 100%; }
.build-choice.sel { outline: 4px solid #ffd94d; outline-offset: 2px; }
.build-choice.build-fall { animation: build-fall 0.5s ease-in forwards; }
@keyframes build-fall { to { transform: translateY(30px); opacity: 0.25; } }
.build-comp { text-align: center; margin: 4px 0; }
.build-comp img { width: 110px; }
.build-comp img.comp-jump { animation: dino-jump 0.7s ease-in-out; }

/* DA-32.1: dien mao vuon theo demo CEO duyet (test-evidence/da321-demo.html, 86a08b9) — giu nguyen co che gieo-tuoi-hai + cham diem, chi doi dien mao. */
.garden-screen { position: relative; max-width: 520px; margin: 0 auto; padding: 10px 12px 12px; overflow: hidden; background: linear-gradient(180deg, #c9b6f6 0%, #dfb9ef 30%, #f2c2e2 58%, #f8cfe0 82%, #f6c9d8 100%); border-radius: 18px; }
.garden-screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle 2px at 8% 12%, rgba(255,255,255,.95) 50%, transparent 51%), radial-gradient(circle 3px at 92% 9%, rgba(255,255,255,.9) 50%, transparent 51%), radial-gradient(circle 2px at 85% 30%, rgba(255,255,255,.85) 50%, transparent 51%), radial-gradient(circle 2px at 4% 44%, rgba(255,255,255,.8) 50%, transparent 51%), radial-gradient(circle 3px at 96% 55%, rgba(255,255,255,.85) 50%, transparent 51%), radial-gradient(circle 2px at 12% 68%, rgba(255,255,255,.8) 50%, transparent 51%), radial-gradient(circle 2px at 90% 78%, rgba(255,255,255,.8) 50%, transparent 51%), radial-gradient(circle 3px at 6% 88%, rgba(255,255,255,.85) 50%, transparent 51%); }
.garden-screen > * { position: relative; z-index: 1; }
.garden-screen h1 { text-align: center; font-size: 40px; font-weight: 900; letter-spacing: 2px; line-height: 1.1; color: #fff3cf; text-shadow: 2px 0 0 #8a5a2e, -2px 0 0 #8a5a2e, 0 2px 0 #8a5a2e, 0 -2px 0 #8a5a2e, 2px 2px 0 #8a5a2e, -2px 2px 0 #8a5a2e, 2px -2px 0 #8a5a2e, -2px -2px 0 #8a5a2e, 0 5px 0 rgba(138,90,46,.55), 0 7px 10px rgba(120,60,20,.35); margin: 2px 0 6px; }
.garden-screen [data-garden-level] { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(180deg, #fffaf0, #ffeecf); border: 3px solid #d9a441; box-shadow: 0 2px 0 #b9822e, 0 3px 5px rgba(120,60,20,.25); font-size: 20px; font-weight: 900; color: #7a4a21; cursor: pointer; margin: 2px; }
.garden-screen [data-garden-level]:disabled { opacity: 0.45; }
.garden-screen [data-garden-level].sel { background: linear-gradient(180deg, #ffe9a8, #ffd76e); }
.garden-yard { position: relative; width: 100%; aspect-ratio: 3 / 2; max-height: 340px; padding: 9px; border-radius: 20px; background: linear-gradient(180deg, #f9a9bd 0%, #f28ba6 45%, #ef7d9c 100%); box-shadow: 0 4px 0 #d95f83, 0 8px 16px rgba(120,30,60,.35), inset 0 2px 0 rgba(255,255,255,.55); }
.garden-scene { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #8fd8f8 0%, #aee9f9 45%, #c9f3e2 72%, #b8ecc9 100%); }
.garden-sun { position: absolute; left: 6%; top: 5%; width: 19%; aspect-ratio: 1; z-index: 1; }
.garden-cloud { position: absolute; background: #ffd9ea; opacity: .95; border-radius: 50px; z-index: 1; }
.garden-cloud.c1 { width: 34%; height: 8%; left: 38%; top: 12%; }
.garden-cloud.c2 { width: 26%; height: 7%; left: 62%; top: 32%; }
.garden-cloud.c3 { width: 22%; height: 6%; left: 30%; top: 38%; }
.garden-cloud::before, .garden-cloud::after { content: ""; position: absolute; background: #ffd9ea; border-radius: 50%; }
.garden-cloud::before { width: 46%; height: 130%; left: 12%; top: -55%; }
.garden-cloud::after { width: 36%; height: 110%; right: 14%; top: -45%; }
.garden-hill { position: absolute; left: -10%; right: -10%; bottom: 28%; height: 20%; background: radial-gradient(ellipse 60% 100% at 30% 100%, #a5e08a 0%, #8fd47a 70%, transparent 71%), radial-gradient(ellipse 55% 100% at 78% 100%, #9bdc84 0%, #86d172 70%, transparent 71%); z-index: 1; }
.garden-tree { position: absolute; bottom: 30%; height: 42%; z-index: 2; }
.garden-tree .trunk { position: absolute; left: 50%; bottom: 0; width: 13%; height: 34%; transform: translateX(-50%); background: linear-gradient(90deg, #8a5a33, #6e4525); border-radius: 6px 6px 3px 3px; }
.garden-tree .canopy { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); width: 100%; height: 62%; }
.garden-tree .canopy i { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a9e68d, #6cbf5e 60%, #57a848); box-shadow: inset -4px -6px 0 rgba(60,120,40,.25); }
.garden-tree .canopy i:nth-child(1) { width: 52%; height: 62%; left: 2%; bottom: 4%; }
.garden-tree .canopy i:nth-child(2) { width: 58%; height: 70%; left: 24%; bottom: 20%; }
.garden-tree .canopy i:nth-child(3) { width: 42%; height: 50%; right: 0; bottom: 2%; }
.garden-tree .canopy b { position: absolute; width: 8%; height: 10%; border-radius: 50%; background: #ffb3d1; box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.garden-tree.left { left: 7%; width: 27%; }
.garden-tree.right { right: 6%; width: 29%; }
.garden-grass { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; z-index: 3; background: linear-gradient(180deg, #7ccb5e 0%, #5db84a 55%, #4da83e 100%); }
.garden-comp { position: absolute; left: 1%; bottom: 3%; width: 26%; max-width: 110px; z-index: 6; filter: drop-shadow(0 4px 4px rgba(40,60,20,.35)); }
.garden-brachio { position: absolute; right: 2%; top: 2%; width: 110px; z-index: 4; }
.garden-bed { position: absolute; left: 8%; right: 8%; bottom: 4%; height: 26%; z-index: 4; background: linear-gradient(180deg, #9c6b43, #7d4f2c 60%, #6b4225); border-radius: 18px; box-shadow: inset 0 4px 8px rgba(0,0,0,.35), inset 0 -3px 0 rgba(255,220,180,.25), 0 2px 0 rgba(255,255,255,.35); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 6px; }
.garden-bed::before { content: ""; position: absolute; left: 4%; right: 4%; top: -7px; height: 12px; background-image: radial-gradient(circle 3px at 10px 8px, #5da85f 50%, transparent 51%), radial-gradient(circle 3px at 30px 5px, #6cbf5e 50%, transparent 51%), radial-gradient(circle 3px at 52px 9px, #4da83e 50%, transparent 51%), radial-gradient(circle 3px at 74px 6px, #5da85f 50%, transparent 51%); background-size: 84px 12px; background-repeat: repeat-x; }
.garden-bed.watered { background: linear-gradient(180deg, #7d5a38, #64452a 60%, #54371f); }
.garden-sprout { font-size: 28px; }
.garden-crops { position: absolute; left: 0; right: 0; bottom: 38%; display: flex; justify-content: center; gap: 12px; z-index: 5; }
.garden-crop { width: 72px; height: 72px; font-size: 44px; background: rgba(255, 255, 255, 0.9); border: 3px solid #4a2f1d; border-radius: 50%; box-shadow: 0 3px 0 rgba(120,60,20,.3), 0 4px 8px rgba(120,60,20,.25); cursor: pointer; }
.garden-crop:disabled { opacity: 0.45; }
.garden-crop.sel { outline: 4px solid #22a355; }
.garden-crop.picked { animation: garden-pop 0.5s ease-out; }
.garden-crop.garden-tall { transform: translateY(-30px); }
@keyframes garden-pop { from { transform: scale(0.7); } to { transform: scale(1.15); } }
.garden-tray { display: flex; gap: 12px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.garden-seed { width: 62px; height: 62px; font-size: 36px; background: radial-gradient(circle at 35% 30%, #fff8ea, #ffe9c4 70%); border: none; border-radius: 50%; box-shadow: 0 3px 0 rgba(120,60,20,.3), 0 4px 8px rgba(120,60,20,.25), inset 0 0 0 4px #f2b544; cursor: pointer; }
.garden-seed:nth-child(3n+2) { box-shadow: 0 3px 0 rgba(120,60,20,.3), 0 4px 8px rgba(120,60,20,.25), inset 0 0 0 4px #7fd4c9; }
.garden-seed:nth-child(3n+3) { box-shadow: 0 3px 0 rgba(120,60,20,.3), 0 4px 8px rgba(120,60,20,.25), inset 0 0 0 4px #f78fb0; }
.garden-seed:active { transform: scale(.92); }
.garden-seed:disabled { opacity: 0.45; }
.garden-seed.planted { filter: grayscale(.5) brightness(.85); transform: scale(.9); }
.garden-can { min-width: 140px; min-height: 62px; font-size: 24px; font-weight: 800; background: linear-gradient(180deg, #7cc4f7, #42a5f5 60%, #2f8fe0); color: #ffffff; border: 3px solid #4a2f1d; border-radius: 18px; box-shadow: 0 3px 0 #2b6cb0, 0 4px 8px rgba(20,90,140,.3); cursor: pointer; }
.garden-can:disabled { opacity: 0.45; }
.garden-can.sel { outline: 4px solid #22a355; }
.garden-done { min-width: 108px; height: 62px; font-size: 26px; font-weight: 900; letter-spacing: 1px; color: #ffffff; background: linear-gradient(180deg, #7ed67a, #4cb84a 60%, #3da53c); border: 3px solid #f7a8bd; border-radius: 18px; text-shadow: 0 2px 0 rgba(0,80,0,.35); box-shadow: 0 3px 0 #2f8a2e, 0 5px 10px rgba(20,90,20,.3), inset 0 2px 0 rgba(255,255,255,.5); cursor: pointer; }
.garden-done:active { transform: scale(.95); }
.garden-done:disabled { opacity: 0.45; }
.garden-done.pulse { animation: garden-pulse .7s ease infinite alternate; }
@keyframes garden-pulse { from { transform: scale(1); } to { transform: scale(1.06); } }
#garden-target { text-align: center; font-size: 24px; font-weight: 900; color: #7a4a21; text-shadow: 0 1px 0 #fff, 0 2px 3px rgba(120,60,20,.25); margin: 6px 0; }
.garden-pond-zone { position: relative; height: 92px; display: flex; justify-content: center; align-items: center; margin: 4px 0; }
.garden-pond { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 92%; height: 100%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #a5dcf7, #6fbfe8 70%, #5aaede); box-shadow: inset 0 3px 8px rgba(255,255,255,.6), inset 0 -4px 10px rgba(20,90,140,.3); z-index: 0; }
.garden-banner { position: relative; z-index: 1; width: 96%; background: linear-gradient(180deg, #fff, #ffeef4); border: 3px solid #f7a8bd; border-radius: 16px; box-shadow: 0 3px 0 #e58aa8, 0 5px 10px rgba(150,50,90,.25); padding: 10px 36px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 20px; font-weight: 900; color: #7a4a21; letter-spacing: .5px; }
.garden-bow { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; }
.garden-bow.left { left: 6px; }
.garden-bow.right { right: 6px; }
.garden-vine { position: absolute; z-index: 7; pointer-events: none; border: 3px solid #5da85f; border-radius: 50%; }
.garden-vine.v1 { width: 90px; height: 26px; left: 8%; top: -7px; border-color: transparent transparent #5da85f transparent; transform: rotate(-4deg); }
.garden-vine.v2 { width: 90px; height: 26px; right: 8%; top: -7px; border-color: transparent transparent #5da85f transparent; transform: rotate(4deg); }
.garden-corner-flower { position: absolute; width: 30px; height: 30px; z-index: 7; pointer-events: none; }
.garden-corner-flower i { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%,-50%); background: radial-gradient(circle, #ffd94d 0 22%, #ff9ec7 23% 100%); border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.55); }
.garden-corner-flower i::before, .garden-corner-flower i::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: radial-gradient(circle 7px at 50% 12%, #ffb3d1 50%, transparent 51%), radial-gradient(circle 7px at 88% 50%, #ff9ec7 50%, transparent 51%), radial-gradient(circle 7px at 50% 88%, #ffb3d1 50%, transparent 51%), radial-gradient(circle 7px at 12% 50%, #ff9ec7 50%, transparent 51%); }
.garden-corner-flower.cf-tl { left: -8px; top: -8px; }
.garden-corner-flower.cf-tr { right: -8px; top: -8px; }
.garden-corner-flower.cf-bl { left: -8px; bottom: -8px; }
.garden-corner-flower.cf-br { right: -8px; bottom: -8px; }
.garden-mushroom { position: absolute; right: 2.5%; bottom: 31%; z-index: 5; width: 34px; height: 40px; }
.garden-mushroom .cap { position: absolute; top: 0; left: 0; width: 34px; height: 20px; background: radial-gradient(circle at 35% 30%, #ff8a8a, #e84545 65%); border-radius: 50% 50% 6px 6px; }
.garden-mushroom .cap::after { content: ""; position: absolute; left: 7px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 14px 2px 0 #fff, 6px 9px 0 #fff; }
.garden-mushroom .stem { position: absolute; left: 11px; top: 18px; width: 12px; height: 20px; background: #fff3d6; border-radius: 0 0 6px 6px; }
@media (min-width: 600px) { .garden-screen h1 { font-size: 52px; } .garden-screen [data-garden-level] { width: 44px; height: 44px; } .garden-yard { max-height: 560px; } .garden-seed { width: 70px; height: 70px; } .garden-done { height: 70px; font-size: 30px; } .garden-banner { font-size: 26px; } }

.cook-recipe { background: #fff8e2; border: 3px solid #4a2f1d; border-radius: 14px; padding: 8px 12px; margin: 8px auto; max-width: 420px; }
.cook-dish { font-size: 20px; font-weight: bold; margin: 2px 0 6px; }
.cook-ing { display: inline-block; margin: 2px 6px; padding: 2px 6px; background: #fff; border: 2px solid #4a2f1d; border-radius: 10px; }
.cook-ing svg { width: 26px; height: 26px; vertical-align: middle; }
.cook-ing.done { background: #d9f2c9; }
.cook-ing.cook-secret { background: #f0e6ff; }
.cook-pot { position: relative; width: 220px; margin: 10px auto 0; cursor: pointer; }
.cook-pot-svg { display: block; width: 100%; }
.cook-added-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 34px; align-items: flex-end; }
.cook-added { display: inline-block; width: 34px; height: 34px; }
.cook-added svg { width: 100%; height: 100%; }
.cook-pot.stirring { animation: cook-shake 0.35s ease-in-out; }
@keyframes cook-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.cook-stir-dots { text-align: center; font-size: 22px; margin: 4px 0; min-height: 28px; }
.cook-tray { display: flex; gap: 12px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.cook-choice { width: 88px; min-height: 88px; padding: 6px; background: #fff8e2; border: 3px solid #4a2f1d; border-radius: 14px; cursor: pointer; }
.cook-choice svg { display: block; width: 56px; height: 56px; margin: 0 auto; }
.cook-choice span { display: block; font-size: 15px; margin-top: 2px; }
.cook-choice.sel { outline: 4px solid #ffd94d; outline-offset: 2px; }
.cook-choice.cook-fall { animation: build-fall 0.5s ease-in forwards; }
.cook-comp { text-align: center; margin: 4px 0; }
.cook-comp img { width: 110px; }
.cook-comp img.comp-jump { animation: dino-jump 0.7s ease-in-out; }

/* --- To mau (DA-33.1, v3 §4.1) --- */
#paint-stage { margin: 8px auto; min-height: 200px; }
#paint-stage svg { display: block; width: min(82vw, 340px); height: auto; margin: 0 auto; background: #fff; border-radius: 16px; border: 3px solid #4a2f1d; }
#paint-stage [data-paint-region] { cursor: pointer; }
.paint-loading { text-align: center; color: #999; }
#paint-picks { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.paint-pick { padding: 8px 12px; font-size: 17px; background: #fff8e2; border: 3px solid #4a2f1d; border-radius: 12px; cursor: pointer; }
#paint-palette { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.paint-color { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; min-width: 56px; min-height: 64px; background: #fff; border: 3px solid #4a2f1d; border-radius: 12px; cursor: pointer; font-size: 15px; }
.paint-dot { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #4a2f1d; }
.paint-color.sel, .paint-pick.sel { outline: 4px solid #ffd94d; outline-offset: 2px; }

/* --- Tim theo mau (DA-33.2, v3 §4.2) --- */
#find-row { display: flex; gap: 12px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.find-dino { position: relative; width: min(28vw, 150px); padding: 8px; background: #fff; border: 5px solid #4a2f1d; border-radius: 16px; cursor: pointer; }
.find-dino img { display: block; width: 100%; height: auto; }
.find-tint { position: absolute; inset: 0; border-radius: 10px; opacity: .45; pointer-events: none; }
.find-dino.sel { outline: 4px solid #ffd94d; outline-offset: 2px; }
.find-dino img.find-jump { animation: dino-jump 0.7s ease-in-out; }
.find-dino.find-shake { animation: find-shake 0.5s ease-in-out; }
@keyframes find-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px) rotate(-3deg); } 75% { transform: translateX(7px) rotate(3deg); } }
#find-streak { text-align: center; font-size: 22px; margin: 4px 0; min-height: 28px; }
.find-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #4a2f1d; margin: 0 3px; background: #fff; }
.find-dot.on { background: #ffd94d; }

#sizev3-row { display: flex; gap: 16px; justify-content: center; align-items: flex-end; margin: 12px 0; }
.sizev3-dino { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 10px 8px 8px; background: #fff; border: 5px solid #4a2f1d; border-radius: 16px; cursor: pointer; min-width: 120px; }
.sizev3-dino img { display: block; width: auto; max-width: 100%; height: auto; }
.sizev3-dino.sel { outline: 4px solid #ffd94d; outline-offset: 2px; }
.sizev3-dino img.find-jump { animation: dino-jump 0.7s ease-in-out; }
.sizev3-dino.find-shake { animation: find-shake 0.5s ease-in-out; }
.sizev3-name { margin-top: 8px; font-size: 18px; font-weight: bold; color: #4a2f1d; }
#sizev3-streak { text-align: center; font-size: 22px; margin: 4px 0; min-height: 28px; }

/* Cảm xúc DA-33.4: hàng 4 nút mặt vẽ dưới tên bạn ở sân chơi + động tác thể hiện. */
#emo-row { display: flex; gap: 10px; justify-content: center; margin: 10px 0 4px; }
.emo-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 6px; background: #fff; border: 4px solid #4a2f1d; border-radius: 16px; cursor: pointer; min-width: 64px; }
.emo-btn img { width: 52px; height: 52px; display: block; }
.emo-btn span { font-size: 15px; font-weight: bold; color: #4a2f1d; word-break: keep-all; line-height: 1.3; }
.emo-btn.sel { outline: 4px solid #ffd94d; outline-offset: 2px; }
#companion-img.emo-jump { animation: dino-jump 0.7s ease-in-out; }
#companion-img.emo-bow { animation: emo-bow 1.2s ease-in-out; }
#companion-img.emo-nod { animation: emo-nod 1.8s ease-in-out; }
#companion-img.emo-hop { animation: emo-hop 0.9s ease-in-out; }
@keyframes emo-bow { 0% { transform: rotate(0deg); } 40% { transform: rotate(7deg) translateY(10px); } 100% { transform: rotate(0deg); } }
@keyframes emo-nod { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg) translateY(2px); } }
@keyframes emo-hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-14px); } 55% { transform: translateY(0); } 80% { transform: translateY(-8px); } }

/* --- Bản đồ hành trình (DA-61, v2 §2) --- */
.map-screen { padding: 8px 12px 24px; border-radius: 18px; }
.map-screen.season-spring { background: rgba(255, 183, 213, 0.20); }
.map-screen.season-summer { background: rgba(255, 217, 77, 0.20); }
.map-screen.season-autumn { background: rgba(255, 157, 111, 0.22); }
.map-screen.season-winter { background: rgba(191, 232, 255, 0.30); }
#map-progress { font-size: 18px; font-weight: bold; text-align: center; margin: 4px 0; }
#map-track { position: relative; display: flex; gap: 14px; overflow-x: auto; padding: 34px 12px 30px; }
#map-track::before { content: ""; position: absolute; left: 12px; right: 12px; top: 66px; border-top: 4px dashed #c9a86a; }
.map-stop { flex: 0 0 104px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; background: #fff8e1; border: 3px solid #4a2f1d; border-radius: 18px; cursor: pointer; }
.map-stop:nth-child(even) { transform: translateY(24px); }
.map-stop .map-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.map-stop .map-icon svg { width: 64px; height: 64px; }
.map-stop .map-icon img { width: 56px; height: 56px; }
.map-stop .map-name { font-size: 15px; font-weight: bold; line-height: 1.2; text-align: center; }
.map-stop .map-badge { font-size: 13px; font-weight: bold; color: #8d6e63; }
.map-stop.map-locked { background: #eceff1; opacity: 0.75; }
.map-stop.map-locked .map-name { color: #78909c; }
.map-stop.map-playing { background: #e8f5e9; box-shadow: 0 0 0 3px #a5d6a7; }
.map-stop.map-done { background: #fce4ec; box-shadow: 0 0 0 3px #f48fb1; }
.map-stop.map-done .map-badge { font-size: 18px; }

/* DA-67 (BH2-61): bạn đồng hành nhảy múa 3 giây khi tim đầy 5 — dùng lại
   nhịp nhảy dino-happy, lặp 5 lần = 3 giây. */
.dino-dance { animation: dino-happy 0.6s ease-in-out 5; }

/* DA-67 (BH2-68): huy hiệu trò vừa mở (Nghe & đoán đủ 3 bạn). */
.gc-badge { display: block; font-size: 16px; font-weight: 700; }
.gc-new { background: #fff3b0; color: #7a4a00; border-radius: 999px; padding: 2px 10px; }
.map-new { background: #fff3b0; color: #7a4a00; border-radius: 999px; padding: 1px 8px; }
.hub-new { text-align: center; font-weight: 700; color: #7a4a00; background: #fff3b0; border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
