/*
  Hành Tinh Gõ Phím. Bố cục: thanh trên + đường ray bên trái, màn hình chính là quỹ đạo các hành tinh.
  Màu theo data-skin (mỗi giao diện là một thế giới riêng, không theo sáng/tối của hệ thống).
  Cỡ chữ và khoảng cách theo data-band (4–6 tuổi to và ít chữ, 15–18 tuổi gọn và dày thông tin).
*/
:root {
  --bg: #fff0f6; --bg2: #ffe3ee; --surface: #ffffff; --surface2: #fff5f9; --ink: #3a1a40; --muted: #86607f; --line: #f6d3e1;
  --primary: #df3f7c; --on-primary: #ffffff; --accent: #f7b733; --ok: #1f9d6d; --bad: #d6363f; --star: #e8a3c0; --hand: #f7cdb0; --hand-line: #e2ab8a;
  --key: #ffffff; --key-mod: #f6e6ee;
  --display: "Be Vietnam Pro", system-ui, "Segoe UI", sans-serif; --body: "Be Vietnam Pro", system-ui, "Segoe UI", sans-serif; --mono: "JetBrains Mono", Consolas, monospace;
  --edge: color-mix(in srgb, var(--line) 62%, var(--primary)); --raise: 0 0 0 1.5px var(--line), 0 3px 0 var(--edge), 0 12px 24px -18px var(--edge); --scale: 1; --radius: 20px; --key-size: clamp(26px, 3.1vw, 42px);
  color-scheme: light;
}
[data-skin="moonRabbit"] { --bg: #f0edff; --bg2: #e2dcff; --surface: #fff; --surface2: #f6f4ff; --ink: #231a58; --muted: #6a6399; --line: #dcd5fb; --primary: #6248dc; --accent: #ffb545; --star: #a99be8; --key-mod: #ebe7fb; }
[data-skin="toyFriends"] { --bg: #fff3e2; --bg2: #ffe6c7; --surface: #fff; --surface2: #fff8ee; --ink: #41250e; --muted: #8a6547; --line: #f6dcba; --primary: #d9610f; --accent: #2bb3a3; --star: #e7b67f; --key-mod: #fbebd6; }
[data-skin="galaxy"] { --bg: #0e1636; --bg2: #16204a; --surface: #1a2552; --surface2: #212e60; --ink: #eaf0ff; --muted: #a2b1da; --line: #2f3e75; --primary: #55b6ff; --on-primary: #06203b; --accent: #ffd36b; --star: #ffffff; --key: #26336a; --key-mod: #1d2858; --hand: #e9bb9c; --hand-line: #c9916f; color-scheme: dark; }
[data-skin="graphite"] { --bg: #15171c; --bg2: #1b1e25; --surface: #20242c; --surface2: #292e38; --ink: #eceef2; --muted: #a0a6b4; --line: #333945; --primary: #f2b84b; --on-primary: #20180a; --accent: #7fd6c2; --ok: #58cf9f; --bad: #ff7a7a; --star: #5d6578; --key: #2a2f3a; --key-mod: #21252e; --hand: #cfa98f; --hand-line: #a9836b; color-scheme: dark; }
[data-band="seed"] { --display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif; --scale: 1.16; --radius: 28px; }
[data-band="captain"] { --radius: 12px; --scale: .96; }
[data-band="pilot"] { --radius: 16px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: linear-gradient(170deg, var(--bg), var(--bg2)) fixed; color: var(--ink); font: 500 calc(15px * var(--scale))/1.55 var(--body); padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px)); overflow-x: hidden; }
:root:not([data-skin]) body, [data-skin="pinkKitten"] body { background: var(--bg) url("../assets/theme-pink-kitten.webp") center / cover fixed; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; min-height: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: calc(30px * var(--scale)); font-weight: 800; } h2 { font-size: calc(21px * var(--scale)); font-weight: 700; } h3 { font-size: 13px; font-family: var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
kbd { font: 700 13px var(--mono); padding: 2px 7px; margin: 0 3px; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface2); }
.muted { color: var(--muted); font-size: .92em; }
.lead { color: var(--muted); max-width: 62ch; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; color: var(--primary); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; align-items: center; }
.btn { border: 0; background: var(--primary); color: var(--on-primary); font-weight: 700; padding: 10px 20px; border-radius: 15px; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 62%, #000); transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 62%, #000); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--raise); }
.btn.danger { background: var(--bad); color: #fff; box-shadow: none; }
.btn.large { padding: 13px 28px; font-size: 1.08em; }
.btn.small { padding: 6px 14px; font-size: .9em; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--raise); font-size: 17px; }

/* Khung: thanh trên trong suốt, cột trái gồm thẻ điều hướng, bạn đồng hành và nhiệm vụ */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: none; padding: 0; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 14px; font-size: 21px; background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #7c4dff)); box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-size: 11px; font-weight: 700; color: var(--primary); }
.brand-text strong { font: 800 18px var(--display); letter-spacing: -.01em; }
.brand-text b { color: var(--primary); }
.top-stats { display: flex; gap: 8px; align-items: center; margin-left: auto; min-width: 0; }
.top-tools { display: flex; gap: 7px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 13px; border-radius: 15px; background: var(--surface); box-shadow: var(--raise); border: 0; font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill-level i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-style: normal; font-weight: 800; color: var(--on-primary); background: var(--primary); }
.pill small { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.1; }
.pill-xp { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.pill-btn { transition: transform .1s; }
.pill-btn:hover { transform: translateY(-1px); }
.avatar-pill { font-size: 19px; padding: 0 10px; }
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; max-width: 1400px; margin: 0 auto; padding: 22px max(20px, env(safe-area-inset-right, 0px)) 110px max(20px, env(safe-area-inset-left, 0px)); }
.rail { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 14px; }
.sidenav { padding: 13px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: var(--raise); }
.nav-title { margin-bottom: 9px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 66px; justify-content: center; border: 0; padding: 7px 4px; border-radius: 14px; font-size: 12.5px; color: var(--ink); background: var(--surface); box-shadow: var(--raise); transition: transform .1s; }
.nav-item span { font-size: 19px; line-height: 1.2; }
.nav-item b { font-weight: 700; }
.nav-item:hover { transform: translateY(-1px); }
.nav-item[aria-current="page"] { color: var(--on-primary); background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #7c4dff)); box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 62%, #000); }
.rail-cards { display: flex; flex-direction: column; gap: 14px; }
.buddy { display: grid; grid-template-columns: 62px 1fr; gap: 11px; align-items: center; padding: 13px; border-radius: 20px; color: #fff; background: linear-gradient(150deg, #6a4ee0, #4f46c8 60%, #3f6fd8); box-shadow: 0 4px 0 #3a2fa5; }
.buddy-art { width: 62px; height: 62px; border-radius: 16px; overflow: hidden; background: #fff; }
.buddy-art img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.buddy small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.buddy strong { display: block; font: 800 15px/1.25 var(--display); }
.buddy p { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.45; opacity: .92; }
.next-level { display: flex; flex-direction: column; gap: 5px; padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.next-level div { display: flex; justify-content: space-between; }
.rail-title { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rail-tasks { display: flex; flex-direction: column; gap: 8px; }
.rail-task { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 8px 10px; border: 0; border-radius: 14px; text-align: left; background: var(--surface); box-shadow: var(--raise); font-size: 12.5px; font-weight: 700; }
.rail-task span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-size: 17px; background: var(--surface2); }
.rail-task i { font-style: normal; color: var(--muted); }
.rail-task.done i { color: var(--ok); }
.rail-streak { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 16px; font-size: 12.5px; color: var(--ink); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent), 0 3px 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.rail-streak b { font: 800 22px var(--display); }
main { min-width: 0; padding: 16px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--surface) 80%, transparent), 0 18px 40px -28px var(--edge); }
.home { display: flex; flex-direction: column; gap: 18px; }
.home.narrow { max-width: 620px; align-items: flex-start; }
.section-title { margin-top: 8px; }

/* Biểu ngữ đầu trang: mỗi khu một sắc màu */
.banner { position: relative; display: flex; gap: 22px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 26px 30px; overflow: hidden; border-radius: 24px; color: #fff; background: var(--tone); box-shadow: 0 5px 0 var(--tone-edge), 0 18px 34px -22px var(--tone-edge); }
.banner::after { content: ""; position: absolute; right: -70px; top: -90px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, #ffffff30, transparent 68%); pointer-events: none; }
.banner > * { position: relative; z-index: 1; }
.banner-copy { display: flex; flex-direction: column; gap: 7px; flex: 1 1 340px; min-width: 0; }
.banner-eye { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.banner h1 { font-size: calc(33px * var(--scale)); font-weight: 800; }
.banner p { font-size: 14.5px; opacity: .94; max-width: 62ch; }
.banner-side { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.banner-tile { min-width: 96px; padding: 11px 16px; border-radius: 16px; background: #ffffff26; box-shadow: inset 0 0 0 1px #ffffff40; }
.banner-tile b, .banner-tile dd { display: block; margin: 0; color: #fff; font: 800 25px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.banner-tile small, .banner-tile dt, .banner-tile dd small { color: #fffffff0; font: 600 11.5px var(--body); }
.tone-violet { --tone: linear-gradient(115deg, #5a43dc, #7a55e0 55%, #3f8fdc); --tone-edge: #3f2fa8; }
.tone-mint { --tone: linear-gradient(115deg, #10876a, #15967b 55%, #2a8fae); --tone-edge: #0b6650; }
.tone-pink { --tone: linear-gradient(115deg, #d23a77, #b049c8 60%, #7a55e0); --tone-edge: #97245a; }
.tone-sun { --tone: linear-gradient(115deg, #d9620f, #dc4f58 65%, #b049c8); --tone-edge: #a04309; }
.note-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.note-chips span { padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.credit { font-size: 12.5px; color: var(--muted); text-align: center; }

/* Thẻ KidzType */
.kz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }
.kz-grid.wide { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.kz-card { --c: var(--primary); position: relative; display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center; min-width: 0; padding: 14px 15px; border: 0; border-radius: 18px; text-align: left; background: var(--surface); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 30%, var(--line)), 0 4px 0 color-mix(in srgb, var(--c) 42%, var(--line)); transition: transform .12s; }
.kz-card:hover { transform: translateY(-2px); }
.kz-card:active { transform: translateY(2px); }
.kz-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; font-size: 25px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent); }
.kz-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kz-copy em { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.kz-copy strong { font: 800 15px/1.25 var(--display); }
.kz-copy small { color: var(--muted); line-height: 1.35; font-size: 12.5px; }
.kz-go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-size: 13px; color: #fff; background: var(--c); }
.kz-num { position: absolute; right: 13px; top: 4px; font: 800 25px var(--display); color: color-mix(in srgb, var(--c) 16%, transparent); pointer-events: none; }
.kz-card.done .kz-go { background: var(--ok); }
.kz-stage { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--surface); box-shadow: var(--raise); }
.kz-head { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; padding: 13px 16px; color: #fff; background: var(--tone); }
.kz-head .kz-icon { width: 42px; height: 42px; background: #ffffff2e; box-shadow: none; }
.kz-title { flex: 1 1 200px; min-width: 0; }
.kz-title small { font-size: 11.5px; font-weight: 700; opacity: .9; }
.kz-title h1 { font-size: 20px; }
.kz-tip { padding: 8px 16px; font-size: 13px; text-align: center; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.kz-frame { display: block; width: 100%; height: min(70vh, 640px); min-height: 380px; border: 0; background: #0d1030; }
.kz-frame:fullscreen { height: 100%; }
/* Phòng của Miu và bạn nhỏ */
.room { position: relative; height: clamp(280px, 40vw, 400px); overflow: hidden; border-radius: 24px; box-shadow: var(--raise); }
.room-wall { position: absolute; inset: 0 0 34%; background: var(--wall); }
.room-floor { position: absolute; inset: 66% 0 0; background: linear-gradient(#e6c6a4, #d2a97f); box-shadow: inset 0 3px 0 #ffffff70; }
.room-rug { position: absolute; left: 50%; bottom: 7%; width: 42%; height: 17%; border-radius: 50%; translate: -50% 0; background: var(--rug); box-shadow: inset 0 0 0 6px #ffffff50; }
.room-miu { position: absolute; left: 50%; bottom: 10%; height: 66%; translate: -50% 0; filter: drop-shadow(0 8px 10px #0003); }
.room-item { position: absolute; line-height: 1; font-size: clamp(38px, 7vw, 74px); filter: drop-shadow(0 5px 6px #0003); }
.at-frame { left: 12%; top: 12%; }
.at-bed { left: 5%; bottom: 13%; font-size: clamp(56px, 10vw, 104px); }
.at-lamp { right: 26%; top: 8%; }
.at-plant { right: 5%; bottom: 20%; }
.at-toy { right: 22%; bottom: 7%; font-size: clamp(30px, 5vw, 54px); }
.at-pet { left: 36%; bottom: 8%; font-size: clamp(30px, 5vw, 54px); animation: bob 1.8s ease-in-out infinite; }
.mascot-pet { position: absolute; left: -10px; bottom: 2px; font-size: 34px; line-height: 1; filter: drop-shadow(0 3px 4px #0003); animation: bob 1.8s ease-in-out infinite; pointer-events: none; }
.mission-goal { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--primary); }
.mission-head { flex-wrap: wrap; }
.rail-streak .mission-goal { display: block; font-size: 11.5px; }
.modal-shop { width: min(620px, 100%); }
.shop-item.on { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
/* Truyện và thử thách gia đình */
.story { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.story-friend { display: grid; place-items: center; width: 104px; height: 104px; font-size: 62px; line-height: 1; border-radius: 30px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); box-shadow: var(--raise); }
.story-text { font: 700 1.2em/1.5 var(--display); max-width: 46ch; }
.story-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 16px; border: 0; border-radius: 16px; text-align: left; background: var(--surface); box-shadow: var(--raise); }
.story-bar span { font-size: 28px; line-height: 1; }
.story-bar small { color: var(--primary); font-weight: 700; }
.story-page { padding: 11px 14px; border-radius: 14px; background: var(--surface2); }
.modal-story { width: min(560px, 100%); }
.board { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.board li { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface2); }
.board li.me { box-shadow: inset 0 0 0 2px var(--primary); }
.board strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board small { grid-column: 3; color: var(--muted); }
.board em { grid-column: 4; grid-row: 1 / span 2; font: 800 16px var(--display); color: var(--primary); }
/* Báo cáo tuần */
.report-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 0; }
.report-rows div { padding: 9px 13px; border-radius: 13px; background: var(--surface2); }
.report-rows dd { font-size: 20px; }
.report-rows dd small { font-size: 12px; }
.report-notes { display: flex; flex-direction: column; gap: 6px; }
.kz-blocked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 340px; padding: 24px; text-align: center; }
.kz-blocked strong { font: 800 18px var(--display); }
.kz-blocked p { color: var(--muted); }
.kz-blocked .btn { text-decoration: none; }
.kz-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 11px 16px; font-size: 13px; color: var(--muted); }
body.in-frame .mascot { display: none; }
/* Trang chủ */
dt { font-size: 12px; color: var(--muted); }
dd { margin: 0; font: 800 26px var(--display); font-variant-numeric: tabular-nums; }
dd small { font: 500 12px var(--body); color: var(--muted); }
.orbit { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 8px; padding: 12px 0 8px; }
.orbit-line { position: absolute; left: 6%; right: 6%; top: 66px; border-top: 3px dashed color-mix(in srgb, var(--primary) 34%, transparent); }
.planet { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 6px 4px; text-align: center; }
.planet:nth-child(even) { transform: translateY(12px); }
.planet-orb { position: relative; display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff9, transparent 42%), radial-gradient(circle at 62% 70%, color-mix(in srgb, var(--c) 72%, #2a1a55), var(--c) 74%); box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 40%, transparent); margin-bottom: 8px; transition: transform .25s; }
.planet-orb b { font-size: 38px; position: relative; z-index: 1; }
.planet-orb.small { width: 76px; height: 76px; flex: none; margin: 0 8px; }
.planet-orb.small b { font-size: 28px; }
.planet-ring { position: absolute; inset: 34% -17%; border: 5px solid var(--r); border-radius: 50%; transform: rotate(-20deg); opacity: .9; }
.planet:hover .planet-orb { transform: scale(1.06) rotate(-4deg); }
.planet strong { font-family: var(--display); font-size: 1.08em; line-height: 1.2; }
.planet small { color: var(--muted); }
.planet em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--on-primary); background: var(--primary); padding: 1px 10px; border-radius: 99px; margin-top: 3px; }
.placement-note { display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.placement-note > div { flex: 1 1 240px; min-width: 0; }

/* Bản đồ hành tinh */
.course { display: flex; flex-direction: column; gap: 22px; }
.course-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); }
.course-head > div:nth-child(2) { flex: 1 1 280px; min-width: 0; }
.course-meter { width: 130px; font-family: var(--display); text-align: right; }
.course-meter strong { font-size: 22px; }
.meter { height: 9px; border-radius: 9px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--primary); }
.chapter h2 { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 9px; }
.node { display: flex; gap: 11px; align-items: center; padding: 10px 13px; text-align: left; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--raise); min-width: 0; }
.node:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--primary); }
.node:disabled { opacity: .55; }
.node-dot { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface2); font-size: 13px; color: var(--primary); }
.node.passed .node-dot { background: var(--ok); color: #fff; }
.node.test { box-shadow: inset 0 0 0 1.5px var(--accent); }
.node-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.node-copy small { color: var(--muted); line-height: 1.3; font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stars { color: var(--line); white-space: nowrap; font-size: 14px; }
.stars b { font-weight: 400; }
.stars .on { color: var(--accent); }

/* Màn hình gõ */
.practice, .seed { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--raise); }
.practice-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.practice-title { flex: 1 1 240px; min-width: 0; }
.practice-title h1 { font-size: calc(22px * var(--scale)); }
.practice-title p { color: var(--muted); font-size: .9em; line-height: 1.35; }
.practice-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.segs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--raise); }
.segs.wrap { flex-wrap: wrap; border-radius: 18px; }
.seg { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.hud { display: flex; gap: 8px; flex-wrap: wrap; }
.hud-item { flex: 1 1 80px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 13px; border-radius: 12px; background: var(--surface); box-shadow: var(--raise); }
.hud-item small { color: var(--muted); font-size: 12px; }
.hud-item strong { font: 800 20px var(--display); font-variant-numeric: tabular-nums; }
.flight { position: relative; height: 26px; margin: 2px 32px 0 12px; }
.flight::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; border-top: 3px dotted var(--line); }
.flight-fill { position: absolute; left: 0; top: 10px; height: 5px; width: 0; border-radius: 5px; background: var(--primary); transition: width .2s; }
.flight-ship, .flight-ghost { position: absolute; top: 0; left: 0; transform: translateX(-50%) rotate(45deg); font-size: 19px; font-weight: 400; transition: left .2s; }
.flight-ghost { opacity: .6; transform: translateX(-50%); }
.flight-goal { position: absolute; right: -28px; top: -1px; font-size: 20px; }
.prompt-card { position: relative; padding: 18px 22px; min-height: 104px; max-height: 190px; overflow: auto; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); display: flex; align-items: center; }
.prompt { font: 700 clamp(22px, 2.8vw, 33px)/1.6 var(--mono); width: 100%; overflow-wrap: anywhere; }
.ch { color: var(--muted); opacity: .75; border-radius: 5px; }
.ch.done { color: var(--ok); opacity: 1; }
.ch.current { color: var(--on-primary); background: var(--primary); opacity: 1; animation: blink 1.1s infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 26%, transparent); } }
.shake { animation: shake .18s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.tw { display: inline-flex; flex-direction: column; vertical-align: top; margin-right: 2px; color: var(--muted); }
.tw.done { color: var(--ok); }
.tw.current { color: var(--ink); }
.tw-live { position: relative; color: var(--primary); }
.tw-live em { display: block; font-style: normal; font-size: .5em; line-height: 1.2; color: var(--muted); }
.tw-keys { display: flex; gap: 2px; font-size: 14px; line-height: 1.5; font-weight: 500; margin-top: 3px; }
.tw-keys i { font-style: normal; min-width: 17px; text-align: center; border-radius: 5px; background: var(--surface2); color: var(--muted); }
.tw-keys .ok { color: var(--ok); }
.tw-keys .now { background: var(--primary); color: var(--on-primary); }
.warn { color: var(--bad); font-weight: 600; font-size: .92em; }
.hint:empty { display: none; }
.pause-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface); border-radius: var(--radius); padding: 8px; text-align: center; }

/* Bàn phím */
.keys-stage { display: flex; justify-content: center; }
.keys-stage[data-guide="keys"] .hands-wrap { display: none; }
.keys-stage[data-guide="blind"] .kb-wrap { visibility: hidden; height: 0; overflow: hidden; }
.kb-wrap { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.kb { display: flex; flex-direction: column; gap: 4px; padding: 9px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: var(--raise); max-width: 100%; }
.kb-row { display: flex; gap: 4px; justify-content: center; }
.key { --w: 1; flex: var(--w) 1 0; width: calc(var(--key-size) * var(--w)); max-width: calc(var(--key-size) * var(--w)); height: var(--key-size); min-width: 0; padding: 0; border: 0; border-radius: 9px; font: 700 calc(var(--key-size) * .33)/1 var(--body); background: color-mix(in srgb, var(--finger, var(--key)) 17%, var(--key)); color: var(--ink); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--finger, var(--line)) 58%, var(--key)), inset 0 0 0 1px color-mix(in srgb, var(--finger, var(--line)) 28%, var(--line)); touch-action: manipulation; }
.key.mod { background: var(--key-mod); color: var(--muted); font-size: calc(var(--key-size) * .25); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.key.bump { background-image: linear-gradient(var(--ink), var(--ink)); background-size: 34% 2.5px; background-repeat: no-repeat; background-position: 50% 80%; }
.key.target { background: var(--finger); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--finger) 34%, transparent); transform: translateY(1px); }
.key.target-shift { background: var(--ink); color: var(--bg); }
.key.hit { animation: hit .22s; }
.key.miss { animation: missKey .3s; }
@keyframes hit { 40% { filter: brightness(1.25); transform: translateY(2px); } }
@keyframes missKey { 40% { box-shadow: 0 0 0 4px var(--bad); } }
.key.heat { background: color-mix(in srgb, #e5323f calc(var(--heat) * 100%), var(--key)); box-shadow: inset 0 0 0 1px var(--line); }
.kb.big { --key-size: clamp(27px, 4.2vw, 56px); }
.hands-wrap { width: min(calc(var(--key-size) * 13.5), 100%); margin-top: -8px; height: calc(var(--key-size) * 2.8); overflow: hidden; pointer-events: none; }
.hands { width: 100%; display: block; }
.hands .skin { fill: var(--hand); stroke: var(--hand-line); stroke-width: 1.5; }
.finger { transition: transform .12s; }
.finger .tip { opacity: .55; }
.finger.on .tip { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
.finger.on .skin { fill: color-mix(in srgb, var(--hand) 84%, #fff); stroke: var(--ink); stroke-width: 2; }
.kb-caption { margin-bottom: 4px; min-height: 1.5em; font-weight: 700; color: var(--ink); text-align: center; }
.kb-caption::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--finger, transparent); margin-right: 7px; }
.kb-caption:empty::before { display: none; }
.kb-wrap.demo { --key-size: clamp(20px, 3.2vw, 32px); }
.kb-wrap.no-hands .hands-wrap, .kb-wrap.no-hands .kb-caption { display: none; }

/* Mầm Sao 4–6 tuổi */
.seed-card { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); min-height: 150px; }
.seed-pic { font-size: 74px; line-height: 1; }
.seed-letter { font: 800 96px/1 var(--display); color: var(--primary); }
.seed-card small { font-size: 22px; font-weight: 700; color: var(--muted); }
.free-pad { position: relative; height: 210px; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); display: grid; place-items: center; color: var(--muted); font-size: 22px; font-weight: 700; }
.free-bit { position: absolute; font: 800 40px var(--display); color: var(--primary); animation: pop 2.6s forwards; transform: rotate(var(--tilt)); }
@keyframes pop { 0% { scale: .2; } 12% { scale: 1.2; } 20% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -30px; } }

/* Luyện tập */
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 11px; }
.quick { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; text-align: left; padding: 13px 16px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); min-width: 0; }
.quick span { grid-row: span 2; font-size: 28px; align-self: center; }
.quick strong { font-family: var(--display); font-size: 1.1em; }
.quick small { color: var(--muted); }
.quick:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--primary); }
.quick:disabled { opacity: .55; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.lib-card { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 11px 13px; border: 0; border-radius: 15px; background: var(--surface); box-shadow: var(--raise); min-width: 0; }
.lib-card small { color: var(--muted); }
.lib-card code { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.week { display: flex; gap: 7px; flex-wrap: wrap; }
.day { width: 58px; padding: 8px 0; text-align: center; border-radius: 14px; background: var(--surface); box-shadow: var(--raise); }
.day small { display: block; color: var(--muted); }
.day b { font-size: 21px; color: var(--line); }
.day.on b { color: var(--accent); }
.day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.streak { font-weight: 700; }
.daily { align-items: flex-start; }
.panel { padding: 15px 17px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.panel h2 { font-size: 1.15em; }

/* Biểu đồ */
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 500 11px var(--body); }
.chart .tick.end { fill: var(--ink); font-weight: 700; }
.chart .bar { fill: var(--primary); }
.chart .bar-g:hover .bar { filter: brightness(1.1); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }

/* Game */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 11px; }
.game-card { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 148px; padding: 13px 15px; border: 0; border-radius: var(--radius); text-align: left; color: #fff; overflow: hidden; }
.game-card-art { font-size: 40px; line-height: 1.2; }
.game-card strong { font: 700 1.14em var(--display); }
.game-card small { opacity: .9; line-height: 1.3; }
.game-card em { font-style: normal; font-size: 12px; font-weight: 700; margin-top: auto; }
.game-card:hover { filter: brightness(1.08); }
.t-sky { background: linear-gradient(#4aa6e8, #a4e0f7); }
.t-farm { background: linear-gradient(#5aa84f, #99683c); }
.t-garden { background: linear-gradient(#3f9d6c, #8fce6f); }
.t-paper { background: linear-gradient(#5867c9, #8e9be8); }
.t-ocean { background: linear-gradient(#116ba3, #0a3560); }
.t-cafe { background: linear-gradient(#b86a3a, #6b3a1d); }
.t-castle { background: linear-gradient(#5a5a8a, #2c2c4d); }
.t-space { background: linear-gradient(#1e1b4b, #0b0a24); }
.t-runner { background: linear-gradient(#e36f4d, #7a3d9e); }
.t-haunted { background: linear-gradient(#433269, #17102e); }
.t-neon { background: linear-gradient(#c026a0, #1a0b45); }
.t-zombie { background: linear-gradient(#4a6b3a, #1e2c17); }
.t-deep { background: linear-gradient(#0f2748, #050b1a); }
.t-battle { background: linear-gradient(#94453b, #311a1a); }
.game { display: flex; flex-direction: column; gap: 9px; }
.game-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.game-head h1 { font-size: calc(21px * var(--scale)); flex: 1 1 200px; min-width: 0; }
.game-hud { display: flex; gap: 15px; }
.game-hud span { display: flex; flex-direction: column; align-items: center; }
.game-hud small { font-size: 11px; color: var(--muted); }
.game-hud strong { font: 800 18px var(--display); font-variant-numeric: tabular-nums; min-width: 28px; text-align: center; color: var(--ink); }
.game-field { position: relative; height: min(62vh, 520px); min-height: 320px; border-radius: var(--radius); overflow: hidden; }
.game-field.hit { animation: fieldHit .3s; }
.game-field.miss { animation: shake .16s; }
@keyframes fieldHit { 40% { box-shadow: inset 0 0 0 8px var(--bad); } }
.foe { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 1px; transform: translateX(-50%); }
.foe-word { font: 700 17px var(--mono); padding: 1px 9px; border-radius: 9px; background: #fff; color: #2a2140; box-shadow: 0 2px 5px #0005; white-space: nowrap; }
.foe-word b { color: #1f9d6d; }
.foe.locked .foe-word { box-shadow: 0 0 0 3px #ffd36b; }
.foe-art { font-style: normal; font-size: 33px; line-height: 1.15; }
.foe.boom { transition: all .28s; scale: 1.6; opacity: 0; }
.game-base { position: absolute; font-size: 42px; line-height: 1; opacity: .92; }
.game-base.d-left { left: 8px; top: 50%; translate: 0 -50%; }
.game-base.d-down { left: 50%; bottom: 8px; translate: -50% 0; }
.game-base.d-pop { left: 50%; bottom: 8px; translate: -50% 0; }
.game-over-lay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 14px; background: #0005; }
.game-over-lay[hidden] { display: none; }
.game-panel { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; max-width: 440px; width: 100%; padding: 18px; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.game-panel-icon { font-size: 44px; line-height: 1.1; }
.challenge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 7px; width: 100%; }
.challenge { display: flex; flex-direction: column; padding: 9px 7px; border: 0; border-radius: 13px; background: var(--surface2); box-shadow: var(--raise); }
.challenge:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.challenge small { color: var(--muted); font-size: 12px; }
.game-lock { text-align: center; font: 700 16px var(--mono); color: var(--muted); }

/* Thành tích, phụ huynh */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 11px 5px; text-align: center; border-radius: 15px; background: var(--surface); box-shadow: var(--raise); filter: grayscale(1); opacity: .5; }
.badge.on { filter: none; opacity: 1; }
.badge span { font-size: 28px; line-height: 1.2; }
.parent { display: flex; flex-direction: column; gap: 14px; }
.parent-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.parent-head p { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 9px; margin: 0; }
.kpis div { padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--raise); }
.insight { padding: 10px 15px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-weight: 600; }
.parent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.mission { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise); }
.mission-head { display: flex; align-items: baseline; gap: 10px; }
.mission-head h2 { font-size: 1.2em; }
.mission-count { font: 700 15px var(--mono); color: var(--muted); }
.mission-shield { margin-left: auto; font-weight: 700; }
.mission-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; }
.mission-step, .chest { display: grid; grid-template-columns: auto 1fr; gap: 0 11px; align-items: center; text-align: left; padding: 11px 14px; border: 0; border-radius: 16px; color: var(--ink); background: var(--surface2); box-shadow: var(--raise); min-width: 0; }
.mission-step span, .chest span { grid-row: span 2; font-size: 25px; }
.mission-step strong, .chest strong { font-family: var(--display); }
.mission-step small, .chest small { color: var(--muted); }
.mission-step:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.mission-step.done { box-shadow: inset 0 0 0 2px var(--ok); }
.mission-step.done span { color: var(--ok); font-weight: 800; }
.chest:disabled { opacity: .75; }
.chest.ready { background: var(--accent); color: #2c1c00; box-shadow: none; animation: chest-pulse 1.6s ease-in-out infinite; }
.chest.ready small { color: inherit; }
@keyframes chest-pulse { 50% { transform: scale(1.015); } }
@media (prefers-reduced-motion: reduce) { .chest.ready { animation: none; } }
.chest-sticker { font-size: 76px; line-height: 1.1; }
.chest-fact { font-size: 1.1em; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 7px; }
.album-item { height: 50px; border: 0; border-radius: 12px; font-size: 26px; color: var(--ink); background: var(--surface2); box-shadow: var(--raise); }
.album-item:disabled { font-size: 17px; color: var(--muted); }
.daily { gap: 14px; }
.studio-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.studio-count { font: 700 15px var(--mono); color: var(--muted); }
.studio-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.studio-key { height: 40px; border: 0; border-radius: 10px; font: 700 15px var(--mono); color: var(--ink); background: var(--surface2); box-shadow: var(--raise); }
.studio-key.done { background: var(--ok); color: #fff; box-shadow: none; }
.studio-key.on { outline: 3px solid var(--primary); outline-offset: 1px; }
.studio-now { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface2); }
.studio-letter { font: 800 44px/1 var(--mono); color: var(--primary); min-width: 44px; text-align: center; }
.studio-say { display: flex; flex-direction: column; flex: 1 1 180px; min-width: 0; }
.studio-say small { color: var(--muted); }
.studio-say b { font-size: 1.25em; }
.studio-file { cursor: pointer; }
.studio-file input { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; }
.limit { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.limit select { width: auto; }
.rest { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px; padding: 42px 18px; border-radius: var(--radius); background: var(--surface); }
.rest-art { font-size: 54px; }
.rest small { color: var(--muted); }

/* Hộp thoại */
.modal-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 14px; background: #1a10308c; overflow: auto; }
.modal { position: relative; width: min(520px, 100%); max-height: calc(100vh - 28px); overflow: auto; padding: 22px; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px #0006; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; font-size: 14px; }
.modal-guide { width: min(720px, 100%); }
.modal-cert { width: min(640px, 100%); }
.avatars { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface2); font-size: 20px; }
.avatar[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--primary); }
label { font-weight: 600; font-size: .93em; }
.check { display: flex; gap: 9px; align-items: center; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
input[type="range"] { padding: 0; accent-color: var(--primary); }
.result { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; overflow: hidden; }
.result-icon { font-size: 44px; line-height: 1.1; }
.result-stats { display: flex; gap: 24px; margin: 0; }
.result-reward { font-weight: 700; color: var(--primary); }
.result-note { padding: 6px 14px; border-radius: 12px; font-weight: 700; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.result .stars { font-size: 26px; }
.confetti-host { position: absolute; inset: 0; pointer-events: none; }
.confetti { position: absolute; top: -10px; width: 8px; height: 11px; border-radius: 2px; animation: fall var(--d) ease-in forwards; }
@keyframes fall { to { transform: translate(var(--x), 400px) rotate(420deg); opacity: 0; } }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; }
.shop-item { display: flex; flex-direction: column; align-items: center; padding: 11px 6px; border: 0; border-radius: 14px; background: var(--surface2); box-shadow: var(--raise); }
.shop-item span { font-size: 26px; }
.shop-item small { color: var(--muted); }
.shop-item.on { box-shadow: inset 0 0 0 2px var(--primary); }
.shop-item:disabled { opacity: .5; }
.who { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; }
.who-item { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border: 0; border-radius: 14px; background: var(--surface2); }
.who-item span { font-size: 30px; }
.who-item small { color: var(--muted); }
.guide { display: flex; flex-direction: column; gap: 13px; }
.guide-steps { display: flex; gap: 5px; padding-right: 38px; }
.guide-steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.guide-steps i.on { background: var(--primary); }
.guide-row { display: flex; gap: 14px; align-items: center; }
.guide-mascot { width: 118px; flex: none; }
.guide-mascot .mascot-art { width: 100%; display: block; }
.guide-line { font: 700 1.14em/1.35 var(--display); }
.tick-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.tick-list li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }
.demo-rewards { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-rewards span { padding: 7px 13px; border-radius: 99px; background: var(--surface2); font-weight: 700; }
.certificate { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding: 34px 20px; border-radius: 16px; background: var(--surface2); box-shadow: inset 0 0 0 3px var(--c), inset 0 0 0 9px var(--surface2), inset 0 0 0 10px var(--c); }
.certificate h2 { font-size: 36px; color: var(--primary); }
.certificate h3 { font: 700 21px var(--display); text-transform: none; letter-spacing: 0; color: var(--ink); }
.welcome { min-height: 100vh; display: grid; place-items: end center; }
.welcome-art { width: 240px; opacity: .85; }
.welcome-art .mascot-art { width: 100%; display: block; }

/* Mascot và thông báo */
.mascot { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 8; width: 118px; touch-action: none; cursor: grab; user-select: none; }
[data-band="seed"] .mascot { width: 140px; }
.mascot-char { width: 100%; }
.mascot-art { width: 100%; display: block; pointer-events: none; }
.rabbit { animation: bob 2.4s ease-in-out infinite; }
.rabbit.m-clap, .rabbit.m-dance, .rabbit.m-heart { animation-duration: .7s; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.mascot-bubble { position: absolute; right: 12px; bottom: calc(100% - 8px); width: max-content; max-width: 210px; padding: 6px 12px; border-radius: 15px 15px 3px 15px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px #0003; opacity: 0; transition: opacity .2s; pointer-events: none; }
.mascot.talking .mascot-bubble { opacity: 1; }
[data-kind="study"] ~ * { }
#toasts { position: fixed; top: 66px; right: 14px; z-index: 30; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.toast { padding: 8px 15px; border-radius: 13px; background: var(--ink); color: var(--bg); font-weight: 600; max-width: 300px; }

/* Máy tính xách tay thấp: giữ bàn phím trong màn hình */
@media (max-height: 820px) and (min-width: 821px) {
  :root { --key-size: clamp(24px, 2.6vw, 34px); }
  .layout { padding-top: 10px; padding-bottom: 10px; }
  .practice, .seed { gap: 7px; }
  .prompt-card { min-height: 76px; padding: 9px 18px; }
  .hands-wrap { height: calc(var(--key-size) * 1.9); margin-top: -4px; }
  .hud-item { padding: 2px 13px; }
  .seed-card { min-height: 112px; padding: 6px; }
  .seed-letter { font-size: 72px; }
  .seed-pic { font-size: 54px; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 150px; }
  .sidenav { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; border-radius: 0; box-shadow: 0 -1px 0 var(--line); padding: 4px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
  .nav-item { gap: 0; padding: 4px 6px; font-size: 11px; flex: 1; min-width: 0; min-height: 0; background: none; box-shadow: none; }
  .nav-item span { font-size: 19px; }
  .nav-item b { white-space: nowrap; font-size: 10.5px; }
  .mascot { width: 78px; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  [data-band="seed"] .mascot { width: 84px; }
  .brand-text { display: none; }
  .topbar { gap: 6px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .pill-level > span, .pill-btn > span { display: none; }
  .pill, .avatar-pill { padding: 0 8px; gap: 5px; }
  .top-stats { gap: 5px; }
  .top-tools { gap: 5px; }
  .brand-mark, .icon-btn { width: 40px; height: 40px; }
  main { padding: 0; border-radius: 0; background: none; backdrop-filter: none; box-shadow: none; }
  .rail { position: static; display: contents; }
  .rail-cards, .nav-title, .pill small, .pill-xp { display: none; }
  .nav-grid { display: flex; width: 100%; gap: 0; }
  .banner { padding: 20px; border-radius: 20px; }
  .banner h1 { font-size: 25px; }
  .kz-frame { height: 62vh; }
  :root { --key-size: min(calc((100vw - 60px) / 15.2), 42px); }
  .kb.big { --key-size: min(calc((100vw - 60px) / 15.2), 42px); }
  .kb { padding: 6px; gap: 3px; }
  .kb-row { gap: 2px; }
  .key { border-radius: 5px; }
  .hud-item { flex-basis: 40%; }
  .seed-letter { font-size: 72px; }
  .seed-pic { font-size: 52px; }
  .planet:nth-child(even) { transform: none; }
  .orbit-line { display: none; }
  .guide-row { flex-direction: column; text-align: center; }
  .guide-mascot { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  body * { visibility: hidden; }
  .certificate, .certificate *, .report, .report * { visibility: visible; }
  .report { position: fixed; inset: 10mm; box-shadow: none; }
  .no-print { display: none; }
  .certificate { position: fixed; inset: 20mm; }
}
