/* Bảng màu pastel sáng (mặc định) và bản tối dịu, đổi bằng nút 🌙/☀️ */
/* Giao diện Tây Du Ký cổ điển: giấy dó, son đỏ, vàng đồng, ngọc bích; chế độ tối là mực đen và vàng */
:root {
  color-scheme: light;
  --bg: #faf7f0; --card: #ffffff; --fg: #3a2a1d; --muted: #8b7560; --line: #e7dfcf;
  --red: #b3302a; --gold: #c8962e; --ok: #4a8b66; --bad: #c4504b; --sky: #e4ecdd;
  --mint: #dcebd8; --lav: #f0e3cd; --peach: #f7e2c4; --lemon: #f8edc2;
  --field1: #dfe9d6; --field2: #f4f0de; --review-bg: #f5dcd3; --review-fg: #8c2822;
  --r-card: 12px; --r-btn: 10px; --on-red: #fff;
  --serif: "Noto Serif", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --hanzi: "Noto Serif SC", "Songti SC", "SimSun", "Noto Serif", serif;
  --kai: "Ma Shan Zheng", "KaiTi", "STKaiti", "Noto Serif SC", serif;
  --paper: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1511; --card: #271f19; --fg: #f1e7d2; --muted: #b9a98f; --line: #4b3b2c;
  --red: #e0584d; --gold: #e3b653; --ok: #7bb892; --bad: #e0716c; --sky: #2d3832;
  --mint: #2c3c32; --lav: #3a2f25; --peach: #433429; --lemon: #463d27;
  --field1: #2d3a33; --field2: #384940; --review-bg: #4a2b27; --review-fg: #f2b9af;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, "Segoe UI", "Noto Sans SC", sans-serif; background-image: var(--paper); }
#app { max-width: 720px; margin: 0 auto; padding: 16px; }
button { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-btn, 10px); padding: 10px 14px; cursor: pointer; box-shadow: 0 1px 0 rgba(120, 80, 30, .10); transition: transform .08s, background .15s; }
button:hover:not(:disabled) { background: var(--peach); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: default; }
button.primary { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: .85rem; }

