:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #2d2a3e;
  --muted: #6f6a85;
  --line: #efe4d2;
  --pri: #ff8a5c;
  --pri-d: #e8673a;
  --sky: #4cb5f5;
  --sky-d: #2a93d4;
  --leaf: #4fbf7f;
  --sun: #ffc93c;
  --grape: #8b6cf6;
  --danger: #e5484d;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(45, 42, 62, .08), 0 10px 24px rgba(45, 42, 62, .08);
  --font: "Nunito", "Segoe UI Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.45; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { font-family: inherit; }
h1, h2, h3 { line-height: 1.2; margin: .2em 0 .5em; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Nút ---------- */
.btn { border: 0; border-radius: 16px; padding: 12px 18px; min-height: 48px; font-size: 17px; font-weight: 800; cursor: pointer;
  background: var(--sky); color: #fff; box-shadow: 0 4px 0 var(--sky-d); transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sky-d); }
.btn.alt { background: var(--grape); box-shadow: 0 4px 0 #6a4fd6; }
.btn.go { background: var(--leaf); box-shadow: 0 4px 0 #34985f; }
.btn.warm { background: var(--pri); box-shadow: 0 4px 0 var(--pri-d); }
.btn.danger { background: var(--danger); box-shadow: 0 4px 0 #b3282d; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.btn.big { min-height: 68px; font-size: 21px; padding: 14px 26px; border-radius: 22px; }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.btn.tiny { min-height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 12px; }
.btn.round { width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; font-size: 24px; }
.btn.top { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); min-height: 44px; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 700; cursor: pointer; margin: 3px; color: var(--ink); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }

/* ---------- Thanh trên ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: rgba(255, 248, 236, .92); backdrop-filter: blur(6px); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; font-size: 19px; font-weight: 800; color: var(--ink); cursor: pointer; padding: 0; }
.brand b { color: var(--pri); }
.logo { font-size: 30px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.stars { background: #fff4c7; border: 2px solid #ffe08a; border-radius: 999px; padding: 6px 12px; font-weight: 800; white-space: nowrap; transition: transform .2s; }
.stars.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.25); } }

#view { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; outline: none; }

/* ---------- Trang chính ---------- */
.hello { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #ffe3c2, #ffd1e3); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.hello .owl-big { font-size: 64px; animation: bob 2.4s ease-in-out infinite; cursor: pointer; }
.hello h1 { font-size: 26px; margin: 0; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 21px; margin: 26px 0 12px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.lesson-card { position: relative; border: 0; text-align: left; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 150px; color: var(--ink); transition: transform .12s; }
.lesson-card:hover { transform: translateY(-3px); }
.lesson-card:active { transform: scale(.98); }
.lesson-card .ic { font-size: 54px; line-height: 1; }
.lesson-card .tt { font-size: 19px; font-weight: 800; }
.lesson-card .sub { font-size: 14px; color: var(--muted); }
.lesson-card.today { background: linear-gradient(160deg, #fff, #e8f7ff); outline: 3px solid var(--sky); }
.badge { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 9px; background: #eef; color: #445; }
.badge.ok { background: #dcf7e7; color: #1f7a48; }
.badge.beta { background: #e4f1ff; color: #1d5f99; }
.badge.draft { background: #fff0cc; color: #8a5a00; }
.badge.ai { background: #f1e8ff; color: #5b34b8; }
.lesson-card .badges { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Thẻ từ ---------- */
.theme-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.theme-tabs button { flex: 0 0 auto; }
.theme-tabs .on { background: var(--pri); color: #fff; border-color: var(--pri); }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 12px; }
.word-tile { background: #fff; border: 0; border-radius: 18px; box-shadow: var(--shadow); padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; color: var(--ink); }
.word-tile .e { font-size: 46px; }
.word-tile .w { font-weight: 800; font-size: 17px; }
.word-tile .v { font-size: 13px; color: var(--muted); text-align: center; }
.wcard { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.wc-pic { font-size: 110px; line-height: 1.1; animation: pop-in .35s; }
.wc-word { font-size: 40px; font-weight: 900; color: var(--pri-d); }
.wc-ipa { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 18px; font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", sans-serif; }
.wc-vi { font-size: 19px; font-weight: 700; }
.wc-ex { font-size: 17px; color: var(--muted); font-style: italic; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }

/* ---------- Hộp thoại ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(30, 25, 50, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: #fff; border-radius: 24px; padding: 22px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 860px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Thông báo ---------- */
#toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #1f7a48; color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 700; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); transition: opacity .4s, transform .4s; }
.toast.warn { background: #b26a00; }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- Màn chơi ---------- */
#play { position: fixed; inset: 0; z-index: 50; background: #8fd3ff; display: flex; flex-direction: column; touch-action: none; user-select: none; -webkit-user-select: none; }
.play-top { display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: rgba(255, 255, 255, .7); z-index: 5; }
.play-title { flex: 1; font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replay-main { background: var(--pri); box-shadow: 0 4px 0 var(--pri-d); animation: pulse 1.8s infinite; width: 64px; height: 64px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.mic-dot { font-size: 24px; animation: pulse 1s infinite; }
#stage { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#stage canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; max-height: 100%; touch-action: none; }
#owl-bubble { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 22px; padding: 10px 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .15); max-width: min(94vw, 640px); animation: pop-in .25s; }
#owl-bubble .owl { font-size: 40px; }
#owl-bubble .say { display: flex; flex-direction: column; }
#owl-bubble b { font-size: 21px; }
#owl-bubble small { font-size: 14px; }
#owl-bubble .replay { border: 0; background: #ffe7dc; border-radius: 50%; width: 52px; height: 52px; font-size: 22px; cursor: pointer; flex: 0 0 auto; }
#choice-layer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.choice-panel { background: rgba(255, 255, 255, .95); border-radius: 26px; padding: 14px; box-shadow: 0 -6px 30px rgba(0, 0, 0, .15); width: min(720px, 100%); }
.choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pic-btn { border: 4px solid #fff; background: #fff7e6; border-radius: 22px; min-width: 110px; min-height: 110px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; box-shadow: 0 5px 0 #f0dcc0; color: var(--ink); }
.pic-btn .e { font-size: 52px; line-height: 1.1; }
.pic-btn .w { font-weight: 800; font-size: 18px; }
.pic-btn:active { transform: translateY(3px); }
.pic-btn.pulse { animation: glow 1s infinite; border-color: var(--sun); }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(255, 201, 60, .5); transform: scale(1.05); } }
.parent-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.wobble { animation: wobble .5s; }
@keyframes wobble { 20% { transform: translateX(-10px) rotate(-4deg); } 40% { transform: translateX(9px) rotate(3deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
#pause-layer { position: absolute; inset: 0; z-index: 20; background: rgba(30, 25, 50, .5); display: flex; align-items: center; justify-content: center; }
.pause-card { background: #fff; border-radius: 26px; padding: 26px 34px; text-align: center; }
.big-emoji { font-size: 70px; }

/* Nút cảm ứng: chạy và nhảy cùng lúc bằng hai tay */
#touch-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; justify-content: space-between; align-items: flex-end; padding: 12px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.pad-left, .pad-right { display: flex; gap: 14px; pointer-events: auto; }
.pad { width: 84px; height: 84px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .8); font-size: 34px; font-weight: 900; box-shadow: 0 5px 0 rgba(0, 0, 0, .15); color: var(--ink); touch-action: none; cursor: pointer; }
.pad.jump { background: rgba(255, 138, 92, .92); color: #fff; width: 96px; height: 96px; }
.pad.act { background: rgba(79, 191, 127, .92); color: #fff; }
.pad.on { transform: scale(.92); filter: brightness(.9); }

/* Hiệu ứng */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.particle { position: absolute; font-size: 26px; transform: translate(-50%, -50%); animation: fly .85s ease-out forwards; }
@keyframes fly { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4) rotate(200deg); opacity: 0; } }

/* Mô phỏng giọng nói */
.sim-panel { position: fixed; top: 150px; right: 12px; z-index: 120; background: #2d2a3e; color: #fff; border-radius: 16px; padding: 10px; max-width: 280px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.sim-panel .btn { margin-top: 6px; }

/* ---------- Game DOM (chọn, bóng bay, kéo, truyện) ---------- */
.scene { position: absolute; inset: 0; overflow: hidden; }
.scene.forest { background: linear-gradient(#8fd3ff 0 62%, #5cb85c 62%); }
.scene.home { background: linear-gradient(#ffe9c7 0 66%, #c98b55 66%); }
.scene.beach { background: linear-gradient(#9fe7ff 0 55%, #4fc3f7 55% 64%, #f3d27a 64%); }
.scene.night { background: radial-gradient(circle at 80% 15%, #3d4e86, #1b2447 70%); }
.scene.leaf { background: radial-gradient(circle at 50% 120%, #8bd46e 0 45%, transparent 46%), linear-gradient(#bdf0ff, #e9fbd9); }
.scene.town { background: linear-gradient(#a7dcff 0 60%, #9aa3ad 60% 64%, #7ccf6a 64%); }
.basket-zone { position: absolute; left: 50%; bottom: 210px; transform: translateX(-50%); font-size: 96px; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .2)); }
.host { position: absolute; left: 4%; bottom: 210px; font-size: 80px; animation: bob 2.4s infinite; }
.big-pic { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 130px; }
.where-row { position: absolute; left: 0; right: 0; top: 150px; bottom: 30px; display: flex; justify-content: space-around; align-items: center; padding: 0 10px; gap: 6px; }
.where-obj { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto auto; place-items: center; }
.where-obj .o { grid-column: 2; grid-row: 2; font-size: clamp(64px, 12vw, 120px); line-height: 1; }
.spot { border: 3px dashed rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .35); border-radius: 18px; min-width: 64px; min-height: 64px; cursor: pointer; font-size: 30px; }
.spot.on { grid-column: 2; grid-row: 1; }
.spot.under { grid-column: 2; grid-row: 3; }
.spot.next { grid-column: 3; grid-row: 2; }
.spot.behind { grid-column: 1; grid-row: 2; }
.spot.found { background: #fff; border-style: solid; border-color: var(--sun); }
.balloon { position: absolute; bottom: -180px; width: 120px; height: 150px; border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
.balloon .bb { position: absolute; inset: 0 0 30px 0; border-radius: 50% 50% 46% 46%; display: flex; align-items: center; justify-content: center; font-size: 54px; box-shadow: inset -12px -14px 0 rgba(0, 0, 0, .12), inset 10px 10px 0 rgba(255, 255, 255, .35); }
.balloon .str { position: absolute; left: 50%; bottom: 0; width: 2px; height: 34px; background: #777; }
.balloon.popped { pointer-events: none; }
.balloon.popped .bb, .balloon.popped .str { animation: popb .3s forwards; }
@keyframes popb { to { transform: scale(1.6); opacity: 0; } }
.drag-row { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: clamp(10px, 4vw, 40px); }
.drag-row.top { top: 160px; }
.drag-row.bottom { bottom: 40px; }
.slot { width: 120px; height: 120px; border-radius: 26px; border: 4px dashed rgba(0, 0, 0, .25); background: rgba(255, 255, 255, .4); display: flex; align-items: center; justify-content: center; font-size: 80px; filter: brightness(0) opacity(.35); }
.slot.filled { filter: none; border-style: solid; border-color: var(--sun); background: #fff; }
.drag-item { width: 116px; height: 116px; border-radius: 26px; background: #fff; box-shadow: 0 6px 0 #e6d6bd; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 66px; cursor: grab; touch-action: none; position: relative; z-index: 3; }
.drag-item small { font-size: 13px; font-weight: 800; color: var(--ink); }
.drag-item.dragging { cursor: grabbing; z-index: 30; box-shadow: 0 16px 30px rgba(0, 0, 0, .25); transform: scale(1.08); }
.story-hero { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font-size: clamp(110px, 22vw, 190px); cursor: pointer; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .2)); transition: transform .2s; }
.story-hero.happy { animation: dance .6s 2; }
@keyframes dance { 25% { transform: translate(-50%, -56%) rotate(-8deg); } 75% { transform: translate(-50%, -56%) rotate(8deg); } }
.story-objs { position: absolute; left: 0; right: 0; bottom: 30px; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 0 10px; }
.story-nav { position: absolute; right: 16px; bottom: 30px; z-index: 4; }
.story-page { position: absolute; left: 16px; bottom: 34px; background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 6px 12px; font-weight: 800; }
.end-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 15; background: rgba(255, 248, 236, .96); padding: 16px; overflow: auto; }
.end-inner { max-width: 560px; width: 100%; text-align: center; }
.end-inner .big-emoji { animation: pop-in .4s; }
.end-inner .row { justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Khu ba mẹ ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: none; }
.panel { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border-radius: 18px; padding: 12px 14px; }
.stat b { display: block; font-size: 28px; }
.stat span { font-size: 14px; color: var(--muted); }
.bar { height: 12px; background: #f0e8da; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--leaf); border-radius: 99px; }
table.rt { width: 100%; border-collapse: collapse; font-size: 15px; }
table.rt th, table.rt td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
table.rt.small { font-size: 13px; }
.table-wrap { overflow-x: auto; }
label.f { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
label.f input, label.f select, label.f textarea { font: inherit; font-weight: 600; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fffdf9; min-height: 46px; color: var(--ink); }
label.f textarea { min-height: 90px; }
label.chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; margin: 10px 0; }
label.chk input { width: 26px; height: 26px; flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.round-edit { border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .d { background: var(--bg); border-radius: 12px; min-height: 70px; padding: 6px; font-size: 12px; }
.cal .d.today { outline: 3px solid var(--sky); }
.cal .d b { font-size: 14px; }
.cycle-row { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--bg); margin-bottom: 8px; }
.cycle-row.now { outline: 3px solid var(--sky); background: #e8f7ff; }
.cycle-row .wk { font-weight: 900; min-width: 92px; }
.sugg { background: #f2fff6; border: 2px solid #c5f0d5; border-radius: 18px; padding: 12px 14px; }
.teacher-report { background: #fff; color: #111; }
.teacher-report h2 { font-size: 22px; }
.comment-box { border: 1px solid #aaa; min-height: 120px; border-radius: 8px; }
.list-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hide-sm { display: none; }
  .brand span:not(.logo) { font-size: 15px; }
  .pic-btn { min-width: 92px; min-height: 96px; }
  .pic-btn .e { font-size: 44px; }
  #owl-bubble { top: 76px; }
  #owl-bubble b { font-size: 18px; }
  .pad { width: 74px; height: 74px; }
  .pad.jump { width: 86px; height: 86px; }
  .slot, .drag-item { width: 92px; height: 92px; font-size: 54px; }
  .cal .d { min-height: 56px; }
}

@media print {
  .topbar, .tabs, .no-print, #toasts { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; padding: 0; }
}
.balloon.hl .bb { animation: glow 1s infinite; outline: 5px solid var(--sun); }
.drag-item.pulse, .spot.pulse { animation: glow 1s infinite; outline: 4px solid var(--sun); }
.story-hero.pulse { animation: glowf 1s infinite; }
@keyframes glowf { 50% { filter: drop-shadow(0 0 22px #ffc93c) drop-shadow(0 0 8px #fff); } }
.wcard .wc-ex { margin-top: -4px; }
.brand > span:not(.logo) { white-space: nowrap; }
@media (max-width: 600px) { .brand b { display: none; } }
/* Điện thoại dựng đứng: game ngang nằm giữa, nút điều khiển bên dưới không che hình */
@media (orientation: portrait) and (max-width: 700px) {
  #stage { align-items: flex-start; padding-top: 150px; }
  .rotate-hint { display: block; }
}
.rotate-hint { display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 130px; background: rgba(255,255,255,.85); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; z-index: 4; white-space: nowrap; }
#owl-bubble { width: max-content; }
@media (orientation: portrait) and (max-width: 700px) { .rotate-hint { display: block; } }

/* ---- Micro trong màn chơi ---- */
.mic-btn { width: 64px; height: 64px; background: #fff; color: var(--ink); box-shadow: 0 4px 0 #d9d3e6; position: relative; }
.mic-btn.off { background: #eceaf2; }
.mic-btn.off::after { content: "✕"; position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: #e53935; color: #fff; font-size: 14px; font-weight: 900; line-height: 24px; text-align: center; border: 2px solid #fff; }
.mic-btn.on { background: #5bd17a; box-shadow: 0 4px 0 #2f9e52; }
.mic-btn.listening { background: #ff5a5f; box-shadow: 0 0 0 0 rgba(255, 90, 95, .6); animation: micring 1.1s infinite; }
@keyframes micring { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 95, .6); } 100% { box-shadow: 0 0 0 18px rgba(255, 90, 95, 0); } }
.talk-btn { min-height: 64px; font-size: 20px; font-weight: 800; background: #5bd17a; box-shadow: 0 4px 0 #2f9e52; color: #fff; border-radius: 32px; padding: 6px 20px; display: inline-flex; gap: 8px; align-items: center; }
.talk-btn[disabled] { background: #c9c3d6; box-shadow: 0 4px 0 #a9a2ba; }
.talk-btn.listening { background: #ff5a5f; box-shadow: 0 4px 0 #c43c41; animation: pulse 1s infinite; }
.talk-btn span { font-size: 16px; }

/* ---- Nhà máy ghép từ ---- */
.scene.factory { background: linear-gradient(#e3ecf7 0 62%, #b0bec5 62%); }
.fac-host { position: absolute; left: 3%; top: 24%; font-size: 64px; animation: fbob 2.4s ease-in-out infinite; }
.fac-machine { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); width: min(560px, 82%); background: #ffb74d; border: 6px solid #e08e2b; border-radius: 28px; padding: 18px 14px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 8px 0 #c77a1e; }
.fac-machine.working { animation: shake .15s linear 6; }
.fac-pipe { position: absolute; top: -26px; left: 18%; width: 26px; height: 26px; background: #90a4ae; border-radius: 6px 6px 0 0; }
.fac-slots { display: flex; gap: 12px; justify-content: center; min-height: 96px; }
.fac-tile { width: 88px; height: 96px; border-radius: 18px; border: 4px solid #fff; background: #fffde7; font-size: 58px; font-weight: 900; color: #3949ab; box-shadow: 0 5px 0 #d6cfa4; cursor: pointer; animation: slidein .5s both; font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif; }
.fac-tile.done { background: #c8f7c5; color: #1b5e20; }
.fac-tile.boop { transform: scale(1.15); }
.fac-tile.pulse { animation: glow 1s infinite; border-color: var(--sun); }
.fac-lever { background: #ef5350; box-shadow: 0 5px 0 #b71c1c; color: #fff; }
.fac-lever.pulse { animation: pulse 1s infinite; }
.fac-belt { position: absolute; left: 0; right: 0; bottom: 4%; height: 40%; display: flex; align-items: flex-end; justify-content: center;
  background: repeating-linear-gradient(90deg, #455a64 0 26px, #546e7a 26px 52px) bottom / 100% 26px no-repeat; animation: belt 1s linear infinite; padding-bottom: 30px; }
.fac-boxes { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.fac-box { width: 112px; height: 112px; font-size: 64px; border-radius: 18px; border: 5px solid #a1662f; background: #d7a86e; box-shadow: 0 6px 0 #7b4a1f; cursor: pointer; animation: slidein .5s both; }
.fac-box.gone { opacity: .25; transform: scale(.85); transition: all .3s; }
.fac-box.win { background: #fff59d; border-color: #fbc02d; }
@keyframes belt { to { background-position: 52px 100%; } }
@keyframes slidein { from { transform: translateX(260px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }
@keyframes fbob { 50% { transform: translateY(-8px); } }

/* ---- Săn kho báu ---- */
.scene.treasure { background:
  radial-gradient(ellipse at 30% 40%, #c5e1a5 0 30%, transparent 31%),
  radial-gradient(ellipse at 72% 55%, #c5e1a5 0 28%, transparent 29%),
  linear-gradient(#f6e3b4, #ecd29b); }
.tr-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tr-trail polyline { fill: none; stroke: #8d5524; stroke-width: .9; stroke-dasharray: 2 1.6; vector-effect: non-scaling-stroke; stroke-width: 5px; }
.tr-place { position: absolute; margin: -46px 0 0 -46px; width: 92px; height: 92px; border-radius: 50%; border: 4px dashed rgba(141, 85, 36, .5); background: rgba(255, 255, 255, .55); font-size: 56px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tr-place.been { border-style: solid; border-color: #43a047; background: rgba(200, 247, 197, .8); }
.tr-place.pulse { animation: glow 1s infinite; border-color: var(--sun); }
.tr-hero { position: absolute; transform: translate(-50%, -80%); font-size: 46px; transition: left .85s ease-in-out, top .85s ease-in-out; pointer-events: none; z-index: 2; filter: drop-shadow(0 4px 2px rgba(0,0,0,.25)); }
.tr-sign { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); background: #a1662f; border: 6px solid #6d3f19; border-radius: 16px; padding: 12px 26px; box-shadow: 0 8px 0 #4e2c10; z-index: 3; }
.tr-sign.pop { animation: popin .4s both; }
.tr-sign-txt { display: block; color: #fffde7; font-size: clamp(26px, 5vw, 44px); font-weight: 900; letter-spacing: 1px; font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif; white-space: nowrap; }
.tr-pieces { position: absolute; right: 12px; top: 10px; font-size: 30px; }
.tr-chest { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 110px; display: flex; align-items: center; gap: 8px; animation: chestin .5s both; z-index: 4; }
.tr-chest .in { font-size: 80px; }
.retell-title { font-weight: 800; font-size: 18px; text-align: center; margin-bottom: 8px; }
.pic-btn .num { font-weight: 900; color: #2e7d32; font-size: 22px; min-height: 22px; }
.pic-btn.done { background: #c8f7c5; }
@keyframes popin { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@media (max-width: 600px) {
  .fac-tile { width: 66px; height: 76px; font-size: 44px; }
  .fac-box { width: 88px; height: 88px; font-size: 50px; }
  .fac-host { font-size: 44px; }
  .tr-place { width: 70px; height: 70px; margin: -35px 0 0 -35px; font-size: 42px; }
}
@keyframes chestin { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
/* Mức âm lượng micro + từ bé vừa nói */
#btn-mic, .talk-btn { --lvl: 0; }
#btn-mic.listening { animation: none; box-shadow: 0 0 0 calc(4px + var(--lvl) * 22px) rgba(255, 90, 95, .45); transition: box-shadow .08s; }
.talk-btn.listening { animation: none; box-shadow: 0 0 0 calc(3px + var(--lvl) * 18px) rgba(255, 90, 95, .4); transition: box-shadow .08s; }
.said-pop { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 450; background: #fff; border-radius: 28px; padding: 16px 30px; box-shadow: 0 10px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; animation: chestin .4s both; pointer-events: none; }
.said-pop span { font-size: 90px; line-height: 1.1; }
.said-pop b { font-size: 34px; color: #2d2a3e; }

/* Kiểm tra micro */
.mc-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.mc-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 14px; background: #f6f4fb; }
.mc-row.ok { background: #e8f8ec; } .mc-row.bad { background: #ffecec; }
.mc-ic { font-size: 22px; }
.mc-meter { height: 18px; border-radius: 9px; background: #eceaf2; overflow: hidden; margin: 6px 0; }
.mc-meter div { height: 100%; width: 0; background: linear-gradient(90deg, #5bd17a, #2f9e52); transition: width .06s; }
.toast-act { margin-left: 8px; }
.toast-act { pointer-events: auto; background: #fff; color: #2d2a3e; }

/* ---- Phòng Âm Nhạc Cô Cú ---- */
.music-card { display: flex; align-items: center; gap: 14px; width: 100%; margin: 6px 0 4px; padding: 14px 18px; border: 0; border-radius: 24px; cursor: pointer; text-align: left; color: #fff;
  background: linear-gradient(120deg, #7c4dff, #ff6fae); box-shadow: 0 6px 0 #5b2fd6; font: inherit; }
.music-card .mc-ic { font-size: 44px; }
.music-card b { display: block; font-size: 22px; } .music-card small { opacity: .9; font-size: 15px; }
.music-card .mc-go { margin-left: auto; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #7c4dff; display: grid; place-items: center; font-size: 26px; flex: none; }
.music-room { display: flex; flex-direction: column; gap: 14px; }
.mr-head { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, #ede7ff, #ffe3f1); border-radius: 26px; padding: 14px 18px; }
.mr-head h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); }
.mr-owl { position: relative; font-size: 76px; line-height: 1; cursor: pointer; --beat: .6s; transform-origin: 50% 90%; }
.mr-owl.dancing { animation: owldance calc(var(--beat) * 2) ease-in-out infinite; }
.mr-owl.hop { animation: owlhop .5s; }
.mr-n { position: absolute; font-size: 26px; opacity: 0; }
.mr-owl.dancing .mr-n { animation: notefly calc(var(--beat) * 2) linear infinite; }
.mr-n.n1 { left: -10px; top: 0; } .mr-n.n2 { right: -14px; top: 10px; animation-delay: var(--beat) !important; }
@keyframes owldance { 0%, 100% { transform: rotate(-10deg) translateY(0); } 25% { transform: rotate(0) translateY(-10px); } 50% { transform: rotate(10deg) translateY(0); } 75% { transform: rotate(0) translateY(-10px); } }
@keyframes owlhop { 50% { transform: translateY(-18px) scale(1.1); } }
@keyframes notefly { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.mr-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mr-cat { border: 4px solid transparent; background: #fff; border-radius: 22px; padding: 10px 6px; min-height: 84px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 4px 0 #e6def5; color: var(--ink); }
.mr-cat span { font-size: 34px; }
.mr-cat.on { border-color: #7c4dff; background: #f3eeff; }
.mr-main { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: start; }
.mr-player { background: #2d1b69; color: #fff; border-radius: 28px; padding: 16px; position: sticky; top: 8px; box-shadow: 0 8px 0 #1c1045; }
.mr-now { display: flex; gap: 12px; align-items: center; }
.mr-now b { display: block; font-size: 19px; } .mr-now small { opacity: .75; }
.mr-thumb { font-size: 46px; width: 68px; height: 68px; border-radius: 18px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.mr-lyrics { margin: 14px 0; min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: center; }
.mr-line { font-weight: 800; font-size: clamp(16px, 2.6vw, 20px); opacity: .45; line-height: 1.3; }
.mr-line.big { font-size: clamp(24px, 4.6vw, 36px); opacity: 1; }
.mr-line.now { position: relative; color: rgba(255,255,255,.35); --p: 0; }
.mr-line.now .fill { position: absolute; inset: 0; color: #ffd84d; clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0); text-shadow: 0 0 18px rgba(255, 216, 77, .6); }
.mr-line.count { color: #ffd84d; }
.mr-seek { display: flex; align-items: center; gap: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mr-seek input { flex: 1; accent-color: #ffd84d; height: 28px; }
.mr-ctrl { display: flex; justify-content: center; gap: 18px; margin-top: 10px; }
.mr-btn { width: 72px; height: 72px; font-size: 30px; background: #fff; color: #2d1b69; box-shadow: 0 5px 0 #b9a8f0; }
.mr-play { width: 92px; height: 92px; font-size: 40px; background: #ffd84d; box-shadow: 0 6px 0 #d4a900; }
.mr-list { display: flex; flex-direction: column; gap: 10px; }
.mr-song { display: flex; align-items: center; gap: 12px; border: 4px solid transparent; background: #fff; border-radius: 20px; padding: 10px 14px; font: inherit; cursor: pointer; text-align: left; box-shadow: 0 4px 0 #e6def5; color: var(--ink); min-height: 76px; }
.mr-song.on { border-color: #7c4dff; background: #f3eeff; }
.mr-st { font-size: 38px; } .mr-sn { flex: 1; } .mr-sn b { display: block; font-size: 17px; } .mr-sn small { color: #777; }
.mr-sp { width: 46px; height: 46px; border-radius: 50%; background: #7c4dff; color: #fff; display: grid; place-items: center; font-size: 20px; flex: none; }
.bgm-btn { width: 64px; height: 64px; background: #fff; color: var(--ink); box-shadow: 0 4px 0 #d9d3e6; }
.bgm-btn.off { background: #eceaf2; }
@media (max-width: 760px) {
  .mr-main { grid-template-columns: 1fr; }
  .mr-cats { grid-template-columns: repeat(2, 1fr); }
  .mr-owl { font-size: 58px; }
  .mr-btn { width: 64px; height: 64px; } .mr-play { width: 84px; height: 84px; }
  .play-top .bgm-btn, .play-top .mic-btn { width: 52px; height: 52px; font-size: 22px; }
}
.btn.top { white-space: nowrap; }
@media (max-width: 860px) { .topbar .hide-sm { display: none; } .topbar .btn.top { padding-left: 12px; padding-right: 12px; } }
@media (max-width: 480px) { .top-actions { gap: 6px; } .topbar .btn.top { padding: 0 9px; min-width: 44px; } .brand span:not(.logo) { display: none; } }

.talk-btn.invite:not([disabled]):not(.listening) { animation: pulse 1s infinite; background: #ff8a5c; box-shadow: 0 4px 0 #d9643a; }

.inapp-bar { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: #fff3cd; border: 3px solid #ffb300; border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; font-size: 17px; }
.inapp-bar b:first-child { font-size: 19px; }
.music-card small { color: #fff; } .music-card .mc-ic { white-space: nowrap; }
@media (max-width: 480px) { .music-card .mc-ic { font-size: 32px; } .music-card b { font-size: 19px; } }
/* Khung chọn bằng bàn phím */
.kbd-focus { outline: 5px solid #2979ff !important; outline-offset: 4px; box-shadow: 0 0 0 10px rgba(41, 121, 255, .25) !important; z-index: 5; }

.kbd-press { animation: kbdpress .2s; }
@keyframes kbdpress { 50% { transform: scale(.94); } }

/* ---- Vẽ & trò chuyện ---- */
.scene.paper { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding-top: 92px;
  background: radial-gradient(circle at 20% 20%, #fff7e0 0 30%, transparent 31%), radial-gradient(circle at 85% 75%, #e6f4ff 0 25%, transparent 26%), #fdf3e3; }
.dw-board { position: relative; width: min(88vw, calc(100vh - 300px), 560px); min-width: 220px; aspect-ratio: 1; background: #fff; border-radius: 26px; box-shadow: 0 8px 0 #ead9bd, 0 0 0 4px #f3e3c6 inset; touch-action: none; user-select: none; }
.dw-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dw-line { fill: none; stroke: #5c6bc0; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-width: 7px; }
.dw-temp { stroke: #9fa8da; stroke-width: 5px; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.dw-fill { fill: transparent; transition: fill .6s; }
.dw-board.complete .dw-fill { fill: rgba(92, 107, 192, .12); }
.dw-board .dd { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 4px solid #5c6bc0; background: #fff; color: #3949ab; font-weight: 900; font-size: 22px; cursor: pointer; padding: 0; z-index: 2; }
.dw-board .dd.done { background: #5c6bc0; color: #fff; }
.dw-board .dd.start { box-shadow: 0 0 0 6px rgba(92, 107, 192, .25); }
.dw-board .dd.pulse { animation: glow 1s infinite; border-color: var(--sun); }
.dw-board .dd.boop { transform: scale(1.25); transition: transform .15s; }
.dw-board.complete .dd { opacity: .35; transform: scale(.7); transition: all .5s; }
.dw-reveal { position: absolute; right: 4%; bottom: 3%; font-size: clamp(48px, 10vw, 80px); animation: chestin .5s both; transform: none; left: auto; top: auto; }
.dw-tools { min-height: 70px; display: flex; justify-content: center; width: 100%; }
.dw-palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; background: rgba(255,255,255,.9); padding: 8px 12px; border-radius: 22px; }
.dw-palette .pc { width: 56px; height: 56px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18); cursor: pointer; }
.dw-palette .pc.on { outline: 4px solid #2d2a3e; outline-offset: 2px; }
.dw-palette .pc.pulse { animation: glow 1s infinite; }
.dw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 26px; touch-action: none; cursor: crosshair; }
.dw-gallery { background: #fff; border-radius: 20px; padding: 10px 14px; text-align: center; }
.dw-gallery > div { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.dw-gallery figure { margin: 0; } .dw-gallery img { width: 84px; height: 84px; border-radius: 14px; border: 3px solid #f3e3c6; object-fit: cover; }
.dw-gallery figcaption { font-size: 13px; font-weight: 700; }
@media (max-width: 600px) { .dw-board .dd { width: 44px; height: 44px; margin: -22px 0 0 -22px; font-size: 18px; } .dw-palette .pc { width: 46px; height: 46px; } .scene.paper { padding-top: 150px; } .dw-board { width: min(90vw, calc(100vh - 330px), 560px); } }

/* ---- Giải đua xe ---- */
.gp-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gp-btns { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: 12px; display: flex; gap: 12px; z-index: 6; }
.gp-btn { width: 92px; height: 92px; border-radius: 50%; border: 5px solid #fff; font-size: 38px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.25); color: #fff; touch-action: manipulation; }
.gp-btn small { font-size: 13px; font-weight: 900; letter-spacing: .5px; margin-top: 2px; }
.gp-btn.stop { background: #e53935; } .gp-btn.turbo { background: #ff9800; }
.gp-btn.hit { animation: kbdpress .25s; }
@media (max-width: 600px) { .gp-btn { width: 74px; height: 74px; font-size: 30px; } }

/* ---- Nối đôi bằng đường kẻ ---- */
.mt-board { position: relative; width: min(94vw, 720px); height: calc(100% - 20px); max-height: 560px; display: flex; justify-content: space-between; align-items: stretch; gap: 20%; padding: 8px 4px; }
.mt-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 3; }
.mt-svg line { stroke-width: 7px; stroke-linecap: round; }
.mt-temp { stroke: #9fa8da; stroke-dasharray: 8 7; }
.mt-col { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; flex: 1; }
.mt-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 76px; border: 4px solid #fff; background: #fff; border-radius: 22px; box-shadow: 0 5px 0 #ead9bd; cursor: pointer; padding: 6px 14px; touch-action: none; color: var(--ink); }
.mt-col.left .mt-item { justify-content: flex-start; } .mt-col.right .mt-item { justify-content: flex-end; }
.mt-pic { font-size: 50px; line-height: 1; }
.mt-dot { position: absolute; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: #5c6bc0; border: 4px solid #fff; box-shadow: 0 0 0 2px #5c6bc0; }
.mt-col.left .mt-dot { right: -12px; } .mt-col.right .mt-dot { left: -12px; }
.mt-shadow { font-size: 50px; line-height: 1; filter: brightness(0) opacity(.75); }
.mt-letter { font-size: 44px; font-weight: 900; color: #3949ab; font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif; } .mt-letter small { font-size: 30px; margin-left: 6px; color: #7986cb; }
.mt-word { font-size: 30px; font-weight: 900; color: #2d2a3e; letter-spacing: 1px; font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif; }
.mt-item.sel { border-color: #ffc93c; box-shadow: 0 0 0 6px rgba(255, 201, 60, .45), 0 5px 0 #ead9bd; }
.mt-item.ok { border-color: #8bd88f; background: #effaf0; }
.mt-item.ok .mt-shadow { filter: none; }
.mt-item.pulse { animation: glow 1s infinite; border-color: var(--sun); }
.mt-item.ask { animation: pulse 1s infinite; border-color: #ff8a5c; }
@media (max-width: 600px) { .mt-board { gap: 14%; } .mt-item { min-height: 64px; padding: 4px 8px; } .mt-pic, .mt-shadow { font-size: 38px; } .mt-word { font-size: 22px; } .mt-letter { font-size: 34px; } }
/* ---- Tô chữ cái ---- */
.tc-word { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 54px; font-size: 22px; }
.tc-word span[data-j] { width: 54px; height: 54px; border-radius: 14px; background: #fff; border: 3px dashed #c5cae9; display: grid; place-items: center; font-size: 32px; font-weight: 900; color: #c5cae9; font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif; }
.tc-word span.now { border-color: #5c6bc0; color: #5c6bc0; } .tc-word span.done { border-style: solid; border-color: #43a047; background: #effaf0; color: #2e7d32; }
.tc-word .pic { font-size: 46px; } .tc-word .pic.big { font-size: 60px; } .tc-word b { font-size: 24px; }
.tc-guide { fill: none; stroke: #c5cae9; stroke-width: 22px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 2 18; }
.tc-ink { fill: none; stroke: #ff7043; stroke-width: 20px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tc-pen { fill: #ffc93c; stroke: #fff; stroke-width: 1; }
.tc-start { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: #c8e6c9; color: #2e7d32; font-weight: 900; display: grid; place-items: center; font-size: 18px; pointer-events: none; opacity: .5; }
.tc-start.now { background: #43a047; color: #fff; opacity: 1; box-shadow: 0 0 0 6px rgba(67, 160, 71, .3); }
.tc-start.pulse { animation: glow 1s infinite; }
.tc-board.complete .tc-ink { stroke: #43a047; }
.scene.paper:has(.tc-board) { padding-top: 84px; }
@media (max-width: 600px) { .tc-guide { stroke-width: 16px; } .tc-ink { stroke-width: 15px; } .scene.paper:has(.tc-board) { padding-top: 140px; } }
.scene.paper:has(.mt-board) { padding-top: 88px; }
@media (max-width: 600px) { .scene.paper:has(.mt-board) { padding-top: 140px; } }

/* ---- Mê cung ---- */
.mz-board { position: relative; width: min(92vw, calc(100vh - 290px), 560px); max-height: calc(100vh - 290px); background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 8px 0 #ead9bd; touch-action: none; user-select: none; }
.mz-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mz-floor { fill: #f3fbe9; }
.mz-walls { fill: none; stroke: #6d4c41; stroke-width: 1.6; stroke-linecap: round; }
.mz-path { fill: none; stroke: #ff7043; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.mz-goal, .mz-hero { font-size: 7px; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.mz-hero { font-size: 7.5px; transition: x .12s, y .12s; }
.mz-hero.wob { animation: mzwob .5s; transform-box: fill-box; transform-origin: center; }
.mz-goalbg { fill: #fff3cd; stroke: #ffc93c; stroke-width: .6; }
.mz-goalbg.hint { animation: mzhint 1s infinite; } .mz-goalbg.done { fill: #c8f7c5; stroke: #43a047; }
@keyframes mzhint { 50% { fill: #ffd54f; } }
.scene.paper:has(.mz-board) { padding-top: 92px; }
@media (max-width: 600px) { .scene.paper:has(.mz-board) { padding-top: 140px; } .mz-board { width: min(94vw, calc(100vh - 300px)); padding: 6px; } }
@keyframes mzwob { 25% { transform: translateX(-1.2px); } 75% { transform: translateX(1.2px); } }

/* ---- Sân bóng ---- */
.sc-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sc-mode { position: absolute; inset: 0; z-index: 7; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 16px; padding: 16px; background: rgba(27, 60, 30, .78); }
.sc-mode[hidden] { display: none; }
.sc-mode h2 { width: 100%; text-align: center; color: #fff; margin: 0 0 4px; font-size: 26px; }
.sc-mode-btn { width: min(300px, 44vw); min-height: 150px; border: 5px solid #fff; border-radius: 26px; background: #ffca28; color: #3e2723; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px; box-shadow: 0 7px 0 rgba(0,0,0,.25); font: inherit; }
.sc-mode-btn.two { background: #4fc3f7; }
.sc-mode-btn .e { font-size: 40px; } .sc-mode-btn b { font-size: 21px; } .sc-mode-btn small { font-size: 14px; font-weight: 700; opacity: .85; }
.sc-mode-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.sc-ctl { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.sc-kick { pointer-events: auto; position: absolute; bottom: 14px; width: 96px; height: 96px; border-radius: 50%; border: 5px solid #fff; background: var(--tc, #ff9800); color: #fff; font-size: 40px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 6px 0 rgba(0,0,0,.28); cursor: pointer; touch-action: none; }
.sc-kick small { font-size: 13px; font-weight: 900; margin-top: 2px; }
.sc-kick.right { right: max(12px, env(safe-area-inset-right)); } .sc-kick.left { left: max(12px, env(safe-area-inset-left)); }
.sc-joy ~ .sc-kick { bottom: 146px; width: 80px; height: 80px; font-size: 32px; }
@media (max-height: 430px) { .sc-joy ~ .sc-kick { bottom: 14px; } .sc-joy ~ .sc-kick.left { left: calc(max(12px, env(safe-area-inset-left)) + 112px); } .sc-joy ~ .sc-kick.right { right: calc(max(12px, env(safe-area-inset-right)) + 112px); } }
.sc-kick.hit { animation: kbdpress .25s; }
.sc-joy { pointer-events: auto; position: absolute; bottom: 14px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.28); border: 4px solid rgba(255,255,255,.85); touch-action: none; }
.sc-joy.left { left: max(12px, env(safe-area-inset-left)); } .sc-joy.right { right: max(12px, env(safe-area-inset-right)); }
.sc-joy .knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: var(--tc, #fff); border: 4px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
@media (max-width: 600px) { .sc-kick { width: 76px; height: 76px; font-size: 32px; } .sc-joy { width: 100px; height: 100px; } .sc-joy .knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; } .sc-mode-btn { min-height: 120px; } .sc-mode-btn b { font-size: 17px; } }
