/* =========================================================
   Phi hành gia nhí – giao diện
   Màu theo đặc tả: nền #0B122B · thẻ #1A294A · nút #4263EB · khám phá #A78BFA
   sao #FBBF24 · hoàn thành #34D399 · chữ #F1F5F9 / #AFC3E8
   ========================================================= */
:root {
  --bg: #0B122B; --card: #1A294A; --card2: #22345C; --pri: #4263EB; --pri2: #5B7BFF;
  --vio: #A78BFA; --star: #FBBF24; --ok: #34D399; --bad: #FB7185;
  --tx: #F1F5F9; --tx2: #AFC3E8; --line: rgba(175, 195, 232, .22);
  --r: 18px; --sh: 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Nunito, "Segoe UI", system-ui, sans-serif; font-size: 19px; line-height: 1.45;
  color: var(--tx); background: var(--bg); -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* Bầu trời sao (vẽ bằng CSS, có ảnh nền thì tự phủ lên) */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("../assets/backgrounds/space-bg.webp") center / cover no-repeat,
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 42% 66%, #dbeafe 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 86% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 82%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 58% 36%, #fde68a 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 88%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 48%, #fff 50%, transparent 51%),
    radial-gradient(ellipse at 20% 0%, rgba(167, 139, 250, .28), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(66, 99, 235, .30), transparent 55%),
    var(--bg);
  background-size: cover, 220px 220px, 260px 260px, 180px 180px, 300px 300px, 240px 240px, 340px 340px, 200px 200px, 280px 280px, auto, auto, auto;
}
.view { max-width: 980px; margin: 0 auto; padding: 0 14px calc(28px + env(safe-area-inset-bottom)); outline: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.t-vi { display: inline; }
.t-en { display: block; font-size: .72em; color: var(--tx2); font-weight: 700; }
.note { color: var(--tx2); font-size: 15px; margin: 6px 0; }
.note .t-en { display: inline; margin-left: 6px; font-size: 1em; }
.center { text-align: center; }
.warn { background: rgba(251, 191, 36, .14); border: 1px solid rgba(251, 191, 36, .4); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.peek { font-size: 11px; font-weight: 900; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; min-height: 0; vertical-align: middle; }
.peeked { color: var(--tx2); font-size: .85em; }
:focus-visible { outline: 3px solid var(--star); outline-offset: 3px; border-radius: 10px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-direction: row;
  min-height: 52px; padding: 10px 20px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 900; text-decoration: none; text-align: center; transition: transform .12s; flex-wrap: wrap; row-gap: 0;
}
.btn .t-en { flex-basis: 100%; text-align: center; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, var(--pri2), var(--pri)); box-shadow: 0 6px 0 #2B44B8, var(--sh); }
.btn.primary:active { box-shadow: 0 2px 0 #2B44B8; transform: translateY(3px); }
.btn.big { font-size: 21px; min-height: 60px; padding: 12px 28px; }
.btn.huge { display: flex; width: 100%; font-size: 24px; min-height: 72px; margin: 14px 0 10px; }
.btn.ghost { background: var(--card2); border: 2px solid var(--line); }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: 15px; }
.btn.orange { background: #F97316; color: #fff; min-height: 48px; font-size: 16px; }
.btn.danger { background: #3A1E33; border: 2px solid #9F3A5A; }
.btn .t-en { font-size: .7em; }
.icon-btn, .chip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 52px;
  border-radius: 16px; background: var(--card); border: 2px solid var(--line); text-decoration: none; font-size: 22px; cursor: pointer;
}
.chip { font-size: 16px; font-weight: 900; padding: 0 14px; }
.speak { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; border: 0; background: var(--pri); font-size: 20px; cursor: pointer; }
.speak.mini { width: 40px; height: 40px; flex-basis: 40px; font-size: 17px; }
.link-btn { background: none; border: 0; color: var(--tx2); font-weight: 800; font-size: 15px; text-decoration: underline; cursor: pointer; padding: 10px 8px; min-height: 44px; }
.row-gap { display: flex; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Thanh trên cùng ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 0;
  background: linear-gradient(var(--bg) 70%, transparent); }
.tb-title { flex: 1; text-align: center; font-size: 22px; font-weight: 900; }
.tb-title .t-en { font-size: 14px; }

/* ---------- Hình ---------- */
.art { position: relative; display: inline-block; width: 100%; aspect-ratio: 1; line-height: 0; }
.art > svg, .art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.art.has-img > svg { visibility: hidden; }
.cosmo { aspect-ratio: 104 / 118; }

/* ---------- Cosmo nói ---------- */
.cosmo-row { display: flex; align-items: flex-end; gap: 10px; margin: 8px 0; }
.cosmo-sm { width: 64px; flex: 0 0 64px; }
.cosmo-md { width: 120px; margin: 0 auto; display: block; }
.cosmo-xs { width: 28px; vertical-align: middle; }
.bubble { position: relative; flex: 1; display: flex; gap: 8px; align-items: center; background: #fff; color: #1E293B;
  padding: 12px 12px 12px 16px; border-radius: 20px 20px 20px 6px; font-weight: 800; box-shadow: var(--sh); }
.bubble .t-en { color: #4B5B7A; }
.bubble-text { flex: 1; }

/* ---------- Trang chủ ---------- */
.view.v-home { padding-bottom: 0; }
.home { padding-bottom: calc(6px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-top: 10px; max-width: 560px; margin: 0 auto; }
.home-top { display: flex; justify-content: space-between; align-items: center; }
.hero { text-align: center; margin-top: 4px; }
.hero-art { position: relative; height: 150px; display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.astro-hero { width: 128px; animation: float 4s ease-in-out infinite; }
.cosmo-hero { width: 96px; animation: float 4s ease-in-out -2s infinite; }
.app-title { font-weight: 900; font-size: 36px; margin-top: 6px; background: linear-gradient(90deg, #FDE68A, #FBBF24 40%, #C4B5FD); -webkit-background-clip: text; background-clip: text; color: transparent; }
.app-title small { display: block; font-size: 17px; color: var(--tx2); -webkit-text-fill-color: var(--tx2); letter-spacing: .5px; }
.home-cosmo .cosmo-sm { display: none; }
.home-cosmo .bubble { border-radius: 20px; }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--tx2); }
.progress-line .t-vi, .progress-line .t-en { display: inline; font-size: 1em; color: var(--tx2); }
.progress-line .t-en { margin-left: 4px; }
.bar { flex: 1; height: 12px; background: var(--card); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #6EE7B7); border-radius: 99px; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; min-height: 104px; padding: 10px 6px;
  border-radius: var(--r); background: var(--card); border: 2px solid var(--line); text-decoration: none; font-weight: 900; font-size: 16px; }
.tile .ti { font-size: 34px; line-height: 1; }
.tile .t-en { font-size: 12px; }
.credit { margin-top: auto; text-align: center; padding-top: 6px; }
.credit-by { color: var(--tx2); font-size: 14px; font-weight: 800; }
.credit-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- Bản đồ ---------- */
.map-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; background: var(--card); padding: 5px; border-radius: 16px; }
.seg-b { min-height: 48px; padding: 6px 14px; border-radius: 12px; border: 0; background: transparent; font-weight: 900; font-size: 16px; text-decoration: none; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; color: var(--tx2); }
.seg-b.on { background: var(--pri); color: #fff; }
.seg-b .t-en { font-size: 11px; color: inherit; opacity: .8; }
.map-cosmo .cosmo-sm { width: 56px; flex-basis: 56px; }
.rowmap .pcard.sun { width: 100%; flex-direction: row; justify-content: center; gap: 14px; margin-bottom: 10px; }
.rowmap .pcard.sun .pc-art { width: 96px; }
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: var(--r); cursor: pointer;
  background: var(--card); border: 2px solid var(--line); font-weight: 900; font-size: 17px; text-align: center; }
.pcard .pc-art { width: 92px; }
.pcard.done { border-color: var(--ok); }
.pcard .num { position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--vio); color: #1E1B4B; font-size: 15px; display: grid; place-items: center; }
.tick { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #064E3B; font-weight: 900; display: grid; place-items: center; font-size: 17px; }
.pc-name .t-en { font-size: 13px; }
.orbit { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1; margin: 6px auto 0; }
.orbit-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit-lines circle { fill: none; stroke: rgba(175, 195, 232, .28); stroke-width: .25; stroke-dasharray: 1 1; }
.ob { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; min-width: 40px; min-height: 40px; }
.ob.sun { z-index: 1; }
.ob .ob-lbl { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--tx2); line-height: 1.2; display: none; }
.orbit.labels .ob-lbl { display: block; }
.ob .tick { width: 18px; height: 18px; font-size: 11px; right: -4px; top: -4px; }
.ob:hover .art, .ob:focus-visible .art { filter: drop-shadow(0 0 8px #fff); }

/* Chuyến bay */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 9, 25, .72); display: flex; align-items: center; justify-content: center; padding: 14px; overflow-y: auto; }
.sheet { width: 100%; max-width: 520px; max-height: calc(100dvh - 28px); overflow-y: auto; background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: var(--sh); }
.sheet > h2 { margin-bottom: 10px; font-size: 24px; }
.flight-ov { background: #050918; padding: 0; }
.flight-ov .sheet { max-width: none; max-height: none; height: 100%; border: 0; border-radius: 0; background: transparent; padding: 0; overflow: hidden; }
.flight { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.stars-fly { position: absolute; inset: -50%; background:
  radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 70% 60%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 85% 20%, #fff 50%, transparent 51%);
  background-size: 160px 160px; animation: warp 1.5s linear; }
.fl-planet { width: 34vmin; animation: approach 1.5s ease-in forwards; }
.fl-ship { position: absolute; width: 110px; left: 10%; bottom: 18%; animation: shipfly 1.5s ease-in-out forwards; }
.fl-text { font-size: 24px; font-weight: 900; text-align: center; z-index: 1; }
.fl-text .t-en { font-size: 17px; }
.fl-skip { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: var(--tx2); font-size: 15px; z-index: 1; }

/* ---------- Trạm khám phá ---------- */
.st-hero { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; text-align: center; }
.st-art { width: min(62vw, 260px); margin: 0 auto; filter: drop-shadow(0 0 28px color-mix(in srgb, var(--pc) 45%, transparent)); animation: float 5s ease-in-out infinite; }
.st-name { font-size: 34px; font-weight: 900; }
.st-name small { display: block; font-size: 20px; color: var(--pc); }
.st-name small.en-name { font-size: 18px; }
.st-nick { color: var(--tx2); margin: 4px 0 10px; font-weight: 800; }
.st-nick .t-en { display: inline; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.chip-i { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 16px; font-weight: 800; text-align: left; }
.chip-i .t-en { font-size: 12px; }
.done-tag { display: inline-block; margin-top: 10px; background: rgba(52, 211, 153, .15); color: var(--ok); border: 1px solid var(--ok); border-radius: 99px; padding: 6px 14px; font-weight: 900; }
.done-tag .t-vi, .done-tag .t-en { display: inline; }
.safety { display: flex; gap: 8px; align-items: center; margin: 14px 0 0; padding: 10px 12px; border-radius: 14px; background: rgba(251, 113, 133, .14); border: 1px solid rgba(251, 113, 133, .5); font-weight: 800; }
.safety .t-vi, .safety .t-en { display: block; } .safety > span { flex: 1; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 18px 0 8px; flex-wrap: wrap; }
.sec-head h3 { font-size: 21px; }
.sec-head .t-en { display: inline; margin-left: 6px; }
.fact { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 12px; margin-bottom: 8px; border-left: 6px solid var(--pc, var(--vio)); }
.fact p { flex: 1; margin: 0; font-weight: 800; }
.fact .fn { flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--pc, var(--vio)); color: #111827; display: grid; place-items: center; font-weight: 900; }
.fact.alt { border-left-color: var(--star); background: var(--card2); }
.more { margin-top: 10px; }
.more summary { list-style: none; cursor: pointer; min-height: 56px; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 16px; background: linear-gradient(90deg, rgba(251, 191, 36, .2), rgba(167, 139, 250, .2)); font-weight: 900; font-size: 20px; margin-bottom: 8px; }
.more summary::-webkit-details-marker { display: none; }
.more summary .t-en { display: inline; margin-left: 6px; }
.words { display: flex; flex-wrap: wrap; gap: 10px; }
.word { min-width: 104px; min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 12px; }
.word b { font-size: 21px; color: var(--star); }
.word span { font-size: 14px; color: var(--tx2); font-weight: 800; }
.word.pop { animation: pop .4s; }
.mission-box { margin-top: 20px; background: linear-gradient(160deg, rgba(66, 99, 235, .35), rgba(167, 139, 250, .25)); border: 2px solid var(--line); border-radius: 22px; padding: 14px; text-align: center; }
.mission-box .btn { margin: 8px 0; }
.st-badge { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--tx2); font-weight: 800; font-size: 15px; filter: grayscale(1); opacity: .6; }
.st-badge.got { filter: none; opacity: 1; color: var(--star); }
.st-badge .t-vi, .st-badge .t-en { display: inline; } .st-badge .t-en { margin-left: 6px; }
.bdg-sm { width: 46px; flex: 0 0 46px; }
.bdg-lg { width: 110px; }
.st-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.st-nav .btn { font-size: 15px; }

/* ---------- Câu hỏi ---------- */
.quiz { max-width: 640px; margin: 0 auto; }
.qprog { display: flex; gap: 6px; justify-content: center; margin: 6px 0 12px; }
.qprog i { width: 16px; height: 16px; border-radius: 50%; background: var(--card2); border: 2px solid var(--line); }
.qprog i.now { background: var(--star); border-color: var(--star); transform: scale(1.2); }
.qprog i.ok { background: var(--ok); border-color: var(--ok); }
.qprog i.done { background: var(--vio); border-color: var(--vio); }
.q-visual { display: flex; flex-direction: column; align-items: center; margin-bottom: 6px; }
.q-art { width: min(52vw, 220px); }
.ear { width: 150px; height: 150px; border-radius: 50%; border: 0; background: radial-gradient(circle at 40% 35%, #6D8BFF, var(--pri)); font-size: 64px; cursor: pointer; box-shadow: 0 0 0 10px rgba(66, 99, 235, .25), var(--sh); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ear span { font-size: 14px; font-weight: 900; margin-top: 6px; }
.ear span .t-vi, .ear span .t-en { display: inline; }
.spoken { font-size: 22px; font-weight: 900; color: var(--star); }
.qline { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 8px 0 12px; }
.qtext { font-size: 24px; font-weight: 900; text-align: center; }
.qtext .t-en { font-size: 16px; }
.opts { display: grid; gap: 10px; }
.txt-opts { grid-template-columns: 1fr; }
.img-opts { grid-template-columns: repeat(2, 1fr); }
.img-opts.n3 { grid-template-columns: repeat(3, 1fr); }
.opt { position: relative; min-height: 64px; border-radius: 18px; border: 3px solid var(--line); background: var(--card); cursor: pointer; padding: 10px; font-weight: 900; font-size: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: transform .1s; }
.opt:active { transform: scale(.97); }
.opt .o-art { width: 80%; max-width: 130px; }
.opt .o-text .t-en { font-size: 14px; }
.opt.right { border-color: var(--ok); background: rgba(52, 211, 153, .18); }
.opt.right::after { content: "✓"; position: absolute; right: 10px; top: 8px; color: var(--ok); font-size: 26px; }
.opt.wrong { border-color: var(--bad); opacity: .45; animation: shake .4s; }
.opt.wrong::after { content: "✕"; position: absolute; right: 10px; top: 8px; color: var(--bad); font-size: 22px; }
.opt.glow, .tile-p.glow { box-shadow: 0 0 0 4px var(--star), 0 0 24px var(--star); }
.opt[disabled] { cursor: default; }
.feedback { margin-top: 14px; text-align: center; }
.fb { display: flex; gap: 10px; align-items: center; text-align: left; border-radius: 18px; padding: 12px; margin-bottom: 12px; }
.fb.ok { background: rgba(52, 211, 153, .15); border: 2px solid var(--ok); }
.fb.no { background: rgba(251, 191, 36, .12); border: 2px solid var(--star); }
.fb p { margin: 4px 0 0; font-weight: 700; }
.fb b .t-en { font-weight: 700; }
.fb b .t-en { display: block; font-size: 14px; }

/* Kết quả */
.result { text-align: center; max-width: 600px; margin: 10px auto; }
.result h2 { font-size: 30px; margin: 8px 0; }
.result h2 .t-vi, .result h2 .t-en { display: inline; } .result h2 .t-en { margin-left: 8px; font-size: .6em; }
.big-line { font-size: 21px; font-weight: 800; }
.stars-line { font-size: 30px; letter-spacing: 4px; }
.review { text-align: left; margin-top: 12px; }
.review h3 { margin-bottom: 8px; }
.res-btns { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 16px; }
.center-box { text-align: center; max-width: 520px; margin: 30px auto; }

/* Chúc mừng */
.cele .sheet { text-align: center; position: relative; overflow: hidden; }
.celebrate h2 { margin: 8px 0 12px; font-size: 24px; }
.badge-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 14px; }
.badge-big { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 160px; animation: pop .6s; }
.badge-big b { color: var(--star); }
.confetti i { position: absolute; top: -10px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.4s linear forwards; }
.confetti i:nth-child(3n) { background: var(--star); } .confetti i:nth-child(3n+1) { background: var(--vio); } .confetti i:nth-child(3n+2) { background: var(--ok); }
.confetti i:nth-child(1){left:4%}.confetti i:nth-child(2){left:10%;animation-delay:.2s}.confetti i:nth-child(3){left:16%;animation-delay:.5s}.confetti i:nth-child(4){left:22%;animation-delay:.1s}.confetti i:nth-child(5){left:28%;animation-delay:.7s}.confetti i:nth-child(6){left:34%;animation-delay:.3s}.confetti i:nth-child(7){left:40%;animation-delay:.9s}.confetti i:nth-child(8){left:46%;animation-delay:.15s}.confetti i:nth-child(9){left:52%;animation-delay:.6s}.confetti i:nth-child(10){left:58%;animation-delay:.35s}.confetti i:nth-child(11){left:64%;animation-delay:.8s}.confetti i:nth-child(12){left:70%;animation-delay:.05s}.confetti i:nth-child(13){left:76%;animation-delay:.45s}.confetti i:nth-child(14){left:82%;animation-delay:1s}.confetti i:nth-child(15){left:88%;animation-delay:.25s}.confetti i:nth-child(16){left:94%;animation-delay:.65s}.confetti i:nth-child(17){left:50%;animation-delay:1.1s}.confetti i:nth-child(18){left:30%;animation-delay:1.2s}

/* ---------- Trò chơi ---------- */
.glist { display: grid; gap: 12px; margin-top: 10px; }
.gcard { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: var(--card); border: 2px solid var(--line); text-decoration: none; min-height: 88px; }
.gi { font-size: 40px; width: 64px; height: 64px; border-radius: 18px; background: var(--card2); display: grid; place-items: center; flex: 0 0 64px; }
.gt { flex: 1; } .gt b { font-size: 20px; display: block; } .gt small { color: var(--tx2); font-weight: 700; font-size: 15px; }
.gt b .t-en { font-size: 14px; }
.gt small .t-vi, .gt small .t-en { display: inline; } .gt small .t-en { margin-left: 6px; font-size: 1em; }
.gplays { color: var(--ok); font-weight: 900; font-size: 15px; }
.setup { text-align: center; max-width: 520px; margin: 0 auto; }
.setup-icon { font-size: 72px; }
.setup-desc { font-size: 20px; font-weight: 800; }
.setup .set-row { justify-content: center; }
.set-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; font-weight: 800; }
.set-row > span .t-vi, .set-row > span .t-en { display: inline; } .set-row > span .t-en { margin-left: 6px; }

/* G03 xếp hàng */
.track { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 8px 2px 14px; }
.slot { position: relative; flex: 1 1 0; max-width: 64px; min-width: 30px; aspect-ratio: 1; border-radius: 50%; border: 3px dashed var(--line); display: grid; place-items: center; }
.slot .art { width: 86%; position: absolute; }
.slot .sn { position: absolute; bottom: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--vio); color: #1E1B4B; font-weight: 900; font-size: 13px; display: grid; place-items: center; z-index: 1; }
.slot.now { border-color: var(--star); box-shadow: 0 0 14px rgba(251, 191, 36, .6); }
.slot.filled { border-style: solid; border-color: var(--ok); }
.sun-slot { flex: 1.4 1 0; max-width: 80px; border: 0; }
.sun-slot .art { width: 100%; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.tile-p { border-radius: 16px; border: 2px solid var(--line); background: var(--card); padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 13px; gap: 4px; min-height: 96px; }
.tile-p .art { width: 58px; }
.tile-p.gone { visibility: hidden; }
.shake { animation: shake .4s; }
.lineup { text-align: center; }

/* G04 lật thẻ */
.cards { display: grid; gap: 8px; max-width: 560px; margin: 8px auto; }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; cursor: pointer; perspective: 800px; }
.card .c-back, .card .c-face { position: absolute; inset: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; backface-visibility: hidden; transition: transform .45s; padding: 6px; }
.card .c-back { background: linear-gradient(145deg, var(--pri), var(--vio)); font-size: 30px; color: rgba(255, 255, 255, .8); border: 3px solid rgba(255, 255, 255, .25); }
.card .c-face { background: var(--card2); border: 3px solid var(--line); transform: rotateY(180deg); }
.card.up .c-back { transform: rotateY(180deg); }
.card.up .c-face { transform: rotateY(360deg); }
.card.matched .c-face { border-color: var(--ok); background: rgba(52, 211, 153, .15); }
.card .c-face .art { width: 80%; }
.card .c-face small { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.15; }
.c-name { font-size: 16px; text-align: center; line-height: 1.2; }
.c-name .t-en { font-size: 12px; }

/* ---------- Sổ tay ---------- */
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bcard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 6px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); text-decoration: none; font-size: 15px; }
.bcard .bc-art { width: 72px; }
.bcard b .t-en { font-size: 12px; }
.bcard:not(.done) .bc-art { filter: grayscale(.85) brightness(.75); }
.bcard.done { border-color: var(--ok); }
.bstat { font-size: 12px; font-weight: 800; color: var(--tx2); }
.bcard.done .bstat { color: var(--ok); }
.cert-btn { display: block; text-align: center; margin: 14px 0; padding: 16px; border-radius: 18px; background: linear-gradient(90deg, #B45309, var(--star)); color: #1F1300; font-weight: 900; font-size: 20px; text-decoration: none; }
.cert-btn.off { background: var(--card2); color: var(--tx2); }
.cert-btn .t-vi, .cert-btn .t-en { display: inline; } .cert-btn .t-en { color: inherit; margin-left: 6px; }
.sec-title { margin: 18px 0 8px; font-size: 21px; }
.sec-title .t-en { display: inline; margin-left: 6px; }
.medals { display: grid; grid-template-columns: 1fr; gap: 8px; }
.medal { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--card); filter: grayscale(1); opacity: .55; }
.medal.got { filter: none; opacity: 1; border: 1px solid rgba(251, 191, 36, .5); }
.medal small { display: block; color: var(--tx2); font-size: 13px; }
.medal b .t-en, .medal small .t-en { display: inline; margin-left: 6px; font-size: 1em; }
.medal small .t-vi { display: inline; }

/* Chứng nhận */
.cert-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cert { width: 100%; max-width: 640px; text-align: center; padding: 22px 18px; border-radius: 22px; color: #1E293B;
  background: radial-gradient(circle at 50% 0%, #FFFBEB, #FDE68A); border: 8px double #B45309; }
.cert h2 { font-size: 24px; color: #7C2D12; }
.cert-en { margin: 2px 0 0; color: #92400E; font-weight: 800; }
.cert-stars { color: #B45309; font-size: 22px; letter-spacing: 8px; }
.cert-medal { width: 96px; margin: 0 auto 4px; display: block; }
.cert-name { font-size: 32px; font-weight: 900; color: var(--pri); margin: 14px 0 6px; border-bottom: 2px dashed #B45309; display: inline-block; min-width: 60%; }
.cert-planets { display: flex; justify-content: center; gap: 4px; margin: 12px 0; }
.cert-planets .cp { width: 34px; }
.cert-foot { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: #7C2D12; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; width: 100%; max-width: 420px; }
.field .t-vi, .field .t-en { display: inline; } .field .t-en { margin-left: 6px; }
.field input { font: inherit; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--tx); min-height: 52px; }

/* Ba mẹ */
.parents .pbox { background: var(--card); border-radius: 20px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); }
.parents h3 { margin-bottom: 8px; font-size: 20px; }
.parents h3 .t-en { display: inline; margin-left: 6px; }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.plist li .t-vi, .plist li .t-en { display: inline; } .plist li .t-en { margin-left: 4px; }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.hold { position: relative; width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--vio); background: var(--card); cursor: pointer; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold b { position: relative; font-size: 56px; }
.hold .fill { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; background: var(--vio); opacity: .6; }
.hold.on .fill { height: 100%; transition: height 2s linear; }

/* Ủng hộ */
.support .sheet { background: #FFF7ED; color: #3B2A1A; }
.support h2 { color: #9A3412; }
.sup-box { background: linear-gradient(135deg, #FFE4E6, #FEF3C7); border-radius: 18px; padding: 14px; margin: 12px 0; text-align: center; }
.sup-box h3 { margin-bottom: 6px; }
.sup-box a { color: #C2410C; font-weight: 900; word-break: break-all; }
.qr { width: 200px; max-width: 70%; border-radius: 12px; background: #fff; padding: 6px; }
.bank { list-style: none; padding: 0; margin: 8px 0; text-align: left; display: inline-block; font-size: 16px; }
.small { font-size: 14px; }
.support .btn.ghost { background: #fff; border-color: #FDBA74; color: #9A3412; width: 100%; }

/* ---------- Hoạt hình ---------- */
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }
@keyframes approach { from { transform: scale(.25); opacity: .3; } to { transform: scale(1.15); opacity: 1; } }
@keyframes shipfly { 0% { transform: translate(0, 0); } 100% { transform: translate(55vw, -45vh) scale(.4); opacity: 0; } }
@keyframes warp { from { transform: scale(1); } to { transform: scale(1.6); } }
.reduce *, .reduce *::before, .reduce *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Màn hình lớn ---------- */
@media (min-width: 700px) {
  .pgrid { grid-template-columns: repeat(4, 1fr); }
  .st-hero { grid-template-columns: 300px 1fr; text-align: left; }
  .st-hero .chips { justify-content: flex-start; }
  .bgrid { grid-template-columns: repeat(5, 1fr); }
  .medals { grid-template-columns: repeat(2, 1fr); }
  .img-opts.n4 { grid-template-columns: repeat(4, 1fr); }
  .txt-opts { grid-template-columns: repeat(2, 1fr); }
  .res-btns { flex-direction: row; justify-content: center; flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(8, 1fr); }
  .track { justify-content: center; }
}
@media (max-width: 380px) {
  body { font-size: 18px; }
  .app-title { font-size: 31px; }
  .hero-art { height: 120px; } .astro-hero { width: 100px; } .cosmo-hero { width: 78px; }
  .tile { min-height: 92px; font-size: 15px; }
}
@media (max-height: 720px) and (min-width: 600px) {
  .hero-art { height: 104px; } .astro-hero { width: 88px; } .cosmo-hero { width: 66px; }
  .app-title { font-size: 30px; } .btn.huge { min-height: 64px; margin: 10px 0 8px; } .home-grid { margin: 10px 0; } .tile { min-height: 88px; }
}
/* ---------- Chế độ ngôn ngữ (đổi tức thì, không tải lại trang) ---------- */
html.lang-bi .d-en, html.lang-vi .d-en, html.lang-vi .t-en, html.lang-en .d-vi, html.lang-en .t-vi,
html.lang-vi .only-bi, html.lang-en .only-bi, html.lang-en .nm-en { display: none !important; }
html:not(.lang-en) .peek { display: none; }
html.lang-en .t-en { display: inline !important; font-size: inherit !important; color: inherit !important; font-weight: inherit !important; margin-left: 0 !important; }
html.lang-en .btn .t-en { flex-basis: auto; }
.lang-chip { flex: 0 0 auto; white-space: nowrap; }
.topbar .lang-chip { min-width: 0; min-height: 48px; padding: 0 10px; font-size: 14px; border-radius: 14px; }
@media print {
  body { background: #fff; } .sky, .topbar, .no-print, .overlay { display: none !important; }
  .cert { border-color: #B45309; }
}