/* Bản đồ */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 1.3rem; color: var(--red); }
.sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.chips { display: flex; gap: 6px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; font-size: .9rem; }
.xpbar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.xpbar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .4s; }
.quests { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.quest { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; justify-content: space-between; font-size: .85rem; }
.quest.ok { border-color: var(--ok); }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.review { width: 100%; margin-bottom: 12px; background: var(--review-bg); color: var(--review-fg); border-color: var(--line); }

/* Điều hướng mới */
.tbtn { cursor: pointer; font-size: 1rem; line-height: 1; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 12px; font-size: .9rem; color: var(--muted); }
.crumbs button { padding: 4px 10px; border-radius: 20px; font-size: .85rem; box-shadow: none; }
.crumbs i { font-style: normal; opacity: .6; }
.h2 { font-size: 1.15rem; margin: 6px 0 12px; }
.h3 { font-size: 1rem; margin: 18px 0 8px; }
.note { color: var(--muted); font-size: .9rem; }
.opt-cards { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 560px) { .opt-cards { grid-template-columns: 1fr 1fr; } }
.opt-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 18px; border-radius: 20px; text-align: left; }
.opt-card b { font-size: 1.5rem; }
.opt-card span { color: var(--fg); }
.opt-card small { color: var(--muted); }
.opt-card.std { background: var(--peach); }
.opt-card.new { background: var(--lav); }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.lv { display: flex; flex-direction: column; gap: 4px; padding: 16px 8px; border-radius: 18px; background: var(--mint); }
.lv b { font-size: 1.2rem; } .lv small { color: var(--muted); }
.lv.off { background: var(--card); opacity: .55; }
.unit-list { display: grid; gap: 8px; }
.unit { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; }
.ub { background: var(--lav); border-radius: 12px; min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 6px; flex: none; }
.ub.big { min-width: 52px; height: 52px; font-size: 1.3rem; background: var(--peach); }
.ut { flex: 1; min-width: 0; } .ut b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut small { color: var(--muted); }
.us { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.unit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.unit-head .zh { font-size: 1.15rem; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; font-size: .85rem; }
.cat span { font-size: 1.4rem; }
.cat.active { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.cat.dim:not(.active) { opacity: .55; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.reading h4 { margin: 8px 0 4px; color: var(--red); } .reading p { margin: 4px 0; font-size: 1.1rem; line-height: 1.7; }
.panel .gram { border: 0; padding: 0; margin: 0; }

/* Chuỗi ngày học */
.streak { background: var(--lemon); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 12px; }
.streak.risk { background: var(--peach); }
.sk-top { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; }
.sk-fz { font-size: .85rem; color: var(--muted); }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 10px 0 6px; text-align: center; }
.dot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dot i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 2px dashed var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.dot.on i { border-style: solid; border-color: var(--gold); background: #fff; }
.dot.today i { border-color: var(--red); }
.dot small { color: var(--muted); font-size: .7rem; }
.sk-line { font-size: .88rem; }
.typein.small { font-size: 1rem; }
code { background: var(--lav); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.node { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; }
.node .zhs { font-size: .95rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { flex-wrap: wrap; }
.tabs.tracks button { font-size: .85rem; padding: 8px 6px; }
.node .mini { font-size: .75rem; color: var(--muted); }
.node.part { border-color: var(--gold); }
.node.gold { background: var(--gold); color: #2a2118; border-color: var(--gold); }
.node.gold .mini { color: #2a2118; }
.foot { text-align: center; margin-top: 24px; }

/* Cửa sổ chọn game */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 1.1rem; }
.x { padding: 4px 10px; }
.words { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wd { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; min-width: 64px; }
.wd b { font-size: 1.2rem; font-weight: 500; } .wd small { color: var(--red); font-size: .72rem; } .wd i { font-style: normal; font-size: .7rem; color: var(--muted); max-width: 90px; text-align: center; }
.gram { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.gram > b { display: block; margin-bottom: 6px; }
.gp { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 3px 0; }
.gn { background: var(--red); color: var(--on-red, #fff); border-radius: 50%; width: 20px; height: 20px; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gz { font-weight: 600; }
.gv { color: var(--muted); font-size: .85rem; }
.games { display: grid; gap: 8px; }
.gbtn { display: flex; align-items: center; gap: 12px; text-align: left; }
.gbtn small { display: block; color: var(--muted); font-size: .78rem; }
.gi { font-size: 1.8rem; }
.gs { margin-left: auto; color: var(--gold); letter-spacing: 1px; white-space: nowrap; }

/* Khung game chung */
.gamebar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-weight: 600; }
.hud { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 1.05rem; }
.py { color: var(--muted); text-align: center; font-size: .9rem; margin-top: 6px; }
.msg { min-height: 1.6em; text-align: center; font-weight: 600; margin: 6px 0; }
.warn { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; line-height: 1.5; }
.qbox { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 12px; text-align: center; min-height: 150px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.big { font-size: 4.5rem; line-height: 1.15; }
.bigvi { font-size: 1.9rem; font-weight: 600; }
.py b { color: var(--red); }
.spk { font-size: 2.6rem; border-radius: 50%; width: 84px; height: 84px; padding: 0; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.opt { padding: 16px 10px; font-size: 1.05rem; }
.opt.zh { font-size: 2rem; }
.opt.right { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { background: var(--bad); color: #fff; border-color: var(--bad); }

/* Đấu Yêu Quái */
.arena { background: var(--sky); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.bars { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.hp { flex: 1; height: 14px; background: rgba(0,0,0,.15); border-radius: 7px; overflow: hidden; }
.hp > i { display: block; height: 100%; background: linear-gradient(90deg, #e53935, #fb8c00); transition: width .3s; }
.monster { font-size: 5rem; text-align: center; line-height: 1.2; }
.monster.hit { animation: hit .35s; } .monster.crit { animation: crit .5s; } .monster.atk { animation: atk .4s; }
@keyframes hit { 30% { transform: translateX(-12px) rotate(-6deg); filter: brightness(2); } 60% { transform: translateX(10px); } }
@keyframes crit { 30% { transform: scale(1.35) rotate(8deg); filter: brightness(2.4) hue-rotate(40deg); } 100% { transform: scale(1); } }
@keyframes atk { 30% { transform: translateY(18px) scale(1.25); } }

/* Mưa Chữ */
.field { position: relative; height: 52vh; min-height: 300px; background: linear-gradient(var(--field1), var(--field2)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.field.flash { animation: flash .4s; }
@keyframes flash { 40% { box-shadow: inset 0 0 0 4px var(--bad); } }
.drop { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; will-change: transform; }
.drop b { font-size: 2rem; font-weight: 500; } .drop small { font-size: .7rem; color: var(--muted); }
.drop.pop { opacity: 0; scale: 1.5; transition: .25s; } .drop.splash { opacity: 0; transition: .25s; background: var(--bad); }
.typein { width: 100%; margin-top: 10px; font: inherit; font-size: 1.2rem; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--fg); text-align: center; }
.typein:focus { outline: none; border-color: var(--red); } .typein.bad { border-color: var(--bad); }

/* Lật Bài */
.mem { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .mem { grid-template-columns: repeat(4, 1fr); } }
.mcard { height: 104px; padding: 4px; position: relative; display: flex; align-items: center; justify-content: center; }
.mcard .front { font-size: 2rem; color: var(--gold); }
.mcard .back { display: none; flex-direction: column; align-items: center; font-size: .9rem; line-height: 1.2; }
.mcard .back b { font-size: 2rem; font-weight: 500; } .mcard .back small { color: var(--red); }
.mcard.up .front { display: none; } .mcard.up .back { display: flex; }
.mcard.up { background: var(--sky); } .mcard.done { background: var(--ok); color: #fff; border-color: var(--ok); } .mcard.done small { color: #fff; }

/* Thính Phong */
.tones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.tone { display: flex; flex-direction: column; align-items: center; padding: 14px 2px; }
.tone b { font-size: 1.4rem; } .tone small { font-size: .7rem; color: var(--muted); }
.tone.right { background: var(--ok); color: #fff; } .tone.right small { color: #fff; }
.tone.wrong { background: var(--bad); color: #fff; } .tone.wrong small { color: #fff; }

/* Kết quả */
.result { text-align: center; padding: 32px 8px; }
.trophy { font-size: 4rem; }
.big-stars { font-size: 2.4rem; color: var(--gold); letter-spacing: 4px; }
.rankup { color: var(--red); font-weight: 700; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* ===== Game mới: hoạt ảnh ===== */
.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.timebar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--ok), var(--gold), var(--bad)); }

/* Đua Mây */
.race { background: linear-gradient(#cdeaff, #eaf7ff 60%, #d9f5d0); border: 1px solid var(--line); border-radius: 18px; padding: 8px 10px 10px; position: relative; overflow: hidden; }
:root[data-theme="dark"] .race { background: linear-gradient(#35506a, #3f5f7c 60%, #3d5a4a); }
.sky { height: 26px; position: relative; }
.cl { position: absolute; top: 0; font-size: 1.4rem; opacity: .7; animation: drift 14s linear infinite; }
.cl.c1 { left: -10%; } .cl.c2 { left: 35%; animation-duration: 19s; top: 6px; } .cl.c3 { left: 70%; animation-duration: 24s; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(140%); } }
.lane { position: relative; height: 54px; border-radius: 14px; margin-top: 6px; background: rgba(255, 255, 255, .55); }
.lane .goal { position: absolute; right: 6px; top: 8px; font-size: 1.7rem; }
.runner { position: absolute; top: 4px; left: 0; font-size: 2rem; transition: left .6s cubic-bezier(.2, .9, .3, 1); display: inline-block; animation: bob 1s ease-in-out infinite; }
.runner.me i { position: absolute; left: 4px; top: 22px; font-style: normal; font-size: 1.5rem; }
.runner.boost { animation: boost .6s; }
.runner.dash { animation: dashm .6s; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes boost { 30% { transform: translateY(-12px) scale(1.3) rotate(-8deg); } }
@keyframes dashm { 30% { transform: scale(1.35) rotate(10deg); filter: hue-rotate(-30deg); } }

/* Chém Đào Tiên */
.ask { text-align: center; font-size: 1.1rem; margin: 6px 0; } .ask b { color: var(--red); font-size: 1.3rem; }
.orchard { position: relative; height: 58vh; min-height: 340px; background: linear-gradient(#ffe9d6, #fff6ee); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
:root[data-theme="dark"] .orchard { background: linear-gradient(#4d3f4f, #5a4a5e); }
.orchard.hurt { animation: hurt .4s; }
@keyframes hurt { 40% { box-shadow: inset 0 0 0 5px var(--bad); } }
.peach { position: absolute; left: 0; top: 0; width: 72px; height: 72px; border-radius: 50% 50% 48% 48%; background: radial-gradient(circle at 35% 30%, #ffd0d9, #ff9fb3 55%, #f77a96); box-shadow: 0 4px 10px rgba(240, 100, 140, .35); display: flex; align-items: center; justify-content: center; will-change: transform; }
.peach::before { content: "🍃"; position: absolute; top: -12px; right: 4px; font-size: 1.1rem; }
.peach span { font-size: 1.6rem; color: #4a2a35; font-weight: 600; pointer-events: none; }
.peach.cut { animation: cut .6s forwards; background: radial-gradient(circle, #d8f3e6, #52b788); }
.peach.bad { animation: cut .5s forwards; background: #ccc; filter: grayscale(1); }
.peach.fade { opacity: 0; transition: opacity .4s; }
@keyframes cut { 30% { scale: 1.3; rotate: 15deg; } 100% { scale: .2; opacity: 0; } }
.slash { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px 6px rgba(255, 255, 255, .9), 0 0 24px 10px rgba(240, 100, 140, .5); opacity: 0; pointer-events: none; transition: opacity .15s; }

/* Điền từ / Nối câu */
.qbox.sent { min-height: 120px; padding: 14px 10px; }
.zhline { font-size: 1.7rem; line-height: 1.6; }
.blank { display: inline-block; min-width: 2.4em; border-bottom: 3px solid var(--red); text-align: center; color: var(--red); }
.blank.okfill { color: var(--ok); border-color: var(--ok); } .blank.badfill { color: var(--bad); border-color: var(--bad); }
.big-vi { font-size: 1.15rem; color: var(--fg); }
.opts.one { grid-template-columns: 1fr; }
.opt.long { font-size: 1.35rem; line-height: 1.5; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col { display: grid; gap: 8px; align-content: start; }
.pbtn { text-align: left; padding: 10px; font-size: .95rem; transition: transform .5s ease, background .3s; }
.pbtn.l { font-size: 1.15rem; }
.pbtn.sel { background: var(--lemon); border-color: var(--gold); }
.pbtn.done { background: var(--ok); color: #fff; border-color: var(--ok); }

/* Xếp câu */
.answer { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin: 12px 0 8px; background: var(--card); border: 2px dashed var(--line); border-radius: 16px; align-items: center; }
.answer.good { border-color: var(--ok); background: var(--mint); } .answer.bad { border-color: var(--bad); animation: shake .4s; }
.answer .ph { color: var(--muted); font-size: .9rem; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 12px; min-height: 56px; }
.tk { font-size: 1.4rem; padding: 8px 14px; border-radius: 12px; animation: pop .25s; }
.tk.used { opacity: .25; }
@keyframes pop { from { transform: translateY(14px) scale(.8); opacity: 0; } }

.sx { padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.sx:last-child { border-bottom: 0; }
.sx p { margin: 0; font-size: 1.25rem; line-height: 1.6; }
.sx small { display: block; color: var(--muted); font-size: .85rem; }
.sx .spy { color: var(--red); }

/* ===== Bài đọc kiểu có pinyin ===== */
.rd { --rt: var(--red); }
.rtabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.rtabs .sp { flex: 1; }
.rtab, .rtool { padding: 6px 12px; border-radius: 20px; font-size: .85rem; box-shadow: none; }
.rtab.active { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.rtool.on { background: var(--lav); }
.rtitle { font-size: 2rem; margin: 6px 0 2px; font-weight: 700; line-height: 2.1; }
.rsub { color: var(--muted); font-style: italic; margin-bottom: 8px; }
.rcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 10px; margin: 8px 0 14px; box-shadow: 0 2px 10px rgba(240, 100, 140, .08); }
.rline { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }
.rline.dlg .who { flex: none; margin-top: 1.1em; background: var(--lav); color: var(--fg); border-radius: 50%; min-width: 26px; height: 26px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.rz { font-size: 1.55rem; line-height: 2.5; cursor: pointer; }
.rd ruby { ruby-position: over; ruby-align: center; }
.rd rt { font-size: .5em; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.rd.nopy rt { display: none; }
.rd.nopy .rz { line-height: 1.9; } .rd.nopy .rtitle { line-height: 1.4; }
mark.hl { background: var(--lemon); color: inherit; border-radius: 6px; padding: 0 2px; box-shadow: 0 0 0 1px rgba(246, 196, 83, .5); }
.rh { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 1.1rem; }
.tag { background: var(--lav); color: var(--fg); border-radius: 8px; font-size: .65rem; font-weight: 700; padding: 2px 8px; letter-spacing: .06em; }
.rvocab { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .rvocab { grid-template-columns: 1fr 1fr; } }
.rv { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.rv .no { background: var(--lav); border-radius: 50%; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }
.rvb { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rvb small { color: var(--muted); font-size: .7rem; } .rvb b { color: var(--red); font-size: 1.25rem; font-weight: 500; }
.rvm { text-align: right; display: flex; flex-direction: column; font-size: .82rem; max-width: 45%; }
.rvm small { color: var(--muted); font-size: .62rem; letter-spacing: .05em; }
.rtrans { background: var(--lav); border-left: 4px solid var(--gold); border-radius: 12px; padding: 10px 14px; }
.rtrans p { margin: 4px 0; line-height: 1.55; font-size: .95rem; }

/* ===== Điểm ngữ pháp ===== */
.gcards { display: grid; gap: 8px; margin-top: 8px; }
.gcard { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; }
.gcard .gn, .gn.big { background: var(--red); color: var(--on-red, #fff); border-radius: 50%; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; flex: none; }
.gn.big { min-width: 46px; height: 46px; font-size: 1.2rem; }
.gct { flex: 1; min-width: 0; display: flex; flex-direction: column; } .gct b { font-size: 1.05rem; } .gct small { color: var(--muted); }
.gzbig { font-size: 1.35rem; } .gvbig { color: var(--muted); font-size: .95rem; }
.theory p { margin: 6px 0; line-height: 1.6; }
.exs { display: grid; gap: 8px; }
.ex { background: var(--bg); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.exz { font-size: 1.3rem; line-height: 2.3; } .exz.nopy { line-height: 1.6; } .exz.nopy rt { display: none; }
.ex small { color: var(--muted); display: block; }
.exz ruby { ruby-position: over; } .exz rt { font-size: .5em; color: var(--muted); }
.row.spread { justify-content: space-between; margin: 16px 0; }
.rh .sp { flex: 1; }

/* ===== Lộ trình Unit kiểu thẻ màu (lấy cảm hứng từ app học tiếng Trung) ===== */
.review-all { width: 100%; margin: 6px 0 14px; background: linear-gradient(90deg, #ffb877, #ff8fab); color: #fff; border: 0; font-weight: 700; padding: 12px; }
.review-all:hover:not(:disabled) { background: linear-gradient(90deg, #ffa75c, #ff7a9c); }
.path { display: grid; gap: 4px; }
.pitem { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.pitem:hover:not(:disabled) { background: var(--peach); border-radius: 14px; }
.pitem .pt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pitem .pt b { font-size: 1.05rem; } .pitem .pt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem i { color: var(--muted); font-style: normal; font-size: 1.4rem; }
.pstar { color: var(--gold); font-size: .85rem; letter-spacing: 1px; }
.pic { width: 54px; height: 54px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 700; color: #fff; flex: none; box-shadow: 0 3px 0 rgba(0, 0, 0, .08); }
.pic.vocab { background: #d9a441; }
.pic.grammar { background: #c24a40; }
.pic.reading { background: #4f9a74; }
.item-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; } .item-head small { display: block; color: var(--muted); }
.item-head b { font-size: 1.2rem; }
.h4 { margin: 10px 0 6px; font-size: .95rem; color: var(--muted); }
.gp-title { margin: 0 0 10px; }
.wlist { display: grid; gap: 10px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; cursor: pointer; }
.wc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wc-l { display: flex; flex-direction: column; } .wc-l small { color: var(--red); } .wc-l b { font-size: 1.9rem; font-weight: 500; }
.wc-m { text-align: right; display: flex; flex-direction: column; max-width: 55%; } .wc-m small { color: var(--muted); font-size: .68rem; letter-spacing: .05em; } .wc-m span { font-size: .95rem; }
.wc-ex { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.wc-ex span { font-size: 1.05rem; } .wc-ex small { display: block; color: var(--muted); }
.dock { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 12px 0 14px; margin-top: 16px; background: linear-gradient(transparent, var(--bg) 35%); }
.dock .big { flex: 1; padding: 14px; font-size: 1.05rem; font-weight: 700; }
.dock button:not(.big) { width: 52px; padding: 12px 0; }

/* Đọc theo + chấm điểm */
.rline { position: relative; flex-wrap: wrap; }
.rline .rz { flex: 1; min-width: 0; }
.mic { flex: none; align-self: center; width: 40px; height: 40px; border-radius: 50%; padding: 0; font-size: 1.1rem; }
.mic.rec { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(239, 111, 138, .25); } }
.rres { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px 34px; font-size: .9rem; }
.rres:empty { display: none; }
.score { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; color: #fff; line-height: 1; }
.score b { font-size: 1.3rem; } .score small { font-size: .6rem; }
.score.good { background: var(--ok); } .score.mid { background: #f0a500; } .score.low { background: var(--bad); }
.chk { display: flex; gap: 2px; font-size: 1.3rem; } .chk .ok { color: var(--ok); } .chk .no { color: var(--bad); text-decoration: underline wavy; }
.heard { color: var(--muted); flex-basis: 100%; } .rrow { display: flex; gap: 6px; flex-basis: 100%; }
.bad { color: var(--bad); }
.note.src { font-size: .8rem; }

.tk.line { font-size: 1.1rem; text-align: left; line-height: 1.5; padding: 10px 14px; }
.tk.line b { color: var(--red); margin-right: 4px; }
.rres.show { margin: 10px 0 0 0; justify-content: center; }
#mic.rec, .mic.rec { background: var(--bad); color: #fff; animation: pulse 1s infinite; }

/* ===== Lò Ghép Chữ / Nhà Bộ Thủ ===== */
.pot-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 12px; text-align: center; }
.pot-q { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.bt { width: 84px; padding: 8px 4px; border: 2px solid var(--ok); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; align-items: center; animation: pop .35s; }
.bt b { font-size: 2.2rem; font-weight: 500; line-height: 1.1; } .bt small { font-size: .7rem; color: var(--muted); }
.bt.q { border: 2px dashed var(--gold); background: var(--lemon); justify-content: center; height: 84px; } .bt.q b { color: var(--ok); }
.bt.big { width: 96px; border-color: var(--red); }
.op { font-size: 1.5rem; color: var(--ok); font-weight: 700; }
.pot-wrap { height: 110px; display: flex; align-items: center; justify-content: center; }
.pot { position: relative; width: 120px; height: 74px; background: #3a3f50; border-radius: 10px 10px 60px 60px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 14px 0 #6ee7c7, 0 6px 0 #ff9f43; }
.pot i { font-style: normal; color: var(--gold); font-size: 1.8rem; text-shadow: 0 1px 0 rgba(0,0,0,.3); margin-top: 12px; }
.steam { position: absolute; top: -26px; font-size: 1.4rem; opacity: .6; animation: steam 1.6s ease-in-out infinite; }
@keyframes steam { 50% { transform: translateY(-8px); opacity: .2; } }
.pot.boil { animation: boil .6s; } .pot.pop { animation: potpop .6s; }
@keyframes boil { 30% { transform: translateY(-6px) scale(1.06); } 60% { transform: translateY(2px); } }
@keyframes potpop { 40% { transform: scale(1.18) rotate(-4deg); filter: brightness(1.3); } }
.pot-hint { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.opts.four { grid-template-columns: 1fr 1fr; }
.mail .envelope { position: relative; width: 150px; height: 110px; background: var(--lemon); border: 2px solid var(--gold); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .6s, opacity .6s; }
.mail .envelope::before { content: "✉"; position: absolute; top: -14px; right: -10px; font-size: 1.6rem; }
.mail .ch { font-size: 3.4rem; line-height: 1.1; } .mail small { color: var(--muted); }
.mail .envelope.fly { transform: translateY(80px) scale(.3); opacity: 0; }
.houses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.house { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 6px 10px; border-radius: 6px 6px 14px 14px; }
.house .roof { position: absolute; top: -8px; left: -2px; right: -2px; height: 18px; background: var(--red); clip-path: polygon(0 100%, 50% 0, 100% 100%); border-radius: 4px; opacity: .85; }
.house b { font-size: 2rem; font-weight: 500; } .house small { color: var(--red); font-weight: 700; } .house i { font-style: normal; color: var(--muted); font-size: .8rem; text-align: center; }
.house.right { background: var(--ok); color: #fff; border-color: var(--ok); } .house.right small, .house.right i { color: #fff; }
.house.wrong { background: var(--bad); color: #fff; } .house.wrong small, .house.wrong i { color: #fff; }
.cstruct { margin-top: 4px; color: var(--muted); font-size: .8rem; }


.btline { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .95rem; }
.btline .bl small { color: var(--muted); margin: 0 2px; font-size: .72rem; }
.btline .bl b { color: var(--red); }

.kind { text-align: center; color: var(--muted); font-size: .85rem; margin: 4px 0; }

/* ===== Thẻ trang chủ, Wordle pinyin, bóng, kịch ===== */
.hcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.hcard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; text-align: left; border-radius: 16px; }
.hcard span { font-size: 1.6rem; } .hcard small { color: var(--muted); }
.hcard.c1 { background: var(--lemon); } .hcard.c2 { background: var(--mint); } .hcard.c3 { background: var(--lav); }
.wgrid { display: grid; gap: 6px; justify-content: center; margin: 12px 0; }
.wr { display: flex; gap: 6px; justify-content: center; }
.wc { width: 42px; height: 46px; border: 2px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.3rem; background: var(--card); }
.wc.c-t { border-color: var(--muted); } .wc.c-g { background: var(--ok); border-color: var(--ok); color: #fff; } .wc.c-y { background: var(--gold); border-color: var(--gold); color: #3a3022; } .wc.c-x { background: var(--muted); border-color: var(--muted); color: #fff; opacity: .8; }
.kb { display: grid; gap: 6px; margin-top: 8px; } .kr { display: flex; gap: 4px; justify-content: center; }
.key { padding: 10px 0; min-width: 28px; flex: 1; max-width: 40px; font-weight: 600; text-transform: uppercase; }
.key.k-g { background: var(--ok); color: #fff; } .key.k-y { background: var(--gold); } .key.k-x { background: var(--muted); color: #fff; opacity: .6; }
.sky2 { position: relative; height: 56vh; min-height: 320px; background: linear-gradient(var(--field1), var(--field2)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.bub { position: absolute; left: 0; top: 0; width: 82px; height: 92px; border-radius: 50% 50% 48% 48%; border: 2px solid rgba(255,255,255,.8); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; will-change: transform; box-shadow: inset -6px -8px 12px rgba(0,0,0,.08); }
.bub b { font-size: 1.5rem; font-weight: 500; color: #3a3350; } .bub small { font-size: .65rem; color: #5a5470; }
.bub.popok { animation: popb .3s forwards; background: var(--ok) !important; } .bub.popbad { animation: popb .3s forwards; background: var(--bad) !important; }
@keyframes popb { to { scale: 1.6; opacity: 0; } }
.share-box { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 12px; font-size: 1.3rem; margin: 12px 0; }
.chat { display: grid; gap: 10px; margin: 10px 0; }
.msgb { display: flex; gap: 8px; align-items: flex-start; } .msgb.me { flex-direction: row-reverse; }
.av { font-size: 1.6rem; flex: none; }
.bub2 { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 1.25rem; line-height: 2.3; max-width: 82%; }
.bub2 small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; } .bub2 .who2 { display: block; font-size: .75rem; color: var(--muted); line-height: 1.2; }
.msgb.me .bub2 { background: var(--lav); } .bub2.good { background: var(--mint); } .bub2.mid { background: var(--lemon); } .bub2.low { background: var(--peach); }
.cchoices { display: grid; gap: 8px; } .cch { text-align: left; font-size: 1.15rem; line-height: 2.2; } .cch small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.fbk { padding: 10px 14px; border-radius: 12px; margin: 8px 0; } .fbk.good { background: var(--mint); } .fbk.mid { background: var(--lemon); } .fbk.low { background: var(--peach); }

/* ---- Game ôn tập tổng hợp: Vượt Ải, Ghép Cặp Tốc Độ, Ôn Đến Khi Thuộc ---- */
.tbar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 6px 0 10px; }
.tbar > i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .1s linear; }
.tbar > i.low { background: var(--bad); }
.vmap { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 8px; }
.vmap > i { color: var(--muted); font-style: normal; }
.vst { display: flex; flex-direction: column; align-items: center; padding: 6px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); opacity: .6; }
.vst b { font-size: 1.6rem; } .vst small { color: var(--muted); font-size: .72rem; }
.vst.now { opacity: 1; border-color: var(--gold); background: var(--sky); }
.vst.ok { opacity: 1; border-color: var(--ok); }
.opt.gone { opacity: .25; text-decoration: line-through; }
.dots2 { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.dd { padding: 2px 9px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 1rem; }
.dd.half { border-color: var(--gold); } .dd.miss { border-color: var(--bad); }
.dd.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.hcard.c4 { background: var(--peach, #ffe3cf); }
.tabs { display: flex; gap: 8px; margin: 8px 0 12px; } .tabs button { padding: 8px 16px; border-radius: 999px; } .tabs button.on { background: var(--mint); font-weight: 700; }
.rank-list { display: grid; gap: 6px; margin: 10px 0; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card, rgba(127,127,127,.08)); }
.lrow.top { background: var(--lemon); } .lrow.me { outline: 2px solid var(--red, #e5686b); }
.rpos { width: 34px; text-align: center; font-size: 1.1rem; } .rnick { flex: 1; display: flex; flex-direction: column; font-weight: 700; } .rnick small { font-weight: 400; color: var(--muted); } .rxp { font-variant-numeric: tabular-nums; }


/* ===== Lớp trang trí Tây Du Ký ===== */
h1, .h2, .h3, .rtitle, .opt-card b, .lv b, .ub, .gn.big { font-family: var(--serif); }
.big, .rz, .zhline, .exz, .wc-l b, .bt b, .wd b, .rvb b, .drop b, .bub b, .opt.zh, .tk, .mcard .back b, .house b, .mail .ch, .gzbig, .gz, .pbtn.l, .sx p, .cch, .bub2, .ask b { font-family: var(--hanzi); }
rt, .rd rt, .exz rt { font-family: system-ui, "Segoe UI", sans-serif; }
.top { align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.seal { font-family: var(--kai); background: var(--red); color: var(--on-red, #fff); font-size: 1.8rem; line-height: 1; padding: 8px 10px 6px; border-radius: 8px; letter-spacing: 2px; flex: none; }
h1 { font-size: 1.35rem; color: var(--fg); letter-spacing: .02em; }
h1 small { display: block; font-family: var(--kai); font-size: .9rem; color: var(--red); letter-spacing: .12em; font-weight: 400; }
.chip { border-radius: 999px; border-color: var(--line); background: var(--card); }
.xpbar { height: 8px; border-radius: 4px; border: 0; background: var(--line); }
.xpbar > div { background: var(--red); border-radius: 4px; }
.h2 { font-size: 1.2rem; }

button.primary { background: var(--red); border-color: var(--red); color: var(--on-red, #fff); box-shadow: none; }
button:hover:not(:disabled) { background: var(--lemon); }
button.primary:hover:not(:disabled) { background: #9e2822; }
.opt-card, .hcard, .streak, .panel, .rcard, .qbox, .warn, .pot-card, .wcard, .gram, .lrow, .quest { border: 1px solid var(--line); border-radius: var(--r-card, 12px); box-shadow: none; }
.opt-card, .hcard { padding: 18px 16px; }
.opt-card.std { background: var(--peach); } .opt-card.new { background: var(--mint); }
.opt-card b { font-size: 1.6rem; color: var(--red); }
.hcard.c1 { background: var(--lemon); } .hcard.c2 { background: var(--mint); } .hcard.c3 { background: var(--lav); } .hcard.c4 { background: var(--peach); }
.hcard b { font-family: var(--serif); }
.lv { border-radius: 12px; border: 1px solid var(--line); background: var(--mint); }
.ub { border-radius: 10px; background: var(--red); color: var(--on-red, #fff); }
.ub.big { background: var(--red); }
.crumbs button { border-radius: 4px; }
.review-all { background: var(--red); border-radius: 12px; }
.review-all:hover:not(:disabled) { background: #9e2822; }
.pitem:hover:not(:disabled) { background: var(--lemon); border-radius: 8px; }
.pic { border-radius: 12px; box-shadow: none; font-family: var(--hanzi); }
.pic.vocab { background: #d9a441; }
.pic.grammar { background: #c24a40; }
.pic.reading { background: #4f9a74; }
.tabs button.active, .rtab.active, .cat.active, .tabs button.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.hcards .hcard span { filter: saturate(.9); }
.rtrans { background: var(--lav); border-left-color: var(--red); border-radius: 6px; }
.gn, .gcard .gn, .gn.big { background: var(--red); border-radius: 6px; }
.lrow.top { background: var(--lemon); }
mark.hl { background: var(--lemon); box-shadow: 0 0 0 1px rgba(200, 150, 46, .6); border-radius: 3px; }
.race { background: linear-gradient(#e6eedf, #f4f0de 60%, #e0e8cd); }
.orchard { background: linear-gradient(#f6e3c8, #fbf1de); }
:root[data-theme="dark"] .race { background: linear-gradient(#2d3a33, #384940 60%, #33473a); }
:root[data-theme="dark"] .orchard { background: linear-gradient(#43342a, #52402f); }
.sheet { border-radius: 16px 16px 0 0; }
.foot { margin-top: 28px; }

.dot.on i { background: var(--lemon); }
@media (max-width: 480px) { .seal { font-family: var(--kai); background: var(--red); color: var(--on-red, #fff); font-size: 1.8rem; line-height: 1; padding: 8px 10px 6px; border-radius: 8px; letter-spacing: 2px; flex: none; } h1 { font-size: 1.1rem; } }

/* ===== Nhập môn Pinyin ===== */
.py-banner { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; margin: 4px 0 14px; background: var(--red); color: var(--on-red, #fff); border: 0; border-radius: 12px; box-shadow: none; }
.py-banner:hover:not(:disabled) { background: #9e2822; }
.py-banner span { font-size: 2rem; } .py-banner div { flex: 1; display: flex; flex-direction: column; } .py-banner b { font-family: var(--serif); font-size: 1.1rem; } .py-banner small { opacity: .85; } .py-banner i { font-style: normal; font-size: 1.6rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; margin-bottom: 10px; }
.pygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pyt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.pyt-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 6px; }
.pyp { font-family: var(--serif); font-size: 1.9rem; color: var(--red); line-height: 1.1; }
.pyex { color: var(--muted); font-size: .9rem; } .pyd { font-size: .82rem; color: var(--fg); line-height: 1.4; }
.tsvg { color: var(--red); flex: none; }
.pyrow { display: flex; flex-wrap: wrap; gap: 8px; }
.pychip { padding: 6px 12px; border-radius: 6px; } .pychip small { color: var(--muted); font-family: var(--hanzi); }
.pyo { font-family: var(--serif); font-size: 1.5rem; }
.opt .tsvg { vertical-align: middle; margin-right: 6px; }
.chart-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 12px; }
.pychart { border-collapse: collapse; font-size: .95rem; min-width: max-content; }
.pychart th { position: sticky; top: 0; background: var(--lav); font-family: var(--serif); padding: 4px 8px; z-index: 1; }
.pychart tbody th { position: sticky; left: 0; top: auto; z-index: 2; }
.pychart td { padding: 0; text-align: center; border: 1px solid var(--line); } .pychart td.no { color: var(--line); }
.cc { width: 100%; min-width: 44px; padding: 6px 4px; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-family: var(--serif); }
.cc:hover:not(:disabled) { background: var(--lemon); }
.tabs .on .tsvg, .tabs button.on svg { color: #fff4dc; }
.cc.alt { opacity: .45; }

/* ===== Bố cục mới: thanh quay lại + thanh tab dưới ===== */
.bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 8px 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.bbtn { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 1.3rem; flex: none; }
.btitle { flex: 1; min-width: 0; display: flex; flex-direction: column; } .btitle b { font-family: var(--serif, inherit); font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .btitle small { color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabpad { height: 84px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; gap: 0; background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: none; }
.tabbar button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 0; border: 0; background: transparent; box-shadow: none; padding: 6px 4px; border-radius: 12px; color: var(--muted); }
.tabbar button span { font-size: 1.35rem; line-height: 1.2; } .tabbar button small { font-size: .72rem; }
.tabbar button.on { color: var(--red); font-weight: 700; background: var(--lemon); }
.dock { bottom: 70px; }
.cont { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; margin: 4px 0 12px; background: var(--mint); border: 1px solid var(--ok); border-radius: 14px; }
.cont span { font-size: 1.5rem; color: var(--ok); } .cont div { flex: 1; display: flex; flex-direction: column; } .cont small { color: var(--muted); } .cont i { font-style: normal; font-size: 1.5rem; color: var(--muted); }
.melist { display: grid; gap: 8px; margin-bottom: 12px; }
.mebtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; } .mebtn b { flex: 1; font-weight: 500; } .mebtn i { font-style: normal; color: var(--muted); font-size: 1.4rem; }
.hcard:disabled { opacity: .5; }

/* ===== Icon nét ===== */
.ic { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.ic.on { fill: currentColor; } .ic.off { color: var(--line); }
.starrow { display: inline-flex; gap: 2px; color: var(--gold); vertical-align: middle; } .starrow .ic { width: 1em; height: 1em; vertical-align: 0; }
.big-stars .ic { width: 2.2rem; height: 2.2rem; } .big-stars { display: flex; justify-content: center; gap: 6px; }
.chip .ic { width: 1em; height: 1em; vertical-align: -.15em; } .chip .ic[class*="on"] { color: var(--gold); }
.tabbar button span .ic { width: 1.5rem; height: 1.5rem; }
.hcard > span .ic { width: 1.7rem; height: 1.7rem; color: var(--red); }
.mebtn > span .ic, .cont > span .ic { width: 1.4rem; height: 1.4rem; }
.py-banner > span .ic { width: 2rem; height: 2rem; }
.pic .ic { width: 1.7rem; height: 1.7rem; stroke-width: 1.8; }
.gi .ic { width: 1.7rem; height: 1.7rem; color: var(--red); }
.trophy .ic { width: 4rem; height: 4rem; color: var(--gold); }
.spk .ic { width: 2.4rem; height: 2.4rem; }
.dot i .ic { width: 1rem; height: 1rem; color: var(--red); }
.av .ic { width: 1.6rem; height: 1.6rem; color: var(--muted); }
.ub .ic { width: 1.3rem; height: 1.3rem; }
.bbtn .ic { width: 1.3rem; height: 1.3rem; }
button .ic { margin-right: 2px; } .row button .ic, .rtool .ic { width: 1.05em; height: 1.05em; }
.medal { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .95rem; }
.medal.m1 { background: #d4a017; } .medal.m2 { background: #8f98a3; } .medal.m3 { background: #b4733a; }
.fbk .ic { vertical-align: -.2em; }
.hearts { display: inline-flex; gap: 3px; vertical-align: middle; } .heart { width: 1.15em; height: 1.15em; } .heart.on { color: var(--red); fill: currentColor; } .heart.off { color: var(--line); }

.ipa { font-family: system-ui, "Segoe UI", sans-serif; color: var(--muted); font-size: .85rem; }
.pyt-top { flex-wrap: wrap; } .pyd { font-size: .82rem; }
.pair { display: flex; gap: 14px; justify-content: center; } .pair .spk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 92px; height: 92px; } .pair .spk small { font-size: .72rem; color: var(--muted); }
.pyshow { font-family: var(--serif); color: var(--red); }
.aopts { display: grid; gap: 8px; margin-top: 12px; } .aopt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
.slots { display: flex; gap: 10px; justify-content: center; margin: 12px 0 4px; }
.slot { min-width: 72px; padding: 10px 14px; text-align: center; font-family: var(--serif); font-size: 1.6rem; border: 2px dashed var(--line); border-radius: 12px; background: var(--card); color: var(--red); }
.btiles { display: flex; flex-wrap: wrap; gap: 8px; }
.btile { min-width: 56px; padding: 10px 14px; font-family: var(--serif); font-size: 1.25rem; } .btile.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); } .btile .tsvg { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; } .btile.on .tsvg { color: #fff; }

/* ===== Giải đấu tuần ===== */
.lghead { text-align: center; margin: 4px 0 8px; } .lghead h2 { font-family: var(--serif, inherit); font-size: 1.5rem; margin: 0; color: var(--lg); }
.lgtime { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; letter-spacing: .06em; margin-top: 4px; }
.lgrow { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 6px 0 12px; overflow-x: auto; padding: 4px; }
.lgt { position: relative; display: inline-flex; } .lgt .ic { width: 34px; height: 34px; stroke-width: 1.6; fill: color-mix(in srgb, currentColor 14%, transparent); }
.lgt.cur .ic { width: 64px; height: 64px; stroke-width: 1.8; fill: color-mix(in srgb, currentColor 30%, transparent); }
.lgt.lock .ic { fill: none; } .lgt .lk { position: absolute; width: 14px; height: 14px; left: 10px; top: 8px; color: var(--muted); fill: none; }
.zone { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 0; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; }
.zone.up { color: var(--ok); } .zone.down { color: var(--bad); } .zone .ic { width: 1.2em; height: 1.2em; }
.lrow.dn { background: color-mix(in srgb, var(--bad) 8%, var(--card)); }

/* ===== Sinh động: thẻ hành trình, biểu tượng chìm, chuyển động nhẹ ===== */
.journey { position: relative; overflow: hidden; border-radius: 16px; background: color-mix(in srgb, var(--gold) 14%, var(--card)); border: 1px solid var(--line); padding: 14px 16px 12px; margin: 0 0 12px; min-height: 132px; }
.jart { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; pointer-events: none; }
.jsun { fill: var(--red); opacity: .85; } .jm1 { fill: color-mix(in srgb, var(--red) 14%, transparent); } .jm2 { fill: color-mix(in srgb, var(--ok) 24%, transparent); } .jcl { fill: var(--card); opacity: .9; }
.jtxt { position: relative; max-width: 62%; display: flex; flex-direction: column; gap: 4px; } .jtxt small { color: var(--muted); } .jtxt b { font-family: var(--serif); font-size: 1.35rem; color: var(--red); }
.jbar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .08); overflow: hidden; } .jbar div { height: 100%; background: var(--red); border-radius: 4px; transition: width .5s; }
.jstops { position: relative; display: flex; gap: 6px; margin-top: 10px; }
.jstop { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--red); background: var(--card); } .jstop.done { background: var(--red); } .jstop.now { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.opt-card { position: relative; overflow: hidden; } .opt-card .wm { position: absolute; right: -6px; bottom: -8px; opacity: .13; pointer-events: none; } .opt-card .wm .ic { width: 92px; height: 92px; stroke-width: 1.4; }
.hcard > span:first-child { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .65); margin-bottom: 4px; }
.hcard.c1 > span:first-child { color: #b88a00; } .hcard.c2 > span:first-child { color: var(--ok); } .hcard.c3 > span:first-child { color: #6a4fc0; } .hcard.c4 > span:first-child { color: var(--red); }
.hcard > span .ic { color: inherit; }
.opt-card, .hcard, .pitem, .unit, .lv { transition: transform .15s ease, box-shadow .15s ease; }
.opt-card:hover, .hcard:hover:not(:disabled), .lv:hover:not(.off) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(90, 50, 20, .10); }
.opt-card:active, .hcard:active, .pitem:active, .unit:active, .lv:active { transform: scale(.985); }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#app > :not(.tabbar):not(.tabpad) { animation: fadeup .28s ease both; }
.tabbar button.on span { animation: pop2 .25s ease; } @keyframes pop2 { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { #app > *, .tabbar button.on span { animation: none; } }

/* ===== Cách viết chữ Hán ===== */
.wstroke { margin-top: 4px; padding: 4px 10px; font-size: .78rem; border-radius: 999px; color: var(--red); border-color: var(--red); box-shadow: none; background: transparent; }
.wstroke .ic { width: 1em; height: 1em; }
.hz-box { display: flex; justify-content: center; margin: 8px 0; } .hz { width: 100%; max-width: 320px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.hz-grid { stroke: var(--line); stroke-width: 6; stroke-dasharray: 24 18; fill: none; }
.hz-bg { fill: var(--line); } .hz-done { fill: var(--fg); }
.hz-anim { fill: none; stroke: var(--red); stroke-width: 160; stroke-linecap: butt; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: hzdraw linear forwards; }
@keyframes hzdraw { to { stroke-dashoffset: 0; } }
.hz-n { font-size: 64px; fill: var(--red); font-family: system-ui, sans-serif; font-weight: 700; }
.hz-info { text-align: center; margin: 0; } .hz-ctrl { display: flex; gap: 12px; justify-content: center; margin: 10px 0; } .hz-ctrl button { width: 54px; height: 48px; padding: 0; } .hz-ctrl .ic { width: 1.4rem; height: 1.4rem; margin: 0; }
.hz-tabs { display: flex; gap: 8px; justify-content: center; margin: 6px 0; } .hz-tab { font-family: var(--hanzi); font-size: 1.6rem; padding: 4px 14px; } .hz-tab.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }

.hz-box { touch-action: none; user-select: none; }
.hz-guide { fill: var(--line); opacity: .7; }
.hz-user { fill: none; stroke: var(--fg); stroke-width: 44; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.hz-pad { cursor: crosshair; }
.hz-modes { display: flex; gap: 8px; justify-content: center; margin: 4px 0 6px; } .hz-mode { padding: 6px 18px; border-radius: 999px; } .hz-mode.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.hz-msg { min-height: 1.4em; text-align: center; font-weight: 600; } .hz-msg.ok { color: var(--ok); } .hz-msg.bad { color: var(--bad); }
.hz-ctrl button.on { background: var(--lemon); }
.hz-ctrl .hz-next { width: auto; padding: 0 16px; }

/* ===== Chủ đề giao diện và hình nền ===== */
body { background-color: var(--bg); }
#bgfx { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; background-repeat: no-repeat; pointer-events: none; }
#bgdim { position: absolute; inset: 0; background: var(--bg); }
html[data-bgimg="1"] { --card: rgba(255, 255, 255, .88); }
html[data-bgimg="1"][data-theme="dark"] { --card: rgba(26, 22, 34, .84); }
html[data-bgimg="1"][data-skin="dem-sao"] { --card: rgba(23, 31, 63, .86); }
html[data-bgimg="1"] .bar, html[data-bgimg="1"] .tabbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
html[data-bgimg="1"] .opt-card, html[data-bgimg="1"] .hcard, html[data-bgimg="1"] .panel, html[data-bgimg="1"] .journey { backdrop-filter: blur(4px); }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.skin { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; text-align: left; } .skin.on { outline: 2px solid var(--red); }
.skin .dots { display: flex; gap: 4px; } .skin .dots i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .12); }
.bgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.bgt { min-height: 64px; padding: 6px; font-size: .8rem; text-align: center; background-size: cover; background-position: center; position: relative; overflow: hidden; } .bgt.on { outline: 2px solid var(--red); }
.bgt.thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; background: rgba(0, 0, 0, .45); color: #fff; font-size: .72rem; }
.dimrow { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; font-size: .9rem; } .dimrow input { width: 100%; accent-color: var(--red); }
.helplist details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card, 12px); padding: 10px 14px; margin-bottom: 8px; } .helplist summary { cursor: pointer; font-weight: 600; } .helplist p { margin: 8px 0 2px; line-height: 1.55; font-size: .92rem; }

/* ===== Hướng dẫn sử dụng từng bước ===== */
#tour { position: fixed; inset: 0; z-index: 50; }
.tspot { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 10, 8, .62); transition: all .25s ease; pointer-events: none; }
.tcard { position: absolute; width: min(330px, calc(100vw - 24px)); background: var(--card, #fff); color: var(--fg); border-radius: 16px; padding: 14px 16px 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .35); border: 1px solid var(--line); }
html[data-bgimg="1"] .tcard { background: var(--bg); }
.tcard b { display: block; font-family: var(--serif, inherit); font-size: 1.1rem; margin-bottom: 4px; padding-right: 64px; } .tcard p { margin: 0 0 10px; line-height: 1.5; font-size: .93rem; }
.tskip { position: absolute; top: 10px; right: 10px; padding: 4px 10px; font-size: .8rem; background: transparent; box-shadow: none; color: var(--muted); border-color: var(--line); }
.tdots { display: flex; gap: 5px; margin-bottom: 10px; } .tdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .tdots i.on { background: var(--red); }
.trow { display: flex; gap: 8px; justify-content: flex-end; }

/* nút cỡ lớn (khác với chữ Hán cỡ lớn .big) */
button.big { font-size: 1.05rem; line-height: 1.3; padding: 14px 20px; font-weight: 700; }
.row.stack { flex-direction: column; align-items: stretch; } .row.stack button { width: 100%; }
.extime { font-variant-numeric: tabular-nums; color: var(--red); }
.opt.sel { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.opts.one .opt { text-align: left; }
.exgrid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; } .exn { width: 36px; height: 36px; padding: 0; border-radius: 10px; font-size: .85rem; } .exn.done { background: var(--mint); } .exn.cur { outline: 2px solid var(--red); }
.exscore { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 6px 0; } .exscore b { font-family: var(--serif, inherit); font-size: 3.4rem; color: var(--red); line-height: 1; } .exscore span { color: var(--muted); }
.exsec { display: grid; gap: 8px; margin: 12px auto; max-width: 420px; text-align: left; } .exsec > div { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: center; font-size: .9rem; }
.exbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; } .exbar i { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.exrev { display: grid; gap: 8px; margin-top: 10px; } .exr { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); } .exr p { margin: 4px 0; } .exr.ok { border-left: 4px solid var(--ok); } .exr.no { border-left: 4px solid var(--bad); }

/* ===== Thành ngữ, tục ngữ, truyện ===== */
.cylist { display: grid; gap: 8px; margin-top: 10px; }
.cyitem { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card, 12px); padding: 0 14px; }
.cyitem summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 12px 0; } .cyitem summary::-webkit-details-marker { display: none; }
.cyz { font-family: var(--hanzi); font-size: 1.6rem; line-height: 1.3; } .cyz.sm { font-size: 1.15rem; } .cyitem summary small { color: var(--muted); } .cyitem summary em { font-style: normal; color: var(--fg); font-size: .95rem; }
.cyitem[open] summary { border-bottom: 1px dashed var(--line); } .cyd { padding: 6px 0 12px; } .cyd p { margin: 6px 0; line-height: 1.55; font-size: .93rem; }
.cyex { background: var(--lav); border-radius: 12px; padding: 8px 12px; cursor: pointer; } .cyex small { display: block; color: var(--muted); }
.stv { margin: 0 0 8px 34px; color: var(--muted); font-size: .92rem; line-height: 1.5; }

/* Khi có hình nền, đặt một lớp mờ phía sau nội dung để chữ luôn dễ đọc */
html[data-bgimg="1"] #app { background: color-mix(in srgb, var(--bg) 68%, transparent); border-radius: 18px; min-height: 100vh; }

/* ===== Công tắc và khung tài khoản ===== */
.sw { position: relative; display: inline-block; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); transition: background .2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .2s; }
.sw.on { background: var(--red); } .sw.on i { left: 23px; }
.mebtn.swrow > span:first-child { display: inline-flex; }
.acinfo { display: grid; gap: 2px; margin: 4px 0 12px; } .acinfo b { margin-bottom: 8px; word-break: break-all; }
.acct-bg .tabs { margin-top: 0; }

/* ===== Phối màu tự chọn ===== */
.custompal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card, 12px); padding: 4px 14px 14px; margin-bottom: 12px; }
.cprow { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0; } .cprow label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); }
.cprow input[type="color"] { width: 64px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; } .preset span { display: flex; } .preset i { width: 22px; height: 22px; display: inline-block; border: 1px solid rgba(0, 0, 0, .12); } .preset i:first-child { border-radius: 8px 0 0 8px; } .preset i:last-child { border-radius: 0 8px 8px 0; } .preset small { font-size: .72rem; }

/* Luyện thi: bộ đề, chip, ô gõ */
.setgrid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.setchip { min-width: 46px; min-height: 46px; padding: 4px 8px; border-radius: 12px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-weight: 700; line-height: 1.1; }
.setchip small { font-size: .65rem; font-weight: 600; color: var(--muted); }
.setchip .starrow { font-size: .6rem; }
.setchip.done { background: var(--mint); }
.setchip.mock { min-width: 52px; }
.setchip.mock.pass { background: var(--mint); border-color: var(--ok); }
.setchip.mock.done { background: var(--lemon); }
.tcard2 { border: 1px solid var(--line); border-radius: var(--r-card, 12px); padding: 12px 14px; margin: 0 0 10px; background: var(--card, transparent); }
.tcard2 .tc-h { display: flex; flex-direction: column; gap: 2px; }
.tcard2 .tc-h small { color: var(--muted); }
.unit i { margin-left: auto; color: var(--muted); display: inline-flex; }
.exin { width: 100%; box-sizing: border-box; font-size: 1.4rem; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--fg); font-family: var(--hanzi); }.tiername { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 2px; }
.tiername small { color: var(--muted); }
.tier { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); }
.tier.t0 { background: var(--mint); } .tier.t1 { background: var(--lemon); } .tier.t2 { background: var(--peach); }button.sure { background: var(--bad); color: #fff; border-color: var(--bad); }
.gdet { border: 1px solid var(--line); border-radius: var(--r-card, 12px); margin: 0 0 8px; padding: 0 14px; }
.gdet summary { cursor: pointer; padding: 12px 0; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.gdet summary::-webkit-details-marker { display: none; }
.gdet summary small { color: var(--muted); }
.gdet[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.gdet .gzh { font-family: var(--hanzi); font-size: 1.1rem; }
.gdet .ex { padding: 6px 0; cursor: pointer; } .gdet .ex small { display: block; color: var(--muted); }
.gdet .exz { font-family: var(--hanzi); font-size: 1.2rem; }

/* Màn chúc mừng, nhiệm vụ */
.cel { position: fixed; inset: 0; z-index: 90; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; align-items: center; padding: 24px 18px 22px; overflow: auto; animation: celin .25s ease; }
@keyframes celin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cel.purple { background: linear-gradient(#8b5cd6, #6a3fb8); color: #fff; }
.cel-in { flex: 1; width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.cel-art { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--lemon); color: var(--gold); margin-bottom: 8px; }
.cel-art .ic { width: 64px; height: 64px; stroke-width: 1.6; }
.cel-art.big { width: 150px; height: 150px; background: rgba(255,255,255,.18); color: #ffd84d; } .cel-art.big .ic { width: 84px; height: 84px; }
.cel-art.flame { flex-direction: column; background: #fff1dc; color: #f08a1c; position: relative; } .cel-art.flame b { position: absolute; bottom: 14px; font-size: 1.6rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cel-art.ice { background: #e3f3ff; color: #2aa0ee; }
.cel-t { font-size: 1.7rem; line-height: 1.25; margin: 4px 0; } .cel-t.gold { color: var(--gold); } .cel-t.orange { color: #f08a1c; } .blue { color: #2aa0ee; }
.cel-s { color: var(--muted); margin: 0; font-size: 1.05rem; line-height: 1.5; } .cel.purple .cel-s { color: rgba(255,255,255,.9); }
.cel-badge { background: var(--lemon); border: 2px solid var(--gold); border-radius: 12px; padding: 6px 22px; font-weight: 700; }
.cstats { display: flex; gap: 10px; margin-top: 22px; width: 100%; }
.cs { flex: 1; border-radius: 14px; border: 2px solid; overflow: hidden; background: var(--card, #fff); }
.cs b { display: block; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: #fff; padding: 5px 4px; }
.cs span { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 14px 4px; font-size: 1.25rem; font-weight: 800; }
.cs.p { border-color: #b57bee; } .cs.p b { background: #b57bee; } .cs.p span { color: #9a55d8; }
.cs.g { border-color: #58cc02; } .cs.g b { background: #58cc02; } .cs.g span { color: #46a302; }
.cs.b { border-color: #1cb0f6; } .cs.b b { background: #1cb0f6; } .cs.b span { color: #1899d6; }
.cel-foot { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cel-dots { display: flex; gap: 6px; min-height: 8px; } .cel-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .cel-dots i.on { background: var(--red); } .cel.purple .cel-dots i { background: rgba(255,255,255,.35); } .cel.purple .cel-dots i.on { background: #fff; }
.cel-btn { width: 100%; padding: 15px; border-radius: 14px; border: 0; background: var(--red); color: var(--on-red, #fff); font-weight: 800; font-size: 1.05rem; letter-spacing: .03em; text-transform: uppercase; box-shadow: 0 4px 0 rgba(0,0,0,.22); }
.cel.purple .cel-btn { background: #fff; color: #6a3fb8; }
.wkrow { display: flex; gap: 8px; margin-top: 18px; } .wkrow div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wkrow span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; } .wkrow .on span { background: #f08a1c; border-color: #f08a1c; color: #fff; } .wkrow .now span { outline: 2px solid var(--red); outline-offset: 2px; } .wkrow small { color: var(--muted); }
.wkrow .ic { width: 18px; height: 18px; }
.qpanel { width: 100%; border: 1px solid var(--line); border-radius: var(--r-card, 12px); overflow: hidden; text-align: left; margin: 6px 0 10px; background: var(--card, transparent); }
.qrow { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; } .qrow:last-child { border-bottom: 0; }
.qrow b { grid-column: 1 / -1; } .qrow.ok { background: var(--mint); }
.qbar { position: relative; height: 22px; border-radius: 999px; background: var(--line); overflow: hidden; } .qbar i { position: absolute; inset: 0 auto 0 0; background: #f59a23; border-radius: 999px; } .qbar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; font-weight: 800; }
.qrow.ok .qbar i { background: #58cc02; }
.qch { display: flex; flex-direction: column; align-items: center; color: #d98a14; } .qch .ic { width: 26px; height: 26px; } .qch small { font-weight: 700; }
.qmonth { width: 100%; text-align: left; border: 2px solid #f59a23; border-radius: var(--r-card, 12px); padding: 12px 14px; background: var(--lemon); color: var(--fg); margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; } .qmonth small { opacity: .8; }
html[data-theme="dark"] .qmonth, html.dark .qmonth { background: #3a2a12; color: #ffd89a; }
.boostbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #8b5cd6; color: #fff; font-weight: 700; margin-bottom: 8px; }
.chip.boost { background: #8b5cd6; color: #fff; border-color: #8b5cd6; }

/* Trang streak: lịch, mục tiêu, bạn bè */
button.chip { cursor: pointer; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.skhero { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.skn { display: block; font-size: 4rem; line-height: 1; color: #f06a2a; font-family: var(--serif); } .skl { font-size: 1.5rem; font-weight: 800; color: #f06a2a; }
.skfl { width: 110px; height: 110px; display: grid; place-items: center; border-radius: 50%; background: var(--lemon); color: #f08a1c; } .skfl .ic { width: 70px; height: 70px; } .skfl.off { color: var(--muted); filter: grayscale(1); }
.skmile { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card, 12px); margin-bottom: 8px; } .skmile .ic { width: 34px; height: 34px; color: #f08a1c; flex: none; }
.calbox { border: 1px solid var(--line); border-radius: var(--r-card, 12px); padding: 12px 10px; background: var(--card, transparent); }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calwd, .calrow { display: grid; grid-template-columns: repeat(7, 1fr); } .calwd span { text-align: center; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal { height: 38px; display: grid; place-items: center; margin: 3px 0; font-weight: 700; color: var(--muted); position: relative; }
.cal.on, .cal.ice { color: #fff; } .cal.on { background: linear-gradient(#f9742f, #f59a23); } .cal.ice { background: #4cb4f0; }
.cal.on, .cal.ice { border-radius: 999px; } .cal.l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .cal.r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal.now:not(.on) { outline: 2px solid var(--red); outline-offset: -3px; border-radius: 999px; color: var(--fg); } .cal:not(.on):not(.ice):not(.fut) { color: var(--fg); }
.cal .ic { width: 18px; height: 18px; }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; } .legend.on { background: #f59a23; } .legend.ice { background: #4cb4f0; }
.goals { display: grid; gap: 8px; } .goal { display: grid; grid-template-columns: 70px 1fr 24px; gap: 10px; align-items: center; } .goal .ic { color: #f08a1c; width: 22px; height: 22px; } .goal.ok .ic { color: #46a302; } .goal.ok .qbar i { background: #58cc02; }
.fradd { display: flex; gap: 8px; } .fradd input { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--fg); font-size: 1rem; }
.frlist { border: 1px solid var(--line); border-radius: var(--r-card, 12px); overflow: hidden; }
.frow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); } .frow:last-child { border-bottom: 0; } .frow.me { background: var(--mint); }
.frow .fn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .frow .fn small { color: var(--muted); }
.fav { width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: var(--on-red, #fff); display: grid; place-items: center; font-weight: 800; flex: none; }
.fstreak { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--muted); } .fstreak.on { color: #f08a1c; } .fstreak .ic { width: 20px; height: 20px; }

/* Bảng tin, nhắn tin */
.tabbar .badge, .badge { font-style: normal; background: #e5322d; color: #fff; border-radius: 999px; font-size: .65rem; min-width: 16px; height: 16px; display: inline-grid; place-items: center; padding: 0 4px; font-weight: 800; }
.tabbar button > span { position: relative; } .tabbar button > span .badge { position: absolute; top: -4px; right: -8px; }
.frow.thread { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.compose { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; } .compose textarea { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--fg); font: inherit; resize: vertical; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.post { border-bottom: 1px solid var(--line); padding: 14px 0; }
.post .ph { display: flex; align-items: center; gap: 10px; } .post .ph > div:not(.fav):not(.pdel) { flex: 1; display: flex; flex-direction: column; } .post .ph small { color: var(--muted); }
.post .pb { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; } .post .pb p { margin: 0; font-size: 1.15rem; line-height: 1.45; flex: 1; word-break: break-word; }
.pa { display: flex; flex-direction: column; align-items: center; color: #f08a1c; min-width: 84px; } .pa .ic { width: 56px; height: 56px; } .pa b { font-size: 1.8rem; line-height: 1; } .pa.tr { color: var(--gold); }
.pact { display: flex; gap: 8px; } .pact .rtool.on { color: #e5322d; border-color: #e5322d; } .pact .ic { vertical-align: -.2em; }
.plikes { color: var(--muted); margin-top: 8px; font-size: .9rem; }
.chatmsgs { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; min-height: 160px; overflow-y: auto; padding: 8px 2px; }
.cm { max-width: 80%; padding: 9px 13px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; display: flex; flex-direction: column; gap: 2px; word-break: break-word; } .cm small { color: var(--muted); font-size: .7rem; }
.cm.me { align-self: flex-end; background: var(--red); color: var(--on-red, #fff); border-color: var(--red); } .cm.me small { color: rgba(255,255,255,.8); }
.cm.sys { align-self: center; max-width: 100%; flex-direction: row; align-items: center; gap: 6px; background: var(--lemon); color: var(--fg); } .cm.sys .ic { color: #f08a1c; }
.cm.gift { flex-direction: row; align-items: center; gap: 12px; background: #8b5cd6; color: #fff; border-color: #8b5cd6; } .cm.gift .ic { width: 34px; height: 34px; } .cm.gift div { display: flex; flex-direction: column; gap: 4px; } .cm.gift small { color: rgba(255,255,255,.9); }
.chatbar { display: flex; gap: 8px; margin: 8px 0; } .chatbar input { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--fg); font-size: 1rem; }
.cel-sec { width: 100%; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: transparent; color: inherit; font-weight: 700; } .cel.purple .cel-sec { border-color: rgba(255,255,255,.5); color: #fff; }
.tabs { flex-wrap: wrap; }

/* Giữ cố định thanh trên và thanh dưới khi cuộn (backdrop-filter trên #app từng làm thanh dưới trôi theo nội dung) */
.gamebar { position: sticky; top: 0; z-index: 4; background: var(--bg); }
.tabbar { position: fixed !important; }
/* Thanh thương hiệu ở trang chủ: cố định khi cuộn, phủ kín bề ngang khung để không bị lộ góc */
header.top { position: sticky; top: 0; z-index: 4; margin: -16px -16px 10px; padding: 14px 16px 8px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-radius: 18px 18px 0 0; }

/* Phong cách riêng của app: con dấu son, thẻ phẳng có chữ Hán, màu theo giao diện đang chọn (thay cho kiểu Duolingo) */
.cel { background: var(--bg); color: var(--fg); }
.cel.purple { background: var(--red); color: var(--on-red, #fff); }
.cel-t { font-family: var(--serif); font-weight: 800; letter-spacing: .01em; }
.cel-t.gold { color: var(--gold); } .cel-t.orange { color: var(--red); }
.cel.purple .cel-t, .cel.purple .cel-s { color: var(--on-red, #fff); }
.cel-seal { width: 104px; height: 104px; display: grid; place-items: center; border: 3px solid var(--red); border-radius: 14px; color: var(--red); font-family: var(--hanzi); font-size: 3.6rem; line-height: 1; transform: rotate(-5deg); margin-bottom: 10px; position: relative; }
.cel-seal::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--red); border-radius: 9px; opacity: .45; }
.cel.purple .cel-seal { border-color: var(--on-red, #fff); color: var(--on-red, #fff); } .cel.purple .cel-seal::after { border-color: var(--on-red, #fff); }
.cstats { gap: 10px; }
.cs { border: 1px solid var(--line); border-radius: var(--r-card, 12px); background: var(--card); position: relative; overflow: visible; text-align: left; padding: 10px 12px 12px; }
.cs em { position: absolute; right: 8px; top: 4px; font-style: normal; font-family: var(--hanzi); font-size: 1.5rem; color: var(--gold); opacity: .35; }
.cs b { background: transparent !important; color: var(--muted); padding: 0; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.cs span { display: block; padding: 6px 0 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 800; justify-content: flex-start; }
.cs.p { border-color: var(--line); } .cs.p span { color: var(--gold); }
.cs.g { border-color: var(--line); } .cs.g span { color: var(--ok, #3b9a5b); }
.cs.b { border-color: var(--line); } .cs.b span { color: var(--red); }
.cel-btn { background: var(--red); color: var(--on-red, #fff); border-radius: var(--r-btn, 12px); box-shadow: none; text-transform: none; letter-spacing: 0; font-size: 1.05rem; }
.cel.purple .cel-btn { background: var(--bg); color: var(--fg); }
.cel-sec { border-width: 1px; border-radius: var(--r-btn, 12px); }
.cel-art { background: var(--lemon); color: var(--red); } .cel-art.flame { background: var(--lemon); color: var(--red); } .cel-art.ice { background: var(--mint); color: #3b8a99; }
.cel-badge { background: transparent; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; }
.wkrow .on span { background: var(--red); border-color: var(--red); } .wkrow .now span { outline-color: var(--gold); }
.qbar i { background: var(--gold); } .qrow.ok .qbar i, .goal.ok .qbar i { background: var(--ok, #3b9a5b); }
.qch, .goal .ic, .skmile .ic { color: var(--gold); }
.qmonth { border-color: var(--gold); }
.boostbar, .chip.boost { background: var(--gold); color: #1d1408; border-color: var(--gold); }
.skn, .skl { color: var(--red); } .skfl { color: var(--red); }
.cal.on { background: var(--red); color: var(--on-red, #fff); } .cal.ice { background: #4f98a3; }
.legend.on { background: var(--red); } .legend.ice { background: #4f98a3; }
.pa { color: var(--red); } .pa.tr { color: var(--gold); }
.fstreak.on { color: var(--red); }
.cm.gift { background: var(--red); border-color: var(--red); color: var(--on-red, #fff); }
.pact .rtool.on { color: var(--red); border-color: var(--red); }
.badge { background: var(--red); }

/* Trò chơi mới: Đoán Pinyin, Săn Chữ, Ghép Hai Nửa, Nối Đuôi, Đập Yêu Quái, Tìm Chữ Chung */
.wd { display: grid; gap: 6px; margin: 10px auto; max-width: 340px; } .wdr { display: grid; gap: 6px; }
.wc { height: 44px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; font-weight: 800; font-size: 1.3rem; text-transform: uppercase; background: var(--card); }
.wc.ok { background: var(--ok, #3b9a5b); border-color: var(--ok, #3b9a5b); color: #fff; } .wc.mid { background: var(--gold); border-color: var(--gold); color: #1d1408; } .wc.no { background: var(--line); border-color: var(--line); color: var(--muted); }
.sg { display: grid; gap: 4px; touch-action: none; user-select: none; margin: 8px 0; }
.sc { aspect-ratio: 1; padding: 0; font-family: var(--hanzi); font-size: 1.5rem; border-radius: 10px; background: var(--card); border: 1px solid var(--line); touch-action: none; }
.sc.sel { background: var(--gold); color: #1d1408; } .sc.done { background: var(--ok, #3b9a5b); color: #fff; border-color: var(--ok, #3b9a5b); }
.sglist { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .sgi { padding: 6px 10px; border-radius: 999px; font-size: .85rem; } .sgi.ok { background: var(--mint); border-color: var(--ok, #3b9a5b); }
.dm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; } .dmc { display: flex; flex-direction: column; gap: 8px; }
.dmt { padding: 12px 8px; font-family: var(--hanzi); font-size: 1.15rem; line-height: 1.35; border-radius: 12px; } .dmt.on { background: var(--gold); color: #1d1408; border-color: var(--gold); } .dmt.good { background: var(--mint); border-color: var(--ok, #3b9a5b); opacity: .75; }
.shake { animation: shk .35s; } @keyframes shk { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.chain { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 6px 0; } .cn { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--hanzi); background: var(--card); } .cn.now { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); } .ar { color: var(--muted); font-style: normal; }
.zhq { font-family: var(--hanzi); font-size: 1.6rem; color: var(--red); }
.tbar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0; } .tbar i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width .1s linear; }
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0; } .hole { aspect-ratio: 1.1; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, rgba(0,0,0,.45), rgba(0,0,0,.12) 70%); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.mon { width: 82%; aspect-ratio: 1; border-radius: 50% 50% 40% 40%; background: var(--red); color: var(--on-red, #fff); font-family: var(--hanzi); font-size: 1.25rem; font-weight: 700; border: 0; animation: pop .25s ease-out; padding: 2px; } @keyframes pop { from { transform: translateY(80%) scale(.7); } to { transform: none; } }
.mon.whack { background: var(--ok, #3b9a5b); transform: scale(.85); } .mon.bad { background: var(--bad, #c0392b); opacity: .6; } .mon.show { outline: 3px solid var(--gold); }
.opt .kp { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); } .opt.same { opacity: .8; }
.holes { max-width: 360px; margin: 12px auto; gap: 8px; } .sg { max-width: 420px; margin: 8px auto; } .dm { max-width: 520px; margin: 8px auto; }

/* Đập Yêu Quái: hang đất nhỏ, yêu quái nhiều màu có sừng, mắt, nanh và bảng gỗ ghi chữ */
.holes { max-width: 380px; margin: 14px auto; gap: 10px 8px; }
.hole { position: relative; aspect-ratio: 1; border: 0; border-radius: 0; background: transparent; display: block; overflow: hidden; }
.hole::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 2%; height: 20%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #2a1a0e 35%, #6b4a2f 75%); }
.mon { position: absolute; left: 10%; right: 10%; bottom: 8%; width: auto; aspect-ratio: auto; height: 86%; border-radius: 0; background: transparent; border: 0; padding: 0; color: #c8553d; animation: pop2m .22s ease-out; font-size: inherit; }
.mon.c1 { color: #3f8f7b; } .mon.c2 { color: #7a5aa6; } .mon.c3 { color: #b58a2a; }
@keyframes pop2m { from { transform: translateY(70%); } to { transform: none; } }
.mon .msvg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mon .plq { position: absolute; left: 14%; right: 14%; bottom: 7%; padding: 2px 0; background: #f1dfae; border: 2px solid #5a3b1d; border-radius: 6px; color: #2a1810; font-family: var(--hanzi); font-weight: 700; font-size: 1.05rem; line-height: 1.25; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.mon.whack { background: transparent; transform: scale(.8) rotate(-12deg); filter: grayscale(.9) brightness(1.1); opacity: .8; transition: .25s; }
.mon.bad { background: transparent; animation: shk .35s; opacity: .7; }
.mon.show { outline: 0; filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 3px var(--gold)); }

/* Đập Yêu Quái: búa, mặt choáng, sao xoay, chữ BỐP và rung màn hình */
.holes { position: relative; }
.holes .mon { cursor: inherit; }
.msvg .xe, .msvg .te, .msvg .mh, .msvg .mt, .msvg .stars { display: none; }
.msvg .stars { transform-box: fill-box; transform-origin: 50% 70%; }
.mon.whack, .mon.wrongone { filter: none; opacity: 1; background: transparent; animation: squash .35s forwards, sinkm .4s .75s forwards; }
.mon.whack .ey, .mon.whack .mo { display: none; } .mon.whack .xe, .mon.whack .mh, .mon.whack .stars { display: block; }
.mon.whack .stars { animation: spinst 1s linear infinite; }
.mon.taunt .ey, .mon.laugh .ey, .mon.taunt .mo, .mon.laugh .mo { display: none; } .mon.taunt .te, .mon.laugh .te, .mon.taunt .mt, .mon.laugh .mt { display: block; }
.mon.taunt { animation: bob .18s 3, sinkm .4s .6s forwards; }
.mon.laugh:not(.taunt) { animation: bob .18s 6; }
.mon.show { filter: drop-shadow(0 0 7px var(--gold)); }
@keyframes squash { 0% { transform: none; } 25% { transform: scale(1.18, .55); } 60% { transform: scale(.95, .8) rotate(-6deg); } 100% { transform: scale(.92, .85) rotate(-8deg); } }
@keyframes sinkm { to { transform: translateY(120%) scale(.9); } }
@keyframes bob { 50% { transform: translateY(-8%) rotate(3deg); } }
@keyframes spinst { to { transform: rotate(360deg); } }
.hammer { position: absolute; width: 64px; height: 64px; margin-left: -32px; pointer-events: none; z-index: 6; opacity: 0; transform-origin: 50% 92%; animation: hmr .62s ease-in forwards; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.hammer svg { width: 100%; height: 100%; }
@keyframes hmr { 0% { opacity: 0; transform: translate(40px, -56px) rotate(75deg); } 15% { opacity: 1; } 32% { opacity: 1; transform: translate(-2px, -2px) rotate(-28deg); } 46% { transform: translate(-2px, 2px) rotate(-22deg); } 100% { opacity: 0; transform: translate(6px, -22px) rotate(12deg); } }
.burst { position: absolute; z-index: 7; transform: translate(-50%, -50%); pointer-events: none; font: 800 1.7rem var(--serif); color: #ffd84d; text-shadow: -2px -2px 0 #7a2a10, 2px -2px 0 #7a2a10, -2px 2px 0 #7a2a10, 2px 2px 0 #7a2a10; white-space: nowrap; animation: bst .72s ease-out forwards; }
.burst.bad { color: #ff8a7a; }
@keyframes bst { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.3) rotate(-10deg); } 22% { opacity: 1; transform: translate(-50%, -60%) scale(1.3) rotate(4deg); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1) rotate(0); } }
.holes.jolt { animation: jolt .25s; } @keyframes jolt { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, 0); } }

/* Búa lên cấp theo chuỗi đập đúng: gỗ, sắt, vàng */
.combo { font-weight: 700; color: var(--muted); } .combo.l1 { color: #5a7388; } .combo.l2 { color: var(--gold); }
.hammer.l1 { filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)) saturate(.5) brightness(1.15); width: 78px; height: 78px; margin-left: -39px; }
.hammer.l2 { width: 92px; height: 92px; margin-left: -46px; filter: drop-shadow(0 0 8px #ffd84d) sepia(1) saturate(4) hue-rotate(-12deg) brightness(1.1); }

/* Hiệu ứng chung: linh vật, hạt lấp lánh */
#mascot { position: fixed; left: max(10px, calc(50% - 360px)); bottom: 18px; z-index: 70; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; animation: mpop .32s cubic-bezier(.2,1.4,.4,1); }
#mascot svg { width: 74px; height: 74px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
#mascot .mtxt { background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 5px 10px; font-weight: 800; font-size: .9rem; margin-bottom: 40px; white-space: nowrap; }
#mascot .f-ok, #mascot .f-cheer, #mascot .f-bad { display: none; }
#mascot.happy .f-ok, #mascot.cheer .f-cheer, #mascot.sad .f-bad { display: block; }
#mascot.cheer svg { animation: mjump .4s 2; } #mascot.sad svg { animation: mshake .4s; } #mascot.happy svg { animation: mjump .3s; }
@keyframes mpop { from { transform: translateY(40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mjump { 50% { transform: translateY(-14px) rotate(-6deg); } }
@keyframes mshake { 25% { transform: translateX(-5px) rotate(-5deg); } 75% { transform: translateX(5px) rotate(5deg); } }
.fxp { position: fixed; z-index: 80; width: 9px; height: 9px; margin: -4px 0 0 -4px; pointer-events: none; animation: fxfly .8s ease-out forwards; }
.fxp.spark { background: #ffd84d; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); width: 13px; height: 13px; }
.fxp.peach { background: #ff9ab0; border-radius: 50%; width: 11px; height: 11px; }
.fxp.dirt { background: #9a8470; border-radius: 40%; }
.fxp.conf { border-radius: 2px; width: 8px; height: 12px; }
@keyframes fxfly { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 30px)) rotate(var(--r)); } }
.coinline { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { #mascot, #mascot svg { animation: none; } }

/* Cửa hàng xu */
.chip.coin { color: var(--gold); border-color: var(--gold); }
.coinhero { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--gold); border-radius: var(--r-card, 12px); background: var(--lemon); margin-bottom: 10px; }
.coinhero .ch-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: #1d1408; display: grid; place-items: center; flex: none; } .coinhero .ch-ic .ic { width: 30px; height: 30px; }
.coinhero b { display: block; font-family: var(--serif); font-size: 1.8rem; } .coinhero small { color: var(--muted); }
.shoplist { display: grid; gap: 8px; }
.shopcard { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card, 12px); background: var(--card); }
.shopcard.eq { border-color: var(--ok, #3b9a5b); background: var(--mint); }
.shopcard .sart { width: 64px; height: 64px; display: grid; place-items: center; } .shopcard .sart svg { width: 100%; height: 100%; } .shopcard .sart.ic { border-radius: 14px; background: var(--lemon); color: var(--red); } .shopcard .sart.ic .ic { width: 34px; height: 34px; }
.shopcard .sface .f-ok { display: block; } .shopcard .sface .f-cheer, .shopcard .sface .f-bad { display: none; }
.shopcard .sinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .shopcard .sinfo small { color: var(--muted); }
.shopcard button { white-space: nowrap; }
@media (max-width: 420px) { .shopcard { grid-template-columns: 52px 1fr; } .shopcard button { grid-column: 1 / -1; } }

/* Chém Hoa Quả: quả vẽ SVG, tách đôi khi chém */
.peach { background: none; box-shadow: none; border-radius: 0; width: 76px; height: 76px; }
.peach::before { content: none; }
.peach .fr { position: absolute; inset: 0; pointer-events: none; } .peach .frsvg { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.peach span { position: relative; z-index: 2; font-size: 1.45rem; color: #fff; text-shadow: -1.5px -1.5px 0 #3a2412, 1.5px -1.5px 0 #3a2412, -1.5px 1.5px 0 #3a2412, 1.5px 1.5px 0 #3a2412; font-family: var(--hanzi); }
.peach.cut { animation: none; background: none; } .peach.bad { animation: none; background: none; filter: grayscale(1); opacity: .6; transition: .3s; }
.peach.cut .half.hl { clip-path: inset(0 50% 0 0); animation: halfl .7s ease-in forwards; } .peach.cut .half.hr { clip-path: inset(0 0 0 50%); animation: halfr .7s ease-in forwards; }
@keyframes halfl { to { transform: translate(-26px, 70px) rotate(-35deg); opacity: 0; } } @keyframes halfr { to { transform: translate(26px, 70px) rotate(35deg); opacity: 0; } }
.peach.cut span { animation: wfade .7s forwards; } @keyframes wfade { 60% { opacity: 1; } to { opacity: 0; transform: translateY(-18px) scale(1.2); } }
/* Mưa chữ: kiểu giọt mưa */
.field.rain-hoa .drop { background: #ffe0e8; border-color: #f4a8bc; border-radius: 60% 40% 60% 40%; } .field.rain-hoa .drop b { color: #a3254b; }
.field.rain-sao .drop { background: #1c2547; border-color: #ffd166; box-shadow: 0 0 12px rgba(255, 209, 102, .55); } .field.rain-sao .drop b { color: #ffe9a8; } .field.rain-sao .drop small { color: #b8c2ff; }
.field.rain-la .drop { background: #e3f3d9; border-color: #7fbf6a; border-radius: 4px 40px 4px 40px; } .field.rain-la .drop b { color: #27583a; }
/* Lật bài: mặt lưng */
.mcard.bk-sen .front, .mcard.bk-rong .front, .mcard.bk-phuc .front { font-family: var(--hanzi); font-size: 2.6rem; width: 100%; height: 100%; display: grid; place-items: center; border-radius: 10px; color: #fff3c0; }
.mcard.bk-sen .front { background: linear-gradient(135deg, #e06a9a, #8f3a78); } .mcard.bk-rong .front { background: linear-gradient(135deg, #2f8f7a, #14504a); } .mcard.bk-phuc .front { background: linear-gradient(135deg, #d4401f, #8a1f10); }
/* Hiệu ứng hạt mới */
.fxp.petal { background: #ffb3c8; border-radius: 60% 0 60% 0; width: 12px; height: 9px; } .fxp.coin { background: radial-gradient(circle, #fff3a0 30%, #f2b134 32%); border: 2px solid #b8861a; border-radius: 50%; width: 13px; height: 13px; box-sizing: border-box; } .fxp.juice { border-radius: 50%; width: 10px; height: 10px; }

/* Khung cảnh trang trí sau mỗi trò chơi: dùng nền trong suốt để chữ vẫn dễ đọc ở cả giao diện sáng và tối */
#gm { position: relative; isolation: isolate; border-radius: 16px; }
.gdecor { position: absolute; inset: -6px; z-index: -1; pointer-events: none; overflow: hidden; border-radius: 18px; }
.gdecor i { position: absolute; display: block; }
.sc-may { background: linear-gradient(rgba(140, 190, 235, .16), rgba(255, 255, 255, 0)); }
.sc-may i { width: calc(90px * var(--s)); height: calc(30px * var(--s)); border-radius: 30px; background: rgba(255, 255, 255, .55); box-shadow: calc(24px * var(--s)) calc(-12px * var(--s)) 0 rgba(255, 255, 255, .5), calc(-20px * var(--s)) calc(-6px * var(--s)) 0 rgba(255, 255, 255, .45); animation: cloudgo linear infinite; }
@keyframes cloudgo { from { transform: translateX(-120px); } to { transform: translateX(calc(100vw)); } }
.sc-dao { background: linear-gradient(rgba(255, 170, 200, .28), rgba(255, 240, 245, .05)); }
.sc-dao i { width: 11px; height: 8px; background: #ffb3c8; border-radius: 60% 0 60% 0; animation: petalfall linear infinite; top: -20px !important; }
@keyframes petalfall { from { transform: translate(0, -20px) rotate(0); } to { transform: translate(60px, 640px) rotate(540deg); } }
.sc-truc { background: linear-gradient(rgba(110, 180, 120, .26), rgba(240, 255, 240, .04)); }
.sc-truc::before, .sc-truc::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18px; background: repeating-linear-gradient(to bottom, rgba(60, 130, 70, .4) 0 70px, rgba(40, 100, 55, .5) 70px 76px); }
.sc-truc::before { left: 6%; } .sc-truc::after { right: 8%; width: 14px; }
.sc-truc i { width: 14px; height: 6px; background: #6fb56f; border-radius: 0 100% 0 100%; animation: petalfall linear infinite; top: -20px !important; }
.sc-thuy { background: linear-gradient(rgba(70, 150, 210, .3), rgba(180, 225, 250, .08)); }
.sc-thuy i { width: calc(9px * var(--s)); height: calc(9px * var(--s)); border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; animation: bubup linear infinite; }
@keyframes bubup { from { transform: translateY(40px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-620px); opacity: 0; } }
.sc-dem { background: linear-gradient(rgba(20, 28, 70, .5), rgba(60, 70, 130, .2)); }
.sc-dem::before { content: ""; position: absolute; right: 8%; top: 6%; width: 40px; height: 40px; border-radius: 50%; background: #fff3c0; box-shadow: 0 0 26px rgba(255, 243, 192, .7); }
.sc-dem i { width: calc(4px * var(--s)); height: calc(4px * var(--s)); background: #fff; border-radius: 50%; animation: twk ease-in-out infinite alternate; }
@keyframes twk { from { opacity: .15; } to { opacity: 1; } }
.sc-thien { background: linear-gradient(rgba(255, 224, 140, .3), rgba(255, 255, 255, .08)); }
.sc-thien i { width: calc(70px * var(--s)); height: calc(22px * var(--s)); border-radius: 22px; background: rgba(255, 215, 110, .5); box-shadow: calc(18px * var(--s)) calc(-9px * var(--s)) 0 rgba(255, 230, 150, .5); animation: cloudgo linear infinite; }
@media (prefers-reduced-motion: reduce) { .gdecor i { animation: none; } }

/* Cửa hàng: thẻ nhóm, xem trước */
.shoptabs { flex-wrap: nowrap; overflow-x: auto; gap: 6px; } .shoptabs button { white-space: nowrap; padding: 8px 12px; }
.shopcard .sart.sw { border-radius: 14px; border: 1px solid var(--line); }
.shopcard .sart.bkp { border-radius: 10px; font-family: var(--hanzi); font-size: 1.9rem; color: #fff3c0; width: 52px; height: 64px; margin: auto; background: linear-gradient(135deg, var(--red), var(--gold)); }
.shopcard .bkp.bk-sen { background: linear-gradient(135deg, #e06a9a, #8f3a78); } .shopcard .bkp.bk-rong { background: linear-gradient(135deg, #2f8f7a, #14504a); } .shopcard .bkp.bk-phuc { background: linear-gradient(135deg, #d4401f, #8a1f10); }
.shopcard .rainp { border-radius: 12px; font-family: var(--hanzi); font-size: 1.6rem; background: var(--card); border: 1px solid var(--line); width: 52px; height: 52px; margin: auto; }
.shopcard .rainp.r-la { background: #e3f3d9; border-color: #7fbf6a; border-radius: 4px 26px 4px 26px; color: #27583a; } .shopcard .rainp.r-hoa { background: #ffe0e8; border-color: #f4a8bc; border-radius: 60% 40% 60% 40%; color: #a3254b; } .shopcard .rainp.r-sao { background: #1c2547; border-color: #ffd166; color: #ffe9a8; box-shadow: 0 0 10px rgba(255, 209, 102, .5); }
.shopcard .sart.dots { display: flex; gap: 3px; align-items: center; justify-content: center; } .shopcard .sart.dots i { width: 16px; height: 34px; border-radius: 8px; display: block; }
.lockp { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-size: .75rem; } .lockp .ic { width: 14px; height: 14px; }
.goal.ach, .goal.wk { grid-template-columns: 1fr 120px 62px; } .goal .at { display: flex; flex-direction: column; } .goal .at small { color: var(--muted); } .goal .gg { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-weight: 800; justify-content: flex-end; } .goal .gg .ic { width: 18px; height: 18px; }
.goal.ok .gg { color: var(--ok, #3b9a5b); }
.wkq { margin-top: 8px; }
@media (max-width: 420px) { .goal.ach, .goal.wk { grid-template-columns: 1fr 90px 52px; } }

/* Giao diện tiệm bảo vật: mái ngói, đèn lồng, bảng hiệu, thẻ hàng có ruy băng */
.shopfront { position: relative; padding: 52px 14px 14px; border: 2px solid var(--gold); border-radius: var(--r-card, 12px); background: linear-gradient(var(--lemon), var(--card)); text-align: center; margin-bottom: 12px; overflow: hidden; }
.shopfront .roof { position: absolute; left: 0; top: 0; width: 100%; height: 46px; }
.shopfront .lantern { position: absolute; top: 40px; width: 22px; height: 28px; border-radius: 45%; background: radial-gradient(circle at 40% 35%, #ff8a70, var(--red) 70%); border: 2px solid var(--gold); transform-origin: 50% -30px; animation: sway 3.2s ease-in-out infinite; z-index: 2; }
.shopfront .lantern::before { content: ""; position: absolute; left: 50%; top: -28px; width: 2px; height: 28px; background: var(--gold); }
.shopfront .lantern::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 3px; height: 12px; background: var(--gold); transform: translateX(-50%); border-radius: 2px; }
.shopfront .lantern.l1 { left: 12px; } .shopfront .lantern.l2 { right: 12px; animation-delay: -1.6s; }
@keyframes sway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.shopfront .sign { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 22px; margin: 4px 0 8px; border: 2px solid var(--gold); border-radius: 10px; background: var(--card); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.shopfront .sz { font-family: var(--hanzi); font-size: 2.1rem; line-height: 1.1; color: var(--red); letter-spacing: .15em; } .shopfront .sign small { color: var(--muted); letter-spacing: .08em; }
.shopfront .bal { display: flex; align-items: center; justify-content: center; gap: 10px; } .shopfront .bal b { font-family: var(--serif); font-size: 2.3rem; color: var(--gold); line-height: 1; } .shopfront .bal em { font-style: normal; color: var(--muted); }
.shopfront .ch-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #1d1408; display: grid; place-items: center; animation: coinspin 4s linear infinite; } .shopfront .ch-ic .ic { width: 24px; height: 24px; }
@keyframes coinspin { 0%, 90% { transform: none; } 95% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
.shopfront .shnote { margin: 8px 0 0; color: var(--muted); font-size: .85rem; }
.shsec { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-size: 1rem; font-family: var(--serif); } .shsec i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); } .shsec i:last-child { background: linear-gradient(90deg, var(--gold), transparent); } .shsec span { color: var(--red); text-align: center; }
.shopcard { position: relative; transition: transform .15s, box-shadow .15s; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.shopcard:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.shopcard .rib { position: absolute; top: -1px; left: -1px; padding: 2px 10px 3px; font-size: .68rem; font-weight: 800; border-radius: var(--r-card, 12px) 0 10px 0; letter-spacing: .03em; }
.rib.own { background: var(--ok, #3b9a5b); color: #fff; } .rib.rare { background: var(--red); color: var(--on-red, #fff); }
.shopcard button.primary { background: linear-gradient(var(--gold), color-mix(in srgb, var(--gold) 75%, #8a5a00)); color: #1d1408; border-color: var(--gold); font-weight: 800; }
.shopcard .rtool.on { background: var(--mint); }
.shoptabs button { border-radius: 10px 10px 0 0; border-bottom: 3px solid transparent; } .shoptabs button.on { border-bottom-color: var(--gold); background: var(--lemon); color: var(--fg); font-weight: 800; }
.cont.shopbtn, .mebtn.shopme { border-color: var(--gold); background: linear-gradient(var(--lemon), var(--card)); } .cont.shopbtn > span, .mebtn.shopme > span { color: var(--gold); }
.hcard.shopcard2 { border-color: var(--gold); background: linear-gradient(var(--lemon), var(--card)); } .hcard.shopcard2 > span { color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .shopfront .lantern, .shopfront .ch-ic { animation: none; } }
.shopfront.coinhero { display: block; gap: 0; } .shopfront .shnote { max-width: 34em; margin-left: auto; margin-right: auto; }

/* Yêu quái vẽ SVG dùng chung (Đấu Yêu Quái, Đua Mây, Boss, Vượt Ải): nét mặt theo trạng thái */
.amon { display: inline-block; line-height: 0; width: 64px; height: 64px; vertical-align: middle; } .amon.sm { width: 40px; height: 40px; } .amon.big { width: 128px; height: 128px; }
.amon svg { width: 100%; height: 100%; }
.amon .xe, .amon .te, .amon .mh, .amon .mt, .amon .stars { display: none; } .amon .stars { transform-box: fill-box; transform-origin: 50% 70%; }
.amon.hurt .ey, .amon.hurt .mo { display: none; } .amon.hurt .xe, .amon.hurt .mh, .amon.hurt .stars { display: block; } .amon.hurt .stars { animation: spinst 1s linear infinite; }
.amon.laugh .ey, .amon.laugh .mo { display: none; } .amon.laugh .te, .amon.laugh .mt { display: block; } .amon.laugh { animation: bob .18s 5; }
.amon.dead { animation: deadm .8s forwards; } @keyframes deadm { to { transform: rotate(-70deg) translateY(30px) scale(.8); opacity: .25; } }
.monster { font-size: 1rem; display: flex; flex-direction: column; align-items: center; gap: 2px; } .monster .mname { color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.monster .amon.big { filter: drop-shadow(0 5px 6px rgba(0,0,0,.25)); }
/* Đua Mây */
.cl { font-size: 1rem; opacity: .85; } .cl .acloud { width: 60px; height: 28px; }
.lane .goal { font-size: 1rem; width: 40px; height: 40px; } .lane .goal .atemple { width: 100%; height: 100%; }
.runner { font-size: 1rem; width: 56px; height: 52px; } .runner .hero { position: absolute; left: 6px; top: -10px; width: 44px; height: 48px; z-index: 2; } .runner .hero svg { width: 100%; height: 100%; }
.runner.me i { left: 0; top: 18px; width: 56px; height: 28px; z-index: 1; } .runner.me i .anim { width: 100%; height: 100%; }
.runner.mon .amon { position: absolute; left: 4px; top: 2px; width: 44px; height: 44px; }
.ahero .f-cheer, .ahero .f-bad { display: none; } .ahero .f-ok { display: block; } .ahero.cheer .f-ok { display: none; } .ahero.cheer .f-cheer { display: block; }
.runner .trail { position: absolute; left: -30px; top: 22px; width: 0; height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255, 215, 110, .9)); opacity: 0; }
.runner.boost .trail { width: 46px; animation: trailfx .6s; } @keyframes trailfx { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
/* Vượt ải: hộ vệ từng ải */
.vst { gap: 2px; } .vst b { font-size: 1rem; } .vst .amon.sm { width: 34px; height: 34px; }
.vst:not(.now):not(.ok) .amon { filter: grayscale(.8) opacity(.55); }
/* Lò Ghép Chữ */
.pot { background: none; box-shadow: none; width: 150px; height: 96px; } .pot .apot { position: absolute; inset: 0; width: 100%; height: 100%; }
.pot i { position: relative; z-index: 2; margin-top: 18px; font-family: var(--hanzi); color: #fff3c0; text-shadow: -1px -1px 0 #1d2130, 1px 1px 0 #1d2130; }
.pot .flame { transform-origin: 60px 84px; animation: flick .5s ease-in-out infinite alternate; } @keyframes flick { from { transform: scaleY(.9); } to { transform: scaleY(1.12) scaleX(.96); } }
.pot .steam { top: -4px; width: 10px; height: 10px; border-radius: 50%; background: rgba(220, 235, 245, .8); animation: steamup 1.8s ease-out infinite; font-size: 0; opacity: 0; } .pot .steam.s1 { left: 38%; } .pot .steam.s2 { left: 50%; animation-delay: .6s; } .pot .steam.s3 { left: 62%; animation-delay: 1.2s; }
@keyframes steamup { 0% { transform: translateY(14px) scale(.5); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-34px) scale(1.6); opacity: 0; } }
.pot.pop .apot { animation: potpop .6s; }
/* Nổ Bóng: bóng xà phòng bóng loáng */
.bub { background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,.95) 0 8%, transparent 9%), radial-gradient(circle at 70% 78%, rgba(255,255,255,.55) 0 6%, transparent 7%); border-color: rgba(255,255,255,.9); }
.bub::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); pointer-events: none; }
.shopcard .sart.mons { display: flex; align-items: center; justify-content: center; } .shopcard .sart.mons .amon { width: 30px; height: 30px; margin: 0 -3px; }
.runner .hero svg { width: auto; height: auto; } .runner .hero > svg { width: 100%; height: 100%; } .runner .hero { width: 52px; height: 58px; top: -14px; left: 2px; }

/* Kiểu nút bấm, khung câu hỏi và hình nền cho các trò trắc nghiệm (mua ở cửa hàng) */
#gm[data-btn="ngoc"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="ngoc"] { background: radial-gradient(circle at 30% 25%, #b8f5de, #3fb892 60%, #1f8068); border: 2px solid #166652; color: #063c2e; font-weight: 800; border-radius: 14px; box-shadow: inset 0 3px 4px rgba(255,255,255,.55), 0 3px 0 #0f4a3a; }
#gm[data-btn="neon"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="neon"] { background: #10162f; border: 2px solid #5ee0ff; color: #bff4ff; font-weight: 700; border-radius: 10px; box-shadow: 0 0 10px rgba(94,224,255,.6), inset 0 0 8px rgba(94,224,255,.25); text-shadow: 0 0 6px rgba(94,224,255,.8); }
#gm[data-btn="truc"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="truc"] { background: linear-gradient(90deg, #e2d49a, #f6efcb 20%, #f6efcb 80%, #e2d49a); border: 2px solid #9a8a3a; color: #4a4010; font-weight: 700; border-radius: 4px; box-shadow: inset 9px 0 0 #cdbb62, inset -9px 0 0 #cdbb62, 0 2px 0 #7a6a20; }
#gm[data-btn="vang"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="vang"] { background: linear-gradient(#ffe88a, #e2b02a 55%, #c8901a); border: 2px solid #8a5a00; color: #3a2200; font-weight: 800; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 0 #8a5a00; }
#gm[data-btn="go"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="go"] { background: repeating-linear-gradient(95deg, rgba(120,70,20,.12) 0 3px, transparent 3px 9px), linear-gradient(#e0b073, #b9814a); border: 2px solid #7a4f24; color: #3a2210; font-weight: 700; border-radius: 10px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 0 #6a4220; }
#gm[data-btn="keo"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="keo"] { background: #ffd1e6; border: 0; color: #7a2a52; font-weight: 800; border-radius: 999px; box-shadow: 0 5px 0 #f09ac0, inset 0 -3px 0 rgba(255,255,255,.35); }
#gm[data-btn] :is(.opt, .tk, .dmt, .pbtn):active { transform: translateY(2px); }
#gm[data-btn] .opt.right { background: var(--ok) !important; color: #fff !important; border-color: var(--ok) !important; text-shadow: none !important; }
#gm[data-btn] .opt.wrong { background: var(--bad) !important; color: #fff !important; border-color: var(--bad) !important; text-shadow: none !important; }
#gm[data-btn] .opt.sel { outline: 3px solid var(--gold); }
#gm[data-btn] :is(.tk.used, .opt:disabled:not(.right):not(.wrong)) { opacity: .5; }
.btnprev { display: inline-block; padding: 8px 12px; font-size: .8rem; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
#gm[data-card="giay"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="giay"] { background: linear-gradient(#f8efd6, #f1e3bd); border: 0; border-top: 8px double #b9955a; border-bottom: 8px double #b9955a; border-radius: 6px; color: #3a2a10; }
#gm[data-card="giay"] :is(.qbox, .ask, .pot-card) :is(.py, .big, .bigvi, .big-vi, .zhline, .note, small, b) { color: inherit; }
#gm[data-card="go"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="go"] { background: repeating-linear-gradient(95deg, rgba(120,70,20,.12) 0 3px, transparent 3px 10px), linear-gradient(#d9aa6c, #bf8a50); border: 4px solid #7a4f24; border-radius: 8px; color: #2a1608; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
#gm[data-card="go"] :is(.qbox, .ask, .pot-card) :is(.py, .big, .bigvi, .big-vi, .zhline, .note, small, b) { color: inherit; }
#gm[data-card="lua"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="lua"] { background: linear-gradient(#c8402e, #8f2a1f); border: 3px solid #f2c230; border-radius: 10px; color: #fff3c0; box-shadow: inset 0 0 0 3px rgba(0,0,0,.18); }
#gm[data-card="lua"] :is(.qbox, .ask, .pot-card) :is(.py, .big, .bigvi, .big-vi, .zhline, .note, small, b) { color: inherit; }
.cardprev { display: grid; place-items: center; width: 56px; height: 48px; font-family: var(--hanzi); font-size: 1.6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
#gm[data-gbg] { padding: 10px; background: linear-gradient(color-mix(in srgb, var(--bg) 58%, transparent), color-mix(in srgb, var(--bg) 58%, transparent)), var(--gbg) center / cover no-repeat; border-radius: 16px; }


/* Kho đồ */
.shopfront .invbtn { position: absolute; right: 10px; top: 52px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--gold); background: var(--card); font-weight: 800; }
.invbadge { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--red); color: var(--on-red, #fff); font-size: .7rem; font-weight: 800; vertical-align: middle; }
.invhero .roof path { stroke-width: 2; }
.invacts { display: grid; gap: 8px; } .invact { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--gold); border-radius: var(--r-card, 12px); background: var(--lemon); } .invact.pass { border-color: var(--line); background: var(--card); }
.invact .ia { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #1d1408; display: grid; place-items: center; flex: none; } .invact.pass .ia { background: var(--sky); color: #3b8a99; } .invact .ia .ic { width: 22px; height: 22px; }
.invact div { display: flex; flex-direction: column; } .invact small { color: var(--muted); } .invact em { font-style: normal; font-weight: 800; color: var(--red); }
.invcard .sart { position: relative; } .invcard .cnt { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-weight: 800; font-size: .8rem; background: var(--red); color: var(--on-red, #fff); border-radius: 999px; padding: 1px 7px; }
.invempty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border: 2px dashed var(--line); border-radius: var(--r-card, 12px); color: var(--muted); text-align: center; } .invempty .ic { width: 38px; height: 38px; } .invempty p { margin: 0; }
.cont.invcont { border-color: var(--gold); } .cont.invcont > span { color: var(--gold); }
.chip.boost.gold { background: var(--red); border-color: var(--red); color: var(--on-red, #fff); }

/* Màn xem trước món hàng */
.shopcard[data-act="shop-info"] { cursor: pointer; }
.sheet.shopinfo { max-width: 460px; }
.shopinfo .dm-stage { position: relative; min-height: 150px; border: 1px solid var(--line); border-radius: var(--r-card, 12px); background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 8px 0; padding: 8px; }
.shopinfo .dm-stage.scenedemo { min-height: 170px; background: var(--bg); } .shopinfo .dm-stage .gdecor { inset: 0; z-index: 0; border-radius: 0; }
.shopinfo .dm-stage .peach.demo { position: relative; width: 104px; height: 104px; } .shopinfo .dm-stage .peach.demo span { font-size: 2rem; }
.shopinfo .dm-hint { position: relative; z-index: 2; color: var(--muted); font-size: .85rem; text-align: center; margin: 2px 0 6px; }
.shopinfo .dm-cards .mem { grid-template-columns: repeat(2, 90px); } .shopinfo .dm-cards .mcard { height: 112px; }
.shopinfo .raindemo { position: relative; height: 170px; display: block; } .shopinfo .raindemo .drop { position: absolute; transform: none; }
.shopinfo .hamdemo { min-height: 170px; } .shopinfo .hamdemo .hammer { z-index: 5; }
.shopinfo .monsdemo { gap: 6px; } .shopinfo .monsdemo .amon { width: 70px; height: 70px; cursor: pointer; }
.shopinfo .mdemo { width: 110px; height: 110px; } .mdemo .f-ok, .mdemo .f-cheer, .mdemo .f-bad { display: none; } .mdemo.happy .f-ok, .mdemo.cheer .f-cheer, .mdemo.sad .f-bad { display: block; } .mdemo.cheer svg { animation: mjump .4s 2; } .mdemo.sad svg { animation: mshake .4s; }
.shopinfo .dm-sound, .shopinfo .dm-icon { color: var(--red); } .shopinfo .dm-sound .ic, .shopinfo .dm-icon .ic { width: 64px; height: 64px; }
.shopinfo .gmdemo { width: 100%; } .shopinfo .skindemo { flex-direction: column; align-items: stretch; gap: 10px; min-height: 190px; border-radius: var(--r-card, 12px); }
.skindemo .sk-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--r-card, 12px); background: var(--card); border: 1px solid var(--line); } .skindemo .sk-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--gold); font-weight: 700; }
.skindemo .sk-card { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: var(--r-card, 12px); background: var(--card); border: 1px solid var(--line); } .skindemo .sk-card b { font-family: var(--hanzi); font-size: 2rem; } .skindemo .sk-card small { color: var(--muted); }
.skindemo .sk-row { display: flex; gap: 8px; } .skindemo .sk-btn { flex: 1; text-align: center; padding: 10px; border-radius: var(--r-btn, 12px); background: var(--red); color: var(--on-red, #fff); font-weight: 700; } .skindemo .sk-btn.ghost { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.si-note { margin: 6px 0; line-height: 1.5; } .si-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin: 4px 0; } .si-meta span { display: inline-flex; align-items: center; gap: 4px; } .si-meta .ic { width: 16px; height: 16px; color: var(--gold); }
.si-warn { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--lemon); color: var(--fg); font-size: .88rem; }
.shopinfo .row { margin-top: 10px; }

/* Chém Hoa Quả: vệt chém, vết cắt, vết nước ép */
.bladecv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.orchard .slash { display: none; }
.peach .cutline { position: absolute; left: -18%; right: -18%; top: 50%; height: 3px; margin-top: -1px; background: #fff; border-radius: 3px; box-shadow: 0 0 8px 3px rgba(255, 255, 255, .9); transform: rotate(var(--a, -.6rad)) scaleX(0); transform-origin: center; animation: cutl .55s ease-out forwards; z-index: 4; }
@keyframes cutl { 0% { transform: rotate(var(--a)) scaleX(0); opacity: 1; } 35% { transform: rotate(var(--a)) scaleX(1); opacity: 1; } 100% { transform: rotate(var(--a)) scaleX(1); opacity: 0; } }
.orchard .splat { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; pointer-events: none; opacity: .55; animation: splatf 2.6s ease-out forwards; z-index: 0; }
@keyframes splatf { 0% { transform: scale(.4); opacity: .8; } 15% { transform: scale(1); } 100% { transform: scale(1.1); opacity: 0; } }
.dm-stage .bladecv { z-index: 4; }
.shopcard .sart .bladeprev { width: 100%; height: 100%; } .shopinfo .bladedemo { min-height: 160px; }

/* Phòng chơi cùng nhau */
.rmhome { display: grid; gap: 10px; margin: 8px 0; }
.rmbig { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: var(--r-card, 12px); }
.rmbig > .ic { width: 34px; height: 34px; flex: none; } .rmbig span { display: flex; flex-direction: column; } .rmbig small { opacity: .8; font-weight: 400; }
.rmgames { display: grid; gap: 8px; } .rmgames.sel { grid-template-columns: 1fr 1fr; }
.rmg { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card, 12px); background: var(--card); text-align: left; }
.rmg.on { border-color: var(--gold); background: var(--lemon); box-shadow: 0 0 0 2px var(--gold); }
.rmg .gi { width: 36px; height: 36px; border-radius: 10px; background: var(--lemon); color: var(--red); display: grid; place-items: center; flex: none; } .rmg .gi .ic { width: 22px; height: 22px; }
.rmg small { color: var(--muted); display: block; } .rmg p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); } .rmg b { display: block; }
.rmcard { border: 1px solid var(--line); border-radius: var(--r-card, 12px); background: var(--card); padding: 12px 14px; margin: 8px 0; }
.rmhead { display: flex; flex-direction: column; gap: 8px; border-color: var(--gold); background: linear-gradient(var(--lemon), var(--card)); }
.rmcode { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .rmcode small { color: var(--muted); } .rmcode b { font-family: var(--serif); font-size: 2.1rem; letter-spacing: .18em; color: var(--red); } .lockb { font-style: normal; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .85rem; } .lockb .ic { width: 14px; height: 14px; }
.rmmeta { display: flex; flex-direction: column; } .rmmeta small { color: var(--muted); }
.rmplayers { display: grid; gap: 6px; } .rmp { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); } .rmp.me { border-color: var(--gold); } .rmp.out { opacity: .5; }
.rmp .fn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .rmp small { color: var(--muted); } .rmp .rsc { font-weight: 800; color: var(--gold); } .rmp .crown { color: var(--gold); } .rmp .crown .ic { width: 20px; height: 20px; }
.fav.t0 { background: #d4401f; } .fav.t1 { background: #3b5fc0; }
.rmact { margin-top: 12px; align-items: center; }
.bgboard { display: grid; gap: 6px; margin: 8px 0; }
.bgc { aspect-ratio: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-family: var(--hanzi); }
.bgc b { font-size: 1.45rem; font-weight: 600; } .bgc small { font-size: .62rem; color: var(--muted); font-family: system-ui, sans-serif; }
.bgc.empty { border-style: dashed; color: var(--muted); font-size: 1.4rem; background: transparent; }
.bgc.free { background: var(--lemon); border-color: var(--gold); color: var(--gold); } .bgc.free .ic { width: 22px; height: 22px; } .bgc.free small { color: var(--gold); }
.bgc.on { background: var(--mint); border-color: var(--ok, #3b9a5b); } .bgc.on b { opacity: .35; text-decoration: line-through; text-decoration-thickness: 2px; }
.bgc .stamp { position: absolute; inset: 0; display: grid; place-items: center; color: var(--red); font-style: normal; pointer-events: none; animation: stampin .25s ease-out; } .bgc .stamp .ic { width: 36px; height: 36px; stroke-width: 3; }
@keyframes stampin { from { transform: scale(2) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.bgpool { display: flex; flex-wrap: wrap; gap: 6px; } .bgw { display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 10px; min-width: 70px; font-family: var(--hanzi); } .bgw b { font-size: 1.2rem; font-weight: 600; } .bgw small { font-size: .65rem; color: var(--muted); font-family: system-ui, sans-serif; } .bgw i { font-style: normal; font-size: .65rem; color: var(--muted); font-family: system-ui, sans-serif; max-width: 80px; text-align: center; }
.bgw.sel { background: var(--gold); color: #1d1408; border-color: var(--gold); } .bgw.used { opacity: .3; }
.bgcall { text-align: center; } .bgbig { display: flex; flex-direction: column; align-items: center; margin: 4px 0; } .bgbig b { font-family: var(--hanzi); font-size: 3.4rem; line-height: 1.1; } .bgbig small { color: var(--muted); } .bgbig.listen { color: var(--red); } .bgbig.listen .ic { width: 64px; height: 64px; } .bgbig.wait { color: var(--muted); font-size: 1.4rem; } .bgbig.vi b { font-family: var(--serif); font-size: 1.8rem; }
.bgbingo { width: 100%; font-size: 1.5rem; letter-spacing: .15em; padding: 14px; } .bgbingo:disabled { opacity: .45; } .bgbingo.ready { animation: bingopulse 1s ease-in-out infinite; } @keyframes bingopulse { 50% { transform: scale(1.04); box-shadow: 0 0 18px var(--gold); } }
.bgprog { display: grid; gap: 6px; } .bgprog > div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; } .bgprog .me > span { font-weight: 800; color: var(--red); }
.bgcalled { display: flex; flex-wrap: wrap; gap: 5px; } .bgcalled span { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-family: var(--hanzi); } .bgcalled span.mine { background: var(--mint); border-color: var(--ok, #3b9a5b); }
.rqhead { display: flex; justify-content: space-between; align-items: center; font-weight: 700; } .rqhead .ic { width: 18px; height: 18px; color: var(--red); vertical-align: -3px; }
.rqteams { display: flex; justify-content: space-between; margin: 6px 0; font-weight: 800; } .rqteams .ta { color: #d4401f; } .rqteams .tb2 { color: #3b5fc0; }
.rqout { color: var(--red); } .rlturn { color: var(--red); }
.rmstand { display: grid; gap: 6px; margin: 10px 0; } .rms { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; text-align: left; } .rms.me { border-color: var(--gold); background: var(--lemon); } .rms .pl { width: 26px; height: 26px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 800; } .rms.p1 .pl { background: var(--gold); color: #1d1408; } .rms .fn { flex: 1; display: flex; flex-direction: column; } .rms small { color: var(--muted); } .rms .rsc { font-weight: 800; color: var(--red); }
.rmwin { text-align: center; } .rmreward { margin-top: 8px; } .rmgold { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 800; font-size: 1.2rem; margin: 4px 0; } .rmgold .ic { width: 22px; height: 22px; }
.tugnames { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; font-weight: 700; } .tugnames .ta { color: #d4401f; } .tugnames .tb2 { color: #3b5fc0; text-align: right; }
.tugbar { position: relative; height: 36px; margin: 12px 4px; border-radius: 18px; background: linear-gradient(90deg, #d4401f, var(--line) 50%, #3b5fc0); } .tugbar .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 3px; background: var(--fg); opacity: .4; } .tugbar .goalL, .tugbar .goalR { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--gold); } .tugbar .goalL { left: 2%; } .tugbar .goalR { right: 2%; }
.tugbar .knot { position: absolute; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--gold); color: #1d1408; display: grid; place-items: center; transition: left .5s cubic-bezier(.2,.9,.3,1); box-shadow: 0 2px 6px rgba(0,0,0,.3); } .tugbar .knot .ic { width: 20px; height: 20px; }
.rlplaced { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; padding: 8px; border: 2px dashed var(--line); border-radius: 12px; margin: 8px 0; } .tkp { padding: 6px 12px; border-radius: 10px; background: var(--mint); border: 1px solid var(--ok, #3b9a5b); font-family: var(--hanzi); font-size: 1.2rem; }
.rlbag { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; } .rlbag .tk { padding: 10px 16px; font-size: 1.3rem; }
.rqopts .opt { padding: 14px 10px; }
@media (max-width: 420px) { .rmgames.sel { grid-template-columns: 1fr; } .bgc b { font-size: 1.2rem; } .bgprog > div { grid-template-columns: 70px 1fr; } }

/* ---- Phòng chơi: bảng điểm, đua thuyền, lật bài, nối từ ---- */
.rms .rsc { flex: none; min-width: 3.4em; text-align: right; font-family: var(--font, inherit); font-size: .95rem; font-weight: 800; color: var(--red); white-space: nowrap; }
.rms .fn b, .rmp .fn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boatlanes { display: grid; gap: 8px; margin-top: 8px; }
.lane2 { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; }
.lane2 .ln { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.lane2.me .ln { color: var(--red); font-weight: 700; }
.lane2 .water { position: relative; height: 30px; border-radius: 15px; background: linear-gradient(#cfe8f6, #a9d3ec); border: 1px solid var(--line); overflow: hidden; }
.lane2 .boat { position: absolute; top: 2px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; transition: left .5s ease; }
.lane2 .boat .ic { width: 16px; height: 16px; }
.lane2 .finish { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; background: repeating-linear-gradient(#222 0 6px, #fff 6px 12px); }
.rqout { color: var(--red); text-align: center; }
.rmmem .mcard { height: 92px; }
.rmmem .mcard.z .back b { font-size: 1.7rem; }
.rmmem .mcard.v .back b { font-size: 1rem; font-family: inherit; font-weight: 700; }
.rlturn { color: var(--red); }
.tbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 6px 0; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--red); transition: width .5s linear; }
.rmp.out { opacity: .5; }
.opt.zh.long small { display: block; font-size: .75rem; color: var(--muted); font-family: inherit; }
/* ---- Sảnh chờ, trò chuyện trong phòng, trang cá nhân ---- */
.lnk { cursor: pointer; } .lnk:hover, .rml a:hover { text-decoration: underline; } .rml a { color: inherit; cursor: pointer; font-weight: 600; }
.lobtool { justify-content: flex-start; margin: 0 0 8px; }
.rmlobby { display: grid; gap: 8px; margin-bottom: 6px; }
.rml { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rml .gi { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--lemon); color: var(--red); }
.rml .gi .ic { width: 20px; height: 20px; }
.rml .fn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .rml .fn small { color: var(--muted); }
.rml .lockb { font-style: normal; color: var(--muted); } .rml .lockb .ic { width: 14px; height: 14px; vertical-align: -2px; }
.rml button { flex: none; min-width: 64px; }

.rmchat { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 10px 12px; display: grid; gap: 8px; }
.rcH { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rcH b { display: flex; align-items: center; gap: 6px; } .rcH .ic { width: 18px; height: 18px; }
.rcV { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; } .rcV .ic { width: 14px; height: 14px; }
.rcM { height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: var(--bg2, rgba(0, 0, 0, .04)); }
.rcm { font-size: .92rem; line-height: 1.35; word-break: break-word; } .rcm b { margin-right: 6px; color: var(--muted); font-size: .8rem; }
.rcm.me b { color: var(--red); }
.rcQ { display: flex; flex-wrap: wrap; gap: 6px; }
.rcI { display: flex; gap: 8px; } .rcI input { flex: 1; min-width: 0; } .rcI button { flex: none; padding: 0 14px; } .rcI .ic { width: 18px; height: 18px; }
.rcMic { display: grid; gap: 6px; } .rcMic .ic { width: 16px; height: 16px; vertical-align: -3px; }
.rcVoice { display: flex; flex-wrap: wrap; gap: 6px; } .rcVoice span { padding: 3px 10px; border-radius: 999px; background: var(--lemon); font-size: .82rem; } .rcVoice span.me { outline: 1.5px solid var(--red); }
@media (max-width: 480px) { .rcM { height: 120px; } }

.pf { position: relative; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; padding: 0 14px 16px; }
.pfban { height: 92px; margin: 0 -14px; background: linear-gradient(120deg, hsl(var(--h) 60% 62%), hsl(calc(var(--h) + 40) 70% 78%)); }
.pfav { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 50% 30%); font-weight: 800; overflow: hidden; border: 3px solid var(--card); }
.pfav.big { width: 96px; height: 96px; margin: -48px auto 6px; font-size: 2.2rem; position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.pfav svg { width: 100%; height: 100%; }
.pfn { margin: 4px 0 0; } .pfn small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.pfon { margin: 2px 0 8px; color: var(--muted); font-size: .85rem; } .pfon.on { color: var(--ok, #3b9a5b); }
.pfbio { margin: 0 auto 10px; max-width: 34em; line-height: 1.4; } .pfbio i { color: var(--muted); }
.pfchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.pfchips span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 600; } .pfchips .ic { width: 15px; height: 15px; }
.pfstats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.pfs { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border-radius: 12px; background: var(--lemon); }
.pfs .ic { width: 16px; height: 16px; color: var(--red); } .pfs b { font-size: 1.1rem; } .pfs small { color: var(--muted); font-size: .72rem; }
.pfact { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; } .pfok { display: inline-flex; align-items: center; gap: 4px; color: var(--ok, #3b9a5b); font-weight: 600; } .pfact .ic { width: 16px; height: 16px; vertical-align: -3px; }
@media (max-width: 520px) { .pfstats { grid-template-columns: repeat(3, 1fr); } }
/* ---- Ảnh đại diện thời trang ---- */
.pfav .avsvg { width: 100%; height: 100%; display: block; }
.pfav { padding: 0; }
.pfav.big { width: 112px; height: 112px; margin: -56px auto 6px; }
.pfav.md { width: 52px; height: 52px; flex: none; } .pfav.sm { width: 64px; height: 64px; margin: 0 auto; }
.pfav.fr-vang { border: 4px solid #f2c230; box-shadow: 0 0 0 2px #7a5a00; }
.pfav.fr-do { border: 4px solid #c0392b; box-shadow: 0 0 0 2px #f2c230; }
.pfav.fr-ngoc { border: 4px solid #3fbf9a; box-shadow: 0 0 0 2px #1d6a55, 0 0 12px rgba(63, 191, 154, .6); }
.pfav.fr-cau { border: 4px solid transparent; background: conic-gradient(#ff4d6d, #ffd84d, #4dd26a, #4dd2ff, #8b5cf6, #ff4d6d) border-box; -webkit-mask: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.pfav.fr-cau .avsvg { border-radius: 50%; }
.pfav.fr-rong { border: 4px solid #f2c230; box-shadow: 0 0 0 3px #c0392b, 0 0 0 5px #f2c230; }
.sart.av { display: grid; place-items: center; background: transparent; } .dm-stage.av { display: grid; place-items: center; padding: 14px; } .dm-stage.av .pfav { margin: 0; }
.pfme { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; }
.pfme span:not(.pfav) { flex: 1; display: flex; flex-direction: column; } .pfme small { color: var(--muted); } .pfme i .ic { width: 18px; height: 18px; }
.avsvg .f-cheer, .avsvg .f-bad { display: none; } .avsvg .f-ok { display: block; }

/* ---- Toàn thân chibi, bảng tên, cờ hiệu ---- */
.pffull { display: inline-block; line-height: 0; border-radius: 18px; overflow: hidden; border: 3px solid var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); background: var(--card); }
.pffull .fbsvg { width: 100%; height: auto; display: block; }
.pffull.hero { width: 170px; margin: -64px auto 4px; position: relative; }
.pffull.mini { width: 64px; border-width: 2px; border-radius: 12px; box-shadow: none; } .pffull.demo { width: 150px; }
.pffull.fr-vang { border-color: #f2c230; box-shadow: 0 0 0 2px #7a5a00; } .pffull.fr-do { border-color: #c0392b; box-shadow: 0 0 0 2px #f2c230; }
.pffull.fr-ngoc { border-color: #3fbf9a; box-shadow: 0 0 0 2px #1d6a55, 0 0 12px rgba(63, 191, 154, .6); } .pffull.fr-rong { border-color: #f2c230; box-shadow: 0 0 0 3px #c0392b, 0 0 0 5px #f2c230; }
.pffull.fr-cau { border: 3px solid transparent; background: conic-gradient(#ff4d6d, #ffd84d, #4dd26a, #4dd2ff, #8b5cf6, #ff4d6d) border-box; }
.pfhero { position: relative; } .pfflagw { position: absolute; right: calc(50% - 148px); top: -40px; width: 46px; line-height: 0; } .pfflag { width: 100%; height: auto; }
@media (max-width: 480px) { .pfflagw { right: 4px; top: -30px; width: 38px; } }
.pfplate { display: inline-block; padding: 2px 16px; border: 2px solid transparent; border-radius: 10px; font-size: 1.15rem; }
.sart.av .pfplate { font-size: .9rem; padding: 2px 10px; } .sart.av .pfflag { width: 34px; }
.fbsvg .f-cheer, .fbsvg .f-bad { display: none; } .fbsvg .f-ok { display: block; }

/* ---- Hoạt họa nhân vật chibi ---- */

.wg { animation: fbflap 1.6s ease-in-out infinite; transform-origin: 42px 100px; }
.fbpet { animation: fbhop 1.8s ease-in-out infinite; transform-origin: 16px 36px; }
.fbhand { animation: fbwave 2.4s ease-in-out infinite; transform-origin: 0 0; }
.fbbal { animation: fbsway 3s ease-in-out infinite; transform-origin: 26px 122px; }
.fbaura { transform-origin: 60px 100px; }
.fxtw path { animation: fbtw 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; } .fxtw path:nth-child(2) { animation-delay: .4s; } .fxtw path:nth-child(3) { animation-delay: .8s; } .fxtw path:nth-child(4) { animation-delay: 1.2s; }
.fxpulse { animation: fbpulse 2.4s ease-in-out infinite; transform-origin: 60px 120px; }
.fxfall path { animation: fxfall 4.5s linear infinite; } .fxfall path:nth-child(2) { animation-delay: 1s; } .fxfall path:nth-child(3) { animation-delay: 2s; } .fxfall path:nth-child(4) { animation-delay: 3s; } .fxfall path:nth-child(5) { animation-delay: 1.6s; }
.fxf { animation: fxfall 4s linear infinite; }
.fxr { animation: fxrise 5s ease-in infinite; }
.fxs { animation: fxshoot 3.2s ease-in infinite; opacity: 0; }
.fxfire { animation: fbfire .7s ease-in-out infinite alternate; transform-origin: 58px 156px; }
@keyframes fbbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes fbflap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
@keyframes fbhop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } 60% { transform: translateY(-5px); } }
@keyframes fbwave { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(6deg); } }
@keyframes fbsway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes fbtw { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes fbpulse { 0%, 100% { opacity: .7; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes fxfall { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(185px) translateX(10px); opacity: .1; } }
@keyframes fxrise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-180px); opacity: 0; } }
@keyframes fxshoot { 0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: 1; } 40% { transform: translate(-40px, 26px); opacity: 0; } 100% { opacity: 0; } }
@keyframes fbfire { from { transform: scaleY(.9) scaleX(1); } to { transform: scaleY(1.12) scaleX(.96); } }
@media (prefers-reduced-motion: reduce) { .fbfig, .wg, .fbpet, .fbhand, .fbbal, .fxtw path, .fxpulse, .fxfall path, .fxf, .fxr, .fxs, .fxfire { animation: none !important; } }
.pfintro { display: inline-block; max-width: 90%; margin: 4px auto 6px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); position: relative; font-size: .92rem; animation: pfpop .5s ease-out; } .pfintro::before { content: ''; position: absolute; left: 50%; top: -7px; width: 10px; height: 10px; background: var(--card); border-left: 1.5px solid var(--line); border-top: 1.5px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.pfbadge { width: 22px; height: 26px; vertical-align: -6px; margin-right: 6px; } .sart.av .pfbadge, .dm-stage.av .pfbadge { margin-right: 4px; }
.dm-stage.av { flex-wrap: wrap; gap: 8px; }
@keyframes pfpop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- Chi tiết hoạt họa của nét mặt ---- */
.eye { animation: eblink 4.6s infinite; transform-box: fill-box; transform-origin: center; }
.hb { animation: ehb 1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.tear { animation: etear 1.6s ease-in infinite; transform-box: fill-box; }
.spk { animation: fbtw 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.zz { animation: ezz 2.4s ease-in-out infinite; }
.spin { animation: espin 1.8s linear infinite; transform-box: fill-box; transform-origin: center; }
.glint { animation: eglint 3s ease-in-out infinite; }
@keyframes eblink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes ehb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
@keyframes etear { 0% { transform: translateY(-2px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }
@keyframes ezz { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes espin { to { transform: rotate(360deg); } }
@keyframes eglint { 0%, 70%, 100% { opacity: .15; } 85% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .eye, .hb, .tear, .spk, .zz, .spin, .glint { animation: none !important; } }
/* ---- Sảnh chờ dạng ô nhân vật ---- */
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
@media (max-width: 560px) { .slots { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
@media (max-width: 380px) { .slots { grid-template-columns: repeat(2, 1fr); } }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); animation: slotin .4s ease-out backwards; min-width: 0; }
.slot.me { border-color: var(--gold); box-shadow: 0 0 0 2px var(--lemon); } .slot.host { border-color: #f2c230; }
.stile { position: relative; width: 100%; display: grid; place-items: center; cursor: pointer; }
.slot .pffull.slotf { width: 78%; max-width: 100px; border-width: 2px; border-radius: 12px; box-shadow: none; }
.slot.empty { border-style: dashed; background: transparent; opacity: .75; }
.slot.empty .stile { aspect-ratio: 120 / 170; width: 78%; max-width: 100px; border-radius: 12px; background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(127, 127, 127, .08) 8px 16px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); animation: slotwait 2s ease-in-out infinite; }
.slot.empty .stile span .ic { width: 22px; height: 22px; } .slot.empty small { font-size: .7rem; }
.shost { position: absolute; top: -2px; right: 6%; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #f2c230; color: #7a5a00; font-style: normal; animation: fbtw 2s ease-in-out infinite; } .shost .ic { width: 14px; height: 14px; }
.sname { max-width: 100%; text-align: center; font-size: .8rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sname .pfplate { font-size: .78rem; padding: 1px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sstate { font-size: .62rem; letter-spacing: .04em; color: var(--muted); font-weight: 700; } .sstate.h { color: #b8860b; }
@keyframes slotin { from { transform: translateY(8px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slotwait { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* ---- Động tác nhân vật (thay cho bay lên bay xuống) ---- */
.fbfig { animation: fbbreath 3.6s ease-in-out infinite !important; transform-origin: 60px 150px; }
.fbhead { transform-origin: 60px 92px; } .fbarmL { transform-origin: 38px 96px; } .fbarmR { transform-origin: 82px 96px; }
.fbshadow { transform-box: fill-box; transform-origin: center; }
@keyframes fbbreath { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
[data-act="chao"] .fbarmR { animation: aWave 5s ease-in-out infinite; } [data-act="chao"] .fbhead { animation: aTilt 5s ease-in-out infinite; }
[data-act="gat"] .fbhead { animation: aNod 4s ease-in-out infinite; }
[data-act="cui"] .fbfig { animation: aBow 5s ease-in-out infinite !important; } [data-act="cui"] .fbhead { animation: aBowHead 5s ease-in-out infinite; }
[data-act="vo-tay"] .fbarmL { animation: aClapL 4s ease-in-out infinite; } [data-act="vo-tay"] .fbarmR { animation: aClapR 4s ease-in-out infinite; }
[data-act="mung"] .fbarmL { animation: aCheerL 4.5s ease-in-out infinite; } [data-act="mung"] .fbarmR { animation: aCheerR 4.5s ease-in-out infinite; } [data-act="mung"] .fbfig { animation: aHop 4.5s ease-in-out infinite !important; }
[data-act="lac"] .fbhead { animation: aShake 4s ease-in-out infinite; }
[data-act="nhay"] .fbfig { animation: aJump 4.5s ease-in-out infinite !important; } [data-act="nhay"] .fbshadow { animation: aShadow 4.5s ease-in-out infinite; }
[data-act="xoay"] .fbfig { animation: aSpin 5s ease-in-out infinite !important; }
[data-act="mua"] .fbfig { animation: aDance .9s ease-in-out infinite alternate !important; } [data-act="mua"] .fbarmL { animation: aDanceL .9s ease-in-out infinite alternate; } [data-act="mua"] .fbarmR { animation: aDanceR .9s ease-in-out infinite alternate; } [data-act="mua"] .fbhead { animation: aTilt2 .9s ease-in-out infinite alternate; }
@keyframes aWave { 0%, 40%, 100% { transform: rotate(0); } 8% { transform: rotate(-145deg); } 14% { transform: rotate(-118deg); } 20% { transform: rotate(-145deg); } 26% { transform: rotate(-118deg); } 32% { transform: rotate(-145deg); } }
@keyframes aTilt { 0%, 40%, 100% { transform: rotate(0); } 8%, 32% { transform: rotate(-5deg); } }
@keyframes aNod { 0%, 40%, 100% { transform: translateY(0) rotate(0); } 6%, 18% { transform: translateY(6px) rotate(3deg); } 12%, 24% { transform: translateY(0); } }
@keyframes aBow { 0%, 45%, 100% { transform: translateY(0) scaleY(1); } 12%, 32% { transform: translateY(9px) scaleY(.9); } }
@keyframes aBowHead { 0%, 45%, 100% { transform: translateY(0); } 12%, 32% { transform: translateY(7px) scale(.96); } }
@keyframes aClapL { 0%, 45%, 100% { transform: rotate(0); } 5%, 15%, 25%, 35% { transform: rotate(-52deg); } 10%, 20%, 30%, 40% { transform: rotate(-14deg); } }
@keyframes aClapR { 0%, 45%, 100% { transform: rotate(0); } 5%, 15%, 25%, 35% { transform: rotate(52deg); } 10%, 20%, 30%, 40% { transform: rotate(14deg); } }
@keyframes aCheerL { 0%, 50%, 100% { transform: rotate(0); } 10%, 40% { transform: rotate(155deg); } 20%, 30% { transform: rotate(140deg); } }
@keyframes aCheerR { 0%, 50%, 100% { transform: rotate(0); } 10%, 40% { transform: rotate(-155deg); } 20%, 30% { transform: rotate(-140deg); } }
@keyframes aHop { 0%, 50%, 100% { transform: translateY(0); } 15%, 35% { transform: translateY(-5px); } 25% { transform: translateY(0); } }
@keyframes aShake { 0%, 45%, 100% { transform: rotate(0); } 6%, 18%, 30% { transform: rotate(10deg); } 12%, 24%, 36% { transform: rotate(-10deg); } }
@keyframes aJump { 0%, 50%, 100% { transform: translateY(0) scaleY(1); } 4% { transform: translateY(2px) scaleY(.94); } 10%, 30% { transform: translateY(-16px) scaleY(1.03); } 18%, 38% { transform: translateY(0) scaleY(.94); } }
@keyframes aShadow { 0%, 50%, 100% { transform: scale(1); opacity: .12; } 10%, 30% { transform: scale(.6); opacity: .06; } }
@keyframes aSpin { 0%, 45%, 100% { transform: scaleX(1); } 11% { transform: scaleX(.04); } 22% { transform: scaleX(-1); } 33% { transform: scaleX(.04); } }
@keyframes aDance { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes aDanceL { from { transform: rotate(120deg); } to { transform: rotate(10deg); } }
@keyframes aDanceR { from { transform: rotate(-10deg); } to { transform: rotate(-120deg); } }
@keyframes aTilt2 { from { transform: rotate(6deg); } to { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .fbfig, .fbhead, .fbarmL, .fbarmR, .fbshadow { animation: none !important; } }

/* ---- Phòng thử đồ, mục con, biểu cảm ---- */
.fit { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.fitfig { flex: none; } .pffull.fit { width: 96px; } .fitinfo { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .fitinfo small { color: var(--muted); }
.fashcats { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; position: sticky; top: 64px; z-index: 5; background: var(--bg); }
.fashcats button { flex: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); white-space: nowrap; cursor: pointer; } .fashcats button.on { background: var(--red); color: #fff; border-color: var(--red); }
@media (min-width: 720px) { .fashcats ~ .shoplist { grid-template-columns: 1fr 1fr; display: grid; gap: 8px; } }
.slotrow { margin-bottom: 10px; } .slotrow > b { display: block; margin-bottom: 6px; font-size: .9rem; }
.emochips { display: flex; flex-wrap: wrap; gap: 8px; }
.emochip { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; padding: 6px 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; } .emochip.on { border-color: var(--red); background: var(--lemon); } .emochip small { font-size: .68rem; text-align: center; }
.emochip .pffull.mini { width: 48px; }
.emoface { width: 44px; height: 44px; display: block; } .emoface.big { width: 60px; height: 60px; } .emoface svg { width: 100%; height: 100%; } .emoface .f-ok { display: block; }
.emoshop { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.emocard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: center; } .emocard .pffull.mini { width: 56px; }
/* ---- Bảng tên động, khung động, cờ, huy hiệu, thanh cá nhân ---- */
.pfplate.pl-neon { box-shadow: 0 0 8px #5ff3ff, inset 0 0 6px rgba(95, 243, 255, .5); text-shadow: 0 0 6px #5ff3ff; animation: plneon 2.2s ease-in-out infinite; }
.pfplate.pl-fire { background: linear-gradient(0deg, #c0392b, #f08a1c, #ffd84d) !important; background-size: 100% 200%; animation: plfire 1.1s ease-in-out infinite alternate; text-shadow: 0 1px 2px #7a1f16; }
.pfplate.pl-ice { background: linear-gradient(110deg, #bfe9ff 30%, #fff 45%, #bfe9ff 60%) !important; background-size: 250% 100%; animation: plshine 3s linear infinite; }
.pfplate.pl-rainbow { background: #fff !important; background-image: linear-gradient(90deg, #ff4d6d, #ffd84d, #4dd26a, #4dd2ff, #8b5cf6, #ff4d6d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: plrain 3s linear infinite; font-weight: 800; border-color: #d8d8e0; }
.pfplate.pl-royal { background: linear-gradient(110deg, #f2c230 35%, #fff7c0 50%, #f2c230 65%) !important; background-size: 250% 100%; animation: plshine 2.6s linear infinite; font-weight: 800; }
.pfplate.pl-ribbon { clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); border-radius: 0; padding-left: 20px; padding-right: 20px; }
.pfplate.pl-ink { font-family: var(--hanzi), serif; letter-spacing: .06em; border-style: double; border-width: 3px; }
@keyframes plneon { 0%, 100% { opacity: 1; } 45% { opacity: .75; } 50% { opacity: 1; } 55% { opacity: .6; } }
@keyframes plfire { from { background-position: 0 0; } to { background-position: 0 100%; } }
@keyframes plshine { from { background-position: 200% 0; } to { background-position: -50% 0; } }
@keyframes plrain { to { background-position: 200% 0; } }
.pfav.fr-vang, .pffull.fr-vang { animation: frglowV 2.4s ease-in-out infinite; } .pfav.fr-do, .pffull.fr-do { animation: frglowD 2.2s ease-in-out infinite; } .pfav.fr-rong, .pffull.fr-rong { animation: frglowR 1.8s ease-in-out infinite; }
.pfav.fr-cau, .pffull.fr-cau { background: none; animation: frcau 4s linear infinite; }
@keyframes frglowV { 0%, 100% { box-shadow: 0 0 0 2px #7a5a00, 0 0 4px #f2c230; } 50% { box-shadow: 0 0 0 2px #7a5a00, 0 0 14px #ffd84d; } }
@keyframes frglowD { 0%, 100% { box-shadow: 0 0 0 2px #f2c230, 0 0 4px #c0392b; } 50% { box-shadow: 0 0 0 2px #f2c230, 0 0 14px #ff5a4a; } }
@keyframes frglowR { 0%, 100% { box-shadow: 0 0 0 3px #c0392b, 0 0 0 5px #f2c230, 0 0 4px #f2c230; } 50% { box-shadow: 0 0 0 3px #c0392b, 0 0 0 5px #f2c230, 0 0 16px #ff8a1c; } }
@keyframes frcau { 0% { border-color: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; } 20% { border-color: #ffd84d; box-shadow: 0 0 8px #ffd84d; } 40% { border-color: #4dd26a; box-shadow: 0 0 8px #4dd26a; } 60% { border-color: #4dd2ff; box-shadow: 0 0 8px #4dd2ff; } 80% { border-color: #8b5cf6; box-shadow: 0 0 8px #8b5cf6; } 100% { border-color: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; } }
.pfflag .fw, .pflv .fw { animation: flwave 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }
@keyframes flwave { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(4deg) scaleX(.93); } }
.pflv { width: 38px; height: 26px; vertical-align: -6px; margin-left: 6px; }
.pfbadge { animation: bdswing 3.4s ease-in-out infinite; transform-origin: 50% 0; } .pfbadge circle { animation: bdshine 2.4s ease-in-out infinite; }
@keyframes bdswing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } } @keyframes bdshine { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.pfintro { animation: pfpop .5s ease-out, pffloat 3.5s ease-in-out .5s infinite; } @keyframes pffloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.fbsway { animation: fbsw 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; } @keyframes fbsw { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.fbbeat { animation: fbbt 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; } @keyframes fbbt { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.1, .92); } 24% { transform: scale(1); } }
.bgcloud { animation: bgdrift 9s ease-in-out infinite alternate; } .bgcloud.b2 { animation-duration: 12s; animation-direction: alternate-reverse; } @keyframes bgdrift { from { transform: translateX(-10px); } to { transform: translateX(14px); } }
.bgsun { animation: bgsun 6s ease-in-out infinite alternate; } @keyframes bgsun { from { transform: translateY(8px); opacity: .7; } to { transform: translateY(-4px); opacity: 1; } }
.bgray { animation: bgrot 14s linear infinite; transform-origin: 60px 100px; } @keyframes bgrot { to { transform: rotate(360deg); } }
.hud { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; }
.pfav.hudav { width: 42px; height: 42px; flex: none; } .hudm { flex: 1; min-width: 0; } .hudn { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; overflow: hidden; } .hudn .pfplate { font-size: .85rem; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hudn .pfbadge { width: 16px; height: 19px; margin-right: 4px; }
.hudx { height: 7px; margin-top: 4px; border-radius: 4px; background: var(--line); overflow: hidden; } .hudx i { display: block; height: 100%; background: linear-gradient(90deg, #f2c230, #ff8a1c); background-size: 200% 100%; animation: hudflow 2.4s linear infinite; border-radius: 4px; transition: width .5s; }
.hudc { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--gold); } .hudc .ic { width: 16px; height: 16px; }
.hud.hok { animation: hudok .6s ease-out; } .hud.hbad { animation: hudbad .45s ease-out; }
@keyframes hudflow { to { background-position: -200% 0; } } @keyframes hudok { 0% { transform: scale(1); } 30% { transform: scale(1.03); box-shadow: 0 0 14px rgba(255, 216, 77, .7); } 100% { transform: scale(1); } } @keyframes hudbad { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
.finme { display: flex; justify-content: center; margin-bottom: 8px; } .pffull.finf { width: 120px; }
/* ---- Bảng điểm bên phải khi đang chơi ---- */
.rmplay { display: grid; grid-template-columns: 1fr; gap: 10px; }
.rmside { order: -1; }
@media (min-width: 760px) { .rmplay { grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; } .rmside { order: 0; position: sticky; top: 76px; } }
.rmmain .rqlist, .rmmain h3.shsec:has(+ .rqlist) { display: none; }
.stimer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; margin-bottom: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 1.4rem; font-weight: 800; letter-spacing: .04em; } .stimer .ic { width: 22px; height: 22px; color: var(--red); }
.stimer.low { color: #d9362b; border-color: #d9362b; animation: stlow .5s ease-in-out infinite alternate; } @keyframes stlow { to { transform: scale(1.04); } }
.srows { display: grid; gap: 6px; }
@media (max-width: 759px) { .srows { grid-template-columns: repeat(2, 1fr); } }
.srow { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); min-width: 0; } .srow.me { border-color: var(--gold); box-shadow: 0 0 0 2px var(--lemon); }
.spos { width: 16px; text-align: center; font-size: .8rem; color: var(--muted); flex: none; }
.pfav.sav { width: 34px; height: 34px; flex: none; border-width: 2px; }
.sinfo { flex: 1; min-width: 0; overflow: hidden; } .sinfo .pfplate { display: block; font-size: .8rem; padding: 1px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sscore { flex: none; font-weight: 800; color: var(--red); font-size: .9rem; min-width: 2.2em; text-align: right; }
/* ---- Chọn đội (màu) và cài đặt phòng ---- */
.teamrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.tsw { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 2px solid rgba(0, 0, 0, .25); background: var(--tc); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); } .tsw.on { outline: 3px solid var(--fg, #222); outline-offset: 2px; transform: scale(1.08); } .tsw .ic { width: 20px; height: 20px; }
.tsw em { position: absolute; right: -5px; top: -7px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #222; color: #fff; font-size: .62rem; font-style: normal; display: grid; place-items: center; }
.slot { border-color: color-mix(in srgb, var(--tc, var(--line)) 70%, transparent); } .slot .sstate { border-top: 3px solid var(--tc, transparent); padding-top: 2px; width: 70%; text-align: center; }
.srow { border-left: 5px solid var(--tc, var(--line)); }
.setbtn { float: right; } .setbtn .ic { width: 15px; height: 15px; vertical-align: -3px; }
/* ---- Sửa tràn viền ở thẻ cửa hàng thời trang ---- */
.shopcard .sart { flex: none; width: 64px; height: 64px; overflow: hidden; display: grid; place-items: center; }
.shopcard .sart.none { opacity: .45; border: 1.5px dashed var(--line); border-radius: 12px; } .shopcard .sart.none .ic { width: 22px; height: 22px; }
.shopcard .sart .pfbadge { width: 30px; height: 36px; margin: 0; } .shopcard .sart .pfflag { width: 30px; height: 44px; margin: 0; } .shopcard .sart .pfintro { display: none; }
.shopcard .sart .pfplate { max-width: 62px; font-size: .72rem; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopcard .sart.av .pffull.mini { width: 54px; }

.dm-stage.av .pfintro { max-width: 90%; }
/* ---- Thanh kéo ngang cho các hàng nút dài (hiện thanh cuộn, kéo bằng chuột, vuốt bằng tay) ---- */
.fashcats, .shoptabs, .hscroll { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--gold) var(--line); padding-bottom: 8px; cursor: grab; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.fashcats:active, .shoptabs:active, .hscroll:active { cursor: grabbing; }
.fashcats::-webkit-scrollbar, .shoptabs::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: block; height: 9px; }
.fashcats::-webkit-scrollbar-track, .shoptabs::-webkit-scrollbar-track, .hscroll::-webkit-scrollbar-track { background: var(--line); border-radius: 6px; }
.fashcats::-webkit-scrollbar-thumb, .shoptabs::-webkit-scrollbar-thumb, .hscroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 6px; }
.shoptabs > button, .hscroll > * { flex: none; white-space: nowrap; user-select: none; }
/* ---- Bảng tên lấp đầy khung ---- */
.pfplate.fill { display: block; box-sizing: border-box; width: 100%; text-align: center; padding: 3px 10px; border-radius: 10px; font-weight: 800; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfnamebar { width: 170px; max-width: 100%; margin: 2px auto 4px; } .pfbadges { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 26px; margin-bottom: 4px; } .pfbadges small { color: var(--muted); } .pfbadges .pfbadge, .pfbadges .pflv { margin: 0; vertical-align: 0; }
.hudn .pfplate.fill { flex: 1; min-width: 0; width: auto; margin: 0 4px; font-size: .85rem; padding: 1px 8px; }
.slot .sname { width: 100%; } .slot .sname .pfplate { display: block; box-sizing: border-box; width: 100%; max-width: 100%; text-align: center; border-radius: 8px; }
/* hàng bảng điểm: cả hàng là bảng tên của người chơi */
.srow.plated { border-width: 2px; border-left-width: 5px; border-left-color: var(--tc, var(--line)); }
.srow.plated .spos { color: inherit; opacity: .75; } .srow.plated .sname2 { display: block; font-weight: 800; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .srow.plated .sscore { color: inherit; }
.srow.pl-neon { box-shadow: 0 0 8px #5ff3ff, inset 0 0 6px rgba(95, 243, 255, .5); animation: plneon 2.2s ease-in-out infinite; } .srow.pl-neon .sname2 { text-shadow: 0 0 6px #5ff3ff; }
.srow.pl-fire { background: linear-gradient(0deg, #c0392b, #f08a1c, #ffd84d) !important; background-size: 100% 200%; animation: plfire 1.1s ease-in-out infinite alternate; }
.srow.pl-ice { background: linear-gradient(110deg, #bfe9ff 30%, #fff 45%, #bfe9ff 60%) !important; background-size: 250% 100%; animation: plshine 3s linear infinite; }
.srow.pl-royal { background: linear-gradient(110deg, #f2c230 35%, #fff7c0 50%, #f2c230 65%) !important; background-size: 250% 100%; animation: plshine 2.6s linear infinite; }
.srow.pl-rainbow .sname2 { background-image: linear-gradient(90deg, #ff4d6d, #ffd84d, #4dd26a, #4dd2ff, #8b5cf6, #ff4d6d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: plrain 3s linear infinite; }
.srow.pl-ink .sname2 { font-family: var(--hanzi), serif; letter-spacing: .05em; }
.srow.me { outline: 2px solid var(--gold); outline-offset: 1px; }
/* ---- Phòng thử đồ cố định phía trên ---- */
.fit { position: sticky; top: 60px; z-index: 6; box-shadow: 0 6px 14px rgba(0, 0, 0, .25); align-items: flex-start; }
.pffull.fit { width: 104px; } @media (max-width: 480px) { .pffull.fit { width: 84px; } }
.fashcats { position: static; }
.fittry { display: flex; flex-wrap: wrap; gap: 4px; max-height: 76px; overflow-y: auto; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--lemon); font-size: .74rem; } .fchip.own { background: var(--mint); } .fchip em { font-style: normal; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fchip small { color: var(--gold); font-weight: 700; }
.fchip button { width: 18px; height: 18px; padding: 0; border-radius: 50%; display: grid; place-items: center; line-height: 0; } .fchip button .ic { width: 11px; height: 11px; }
.fitbtns { display: flex; flex-wrap: wrap; gap: 6px; } .fitbtns button { padding: 6px 12px; font-size: .85rem; } .fitbtns .ic { width: 15px; height: 15px; vertical-align: -3px; }
.shopcard.trying { outline: 2px solid var(--red); outline-offset: -2px; background: var(--lemon); } .rib.try { background: var(--red); color: #fff; }
/* ---- Thêm nền bảng tên động (dùng cho bảng tên, hàng bảng điểm, ô sảnh chờ) ---- */
.pfplate, .srow { position: relative; overflow: hidden; }
.pfplate[class*="pl-"]::after, .srow[class*="pl-"]::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.pl-sakura { background: linear-gradient(100deg, #ffd1e0, #ffb3c8 50%, #ffd1e0) 0 0 / 200% 100% !important; animation: plshine 5s linear infinite; }
.pl-sakura::after { background-image: radial-gradient(circle at 20% 30%, #fff 0 2px, transparent 3px), radial-gradient(circle at 60% 70%, #fff 0 2px, transparent 3px), radial-gradient(circle at 85% 25%, #ffe9f0 0 2.4px, transparent 3.4px); background-size: 70px 100%; animation: plpet 3.2s linear infinite; }
.pl-ocean { background: linear-gradient(90deg, #1f78c8, #5fd0f0, #1f78c8) 0 0 / 200% 100% !important; animation: plshine 4s linear infinite; }
.pl-ocean::after { background: repeating-linear-gradient(100deg, rgba(255, 255, 255, .2) 0 8px, transparent 8px 22px); background-size: 44px 100%; animation: plpet 1.6s linear infinite; }
.pl-night { background: linear-gradient(90deg, #1c2352, #4b3b9a, #1c2352) !important; }
.pl-night::after { background-image: radial-gradient(circle at 12% 40%, #fff 0 1.2px, transparent 2px), radial-gradient(circle at 38% 70%, #fff 0 1px, transparent 2px), radial-gradient(circle at 66% 30%, #fff3b0 0 1.4px, transparent 2.4px), radial-gradient(circle at 90% 65%, #fff 0 1px, transparent 2px); animation: pltw 1.8s ease-in-out infinite alternate; }
.pl-bamboo { background: repeating-linear-gradient(90deg, #3f9a52 0 14px, #52b266 14px 17px, #3f9a52 17px 30px) 0 0 / 60px 100% !important; animation: plpet 6s linear infinite; }
.pl-volcano { background: linear-gradient(0deg, #ff7a1c, #7a1410 70%) !important; animation: plfire 1.4s ease-in-out infinite alternate; background-size: 100% 160% !important; }
.pl-cloud { background: linear-gradient(#fff3c0, #ffe9a0) !important; }
.pl-cloud::after { background-image: radial-gradient(ellipse 18px 8px at 20% 60%, rgba(255, 255, 255, .9), transparent), radial-gradient(ellipse 22px 9px at 70% 35%, rgba(255, 255, 255, .85), transparent); background-size: 120px 100%; animation: plpet 7s linear infinite; }
.pl-scale { background: radial-gradient(circle at 50% 100%, transparent 0 7px, rgba(0, 0, 0, .22) 8px 9px, transparent 10px) 0 0 / 18px 12px, linear-gradient(90deg, #1f8a74, #2fc0a0, #1f8a74) !important; animation: plpet 5s linear infinite; }
.pl-bolt { background: linear-gradient(90deg, #121a38, #26407a, #121a38) !important; }
.pl-bolt::after { background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .85) 48%, transparent 56%); animation: plbolt 3.4s ease-in-out infinite; }
.pl-rbbg { background: linear-gradient(90deg, #ff4d6d, #ffd84d, #4dd26a, #4dd2ff, #8b5cf6, #ff4d6d) 0 0 / 300% 100% !important; animation: plrain 4s linear infinite; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.pl-diamond { background: linear-gradient(110deg, #9fd8f5 30%, #fff 45%, #9fd8f5 60%) 0 0 / 250% 100% !important; animation: plshine 2.8s linear infinite; }
.pl-diamond::after { background: radial-gradient(circle at 82% 30%, #fff 0 2px, transparent 3px); animation: pltw 1.2s ease-in-out infinite alternate; }
.pl-lotus { background: radial-gradient(circle at 20% 70%, rgba(127, 207, 154, .55) 0 10px, transparent 11px), linear-gradient(90deg, #ffd6e6, #ffe9f1, #ffd6e6) !important; }
.pl-lotus::after { background: radial-gradient(circle at 20% 70%, transparent 0 8px, rgba(255, 255, 255, .8) 9px 10px, transparent 11px); animation: plripple 2.2s ease-out infinite; }
.pl-ornate { background: linear-gradient(90deg, #8a1010, #c0281c, #8a1010) !important; border-style: double !important; border-width: 4px !important; box-shadow: inset 0 0 0 1.5px #ffd84d, 0 0 6px rgba(242, 194, 48, .6); }
.pl-ornate::after { background: linear-gradient(110deg, transparent 42%, rgba(255, 233, 160, .55) 50%, transparent 58%); animation: plbolt 3.8s ease-in-out infinite; }
@keyframes plpet { to { background-position-x: 100%; } } @keyframes pltw { from { opacity: .35; } to { opacity: 1; } } @keyframes plbolt { 0%, 70%, 100% { transform: translateX(-100%); opacity: 0; } 76% { opacity: 1; } 90% { transform: translateX(100%); opacity: 0; } }
@keyframes plripple { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes plpetshift { to { background-position: 70px 0; } }
.pl-sakura::after, .pl-ocean::after, .pl-cloud::after { animation-name: plpetshift; } .pl-ocean::after { background-size: 44px 100%; }
/* nền đội cho hàng bảng điểm khi chưa dùng bảng tên */
.srow.noplate { background: linear-gradient(90deg, color-mix(in srgb, var(--tc, #888) 42%, var(--card)), var(--card) 75%) 0 0 / 200% 100%; border-color: color-mix(in srgb, var(--tc, #888) 55%, transparent); animation: plshine 6s linear infinite; }
.srow.noplate::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .12) 50%, transparent 60%); animation: plbolt 5s ease-in-out infinite; }
.slot { background: linear-gradient(180deg, color-mix(in srgb, var(--tc, #888) 22%, var(--card)), var(--card) 60%); }
.srow > * { position: relative; z-index: 1; }
/* ---- Cố định thanh tab cửa hàng, phòng thử đồ và hàng mục khi cuộn ---- */
.shoptabs, .fashcats { position: sticky; z-index: 8; background: var(--bg); margin-top: 0; padding-top: 4px; }
.fit { position: sticky; z-index: 7; background: var(--card); margin-bottom: 4px; }
.fashcats { z-index: 6; }
@media (max-width: 480px) { .pffull.fit { width: 64px; } .fit { padding: 6px 8px; gap: 10px; } .fittry { max-height: 52px; } .fitinfo small { font-size: .72rem; } }
/* ---- Quân bài Lật Bài: úp và lật cùng một hình chữ nhật bo góc, đồng bộ kích thước ---- */
.mcard { border-radius: 14px !important; overflow: hidden; }
.mcard.bk-sen:not(.up), .mcard.bk-rong:not(.up), .mcard.bk-phuc:not(.up) { padding: 0; border-color: transparent; }
.mcard.bk-sen:not(.up) { background: linear-gradient(135deg, #e06a9a, #8f3a78); } .mcard.bk-rong:not(.up) { background: linear-gradient(135deg, #2f8f7a, #14504a); } .mcard.bk-phuc:not(.up) { background: linear-gradient(135deg, #d4401f, #8a1f10); }
.mcard.bk-sen .front, .mcard.bk-rong .front, .mcard.bk-phuc .front { border-radius: 0; background: transparent !important; }
.mcard.up { background: var(--card); border: 2px solid var(--gold); }
.shopinfo .dm-cards .mem { grid-template-columns: repeat(2, 96px); justify-content: center; gap: 12px; } .shopinfo .dm-cards .mcard { height: 128px; }
/* ---- Đặc quyền, ủng hộ ---- */
.perkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin: 4px 0 8px; border-radius: 12px; background: linear-gradient(100deg, #f2c230, #ffe9a0 50%, #f2c230) 0 0 / 250% 100%; color: #4a2c12; font-weight: 700; font-size: .9rem; animation: plshine 4s linear infinite; } .perkbar .ic { width: 18px; height: 18px; } .perkbar span { flex: 1; min-width: 12em; } .perkbar button { padding: 4px 12px; font-size: .8rem; }
.perkbar.vip { background: linear-gradient(100deg, #8b5cf6, #c9a8ff 50%, #8b5cf6) 0 0 / 250% 100%; color: #fff; }
.mebtn.donate { margin-bottom: 8px; } .mebtn.donate .ic { color: #e8365d; }
.donsheet .donqr { display: grid; place-items: center; margin: 8px 0; } .donsheet .donqr img { max-width: 260px; width: 100%; border-radius: 12px; background: #fff; padding: 6px; }
.donrows { display: grid; gap: 6px; margin: 8px 0; } .donrows > div { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; } .donrows small { color: var(--muted); min-width: 7em; } .donrows b { flex: 1; word-break: break-all; }
.perkform textarea { width: 100%; box-sizing: border-box; }
/* ---- VIP: vương miện, đồ độc quyền, khung, bảng tên, trang đặc quyền ---- */
.vipmark { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; filter: drop-shadow(0 0 3px rgba(255, 216, 77, .8)); animation: vipshine 2.4s ease-in-out infinite; flex: none; } @keyframes vipshine { 0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 216, 77, .6)); } 50% { filter: drop-shadow(0 0 6px rgba(255, 236, 130, 1)) brightness(1.2); } }
.vipchip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px; border-radius: 999px; background: linear-gradient(100deg, #f2c230, #fff3a0 50%, #f2c230) 0 0 / 250% 100%; color: #4a2c12; font-weight: 800; font-size: .78rem; animation: plshine 3s linear infinite; } .vipchip .vipmark { margin: 0; width: 14px; height: 14px; }
.pl-vip { background: linear-gradient(110deg, #b8860b, #ffd84d 35%, #fff3a0 50%, #ffd84d 65%, #b8860b) 0 0 / 250% 100% !important; animation: plshine 2.2s linear infinite; box-shadow: 0 0 8px rgba(255, 216, 77, .7); border-style: double !important; border-width: 3px !important; font-weight: 800; }
.pl-vip::after { background: radial-gradient(circle at 86% 30%, #fff 0 2px, transparent 3px); animation: pltw 1s ease-in-out infinite alternate; }
.pfav.fr-vip, .pffull.fr-vip { border: 4px solid #ffd84d; animation: frvip 1.8s ease-in-out infinite; } @keyframes frvip { 0%, 100% { box-shadow: 0 0 0 2px #8a5a00, 0 0 6px #ffd84d; border-color: #ffd84d; } 50% { box-shadow: 0 0 0 2px #c0182c, 0 0 18px #fff3a0; border-color: #fff3a0; } }
.rib.vip { background: linear-gradient(100deg, #8a5a00, #ffd84d); color: #3a1f00; font-weight: 800; }
.mebtn.vipbtn { border-color: #ffd84d; } .mebtn.vipbtn .ic { color: #f2c230; }
.vipcard { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 10px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); } .vipcard.on { border-color: #ffd84d; background: linear-gradient(135deg, var(--card), rgba(255, 216, 77, .18)); }
.vipfig { flex: none; } .vipinfo { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .vipinfo small { color: var(--muted); } .vipinfo .vipnote { color: var(--red); }
.viplist { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; } .viplist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); } .viplist .ic { width: 22px; height: 22px; flex: none; color: #f2c230; margin-top: 2px; } .viplist li div { display: flex; flex-direction: column; } .viplist small { color: var(--muted); }
.vipitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; } .vipit { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid #ffd84d; border-radius: 12px; background: var(--card); text-align: center; } .vipit small { font-size: .7rem; } .vipit .pffull.mini { width: 54px; }
.vipplans { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 6px; }
.vplan { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border: 1.5px solid #ffd84d; border-radius: 14px; background: linear-gradient(160deg, var(--card), rgba(255, 216, 77, .16)); cursor: pointer; } .vplan b { font-size: 1rem; } .vplan span { font-size: 1.25rem; font-weight: 800; color: var(--gold); } .vplan small { color: var(--ok); font-weight: 700; font-size: .72rem; }
.perkform select { margin-right: 6px; }

/* thử đồ mượt: bỏ hiệu ứng vào lại của nhân vật trong phòng thử đồ để không giật khi đổi món */
.fit .fbsvg, .fit .pffull { animation-delay: 0s; }
.fit .pffull { transition: none; }

/* ---- Phòng thử đồ: thấy cả bảng tên, huy hiệu, cờ và lời chào ---- */
.fitfig { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 104px; flex: none; } .fitfig .pffull.fit { width: 100%; }
.fitplate { display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; } .fitplate .pfplate.fill { flex: 1; min-width: 0; font-size: .78rem; padding: 1px 6px; } .fitplate .pfbadge { width: 14px; height: 17px; margin: 0; } .fitplate .vipmark { width: 14px; height: 14px; margin: 0; }
.fitextra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .fitflag { width: 26px; line-height: 0; } .fitflag .pfflag { width: 100%; height: auto; } .fitextra .pfintro { font-size: .75rem; padding: 3px 10px; margin: 0; max-width: 100%; } .fitextra .pfintro::before { display: none; }
@media (max-width: 480px) { .fitfig { width: 64px; } .fitplate .pfplate.fill { font-size: .68rem; padding: 0 4px; } }
/* ---- Các thanh cố định của cửa hàng nằm chung một khối dính, tự xếp chồng và không bao giờ lệch ---- */
.shopstick { position: sticky; top: var(--hbar, 61px); z-index: 8; background: var(--bg); padding-bottom: 2px; }
.shopstick .shoptabs, .shopstick .fit, .shopstick .fashcats { position: static; top: auto; }
.shopstick .fit { margin-bottom: 4px; }
/* ---- Phòng thử đồ thu nhỏ: gọn để không chiếm cả màn hình điện thoại ---- */
.fithead { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; } .fitmini { padding: 2px 10px; font-size: .74rem; border-radius: 999px; }
.fit.mini { padding: 6px 8px; gap: 8px; align-items: center; } .fit.mini .fitfig { width: 46px; } .fit.mini .fitplate, .fit.mini .fitextra, .fit.mini .fitinfo > small { display: none; }
.fit.mini .fittry { flex-wrap: nowrap; overflow-x: auto; max-height: none; scrollbar-width: none; } .fit.mini .fittry::-webkit-scrollbar { display: none; } .fit.mini .fchip { flex: none; }
.fit.mini .fitbtns button { padding: 3px 10px; font-size: .78rem; } .fit.mini .fitinfo { gap: 4px; min-width: 0; flex: 1; }
.fit.mini .pffull.fit { width: 100%; border-width: 2px; border-radius: 10px; }
/* ---- Chọn ngôn ngữ ---- */
.langrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 2px 8px; } .langlab { font-size: .8rem; color: var(--muted); } .langchips { display: flex; gap: 6px; flex-wrap: wrap; }
.langbig { display: grid; gap: 10px; margin: 10px 0; } .langbig button { padding: 12px; font-size: 1.05rem; }

/* ---- Một Unit: các bảng hiệu gỗ treo dưới xà ngang (thay cho danh sách dọc) ---- */
.scroll-btn { position: relative; display: block; width: 100%; margin: 10px 0 14px; padding: 0 22px; border: 0; background: none; cursor: pointer; }
.scroll-btn .sc-in { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; background: linear-gradient(180deg, #f6e7bf, #ead3a0); color: #5a3510; border-top: 2px solid #b98a43; border-bottom: 2px solid #b98a43; font-weight: 800; letter-spacing: .02em; } .scroll-btn .ic { width: 20px; height: 20px; }
.scroll-btn .rod { position: absolute; top: -4px; bottom: -4px; width: 18px; border-radius: 9px; background: linear-gradient(90deg, #7a4a1a, #b9783a 50%, #7a4a1a); box-shadow: 0 2px 4px rgba(0, 0, 0, .35); } .scroll-btn .rod.l { left: 6px; } .scroll-btn .rod.r { right: 6px; }
.beam { position: relative; height: 14px; margin: 0 -4px -6px; border-radius: 8px; background: linear-gradient(180deg, #8a5524, #5a3410); box-shadow: 0 3px 6px rgba(0, 0, 0, .35); z-index: 2; }
.beam .lan { position: absolute; top: 10px; width: 14px; height: 20px; border-radius: 7px; background: radial-gradient(circle at 50% 40%, #ff8a5a, #c0281c); box-shadow: 0 0 10px rgba(255, 120, 60, .7); animation: lanswing 3.2s ease-in-out infinite; transform-origin: 50% -8px; } .beam .lan.l { left: 18px; } .beam .lan.r { right: 18px; animation-delay: -1.6s; }
.plaques { display: grid; grid-template-columns: 1fr; gap: 22px 14px; padding: 18px 2px 8px; }
@media (min-width: 560px) { .plaques { grid-template-columns: 1fr 1fr; } }
.plaque { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 14px 18px; border: 2px solid #9a6a2e; border-radius: 6px; text-align: center; cursor: pointer; color: #3a2210; background: repeating-linear-gradient(94deg, rgba(120, 70, 20, .06) 0 3px, transparent 3px 9px), linear-gradient(180deg, #f2d9a6, #e4c07e); box-shadow: 0 6px 12px rgba(0, 0, 0, .28), inset 0 0 0 3px rgba(255, 240, 200, .45); transform-origin: 50% -16px; animation: plsway 5s ease-in-out infinite; animation-delay: calc(var(--sw) * -1.2s); }
.plaque:hover { filter: brightness(1.05); } .plaque:active { transform: scale(.98); }
.plaque .rope { position: absolute; top: -20px; width: 2px; height: 20px; background: #6a4420; } .plaque .rope.l { left: 24%; transform: rotate(-12deg); } .plaque .rope.r { right: 24%; transform: rotate(12deg); }
.plaque .pl-top { position: relative; display: grid; place-items: center; } .plaque .pic { width: 52px; height: 52px; border-radius: 10px; } .plaque .pl-no { position: absolute; left: -22px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: #7a1f16; color: #fff3c0; font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.plaque b { font-size: 1rem; line-height: 1.25; } .plaque small { color: #7a5a30; font-size: .8rem; line-height: 1.3; }
.plaque .pl-foot { min-height: 22px; display: flex; align-items: center; gap: 6px; justify-content: center; } .plaque .pl-foot em { font-style: normal; color: #a01c10; } .plaque .pl-foot .ic { width: 20px; height: 20px; }
.plaque .seal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; background: #c0281c; color: #fff3c0; font-weight: 800; font-size: .85rem; transform: rotate(-8deg); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.plaque .tassel { position: absolute; bottom: -14px; left: 50%; width: 8px; height: 14px; margin-left: -4px; background: linear-gradient(#d4401f, #8a1f10); border-radius: 0 0 4px 4px; }
.plaque.done { background: repeating-linear-gradient(94deg, rgba(120, 70, 20, .06) 0 3px, transparent 3px 9px), linear-gradient(180deg, #f6e4b0, #ecc96f); }
.plaque.next { box-shadow: 0 0 0 3px #ffd84d, 0 0 18px rgba(255, 216, 77, .8), 0 6px 12px rgba(0, 0, 0, .28); animation: plsway 5s ease-in-out infinite, plglow 1.8s ease-in-out infinite alternate; }
@keyframes plsway { 0%, 100% { transform: rotate(calc(var(--sw) * -1deg)); } 50% { transform: rotate(calc(var(--sw) * 1deg)); } }
@keyframes plglow { from { filter: brightness(1); } to { filter: brightness(1.12); } }
@keyframes lanswing { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .plaque, .plaque.next, .beam .lan { animation: none !important; } }
/* ---- Trang Unit, bản gọn và hợp màu giao diện: thẻ treo nhỏ, viền vàng phía trên, con dấu khi hoàn thành ---- */
.scroll-btn { margin: 8px 0 12px; padding: 0 14px; }
.scroll-btn .sc-in { background: var(--card); color: var(--fg); border: 1px solid var(--gold); border-left: 0; border-right: 0; padding: 11px 10px; font-weight: 700; }
.scroll-btn .sc-in .ic { color: var(--gold); }
.scroll-btn .rod { top: 0; bottom: 0; width: 8px; border-radius: 4px; background: var(--gold); box-shadow: none; } .scroll-btn .rod.l { left: 6px; } .scroll-btn .rod.r { right: 6px; }
.beam { height: 5px; margin: 0 0 -2px; border-radius: 3px; background: var(--gold); opacity: .5; box-shadow: none; } .beam .lan { display: none; }
.plaques { grid-template-columns: 1fr; gap: 12px; padding: 14px 0 8px; }
@media (min-width: 640px) { .plaques { grid-template-columns: 1fr 1fr; } }
.plaque { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "top title foot" "top sub foot"; column-gap: 12px; row-gap: 2px; align-items: center; text-align: left; padding: 11px 14px; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 4px 4px 14px 14px; box-shadow: none; animation: none !important; transform: none !important; }
.plaque:hover { filter: none; border-color: var(--gold); background: var(--lemon); }
.plaque .rope, .plaque .tassel { display: none; }
.plaque .pl-top { grid-area: top; } .plaque b { grid-area: title; font-size: .98rem; } .plaque small { grid-area: sub; color: var(--muted); } .plaque .pl-foot { grid-area: foot; min-height: 0; }
.plaque .pic { width: 46px; height: 46px; } .plaque .pl-no { left: -8px; top: -8px; width: 20px; height: 20px; font-size: .7rem; background: var(--red); color: #fff; }
.plaque .pl-foot em { color: var(--gold); } .plaque .seal { width: 24px; height: 24px; }
.plaque.done { background: var(--card); border-top-color: var(--ok); }
.plaque.next { border-color: var(--gold); border-top-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(255, 216, 77, .35); background: var(--lemon); }
/* ---- Trang Unit: mỗi mục là một chiếc đèn lồng treo dưới xà ngang (sáng khi đã ôn, nhấp nháy khi là bài tiếp theo) ---- */
.lan-review { position: relative; display: block; width: 100%; margin: 8px 0 6px; padding: 0 16px; border: 0; background: none; cursor: pointer; }
.lan-review .sc-in { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border-radius: 14px; color: #fff3c0; font-weight: 800; letter-spacing: .02em; background: radial-gradient(ellipse at 50% 0, rgba(255, 220, 120, .45), transparent 70%), linear-gradient(180deg, #e4502c, #a8240e); box-shadow: 0 0 18px rgba(255, 110, 60, .45), inset 0 -4px 0 rgba(0, 0, 0, .18); animation: lanpulse 2.6s ease-in-out infinite; }
.lan-review .sc-in .ic { width: 20px; height: 20px; }
.lan-review .cap { position: absolute; top: 4px; bottom: 4px; width: 14px; border-radius: 5px; background: linear-gradient(90deg, #8a5a10, #e0b13a 50%, #8a5a10); } .lan-review .cap.l { left: 8px; } .lan-review .cap.r { right: 8px; }
.lanterns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; padding: 0 0 12px; }
@media (min-width: 460px) { .lanterns { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .lanterns { grid-template-columns: repeat(4, 1fr); } }
.lan2 { --lc: #d4401f; --ld: #7a1f16; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 6px 14px; border: 0; background: none; text-align: center; cursor: pointer; color: var(--fg); }
.lan2.k-g { --lc: #f0a020; --ld: #8a5a00; } .lan2.k-r { --lc: #2fa58b; --ld: #17594a; } .lan2.k-t { --lc: #8b5cf6; --ld: #4c2b9e; }
.lan2::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 3px; background: linear-gradient(180deg, #a8702a, #5a3410); box-shadow: 0 2px 3px rgba(0, 0, 0, .3); }
.lan2 .lhook { width: 2px; height: calc(10px + var(--i) * 6px); margin-top: 6px; background: #8a6a3a; }
.lan2 .lbody { position: relative; width: 76px; height: 106px; display: grid; place-items: center; transform-origin: 50% 0; animation: lansway 4.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.9s); }
.lan2 .lsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: saturate(.55) brightness(.78); transition: filter .3s; }
.lan2 .lsvg .bd { fill: var(--lc); stroke: var(--ld); stroke-width: 2; } .lan2 .lsvg .cp { fill: #c9962b; stroke: #6a4a10; stroke-width: 1.4; } .lan2 .lsvg .hk { fill: #6a4a10; } .lan2 .lsvg .rb { stroke: var(--ld); stroke-width: 1.6; opacity: .45; } .lan2 .lsvg .ts { stroke: #e0b13a; stroke-width: 2; stroke-linecap: round; } .lan2 .lsvg .gl { opacity: 0; transition: opacity .3s; }
.lan2 .lz { position: relative; z-index: 1; margin-top: -6px; font-family: var(--hanzi); font-size: 1.7rem; font-weight: 700; color: #fff3c0; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); } .lan2 .lz.ic .ic { width: 28px; height: 28px; }
.lan2 .lno { position: absolute; right: -2px; top: 14px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; background: var(--card); color: var(--fg); border: 1.5px solid var(--lc); font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.lan2.lit .lsvg, .lan2.next .lsvg { filter: drop-shadow(0 0 8px var(--lc)) saturate(1.15) brightness(1.08); } .lan2.lit .lsvg .gl, .lan2.next .lsvg .gl { opacity: .85; }
.lan2.next .lbody { animation: lansway 4.6s ease-in-out infinite, lanflicker 1.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.9s), 0s; }
.lan2 .lstars { min-height: 20px; display: flex; align-items: center; justify-content: center; font-size: .8rem; } .lan2 .lstars em { font-style: normal; font-weight: 800; color: var(--gold); letter-spacing: .02em; }
.lan2 b { font-size: .92rem; line-height: 1.25; } .lan2 small { color: var(--muted); font-size: .76rem; line-height: 1.3; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lan2:hover .lsvg { filter: drop-shadow(0 0 7px var(--lc)) saturate(1.1) brightness(1.05); }
@keyframes lansway { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.2deg); } }
@keyframes lanflicker { from { opacity: .92; } to { opacity: 1; } }
@keyframes lanpulse { 0%, 100% { box-shadow: 0 0 14px rgba(255, 110, 60, .4), inset 0 -4px 0 rgba(0, 0, 0, .18); } 50% { box-shadow: 0 0 26px rgba(255, 140, 80, .7), inset 0 -4px 0 rgba(0, 0, 0, .18); } }
@media (prefers-reduced-motion: reduce) { .lan2 .lbody, .lan2.next .lbody, .lan-review .sc-in { animation: none !important; } }
.lan2, .lan2:hover, .lan2:active, .lan2:focus { background: none !important; box-shadow: none !important; transform: none; }
.lan2 .lsvg { filter: saturate(.8) brightness(.86); } .lan2:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 12px; }

.lan2 .lz .lani { width: 30px; height: 30px; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); } .lan-review .sc-in .lani { width: 22px; height: 22px; animation: wheelspin 9s linear infinite; }
@keyframes wheelspin { to { transform: rotate(360deg); } } @media (prefers-reduced-motion: reduce) { .lan-review .sc-in .lani { animation: none; } }

/* ---- Huy hiệu hạng giải đấu và huy chương top 3 mang dáng riêng ---- */
.lgem { display: inline-grid; place-items: center; width: 40px; height: 40px; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--lg, #f2c230) 55%, transparent)); } .lgem svg { width: 100%; height: 100%; }
.lgem.big { width: 64px; height: 64px; flex: none; animation: lgbob 3.4s ease-in-out infinite; } .lgem.mini { width: 20px; height: 20px; vertical-align: -5px; filter: none; }
@keyframes lgbob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } } @media (prefers-reduced-motion: reduce) { .lgem.big { animation: none; } }
.lgrow { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; } .lgt { position: relative; display: inline-grid; place-items: center; } .lgt .lgem { width: 38px; height: 38px; } .lgt.lock .lgem { opacity: .45; filter: grayscale(1); } .lgt.cur .lgem { transform: scale(1.22); filter: drop-shadow(0 0 8px var(--lg, #f2c230)); } .lgt .lk { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; }
.lghead { display: flex; align-items: center; gap: 12px; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; font-weight: 800; color: #3a2412; }
.medal.m1 { background: linear-gradient(135deg, #fff3a0, #f2b81c); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.medal.m2 { background: linear-gradient(135deg, #f4f6fb, #a8afc0); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.medal.m3 { background: linear-gradient(135deg, #f0b27a, #b8733a); clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
/* ---- Hoạt cảnh giữ lửa (streak) ---- */
.scn-stage { position: relative; display: inline-block; } .scn { width: 100%; height: auto; display: block; overflow: visible; }
.scn-stage.cel { width: min(260px, 70vw); margin-bottom: 6px; } .scn-stage.hero { width: 140px; flex: none; } .scn-stage.mini { width: 84px; flex: none; }
.scn-n { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; font-size: 1.7rem; color: #fff; text-shadow: 0 2px 0 #7a2a08, 0 0 6px #7a2a08; } .scn-stage.mini .scn-n { display: none; }
.sk-mid { display: flex; gap: 10px; align-items: center; margin: 6px 0 2px; } .sk-mid .sk-line { flex: 1; margin: 0; }
.skrestore { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--card); border: 1px dashed var(--red); border-radius: 14px; padding: 10px 12px; margin: 10px 0; } .skrestore > div { flex: 1; min-width: 160px; } .skrestore small { display: block; color: var(--muted); }
.scn-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; } .scn-it { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; text-align: center; } .scn-it .scn-stage { width: 100%; } .scn-it small { color: var(--muted); }
.sc-fl { transform-origin: 100px 140px; animation: scFlick 1.1s ease-in-out infinite; }
@keyframes scFlick { 0%, 100% { transform: scale(1, 1) skewX(0); } 35% { transform: scale(.96, 1.06) skewX(2deg); } 70% { transform: scale(1.03, .96) skewX(-2deg); } }
.sc-fl.sc-grow { animation: scGrow 1.6s cubic-bezier(.2, 1.4, .4, 1) both, scFlick 1.1s 1.6s ease-in-out infinite; } .sc-fl.big { filter: drop-shadow(0 0 10px #ffb23f); }
@keyframes scGrow { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.sc-fl.sc-calm { animation: scCalm 3s ease-in-out infinite; transform: scale(.78); } @keyframes scCalm { 0%, 100% { transform: scale(.78, .74); } 50% { transform: scale(.8, .82); } }
.sc-fl.sc-lean { animation: scLean .9s ease-in-out infinite; transform: scale(.8); } @keyframes scLean { 0%, 100% { transform: scale(.8) skewX(14deg); } 50% { transform: scale(.74, .84) skewX(24deg); } }
.sc-fl.sc-steady { transform: scale(.82); animation: scFlick 1.4s ease-in-out infinite; }
.sc-fl.sc-ignite { animation: scGrow 1.4s 1s cubic-bezier(.2, 1.4, .4, 1) both; opacity: 0; }
.sc-hit { animation: scHit 2.4s ease-in-out infinite; } .sc-hit.b { animation-name: scHitB; } @keyframes scHit { 0%, 100% { transform: translateX(-16px); opacity: 0; } 40%, 60% { transform: translateX(10px); opacity: 1; } } @keyframes scHitB { 0%, 100% { transform: translateX(16px); opacity: 0; } 40%, 60% { transform: translateX(-10px); opacity: 1; } }
.sc-sp { animation: scSp 2.6s ease-out infinite; opacity: 0; } @keyframes scSp { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-70px) translateX(8px); opacity: 0; } }
.sc-wind path { stroke-dasharray: 40; animation: scWind 1.4s linear infinite; } @keyframes scWind { 0% { stroke-dashoffset: 40; opacity: 0; } 30% { opacity: 1; } 100% { stroke-dashoffset: -40; opacity: 0; } }
.sc-bang { transform-origin: 158px 48px; animation: scPulse .8s ease-in-out infinite; } @keyframes scPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.sc-ring { transform-origin: 100px 100px; animation: scSpin 9s linear infinite; } @keyframes scSpin { to { transform: rotate(360deg); } }
.sc-shield { transform-origin: 100px 100px; animation: scPulse 2s ease-in-out infinite; }
.sc-drop { animation: scDrop 2.4s cubic-bezier(.3, 1.3, .5, 1) infinite; } @keyframes scDrop { 0% { transform: translate(100px, -30px) rotate(-30deg); opacity: 0; } 30% { transform: translate(100px, 40px) rotate(8deg); opacity: 1; } 75%, 100% { transform: translate(100px, 36px) rotate(0); opacity: 1; } }
.sc-fall { animation: scFall 2.6s ease-in infinite; } @keyframes scFall { 0% { transform: translate(100px, -20px) rotate(-60deg) scale(1.3); opacity: 0; } 35% { opacity: 1; } 60%, 100% { transform: translate(100px, 92px) rotate(0) scale(1.3); opacity: 1; } }
.sc-cloud { animation: scBob 3s ease-in-out infinite; } @keyframes scBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.sc-rays { transform-origin: 100px 90px; animation: scSpin 18s linear infinite; }
.sc-bu { transform-box: fill-box; animation: scBu 2.2s ease-out infinite; opacity: 0; } @keyframes scBu { 0% { transform: translate(var(--x, 0)) scale(.2); opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(2.4); } }
.sc-out .sc-fl { animation: scOut 3s ease-in-out infinite; } @keyframes scOut { 0% { transform: scale(1); opacity: 1; } 70%, 100% { transform: scale(.35, .2); opacity: .15; } }
.sc-smoke path { stroke-dasharray: 60; animation: scSmoke 2.8s ease-out infinite; opacity: 0; } @keyframes scSmoke { 0% { stroke-dashoffset: 60; opacity: 0; transform: translateY(20px); } 30% { opacity: .9; } 100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-18px); } }
.sc-relit .sc-fl { animation: scRelit 3s ease-out infinite; } @keyframes scRelit { 0%, 30% { transform: scale(.15); opacity: 0; filter: grayscale(1); } 60% { transform: scale(.9); opacity: 1; filter: none; } 100% { transform: scale(1); opacity: 1; } }
.sc-burn { animation: scBurn 3s ease-in infinite; } @keyframes scBurn { 0% { transform: translate(100px, -20px) scale(.9); opacity: 0; } 25% { transform: translate(100px, 40px) scale(.9); opacity: 1; filter: none; } 55% { transform: translate(100px, 70px) scale(.7); opacity: .9; filter: sepia(1) saturate(6) brightness(1.1); } 80%, 100% { transform: translate(100px, 90px) scale(.2); opacity: 0; } }
.sc-orbit { transform-origin: 100px 100px; animation: scSpin 7s linear infinite; } .sc-orbit .sc-ch { }
.sc-tick { stroke-dasharray: 40; animation: scTick 2.4s ease-out infinite; } @keyframes scTick { 0% { stroke-dashoffset: 40; } 40%, 100% { stroke-dashoffset: 0; } }
.sc-z { animation: scZ 2.8s ease-in-out infinite; opacity: 0; } @keyframes scZ { 0% { transform: translate(0, 8px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translate(8px, -14px); opacity: 0; } }
.cel-badge + h2 { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .scn *, .scn { animation-duration: 0s !important; animation-iteration-count: 1 !important; } }
/* ---- Kiểu trang Unit trong cửa hàng ---- */
.lan2 .lsvg .hk { fill: #6a4a10; }
.sart.unitp .lan2 { padding: 0; pointer-events: none; } .sart.unitp .lbody { width: 44px; height: 62px; } .sart.unitp .lz { font-size: 1.1rem; margin-top: -3px; }
.unitdemo { padding: 16px 8px 8px; } .unitdemo .lanterns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; } .unitdemo .lan2 { padding: 6px 0 0; pointer-events: none; } .unitdemo .lan2::before { display: none; }
.lanterns.us-may .lan2 .lbody { animation-duration: 6s; } .lanterns.us-chuong .lan2 .lbody { animation-duration: 3.2s; } .lanterns.us-quat .lan2 .lbody { animation-duration: 5.4s; }
.lan2 .us-ngoc .bd { stroke-width: 3; } .lan2 .us-may .bd { stroke-linejoin: round; }
.lan2 .us-ngoc ~ .lz, .lanterns.us-ngoc .lz { margin-top: 2px; } .lanterns.us-may .lz { margin-top: 8px; } .lanterns.us-hulo .lz { margin-top: 14px; font-size: 1.5rem; } .lanterns.us-dao .lz, .lanterns.us-quat .lz, .lanterns.us-lenh .lz { margin-top: 4px; } .lanterns.us-chuong .lz { margin-top: 6px; }
.chip.charm { color: #f6d34a; } .chip.charm.zero { opacity: .6; }

/* ---- Thẻ "Học thêm" cùng kiểu thẻ HSK ---- */
@media (min-width: 560px) { .opt-cards.three { grid-template-columns: repeat(3, 1fr); } }
.opt-cards.three .opt-card { padding: 16px 14px; } .opt-cards.three .opt-card b { font-size: 1.35rem; }
.opt-card.py { background: var(--lemon); } .opt-card.thi { background: var(--mint); } .opt-card.cy { background: var(--peach); }
.bottag { font-style: normal; font-size: .62rem; font-weight: 800; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--line); color: var(--muted); vertical-align: 2px; letter-spacing: .04em; }

/* ---- Tốc Ấn: ấn đỏ thưởng tốc độ ---- */
.tocan { display: flex; gap: 10px; justify-content: center; margin: 6px 0 12px; }
.ts-seal { width: 52px; height: 52px; display: grid; place-items: center; font-family: var(--hanzi, serif); font-size: 1.9rem; font-weight: 800; border-radius: 6px; border: 2px dashed var(--line); color: var(--line); transform: rotate(var(--r, 0deg)); }
.ts-seal:nth-child(odd) { --r: -4deg; } .ts-seal:nth-child(even) { --r: 3deg; }
.ts-seal.on { background: #c0392b; color: #ffe9c4; border: 2px solid #7a1f16; box-shadow: inset 0 0 0 3px #c0392b, inset 0 0 0 4.5px #ffe9c4aa, 0 3px 0 #7a1f16; animation: stamp .5s var(--d, 0s) cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { 0% { transform: scale(2.4) rotate(var(--r)); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(var(--r)); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ts-seal.on { animation: none; } }
.lan2 .lhook { height: 14px !important; }
button.scn-it { cursor: pointer; color: var(--fg); font: inherit; }

/* ---- Dấu ấn đánh giá (thay sao) ---- */
.starrow .ansvg { width: 1em; height: 1em; vertical-align: 0; } .starrow .ansvg.off { color: var(--line); }
.starrow .ansvg:nth-child(odd) { transform: rotate(-3deg); } .starrow .ansvg:nth-child(even) { transform: rotate(2.5deg); }
.big-stars .ansvg { width: 2.4rem; height: 2.4rem; filter: drop-shadow(0 2px 0 #7a1f16); } .big-stars .ansvg.on { animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both; } .big-stars .ansvg:nth-child(2).on { animation-delay: .2s; } .big-stars .ansvg:nth-child(3).on { animation-delay: .4s; }
.gs .starrow { font-size: 1.15rem; gap: 3px; }
.starrow .ansvg.off { color: var(--muted); opacity: .55; }

.starrow .ansvg:nth-child(n) { transform: none; } .starrow .ansvg.on { filter: drop-shadow(0 1px 1px rgba(120, 30, 60, .35)); } .big-stars .ansvg { filter: drop-shadow(0 2px 3px rgba(120, 30, 60, .4)); }

.starrow .ansvg { height: 1.08em; } .big-stars .ansvg { height: 2.6rem; width: 2.4rem; }

.starrow .ansvg { height: 1em; width: 1.15em; } .big-stars .ansvg { height: 2.2rem; width: 2.6rem; }

/* ---- Ký hiệu đánh giá trong cửa hàng ---- */
.starrow .ansvg { height: 1em; width: 1.15em; } .starrow.big { font-size: 2.4rem; gap: 8px; display: flex; justify-content: center; } .starrow.big .ansvg { width: 1.1em; height: 1em; }
.sart.ratep { font-size: 1.5rem; } .ratedemo { padding: 22px 8px; }
/* ---- Lời thề giữ lửa ---- */
.pledge { background: var(--card); border: 1px solid var(--gold, #f2c230); border-radius: 14px; padding: 12px 14px; margin: 10px 0; } .pledge.fail { border-color: var(--line); } .pledge .h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.pl-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; } @media (min-width: 560px) { .pl-opts { grid-template-columns: repeat(4, 1fr); } }
.pl-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; text-align: left; } .pl-opt b { font-size: 1.05rem; } .pl-opt small { color: var(--muted); }
.sk-pl { margin-top: 6px; font-size: .85rem; color: var(--gold, #d4a017); display: flex; align-items: center; gap: 6px; } .sk-pl .ic { width: 1rem; height: 1rem; }
/* ---- Đường lửa (mốc streak) và bình luận ---- */
.skpath { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.skn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 4px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--muted); text-align: center; }
.skn b { font-size: 1.15rem; color: var(--fg); } .skn small { font-size: .7rem; } .skn em { font-style: normal; font-size: .68rem; color: var(--red); margin-top: 2px; }
.skn-fl { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 2px; background: var(--bg); } .skn-fl .ic { width: 22px; height: 22px; }
.skn.done { background: linear-gradient(#ff9a3c22, #ff7a1a33); border-color: #f08a1c; } .skn.done .skn-fl { background: linear-gradient(#ffb23f, #f0701a); color: #fff; box-shadow: 0 0 10px #f0701a88; } .skn.done .skn-fl .ic { fill: #fff3c0; }
.skn.cur { border-color: var(--red); } .skn.cur .skn-fl { background: conic-gradient(var(--red) calc(var(--p, 0) * 1%), var(--line) 0); color: var(--red); position: relative; } .skn.cur .skn-fl::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); z-index: 0; } .skn.cur .skn-fl .ic { position: relative; z-index: 1; }
.skn:not(.done):not(.cur) { opacity: .6; }
.achcat { margin: 14px 0 4px; font-family: var(--serif); } .achcat small { color: var(--muted); font-weight: 400; }
.goal.ach .gg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; text-align: right; font-size: .8rem; } .goal.ach .gg .rtool { padding: 2px 8px; }
.cmts { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: grid; gap: 6px; } .cmt { font-size: .9rem; position: relative; padding-right: 26px; } .cmt small { color: var(--muted); margin-left: 4px; } .cmt .cdel { position: absolute; right: 0; top: -2px; padding: 0 4px; }
.cmform { display: flex; gap: 6px; } .cmform input { flex: 1; min-width: 0; }
.pa.lk { display: flex; justify-content: center; }
.bottag.real { background: #2b7a4b33; color: #4fbf7f; }

.bottag { display: inline-block; width: auto; flex: none; font-style: normal; font-size: .62rem; font-weight: 800; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--line); color: var(--muted); vertical-align: 2px; letter-spacing: .04em; }
.owrow { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin: 6px 0; } .owrow label { display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.post.notice { border-color: var(--gold, #f2c230); background: color-mix(in srgb, var(--gold, #f2c230) 10%, var(--card)); } .post.notice .pb p { font-weight: 700; } .pa.nt { display: none; }
.lrow .rnick .bottag { align-self: flex-start; margin: 2px 0 0; background-image: none; }

/* ---- Nhắc học ---- */
.remind { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 10px 0; } .rm-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .rm-h b { display: flex; align-items: center; gap: 6px; } .rm-h .ic { width: 1.1rem; height: 1.1rem; }
.rm-body { margin-top: 8px; display: grid; gap: 8px; } .rm-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .rm-pick input[type=time] { padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
.rm-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 82px; z-index: 50; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 520px); padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--gold, #f2c230); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); animation: fadeup .25s ease both; }
/* ---- Hướng dẫn thao tác trực tiếp ---- */
#guide { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.g-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55), 0 0 0 3px var(--gold, #ffd23f), 0 0 18px 4px rgba(255, 210, 63, .7); transition: left .25s, top .25s, width .25s, height .25s; pointer-events: none; animation: gpulse 1.4s ease-in-out infinite; } .g-spot.shake { animation: gshake .4s; }
@keyframes gpulse { 50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55), 0 0 0 3px var(--gold, #ffd23f), 0 0 28px 8px rgba(255, 210, 63, .9); } } @keyframes gshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.g-hand { position: fixed; left: 0; top: 0; opacity: 0; transform: translate(60vw, 80vh); transition: transform .9s cubic-bezier(.3, .8, .3, 1), opacity .3s; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); } .g-hand.on { opacity: 1; } .g-hand svg { display: block; }
.g-hand i { position: absolute; left: -6px; top: -6px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--gold, #ffd23f); opacity: 0; } .g-hand.tap i { animation: gtap .38s ease-out; } @keyframes gtap { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.g-card { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; width: min(92vw, 460px); background: var(--card); color: var(--fg); border: 1px solid var(--gold, #ffd23f); border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); pointer-events: auto; } .g-card.top { bottom: auto; top: 12px; }
.g-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .g-h small { color: var(--muted); } .g-card p { margin: 6px 0 8px; line-height: 1.45; } .g-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.guidelist { display: grid; gap: 8px; margin: 8px 0 12px; } .guidelist .mebtn b { font-weight: 700; }
/* ---- Bảng Vàng: xếp hạng mang dáng bảng danh khoa cử, không dùng huy chương/vùng xanh đỏ quen thuộc ---- */
.rank-list .lrow { border-radius: 6px; border: 1px solid #b8860b66; background: linear-gradient(90deg, color-mix(in srgb, var(--gold, #d4a017) 10%, var(--card)), var(--card) 30%); position: relative; }
.rank-list .lrow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 6px 0 0 6px; background: linear-gradient(#c0392b, #8a1f16); }
.rank-list .lrow.top { background: linear-gradient(90deg, color-mix(in srgb, var(--gold, #d4a017) 22%, var(--card)), var(--card) 45%); }
.rank-list .lrow.dn { opacity: .85; }
.rpos.bv { display: grid; place-items: center; } .seal-rk { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 5px; font-family: var(--hanzi, serif); font-size: 1.3rem; font-weight: 800; color: #ffe9c4; background: #c0392b; border: 2px solid #7a1f16; box-shadow: inset 0 0 0 2px #c0392b, inset 0 0 0 3px #ffe9c4aa; transform: rotate(-3deg); }
.bv2 .seal-rk { background: #b8863b; border-color: #6e4a12; box-shadow: inset 0 0 0 2px #b8863b, inset 0 0 0 3px #fff3c0aa; } .bv3 .seal-rk { background: #6b7a8f; border-color: #36404f; box-shadow: inset 0 0 0 2px #6b7a8f, inset 0 0 0 3px #e6edf7aa; }
.zone { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; } .zone i { flex: 1; height: 0; border-top: 2px dashed currentColor; opacity: .6; } .zone.up { color: #d4a017; } .zone.down { color: #b9564a; } .zone .ic { display: none; }
.gate-note { margin: 4px 0 8px; }

.opt-card small { text-align: left; }

/* ---- Khi có khung/nút lạ (như quảng cáo của nơi lưu trữ) nằm đè đáy màn hình: nâng thanh tab và các hộp nổi lên ---- */
html.nf-badge .tabbar { bottom: 78px; left: 8px; right: 8px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
html.nf-badge .tabpad { height: 170px; }
html.nf-badge .rm-toast, html.nf-badge .g-card:not(.top) { bottom: 168px; }
.owtable { overflow-x: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; } .owtable table { width: 100%; border-collapse: collapse; font-size: .82rem; white-space: nowrap; } .owtable th, .owtable td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); } .owtable th { color: var(--muted); position: sticky; top: 0; background: var(--card); } .owtable tbody tr { cursor: pointer; } .owtable tbody tr:hover { background: color-mix(in srgb, var(--gold, #f2c230) 10%, transparent); }
/* ---- Ngăn kéo ở tab Tôi ---- */
.mesec { border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; background: var(--card); } .mesec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; } .mesec > summary::-webkit-details-marker { display: none; } .mesec > summary .h2 { margin: 0; }
.mesec .mchev { display: grid; place-items: center; transition: transform .2s; color: var(--muted); } .mesec .mchev .ic { width: 1.3rem; height: 1.3rem; } .mesec[open] > summary .mchev { transform: rotate(90deg); }
.mesec-b { padding: 0 14px 14px; }
.chip.ownchip { color: #ffd23f; border-color: #ffd23f88; } .chip.ownchip .ic { width: 1.05rem; height: 1.05rem; }

/* ---- Màn đăng nhập / đăng ký (chắn trước web) ---- */
html.auth-locked #app, html.auth-locked #mascot, html.auth-locked .rm-toast, html.auth-locked #guide, html.auth-locked #tour, html.auth-locked #cel { display: none !important; }
#authgate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: linear-gradient(#1a0f3a, #3a1f5e 60%, #7a2a3a); color: #fff3e0; }
.ag-sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 8%, #fff, transparent), radial-gradient(1px 1px at 55% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 78% 12%, #fff, transparent), radial-gradient(1px 1px at 90% 30%, #fff, transparent), radial-gradient(1px 1px at 8% 45%, #fff, transparent); }
.ag-moon { position: absolute; right: 12%; top: 8%; width: 70px; height: 70px; border-radius: 50%; background: #f6e7a6; box-shadow: 0 0 40px 10px rgba(246, 231, 166, .35); } .ag-moon::after { content: ""; position: absolute; left: 18px; top: -4px; width: 64px; height: 64px; border-radius: 50%; background: #2a1750; }
.ag-mt { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; }
.ag-l { position: absolute; top: -6px; transform-origin: 50% 0; animation: lansway 5s ease-in-out infinite; } .ag-ln { width: 64px; height: auto; display: block; filter: drop-shadow(0 0 14px rgba(255, 150, 60, .55)); }
.ag-l.l1 { left: 5%; } .ag-l.l2 { left: 16%; top: -30px; animation-delay: -1.5s; } .ag-l.l3 { right: 8%; animation-delay: -2.5s; } .ag-l.l4 { right: 20%; top: -34px; animation-delay: -.8s; } .ag-l.l2 .ag-ln, .ag-l.l4 .ag-ln { width: 52px; }
.ag-card { position: relative; width: min(94vw, 420px); background: rgba(24, 14, 44, .92); border: 1px solid rgba(255, 210, 63, .45); border-radius: 22px; padding: 18px 18px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.ag-body { display: grid; gap: 10px; } .ag-brand { display: flex; align-items: center; gap: 12px; } .ag-brand h1 { margin: 0; font-size: 1.35rem; font-family: var(--serif, serif); } .ag-brand small { color: #e8a060; letter-spacing: .3em; }
.ag-mas { display: flex; align-items: center; gap: 10px; } .ag-face { width: 64px; height: 64px; flex: none; animation: agbob 3s ease-in-out infinite; } .ag-face svg { width: 100%; height: 100%; }
.ag-say { position: relative; background: #fff3e0; color: #3a2412; border-radius: 14px; padding: 8px 12px; font-size: .9rem; line-height: 1.4; } .ag-say::before { content: ""; position: absolute; left: -8px; top: 22px; border: 8px solid transparent; border-right-color: #fff3e0; border-left: 0; }
@keyframes agbob { 50% { transform: translateY(-4px) rotate(2deg); } }
.ag-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 4px; } .ag-tabs button { padding: 9px; border-radius: 9px; border: 0; background: transparent; color: #ddd0c0; font-weight: 700; } .ag-tabs button.on { background: #e04e00; color: #fff; }
#authgate label { display: grid; gap: 4px; font-size: .85rem; color: #e8d8c4; } #authgate input[type=email], #authgate input[type=text], #authgate input[type=password] { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .3); color: #fff; font: inherit; } #authgate input:focus { outline: 2px solid #ffd23f; outline-offset: 1px; }
.ag-pw { position: relative; display: block; } .ag-pw input { padding-right: 64px !important; } .ag-pw button { position: absolute; right: 6px; top: 6px; bottom: 6px; border-radius: 9px; border: 0; padding: 0 12px; background: rgba(255, 255, 255, .14); color: #fff; }
.ag-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; } .ag-chk { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px !important; flex-direction: row; } .ag-opt .link { background: none; border: 0; color: #ffd23f; text-decoration: underline; padding: 0; }
.ag-msg { min-height: 1.2em; margin: 0; color: #ffb3a0; font-size: .85rem; } .ag-go { width: 100%; padding: 12px; font-size: 1rem; } .ag-foot { color: #b8a48e; text-align: center; font-size: .75rem; } .ag-load { text-align: center; color: #e8d8c4; }
@media (prefers-reduced-motion: reduce) { .ag-l, .ag-face { animation: none; } }
/* ---- Linh vật dẫn đường (Tiểu Ngộ) ---- */
.mface .f-cheer, .mface .f-bad { display: none; } .mface .f-ok { display: block; } .mface.cheer .f-ok { display: none; } .mface.cheer .f-cheer { display: block; }
.tcard .tbody { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; } .tmas { width: 62px; height: 62px; flex: none; animation: agbob 3s ease-in-out infinite; } .tmas svg { width: 100%; height: 100%; } .tmas.cheer svg { animation: mjump .45s 2; } .tsay { position: relative; flex: 1; min-width: 0; } .tsay b { display: block; } .tsay p { margin: 4px 0 0; }
.g-line { display: flex; gap: 8px; align-items: flex-start; } .g-mas { width: 46px; height: 46px; flex: none; animation: agbob 3s ease-in-out infinite; } .g-mas svg { width: 100%; height: 100%; } .g-line p { margin: 2px 0 6px; }
.ag-hint { color: #b8a48e; font-size: .72rem; } #authgate input[type=date] { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .3); color: #fff; font: inherit; color-scheme: dark; }
.gen-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .gen-chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .8rem; } .gen-chip b { color: var(--gold, #f2c230); }.alertrow .fav { background: #c0392b; color: #fff; font-weight: 800; } .alertrow small { white-space: normal; }

/* Ô chọn ngày trên điện thoại (iOS) hay tràn khỏi khung: ép về đúng bề rộng */
#authgate input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 44px; text-align: left; }
#authgate input[type=date]::-webkit-date-and-time-value { text-align: left; }
.ag-msg { background: rgba(255, 120, 90, .12); border-radius: 10px; padding: 0; } .ag-msg:not(:empty) { padding: 8px 10px; } .ag-resend { justify-self: start; background: none; border: 0; color: #ffd23f; text-decoration: underline; padding: 0; }
.ag-ok { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 8px 0 6px; } .ag-ok .ag-face { width: 96px; height: 96px; } .ag-ok h2 { margin: 0; color: #ffd23f; font-family: var(--serif, serif); } .ag-ok p { margin: 0; color: #e8d8c4; }
.ag-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #ffd23f; animation: agspin .8s linear infinite; } @keyframes agspin { to { transform: rotate(360deg); } }
.memtip { text-align: center; margin: 10px 0; color: var(--muted); } .memtip b { color: var(--fg); } .memtip .pvn { color: var(--red); font-weight: 800; } .memtip .rtool { margin-left: 8px; }

/* ---- Lật Bài: cả lá bài xoay 3D (mặt úp sang mặt chữ), chữ co theo kích thước thẻ ---- */
button.mcard.flip3d.flip3d { perspective: 900px; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; overflow: visible !important; height: 104px; }
.mcard.flip3d .mc-in { position: absolute; inset: 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .3, 1); transition-delay: var(--d, 0s); }
.mcard.flip3d.up .mc-in { transform: rotateY(180deg); }
.mcard.flip3d .front, .mcard.flip3d .back { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; box-sizing: border-box; display: flex !important; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px 8px; overflow: hidden; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); border: 1px solid var(--line); }
.mcard.flip3d .back { transform: rotateY(180deg); border: 2px solid var(--gold); word-break: break-word; hyphens: auto; line-height: 1.15; }
.mcard.flip3d .back b { font-size: var(--zs, 2rem); line-height: 1.1; } .mcard.flip3d .back small { font-size: .78rem; margin-top: 2px; } .mcard.flip3d .back span { font-size: var(--vs, 1rem); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mcard.flip3d.done .back { background: var(--ok); color: #fff; border-color: var(--ok); } .mcard.flip3d.done .back small { color: #fff; }
.mcard.flip3d.done .mc-in { animation: mcpop .45s ease; } @keyframes mcpop { 40% { transform: rotateY(180deg) scale(1.08); } }
.mcard.flip3d.bk-sen .front { background: linear-gradient(135deg, #e06a9a, #8f3a78) !important; border-color: transparent; } .mcard.flip3d.bk-rong .front { background: linear-gradient(135deg, #2f8f7a, #14504a) !important; border-color: transparent; } .mcard.flip3d.bk-phuc .front { background: linear-gradient(135deg, #d4401f, #8a1f10) !important; border-color: transparent; }
.mcard.flip3d.up .front { display: flex !important; }
@media (prefers-reduced-motion: reduce) { .mcard.flip3d .mc-in { transition-duration: .01s; } }
.reqpanel { border-color: var(--gold, #f2c230); margin: 8px 0; } .reqpanel .frow { flex-wrap: wrap; gap: 8px; }

.owtable td .rtool { white-space: nowrap; }

.voicebox .vsel { display: grid; gap: 4px; margin: 8px 0; font-size: .85rem; color: var(--muted); } .voicebox select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; } .voicebox .vlab { font-size: .85rem; color: var(--muted); margin: 4px 0; }

.vstyles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 6px 0 8px; } @media (min-width: 560px) { .vstyles { grid-template-columns: repeat(4, 1fr); } }
.vst { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; border-radius: 12px; text-align: left; } .vst b { font-size: .9rem; } .vst small { color: var(--muted); font-size: .72rem; line-height: 1.25; } .vst.on { border-color: var(--red); background: var(--lemon); }
/* ---- Nút tốc độ đọc nổi ---- */
#spd { position: fixed; right: 12px; bottom: 92px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
html.nf-badge #spd { bottom: 172px; }
.spd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--gold, #f2c230); color: var(--fg); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); font-weight: 700; } .spd-btn .ic { width: 1.1rem; height: 1.1rem; }
.spd-pop { display: none; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 250px; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); } #spd.open .spd-pop { display: flex; }
.spd-pop button { padding: 6px 10px; border-radius: 999px; } .spd-pop button.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); } .spd-pop .spd-v { width: 100%; background: transparent; border: 0; text-decoration: underline; color: var(--muted); }
.voicebox.bare { padding: 0; } .voicebox.bare .rm-h { justify-content: flex-end; }
#app.noanim > *, #app.noanim .tabbar button.on span { animation: none !important; }

/* Đề thi: tiêu đề phần, đoạn văn dài, ô viết bài */
.expart { margin: 0 0 8px; padding: 8px 12px; border-left: 4px solid var(--accent, #e0602a); background: var(--card); border-radius: 8px; font-size: .92rem; line-height: 1.45; text-align: left; }
.expart b { font-size: 1rem; }
.zhline.passage { font-size: 1.12rem; line-height: 1.95; text-align: left; white-space: pre-line; width: 100%; }
.exin.exta { min-height: 160px; resize: vertical; line-height: 1.8; font-size: 1.1rem; }

.readgate { padding: 18px 12px; text-align: center; }
.readgate p { margin: 0 0 12px; line-height: 1.6; }
.readleft { margin: 0 0 6px; }

/* Đề thi: gọn lại để thấy hết đáp án mà không phải kéo xuống */
.qbox.exq { min-height: 0; padding: 10px 12px; gap: 2px; }
.qbox.exq .spk { width: 54px; height: 54px; font-size: 1.8rem; }
.qbox.exq .spk .ic { width: 1.7rem; height: 1.7rem; }
.qbox.exq .note { margin: 2px 0 0; font-size: .85rem; }
.qbox.exq .zhline { font-size: 1.35rem; line-height: 1.6; }
.qbox.exq + .opts.one { gap: 6px; margin-top: 8px; }
.qbox.exq + .opts.one .opt { padding: 9px 12px; }
.qbox.exq + .opts.one .opt.long { font-size: 1.15rem; line-height: 1.45; }
.qbox.exq + .opts.one .opt.long.vi { font-size: .95rem; line-height: 1.4; }
.expart { margin-bottom: 6px; padding: 5px 10px; font-size: .85rem; }
.expart br { display: none; }
.expart b::after { content: " · "; }
/* Hai gói: khung so sánh, Unit bị khóa */
.tiers { display: grid; gap: 12px; margin-bottom: 12px; }
.tiercard { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); text-align: left; }
.tiercard.t2 { border-color: #d4a017; box-shadow: inset 0 0 0 1px rgba(212, 160, 23, .35); }
.tiercard.cur { outline: 2px solid var(--red, #c0392b); }
.tiercard .th { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 1.1rem; }
.tiercard .th .vipmark { width: 26px; height: 26px; }
.tiercard .th em { margin-left: auto; font-style: normal; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: rgba(212, 160, 23, .2); }
.tiercard .th em.now { background: var(--red, #c0392b); color: #fff; margin-left: 4px; }
.tiercard .viplist { margin: 0 0 8px; }
.unit.locked { opacity: .72; }
.unit.locked .us { display: inline-flex; align-items: center; }
.unit.locked .us .ic { width: 1.1rem; height: 1.1rem; }
/* ===== Ô nhập, danh sách chọn, ô soạn: một kiểu chung cho cả web (phẳng, bo tròn, viền ấm, nhấn đỏ khi chọn) ===== */
:where(select, textarea, input:not([type]), input[type=text], input[type=email], input[type=number], input[type=search], input[type=password], input[type=date], input[type=time], input[type=url], input[type=tel]) {
  font: inherit; font-size: 1rem; color: var(--fg); background: var(--card, #fff); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; box-sizing: border-box; max-width: 100%; transition: border-color .15s ease, box-shadow .15s ease;
}
:where(textarea) { width: 100%; line-height: 1.55; resize: vertical; min-height: 84px; }
:where(select) {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a6a3a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
:where(select, textarea, input):focus-visible { outline: none; border-color: var(--red, #c0392b); box-shadow: 0 0 0 3px rgba(192, 57, 43, .16); }
:where(select, textarea, input)::placeholder { color: var(--muted); opacity: .75; }
:where(select, textarea, input):disabled { opacity: .55; cursor: not-allowed; }
select option { color: #2b1d10; background: #fffaf0; }
/* Khung có nhãn phía trên, dùng trong các form chủ ứng dụng */
.fld { display: grid; gap: 5px; margin: 0; font-size: .82rem; color: var(--muted); text-align: left; }
.fld > span { font-weight: 700; letter-spacing: .01em; }
.fld :where(input, select, textarea), .finput { width: 100%; }
.finput { font: inherit; font-size: 1rem; color: var(--fg); background: var(--card, #fff); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; box-sizing: border-box; }
.finput:focus-visible { outline: none; border-color: var(--red, #c0392b); box-shadow: 0 0 0 3px rgba(192, 57, 43, .16); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 2px 0; }
.formpanel { display: grid; gap: 12px; text-align: left; padding: 14px; }
.formpanel > .note { margin: 0; }
.formpanel .fh { margin: 0; font-size: 1.08rem; color: var(--red, #c0392b); }
.formpanel .row { justify-content: flex-start; margin: 0; }
.owrow { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0; }
.owrow .fld { flex: 1 1 150px; }
.owrow button { flex: none; }
.howto { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 2px 14px 6px; margin-bottom: 12px; text-align: left; }
.howto > summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; display: flex; gap: 8px; align-items: center; color: var(--red, #c0392b); }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::after { content: "▾"; margin-left: auto; opacity: .6; transition: transform .15s ease; }
.howto:not([open]) > summary::after { transform: rotate(-90deg); }
.howto .steps { margin: 2px 0 8px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; font-size: .93rem; }
.racts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.plantag { font-style: normal; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #e3e7ee; color: #3f4a5a; vertical-align: middle; }
.plantag.t2 { background: rgba(212, 160, 23, .25); color: #7a5600; }
.plansheet .tierchips, .tierchips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.tierchips button { flex: 1; min-width: 96px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--fg); font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.tierchips button.on { border-color: var(--red, #c0392b); background: rgba(192, 57, 43, .10); color: var(--red, #c0392b); font-weight: 700; }
.tierchips button.rm.on { border-color: #888; background: rgba(120, 120, 120, .12); color: var(--fg); }
.plansheet .fld { margin: 8px 0; }
/* Ô chat, bình luận, thêm bạn, bảng tin: cùng kiểu, nút gửi liền khối */
.chatbar, .fradd, .cmform, .rcI { align-items: stretch; }
.chatbar input, .fradd input, .cmform input, .rcI input, .compose textarea { border: 1.5px solid var(--line); border-radius: 14px; background: var(--card, #fff); padding: 11px 14px; }
.chatbar input:focus-visible, .fradd input:focus-visible, .cmform input:focus-visible, .rcI input:focus-visible, .compose textarea:focus-visible { outline: none; border-color: var(--red, #c0392b); box-shadow: 0 0 0 3px rgba(192, 57, 43, .16); }
.chatbar button, .fradd button, .cmform button { border-radius: 14px; }
.compose { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.perkform textarea, .perkform select { margin: 0; }
/* ===== Chat trong phòng: thanh cố định ở cuối màn hình, luôn thấy ô nhập ===== */
.rcdock { position: fixed; left: 0; right: 0; bottom: calc(67px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; padding: 0 12px 8px; pointer-events: none; }
.rcdock > * { pointer-events: auto; }
body.has-rcdock #app { padding-bottom: 150px; }
.rcd-bar { display: flex; gap: 8px; align-items: stretch; padding: 7px; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: 0 6px 22px rgba(60, 30, 10, .18); }
.rcd-bar input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 13px; background: var(--bg, var(--card)); padding: 10px 12px; }
.rcd-bar button { flex: none; width: 46px; border-radius: 13px; padding: 0; display: grid; place-items: center; position: relative; }
.rcd-bar .ic { width: 20px; height: 20px; }
.rcd-t { border: 1.5px solid var(--line); background: var(--card); color: var(--fg); }
.rcdock[data-open="1"] .rcd-t { background: var(--lemon, #fbefc0); border-color: var(--gold, #c9962b); }
.rcd-t .badge { position: absolute; top: -6px; right: -6px; }
.rcd-float { display: grid; gap: 5px; margin: 0 0 6px; justify-items: start; pointer-events: none; }
.rcd-float .rcm { max-width: 86%; padding: 6px 12px; border-radius: 14px 14px 14px 4px; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); box-shadow: 0 3px 10px rgba(60, 30, 10, .14); animation: rcIn .25s ease both, rcOut 11s linear forwards; font-size: .92rem; overflow-wrap: anywhere; }
.rcd-float .rcm b { margin-right: 6px; color: var(--red); } .rcd-float .rcm.me { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--lemon, #fbefc0); }
@keyframes rcIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rcOut { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
.rcd-panel { display: none; gap: 8px; padding: 10px 12px; margin-bottom: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: 0 8px 26px rgba(60, 30, 10, .2); }
.rcdock[data-open="1"] .rcd-panel { display: grid; animation: rcIn .2s ease both; }
.rcdock .rcM { height: min(34vh, 250px); background: var(--bg, rgba(0, 0, 0, .04)); }
.rcdock .rcm { padding: 5px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; } .rcdock .rcm b { margin-right: 6px; color: var(--red); } .rcdock .rcm.me { align-self: flex-end; background: var(--lemon, #fbefc0); }
.rcdock .rcQ { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; } .rcdock .rcQ button { flex: none; }
@media (prefers-reduced-motion: reduce) { .rcd-float .rcm, .rcdock[data-open="1"] .rcd-panel { animation: none; } }
.rcd-t .badge[hidden] { display: none; }

/* Cửa hàng: các mục con xếp hàng ngang như hàng tab phía trên, mỗi mục một nút */
.shopsecs { margin-top: 6px; border-bottom: 0 !important; }
.shopsecs button { border-radius: 999px !important; border: 1.5px solid var(--line) !important; background: var(--card); padding: 7px 14px !important; font-size: .92rem; color: var(--fg); }
.shopsecs button.on { border-color: var(--red) !important; background: rgba(192, 57, 43, .10) !important; color: var(--red); font-weight: 700; }
.shsecnote { margin: 10px 0 8px; font-size: .85rem; color: var(--muted); }
/* Thanh xem thử giao diện chưa mua */
.tryskin { position: fixed; left: 0; right: 0; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 60; margin: 0 auto; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--card); border: 1.5px solid var(--gold, #c9962b); border-radius: 16px; box-shadow: 0 8px 26px rgba(0, 0, 0, .28); }
.tryskin .row { margin: 0; gap: 8px; }
/* Gợi ý mua combo giao diện + cảnh */
.si-sug { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--sky); font-size: .88rem; line-height: 1.45; }
.si-meta s { opacity: .55; margin-left: 4px; }
.shopinfo .row { flex-wrap: wrap; gap: 8px; }
.bgs.fxs .bgt:not(.thumb) { padding: 8px 12px; }

/* Hai gói đặt ngang nhau để so sánh, đỡ phải kéo dài */
.tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.tiercard { padding: 8px; min-width: 0; }
.tiercard .th { flex-wrap: wrap; gap: 4px 6px; font-size: .98rem; }
.tiercard .th .vipmark { width: 22px; height: 22px; }
.tiercard .th em { font-size: .66rem; padding: 1px 7px; }
.tiercard .viplist { gap: 6px; }
.tiercard .viplist li { gap: 6px; padding: 6px 7px; }
.tiercard .viplist .ic { width: 17px; height: 17px; margin-top: 1px; }
.tiercard .viplist b { font-size: .8rem; line-height: 1.25; }
.tiercard .viplist small { font-size: .7rem; line-height: 1.3; }
.tiercard .vipplans { grid-template-columns: 1fr; }
.tiercard .vplan { padding: 8px 6px; } .tiercard .vplan b { font-size: .86rem; } .tiercard .vplan span { font-size: 1.05rem; }
@media (min-width: 700px) {
  .tiers { gap: 14px; }
  .tiercard { padding: 12px; } .tiercard .viplist b { font-size: .92rem; } .tiercard .viplist small { font-size: .8rem; }
  .tiercard .viplist .ic { width: 22px; height: 22px; }
}

/* ===== Tab Cá nhân: 3 ô hành động ===== */
.pftiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 12px; } .pftiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pft { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 12px 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-card, 16px); background: linear-gradient(155deg, var(--card), var(--pc, var(--sky))); box-shadow: 0 2px 0 rgba(0, 0, 0, .04); min-width: 0; }
.pft.t1 { --pc: var(--lav); } .pft.t2 { --pc: var(--lemon); } .pft.t3 { --pc: var(--mint); }
.pft b { font-size: .98rem; } .pft small { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.pfti { position: relative; width: 38px; height: 38px; margin-bottom: 6px; border-radius: 12px; display: grid; place-items: center; background: var(--red); color: var(--on-red, #fff); }
.pfti .ic { width: 20px; height: 20px; } .pfti .invbadge { position: absolute; right: -6px; top: -6px; }
@media (max-width: 420px) { .pft { padding: 10px 8px; } .pft small { display: none; } .pfti { margin-bottom: 4px; } }

/* ===== Kho đồ: tab, ô đang dùng, thẻ kéo thả ===== */
.invtabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; } .invtabs::-webkit-scrollbar { display: none; }
.itab { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .9rem; }
.itab .ic { width: 17px; height: 17px; } .itab.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.loadout { position: sticky; top: var(--hbar, 61px); z-index: 6; display: flex; gap: 8px; overflow-x: auto; padding: 8px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: var(--r-card, 16px); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); scrollbar-width: thin; }
.islot { flex: 1 0 104px; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; text-align: center; border: 2px dashed var(--line); border-radius: 14px; background: var(--card); transition: border-color .15s, background .15s, transform .15s; min-width: 0; }
.islot .isart { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--sky); } .islot.empty .isart { opacity: .4; }
.islot .isart .sart, .itile .itart .sart, .idrag-ghost .sart { width: 100%; height: 100%; min-height: 0; margin: 0; }
.islot small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; } .islot b { font-size: .8rem; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.islot.can { border-color: var(--gold); border-style: solid; background: var(--lemon); animation: islotPulse 1s ease-in-out infinite; } .islot.over { transform: scale(1.06); background: color-mix(in srgb, var(--gold) 35%, var(--card)); }
.idragging .islot:not(.can) { opacity: .45; } .islot.no { animation: islotNo .4s; }
@keyframes islotPulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 40%, transparent); } } @keyframes islotNo { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.idrag { margin: 2px 0 10px; }
.igroup { margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--r-card, 16px); background: var(--card); overflow: hidden; }
.igroup > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; } .igroup > summary::-webkit-details-marker { display: none; }
.igroup > summary span { font-weight: 800; } .igroup > summary small { margin-left: auto; color: var(--muted); font-size: .78rem; text-align: right; } .igroup > summary i .ic { width: 16px; height: 16px; transition: transform .2s; } .igroup[open] > summary i .ic { transform: rotate(90deg); }
.itiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 0 10px 12px; }
.itile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); cursor: grab; user-select: none; -webkit-user-select: none; min-width: 0; }
.itile .itart { width: 100%; height: 62px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--sky); pointer-events: none; }
.itile b { font-size: .78rem; line-height: 1.2; text-align: center; max-width: 100%; overflow-wrap: anywhere; }
.itile.on { border-color: var(--red); background: color-mix(in srgb, var(--red) 9%, var(--card)); } .itile.dragging { opacity: .35; }
.itick { position: absolute; right: 5px; top: 5px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: var(--on-red, #fff); } .itick .ic { width: 13px; height: 13px; }
.igrip { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; z-index: 2; touch-action: none; cursor: grab; background: radial-gradient(circle, var(--muted) 1.4px, transparent 1.6px) 0 0 / 7px 7px; opacity: .55; border-radius: 6px; -webkit-mask: linear-gradient(#000, #000); }
@media (hover: hover) and (pointer: fine) { .igrip { opacity: 0; } .itile:hover .igrip { opacity: .5; } }
.idrag-ghost { position: fixed; left: 0; top: 0; width: 64px; height: 64px; z-index: 9999; pointer-events: none; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); opacity: .92; background: var(--card); border: 2px solid var(--gold); }
body.idragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
@media (min-width: 900px) { html[data-wide="1"] .loadout { flex-wrap: wrap; overflow: visible; } html[data-wide="1"] .islot { flex: 0 1 150px; } }
.itile .sart.dots, .islot .sart.dots { display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--card); } .itile .sart.dots i, .islot .sart.dots i { width: 14px; height: 14px; flex: none; border-radius: 50%; }

.itile .sface, .isart .sface, .idrag-ghost .sface { display: block; width: 100%; height: 100%; } .itile .sface .f-ok, .isart .sface .f-ok, .idrag-ghost .sface .f-ok { display: block; } .itile .sface .f-cheer, .itile .sface .f-bad, .isart .sface .f-cheer, .isart .sface .f-bad, .idrag-ghost .sface .f-cheer, .idrag-ghost .sface .f-bad { display: none; }
.itile.add { border-style: dashed; cursor: pointer; } .itile.add .itart .ic { width: 28px; height: 28px; color: var(--red); }
.tunepanel { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card, 16px); background: var(--card); } .tunepanel .h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; } .tunepanel .h3 .ic { width: 18px; height: 18px; }
.tunegrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } .tunebox { display: grid; gap: 8px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); } .tunebox > b { font-size: .95rem; }

.itile .itart { position: relative; } .itfx { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; } .itfx .ic { width: 12px; height: 12px; }
.fxrow { display: grid; gap: 8px; padding: 0 10px 12px; } .fxsel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .fxsel span { color: var(--muted); font-size: .85rem; } .fxsel select { flex: 1; min-width: 180px; }

.igroup.tunepanel { padding: 0; } .igroup.tunepanel > summary span { display: inline-flex; align-items: center; gap: 6px; } .igroup.tunepanel > summary span .ic { width: 18px; height: 18px; }
.igroup.tunepanel .tunegrid { padding: 0 10px 12px; }

.islot.multi { cursor: pointer; } .islot.sel { border-color: var(--red); border-style: solid; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.itile .emoface, .isart .emoface { display: block; width: 100%; height: 100%; } .itile .emoface svg, .isart .emoface svg { width: 100%; height: 100%; }

/* Kho đồ: chế độ xem trước, phòng thử đồ trong Kho */
.pftiles.one { grid-template-columns: minmax(0, 1fr); }
.itab.prev { margin-left: auto; border-style: dashed; } .itab.prev.on { border-style: solid; }
.ipvnote { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--lemon); }
.itile.pv::after { content: ""; position: absolute; left: 6px; bottom: 6px; width: 0; height: 0; }
.itile.trying { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent); }
.itile .rib.try { position: absolute; left: 4px; top: 4px; z-index: 3; font-size: .62rem; padding: 1px 6px; border-radius: 999px; background: var(--gold); color: #1d1408; font-weight: 800; }
.loadout.flat { position: static; }
.fit.can { outline: 3px dashed var(--gold); outline-offset: 2px; } .fit.over { outline-style: solid; background: color-mix(in srgb, var(--gold) 18%, var(--card)); }

/* ================= Kho đồ mới: Gương Thần + tủ đồ chia mục ================= */
.invbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--r-card, 14px); background: var(--card); } .invbar b { display: block; font-size: 1.15rem; } .invbar small { color: var(--muted); }
.kho { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.kstage { position: sticky; top: var(--hbar, 61px); z-index: 7; }
.kst { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 6px; padding: 8px; min-height: 120px; border: 2px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--fg); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.kst .kbg { position: absolute; inset: 0; z-index: -3; background-size: cover; background-position: center; }
.kst::after { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 30%, transparent); pointer-events: none; }
.kst .kfx { position: absolute; left: 0; top: 0; z-index: -2; overflow: hidden; pointer-events: none; transform-origin: 0 0; }
.kst .kfx > i { position: absolute; display: block; will-change: transform, opacity; }
.khead { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .khead b { display: inline-flex; align-items: center; gap: 6px; text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 70%, transparent); } .khead .ic { width: 16px; height: 16px; } .kmini-b { padding: 2px 10px; font-size: .74rem; border-radius: 999px; }
.khero { border-radius: 12px; overflow: hidden; } .khero .hero3 { margin: 0; border: 0; border-radius: 12px; background: transparent; } .khero .h3scene { height: 86px; margin: 0; }
.kmid { display: flex; align-items: flex-end; justify-content: center; gap: 12px; }
.kfig { display: flex; flex-direction: column; align-items: center; gap: 4px; } .kfig .fitfig { width: 124px; }
.kside { display: flex; flex-direction: column; align-items: center; gap: 6px; } .kmasc .emoface { width: 64px; height: 64px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.kicons { display: grid; grid-template-columns: repeat(2, 44px); gap: 4px; } .kicons .sart { width: 44px; height: 44px; min-height: 0; margin: 0; border-radius: 10px; background: color-mix(in srgb, var(--card) 80%, transparent); display: grid; place-items: center; overflow: hidden; } .kicons .sart svg { max-width: 100%; max-height: 100%; }
.kgm { position: relative; isolation: isolate; border-radius: 14px; padding: 8px; display: grid; gap: 6px; } .kgm .qbox { min-height: 0; padding: 8px; } .kgm .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .kgm .opt { padding: 6px; font-size: .85rem; }
.kmini { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; } .kmini .dm-cards .mem { grid-template-columns: repeat(2, 46px); gap: 6px; } .kmini .dm-cards .mcard { height: 62px; padding: 0; } .kmini .dm-cards .mcard .front { font-size: 1.5rem; } .kmini .dm-cards .mcard .back b { font-size: 1.1rem; }
.kmini .field { position: relative; display: flex; gap: 6px; height: auto; min-height: 0; background: none; border: 0; padding: 0; } .kmini .field .drop { position: relative; left: auto; top: auto; padding: 2px 8px; } .kmini .field .drop b { font-size: 1.1rem; }
.kst.mini { flex-direction: row; align-items: center; flex-wrap: wrap; min-height: 0; } .kst.mini .khead { width: 100%; } .kst.mini .khero, .kst.mini .kgm, .kst.mini .kicons { display: none; } .kst.mini .kfig .fitfig { width: 64px; } .kst.mini .kmasc .emoface { width: 48px; height: 48px; }
.knote { margin: 6px 2px 0; font-size: .78rem; color: var(--muted); }
@media (min-width: 900px) { .kho { grid-template-columns: 340px minmax(0, 1fr); gap: 16px; } .kstage { top: calc(var(--hbar, 61px) + 8px); } }
@media (max-width: 899px) { .kfig .fitfig { width: 92px; } .khero .h3scene { height: 60px; } .kmasc .emoface { width: 46px; height: 46px; } .kst:not(.mini) .kmid { gap: 8px; } .kgm .qbox .big { font-size: 1.3rem !important; } .knote { display: none; } .kicons { grid-template-columns: repeat(4, 34px); } .kicons .sart { width: 34px; height: 34px; } }
.kmain { min-width: 0; }
.ksubs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; } .ksubs::-webkit-scrollbar { display: none; }
.ksub { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .86rem; } .ksub small { opacity: .6; font-weight: 600; } .ksub.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; } .kgsec { grid-column: 1 / -1; margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.kpager { display: flex; justify-content: center; gap: 6px; margin: 10px 0; } .kpager button { min-width: 34px; padding: 6px 10px; border-radius: 10px; } .kpager button.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.ksel { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; font-size: .85rem; } .ksel span { color: var(--muted); } .ksel button { padding: 5px 12px; border-radius: 999px; } .ksel button.on { background: var(--red); color: var(--on-red, #fff); border-color: var(--red); }
.kctl { display: grid; gap: 8px; margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-card, 14px); background: var(--card); } .kslide { display: grid; gap: 4px; font-size: .85rem; } .kslide span { color: var(--muted); } .kslide input { width: 100%; }
.itile { cursor: pointer; } .itile .igrip { display: none; }
.itile .sart.bkp { width: 44px; height: 56px; margin: auto; border-radius: 8px; display: grid; place-items: center; font-family: var(--hanzi); font-size: 1.6rem; color: #fff3c0; background: linear-gradient(135deg, var(--red), var(--gold)); }
.itile .sart.rainp { width: 50px; height: 50px; margin: auto; border-radius: 12px; display: grid; place-items: center; font-family: var(--hanzi); font-size: 1.5rem; background: var(--card); border: 1px solid var(--line); }
.itile .btnprev, .itile .cardprev { margin: auto; }
.itile .itart { height: 66px; }
/* kiểu mưa và mặt lưng quân bài: hiện đúng hình ở mọi nơi, không chỉ trong thẻ cửa hàng */
.sart.bkp.bk-sen { background: linear-gradient(135deg, #e06a9a, #8f3a78); } .sart.bkp.bk-rong { background: linear-gradient(135deg, #2f8f7a, #14504a); } .sart.bkp.bk-phuc { background: linear-gradient(135deg, #d4401f, #8a1f10); }
.sart.rainp.r-la { background: #e3f3d9; border-color: #7fbf6a; border-radius: 4px 26px 4px 26px; color: #27583a; } .sart.rainp.r-hoa { background: #ffe0e8; border-color: #f4a8bc; border-radius: 60% 40% 60% 40%; color: #a3254b; } .sart.rainp.r-sao { background: #1c2547; border-color: #ffd166; color: #ffe9a8; box-shadow: 0 0 10px rgba(255, 209, 102, .5); }
/* mặt lưng mới */
.bk-tuyet { --bk: linear-gradient(135deg, #a8dcf7, #3f7fc0); } .bk-dao { --bk: linear-gradient(135deg, #f7a9c4, #c0527a); } .bk-sao { --bk: linear-gradient(135deg, #2a2f7a, #0b0f33); } .bk-lua { --bk: linear-gradient(135deg, #ff9a3c, #c0301a); } .bk-bien { --bk: linear-gradient(135deg, #3fc3cf, #16607a); } .bk-mac { --bk: linear-gradient(135deg, #6c7378, #2a2f33); }
.sart.bkp:is(.bk-tuyet, .bk-dao, .bk-sao, .bk-lua, .bk-bien, .bk-mac) { background: var(--bk); }
.mcard:is(.bk-tuyet, .bk-dao, .bk-sao, .bk-lua, .bk-bien, .bk-mac) .front { font-family: var(--hanzi); font-size: 2.6rem; width: 100%; height: 100%; display: grid; place-items: center; border-radius: 0; color: #fff3c0; background: transparent !important; }
.mcard:is(.bk-tuyet, .bk-dao, .bk-sao, .bk-lua, .bk-bien, .bk-mac):not(.up) { padding: 0; border-color: transparent; background: var(--bk); }
.mcard.flip3d:is(.bk-tuyet, .bk-dao, .bk-sao, .bk-lua, .bk-bien, .bk-mac) .front { background: var(--bk) !important; border-color: transparent; }
.bk-sao .front, .bk-tuyet .front { text-shadow: 0 0 8px rgba(255, 255, 255, .6); }
/* kiểu mưa mới */
.field.rain-tuyet .drop { background: #eef7ff; border-color: #9fcbe8; border-radius: 50%; box-shadow: 0 0 8px rgba(200, 230, 255, .8); } .field.rain-tuyet .drop b { color: #2a5f86; }
.field.rain-lua .drop { background: #3a1410; border-color: #ff8a3c; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; box-shadow: 0 0 12px rgba(255, 120, 40, .6); } .field.rain-lua .drop b { color: #ffd9a8; } .field.rain-lua .drop small { color: #ffb27a; }
.field.rain-bong .drop { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .95), rgba(180, 225, 255, .4) 60%, rgba(150, 200, 255, .3)); border-color: rgba(255, 255, 255, .9); border-radius: 50%; } .field.rain-bong .drop b { color: #1f4f7a; }
.field.rain-den .drop { background: #d9382a; border-color: #ffc94a; border-radius: 40% 40% 36% 36%; box-shadow: 0 0 10px rgba(255, 150, 60, .6); } .field.rain-den .drop b { color: #fff3c0; } .field.rain-den .drop small { color: #ffe08a; }
.sart.rainp.r-tuyet { background: #eef7ff; border-color: #9fcbe8; border-radius: 50%; color: #2a5f86; box-shadow: 0 0 8px rgba(200, 230, 255, .8); } .sart.rainp.r-lua { background: #3a1410; border-color: #ff8a3c; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; color: #ffd9a8; box-shadow: 0 0 10px rgba(255, 120, 40, .6); } .sart.rainp.r-bong { background: radial-gradient(circle at 30% 25%, #fff, rgba(180, 225, 255, .5) 60%, rgba(150, 200, 255, .4)); border-color: #fff; border-radius: 50%; color: #1f4f7a; } .sart.rainp.r-den { background: #d9382a; border-color: #ffc94a; border-radius: 40% 40% 36% 36%; color: #fff3c0; box-shadow: 0 0 10px rgba(255, 150, 60, .6); }
/* nút bấm mới */
#gm[data-btn="bang"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="bang"] { background: linear-gradient(#f4fbff, #b9e0f7); border: 2px solid #7cc0e8; color: #16506f; font-weight: 800; border-radius: 12px; box-shadow: inset 0 2px 0 #fff, 0 3px 0 #5aa6d4; }
#gm[data-btn="lua"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="lua"] { background: linear-gradient(#ffb347, #e8481a 70%, #b8300e); border: 2px solid #7a1c08; color: #fff3d0; font-weight: 800; border-radius: 12px; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 3px 0 #7a1c08, 0 0 10px rgba(255, 120, 40, .45); }
#gm[data-btn="dao"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="dao"] { background: linear-gradient(#ffe3ee, #f9b6cf); border: 2px solid #e07fa4; color: #7a2347; font-weight: 800; border-radius: 999px; box-shadow: 0 4px 0 #e07fa4, inset 0 2px 0 rgba(255, 255, 255, .7); }
#gm[data-btn="dem"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="dem"] { background: linear-gradient(#262d6b, #141a45); border: 2px solid #8ea2ff; color: #e6ebff; font-weight: 700; border-radius: 12px; box-shadow: 0 0 10px rgba(142, 162, 255, .5), inset 0 0 8px rgba(142, 162, 255, .25); }
/* khung câu hỏi mới và tân trang khung cũ */
#gm[data-card="ngoc"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="ngoc"] { background: radial-gradient(circle at 30% 20%, #c9f5e2, #6fcfa8 55%, #2f9a78); border: 3px solid #1f7a60; border-radius: 16px; color: #063c2e; box-shadow: inset 0 3px 6px rgba(255, 255, 255, .55), 0 4px 0 #165a46; }
#gm[data-card="bang"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="bang"] { background: linear-gradient(#f6fcff, #cfeaf9); border: 3px solid #8cc9ec; border-radius: 14px; color: #164a6a; box-shadow: inset 0 0 0 2px #fff, 0 0 14px rgba(140, 201, 236, .6); }
#gm[data-card="dem"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="dem"] { background: radial-gradient(circle at 20% 15%, #3a4390, #141a45 70%); border: 3px solid #ffd166; border-radius: 14px; color: #eef1ff; box-shadow: 0 0 14px rgba(255, 209, 102, .45), inset 0 0 0 2px rgba(255, 255, 255, .12); }
#gm[data-card="dao"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="dao"] { background: linear-gradient(#fff0f5, #ffd3e2); border: 3px solid #f08ab0; border-radius: 22px 6px 22px 6px; color: #7a2347; box-shadow: 0 3px 0 #e07fa4; }
#gm:is([data-card="ngoc"], [data-card="bang"], [data-card="dem"], [data-card="dao"]) :is(.qbox, .ask, .pot-card) :is(.py, .big, .bigvi, .big-vi, .zhline, .note, small, b) { color: inherit; }
#gm[data-card="giay"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="giay"] { background-image: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .55), transparent 60%), repeating-linear-gradient(0deg, rgba(160, 120, 60, .07) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 26px rgba(170, 130, 70, .28), 0 3px 8px rgba(0, 0, 0, .2); }
#gm[data-card="lua"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="lua"] { background-image: radial-gradient(circle at 50% 0, rgba(255, 220, 120, .35), transparent 60%), repeating-linear-gradient(45deg, rgba(0, 0, 0, .07) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18), inset 0 0 0 6px rgba(242, 194, 48, .55), 0 3px 8px rgba(0, 0, 0, .25); }
/* khung cảnh sau trò chơi mới */
.sc-bien { background: linear-gradient(rgba(70, 170, 220, .32), rgba(200, 235, 250, .08)); } .sc-bien i { width: calc(30px * var(--s)); height: calc(9px * var(--s)); border-radius: 50%; border-top: 2px solid rgba(255, 255, 255, .8); animation: waveslide linear infinite; } @keyframes waveslide { from { transform: translateX(-60px); opacity: 0; } 20% { opacity: 1; } to { transform: translateX(110vw); opacity: 0; } }
.sc-tuyet { background: linear-gradient(rgba(190, 215, 240, .42), rgba(250, 253, 255, .1)); } .sc-tuyet i { width: calc(7px * var(--s)); height: calc(7px * var(--s)); border-radius: 50%; background: #fff; box-shadow: 0 0 5px #fff; animation: petalfall linear infinite; top: -20px !important; }
.sc-lua { background: linear-gradient(rgba(60, 20, 10, .5), rgba(255, 120, 40, .2)); } .sc-lua i { width: calc(5px * var(--s)); height: calc(5px * var(--s)); border-radius: 50%; background: #ffb347; box-shadow: 0 0 6px 1px #ff7a1a; animation: bubup linear infinite; }
.sc-samac { background: linear-gradient(rgba(245, 190, 100, .38), rgba(255, 240, 200, .1)); } .sc-samac i { width: calc(40px * var(--s)); height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 244, 214, .95)); animation: cloudgo linear infinite; }
.sc-thu { background: linear-gradient(rgba(240, 170, 90, .36), rgba(255, 240, 210, .08)); } .sc-thu i { width: calc(13px * var(--s)); height: calc(8px * var(--s)); background: #e0832e; border-radius: 0 100% 0 100%; animation: petalfall linear infinite; top: -20px !important; } .sc-thu i:nth-child(3n) { background: #b5471f; } .sc-thu i:nth-child(3n+1) { background: #d6a21f; }
.sc-cuc { background: linear-gradient(rgba(5, 20, 30, .62), rgba(20, 90, 80, .3)); } .sc-cuc::before { content: ""; position: absolute; left: -10%; right: -10%; top: 4%; height: 55%; background: linear-gradient(90deg, transparent, rgba(95, 224, 176, .55) 30%, rgba(122, 168, 255, .5) 60%, transparent); filter: blur(14px); animation: auroraw 7s ease-in-out infinite alternate; } @keyframes auroraw { from { transform: translateX(-8%) skewX(-10deg); opacity: .5; } to { transform: translateX(8%) skewX(10deg); opacity: 1; } }
.sc-cuc i { width: calc(4px * var(--s)); height: calc(4px * var(--s)); background: #fff; border-radius: 50%; animation: twk ease-in-out infinite alternate; }
.sc-sao { background: linear-gradient(rgba(10, 14, 40, .6), rgba(40, 50, 110, .25)); } .sc-sao i { width: 70px; height: 2px; background: linear-gradient(90deg, #fff, transparent); transform: rotate(32deg); animation: meteorgo linear infinite; } @keyframes meteorgo { from { transform: translate(0, 0) rotate(32deg); opacity: 0; } 10% { opacity: 1; } 40%, 100% { transform: translate(240px, 150px) rotate(32deg); opacity: 0; } }
.sc-hoi { background: linear-gradient(rgba(40, 10, 60, .55), rgba(180, 40, 60, .2)); } .sc-hoi i { width: calc(11px * var(--s)); height: calc(14px * var(--s)); border-radius: 40%; background: #e8452c; box-shadow: 0 0 10px rgba(255, 150, 60, .7); animation: bubup linear infinite; }
/* Làm mờ giao diện để thấy nền rõ hơn (thanh kéo trong Kho đồ) */
html[data-glass] :is(.panel, .card, .rcard, .wcard, .pfme, .shopcard, .itile, .kctl, .invbar, .mesec, .hero3, .fit, .tunebox, .igroup) { background-color: color-mix(in srgb, var(--card) calc(var(--glass) * 1%), transparent); -webkit-backdrop-filter: blur(calc((100 - var(--glass)) * .1px)); backdrop-filter: blur(calc((100 - var(--glass)) * .1px)); }
@media (max-height: 760px) { .khero .h3scene { height: 56px; } .kmini { display: none; } }

/* Khung quảng cáo "Powered by Netlify" (khi chưa nhận site) đè lên nút ở đáy: chừa chỗ để không che nút bấm; nút dễ chạm hơn trên điện thoại */
html.nf-badge #app { padding-bottom: 110px; }
button, [data-act], .opt, .tk, .mcard, .peach, .bub, .itile { touch-action: manipulation; }


/* ===== Chuông thông báo + Hòm thư ===== */
.bellchip { position: relative; }
.bellchip .badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red, #c8361e); color: #fff; font: 700 .66rem/17px system-ui, sans-serif; text-align: center; font-style: normal; }
.bellchip.ring svg { animation: bellring 2.4s ease-in-out infinite; transform-origin: 50% 8%; }
@keyframes bellring { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(14deg); } 72% { transform: rotate(-12deg); } 78% { transform: rotate(8deg); } 84% { transform: rotate(-5deg); } 90% { transform: rotate(0); } }
#inbox.ib-bg { position: fixed; inset: 0; z-index: 60; background: rgba(20, 12, 8, .45); display: flex; justify-content: flex-end; }
#inbox .ib { width: 420px; max-width: 100%; height: 100%; background: var(--bg); border-left: 3px solid var(--gold); display: flex; flex-direction: column; box-shadow: -8px 0 28px rgba(0, 0, 0, .25); animation: ibin .22s ease-out; }
@keyframes ibin { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
#inbox .ib-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
#inbox .ib-head b { display: flex; align-items: center; gap: 8px; color: var(--red); }
#inbox .ib-head .x { border: 0; background: none; padding: 6px; border-radius: 8px; cursor: pointer; color: inherit; }
#inbox .ib-tabs { display: flex; gap: 6px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
#inbox .ib-tabs button { flex: 1; border: 0; border-bottom: 3px solid transparent; background: none; padding: 10px 6px; font-weight: 700; color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; }
#inbox .ib-tabs button.on { color: var(--red); border-bottom-color: var(--red); }
#inbox .ib-tabs small { margin-left: 4px; background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .68rem; }
#inbox .ib-tabs small:empty { display: none; }
#inbox .ib-body { flex: 1; overflow-y: auto; padding: 10px 12px 24px; display: grid; gap: 8px; align-content: start; }
#inbox .ib-bar { display: flex; gap: 8px; justify-content: flex-end; }
#inbox .ib-bar button { padding: 6px 12px; font-size: .85rem; }
#inbox .ib-item { display: flex; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
#inbox .ib-item.new { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
#inbox .ib-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--lemon, #fff3c4); color: var(--red); display: grid; place-items: center; }
#inbox .ib-tx { min-width: 0; flex: 1; } #inbox .ib-tx p { margin: 2px 0; font-size: .9rem; overflow-wrap: anywhere; } #inbox .ib-tx small { color: var(--muted); display: block; } #inbox .ib-tx em { color: var(--red); font-style: normal; font-weight: 700; }
#inbox .ib-act { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; } #inbox .ib-act button { padding: 8px 14px; }
#inbox .ib-done { color: var(--muted); }
#inbox .ib-empty { text-align: center; color: var(--muted); padding: 40px 16px; } #inbox .ib-empty .ic { width: 40px; height: 40px; opacity: .5; }
@media (max-width: 640px) {
  #inbox.ib-bg { align-items: flex-end; justify-content: stretch; }
  #inbox .ib { width: 100%; height: 88vh; border-left: 0; border-top: 3px solid var(--gold); border-radius: 18px 18px 0 0; animation: ibup .22s ease-out; }
  @keyframes ibup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ===== Nút Tiếp tục, hướng dẫn chơi, nối câu gọn, lưới đoán pinyin gọn ===== */
.proceed { display: block; width: 100%; max-width: 420px; margin: 14px auto 6px; }
.helpbtn { margin-left: auto; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-weight: 800; line-height: 1; }
.gh-bg .sheet p { margin: 6px 0 10px; } .ghl { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.pbtn { transition: background .3s, opacity .3s; }
.pbtn.done { padding: 6px 10px; font-size: .8rem; opacity: .6; pointer-events: none; }
.pbtn.l.done { font-size: .95rem; }
.wgrid { gap: 5px; } .wgrid .wr { gap: 5px; } .wgrid .wc { width: 38px; height: 42px; font-size: 1.15rem; }

/* ===== Điện thoại: bố cục gọn, nút to dễ chạm ===== */
@media (max-width: 480px) {
  body { font-size: 15px; }
  #app { padding-left: 12px; padding-right: 12px; }
  button, .opt, .pbtn, .tk, .chip { min-height: 40px; }
  .opts { grid-template-columns: 1fr 1fr; gap: 8px; } .opts .opt.long { grid-column: 1 / -1; }
  .pairs { gap: 8px; } .pbtn { padding: 8px; font-size: .88rem; } .pbtn.l { font-size: 1.05rem; }
  .gamebar { gap: 8px; font-size: .92rem; } .gamebar > button { padding: 6px 10px; }
  .hud { font-size: .88rem; } .qbox .big, .big { font-size: 2.4rem; }
  .sky2 { height: 52vh; }
  .chips { flex-wrap: wrap; gap: 6px; } .chip { padding: 6px 10px; }
  .dock { position: sticky; bottom: 0; }
  .sheet { max-width: 100%; border-radius: 18px 18px 0 0; }
  .fit .fitfig { max-width: 150px; }
}
/* ===== Nút micro dùng chung (mọi nơi ghi âm) ===== */
button.rec, .mic.rec { background: #c8361e !important; color: #fff !important; border-color: #c8361e !important; }
button.proc { opacity: .75; }
.recdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #fff; margin-right: 4px; animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
/* ===== Gương Thần trong Kho đồ trên điện thoại: gọn, không chiếm hết màn hình ===== */
@media (max-width: 899px) {
  .kstage { position: sticky; top: var(--hbar, 61px); }
  .kst:not(.mini) { padding: 6px 10px; gap: 4px; }
  .kst:not(.mini) .kgm, .kst:not(.mini) .kmini { display: none; }
  .kst:not(.mini) .khero { display: none; }
  .kst:not(.mini) .kmid { gap: 14px; align-items: center; }
  .kst:not(.mini) .kfig .fitfig { width: 78px; }
  .kst:not(.mini) .kside { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: 150px; }
  .kst:not(.mini) .kmasc .emoface { width: 40px; height: 40px; }
  .kst:not(.mini) .kicons { grid-template-columns: repeat(4, 30px); gap: 4px; }
  .knote { display: none; }
}
.kst .kfig .fitplate { position: relative; z-index: 1; margin-top: 8px; }

.kst .kfig .fitplate { margin-top: 14px; clear: both; } .kst .kfig .fitfig { overflow: visible; } .kst:not(.mini) { padding-bottom: 14px; }

/* Các hàng mục cuộn ngang luôn có thanh kéo để dùng được bằng chuột và trên máy không vuốt được */
.invtabs, .ksubs, .fashcats, .shoptabs, .hscroll { scrollbar-width: thin; scrollbar-color: var(--gold) var(--line); padding-bottom: 8px; }
.invtabs::-webkit-scrollbar, .ksubs::-webkit-scrollbar, .fashcats::-webkit-scrollbar, .shoptabs::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: block; height: 9px; }
.invtabs::-webkit-scrollbar-track, .ksubs::-webkit-scrollbar-track { background: var(--line); border-radius: 6px; }
.invtabs::-webkit-scrollbar-thumb, .ksubs::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 6px; }
/* ===== Gương Thần: không bao giờ cao hơn màn hình (phóng to không bị che bởi thanh dưới), thu nhỏ gọn gàng ===== */
.kstage { max-height: calc(100vh - var(--hbar, 61px) - 100px); overflow-y: auto; scrollbar-width: thin; border-radius: 18px; }
@media (max-height: 900px) { .kst:not(.mini) .kgm, .kst:not(.mini) .kmini { display: none; } .khero .h3scene { height: 70px; } }
.kst.mini { flex-direction: column; align-items: stretch; flex-wrap: nowrap; padding: 8px 12px 10px; gap: 6px; min-height: 0; }
.kst.mini .khead { width: auto; }
.kst.mini .kmid { display: flex; align-items: center; justify-content: center; gap: 16px; }
.kst.mini .kfig .fitfig { width: 62px; }
.kst.mini .kfig .fitplate, .kst.mini .fitextra, .kst.mini .kicons, .kst.mini .khero, .kst.mini .kgm { display: none; }
.kst.mini .kside { flex-direction: row; align-items: center; gap: 8px; }
.kst.mini .kmasc .emoface { width: 44px; height: 44px; }
.kst .kfig .fitplate { margin-top: 14px; }
/* Cảnh thầy trò Đường Tăng: giữ đúng tỉ lệ 4:1 của tranh để không bị cắt mất nhân vật ở hai bên */
.kst .khero .h3scene { height: auto !important; aspect-ratio: 600 / 150; margin: 0; }

/* ===== Gương Thần có hai chế độ: Gương 1 (nhân vật + trang bị), Gương 2 (xem trước cảnh, nút, thẻ bài, mưa chữ) ===== */
.kmir { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--fg) 10%, transparent); margin-left: auto; margin-right: 6px; }
.kmir button { padding: 3px 10px; font-size: .74rem; border-radius: 999px; border: 0; background: transparent; color: inherit; cursor: pointer; font-weight: 700; min-height: 0; }
.kmir button.on { background: var(--gold, #c8a000); color: #1d1408; }
.kst[data-mir="1"] .khero, .kst[data-mir="1"] .kgm, .kst[data-mir="1"] .kmini { display: none !important; }
.kst[data-mir="2"]:not(.mini) .kmid { display: none; }
.kst[data-mir="2"]:not(.mini) .khero { display: block !important; }
.kst[data-mir="2"]:not(.mini) .kgm { display: grid !important; }
.kst[data-mir="2"]:not(.mini) .kmini { display: flex !important; }
.kst.mini .kmir { display: none; }
.kst .khero .h3scene { height: auto !important; aspect-ratio: 600 / 150; margin: 0; }
/* ô trang bị có tên */
.kicons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.keq { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 1px dashed color-mix(in srgb, var(--fg) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--bg) 55%, transparent); min-width: 58px; }
.keq i { display: block; width: 38px; height: 38px; font-style: normal; } .keq i .sart { width: 38px; height: 38px; }
.keq small { font-size: .62rem; opacity: .85; line-height: 1.1; text-align: center; }
.kst:not(.mini) .kside { flex-direction: column; max-width: none; }
.kst:not(.mini) .kicons { grid-template-columns: repeat(2, 1fr); }
/* ===== Khung ảnh đại diện mới ===== */
.pfav.fr-sakura, .pffull.fr-sakura { border-color: #ffc2d6; box-shadow: 0 0 0 2px #e86a92, 0 0 12px rgba(255, 150, 190, .65); }
.pfav.fr-bac, .pffull.fr-bac { border-color: #e8ecf4; box-shadow: 0 0 0 2px #8a93a6, 0 0 8px rgba(200, 210, 230, .8); }
.pfav.fr-bien, .pffull.fr-bien { border-color: #4ab8e8; box-shadow: 0 0 0 2px #1d6a9a, 0 0 12px rgba(74, 184, 232, .7); animation: frglowB 2.6s ease-in-out infinite; }
.pfav.fr-tim, .pffull.fr-tim { border-color: #b58cf0; box-shadow: 0 0 0 2px #5a2fa0, 0 0 14px rgba(160, 110, 240, .75); animation: frglowT 2.2s ease-in-out infinite; }
.pfav.fr-lua, .pffull.fr-lua { border-color: #ff8a2a; box-shadow: 0 0 0 2px #a83a00, 0 0 14px rgba(255, 120, 30, .8); animation: frglowL 1.3s ease-in-out infinite; }
.pfav.fr-tuyet, .pffull.fr-tuyet { border-color: #eaf6ff; box-shadow: 0 0 0 2px #7ab0d8, 0 0 12px rgba(190, 230, 255, .9); }
.pfav.fr-den, .pffull.fr-den { border-color: #1c1c24; box-shadow: 0 0 0 2px #ffd84d, 0 0 0 4px #1c1c24; }
.pfav.fr-vip-bao-thach, .pffull.fr-vip-bao-thach { border: 4px solid transparent; background: conic-gradient(#e8304a, #ffd84d, #4ad06a, #3fa8e0, #9b5de5, #e8304a) border-box; animation: frcau 4s linear infinite; }
@keyframes frglowB { 0%, 100% { box-shadow: 0 0 0 2px #1d6a9a, 0 0 8px rgba(74, 184, 232, .5); } 50% { box-shadow: 0 0 0 2px #1d6a9a, 0 0 18px rgba(120, 220, 255, .95); } }
@keyframes frglowT { 0%, 100% { box-shadow: 0 0 0 2px #5a2fa0, 0 0 8px rgba(160, 110, 240, .5); } 50% { box-shadow: 0 0 0 2px #5a2fa0, 0 0 20px rgba(210, 170, 255, .95); } }
@keyframes frglowL { 0%, 100% { box-shadow: 0 0 0 2px #a83a00, 0 0 10px rgba(255, 120, 30, .6); } 50% { box-shadow: 0 0 0 2px #a83a00, 0 0 22px rgba(255, 210, 60, .95); } }
.tiers .tiercard.t0 { grid-column: 1 / -1; }
.tiercard.t0 .viplist { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ===== Đồ mới: kiểu nút bấm ===== */
#gm[data-btn="sakura-b"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="sakura-b"] { background: linear-gradient(#fff5f8, #ffd6e4); border: 2px solid #f4a8bc; color: #a3254b; font-weight: 700; border-radius: 16px 4px 16px 4px; box-shadow: 0 3px 0 #f4a8bc; }
#gm[data-btn="trang-nguyet"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="trang-nguyet"] { background: radial-gradient(circle at 30% 25%, #fffbe6, #ffe9a8 70%); border: 2px solid #e8c860; color: #6a5210; font-weight: 700; border-radius: 999px; box-shadow: 0 0 12px rgba(255, 230, 140, .7), inset 0 -3px 0 rgba(200, 160, 40, .25); }
#gm[data-btn="bien-sau"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="bien-sau"] { background: radial-gradient(circle at 20% 130%, rgba(255, 255, 255, .28) 0 14px, transparent 15px), radial-gradient(circle at 65% 140%, rgba(255, 255, 255, .22) 0 18px, transparent 19px), linear-gradient(#2a8fb0, #0c3a5a); border: 2px solid #5ec8e8; color: #e6f8ff; font-weight: 700; border-radius: 12px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), 0 3px 0 #08283e; }
#gm[data-btn="pixel"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="pixel"] { background: #fff; color: #111; border: 3px solid #111; border-radius: 0; font-family: "Courier New", monospace; font-weight: 800; box-shadow: 4px 4px 0 #111; }
#gm[data-btn="kim-loai"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="kim-loai"] { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 2px, transparent 2px 5px), linear-gradient(#f4f6fa, #aab2c0 50%, #d6dbe4); border: 2px solid #7a8498; color: #2a3040; font-weight: 700; border-radius: 10px; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #6a7488; }
#gm[data-btn="cau-vong-b"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="cau-vong-b"] { border: 3px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #e8304a, #ffd84d, #4ad06a, #3fa8e0, #9b5de5, #e8304a) border-box; background-size: 100% 100%, 200% 100%; color: #222; font-weight: 700; border-radius: 12px; animation: btnrb 3s linear infinite; }
@keyframes btnrb { to { background-position: 0 0, 200% 0; } }
#gm[data-btn="mat-ong"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="mat-ong"] { background: linear-gradient(#ffd466, #e89a10 70%, #c97a00); border: 2px solid #8a5200; color: #4a2800; font-weight: 800; border-radius: 14px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5), 0 4px 0 #8a5200; }
#gm[data-btn="toi-do"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="toi-do"] { background: linear-gradient(#2a1f48, #120a28); border: 2px solid #a07aff; color: #e8dcff; font-weight: 700; border-radius: 10px; box-shadow: 0 0 10px rgba(160, 122, 255, .6), inset 0 0 8px rgba(160, 122, 255, .25); }

/* ===== Đồ mới: khung câu hỏi ===== */
#gm[data-card="sakura-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="sakura-c"] { background: linear-gradient(#fff5f8, #ffe3ec); border: 3px dotted #f4a8bc; border-radius: 18px; color: #8a1f45; }
#gm[data-card="bien-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="bien-c"] { background: linear-gradient(#e8f8ff, #bfe8f8); border: 3px solid #4ab8e8; border-radius: 14px 14px 30px 30px; color: #0f4a6a; box-shadow: inset 0 -8px 0 rgba(74, 184, 232, .25); }
#gm[data-card="phong-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="phong-c"] { background: linear-gradient(#fff1de, #ffd9a8); border: 3px solid #c8641e; border-radius: 6px 22px 6px 22px; color: #6a2a08; }
#gm[data-card="kim-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="kim-c"] { background: #17171f; border: 3px solid #f2c230; border-radius: 10px; color: #ffe9a8; box-shadow: 0 0 0 2px #17171f, 0 0 0 4px #f2c230, 0 4px 12px rgba(0, 0, 0, .4); }
#gm[data-card="tre-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="tre-c"] { background: #eef9e4; border: 3px double #4a9a3a; border-left: 10px solid #4a9a3a; border-right: 10px solid #4a9a3a; border-radius: 4px; color: #1f4a22; }
#gm[data-card="vo-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="vo-c"] { background: repeating-linear-gradient(transparent 0 22px, #bcd4ec 22px 23px), #fffef8; border: 1px solid #c8d0e0; border-left: 6px double #e8909c; border-radius: 4px; color: #1c2a4a; }
#gm[data-card="pixel-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="pixel-c"] { background: #fff; border: 4px solid #111; border-radius: 0; box-shadow: 6px 6px 0 #111; color: #111; }
#gm[data-card="ngan-ha-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="ngan-ha-c"] { background: radial-gradient(circle at 20% 20%, rgba(180, 140, 255, .6), transparent 50%), radial-gradient(circle at 80% 70%, rgba(80, 200, 255, .5), transparent 50%), #0e0c2e; border: 2px solid #8a7aff; border-radius: 14px; color: #eef0ff; box-shadow: 0 0 14px rgba(138, 122, 255, .5), inset 0 0 0 1px rgba(255, 255, 255, .15); }
#gm:is([data-card="sakura-c"], [data-card="bien-c"], [data-card="phong-c"], [data-card="kim-c"], [data-card="tre-c"], [data-card="vo-c"], [data-card="pixel-c"], [data-card="ngan-ha-c"]) :is(.qbox, .ask, .pot-card) :is(.py, .big, .bigvi, .big-vi, .zhline, .note, small, b) { color: inherit; }

/* ===== Đồ mới: kiểu mưa chữ (trong game và ảnh xem trước) ===== */
.field.rain-cuc .drop, .sart.rainp.r-cuc, .shopcard .rainp.r-cuc { background: radial-gradient(circle, #fff4b8 55%, #ffd84d 56%); border-color: #e8b020; border-radius: 50%; color: #7a5200; }
.field.rain-cuc .drop b { color: #7a5200; }
.field.rain-ngoc .drop, .sart.rainp.r-ngoc, .shopcard .rainp.r-ngoc { background: linear-gradient(135deg, #bff7de, #5ac2a0); border-color: #1d7a62; border-radius: 10px; color: #0b3d30; }
.field.rain-ngoc .drop b { color: #0b3d30; }
.field.rain-kim-cuong .drop, .sart.rainp.r-kim-cuong, .shopcard .rainp.r-kim-cuong { background: linear-gradient(135deg, #eaffff, #9fe4ff 60%, #d6f4ff); border-color: #2aa6c8; clip-path: polygon(50% 0, 100% 38%, 50% 100%, 0 38%); color: #0b4a66; }
.field.rain-kim-cuong .drop b { color: #0b4a66; }
.field.rain-may .drop, .sart.rainp.r-may, .shopcard .rainp.r-may { background: #fff; border-color: #cfdcee; border-radius: 50px; box-shadow: 0 6px 0 #d6e2f2; color: #34506e; }
.field.rain-may .drop b { color: #34506e; }
.field.rain-sam .drop, .sart.rainp.r-sam, .shopcard .rainp.r-sam { background: #261a4a; border-color: #ffe24a; border-radius: 8px; box-shadow: 0 0 12px rgba(255, 226, 74, .7); color: #fff3a0; }
.field.rain-sam .drop b { color: #fff3a0; } .field.rain-sam .drop small { color: #cdb8ff; }
.field.rain-keo .drop, .sart.rainp.r-keo, .shopcard .rainp.r-keo { background: linear-gradient(#ffb3d1, #ff7fb0); border-color: #d6407a; border-radius: 999px; color: #7a1040; }
.field.rain-keo .drop b { color: #7a1040; } .field.rain-keo .drop small { color: #8a2a52; }
.field.rain-go-r .drop, .sart.rainp.r-go-r, .shopcard .rainp.r-go-r { background: repeating-linear-gradient(95deg, rgba(120, 70, 20, .15) 0 3px, transparent 3px 9px), linear-gradient(#e8c08a, #c8905a); border-color: #7a4a1a; border-radius: 6px; color: #3a2208; }
.field.rain-go-r .drop b { color: #3a2208; }

/* ===== Đồ mới: mặt lưng quân bài ===== */
.bk-tre { --bk: linear-gradient(135deg, #7ad47a, #1f6a3a); } .bk-nguyet { --bk: linear-gradient(135deg, #fff3b0, #e0b840); } .bk-kim { --bk: linear-gradient(135deg, #f2c230, #8a5a00); } .bk-ngoc { --bk: linear-gradient(135deg, #7ae0c0, #17786a); }
.bk-xuan { --bk: linear-gradient(135deg, #ffc2d6, #7ad47a); } .bk-thu { --bk: linear-gradient(135deg, #ffb347, #a83a10); } .bk-dong { --bk: linear-gradient(135deg, #e8f6ff, #5a9ad8); }
.sart.bkp:is(.bk-tre, .bk-nguyet, .bk-kim, .bk-ngoc, .bk-xuan, .bk-thu, .bk-dong) { background: var(--bk); }
.mcard:is(.bk-tre, .bk-nguyet, .bk-kim, .bk-ngoc, .bk-xuan, .bk-thu, .bk-dong) .front { font-family: var(--hanzi); font-size: 2.6rem; width: 100%; height: 100%; display: grid; place-items: center; border-radius: 0; color: #fff3c0; background: transparent !important; }
.mcard:is(.bk-tre, .bk-nguyet, .bk-kim, .bk-ngoc, .bk-xuan, .bk-thu, .bk-dong):not(.up) { padding: 0; border-color: transparent; background: var(--bk); }
.mcard.flip3d:is(.bk-tre, .bk-nguyet, .bk-kim, .bk-ngoc, .bk-xuan, .bk-thu, .bk-dong) .front { background: var(--bk) !important; border-color: transparent; }
.bk-nguyet .front, .bk-xuan .front, .bk-dong .front { color: #3a3a4a !important; text-shadow: none; }
.sart.bkp.bk-nguyet, .sart.bkp.bk-xuan, .sart.bkp.bk-dong { color: #3a3a4a; }

/* ===== Hạt hiệu ứng mới khi trả lời đúng ===== */
.fxp.heart { background: #ff5a8a; width: 13px; height: 13px; clip-path: path("M6.5 12 C-5 4 0 -3 6.5 2 C13 -3 18 4 6.5 12Z"); }
.fxp.star { background: #ffd84d; width: 14px; height: 14px; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.fxp.leaf { background: #5ac26a; width: 13px; height: 9px; border-radius: 0 80% 0 80%; }
.fxp.snow { background: #fff; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px #cfeaff; }
.fxp.ember { background: #ff9a2a; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px #ff5a00; }
.fxp.bubble { background: rgba(180, 225, 255, .35); border: 2px solid rgba(255, 255, 255, .9); width: 15px; height: 15px; border-radius: 50%; box-sizing: border-box; }
.fxp.lantern { background: #e8304a; width: 10px; height: 13px; border-radius: 40%; box-shadow: 0 0 6px #ffb347; }
/* Cửa hàng: Gương Thần xem trước gọn trên điện thoại (ẩn cảnh thầy trò ở tab Trò chơi, ẩn bài và mưa chữ cho đỡ cao) */
@media (max-width: 899px) {
  .shopkho:not(.shoplook) .kst[data-mir="2"]:not(.mini) .khero { display: none !important; }
  .shopkho .kst[data-mir="2"]:not(.mini) .kmini { display: none !important; }
  .shopkho .kstage { top: calc(var(--hbar, 61px) + 4px); }
}
/* Cửa hàng có Gương Thần: các thanh cố định xếp chồng theo đúng chiều cao (biến --shoptabh, --stageh do app.js đo) */
.shopkho .kstage { top: calc(var(--hbar, 61px) + var(--shoptabh, 56px)); z-index: 7; }
.shopkho .shopmain .shopsecs { position: sticky; top: calc(var(--hbar, 61px) + var(--shoptabh, 56px)); z-index: 6; background: var(--bg); }
@media (max-width: 899px) {
  .shopkho .shopmain .shopsecs { top: calc(var(--hbar, 61px) + var(--shoptabh, 56px) + var(--stageh, 185px)); }
  .shoplook .kst[data-mir="2"]:not(.mini) .kgm { display: none !important; }
}
/* Đầu khung Gương Thần: tên và nút "Thu nhỏ" một hàng, hai nút Gương 1 / Gương 2 một hàng riêng, không còn xuống dòng lung tung */
.kst .khead { flex-wrap: wrap; row-gap: 6px; }
.kst .khead b { white-space: nowrap; }
.kst .kmir { order: 3; flex: 1 1 100%; display: flex; margin: 0; }
.kst .kmir button { flex: 1; text-align: center; }
.kst .kmini-b { margin-left: auto; white-space: nowrap; }
/* Khối gộp "Quà tặng và quyền lợi người khác" trong Bảng điều khiển chủ */
.ow-all { padding: 6px 10px; }
.owsec { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--card); }
.owsec > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.owsec > summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); }
.owsec[open] > summary::after { content: "–"; }
.owsec > summary::-webkit-details-marker { display: none; }
.owin { padding: 2px 14px 14px; }
/* Thanh lượt ôn tập hôm nay */
.gbar { display: block; height: 7px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.gbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold, #c8a000), var(--red, #c8361e)); transition: width .3s; }
/* ===== Độ hiếm của món trong cửa hàng ===== */
.shopcard .rar { position: absolute; top: 6px; right: 8px; padding: 1px 8px; font-size: .62rem; font-weight: 800; border-radius: 999px; letter-spacing: .02em; border: 1px solid transparent; z-index: 2; }
.rar-thuong { background: #e8ecf0; color: #4a5560; border-color: #c8d0d8; } .rar-itgap { background: #def5e4; color: #1f6a3a; border-color: #9ad4ac; }
.rar-hiem { background: #dcecff; color: #1d5a9a; border-color: #8cbcf0; } .rar-cuchiem { background: #ecdcff; color: #5a2a9a; border-color: #bc9cf0; }
.rar-huyenthoai { background: linear-gradient(100deg, #ffd84d, #ff8a2a); color: #3a1f00; border-color: #c8861a; box-shadow: 0 0 8px rgba(255, 170, 40, .6); }
.shopcard[data-rar="hiem"] { box-shadow: inset 0 0 0 1px #8cbcf0; } .shopcard[data-rar="cuchiem"] { box-shadow: inset 0 0 0 1px #bc9cf0; } .shopcard[data-rar="huyenthoai"] { box-shadow: inset 0 0 0 2px #ffb347, 0 0 12px rgba(255, 170, 40, .35); }
.rarbar { align-items: center; margin: 4px 0 8px; } .rarlab { font-size: .8rem; color: var(--muted); margin-right: 4px; }
.rarbar .rtool { padding: 4px 10px; font-size: .78rem; }
.rarbar .rtool.on { outline: 2px solid var(--gold, #c8a000); }
/* Nhãn độ hiếm kiểu ruy băng góc trái như nhãn "Hiếm" cũ; nhãn trạng thái (Đã có, Đang thử, gói VIP) chuyển sang góc phải */
.shopcard .rar { position: absolute; top: -1px; left: -1px; right: auto; padding: 2px 10px 3px; font-size: .68rem; font-weight: 800; border: 0; box-shadow: none; border-radius: var(--r-card, 12px) 0 10px 0; letter-spacing: .03em; z-index: 3; }
.shopcard .rar.rar-thuong { background: #6b7683; color: #fff; }
.shopcard .rar.rar-itgap { background: #2f9a5a; color: #fff; }
.shopcard .rar.rar-hiem { background: #2f6fb5; color: #fff; }
.shopcard .rar.rar-cuchiem { background: #8a4fd0; color: #fff; }
.shopcard .rar.rar-huyenthoai { background: linear-gradient(100deg, #ffd84d, #ff8a2a); color: #3a1f00; }
.shopcard .rib { left: auto; right: -1px; border-radius: 0 var(--r-card, 12px) 0 10px; z-index: 3; }
/* ===== Viền theo độ hiếm: càng hiếm càng nổi ===== */
.shopcard { transition: box-shadow .2s; }
.shopcard[data-rar="itgap"] { box-shadow: inset 0 0 0 2px #7cc891; }
.shopcard[data-rar="hiem"] { box-shadow: inset 0 0 0 3px #4a8fe0, 0 0 8px rgba(74, 143, 224, .35); }
.shopcard[data-rar="cuchiem"] { box-shadow: inset 0 0 0 3px #9b5de5, 0 0 14px rgba(155, 93, 229, .55); background-image: linear-gradient(135deg, rgba(155, 93, 229, .10), transparent 55%); }
.shopcard[data-rar="huyenthoai"] { box-shadow: inset 0 0 0 4px #ffb42a, 0 0 20px rgba(255, 160, 30, .75), 0 0 4px #ff8a00; background-image: linear-gradient(135deg, rgba(255, 200, 60, .22), rgba(255, 140, 40, .05) 60%); animation: rarglow 2.2s ease-in-out infinite; }
@keyframes rarglow { 0%, 100% { box-shadow: inset 0 0 0 4px #ffb42a, 0 0 14px rgba(255, 160, 30, .55), 0 0 3px #ff8a00; } 50% { box-shadow: inset 0 0 0 4px #ffd84d, 0 0 28px rgba(255, 170, 40, .95), 0 0 6px #ff8a00; } }
@media (prefers-reduced-motion: reduce) { .shopcard[data-rar="huyenthoai"] { animation: none; } }

/* ===== Đồ VIP mới: nút bấm, khung câu hỏi, kiểu mưa, mặt lưng bài, hạt hiệu ứng ===== */
#gm[data-btn="vip-hoang-gia"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="vip-hoang-gia"] { background: linear-gradient(#4a2a8a, #24104e); border: 2px solid #ffd84d; color: #ffe9a8; font-weight: 800; border-radius: 10px; box-shadow: 0 0 10px rgba(255, 216, 77, .6), inset 0 1px 0 rgba(255, 255, 255, .3); }
#gm[data-btn="vip-ngan-ha-b"] :is(.opt, .tk, .dmt, .pbtn), .btnprev[data-b="vip-ngan-ha-b"] { background: radial-gradient(circle at 20% 30%, rgba(180, 140, 255, .55), transparent 45%), radial-gradient(circle at 80% 70%, rgba(80, 200, 255, .5), transparent 45%), #0e0c2e; border: 2px solid transparent; background-clip: padding-box; color: #eef0ff; font-weight: 700; border-radius: 10px; box-shadow: 0 0 0 2px #ff8ad0, 0 0 0 4px #6ad0ff, 0 0 12px rgba(138, 122, 255, .7); }
#gm[data-card="vip-hoang-gia-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="vip-hoang-gia-c"] { background: linear-gradient(135deg, #3a1f6e, #1c0e40); border: 3px double #ffd84d; border-radius: 14px; color: #fff3c8; box-shadow: 0 0 14px rgba(255, 216, 77, .5); }
#gm[data-card="vip-bao-thach-c"] :is(.qbox, .ask, .pot-card), .cardprev[data-c="vip-bao-thach-c"] { background: linear-gradient(135deg, #1a1040, #0c2a40); border: 3px solid transparent; border-radius: 14px; color: #f0f4ff; box-shadow: 0 0 0 2px #ff6aa8, 0 0 0 4px #ffd84d, 0 0 0 6px #4ad0ff, 0 0 14px rgba(255, 255, 255, .35); animation: bgem 4s linear infinite; }
@keyframes bgem { to { filter: hue-rotate(360deg); } }
#gm:is([data-card="vip-hoang-gia-c"], [data-card="vip-bao-thach-c"]) :is(.qbox, .ask, .pot-card) :is(.py, .big, .bigvi, .big-vi, .zhline, .note, small, b) { color: inherit; }
.field.rain-vip-vang-r .drop, .sart.rainp.r-vip-vang-r, .shopcard .rainp.r-vip-vang-r { background: linear-gradient(135deg, #fff3a0, #f2b01a 60%, #c8861a); border-color: #8a5a00; border-radius: 6px 6px 14px 14px; color: #4a2c00; box-shadow: 0 0 10px rgba(255, 200, 40, .7); }
.field.rain-vip-ngoc-r .drop, .sart.rainp.r-vip-ngoc-r, .shopcard .rainp.r-vip-ngoc-r { background: linear-gradient(135deg, #e8d0ff, #a06ae8 60%, #6a3ab8); border-color: #3a1a78; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); color: #20093f; }
.field.rain-vip-vang-r .drop b, .field.rain-vip-ngoc-r .drop b { color: inherit; }
.bk-vip-phung { --bk: linear-gradient(135deg, #e8304a, #f2b01a); } .bk-vip-de { --bk: linear-gradient(135deg, #5a2aa8, #ffd84d); }
.sart.bkp:is(.bk-vip-phung, .bk-vip-de) { background: var(--bk); }
.mcard:is(.bk-vip-phung, .bk-vip-de) .front { font-family: var(--hanzi); font-size: 2.6rem; width: 100%; height: 100%; display: grid; place-items: center; border-radius: 0; color: #fff3c0; background: transparent !important; }
.mcard:is(.bk-vip-phung, .bk-vip-de):not(.up) { padding: 0; border-color: transparent; background: var(--bk); }
.mcard.flip3d:is(.bk-vip-phung, .bk-vip-de) .front { background: var(--bk) !important; border-color: transparent; }
.fxp.crown { background: #ffd84d; width: 15px; height: 12px; clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%); }
.fxp.gem { background: linear-gradient(135deg, #eaffff, #4ad0ff); width: 12px; height: 14px; clip-path: polygon(50% 0, 100% 38%, 50% 100%, 0 38%); }
/* Khung cảnh, cảnh nền trang đầu của đồ VIP */
.sc-vip-hoang-kim { background: linear-gradient(rgba(58, 31, 102, .45), rgba(255, 209, 102, .22)); }
.sc-vip-ngoc-bich { background: linear-gradient(rgba(23, 165, 138, .3), rgba(191, 247, 222, .1)); }
.vipall { margin: 8px 0; } .vipall .note { line-height: 2; } .vchip { display: inline-block; padding: 1px 9px; margin: 0 2px; border-radius: 999px; font-size: .78rem; background: var(--card); border: 1px solid var(--gold, #c8a000); white-space: nowrap; }
/* Hình xem trước đồ VIP ở trang Quyền lợi các gói: dùng lại kiểu của thẻ cửa hàng */
.vipit .sart { width: 64px; height: 64px; display: grid; place-items: center; } .vipit .sart svg { width: 100%; height: 100%; } .vipit .sart.ic { border-radius: 14px; background: var(--lemon); color: var(--red); } .vipit .sart.ic .ic { width: 34px; height: 34px; }
.vipit .sart.rainp { padding: 2px 8px; border: 2px solid; display: inline-grid; width: 46px; height: 46px; font-family: var(--hanzi); font-size: 1.3rem; } .vipit .btnprev, .vipit .cardprev { display: inline-block; padding: 8px 10px; font-weight: 700; } .vipit .cardprev { min-width: 48px; text-align: center; } .vipit .sart svg.sface { width: 100%; height: 100%; }
.vipit .sart { width: 64px; height: 64px; display: grid; place-items: center; } .vipit .sart svg { width: 100%; height: 100%; } .vipit .sart.ic { border-radius: 14px; background: var(--lemon); color: var(--red); } .vipit .sart.ic .ic { width: 34px; height: 34px; }
.vipit .sart.sw { border-radius: 14px; border: 1px solid var(--line); }
.vipit .sart.bkp { border-radius: 10px; font-family: var(--hanzi); font-size: 1.9rem; color: #fff3c0; width: 52px; height: 64px; margin: auto; background: linear-gradient(135deg, var(--red), var(--gold)); }
.vipit .sart.dots { display: flex; gap: 3px; align-items: center; justify-content: center; } .vipit .sart.dots i { width: 16px; height: 34px; border-radius: 8px; display: block; }
.vipit .sart.mons { display: flex; align-items: center; justify-content: center; } .vipit .sart.mons .amon { width: 30px; height: 30px; margin: 0 -3px; }
.vipit .sart .bladeprev { width: 100%; height: 100%; } .shopinfo .bladedemo { min-height: 160px; }
.vipit .sart { flex: none; width: 64px; height: 64px; overflow: hidden; display: grid; place-items: center; }
.vipit .sart.none { opacity: .45; border: 1.5px dashed var(--line); border-radius: 12px; } .vipit .sart.none .ic { width: 22px; height: 22px; }
.vipit .sart .pfbadge { width: 30px; height: 36px; margin: 0; } .vipit .sart .pfflag { width: 30px; height: 44px; margin: 0; } .vipit .sart .pfintro { display: none; }
.vipit .sart .pfplate { max-width: 62px; font-size: .72rem; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vipit .sart.av .pffull.mini { width: 54px; }
.vipit .sface .f-ok { display: block; } .vipit .sface .f-cheer, .vipit .sface .f-bad { display: none; }

/* Chế độ dạy học (chỉ chủ) */
#teachpill { position: fixed; left: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted); font-size: .76rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); cursor: pointer; }
#teachpill.on { background: #ffd84d; color: #3a2a00; border-color: #c8861a; box-shadow: 0 0 12px rgba(255, 190, 40, .7); }

/* Ô đang được chọn trong các trò nối cặp: nhấc lên, viền màu đậm, dấu tích tròn ở góc. Mỗi kiểu nút trong cửa hàng có màu chọn riêng, tương phản với màu nút để không bị chìm. */
#gm .pbtn.sel, .pbtn.sel { --selc: #ffc83d; --selt: #3a2400; position: relative; transform: translateY(-3px); filter: brightness(1.1) saturate(1.15); border-color: var(--selc) !important; box-shadow: 0 0 0 3px var(--selc), 0 8px 18px rgba(0, 0, 0, .3) !important; transition: transform .15s ease, box-shadow .15s ease; }
#gm .pbtn.sel::after, .pbtn.sel::after { content: "✓"; position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; background: var(--selc); color: var(--selt); font: 800 13px/22px system-ui, sans-serif; text-align: center; box-shadow: 0 2px 5px rgba(0, 0, 0, .35); }
#gm[data-btn="ngoc"] .pbtn.sel { --selc: #ff5a36; --selt: #fff; }
#gm[data-btn="neon"] .pbtn.sel { --selc: #ff3df0; --selt: #fff; }
#gm[data-btn="truc"] .pbtn.sel { --selc: #1f6fe0; --selt: #fff; }
#gm[data-btn="vang"] .pbtn.sel { --selc: #7a1cd6; --selt: #fff; }
#gm[data-btn="go"] .pbtn.sel { --selc: #ffe14d; --selt: #3a2400; }
#gm[data-btn="keo"] .pbtn.sel { --selc: #1ea7ff; --selt: #fff; }
#gm[data-btn="bang"] .pbtn.sel { --selc: #ff7a00; --selt: #fff; }
#gm[data-btn="lua"] .pbtn.sel { --selc: #00e5ff; --selt: #00323a; }
#gm[data-btn="dao"] .pbtn.sel { --selc: #14a36a; --selt: #fff; }
#gm[data-btn="dem"] .pbtn.sel { --selc: #ffe14d; --selt: #3a2400; }
#gm[data-btn="sakura-b"] .pbtn.sel { --selc: #1d6fd8; --selt: #fff; }
#gm[data-btn="trang-nguyet"] .pbtn.sel { --selc: #6a2fd6; --selt: #fff; }
#gm[data-btn="bien-sau"] .pbtn.sel { --selc: #ffe14d; --selt: #3a2400; }
#gm[data-btn="pixel"] .pbtn.sel { --selc: #ff2e63; --selt: #fff; }
#gm[data-btn="kim-loai"] .pbtn.sel { --selc: #e8302a; --selt: #fff; }
#gm[data-btn="cau-vong-b"] .pbtn.sel { --selc: #111; --selt: #fff; }
#gm[data-btn="mat-ong"] .pbtn.sel { --selc: #6a2fd6; --selt: #fff; }
#gm[data-btn="toi-do"] .pbtn.sel { --selc: #3dffb0; --selt: #04301f; }
#gm[data-btn="vip-hoang-gia"] .pbtn.sel { --selc: #4de1ff; --selt: #00323a; }
#gm[data-btn="vip-ngan-ha-b"] .pbtn.sel { --selc: #ffe14d; --selt: #3a2400; }

/* Trò nối cặp: hai cột chung một lưới hàng, ô trái và ô phải cùng hàng luôn cao bằng nhau nên hai bên cân đối */
.pairs { grid-auto-flow: row dense; gap: 8px 10px; align-items: stretch; }
.pairs > .col { display: contents; }
.pairs .pbtn { width: 100%; box-sizing: border-box; display: flex; align-items: center; min-height: 52px; }
.pairs .pbtn.l { grid-column: 1; }
.pairs .pbtn.r { grid-column: 2; }
.pairs .pbtn small.spy { margin-left: 4px; }

.mesec-go .mesec-sum { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; } .mesec-go .mesec-sum .h2 { margin: 0; } .mesec-go .mesec-sum:focus-visible { outline: 2px solid var(--gold); border-radius: 14px; }


/* Ôn nhiều Unit */
.mu .mu-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.mu .mu-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }
.mu .mu-chip.on { background: var(--red, #b81d0b); color: #fff; border-color: transparent; }
.mu .mu-chip i { font-style: normal; margin-left: 6px; background: var(--gold, #ffc83d); color: #3a2400; border-radius: 999px; padding: 0 7px; font-size: .8rem; }
.mu .mu-link { all: unset; cursor: pointer; color: var(--muted); font-size: .9rem; text-decoration: underline; padding: 2px 4px; }
.mu .mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.mu .mu-u { padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; }
.mu .mu-u.on { background: var(--lemon, #fff3b0); border-color: var(--gold, #ffc83d); box-shadow: 0 0 0 2px var(--gold, #ffc83d); }
.mu .mu-u.lock { opacity: .5; cursor: not-allowed; }
.mu .mu-sum { margin: 4px 0 10px; color: var(--muted); }

/* Phím tắt: nhãn A B C D… cho đáp án, số ở cột trái và chữ ở cột phải của trò nối cặp */
.opts { counter-reset: optn; }
.opts > .opt::before { counter-increment: optn; content: counter(optn, upper-alpha); display: inline-block; min-width: 1.5em; margin-right: 8px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .14); font: 800 .78em/1.6 system-ui, sans-serif; text-align: center; vertical-align: .08em; }
.pairs { counter-reset: ln rn; }
.pairs .pbtn.l::before { counter-increment: ln; content: counter(ln); }
.pairs .pbtn.r::before { counter-increment: rn; content: counter(rn, upper-alpha); }
.pairs .pbtn.l::before, .pairs .pbtn.r::before { display: inline-block; flex: none; min-width: 1.5em; margin-right: 8px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .14); font: 800 .78rem/1.6 system-ui, sans-serif; text-align: center; }
.pairs .pbtn.done::before { opacity: .5; }
.gamebar .helpbtn + .helpbtn { margin-left: 0; }

/* Xếp Khối Hán Ngữ */
.bb-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: min(100%, 380px); margin: 6px auto 10px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; touch-action: none; }
.bb-board .bc { aspect-ratio: 1; border-radius: 6px; background: var(--field2); display: flex; align-items: center; justify-content: center; font-family: var(--hanzi); font-style: normal; font-weight: 700; color: #fff; line-height: 1; overflow: hidden; }
.bb-board .bc.on { box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.25); }
.bb-board .bc.pv { outline: 2px solid var(--ok); background: color-mix(in srgb, var(--ok) 35%, var(--field2)); }
.bb-board .bc.pvx { outline: 2px solid var(--bad); background: color-mix(in srgb, var(--bad) 30%, var(--field2)); }
.bb-tray { display: flex; justify-content: space-around; align-items: center; gap: 8px; min-height: 108px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; touch-action: none; }
.bb-piece { padding: 8px; border-radius: 10px; cursor: grab; border: 2px solid transparent; user-select: none; }
.bb-piece.sel { border-color: var(--gold); background: var(--lemon); }
.bb-piece.used { visibility: hidden; }
.bp-g { display: grid; gap: 2px; margin: 0 auto; }
.bp-l { text-align: center; margin-top: 4px; font-family: var(--hanzi); font-weight: 700; font-size: 1.05rem; }
.bp-g i { aspect-ratio: 1; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-weight: 700; font-family: var(--hanzi); line-height: 1; overflow: hidden; }
.bb-ask { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); padding: 12px; display: flex; flex-direction: column; justify-content: center; border-radius: 14px; }
.bb-q { min-height: 0; gap: 4px; }
.bb-z { font-family: var(--hanzi); font-size: 2.6rem; }
#gm:has(.bb-board) { position: relative; }
.bxnode { position: relative; margin-top: 10px; }

/* Kiểu con dấu Tốc Ấn (mua trong Cửa hàng) */
.tocan.sl-vang .ts-seal.on { background: #d9a520; color: #5a3a00; border-color: #8a5d00; box-shadow: inset 0 0 0 3px #d9a520, inset 0 0 0 4.5px #fff3b8aa, 0 3px 0 #8a5d00; }
.tocan.sl-ngoc .ts-seal.on { background: #2f8f6b; color: #e6fff3; border-color: #17543e; box-shadow: inset 0 0 0 3px #2f8f6b, inset 0 0 0 4.5px #e6fff3aa, 0 3px 0 #17543e; }
.tocan.sl-may .ts-seal.on { background: #4a90c8; color: #fff; border-color: #2a5f8f; border-radius: 50%; box-shadow: inset 0 0 0 3px #4a90c8, inset 0 0 0 4.5px #ffffffaa, 0 3px 0 #2a5f8f; }
.tocan.sl-lua .ts-seal.on { background: linear-gradient(160deg, #f7b32b, #e8501c); color: #fff6dc; border-color: #8a2a0a; box-shadow: inset 0 0 0 3px #e8501c, inset 0 0 0 4.5px #fff6dcaa, 0 3px 0 #8a2a0a; }
.tocan.sl-bang .ts-seal.on { background: #8fd3f0; color: #0f4a66; border-color: #3b86a8; box-shadow: inset 0 0 0 3px #8fd3f0, inset 0 0 0 4.5px #ffffffcc, 0 3px 0 #3b86a8; }
.tocan.sl-tim .ts-seal.on { background: #7b3fa8; color: #f3dcff; border-color: #43205f; box-shadow: inset 0 0 0 3px #7b3fa8, inset 0 0 0 4.5px #f3dcffaa, 0 3px 0 #43205f; }
.tocan.sl-den .ts-seal.on { background: #1c1c1c; color: #e3b653; border-color: #e3b653; box-shadow: inset 0 0 0 3px #1c1c1c, inset 0 0 0 4.5px #e3b653aa, 0 3px 0 #000; }
.sealp.tocan { margin: 0; align-items: center; justify-content: center; height: 100%; }
.sealp .ts-seal { width: 38px; height: 38px; font-size: 1.4rem; animation: none; }
/* Chọn độ khó trong game */
.diffbar { display: flex; gap: 6px; margin: 6px 0 8px; }
.diffbar button { flex: 1; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-weight: 700; line-height: 1.15; }
.diffbar button small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.diffbar button.on { background: var(--red); color: var(--on-red); border-color: var(--red); }
.diffbar button.on small { color: var(--on-red); opacity: .85; }
/* Điểm danh */
.chip.ci-new { position: relative; }
.chip.ci-new::after { content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); }
.ci-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0; }
.ci-c { position: relative; aspect-ratio: 1 / 1.1; border: 1px solid var(--line); border-radius: 9px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: .78rem; overflow: hidden; }
.ci-c small { position: absolute; top: 2px; left: 4px; font-size: .62rem; color: var(--muted); }
.ci-c svg { width: 18px; height: 18px; }
.ci-c span { font-weight: 700; color: var(--gold); margin-top: 6px; }
.ci-c i { position: absolute; bottom: 1px; right: 4px; font-style: normal; font-weight: 800; color: var(--red); font-size: .8rem; }
.ci-c em { font-style: normal; font-weight: 700; font-size: .66rem; color: var(--gold); }
.ci-c.done { background: color-mix(in srgb, var(--ok) 22%, var(--card)); color: var(--ok); border-color: var(--ok); }
.ci-c.cur { border: 2px solid var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.ci-c.ms { background: var(--lemon); border-color: var(--gold); }
.ci-c.ms.done { background: color-mix(in srgb, var(--ok) 22%, var(--lemon)); }
.ci-next { text-align: center; margin: 6px 0; }
/* Bảng chọn trò: mỗi mục là một ngăn kéo, chỉ mở mục đang chọn */
.rv-sec { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin: 6px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); text-align: left; }
.rv-sec b { flex: 1; font-size: 1.02rem; }
.rv-sec small { color: var(--muted); }
.rv-sec svg { width: 18px; height: 18px; transition: transform .2s; }
.rv-sec.open { background: var(--lemon); border-color: var(--gold); }
.rv-sec.open svg { transform: rotate(90deg); }
.games[hidden] { display: none; }
/* Nền trang cá nhân (mua trong Cửa hàng, tab Giao diện) */
[data-pc] { background-image: var(--pcp), linear-gradient(180deg, var(--pc1), var(--pc2)); background-size: var(--pcs, 80px), 100% 100%; }
[data-pc] .pfban { background: var(--pcb); height: 120px; }
.shopcard .sart.pcp, .sart.pcp { height: 64px; width: 64px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; padding: 0; display: block; }
.sart.pcp:not([data-pc]) { background: var(--card); }
.sart.pcp .pfban { height: 30px; width: 100%; margin: 0; }
.pcdemo .pf { max-width: 340px; margin: 0 auto; padding-bottom: 12px; }
.pcface { width: 84px; margin: -54px auto 6px; border-radius: 12px; overflow: hidden; border: 2px solid #fff; position: relative; }
[data-pc="hoa-dao"] { --pc1: #fff7f4; --pc2: #ffe6ee; --pcb: linear-gradient(120deg,#ff9fb8,#ffd1dc); --pcs: 80px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='%23ff9fb8' opacity='.5'%3E%3Cpath d='M14 10q8-6 10 4q-8 6-10-4z'/%3E%3Cpath d='M52 40q8-6 10 4q-8 6-10-4z'/%3E%3Cpath d='M30 62q8-6 10 4q-8 6-10-4z'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="truc-xanh"] { --pc1: #f2fbef; --pc2: #d9f0d4; --pcb: linear-gradient(120deg,#3f9f5a,#a7dca0); --pcs: 60px 80px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='80'%3E%3Cg stroke='%232d7a48' opacity='.22' stroke-width='5'%3E%3Cpath d='M10 0V80M40 0V80'/%3E%3C/g%3E%3Cg stroke='%232d7a48' opacity='.3' stroke-width='2'%3E%3Cpath d='M5 24H15M35 52H45'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="song-nuoc"] { --pc1: #f0f8ff; --pc2: #d6ebfa; --pcb: linear-gradient(120deg,#2e86c1,#8fd0f0); --pcs: 60px 30px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='30'%3E%3Cpath d='M0 15q15-14 30 0t30 0' fill='none' stroke='%232e86c1' stroke-opacity='.28' stroke-width='3'/%3E%3C/svg%3E"); }
[data-pc="tuyet-trang"] { --pc1: #eaf3ff; --pc2: #ffffff; --pcb: linear-gradient(120deg,#8fb8f5,#e6f0ff); --pcs: 70px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Cg fill='%23b7d3ff'%3E%3Ccircle cx='10' cy='12' r='2.5'/%3E%3Ccircle cx='42' cy='30' r='2'/%3E%3Ccircle cx='24' cy='56' r='3'/%3E%3Ccircle cx='60' cy='60' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="may-vang"] { --pc1: #fffaf0; --pc2: #fff0c8; --pcb: linear-gradient(120deg,#f2b830,#ffe28a); --pcs: 100px 60px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='60'%3E%3Cg fill='%23f2c230' opacity='.35'%3E%3Cellipse cx='25' cy='20' rx='16' ry='7'/%3E%3Cellipse cx='36' cy='15' rx='9' ry='7'/%3E%3Cellipse cx='75' cy='46' rx='14' ry='6'/%3E%3Cellipse cx='84' cy='41' rx='8' ry='6'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="den-long"] { --pc1: #fff6f2; --pc2: #ffe0d6; --pcb: linear-gradient(120deg,#c0261a,#f07a4a); --pcs: 80px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg opacity='.3'%3E%3Cellipse cx='20' cy='28' rx='8' ry='10' fill='%23e8381a'/%3E%3Cpath d='M20 12V18M16 38h8' stroke='%23c8962e' stroke-width='2'/%3E%3Cellipse cx='60' cy='62' rx='8' ry='10' fill='%23e8381a'/%3E%3Cpath d='M60 46V52M56 72h8' stroke='%23c8962e' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="dem-sao"] { --pc1: #f0ecff; --pc2: #ddd4ff; --pcb: linear-gradient(120deg,#1c2352,#6a5fd0); --pcs: 90px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23ffd84d' opacity='.7'%3E%3Cpath d='M15 14l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3Cpath d='M62 48l1.6 4 4 1.6-4 1.6-1.6 4-1.6-4-4-1.6 4-1.6z'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="cau-vong"] { --pc1: #fff8fd; --pc2: #eef6ff; --pcb: linear-gradient(90deg,#ff8a8a,#ffc46b,#fff08a,#8fe0a8,#7cc2ff,#b79bff); --pcs: 70px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Cg opacity='.45'%3E%3Ccircle cx='12' cy='14' r='3' fill='%23ff9fb8'/%3E%3Ccircle cx='46' cy='30' r='3' fill='%239ad0ff'/%3E%3Ccircle cx='26' cy='56' r='3' fill='%23ffe066'/%3E%3Ccircle cx='60' cy='60' r='3' fill='%239be0b0'/%3E%3C/g%3E%3C/svg%3E"); }
[data-pc="cung-dinh"] { --pc1: #fffaf0; --pc2: #fbe9c0; --pcb: linear-gradient(120deg,#8e1b1b,#e0a82e); --pcs: 90px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Ctext x='45' y='58' font-size='34' text-anchor='middle' fill='%23c8962e' opacity='.2' font-family='serif'%3E福%3C/text%3E%3C/svg%3E"); }
[data-pc="ngan-ha"] { --pc1: #f5eeff; --pc2: #e6d6fa; --pcb: linear-gradient(120deg,#2a1450,#c0508a); --pcs: 90px; --pcp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23ffffff' opacity='.75'%3E%3Cpath d='M15 14l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3Cpath d='M62 48l1.6 4 4 1.6-4 1.6-1.6 4-1.6-4-4-1.6 4-1.6z'/%3E%3Ccircle cx='74' cy='14' r='1.6'/%3E%3Ccircle cx='30' cy='70' r='1.6'/%3E%3C/g%3E%3C/svg%3E"); }

/* Gương Thần: cảnh Gương 2 co theo khung, không bị kéo rộng làm mất nhân vật */
.kst .khero .hero3 { width: 100%; max-width: 100%; height: auto !important; min-height: 0 !important; }
.kst .khero .h3scene { width: 100% !important; max-width: 100%; min-width: 0; height: auto !important; aspect-ratio: 600 / 150; overflow: hidden; }
.kst .khero .h3scene > svg.hs { width: 100%; height: 100%; display: block; }
.kst .khero .h3scene { min-height: 0 !important; }

/* Nút tốc độ đọc: thu nhỏ thành thẻ mỏng dính cạnh phải, mờ khi không dùng */
#spd { right: 0; bottom: 120px; opacity: .55; transition: opacity .2s; }
#spd:hover, #spd.open, #spd:focus-within { opacity: 1; }
.spd-btn { flex-direction: column; gap: 1px; padding: 6px 5px 5px 7px; min-width: 36px; border-radius: 12px 0 0 12px; border-right: 0; box-shadow: -2px 2px 8px rgba(0, 0, 0, .22); font-size: .64rem; line-height: 1.1; }
.spd-btn .ic { width: 1rem; height: 1rem; }
.spd-pop { margin-right: 6px; }
/* Điện thoại: thanh trên cùng xếp 2 hàng gọn (tên ở hàng 1, nút nhỏ ở hàng 2), thông báo nổi không bị bóp hẹp */
.rm-toast { width: max-content; }
@media (max-width: 520px) {
  header.bar { flex-wrap: wrap; row-gap: 6px; }
  header.bar .btitle { flex: 1 1 0; min-width: 0; }
  header.bar .chips { order: 3; flex: 1 1 100%; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; padding-bottom: 2px; }
  header.bar .chips::-webkit-scrollbar { display: none; }
  header.bar .chip { flex: none; padding: 5px 8px; font-size: .85rem; }
  .rm-toast { max-width: 94vw; flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .rm-toast { left: 8px; right: 8px; transform: none; width: auto; max-width: none; margin: 0 auto; }
  .rm-toast > * { min-width: 0; }
  header.bar .chips { justify-content: space-between; overflow: visible; gap: 3px; }
  header.bar .chip { padding: 5px 7px; font-size: .78rem; gap: 3px; }
}.diffnote { margin: 0 0 10px; padding: 7px 10px; border-radius: 10px; background: var(--card); border: 1px dashed var(--line); font-size: .82rem; line-height: 1.35; color: var(--muted); }
.diffnote b { color: var(--fg); }
