/* ===== Trang chủ (xếp dọc) + thanh con Rubik + khu Cờ vua VIP ===== */

/* Thanh con khu Rubik: Giải Rubik · Bấm giờ · Luyện tập */
.subnav { display: flex; align-items: center; gap: 6px; max-width: 1120px; width: calc(100% - 32px); margin: 10px auto 0; padding: 6px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav[hidden] { display: none; }
.subnav-t { flex: none; padding: 0 8px 0 6px; font-weight: 800; font-size: .9rem; color: var(--text-2); border-right: 1px solid var(--border); margin-right: 2px; }
.subnav a { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: 12px; color: var(--muted); font-weight: 700; font-size: .92rem; text-decoration: none; }
.subnav a:hover { background: var(--surface-2); color: var(--text); }
.subnav a.active { background: var(--accent-soft); color: var(--accent-ink); }
body.timing .subnav, body.play-mode .subnav { display: none; }
.subnav-sound { margin-left: auto; flex: none; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 1.05rem; line-height: 1; }
.subnav-sound:hover { background: var(--accent-soft); }
.subnav-sound.off { opacity: .55; }
@media (max-width: 600px) { .subnav { width: calc(100% - 24px); margin-top: 8px; } .subnav a { padding: 7px 11px; font-size: .86rem; } .subnav-t { display: none; } }

/* Trang chủ */
.home { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; padding-top: 14px; padding-bottom: 24px; }
.home-hero { text-align: center; padding: 26px 18px 22px; border-radius: 24px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 0% 0%, #5B3DF5 0%, transparent 55%), radial-gradient(120% 120% at 100% 100%, #0EA5E9 0%, transparent 55%), #1b1440;
  box-shadow: var(--sh-3); }
.home-hero h1 { margin: 6px 0 4px; font-size: 2.4rem; color: #fff; }
.home-hero h1 .bx { color: #A78BFA; font-style: italic; }
.home-hero p { margin: 0 auto; max-width: 440px; color: rgba(255, 255, 255, .85); line-height: 1.5; }
.hh-logo { display: inline-flex; align-items: center; gap: 12px; }
.hh-logo .logo { width: 46px; height: 46px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-radius: 12px; background: #111; }
.hh-logo .logo i { border-radius: 4px; }
.hh-knight { width: 50px; height: 50px; background: url(vendor/pieces/wN.svg) center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); animation: hhHop 2.2s ease-in-out infinite; }
@keyframes hhHop { 50% { transform: translateY(-6px) rotate(6deg); } }
.hh-go { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.hh-btn { padding: 12px 20px; border-radius: 14px; font-weight: 800; text-decoration: none; color: #1b1440; background: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); transition: transform .15s; }
.hh-btn:hover { transform: translateY(-2px); }
.hh-btn.chess { background: linear-gradient(135deg, #67E8F9, #A78BFA); color: #0b1020; }

/* 📬 Hộp thư (inbox.js) */
/* nút 📬 trên thanh trên cùng (dùng chung kiểu .tk-top của nút Khiếu nại – ticket.css) + số thư mới màu đỏ */
.ib-top.has-new { border-color: var(--accent, #5b3df5); }
.ib-top.has-new .tk-ico { animation: hmWiggle 2.4s ease-in-out infinite; }
@keyframes hmWiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-14deg); } 84% { transform: rotate(12deg); } 92% { transform: rotate(-6deg); } }
.ib-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface, #fff); pointer-events: none; }
.ib-n[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ib-top.has-new .tk-ico { animation: none; } }
.ib-modal { width: min(560px, calc(100% - 24px)); }
.ib-list { display: flex; flex-direction: column; gap: 10px; max-height: min(62vh, 520px); overflow-y: auto; padding: 2px 2px 2px 7px; }
.ib-item { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border, rgba(127, 127, 127, .2)); }
.ib-item.new { background: var(--accent-soft, rgba(91, 61, 245, .1)); border-color: var(--accent, #5b3df5); }
.ib-item.new::before { content: ''; position: absolute; top: 14px; left: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #5b3df5); box-shadow: 0 0 0 2px var(--surface, #fff); }
.ib-ico { font-size: 1.6rem; line-height: 1.1; }
.ib-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ib-txt b { font-size: 1rem; line-height: 1.3; }
.ib-txt p { margin: 0; color: var(--text, inherit); opacity: .85; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; } /* pre-line: thư chủ web gửi giữ xuống dòng */
.ib-txt small { color: var(--muted); font-size: .78rem; }
.ib-go { align-self: flex-start; margin-top: 4px; min-height: 36px; padding: 0 14px; font-size: .88rem; }
.ib-del { border: 0; background: transparent; min-height: 32px; min-width: 32px; padding: 0; font-size: 1rem; opacity: .55; cursor: pointer; }
.ib-del:hover { opacity: 1; }
.ib-empty { margin: 12px 0; text-align: center; color: var(--muted); }
.ib-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.ib-foot .ib-all[hidden] { display: none; }

.home-sec { display: flex; flex-direction: column; gap: 8px; }
.home-sec h2 { display: flex; align-items: center; gap: 8px; margin: 4px 2px 2px; font-size: 1.25rem; }
.home-sec h2 small { font-size: .82rem; font-weight: 700; color: var(--gold-text); }
.hs-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); }
.home-sec.rubik .hs-ico { background: var(--accent-soft); } .home-sec.chess .hs-ico { background: #dff6fb; } .home-sec.vip .hs-ico { background: var(--gold-soft); }
[data-theme="dark"] .home-sec.chess .hs-ico { background: #0b3444; }
.home-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font: inherit; min-height: 0; cursor: pointer;
  box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s, border-color .15s; }
.home-row:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--border-strong); }
.hr-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.4rem; border-radius: 12px; background: var(--surface-2); }
.hr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hr-t b { font-size: 1rem; }
.hr-t small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.hr-tag { flex: none; font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.hr-tag.free { background: var(--success-soft); color: var(--success); }
.hr-tag.vip { background: var(--gold-soft); color: var(--gold-text); border: 1px solid var(--gold-line); }
.hr-go { flex: none; font-size: 1.4rem; color: var(--muted); font-weight: 700; }
.home-sec.chess .home-row:hover { border-color: #22D3EE; }
.home-sec.rubik .home-row:hover { border-color: var(--accent); }

.home-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hp-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 16px; text-align: center; text-decoration: none; color: var(--text);
  background: var(--surface); border: 2px solid var(--border); transition: transform .15s, border-color .15s; }
.hp-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.hp-card span { font-size: 1.6rem; } .hp-card b { font-size: .95rem; } .hp-card em { font-style: normal; font-weight: 900; color: var(--accent); }
.hp-card small { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.hp-card.combo { border-color: var(--gold-line); background: var(--gold-soft); }
@media (max-width: 480px) { .home-hero h1 { font-size: 2rem; } .hr-tag { display: none; } .home-plans { gap: 6px; } }

/* Trang VIP: tiêu đề 2 phần */
.vip-sec-title { display: flex; align-items: center; gap: 10px; margin: 18px 4px 0; font-size: 1.35rem; }
.vip-sec-title span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); }
.vip-sec-title.chess span { background: #dff6fb; }
[data-theme="dark"] .vip-sec-title.chess span { background: #0b3444; }

/* Khu Cờ vua VIP */
.chess-vip { display: flex; flex-direction: column; gap: 14px; background: linear-gradient(160deg, var(--surface) 60%, rgba(34, 211, 238, .08)); }
.cv-head { display: flex; align-items: center; gap: 14px; }
.cv-head h3 { margin: 0; font-size: 1.3rem; }
.cv-knight { width: 56px; height: 56px; flex: none; border-radius: 16px; background: url(vendor/pieces/wN.svg) center / 78% no-repeat, linear-gradient(135deg, #0EA5E9, #7C3AED); box-shadow: 0 8px 18px rgba(14, 165, 233, .35); }
.cv-price { color: var(--muted); } .cv-price b { font-size: 1.4rem; color: var(--text); }
.cv-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cv-feats li { display: flex; gap: 10px; align-items: flex-start; }
.cv-feats li > span { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); }
.cv-feats b { display: block; } .cv-feats small { color: var(--muted); }
.cv-compare { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cv-compare th, .cv-compare td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.cv-compare td:first-child, .cv-compare th:first-child { text-align: left; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cv-actions .gold { flex: 1 1 220px; }

/* Mục có danh sách chi tiết (Luyện tập Rubik / Luyện giải đố Cờ vua) */
.home-row.home-detail { flex-direction: column; align-items: stretch; gap: 10px; }
.hd-top { display: flex; align-items: center; gap: 12px; }
.hd-list { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 7px; border-radius: 12px; background: var(--surface-2); }
.hd-list li { display: flex; align-items: flex-start; gap: 9px; font-size: .88rem; line-height: 1.4; color: var(--text-2); }
.hd-list li i { flex: none; width: 22px; text-align: center; font-style: normal; }
.hd-list li b { color: var(--text); }
.home-sec.chess .hd-list { background: rgba(34, 211, 238, .08); }
.home-sec.rubik .hd-list { background: var(--accent-soft); }
.lock-list { text-align: left; margin: 4px auto 6px; max-width: 520px; }
.ch-lock .lock-list { background: var(--surface); margin: 0; }

/* ===== Trang VIP tách 3 kiểu: tổng (#vip) · Rubik VIP (#vip-rubik) · Cờ vua VIP (#vip-chess) ===== */
body[data-vipmode="all"] #view-vip .vip-sec-title,
body[data-vipmode="all"] #vipLibrary,
body[data-vipmode="all"] #view-vip .vip-hero,
body[data-vipmode="all"] #view-vip .vip-compare,
body[data-vipmode="all"] #view-vip .chess-vip,
body[data-vipmode="rubik"] #vipChoose,
body[data-vipmode="rubik"] #view-vip .vip-sec-title.chess,
body[data-vipmode="rubik"] #view-vip .chess-vip,
body[data-vipmode="chess"] #vipChoose,
body[data-vipmode="chess"] #view-vip .vip-sec-title.rubik,
body[data-vipmode="chess"] #vipLibrary,
body[data-vipmode="chess"] #view-vip .vip-hero,
body[data-vipmode="chess"] #view-vip .vip-compare { display: none !important; }
/* trang Rubik VIP / Cờ vua VIP: tiêu đề phần lên đầu */
body[data-vipmode="rubik"] #view-vip .vip-sec-title.rubik, body[data-vipmode="chess"] #view-vip .vip-sec-title.chess { margin-top: 4px; }

.vip-choose { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .vip-choose { grid-template-columns: 1fr; } }
.vc-pick { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 20px; text-decoration: none; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--sh-2); transition: transform .15s, box-shadow .15s; }
.vc-pick:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.vc-pick.rubik { background: linear-gradient(140deg, #5B3DF5, #2E1A9E); }
.vc-pick.chess { background: linear-gradient(140deg, #0EA5E9, #4C1D95); }
.vc-pick .vp-ico { font-size: 2rem; }
.vc-pick b { font-size: 1.3rem; }
.vc-pick small { color: rgba(255, 255, 255, .85); line-height: 1.45; }
.vc-pick em { font-style: normal; font-weight: 900; font-size: 1.15rem; color: #FDE68A; }
.vc-pick .vp-go { align-self: flex-start; margin-top: 4px; padding: 7px 14px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-weight: 800; font-size: .9rem; }
.plan-pick.two { grid-template-columns: 1fr 1fr; }
.subnav .sub-vip { color: var(--gold-text); }
.subnav .sub-vip.active { background: var(--gold-soft); color: var(--gold-text); }
.subnav.chess a.active:not(.sub-vip) { background: #dff6fb; color: #0e5a6e; }
[data-theme="dark"] .subnav.chess a.active:not(.sub-vip) { background: #0b3444; color: #a5f3fc; }

/* Thanh chọn trong mục VIP + phần Đăng ký ở dưới cùng */
.vip-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.vip-tabs a { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px 6px; border-radius: 12px; text-decoration: none;
  color: var(--muted); font-weight: 800; font-size: .92rem; text-align: center; }
.vip-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.vip-sec-title.pay span { background: var(--gold-soft); }
@media (max-width: 480px) { .vip-tabs a { font-size: .8rem; padding: 9px 4px; } }
body[data-vipmode] #view-vip .vip-sec-title.pay { display: flex !important; } /* tiêu đề Đăng ký luôn hiện */

/* Nhấn mạnh gói Cờ vua giá rẻ */
.cv-head { position: relative; }
.cheap-tag { margin-left: auto; align-self: flex-start; padding: 5px 11px; border-radius: 99px; font-weight: 900; font-size: .82rem; color: #fff;
  background: linear-gradient(135deg, #22C55E, #0EA5E9); box-shadow: 0 6px 14px rgba(34, 197, 94, .35); animation: cheapBob 2.2s ease-in-out infinite; }
@keyframes cheapBob { 50% { transform: translateY(-3px) rotate(-3deg); } }
.cheap-box { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--success-soft); border: 1px dashed var(--success); }
.cheap-box b { color: var(--success); }
.cheap-box span { font-size: .9rem; color: var(--text-2); line-height: 1.45; }
.cheap-box span b { color: var(--text); }
.cheap-note { margin: 0; font-size: .8rem; color: var(--success); text-align: center; line-height: 1.4; font-weight: 600; }
.vip-status .vip-off { display: block; margin-top: 6px; font-size: .85rem; color: var(--danger); }

/* ===== Chọn ngôn ngữ (i18n.js) ===== */
.lang-gate { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px; background: rgba(10, 8, 30, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: lgIn .25s ease; }
.lang-gate.out { opacity: 0; transition: opacity .25s; }
@keyframes lgIn { from { opacity: 0; } }
.lg-box { width: min(420px, 100%); padding: 26px 22px 22px; border-radius: 24px; text-align: center; background: var(--surface); color: var(--text); box-shadow: var(--sh-3); animation: lgPop .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes lgPop { from { transform: scale(.9); opacity: 0; } }
.lg-logo .logo { width: 52px; height: 52px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; border-radius: 14px; background: #111; }
.lg-logo .logo i { border-radius: 4px; }
.lg-box h2 { margin: 12px 0 18px; font-size: 1.45rem; line-height: 1.25; }
.lg-box h2 small { font-size: 1.05rem; color: var(--muted); font-weight: 700; }
.lg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lg-btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; padding: 16px 8px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface-2); }
.lg-btns button:hover { border-color: var(--accent); background: var(--accent-soft); }
.lg-btns span { font-size: 2.2rem; line-height: 1.1; } .lg-btns b { font-size: 1.05rem; } .lg-btns small { color: var(--muted); font-size: .8rem; }
.lang-btn { width: auto !important; padding: 0 10px !important; font-weight: 800; font-size: .85rem; border: 1px solid var(--border); }

/* ===== 🌏 Vì sao có 2 ngôn ngữ (nút cạnh số điện thoại + hộp thoại) ===== */
.cb-why { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .28); gap: 5px; cursor: pointer; font-weight: 700; }
.cb-why span[aria-hidden] { font-size: 15px; line-height: 1; }
.why-modal { max-width: min(640px, calc(100vw - 24px)); }
.why-modal .hw-body { max-height: min(65vh, 560px); overflow-y: auto; padding-right: 4px; }
.why-modal .hw-body p { margin: 0 0 10px; line-height: 1.65; }
.why-modal h3 { font-size: 1.05rem; }
.hw-en { display: none !important; }
body.lang-en .hw-en { display: revert !important; } body.lang-en span.hw-en { display: inline !important; }
body.lang-en .hw-vi { display: none !important; }
@media (max-width: 560px) { .cb-why .cbw-t, body.lang-en .cb-why .cbw-t { display: none !important; } .cb-why { padding: 0 9px; } }
.contact-bar .cb-who, .contact-bar .cb-text { min-width: 0; flex-shrink: 1; }
.contact-bar .cb-text b, .contact-bar .cb-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }