/* Giao diện người chơi. Điện thoại và máy tính bảng dọc (dưới 1024px): một cột, thanh mục ở đáy, biểu đồ dính, đặt lệnh dạng tấm trượt. Máy tính (từ 1024px): màn Thị trường là lưới toàn màn hình. */
/* Bộ màu theo quy tắc giao diện của game. Từ 14/10: bộ màu theo tinh thần ảnh Prism (chỉ học bảng màu, không chép mã, bố cục):
   Tối (mặc định): xanh đêm sâu, nhấn ngọc lam sáng, màu phụ hồng cho đường tham chiếu; nhóm tài sản có màu riêng rõ (ngọc lam, tím, xanh chanh).
   Sáng: trắng xanh nhạt, nhấn ngọc lam đậm (đủ tương phản cho chữ). Trước đó (17h21) là xanh đêm, nhấn ngọc lam dịu (#4fb3a9).
   theme.js đặt html[data-theme] = light, dark hoặc auto (Theo máy). Trang quản trị không có data-theme nên vẫn theo máy (style.css). */
:root { --navh:58px; }
:root[data-theme] { color-scheme:light; --bg:#f4f7fb; --card:#ffffff; --soft:#eef2f7; --line:#dde5ee; --ink:#0f1722; --muted:#5b6879; --pick:#0e7c72; --pick2:#db2777; --onpick:#ffffff; --onm:#06201d;
  --up:#0f8a5f; --down:#d4374f; --buy:#0f8a5f; --sell:#d4374f; --ceil:#8e3bd1; --floor:#0a7f99; --refc:#8a6a00;
  --m-cash:#94a3b8; --m-hold:#cbd5e1; --m-vn:#14b8a6; --m-us:#8b5cf6; --m-gfx:#a3b51b; --m-rights:#e8a33d; --glass:rgba(255,255,255,.86); --shadow:0 1px 2px rgba(15,25,40,.05), 0 10px 28px -18px rgba(15,25,40,.25); }
:root[data-theme="dark"] { color-scheme:dark; --bg:#0a0f17; --card:#101824; --soft:#16212f; --line:#1f2c3d; --ink:#e8eef6; --muted:#8193a8; --pick:#2dd4c4; --pick2:#f472b6; --onpick:#04211e; --onm:#0a0f17;
  --up:#34d399; --down:#fb7185; --buy:#16a36f; --sell:#e0485e; --ceil:#c084fc; --floor:#38bdf8; --refc:#facc15;
  --m-cash:#5f6f85; --m-hold:#2c3a4e; --m-vn:#2dd4c4; --m-us:#a78bfa; --m-gfx:#cde45a; --m-rights:#f5b84f; --glass:rgba(16,24,36,.86); --shadow:0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -18px rgba(0,0,0,.75); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { color-scheme:dark; --bg:#0a0f17; --card:#101824; --soft:#16212f; --line:#1f2c3d; --ink:#e8eef6; --muted:#8193a8; --pick:#2dd4c4; --pick2:#f472b6; --onpick:#04211e; --onm:#0a0f17;
  --up:#34d399; --down:#fb7185; --buy:#16a36f; --sell:#e0485e; --ceil:#c084fc; --floor:#38bdf8; --refc:#facc15;
  --m-cash:#5f6f85; --m-hold:#2c3a4e; --m-vn:#2dd4c4; --m-us:#a78bfa; --m-gfx:#cde45a; --m-rights:#f5b84f; --glass:rgba(16,24,36,.86); --shadow:0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -18px rgba(0,0,0,.75); } }
html { -webkit-text-size-adjust:100%; }
body { padding-bottom:calc(var(--navh) + env(safe-area-inset-bottom, 0px)); }
[hidden] { display:none !important; }
h2 { font-size:18px; margin:0 0 6px; }
h3 { font-size:15px; margin:18px 0 6px; }
a { color:var(--pick); }
.small { font-size:13px; }
.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.up { color:var(--up); } .down { color:var(--down); }
.err { color:var(--down); font-weight:600; min-height:1.4em; margin:8px 0 0; }

.top { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 16px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--bg); z-index:5; }
.brand .name { font-weight:700; font-size:18px; }
.brand .season { color:var(--muted); font-size:13px; margin-left:6px; }
.who { display:flex; gap:10px; align-items:center; font-size:14px; }
button { font:inherit; cursor:pointer; }
/* v0.5.4 (16/10): nút Đóng ở Đặt lệnh và các chỗ bấm để quay lại hay sang trang có khung rõ ràng:
   nút dạng chữ (Đóng, Thu gọn, Mở Danh mục, Đặt lệnh Trading, Xem đủ bốn bảng, Có gì mới) thành nút viền bo tròn như nút Menu.
   Không đặt display ở đây để các luật ẩn hiện theo màn (.chart-fold, .sheet-close, .t-open) vẫn thắng. */
button.link { min-height:34px; padding:4px 14px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--pick); font-weight:600; line-height:1.2; white-space:nowrap; }
button.link:hover, button.link:focus-visible { border-color:var(--pick); }
.note { margin:0; padding:8px 16px; background:var(--soft); font-size:13px; }
.toast { z-index:40 !important; position:fixed; left:16px; right:16px; bottom:calc(var(--navh) + 12px + env(safe-area-inset-bottom, 0px)); margin:0 auto; max-width:520px; padding:10px 14px; border-radius:8px; background:var(--ink); color:var(--bg); font-size:14px; z-index:20; box-shadow:0 4px 16px rgba(0,0,0,.2); }
.toast.bad { background:var(--down); color:#fff; }

input, select, textarea { display:block; width:100%; margin-top:4px; padding:10px 12px; font:inherit; font-size:16px; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:8px; }
textarea { resize:vertical; }
label { display:block; margin:10px 0; font-size:14px; }
label small { display:block; color:var(--muted); font-size:12px; margin-top:3px; }
.primary { display:block; width:100%; margin-top:12px; padding:12px; min-height:46px; border:0; border-radius:8px; background:var(--pick); color:var(--onpick); font-weight:600; }
.primary.buy, .primary.sell { color:#fff; }
.primary.buy { background:var(--buy-fill); } .primary.sell { background:var(--sell-fill); }
.primary:disabled { opacity:.55; cursor:default; }

.seg { display:flex; gap:0; border:1px solid var(--line); border-radius:8px; overflow:hidden; margin:8px 0; }
.seg button { flex:1; padding:10px 8px; min-height:44px; border:0; background:transparent; color:var(--ink); }
.seg button + button { border-left:1px solid var(--line); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background:color-mix(in srgb, var(--pick) 14%, var(--card)); color:var(--ink); font-weight:600; box-shadow:inset 0 -2px 0 var(--pick); }
.seg button.buy[aria-pressed="true"], .seg button.sell[aria-pressed="true"] { color:#fff; box-shadow:none; }
.seg button.buy[aria-pressed="true"] { background:var(--buy-fill); }
.seg button.sell[aria-pressed="true"] { background:var(--sell-fill); }

.tabs { position:fixed; left:0; right:0; bottom:0; z-index:10; display:flex; background:var(--bg); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom, 0px); }
.tabs button { flex:1; min-height:var(--navh); border:0; background:none; color:var(--muted); font-size:12px; padding:4px 2px; }
.tabs button[aria-current="page"] { color:var(--pick); font-weight:700; box-shadow:inset 0 3px 0 var(--pick); }

.grid { max-width:1200px; margin:0 auto; padding:12px 16px 24px; }
.panel { display:none; }
body[data-tab="market"] #p-market, body[data-tab="order"] #p-order, body[data-tab="assets"] #p-assets,
body[data-tab="journal"] #p-journal, body[data-tab="rules"] #p-rules, body[data-tab="rank"] #p-rank,
body[data-tab="settings"] #p-settings, body[data-tab="whatsnew"] #p-whatsnew, body[data-tab="notif"] #p-notif, body[data-tab="portfolio"] #p-pf, body[data-tab="ach"] #p-ach,
body[data-tab="portfolio"][data-sub="assets"] #p-assets, body[data-tab="portfolio"][data-sub="orders"] #p-orders { display:block; }

.tw { overflow-x:auto; -webkit-overflow-scrolling:touch; }
table { border-collapse:collapse; width:100%; font-size:14px; }
th, td { border-bottom:1px solid var(--line); padding:8px 6px; text-align:left; vertical-align:middle; }
th { font-weight:600; color:var(--muted); font-size:12px; }
.board tr.sel { background:var(--soft); }
.board tbody tr { cursor:pointer; }
.board .sym { font-weight:700; }
.board .sub { display:block; font-size:12px; color:var(--muted); font-weight:400; }
.board tr.grp td { font-size:12px; color:var(--muted); font-weight:600; padding-top:14px; border-bottom:1px solid var(--line); background:transparent; cursor:default; white-space:normal; }
.board button.trade { padding:6px 10px; min-height:36px; border:1px solid var(--pick); border-radius:6px; background:transparent; color:var(--pick); font-size:13px; }

.chart-head { display:flex; justify-content:space-between; align-items:baseline; gap:10px; flex-wrap:wrap; margin-top:14px; }
.chart-head h3 { margin:0; }
.chart { width:100%; height:260px; border:1px solid var(--line); border-radius:8px; margin-top:6px; position:relative; overflow:hidden; }
.small-chart { height:200px; }
.chart .empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; padding:16px; color:var(--muted); font-size:14px; }

.est { margin:6px 0; padding:8px 10px; border-radius:8px; background:var(--soft); font-size:14px; min-height:1.6em; }
.est:empty { display:none; }

.kpis { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.kpi .k { font-size:12px; color:var(--muted); }
.kpi .v { font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }

.cards { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.cards li { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:14px; }
.cards .line1 { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; font-weight:600; }
.cards .meta { color:var(--muted); font-size:12px; margin-top:2px; overflow-wrap:anywhere; }
.cards .empty { color:var(--muted); background:transparent; border-style:dashed; }
.cards button { margin-top:8px; padding:8px 12px; min-height:40px; border:1px solid var(--down); border-radius:6px; background:transparent; color:var(--down); }
.badge { display:inline-block; white-space:nowrap; flex:0 0 auto; line-height:1.5; font-size:12px; font-weight:600; padding:1px 8px; border-radius:999px; background:var(--soft); color:var(--muted); }
.badge.filled { color:var(--up); } .badge.rejected, .badge.expired { color:var(--down); }
/* v0.5.7: luật chơi thành các thẻ nhỏ có tiêu đề in đậm. */
.rules { list-style:none; padding:0; display:grid; gap:8px; } .rules li { margin:0; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--card); font-size:14px; line-height:1.5; }
.rules .rule-h { display:block; margin-bottom:2px; font-size:14px; }

.foot { max-width:1200px; margin:0 auto; padding:8px 16px 16px; font-size:12px; color:var(--muted); display:flex; flex-wrap:wrap; gap:4px 16px; }

@media (max-width: 420px) { .hide-s { display:none; } }

@media (min-width: 1024px) {
  body { padding-bottom:0; }
  .mobile-only { display:none; }
  .tabs { position:sticky; top:var(--toph, 53px); bottom:auto; border-top:0; border-bottom:1px solid var(--line); justify-content:center; gap:4px; padding:0 16px; }
  .tabs button { flex:0 0 auto; min-height:44px; font-size:14px; padding:0 16px; }
  .tabs button[aria-current="page"] { box-shadow:inset 0 -3px 0 var(--pick); }
  .toast { bottom:20px; }
  .chart { height:340px; }
  .kpis { grid-template-columns:repeat(4, 1fr); }
  #p-pf, #p-assets, #p-orders, #p-journal, #p-rules, #p-rank, #p-settings, #p-whatsnew, #p-notif, #p-ach { max-width:1100px; margin:0 auto; }
  #p-journal, #p-rules, #p-rank, #p-settings, #p-whatsnew, #p-notif, #p-ach { max-width:900px; }
}
/* v0.8.2 (22/10, màn laptop: dòng mục riêng chiếm diện tích): từ 1280px thanh mục nằm giữa thanh đầu (app.js placeNav chuyển phần tử),
   nút cao bằng thanh đầu, vạch chọn nằm trên đường kẻ dưới thanh đầu. Màn đăng nhập (#app ẩn) không hiện thanh mục. */
@media (min-width: 1280px) {
  .top > .tabs { position:relative; top:auto; flex:1 1 0; min-width:0; align-self:stretch; margin:-10px 0; padding:0; border:0; background:none; justify-content:center; gap:2px; }
  .top > .tabs button { min-height:0; padding:0 14px; }
  body:has(#app[hidden]) .top > .tabs { display:none; }
}
@media (min-width: 1280px) and (max-width: 1439px) { .top .brand .sub-brand { display:none; } }

/* Bảng xếp hạng (P5) */
.rank-seg button { padding:10px 4px; font-size:13px; }
table.rank td.pos { width:2.5em; color:var(--muted); }
table.rank tr.me td { font-weight:700; background:color-mix(in srgb, var(--pick) 10%, transparent); }
@media (max-width: 420px) { .tabs button { font-size:12px; padding:4px 0; letter-spacing:-0.01em; } }

/* ---------- Màn đăng nhập (08/10, thiết kế lại) ---------- */
body.is-auth { padding-bottom:0; }
body.is-auth .top, body.is-auth #session-note { display:none !important; }
body.is-auth .foot { position:relative; z-index:1; }
body.is-auth { --glow1:rgba(14,124,114,.18); --glow2:rgba(90,98,184,.16); }
:root[data-theme="dark"] body.is-auth { --glow1:rgba(79,179,169,.14); --glow2:rgba(127,143,214,.14); }
.auth { position:relative; min-height:calc(100svh - 60px); display:grid; gap:20px; align-content:center; padding:32px 16px 28px; isolation:isolate; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] body.is-auth { --glow1:rgba(79,179,169,.14); --glow2:rgba(127,143,214,.14); } }
body.is-auth::before { content:""; position:fixed; inset:-20%; z-index:-1; pointer-events:none;
  background: radial-gradient(40% 35% at 18% 22%, var(--glow1), transparent 70%), radial-gradient(45% 40% at 85% 80%, var(--glow2), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
body.is-auth::after { content:""; position:fixed; inset:0; z-index:-1; opacity:.5; pointer-events:none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%); }
@keyframes drift { from { transform:translate3d(-2%, -1%, 0) scale(1); } to { transform:translate3d(2%, 2%, 0) scale(1.06); } }

.auth-hero { max-width:520px; width:100%; min-width:0; margin:0 auto; }
.auth { overflow-x:clip; }
/* Điện thoại: tên game, rồi khung đăng nhập, rồi tóm tắt luật và dải giá ở dưới. */
@media (max-width: 959px) {
  .auth { gap:0; align-content:start; padding-top:24px; }
  .auth-hero { display:contents; }
  .auth-hero > *, .auth-card { width:100%; max-width:440px; margin-left:auto; margin-right:auto; min-width:0; }
  .hero-kicker { order:1; width:auto; justify-self:center; }
  .hero-name { order:2; text-align:center; }
  .auth .hero-tag { order:3; text-align:center; margin:8px auto 18px; max-width:30ch; }
  .auth-card { order:4; }
  .auth .hero-facts { order:5; margin-top:20px; }
  .hero-ticker { order:6; }
  .tick-note { order:7; }
}
.hero-kicker { display:inline-flex; gap:8px; align-items:center; margin:0 0 10px; padding:4px 12px; border:1px solid var(--line); border-radius:999px; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); background:var(--glass); backdrop-filter:blur(6px); }
.hero-kicker span + span::before { content:"·"; margin-right:8px; }
.hero-kicker::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--up); box-shadow:0 0 0 0 var(--up); animation:pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow:0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 70% { box-shadow:0 0 0 8px transparent; } 100% { box-shadow:0 0 0 0 transparent; } }
.hero-name { margin:0; font-size:clamp(34px, 9vw, 64px); line-height:1.02; letter-spacing:-.03em; font-weight:800;
  background:linear-gradient(120deg, var(--ink) 30%, var(--pick) 100%); -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero-tag { margin:10px 0 16px; font-size:clamp(15px, 3.6vw, 19px); color:var(--muted); max-width:30ch; }
.hero-facts { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.hero-facts li { padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--glass); backdrop-filter:blur(6px); font-size:13px; color:var(--muted); line-height:1.35; }
.hero-facts b { display:block; color:var(--ink); font-size:16px; font-variant-numeric:tabular-nums; }
.hero-ticker { position:relative; margin-top:18px; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--glass); backdrop-filter:blur(6px);
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image:linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.tick-track { display:flex; width:max-content; animation:marquee 40s linear infinite; }
.hero-ticker:hover .tick-track { animation-play-state:paused; }
.tick { display:flex; gap:8px; align-items:baseline; padding:10px 18px; border-right:1px solid var(--line); white-space:nowrap; font-size:14px; font-variant-numeric:tabular-nums; }
.tick b { font-size:13px; letter-spacing:.04em; }
.tick .px { color:var(--ink); }
.tick .wait { color:var(--muted); font-size:12px; }
@keyframes marquee { to { transform:translateX(-50%); } }
.tick-note { margin:6px 2px 0; font-size:12px; color:var(--muted); }
.auth-card { position:relative; max-width:420px; width:100%; margin:0 auto; padding:22px 18px 16px; border:1px solid var(--line); border-radius:18px;
  background:var(--glass); backdrop-filter:blur(14px) saturate(1.2); -webkit-backdrop-filter:blur(14px) saturate(1.2);
  box-shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 20px 50px -20px rgba(0,0,0,.35); animation:cardIn .5s cubic-bezier(.2,.8,.2,1) both; }
.auth-card::before { content:""; position:absolute; left:18px; right:18px; top:-1px; height:2px; border-radius:2px; background:linear-gradient(90deg, transparent, var(--pick), transparent); }
@keyframes cardIn { from { opacity:0; transform:translateY(10px); } }
.auth-title { margin:0; font-size:22px; letter-spacing:-.01em; }
.auth-sub { margin:2px 0 12px; color:var(--muted); font-size:14px; }
/* v0.5.10: bộ đếm chỗ N/M trên màn đăng nhập */
.seats { display:flex; width:fit-content; align-items:center; gap:8px; margin:-4px 0 12px; padding:5px 12px; border:1px solid var(--line); border-radius:16px; background:var(--soft); color:var(--muted); font-size:13px; line-height:1.4; font-variant-numeric:tabular-nums; max-width:100%; }
.seats-dot { width:8px; height:8px; flex:none; border-radius:50%; background:var(--up); }
.seats.full { color:var(--ink); border-color:color-mix(in srgb, var(--down) 45%, var(--line)); }
.seats.full .seats-dot { background:var(--down); }
.seats-full { margin:4px 0 8px; padding:10px 12px; border-radius:10px; background:color-mix(in srgb, var(--down) 10%, transparent); color:var(--ink); font-size:13px; line-height:1.45; }
#register-form input:disabled, #register-form button:disabled { opacity:.55; cursor:not-allowed; }
.auth-card .seg { background:var(--soft); border:0; padding:4px; gap:4px; border-radius:12px; }
.auth-card .seg button { border:0 !important; border-radius:9px; min-height:40px; color:var(--muted); transition:background .2s, color .2s; }
.auth-card .seg button[aria-selected="true"] { background:var(--card); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.15); }
.auth-card form { animation:cardIn .3s ease both; }
.auth-card input { background:var(--card); border-radius:10px; padding:12px 14px; transition:border-color .15s, box-shadow .15s; }
.auth-card input:focus { outline:none; border-color:var(--pick); box-shadow:0 0 0 3px color-mix(in srgb, var(--pick) 25%, transparent); }
.auth-card input.ok { border-color:var(--up); }
.auth-card input.bad { border-color:var(--down); }
.pw { position:relative; display:block; }
.pw input { padding-right:64px; }
.pw-eye { position:absolute; right:6px; top:50%; transform:translateY(-50%); margin-top:2px; border:0; background:transparent; color:var(--pick); font-size:13px; font-weight:600; padding:8px 10px; border-radius:8px; }
.pw-eye:focus-visible { outline:2px solid var(--pick); }
.meter { display:block; height:4px; margin-top:8px; border-radius:4px; background:var(--soft); overflow:hidden; }
.meter span { display:block; height:100%; width:0; background:var(--down); transition:width .25s, background .25s; }
.hint.ok { color:var(--up); } .hint.bad { color:var(--down); }
.caps { color:var(--pick) !important; font-weight:600; }
.auth-card .primary { margin-top:16px; border-radius:12px; min-height:50px; font-size:16px; background:linear-gradient(135deg, var(--pick), color-mix(in srgb, var(--pick) 70%, #000)); box-shadow:0 8px 20px -8px var(--pick); transition:transform .12s, box-shadow .2s, opacity .2s; }
.auth-card .primary:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 12px 26px -10px var(--pick); }
.auth-card .primary:active:not(:disabled) { transform:translateY(0); }
.auth-card .primary.loading { position:relative; color:transparent; }
.auth-card .primary.loading::after { content:""; position:absolute; left:50%; top:50%; width:20px; height:20px; margin:-10px 0 0 -10px; border:2px solid var(--onpick); border-right-color:transparent; border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.center { text-align:center; }
.auth .err:empty { display:none; }
.auth .err { margin:10px 0 0; padding:8px 12px; border-radius:10px; background:color-mix(in srgb, var(--down) 12%, transparent); font-size:14px; }
.shake { animation:shake .35s; }
@keyframes shake { 20%, 60% { transform:translateX(-6px); } 40%, 80% { transform:translateX(6px); } }

@media (min-width: 960px) {
  .auth { grid-template-columns:minmax(0, 1.1fr) minmax(380px, 440px); gap:64px; max-width:1180px; margin:0 auto; padding:48px 40px 40px; align-items:center; }
  .auth-hero { max-width:none; margin:0; }
  .hero-facts { grid-template-columns:repeat(4, minmax(0, 1fr)); }
  
  .auth-card { margin:0; padding:28px 26px 20px; }
}
@media (prefers-reduced-motion: reduce) { body.is-auth::before, .tick-track, .auth-card, .auth-card form, .hero-kicker::before { animation:none !important; } }

/* 13/10 (v0.2): tên phụ, giờ giao dịch theo nhóm, biểu đồ phân tích, có gì mới */
.brand .sub-brand { color:var(--muted); font-size:12px; margin-left:6px; }
@media (max-width: 520px) { .brand .sub-brand { display:none; } }
.hero-sub { margin:4px 0 0; font-size:15px; font-weight:600; color:var(--muted); letter-spacing:.02em; }
.board tr.grp td .ghead { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; color:var(--ink); }
.board tr.grp td .ghours, .board tr.grp td .gnext { display:block; font-weight:400; margin-top:2px; }
.chip-st { line-height:1.5; flex:0 0 auto; display:inline-block; font-size:12px; font-weight:600; padding:1px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.chip-st.open { border-color:var(--buy); color:var(--buy); }
.chip-st.wait { border-color:var(--pick); color:var(--pick); }
.chart-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.chart-tools .seg { margin:6px 0 0; }
.chart-tools .chart-seg button { min-height:38px; padding:6px 10px; font-size:13px; }
.chart-tools .iv-seg { flex:0 0 auto; }
.chart-tools .chart-seg:first-child { flex:1 1 260px; }
.tv-box { height:420px; }
@media (min-width: 1024px) { .tv-box { height:480px; } }
.tv-box .tradingview-widget-container { height:100%; width:100%; }
.tv-box .tradingview-widget-copyright { font-size:12px; padding:4px 8px; }
.chart-warn { margin:6px 0 0; font-weight:600; color:var(--ink); }
#whatsnew .wn { margin:0 0 10px; }
#whatsnew .wn h3 { margin:6px 0 2px; font-size:14px; }
#whatsnew ul { margin:0; padding-left:20px; }
.foot .link { padding:2px 10px; font-size:12px; min-height:26px; }

/* ---------- P12a (v0.3): menu, cài đặt, Từ lần trước bạn vào, bộ thẻ dùng chung, vị thế, lệnh chờ ---------- */
.menu-btn { min-height:40px; padding:6px 14px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--ink); font-weight:600; }
.menu-btn[aria-expanded="true"] { border-color:var(--pick); color:var(--pick); }
.who-name { color:var(--muted); max-width:16ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.backdrop { position:fixed; inset:0; z-index:30; background:rgba(0,0,0,.35); }
.glass { background:var(--glass); backdrop-filter:blur(12px) saturate(1.1); -webkit-backdrop-filter:blur(12px) saturate(1.1); }
.menu { position:fixed; z-index:31; left:0; right:0; bottom:0; padding:12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-top:1px solid var(--line); border-radius:18px 18px 0 0; box-shadow:var(--shadow); display:grid; gap:4px; animation:sheetUp .22s cubic-bezier(.2,.8,.2,1) both; }
.menu button { text-align:left; min-height:48px; padding:10px 14px; border:0; border-radius:10px; background:transparent; color:var(--ink); font-size:16px; }
.menu button:hover, .menu button:focus-visible { background:var(--soft); outline:none; }
.menu .menu-out { color:var(--down); border-top:1px solid var(--line); border-radius:0 0 10px 10px; margin-top:4px; }
.menu-who { margin:0 0 4px; padding:0 14px; font-size:13px; color:var(--muted); }
@keyframes sheetUp { from { transform:translateY(24px); opacity:0; } }
@media (min-width: 1024px) {
  .menu { left:auto; right:16px; top:58px; bottom:auto; width:260px; padding:8px; border:1px solid var(--line); border-radius:14px; animation:popIn .16s ease-out both; }
  .menu button { min-height:40px; font-size:15px; }
  .backdrop { background:transparent; }
}
@keyframes popIn { from { transform:translateY(-6px); opacity:0; } }

.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 16px; box-shadow:var(--shadow); min-width:0; transition:transform .18s ease, border-color .18s ease; }
@media (hover: hover) { .card:hover { transform:translateY(-2px); border-color:color-mix(in srgb, var(--pick) 35%, var(--line)); } }
.card.enter { animation:cardRise .38s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i, 0) * 40ms); }
@keyframes cardRise { from { opacity:0; transform:translateY(8px); } }
.card .k { font-size:12px; color:var(--muted); font-weight:600; letter-spacing:.02em; }
.card .k.mt { margin-top:12px; }
.card .v { font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.card .s { font-size:12px; color:var(--muted); margin-top:2px; }
.card .s.up { color:var(--up); } .card .s.down { color:var(--down); }
.fade { animation:numFade .3s ease both; }
@keyframes numFade { from { opacity:.25; } }

/* v0.5.7: chuông thông báo, thẻ thông báo nổi ở góc, mục Thông báo (notify.js). Thay thẻ "Từ lần trước bạn vào". */
.bell { position:relative; display:inline-grid; place-items:center; width:40px; height:40px; min-height:0; padding:0; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--ink); }
.bell:hover, .bell:focus-visible { border-color:var(--pick); color:var(--pick); }
.bell[aria-pressed="true"] { border-color:var(--pick); color:var(--pick); background:color-mix(in srgb, var(--pick) 14%, var(--card)); } /* v0.5.8: đang mở, bấm lần nữa để đóng */
.bell-n { position:absolute; top:-4px; right:-4px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:var(--down); color:#fff; font-size:12px; font-weight:700; line-height:18px; text-align:center; }
.bell-n[hidden] { display:none; }
.ntoast { position:fixed; z-index:41; right:16px; bottom:calc(var(--navh) + 12px + env(safe-area-inset-bottom, 0px)); width:min(360px, calc(100vw - 32px)); padding:12px 14px 14px;
  border:1px solid var(--line); border-radius:12px; background:var(--glass); box-shadow:var(--shadow); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); overflow:hidden; animation:ntIn .28s cubic-bezier(.2,.8,.2,1) both; }
.ntoast[hidden] { display:none; }
@keyframes ntIn { from { opacity:0; } } /* v0.26.1: chỉ hiện dần, không trượt, để nút x đứng yên ngay khi thẻ hiện */
.ntoast-h { display:flex; align-items:center; gap:8px; }
.ntoast-k { font-size:12px; font-weight:600; color:var(--pick); }
.ntoast-x { margin-left:auto; width:32px; height:32px; min-height:0; padding:0; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--ink); font-size:18px; line-height:1; }
.ntoast-t { display:block; margin-top:4px; font-size:15px; }
.ntoast-b { margin:4px 0 0; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.ntoast-f { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:8px; }
.ntoast-bar { position:absolute; left:0; bottom:0; height:3px; width:100%; background:var(--pick); transform-origin:left; animation:ntBar 35s linear forwards; }
.ntoast.hold .ntoast-bar { animation-play-state:paused; }
@keyframes ntBar { to { transform:scaleX(0); } }
/* Máy tính: góc trái dưới (góc phải là nút Gửi lệnh của khung đặt lệnh). Điện thoại: ngay dưới thanh đầu trang, không đè thanh mục
   ở đáy và thông báo ngắn. */
@media (max-width: 1023px) { .ntoast { top:calc(var(--toph, 53px) + 8px); bottom:auto; left:12px; right:12px; width:auto; max-width:420px; margin-left:auto; } }
@media (min-width: 1024px) { .ntoast { bottom:16px; right:auto; left:16px; } }
@media (prefers-reduced-motion: reduce) { .ntoast { animation:none; } .ntoast-bar { animation:none; } }
.notif-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.notif-top h2 { margin:0; }
.card.notif { display:grid; gap:4px; }
.card.notif p { margin:0; }
.card.notif button.link { justify-self:start; margin-top:4px; min-height:32px; padding:4px 14px; border-color:var(--line); border-radius:999px; color:var(--pick); } /* thắng .cards button (viền đỏ của nút xóa) */
.card.notif.new { border-color:color-mix(in srgb, var(--pick) 55%, var(--line)); }
.notif-h { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.notif-h b { min-width:0; }
.card.notif.new .notif-h b::before { content:""; display:inline-block; width:8px; height:8px; margin-right:6px; border-radius:50%; background:var(--pick); vertical-align:middle; }
.notif-when { margin-left:auto; white-space:nowrap; }
/* v0.5.7: nút Luật chơi cạnh chuông (máy tính có chữ), nút "i" thông tin phiên bản cạnh tên mùa, hộp thông tin nhỏ. */
.rules-btn .rb-t { display:none; }
@media (min-width: 1024px) { .rules-btn { width:auto; padding:0 14px 0 12px; display:inline-flex; gap:6px; font-weight:600; } .rules-btn .rb-t { display:inline; } }
.info-btn { display:inline-flex; align-items:center; gap:6px; min-height:0; padding:2px 4px; border:0; background:none; color:var(--muted); font-size:13px; cursor:pointer; }
.info-btn .season { margin:0; }
.info-btn .i-ico { display:inline-grid; place-items:center; width:20px; height:20px; border:1px solid var(--line); border-radius:50%; font:italic 700 12px/1 Georgia, "Times New Roman", serif; color:var(--pick); background:var(--card); }
.info-btn:hover .i-ico, .info-btn:focus-visible .i-ico, .info-btn[aria-expanded="true"] .i-ico { border-color:var(--pick); }
@media (max-width: 420px) { .info-btn .season { display:none; } }
.info-pop { position:fixed; z-index:35; top:calc(var(--toph, 53px) + 6px); left:12px; width:min(340px, calc(100vw - 24px)); padding:12px 14px; border:1px solid var(--line); border-radius:12px;
  background:var(--card); box-shadow:var(--shadow); }
.info-pop[hidden] { display:none; }
.info-pop .info-h { display:block; font-size:16px; }
.info-pop p { margin:2px 0 0; }
.info-pop .info-k { margin-top:10px; font-weight:600; color:var(--ink); }
.info-list { margin:4px 0 0; padding-left:18px; font-size:13px; line-height:1.5; }
.info-f { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
/* v0.5.7: Phóng to và nút khung thời gian TradingView chỉ cho điện thoại, máy tính tablet ngang dùng thanh công cụ của widget. */
.tv-full[hidden], .tv-iv[hidden] { display:none !important; }
@media (min-width: 1024px) { .tv-full, .tv-iv { display:none !important; } }
.tvfull { position:fixed; inset:0; z-index:60; display:flex; flex-direction:column; background:var(--bg);
  padding:env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.tvfull[hidden] { display:none; }
.tvfull-h { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; border-bottom:1px solid var(--line); }
.tvfull-h b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tvfull-box { flex:1 1 auto; min-height:0; }
.tvfull-box .tradingview-widget-container { height:100%; width:100%; }
.tvfull-box .tradingview-widget-copyright { font-size:12px; padding:4px 8px; }
body.tvfull-open { overflow:hidden; }
/* v0.5.7: thẻ vị thế: bảng nhỏ giá mua, giá hiện tại, vốn, lãi lỗ, ước nhận khi bán hết. */
.pos-dl { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.1fr); gap:4px 12px; margin:8px 0 6px; font-size:13px; line-height:1.4; }
.pos-dl dt { color:var(--muted); }
.pos-dl dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.pos-dl dd.num { white-space:normal; } /* v0.11: giá vốn cổ phiếu Mỹ "183,44 USD (4.700.000 đ)" tràn thẻ ở 320px */

.pf-head h2 { margin-bottom:4px; }
.pf-seg { max-width:420px; }
.dash { display:grid; gap:10px; grid-template-columns:minmax(0, 1fr); }
.big-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.big-num { display:flex; align-items:baseline; gap:6px; margin:4px 0 0; flex-wrap:wrap; }
.big-num .n { font-size:clamp(28px, 7vw, 40px); font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.1; }
.big-num .unit { font-size:13px; color:var(--muted); }
.chip { display:inline-block; white-space:nowrap; flex:0 0 auto; line-height:1.5; padding:2px 10px; border-radius:999px; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; background:var(--soft); color:var(--muted); }
.chip.up { background:color-mix(in srgb, var(--up) 16%, transparent); color:var(--up); }
.chip.down { background:color-mix(in srgb, var(--down) 16%, transparent); color:var(--down); }
.bar { height:8px; border-radius:8px; background:var(--soft); overflow:hidden; margin-top:6px; }
.bar > span { display:block; height:100%; background:var(--pick); transform-origin:left; transition:transform .5s cubic-bezier(.2,.8,.2,1); }
.bar.up > span { background:var(--up); } .bar.warn > span { background:var(--down); } .bar.w { height:5px; } .bar.w > span { background:color-mix(in srgb, var(--pick) 70%, var(--soft)); }
.card.enter .bar > span { animation:grow .6s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i, 0) * 40ms + 120ms); }
@keyframes grow { from { transform:scaleX(0); } }
.stats { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.stat .v { font-size:18px; }
.spark { display:block; width:100%; height:32px; margin-top:6px; }
.spark polyline { stroke:var(--pick); }
.spark.up polyline { stroke:var(--up); } .spark.down polyline { stroke:var(--down); }
.empty-spark { font-size:12px; color:var(--muted); height:auto; margin-top:6px; }
.mix { display:flex; gap:2px; height:14px; border-radius:8px; overflow:hidden; margin:8px 0 10px; background:var(--soft); }
.mix > span { flex-basis:0; min-width:3px; transition:flex-grow .5s cubic-bezier(.2,.8,.2,1); }
.card.enter .mix > span { animation:grow .6s cubic-bezier(.2,.8,.2,1) both; transform-origin:left; }
.m-cash { background:var(--m-cash); } .m-hold { background:var(--m-hold); } .m-vn { background:var(--m-vn); } .m-us { background:var(--m-us); } .m-gfx { background:var(--m-gfx); } .m-rights { background:var(--m-rights); }
.legend { list-style:none; margin:0; padding:0; display:grid; gap:4px; font-size:13px; }
.legend li { display:grid; grid-template-columns:10px minmax(0, 1fr) auto 52px; gap:8px; align-items:center; }
.legend i { width:10px; height:10px; border-radius:3px; display:block; }
.next-list { list-style:none; margin:6px 0 0; padding:0; display:grid; gap:8px; }
.next-line { display:flex; justify-content:space-between; gap:8px; font-size:14px; font-weight:600; }
.next-line .cd { font-variant-numeric:tabular-nums; color:var(--ink); }
@media (min-width: 720px) {
  .dash { grid-template-columns:minmax(0, 1.4fr) minmax(0, 1fr); }
  .stats { grid-template-columns:repeat(4, minmax(0, 1fr)); grid-column:1 / -1; }
  #c-mix { grid-column:1 / -1; }
}

.pos-list { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
@media (min-width: 720px) { .pos-list { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.pos-list .empty { color:var(--muted); border-style:dashed; box-shadow:none; }
.pos-head { display:grid; grid-template-columns:36px minmax(0, 1fr) auto; gap:10px; align-items:center; }
.ico { width:36px; height:36px; border-radius:10px; display:grid; place-items:center; font-weight:800; font-size:16px; color:var(--onm); background:var(--m-vn); }
.ico-us { background:var(--m-us); } .ico-gfx { background:var(--m-gfx); color:#1a1408; }
.pos-name { display:flex; flex-direction:column; min-width:0; } .pos-name b { font-size:16px; }
.pos-val { display:flex; flex-direction:column; align-items:flex-end; }
.pos .small.muted { margin-top:6px; }
.sell-info { margin-top:6px; color:var(--ink); }
.pos-acts, .ord-acts { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:10px; }
.pos-acts button, .ord-acts button { min-height:40px; padding:8px 16px; border-radius:8px; font-weight:600; border:1px solid var(--line); background:transparent; color:var(--ink); margin:0; }
.pos-acts .btn-sell { background:var(--sell-fill); border-color:var(--sell-fill); color:#fff; }
.pos-acts .btn-buy { background:var(--buy-fill); border-color:var(--buy-fill); color:#fff; }
.ord-acts .btn-cancel { border-color:var(--down); color:var(--down); }
.pos-acts button:disabled, .ord-acts button:disabled { opacity:.45; cursor:default; }
.cards .ord-acts button { margin-top:0; }

.quick { display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; margin:-4px 0 4px; }
.quick button { min-height:38px; border:1px solid var(--line); border-radius:8px; background:var(--soft); color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums; }
.quick button:hover { border-color:var(--pick); }
#o-quick-note:empty { display:none; }
#p-order.flash { animation:flash .9s ease; }
@keyframes flash { 0% { box-shadow:0 0 0 0 color-mix(in srgb, var(--pick) 55%, transparent); } 100% { box-shadow:0 0 0 12px transparent; } }

.board .px-ceil { color:var(--ceil); font-weight:700; } .board .px-floor { color:var(--floor); font-weight:700; } .board .px-ref { color:var(--refc); }

@media (prefers-reduced-motion: reduce) {
  .card, .card.enter, .fade, .menu, .bar > span, .mix > span, #p-order.flash, .card.enter .bar > span, .card.enter .mix > span,
  .card.enter .donut .cover, .card.enter .daily .b, body[data-sheet] #p-order { animation:none !important; transition:none !important; }
  .card:hover { transform:none; }
}

/* ---------- v0.4: màn Thị trường theo hai bố cục, tấm trượt đặt lệnh, dashboard Danh mục, báo cáo tài chính ---------- */
.chart-fold { display:none; margin-left:auto; padding:4px 0; font-size:13px; }
.mk-notes p { margin:6px 0 0; }
.mk-strip { display:none; }
.sheet-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.sheet-head h2 { margin:0; }
.sheet-close { display:none; }
.board th.act, .board td.act { width:1%; }

/* Điện thoại, máy tính bảng dọc: biểu đồ dính dưới thanh đầu trang, danh sách mã cuộn bên dưới. */
@media (max-width: 1023px) {
  .mk-chart { position:sticky; top:var(--toph, 53px); z-index:4; background:var(--bg); margin:-12px -16px 10px; padding:8px 16px 8px; border-bottom:1px solid var(--line); }
  .mk-chart .chart-head { margin-top:0; flex-wrap:nowrap; }
  .mk-chart .chart-head h3 { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
  .mk-chart .chart-head #chart-note { display:none; }
  .chart-fold { display:inline-block; flex:0 0 auto; }
  .mk-chart .chart-tools { flex-wrap:nowrap; }
  .mk-chart .chart-tools .chart-seg:first-child { flex:1 1 auto; }
  .mk-chart .chart-tools .chart-seg button { min-height:34px; padding:4px 8px; font-size:12px; }
  .mk-chart .chart, .mk-chart .tv-box { height:28vh; min-height:170px; margin-top:6px; }
  /* v0.5.3: khung dính gọn lại: bóng mờ ở mép dưới thay vì mã bị cắt ngang, dòng ghi công TradingView thấp hơn,
     dải "chỉ để xem" thành một dòng nhỏ không viền (nút chuyển sang Lịch sử đã có ngay trên biểu đồ). */
  .mk-chart { box-shadow:0 12px 14px -14px rgba(0,0,0,.6); }
  .mk-chart .tv-box { --tvcp:22px; }
  .mk-chart .tv-box .tradingview-widget-copyright { font-size:12px; line-height:22px; padding:0 8px; }
  .mk-chart .co-tvbar { flex-wrap:nowrap; margin:4px 0 0; padding:0 2px; border:0; font-size:12px; }
  .mk-chart .co-tvbar .lg { display:none; }
  .mk-chart .co-tvbar .sh { display:inline; }
  .mk-chart .co-tvbar button { min-height:28px; padding:2px 10px; font-size:12px; }
  /* v0.5.7: nút Phóng to cạnh Thu gọn (chỉ ở chế độ TradingView). */
  .mk-chart .chart-head .tv-full { flex:0 0 auto; margin-left:auto; font-size:13px; }
  .mk-chart .chart-tools .tv-iv button { white-space:nowrap; padding:4px 7px; }
  .mk-chart .chart-head .tv-full:not([hidden]) + .chart-fold { margin-left:6px; }
  /* P14 (v0.19): thêm nút Doanh nghiệp: các nút đầu biểu đồ gọn lại, tên mã luôn còn chỗ. */
  .mk-chart .chart-head h3 { flex:1 1 auto; min-width:3.6em; }
  .mk-chart .chart-head button.link { flex:0 0 auto; padding:4px 10px; font-size:13px; }
  .mk-chart .chart-head { gap:6px; }
  .chart-seg .lg { display:none; }
  .mk-list .board tr { scroll-margin-top:calc(var(--toph, 53px) + 42vh); scroll-margin-bottom:calc(var(--navh) + 12px); }
  body.chart-min .mk-chart .chart-body { display:none; }
  .mk-list h2 { margin-top:2px; }
  body[data-sheet] #p-order { display:block; position:fixed; left:0; right:0; bottom:0; z-index:33; max-height:88dvh; overflow:auto; overscroll-behavior:contain;
    background:var(--card); border-top:1px solid var(--line); border-radius:18px 18px 0 0; box-shadow:0 -12px 40px -12px rgba(0,0,0,.45);
    padding:6px 16px calc(16px + env(safe-area-inset-bottom, 0px)); animation:sheetUp .24s cubic-bezier(.2,.8,.2,1) both; }
  body[data-sheet] #p-order::before { content:""; display:block; width:40px; height:4px; border-radius:4px; background:var(--line); margin:2px auto 8px; }
  body[data-sheet] .sheet-close { display:inline-block; }
  .sheet-head { position:sticky; top:-6px; background:var(--card); z-index:1; padding:4px 0; }
  .sheet-bd { z-index:32; }
  body[data-sheet] { overflow:hidden; }
}
@media (min-width: 600px) and (max-width: 1023px) { .mk-chart .chart, .mk-chart .tv-box { height:36vh; } }
.chart-seg .sh { display:none; }
@media (max-width: 1023px) { .chart-seg .sh { display:inline; } }

/* Máy tính: lưới toàn màn hình kiểu bàn giao dịch; trang không cuộn dài, mỗi khung tự cuộn. */
@media (min-width: 1024px) {
  .sheet-bd { display:none !important; }
  body[data-tab="market"] { height:100vh; height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
  /* v0.4.1: chỉ lưới được co; thanh đầu, dòng nhắc phiên, thẻ Từ lần trước, thanh tab, chân trang giữ đủ cao (trước đây dòng nhắc bị co còn 20px, mất nửa dưới chữ). */
  body[data-tab="market"] > :not(#app), body[data-tab="market"] #app > .tabs { flex-shrink:0; }
  body[data-tab="market"] #app { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
  body[data-tab="market"] .grid { flex:1 1 auto; min-height:0; width:100%; max-width:none; padding:10px 14px; display:grid; gap:10px;
    /* v0.5.5 (16/10, biểu đồ to hơn, bảng giá chốt và nơi đặt lệnh nhỏ lại): bảng giá 25% còn 19%,
       đặt lệnh 320-360px còn 290-320px, dải dưới 27% còn 24%. */
    grid-template-columns:minmax(260px, 19%) minmax(0, 1fr) minmax(290px, 320px); grid-template-rows:minmax(0, 1fr) auto minmax(160px, 28%);
    grid-template-areas:"list chart order" "list notes order" "list strip order"; }
  body[data-tab="market"] #p-market { display:contents; }
  body[data-tab="market"] #p-order { grid-area:order; display:block; overflow:auto; min-height:0; }
  .mk-list, .mk-chart, .mk-strip, body[data-tab="market"] #p-order { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
  .mk-list { grid-area:list; overflow:auto; min-height:0; }
  .mk-list h2 { font-size:16px; }
  .mk-list .board th.hide-s, .mk-list .board td.hide-s, .mk-list .board .act { display:none; }
  .mk-list .board td, .mk-list .board th { padding:7px 4px; }
  .mk-list .board tr.grp td .ghours, .mk-list .board tr.grp td .gnext { font-size:12px; }
  .mk-list .board tbody tr:not(.grp):hover { background:var(--soft); }
  .mk-chart { grid-area:chart; display:flex; flex-direction:column; min-height:0; }
  .mk-chart .chart-head { margin-top:0; }
  .mk-chart .chart-body { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
  /* v0.8.2: tối thiểu 240px làm biểu đồ tràn khỏi khung, trục thời gian đè lên ghi chú khi màn thấp (laptop); nay co tới 150px. */
  .mk-chart .chart, .mk-chart .tv-box { flex:1 1 auto; height:auto; min-height:150px; }
  .mk-notes { grid-area:notes; max-height:6.2em; overflow:auto; padding:0 4px; }
  /* v0.5.5: dải "chỉ để xem" một dòng không viền, như trên điện thoại (nút chuyển sang biểu đồ game vẫn có khung). */
  .mk-chart .co-tvbar { margin:4px 0 0; padding:0 2px; border:0; font-size:12px; }
  .mk-chart .co-tvbar button { min-height:28px; padding:2px 12px; font-size:12px; }
  .mk-notes p { margin:0 0 2px; font-size:12px; }
  .mk-strip { grid-area:strip; display:flex; flex-direction:column; min-height:0; }
  .strip-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
  .strip-seg { margin:0; max-width:360px; flex:1 1 auto; }
  .strip-seg button { min-height:34px; padding:4px 10px; font-size:13px; }
  .strip-body { flex:1 1 auto; min-height:0; overflow:auto; margin-top:6px; }
  .strip-tab { font-size:13px; }
  .strip-tab th { position:sticky; top:0; background:var(--card); z-index:1; }
  /* v0.8.2: dòng gọn hơn (45px còn khoảng 35px) để dải dưới thấy ít nhất hai vị thế trên laptop. */
  .strip-tab td, .strip-tab th { padding:4px 6px; }
  .strip-tab button.mini { min-height:26px; padding:2px 12px; }
  .strip-tab tbody tr { cursor:pointer; } .strip-tab tbody tr:hover, .strip-tab tr.sel { background:var(--soft); }
  .strip-tab .sym { font-weight:700; }
  button.mini { min-height:30px; padding:3px 12px; border-radius:6px; font-weight:600; font-size:12px; border:1px solid var(--line); background:transparent; color:var(--ink); }
  button.mini.btn-sell { background:var(--sell-fill); border-color:var(--sell-fill); color:#fff; } button.mini.btn-buy { background:var(--buy-fill); border-color:var(--buy-fill); color:#fff; }
  button.mini.btn-cancel { border-color:var(--down); color:var(--down); }
  button.mini:disabled { opacity:.45; cursor:default; }
  body[data-tab="market"] .foot { flex:0 0 auto; max-width:none; padding:4px 16px 6px; }
}
@media (min-width: 1024px) and (max-height: 760px) { .mk-notes { max-height:3.6em; } }
@media (min-width: 1024px) and (max-width: 1279px) and (max-height: 760px) { body[data-tab="market"] .grid { grid-template-rows:minmax(0, 1fr) auto minmax(125px, 24%); } }

/* Donut cơ cấu cạnh chú thích. */
.mix-row { display:grid; grid-template-columns:96px minmax(0, 1fr); gap:14px; align-items:center; }
.donut { width:96px; height:96px; display:block; }
.donut circle { fill:none; stroke-width:14; }
.donut .track { stroke:var(--soft); }
.donut .seg-cash { stroke:var(--m-cash); } .donut .seg-hold { stroke:var(--m-hold); } .donut .seg-vn { stroke:var(--m-vn); } .donut .seg-us { stroke:var(--m-us); } .donut .seg-gfx { stroke:var(--m-gfx); } .donut .seg-rights { stroke:var(--m-rights); }
.donut .cover { stroke:var(--card); stroke-width:16; stroke-dasharray:100 100; stroke-dashoffset:100; }
.card.enter .donut .cover { animation:sweep .7s cubic-bezier(.4,0,.2,1) .15s both; }
@keyframes sweep { from { stroke-dashoffset:0; } to { stroke-dashoffset:100; } }
@media (max-width: 559px) { .mix-row { grid-template-columns:minmax(0, 1fr); } .donut { display:none; } }

/* Cột lãi lỗ theo phiên: đường 0 ở giữa, cột lãi mọc lên, cột lỗ mọc xuống; phiên chưa tới gạch chéo mờ. */
.dash2 { margin-top:12px; }
.daily { position:relative; display:flex; gap:4px; height:140px; margin-top:10px; }
.daily::before { content:""; position:absolute; left:0; right:0; top:50%; border-top:1px dashed var(--line); }
.daily .col { position:relative; flex:1 1 0; min-width:0; }
.daily .b { position:absolute; left:12%; right:12%; border-radius:4px; transform-origin:bottom; }
.daily .b.pos { bottom:50%; background:var(--up); } .daily .b.neg { top:50%; background:var(--down); transform-origin:top; }
.daily .b { min-height:2px; }
.daily .fut::before { content:""; position:absolute; left:12%; right:12%; top:24%; bottom:24%; border-radius:4px; opacity:.8;
  background:repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px); border:1px dashed var(--line); }
.daily .tag { position:absolute; left:50%; transform:translateX(-50%); font-size:12px; font-weight:700; white-space:nowrap; padding:1px 6px; border-radius:6px; background:var(--soft); }
.daily .tag.pos { top:calc(50% + 4px); } .daily .tag.neg { bottom:calc(50% + 4px); }
.daily .tag.edge { left:auto; right:0; transform:none; }
.daily .tag.first { left:0; transform:none; }
.daily-lab { display:flex; gap:4px; margin-top:4px; }
.daily-lab span { flex:1 1 0; min-width:0; font-size:12px; color:var(--muted); text-align:center; white-space:nowrap; overflow:visible; }
/* 23/10: nhãn 12px rộng hơn cột hẹp; canh bằng flex để phần thừa tràn đều hai bên, nhãn đầu, cuối không lố khỏi mép thẻ. */
.daily-lab span { display:flex; justify-content:center; } .daily-lab span:first-child { justify-content:flex-start; } .daily-lab span:last-child { justify-content:flex-end; }
.card.enter .daily .b { animation:rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i, 0) * 30ms + 120ms); }
@keyframes rise { from { transform:scaleY(0); } }

/* Xếp hạng thu nhỏ. */
.rank-mini { list-style:none; margin:8px 0 6px; padding:0; display:grid; gap:6px; }
.rank-mini li { display:grid; grid-template-columns:2.2em minmax(0, 1fr) auto; gap:4px 8px; align-items:center; font-size:14px; }
.rank-mini li .bar { grid-column:1 / -1; margin-top:0; height:5px; }
.rank-mini .pos { color:var(--muted); font-variant-numeric:tabular-nums; }
.rank-mini .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rank-mini li.me { font-weight:700; } .rank-mini li.me .nm { color:var(--pick); }
@media (min-width: 720px) { .dash2 { grid-template-columns:minmax(0, 1.4fr) minmax(0, 1fr); } }

/* Báo cáo tài chính: ba thẻ mở rộng. */
/* 14/10 (chỗ trống cạnh thẻ ngắn): xếp kiểu cột báo, thẻ nối tiếp nhau trong từng cột, không để hố trống khi một thẻ dài hơn. */
.fs-list { display:grid; gap:10px; }
@media (min-width: 1024px) { .fs-list { display:block; columns:2 420px; column-gap:10px; } .fs-list > details { display:block; break-inside:avoid; margin:0 0 10px; } }
details.fs { padding:0; }
details.fs > summary { list-style:none; cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px 16px; }
details.fs > summary::-webkit-details-marker { display:none; }
details.fs > summary::after { content:""; flex:0 0 auto; width:8px; height:8px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); margin-left:4px; transition:transform .2s; }
details.fs[open] > summary::after { transform:rotate(-135deg); }
.fs-t { display:flex; flex-direction:column; min-width:0; } .fs-t b { font-size:15px; }
.fs-v { font-size:17px; margin-left:auto; }
.fs-body { padding:4px 16px 14px; }
.fs-body p { margin:4px 0 0; }
.fs-tab { font-size:13px; margin-bottom:8px; }
.fs-tab th { color:var(--muted); font-size:12px; letter-spacing:.04em; text-transform:uppercase; padding-top:12px; }
.fs-tab td { padding:6px 4px; }
.fs-tab tr.tot td { font-weight:700; border-top:2px solid var(--line); }
details.fs[open] > summary { border-bottom:1px solid var(--line); }

/* Logo ở đầu trang và màn đăng nhập. */
.brand { display:flex; align-items:center; gap:4px 8px; flex-wrap:wrap; min-width:0; }
.brand .sub-brand, .brand .season { margin-left:0; }
.hero-mark { margin:0 0 12px; }
.logo-mark.big { width:56px; height:56px; }
@media (max-width: 959px) { .hero-mark { order:1; text-align:center; margin-bottom:10px; } }

/* Đường tài sản trong thẻ Tổng tài sản: lấp phần dưới thẻ khi thẻ cao bằng thẻ Sắp tới. */
#c-big { display:flex; flex-direction:column; }
.hero-chart { flex:1 1 auto; display:flex; flex-direction:column; min-height:120px; margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.hc-head { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.hc-legend { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.hc-legend i { display:inline-block; width:12px; height:3px; border-radius:2px; }
.hc-l1 { background:var(--pick); } .hc-l2 { background:repeating-linear-gradient(90deg, var(--pick2) 0 4px, transparent 4px 7px); margin-left:6px; }
.hc-svg { flex:1 1 auto; width:100%; min-height:90px; margin-top:6px; display:block; }
.hc-area { fill:color-mix(in srgb, var(--pick) 16%, transparent); stroke:none; }
.hc-line { fill:none; stroke:var(--pick); stroke-width:2; vector-effect:non-scaling-stroke; stroke-linejoin:round; }
.hc-base { fill:none; stroke:var(--pick2); stroke-width:1.5; stroke-dasharray:5 4; vector-effect:non-scaling-stroke; opacity:.85; }
.hc-foot { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-top:2px; }
.hc-empty { flex:1 1 auto; display:flex; align-items:center; justify-content:center; text-align:center; min-height:90px; margin-top:6px; border:1px dashed var(--line); border-radius:10px; color:var(--muted); font-size:13px; padding:10px; }
.card.enter .hc-svg { animation:numFade .6s ease both; animation-delay:.15s; }
@media (max-width: 440px) { .who-name { display:none; } .brand .logo-mark { width:24px; height:24px; } .brand .name { font-size:17px; } }
.dash2 { align-items:start; }
/* v0.4.1: màn đăng nhập trên điện thoại: tên phụ nằm dưới tên game (trước đây lên đầu trang, trên cả logo). */
@media (max-width: 959px) { .auth .hero-sub { order:2; text-align:center; } }

/* ---------- v0.5: luồng Trading giả lập. Màu nhấn riêng xanh dương điện, chỉ dùng ở
   gạch chân tab Trading, nhãn GIẢ LẬP, nút chọn đòn bẩy. Bảng màu v0.4 giữ nguyên. ---------- */
:root[data-theme] { --tpick:#2563eb; --tsoft:#e6efff; }
:root[data-theme="dark"] { --tpick:#60a5fa; --tsoft:#15253f; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --tpick:#60a5fa; --tsoft:#15253f; } }
/* 23/10 (kiểm giao diện): nền nút Mua, Bán chữ trắng đạt 4,5:1 (WCAG AA). Trước: Mua nền tối #16a36f 3,23:1, nền sáng #0f8a5f 4,36:1;
   Bán nền tối #e0485e 3,99:1. Nay Mua #0e7d55 5,14:1 ở cả hai nền; Bán nền tối #c8364c 5,14:1, nền sáng giữ #d4374f 4,71:1.
   --buy, --sell giữ nguyên cho chữ, viền, đường lệnh trên biểu đồ (chữ xanh trên nền tối cần màu sáng). */
:root[data-theme] { --buy-fill:#0e7d55; --sell-fill:#d4374f; }
:root[data-theme="dark"] { --buy-fill:#0e7d55; --sell-fill:#c8364c; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --buy-fill:#0e7d55; --sell-fill:#c8364c; } }
body[data-tab="trade"] #p-trade { display:block; }
.tabs button.trade-tab[aria-current="page"] { color:var(--tpick); background:var(--tsoft); box-shadow:inset 0 3px 0 var(--tpick); }
.rank-flow button.trade-tab[aria-selected="true"] { background:var(--tsoft); box-shadow:inset 0 -2px 0 var(--tpick); }
/* Nhãn GIẢ LẬP: luôn một dòng, không cắt, đủ line-height cho dấu chữ hoa tiếng Việt. */
.chip-sim { display:inline-block; white-space:nowrap; flex:0 0 auto; line-height:1.5; font-size:12px; font-weight:700; letter-spacing:.02em; padding:1px 8px;
  border-radius:999px; border:1px solid var(--tpick); color:var(--tpick); background:var(--tsoft); vertical-align:middle; }
.chip-lev { display:inline-block; white-space:nowrap; line-height:1.5; font-size:12px; font-weight:700; padding:1px 8px; border-radius:999px; background:var(--soft); color:var(--ink); }
.tsym { display:inline-flex; align-items:center; gap:6px; min-width:0; max-width:100%; }
.tsym-n { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.nowrap { white-space:nowrap; }
.warn { color:var(--down); }
.tr-top { display:grid; gap:8px; margin-bottom:10px; }
.tr-title h2 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0; }
.tr-title p { margin:4px 0 0; }
.t-acct { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:8px; }
.t-acct .tk { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:8px 10px; min-width:0; }
.t-acct .k { display:block; font-size:12px; color:var(--muted); }
.t-acct .v { display:block; font-size:16px; text-align:left; overflow:hidden; text-overflow:ellipsis; }
/* v0.27 L4: nút Nạp lại vốn ở chỗ ô Mức ký quỹ, cao bằng dòng số (không đổi chiều cao dải tài khoản); vùng bấm nới ra 44px bằng ::after. */
.t-acct .btn-refill { position:relative; display:block; margin:0; padding:0 8px; font:inherit; font-size:14px; font-weight:700; line-height:18px; border:1px solid var(--tpick); border-radius:6px; background:var(--tsoft); color:var(--ink); cursor:pointer; }
.t-acct .btn-refill::after { content:""; position:absolute; inset:-12px -6px; }
.t-acct .btn-refill:hover, .t-acct .btn-refill:focus-visible { outline:2px solid var(--tpick); outline-offset:1px; }
.tr-chart .chart-head { margin-top:4px; flex-wrap:wrap; }
.t-chart-title { display:flex; align-items:center; gap:8px; min-width:0; }
.t-chart-title .tmid { font-size:16px; }
.t-open { margin-left:auto; }
.t-tf { max-width:420px; }
.t-tf button { min-height:34px; padding:4px 8px; font-size:13px; }
/* v0.17: công cụ vẽ cùng hàng với khung thời gian; hẹp thì xuống hàng. Chỉ gạch chân nút đang chọn bằng màu nhấn Trading. */
.t-tools { display:flex; flex-wrap:wrap; gap:0 8px; align-items:center; }
.t-tools .t-tf { flex:1 1 220px; }
.t-draw { flex:1 0 auto; max-width:480px; } /* không co dưới bề rộng chữ: thiếu chỗ thì xuống hàng */
.t-draw button { min-height:34px; padding:4px 6px; font-size:13px; white-space:nowrap; }
.t-draw button[aria-pressed="true"] { background:color-mix(in srgb, var(--tpick) 14%, var(--card)); box-shadow:inset 0 -2px 0 var(--tpick); }
.t-draw button.dr-act { color:var(--muted); }
.t-draw button.dr-act.arm { color:var(--down); font-weight:600; }
.t-draw button:disabled { opacity:.45; }
.dr-hint { position:absolute; left:8px; top:8px; right:72px; z-index:4; padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:color-mix(in srgb, var(--card) 88%, transparent); color:var(--ink); font-size:12px; line-height:1.4; pointer-events:none; }
.tchart.dr-on { cursor:crosshair; }
/* v0.18: thanh nổi khi chọn một hình vẽ (gợi ý, nút Xóa hình); chỉ nút nhận bấm, phần chữ để bấm xuyên xuống biểu đồ. */
.dr-sel { position:absolute; left:8px; top:8px; max-width:calc(100% - 88px); z-index:4; display:flex; align-items:center; gap:4px 8px; padding:4px 4px 4px 10px; border:1px solid var(--line); border-radius:8px; background:color-mix(in srgb, var(--card) 88%, transparent); color:var(--ink); font-size:12px; line-height:1.4; pointer-events:none; }
.dr-sel span { flex:1 1 140px; min-width:0; }
.dr-sel button { pointer-events:auto; min-height:30px; padding:4px 10px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--down); font-size:13px; font-weight:600; white-space:nowrap; }
.dr-sel button:hover, .dr-sel button:focus-visible { border-color:var(--down); }
@media (pointer: coarse) { .dr-sel button { min-height:36px; } }
.tchart.dr-mv { cursor:move; } .tchart.dr-pt { cursor:grab; } .tchart.dr-drag { cursor:grabbing; }
/* Máy tính: nút gọn để khung giờ và công cụ vẽ chung một hàng (laptop 1280x650 không mất chiều cao biểu đồ). */
@media (min-width: 1024px) {
  .t-tools .t-tf { flex:1 1 200px; }
  .t-tools .t-tf button { padding:4px 4px; font-size:12px; }
  .t-draw { flex:0 0 auto; }
  .t-draw button { padding:4px 6px; font-size:12px; }
}
.tchart { height:34vh; min-height:220px; touch-action:pan-y; }
.t-hint { margin:4px 0 0; }
.tr-list h3 { margin-top:14px; }
.tboard td.act { white-space:nowrap; }
.tboard td.act .mini + .mini { margin-left:4px; }
.tr-strip { margin-top:12px; }
.t-strip-seg button { font-size:13px; padding:8px 4px; }
.tr-strip .strip-tab { font-size:13px; }
.tr-strip .strip-tab td, .tr-strip .strip-tab th { padding:6px 5px; }
.tr-strip .strip-tab tr.sel { background:var(--soft); }
.tr-strip .strip-tab td .mini + .mini { margin-left:4px; }
.sltp-form { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; }
.sltp-form label { margin:0; flex:1 1 110px; }
.sltp-form input { padding:6px 8px; }
button.mini { min-height:32px; padding:3px 10px; border-radius:6px; font-weight:600; font-size:12px; border:1px solid var(--line); background:transparent; color:var(--ink); }
button.mini.btn-sell { background:var(--sell-fill); border-color:var(--sell-fill); color:#fff; } button.mini.btn-buy { background:var(--buy-fill); border-color:var(--buy-fill); color:#fff; }
button.mini.btn-cancel { border-color:var(--down); color:var(--down); }
button.mini:disabled { opacity:.45; cursor:default; }
#p-torder { display:none; }
.t-form-sym { margin:6px 0 2px; font-size:16px; }
.t-form-sym .t-form-q { display:block; margin-top:2px; font-size:13px; text-align:left; }
.t-type button { padding:10px 4px; }
.t-lev-label { font-size:14px; margin-top:10px; }
.t-levs { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0; }
.t-levs .lev { min-height:40px; min-width:52px; padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--ink); font-variant-numeric:tabular-nums; }
.t-levs .lev.hi { border-style:dashed; }
.t-levs .lev[aria-pressed="true"] { border:1px solid var(--tpick); color:var(--tpick); background:var(--tsoft); font-weight:700; }
.t-reco { border-left:3px solid var(--tpick); padding:2px 0 2px 10px; margin:8px 0; }
.t-reco p { margin:4px 0; }
.t-sltp { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.t-sltp label { margin:6px 0; }
.t-confirm { position:fixed; inset:0; z-index:60; display:grid; place-items:center; padding:16px; background:rgba(0,0,0,.5); }
.t-confirm-box { max-width:420px; width:100%; padding:16px; }
.t-confirm-box h2 { margin:0 0 8px; }
.t-confirm-acts { display:flex; gap:8px; justify-content:flex-end; }
.t-confirm-acts .primary { width:auto; margin:0; padding:10px 16px; }
.t-confirm-acts .btn-ghost { min-height:44px; padding:8px 14px; border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--ink); }
/* Hộp đặt lệnh khi bấm vào biểu đồ (chartorder.js), dùng chung hai luồng. */
.chart .co-pop { position:absolute; z-index:6; display:grid; gap:2px; padding:6px; min-width:180px; border:1px solid var(--line); border-radius:10px; background:var(--glass); box-shadow:var(--shadow); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.co-pop button { text-align:left; padding:8px 10px; min-height:40px; border:0; border-radius:6px; background:transparent; color:var(--ink); font-size:14px; white-space:nowrap; }
.co-pop button:hover, .co-pop button:focus-visible { background:var(--soft); }
/* v0.5.4: dòng mô tả trong hộp xác nhận kéo đường (giá cũ, giá mới, lãi lỗ ước tính): chữ thường, xuống dòng được. */
.co-pop .co-note:disabled { color:var(--ink); opacity:1; font-style:normal; font-size:13px; white-space:normal; max-width:260px; background:transparent; cursor:default; }
.co-pop .co-buy { color:var(--up); font-weight:600; } .co-pop .co-sell { color:var(--down); font-weight:600; } .co-pop .co-x { color:var(--muted); }
.chart.co-dragging { cursor:ns-resize; }
/* v0.5.3: nút + cạnh trục giá, chạy theo thước ngắm; bấm mới mở hộp lệnh. Điện thoại to hơn cho dễ chạm. */
.chart .co-plus { position:absolute; z-index:5; width:24px; height:24px; min-height:0; padding:0; display:grid; place-items:center; border:1px solid var(--line); border-radius:6px;
  background:var(--card); color:var(--ink); font-size:17px; font-weight:600; line-height:1; box-shadow:var(--shadow); cursor:pointer; touch-action:manipulation; }
.chart .co-plus:hover, .chart .co-plus:focus-visible { border-color:var(--tpick, var(--pick)); color:var(--tpick, var(--pick)); }
.chart .co-plus[hidden] { display:none; }
@media (pointer: coarse) { .chart .co-plus { width:32px; height:32px; font-size:20px; border-radius:8px; } }

@media (max-width: 1023px) {
  body[data-tsheet] #p-torder { display:block; position:fixed; left:0; right:0; bottom:0; z-index:33; max-height:88dvh; overflow:auto; overscroll-behavior:contain;
    background:var(--card); border-top:1px solid var(--line); border-radius:18px 18px 0 0; box-shadow:0 -12px 40px -12px rgba(0,0,0,.45);
    padding:6px 16px calc(16px + env(safe-area-inset-bottom, 0px)); animation:sheetUp .24s cubic-bezier(.2,.8,.2,1) both; }
  body[data-tsheet] #p-torder::before { content:""; display:block; width:40px; height:4px; border-radius:4px; background:var(--line); margin:2px auto 8px; }
  body[data-tsheet] #p-torder .sheet-close { display:inline-block; }
  body[data-tsheet] { overflow:hidden; }
  .tr-strip .strip-tab.wide { min-width:560px; }
}
@media (min-width: 600px) and (max-width: 1023px) { .tchart { height:40vh; } }
@media (max-width: 420px) { .t-acct { grid-template-columns:1fr 1fr; } .t-acct .tk:first-child { grid-column:1 / -1; } }
@media (min-width: 1024px) {
  .t-open { display:none; }
  body[data-tab="trade"] { height:100vh; height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
  body[data-tab="trade"] > :not(#app), body[data-tab="trade"] #app > .tabs { flex-shrink:0; }
  body[data-tab="trade"] #app { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
  body[data-tab="trade"] .grid { flex:1 1 auto; min-height:0; width:100%; max-width:none; padding:10px 14px; display:grid; gap:10px;
    grid-template-columns:minmax(290px, 24%) minmax(0, 1fr) minmax(320px, 360px); grid-template-rows:auto minmax(0, 1fr) minmax(150px, 30%);
    grid-template-areas:"top top top" "list chart order" "list strip order"; }
  body[data-tab="trade"] #p-trade { display:contents; }
  .tr-top { grid-area:top; grid-template-columns:minmax(0, 1fr) minmax(0, 1.6fr); align-items:center; margin:0; }
  .tr-list, .tr-chart, .tr-strip, body[data-tab="trade"] #p-torder { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
  .tr-list { grid-area:list; overflow:auto; min-height:0; }
  .tr-list h3 { margin-top:0; }
  .tr-chart { grid-area:chart; display:flex; flex-direction:column; min-height:0; }
  .tr-chart .chart-head { margin-top:0; }
  .tchart { flex:1 1 auto; height:auto; min-height:220px; }
  .tr-strip { grid-area:strip; display:flex; flex-direction:column; min-height:0; margin:0; }
  .tr-strip .strip-body { flex:1 1 auto; min-height:0; overflow:auto; margin-top:6px; }
  .t-strip-seg { margin:0; max-width:520px; }
  .t-strip-seg button { min-height:34px; padding:4px 10px; }
  body[data-tab="trade"] #p-torder { grid-area:order; display:block; overflow:auto; min-height:0; }
  body[data-tab="trade"] .foot { flex:0 0 auto; max-width:none; padding:4px 16px 6px; }
  .tabs button.trade-tab[aria-current="page"] { box-shadow:inset 0 -3px 0 var(--tpick); }
}
@media (min-width: 1024px) and (max-height: 760px) { body[data-tab="trade"] .grid { grid-template-rows:auto minmax(0, 1fr) minmax(120px, 26%); } }
@media (prefers-reduced-motion: reduce) { body[data-tsheet] #p-torder { animation:none !important; } }
@media (min-width: 1024px) {
  .t-strip-seg { flex:0 0 auto; }
  .tr-list .tboard .act { display:none; }
  .tr-list .tboard td, .tr-list .tboard th { padding:7px 4px; }
  .tr-list .tboard tbody tr:hover { background:var(--soft); }
}
@media (max-width: 1023px) {
  .tboard td.act { width:1%; }
  .tboard td.act .mini { display:block; width:100%; min-width:52px; }
  .tboard td.act .mini + .mini { margin:4px 0 0; }
}

/* v0.5.1: thông báo Trading tạm dừng nằm ngay dưới tiêu đề (trước đây lưới máy tính đẩy xuống đáy màn hình). */
.t-off { margin:6px 0 0; padding:8px 12px; border-radius:10px; border:1px solid color-mix(in srgb, var(--down) 45%, var(--line)); background:color-mix(in srgb, var(--down) 10%, transparent); color:var(--ink); font-size:14px; }

/* v0.5.2: khung đặt lệnh Trading gọn hơn để vừa màn laptop; nút Gửi lệnh luôn dính ở đáy khung; đòn bẩy một hàng. */
/* Nút Gửi dính đáy khung đặt lệnh (Trading từ v0.5.2; Đầu tư từ v0.5.5 khi khung hẹp lại). */
.t-submit-bar { position:sticky; bottom:-10px; margin:10px -2px -2px; padding:8px 2px 12px; background:var(--card); z-index:2; box-shadow:0 -10px 14px -12px rgba(0,0,0,.5); }
.t-submit-bar .primary { margin-top:0; }
/* v0.15.1: dòng "Đang sửa lệnh ..." và nút Thôi sửa nằm trong thanh gửi, thấy suốt lúc đang Sửa lệnh. */
.t-submit-bar .o-edit { margin:0 0 8px; display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; color:var(--pick); }
.t-levs { display:grid !important; grid-template-columns:repeat(auto-fit, minmax(44px, 1fr)); gap:6px; }
.t-levs .lev { min-width:0; padding:6px 0; }
.t-reco p { font-size:12px; margin:4px 0; }
#t-sltp-est:empty { display:none; }
#t-sltp-est { margin:2px 0 6px; }
.small.warn { color:var(--down); }
.strip-tab tr.flash-row td { animation:rowFlash 2.4s ease-out both; }
@keyframes rowFlash { 0%, 30% { background:color-mix(in srgb, var(--tpick, var(--pick)) 28%, transparent); } 100% { background:transparent; } }
.co-pop button:disabled { opacity:.6; cursor:default; font-style:italic; }
@media (prefers-reduced-motion: reduce) { .strip-tab tr.flash-row td { animation:none; background:color-mix(in srgb, var(--tpick, var(--pick)) 18%, transparent); } }
/* Đầu tư: dải nhắc khi đang ở biểu đồ TradingView (không đặt lệnh trên biểu đồ được). */
.co-tvbar { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin:6px 0 0; padding:6px 10px; border:1px dashed var(--line); border-radius:8px; font-size:13px; color:var(--muted); }
.co-tvbar .sh { display:none; }
.co-tvbar button { min-height:32px; padding:4px 10px; border:1px solid var(--pick); border-radius:8px; background:transparent; color:var(--pick); font-weight:600; }
.t-row3 { display:grid; grid-template-columns:minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap:8px; }
.t-row3 label { margin:8px 0 2px; min-width:0; }
.t-row3 input { padding:9px 8px; }
.t-lotline { margin:0 0 4px; }
@media (min-width: 1024px) and (max-height: 820px) {
  body[data-tab="trade"] #p-torder h2 { font-size:16px; }
  body[data-tab="trade"] #p-torder .seg { margin:6px 0; }
  body[data-tab="trade"] #p-torder .seg button { min-height:36px; padding:6px 8px; }
  body[data-tab="trade"] #p-torder label { margin:6px 0 2px; font-size:13px; }
  body[data-tab="trade"] #p-torder input { padding:7px 8px; font-size:15px; }
  body[data-tab="trade"] .t-levs .lev { min-height:34px; }
}

/* ---------- v0.5.8 (16/10): bản PC bớt khoảng trống, thêm chuyển động, chuyển tiếp, tương tác ----------
   Quy tắc giao diện (máy tính dùng hết bề rộng, lưới nhiều khung) và 2.5 (chỉ transform, opacity; vào màn một lần; tắt khi giảm chuyển động).
   Luồng Đầu tư không có số nhảy giả hay chuyển động lặp. */
:root { --ease-out:cubic-bezier(.23, 1, .32, 1); }
@property --mx { syntax:"<length>"; inherits:false; initial-value:-999px; }
@property --my { syntax:"<length>"; inherits:false; initial-value:-999px; }

/* Danh mục trên máy tính rộng: lưới 12 cột, tối đa 1680px. Khối .dash, .dash2 "tan" vào lưới (display: contents) để từng thẻ có chỗ riêng. */
@media (min-width: 1200px) {
  body[data-tab="portfolio"] .grid { max-width:1720px; }
  body[data-tab="portfolio"] #p-pf, #p-assets { max-width:none; }
  body[data-tab="portfolio"][data-sub="assets"] #p-assets { display:grid; gap:14px; align-items:start; grid-template-columns:repeat(12, minmax(0, 1fr));
    grid-template-areas:
      "big big big big big stats stats stats stats next next next"
      "big big big big big mix mix mix mix next next next"
      "pos pos pos pos pos pos pos pos pos pos pos pos"
      "daily daily daily daily daily daily daily rank rank rank rank rank"
      "fs fs fs fs fs fs fs fs fs fs fs fs"
      "eq eq eq eq eq eq eq eq eq eq eq eq"; }
  #p-assets .dash, #p-assets .dash2 { display:contents; }
  #p-assets #c-big { grid-area:big; align-self:stretch; }
  #p-assets #c-stats { grid-area:stats; display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  #p-assets #c-mix { grid-area:mix; }
  #p-assets #c-next { grid-area:next; align-self:stretch; }
  #p-assets #s-pos { grid-area:pos; }
  #p-assets .pos-list { display:flex; flex-wrap:wrap; align-items:stretch; } #p-assets .pos-list > li { flex:1 1 max(340px, calc((100% - (var(--pc, 3) - 1) * 10px) / var(--pc, 3))); min-width:0; } /* v0.8.1: xếp kiểu flex, mỗi hàng tối đa --pc thẻ (app.js theo số vị thế), thẻ không hẹp hơn 340px; thẻ hàng cuối tự giãn nên không bao giờ có ô trống */ #p-assets #s-pos h3, #p-assets #s-fs h3, #p-assets #s-eq h3 { margin-top:0; }
  #p-assets #c-daily { grid-area:daily; } #p-assets #c-rank { grid-area:rank; align-self:stretch; }
  /* v0.11.1 (22/10): bỏ thẻ Hoạt động gần đây ở cột phải; tin chỉ còn ở mục Thông báo. */
  #p-assets #s-fs { grid-area:fs; } #p-assets #s-eq { grid-area:eq; }
  /* v0.5.9: ba báo cáo mỗi cái một cột (lưới, không chia cột kiểu báo: kiểu cũ dồn báo cáo gập xuống cột 2, để trống cột 3). */
  #p-assets .fs-list { display:grid; columns:auto; grid-template-columns:repeat(auto-fit, minmax(360px, 1fr)); gap:14px; align-items:start; }
  #p-assets .fs-list > details { margin:0; }
  #p-assets #eq-chart { height:300px; }
}


/* Chuyển màn: nội dung mờ dần vào và nhích lên 8px (220ms, một lần mỗi lần đổi mục). */
#app .grid.view-in { animation:viewIn .22s var(--ease-out) both; }
@keyframes viewIn { from { opacity:0; transform:translateY(8px); } }

/* Vạch đánh dấu mục trượt theo mục đang chọn (điện thoại: mép trên thanh đáy; máy tính: mép dưới thanh trên). */
.tabs .tab-ind { position:absolute; left:0; top:0; width:1px; height:3px; background:var(--pick); transform-origin:left; opacity:0; pointer-events:none; }
.tabs .tab-ind.t { background:var(--tpick, var(--pick)); }
.tabs .tab-ind.anim { transition:transform .26s var(--ease-out), opacity .2s ease, background-color .2s ease; }
.tabs.has-ind button[aria-current="page"], .tabs.has-ind button.trade-tab[aria-current="page"] { box-shadow:none; }
@media (min-width: 1024px) { .tabs .tab-ind { top:auto; bottom:0; } } /* .tabs đã fixed (điện thoại), sticky (máy tính) nên làm gốc định vị cho vạch */

/* Vệt sáng nhẹ theo chuột trên thẻ (chỉ máy có chuột; biến --mx, --my không kế thừa nên không tính lại kiểu cho con). */
@media (hover: hover) and (pointer: fine) {
  .card { position:relative; }
  .card::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; opacity:0; transition:opacity .25s ease;
    background:radial-gradient(360px circle at var(--mx) var(--my), color-mix(in srgb, var(--pick) 9%, transparent), transparent 70%); }
  .card:hover::after { opacity:1; }
}

/* Nhấn nút: thu nhẹ 3% cho cảm giác máy đã nghe (cả điện thoại). */
.btn-sell:active:not(:disabled), .btn-buy:active:not(:disabled), .btn-ghost:active:not(:disabled), button.link:active:not(:disabled), .bell:active,
.menu-btn:active, button.primary:active:not(:disabled), .seg button:active:not(:disabled), button.mini:active:not(:disabled), .lev:active, .tabs button:active { transform:scale(.97); }

@media (prefers-reduced-motion: reduce) {
  #app .grid.view-in { animation:none !important; }
  .tabs .tab-ind.anim { transition:opacity .2s ease; }
  .card::after { display:none; }
}

/* v0.6 (P13): cấp độ, thẻ thành viên, thành tích. Màu huy hiệu theo hạng (Đồng, Bạc, Vàng); thẻ thành viên đổi viền theo bậc 10 cấp. */
:root[data-theme] { --t-bronze:#a0622d; --t-silver:#6b7a8c; --t-gold:#a87b00; --t-special:#db2777; }
:root[data-theme="dark"] { --t-bronze:#d8955a; --t-silver:#b8c4d2; --t-gold:#facc15; --t-special:#f472b6; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --t-bronze:#d8955a; --t-silver:#b8c4d2; --t-gold:#facc15; --t-special:#f472b6; } }
.lv-tag { display:inline-block; white-space:nowrap; font-size:12px; font-weight:600; line-height:1.4; padding:0 6px; border-radius:999px; border:1px solid var(--line); color:var(--muted); font-variant-numeric:tabular-nums; vertical-align:1px; }
td.rk-name { white-space:nowrap; }
.member { display:grid; gap:8px; margin:8px 0 16px; border-color:color-mix(in srgb, var(--pick) 30%, var(--line)); background:linear-gradient(135deg, color-mix(in srgb, var(--pick) 9%, var(--card)), var(--card) 60%); }
.member[data-band="1"], .member[data-band="2"] { border-color:color-mix(in srgb, var(--t-bronze) 55%, var(--line)); }
.member[data-band="3"], .member[data-band="4"], .member[data-band="5"] { border-color:color-mix(in srgb, var(--t-silver) 60%, var(--line)); }
.member[data-band="6"], .member[data-band="7"], .member[data-band="8"], .member[data-band="9"], .member[data-band="10"] { border-color:color-mix(in srgb, var(--t-gold) 60%, var(--line)); }
.mb-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.mb-who { min-width:0; }
.mb-who .k { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mb-title { font-size:20px; font-weight:700; }
.mb-lv { text-align:right; flex:0 0 auto; }
.mb-lv b { display:block; font-size:34px; line-height:1; font-variant-numeric:tabular-nums; }
.mb-xp, .mb-foot { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; font-size:13px; font-variant-numeric:tabular-nums; }
.mb-foot { color:var(--muted); font-size:12px; }
.bar.xp { height:10px; }
.ach-tiers { display:flex; flex-wrap:wrap; gap:6px; }
.tier { white-space:nowrap; font-size:12px; font-weight:600; line-height:1.5; padding:0 8px; border-radius:999px; border:1px dashed var(--line); color:var(--muted); font-variant-numeric:tabular-nums; }
.tier.on { border-style:solid; }
.tier.on.t-bronze { border-color:var(--t-bronze); color:var(--t-bronze); } .tier.on.t-silver { border-color:var(--t-silver); color:var(--t-silver); }
.tier.on.t-gold { border-color:var(--t-gold); color:var(--t-gold); } .tier.on.t-special { border-color:var(--t-special); color:var(--t-special); }
.ach-pr { display:flex; align-items:center; gap:8px; margin-top:6px; } .ach-pr .bar { flex:1; margin-top:0; } .ach-pr span { flex:0 0 auto; font-variant-numeric:tabular-nums; }
.xp-log .line1 span:last-child { font-variant-numeric:tabular-nums; white-space:nowrap; }
.xp-log .up { color:var(--up); }
/* Điện thoại hẹp: tên người chơi đã ẩn, chỉ còn ảnh đại diện. */
@media (max-width: 440px) { .who { gap:8px; } }

/* v0.7 (P11): nút "!" giải thích giờ khớp (vàng, HOSE, cổ phiếu Mỹ) và khung giải thích. Bấm, chạm, bàn phím; không dựa vào rê chuột. */
.why-x { position:relative; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; margin-left:6px; padding:0; border-radius:999px; border:1px solid var(--line); background:transparent; color:var(--muted); font-size:12px; font-weight:700; line-height:1; cursor:pointer; vertical-align:middle; }
.why-x::before { content:""; position:absolute; inset:-8px; }
.why-x[aria-expanded="true"] { border-color:var(--pick); color:var(--pick); }
.why-x:focus-visible { outline:2px solid var(--pick); outline-offset:2px; }
@media (hover: hover) and (pointer: fine) { .why-x:hover { color:var(--ink); border-color:var(--muted); } }
.why-pop { position:fixed; z-index:80; padding:10px 12px; border-radius:10px; border:1px solid var(--line); background:var(--card); color:var(--ink); font-size:13px; line-height:1.5; box-shadow:0 8px 24px rgba(0,0,0,.28); animation:why-in 160ms var(--ease-out, ease-out); }
@keyframes why-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .why-pop { animation:none; } }
#order-day { display:flex; align-items:center; flex-wrap:wrap; gap:2px; }

/* v0.8 (P12b): nút chuyển ngôn ngữ (i18n.js). Ở đầu trang dùng khung tròn như chuông; ở màn đăng nhập nằm góc phải trên của thẻ. */
.lang-q { font-size:12px; font-weight:700; letter-spacing:.04em; }
.lang-q.bell { width:36px; height:36px; }
.auth-lang { position:absolute; top:12px; right:12px; min-height:0; padding:4px 10px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--muted); }
.auth-lang:hover, .auth-lang:focus-visible { border-color:var(--pick); color:var(--pick); }
.menu .menu-lang { display:none; }
/* Dưới 700px đầu trang không đủ chỗ (logo, tên, cấp, chuông, Luật chơi, Menu): nút ngôn ngữ chuyển vào đầu menu. */
@media (max-width: 699px) { .top .lang-q { display:none; } .menu .menu-lang { display:block; font-size:16px; font-weight:400; letter-spacing:0; border-bottom:1px solid var(--line); border-radius:10px 10px 0 0; margin-bottom:4px; } }

/* v0.8 (P12b): bố cục máy tính cho các màn còn lại. Điện thoại giữ một cột như cũ.
   (v0.9: Luật chơi và Thành tích làm lại, xem khối v0.9 cuối tệp; dòng dưới là mô tả cũ.) Từ 1200px: Luật chơi chia hai cột (Đầu tư trái, Trading phải); Thành tích: cột trái thẻ thành viên, XP gần đây, cách tính XP,
   cột phải lưới thành tích; Nhật ký: cột trái ô viết (dính khi cuộn), cột phải danh sách. Không dùng position: sticky trong khối display: contents. */
@media (min-width: 1200px) {
  #p-journal { max-width:1360px; }
  body[data-tab="journal"] #p-journal { display:grid; grid-template-columns:minmax(300px, 420px) minmax(0, 1fr); column-gap:24px; align-items:start;
    grid-template-areas:"h list" "p list" "form list"; grid-template-rows:auto auto 1fr; }
  #p-journal > h2 { grid-area:h; }
  #p-journal > p { grid-area:p; }
  #p-journal > form { grid-area:form; position:sticky; top:calc(var(--toph, 53px) + 56px); }
  #p-journal > #journal { grid-area:list; margin-top:0; }
}

/* ---------- v0.9 (22/10): Luật chơi, Thành tích gọn và theo quy tắc ----------
   Quy tắc giao diện áp dụng từ bản này tới v1.0: số liệu thành dòng hoặc bảng, không chôn trong câu;
   thẻ tối đa 3 dòng chữ, phần dài vào Chi tiết; lưới đều, thẻ cùng hàng cùng cao; mỗi nội dung một chỗ;
   trạng thái bằng màu bậc và vòng tiến độ; khoảng cách theo thang 8, 12, 16, 24. */
.rtab[hidden] { display:none !important; }
.rules-tabs { max-width:620px; }
.rules-tabs .chip-sim { margin-left:4px; vertical-align:1px; }
.rtab { margin-top:12px; }
.cmp-wrap { border:1px solid var(--line); border-radius:12px; background:var(--card); overflow:hidden; }
table.cmp { width:100%; border-collapse:collapse; table-layout:fixed; font-size:14px; }
table.cmp th, table.cmp td { padding:8px 10px; text-align:left; vertical-align:top; border-bottom:1px solid var(--line); overflow-wrap:anywhere; line-height:1.45; }
table.cmp tbody tr:last-child th, table.cmp tbody tr:last-child td { border-bottom:0; }
table.cmp thead th { font-size:13px; font-weight:700; background:var(--soft); white-space:nowrap; }
table.cmp thead th:first-child { width:30%; }
table.cmp tbody th { font-size:13px; font-weight:600; color:var(--muted); }
table.cmp td { font-variant-numeric:tabular-nums; }
.cmp-note { margin:6px 2px 0; }
.r-more { margin-top:8px; font-size:13px; color:var(--muted); }
.r-more summary { cursor:pointer; color:var(--pick); font-weight:600; width:max-content; max-width:100%; }
.r-more p { margin:6px 0 0; line-height:1.55; }
.cmp-more { margin:8px 2px 0; }
.rule-grid { margin-top:12px; }
@media (min-width: 900px) {
  .rule-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  /* Thẻ lẻ cuối cùng giãn hết hàng, dòng số chia hai cột (không để ô trống cạnh nó). */
  .rule-grid > li:last-child:nth-child(odd) { grid-column:1 / -1; }
  .rule-grid > li:last-child:nth-child(odd) .facts { grid-template-columns:repeat(2, minmax(0, 1fr)); column-gap:24px; }
  .rule-grid > li:last-child:nth-child(odd) .facts > div:nth-child(2) { border-top:0; }
}
.rule-card .rule-h { margin-bottom:6px; font-size:15px; }
.facts { margin:0; display:grid; }
.facts > div { display:grid; grid-template-columns:minmax(96px, 40%) minmax(0, 1fr); gap:12px; padding:5px 0; border-top:1px dashed var(--line); font-size:13px; line-height:1.45; }
.facts > div:first-child { border-top:0; }
.facts dt { color:var(--muted); }
.facts dd { margin:0; font-variant-numeric:tabular-nums; }
#rules-xp table.cmp { margin:4px 0 8px; border:1px solid var(--line); border-radius:8px; }
#rules-xp table.cmp thead th:first-child { width:auto; }
#rules-xp table.cmp td:nth-child(2), #rules-xp table.cmp th:nth-child(2) { width:56px; text-align:right; }
#rules-xp table.cmp td:nth-child(3), #rules-xp table.cmp th:nth-child(3) { width:34%; }
@media (max-width: 420px) {
  table.cmp { font-size:12px; } table.cmp th, table.cmp td { padding:6px; }
  table.cmp thead th { white-space:normal; } table.cmp thead th:first-child { width:27%; }
  .facts > div { grid-template-columns:minmax(84px, 38%) minmax(0, 1fr); gap:8px; }
}
/* Thành tích: thẻ thành viên ngang (chừa chỗ ảnh đại diện), bộ lọc, lưới ô đều; bấm ô thì ô giãn hết hàng và hiện chi tiết. */
.member { display:flex; gap:14px; align-items:center; }
.mb-av { flex:0 0 auto; width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:22px; font-weight:700;
  background:var(--soft); color:var(--ink); border:3px solid color-mix(in srgb, var(--pick) 60%, var(--line)); }
.member[data-band="1"] .mb-av, .member[data-band="2"] .mb-av { border-color:var(--t-bronze); }
.member[data-band="3"] .mb-av, .member[data-band="4"] .mb-av, .member[data-band="5"] .mb-av { border-color:var(--t-silver); }
.member[data-band="6"] .mb-av, .member[data-band="7"] .mb-av, .member[data-band="8"] .mb-av, .member[data-band="9"] .mb-av, .member[data-band="10"] .mb-av { border-color:var(--t-gold); }
.mb-body { flex:1; min-width:0; display:grid; gap:6px; }
.mb-body .mb-title { font-size:18px; }
.mb-body .mb-lv b { font-size:28px; }
.fchips { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.fchip { min-height:32px; padding:4px 12px; border-radius:999px; border:1px solid var(--line); background:transparent; color:var(--muted); font-size:13px; white-space:nowrap; }
.fchip:hover { border-color:var(--pick); }
.fchip[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:var(--bg); font-weight:600; }
.ach-tiles { --g:10px; list-style:none; margin:0; padding:0; display:grid; gap:var(--g); grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); }
.ach-tiles > .empty { grid-column:1 / -1; }
.ach-tile { min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; background:var(--card); transition:border-color .18s ease, box-shadow .18s ease; }
.ach-tile.got { border-color:color-mix(in srgb, var(--pick) 35%, var(--line)); }
.ach-tile.sel { border-color:var(--pick); box-shadow:inset 0 0 0 1px var(--pick); }
.ach-btn { flex:1; display:grid; gap:8px; align-content:start; width:100%; padding:12px; border:0; border-radius:12px; background:none; color:var(--ink); text-align:left; }
.ach-btn:hover .ach-n b { color:var(--pick); }
.ach-h { display:flex; gap:10px; align-items:center; min-width:0; }
.ach-n { min-width:0; display:grid; }
.ach-n b { font-size:14px; line-height:1.3; }
.ach-g { font-size:12px; color:var(--muted); }
.pips { display:flex; gap:4px; }
.pip { width:22px; height:5px; border-radius:3px; background:var(--line); }
.pip.on.t-bronze { background:var(--t-bronze); } .pip.on.t-silver { background:var(--t-silver); } .pip.on.t-gold { background:var(--t-gold); } .pip.on.t-special { background:var(--t-special); }
.ach-st { font-size:12px; line-height:1.4; color:var(--muted); }
.ach-tile.got .ach-st { color:var(--ink); }
/* v0.11.1: khung chi tiết dưới hàng của ô đang chọn (achPick trong app.js). Co giãn bằng grid-template-rows 0fr sang 1fr; lề trên âm bằng
   khoảng cách lưới khi đóng để hàng dưới không giật 10px lúc khung được gỡ. Mũi nhọn (::before) đặt theo --nx là tâm ô đang chọn. */
.ach-panel { grid-column:1 / -1; position:relative; display:grid; grid-template-rows:0fr; opacity:0; margin-top:calc(-1 * var(--g));
  transition:grid-template-rows .22s var(--ease-out), margin-top .22s var(--ease-out), opacity .18s ease; }
.ach-panel.show { grid-template-rows:1fr; opacity:1; margin-top:0; }
.ach-pi { min-height:0; overflow:hidden; }
.ach-panel .ach-d { margin-top:6px; padding:12px 12px 14px; border:1px solid var(--pick); border-radius:12px; background:color-mix(in srgb, var(--pick) 6%, var(--card)); }
.ach-panel::before { content:""; position:absolute; z-index:1; top:0; left:var(--nx, 50%); width:12px; height:12px; margin-left:-6px; transform:rotate(45deg);
  border-left:1px solid var(--pick); border-top:1px solid var(--pick); background:color-mix(in srgb, var(--pick) 6%, var(--card)); transition:left .22s var(--ease-out); }
.ach-panel .bar { background:var(--line); } /* nền khung đã ngả màu nhấn, rãnh thanh tiến độ màu --soft gần như chìm mất */
.ach-dh { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.ach-dh b { font-size:15px; }
.ach-x { flex:0 0 auto; min-width:32px; min-height:32px; border:0; border-radius:8px; background:none; color:var(--muted); font-size:20px; line-height:1; cursor:pointer; }
.ach-x:hover { color:var(--ink); background:var(--soft); }
.ach-pi.swap > .ach-d > * { animation:achSwap .2s var(--ease-out) both; }
@keyframes achSwap { from { opacity:0; transform:translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .ach-panel, .ach-panel::before, .ach-tile { transition:none; } .ach-pi.swap > .ach-d > * { animation:none; } }
.ach-d p { margin:0 0 8px; }
.medal2 { flex:0 0 auto; }
.medal2 .m-track { fill:none; stroke:var(--line); stroke-width:3; }
.medal2 .m-arc { fill:none; stroke:var(--pick); stroke-width:3; stroke-linecap:round; }
.medal2 .m-arc.t-bronze { stroke:var(--t-bronze); } .medal2 .m-arc.t-silver { stroke:var(--t-silver); } .medal2 .m-arc.t-gold { stroke:var(--t-gold); } .medal2 .m-arc.t-special { stroke:var(--t-special); }
.medal2 .m-disc { fill:var(--soft); }
.medal2 .m-disc.t-bronze { fill:var(--t-bronze); } .medal2 .m-disc.t-silver { fill:var(--t-silver); } .medal2 .m-disc.t-gold { fill:var(--t-gold); } .medal2 .m-disc.t-special { fill:var(--t-special); }
.medal2 .m-mk { fill:none; stroke:var(--card); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.ach-logsec .link { margin:8px 8px 0 0; }
@media (max-width: 420px) { .ach-tiles { grid-template-columns:1fr 1fr; --g:8px; } .ach-btn { padding:10px; } .member { gap:10px; } .mb-av { width:44px; height:44px; font-size:18px; } }
@media (min-width: 1024px) {
  #p-ach { max-width:1200px; }
  body[data-tab="ach"] #p-ach { display:grid; grid-template-columns:minmax(300px, 360px) minmax(0, 1fr); column-gap:20px; align-items:start;
    grid-template-areas:"h h" "mb main" "rk main" "st main" "ex main" "log main"; grid-template-rows:auto auto auto auto auto 1fr; }
  #p-ach > .rk-sec { grid-area:rk; } /* Rank (Beta): thẻ rank dưới thẻ thành viên; ẩn (rank tắt) thì hàng rk cao 0 */
  #p-ach > .pstats-sec { grid-area:st; }
  #p-ach > h2 { grid-area:h; }
  #p-ach > .member { grid-area:mb; margin-top:0; }
  #p-ach > .explore { grid-area:ex; }
  #p-ach > .ach-main > h3 { margin-top:0; }
  #p-ach > .ach-main { grid-area:main; }
  #p-ach > .ach-logsec { grid-area:log; }
  #p-ach > .ach-logsec h3 { margin-top:4px; }
}
/* v0.9 (22/10, màn laptop): màn Trading máy tính, cột biểu đồ là flex dọc nên thanh khung thời gian (1m đến 4h, có từ v0.5)
   bị ép còn 2px, trông như không có; hai dòng chú thích tràn xuống bảng Vị thế. Nay chỉ biểu đồ được co (tối thiểu 140px);
   chú thích một dòng, bấm để mở hết (trade.js). */
@media (min-width: 1024px) {
  .tr-chart > * { flex-shrink:0; }
  .tr-chart > .tchart { flex:1 1 auto; min-height:140px; }
  .tr-chart p.t-hint { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; } /* 23/10: chỉ dòng nguồn; hướng dẫn nằm trong Chi tiết */
  .tr-chart p.t-hint.open { white-space:normal; }
}

/* v0.10 (22/10, lối vào Hồ sơ dễ nhận ra hơn trên điện thoại): ảnh đại diện tròn ở đầu trang thay chip "Cấp N".
   Viền theo bậc cấp như thẻ thành viên; số cấp trong huy hiệu nhỏ ở góc; chấm cam tới lần đầu mở Hồ sơ. Máy tính: ảnh và tên là một nút. */
.pf-av-btn { flex:0 1 auto; min-width:0; display:inline-flex; align-items:center; gap:8px; min-height:40px; padding:2px 10px 2px 2px; border-radius:999px; border:1px solid transparent; background:transparent; color:var(--ink); font:inherit; cursor:pointer; }
.pf-av-btn:hover { border-color:var(--line); }
.pf-av-btn:focus-visible { outline:2px solid var(--pick); outline-offset:2px; }
.pf-av-btn .who-name { color:var(--ink); font-weight:600; }
.pf-av { position:relative; flex:0 0 auto; width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700;
  background:var(--soft); border:2px solid color-mix(in srgb, var(--pick) 60%, var(--line)); }
.pf-av-btn[data-band="1"] .pf-av, .pf-av-btn[data-band="2"] .pf-av { border-color:var(--t-bronze); }
.pf-av-btn[data-band="3"] .pf-av, .pf-av-btn[data-band="4"] .pf-av, .pf-av-btn[data-band="5"] .pf-av { border-color:var(--t-silver); }
.pf-av-btn[data-band="6"] .pf-av, .pf-av-btn[data-band="7"] .pf-av, .pf-av-btn[data-band="8"] .pf-av, .pf-av-btn[data-band="9"] .pf-av, .pf-av-btn[data-band="10"] .pf-av { border-color:var(--t-gold); }
.av-lv { position:absolute; right:-6px; bottom:-5px; min-width:17px; height:17px; padding:0 3px; border-radius:999px; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; line-height:1; font-variant-numeric:tabular-nums; background:var(--pick); color:var(--bg); border:2px solid var(--bg); }
.av-lv[hidden], .av-dot[hidden] { display:none; }
.av-dot { position:absolute; top:-2px; right:-2px; width:10px; height:10px; border-radius:50%; background:#e8710a; border:2px solid var(--bg); animation:av-pulse 1.6s ease-in-out infinite; }
@keyframes av-pulse { 50% { transform:scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .av-dot { animation:none; } }
@media (max-width: 440px) { .pf-av-btn { padding:2px 0; } }
/* Khám phá Paper Floor: lưới ô đều (2 cột), mỗi ô tên một dòng, mô tả tối đa hai dòng. */
.explore { margin:0 0 16px; }
.explore h3 { margin:0 0 8px; }
.ex-tiles { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ex-tile { display:grid; gap:4px; align-content:start; text-align:left; padding:12px; min-height:72px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--ink); font:inherit; cursor:pointer; }
.ex-tile:hover { border-color:var(--pick); }
.ex-tile:focus-visible { outline:2px solid var(--pick); outline-offset:2px; }
.ex-tile b { font-size:14px; }
.ex-tile span { font-size:12px; color:var(--muted); line-height:1.4; }
/* Nút Đặt lệnh ở đầu biểu đồ (điện thoại): đậm hơn chữ Thu gọn để dễ thấy. */
.chart-head .chart-order { font-weight:700; color:var(--pick); white-space:nowrap; }

/* v0.11 (22/10): thẻ Hôm nay, Mục tiêu mùa, chip lọc vị thế, thanh SL/TP Trading, vòng tròn đổi sáng tối. */
.today-card { display:flex; flex-direction:column; gap:8px; }
.td-hi { font-size:15px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.td-chips { display:flex; flex-wrap:wrap; gap:6px; }
.td-chip { white-space:nowrap; font-size:12px; line-height:1.5; padding:2px 10px; border-radius:999px; border:1px solid var(--line); color:var(--muted); }
.td-chip.on { color:var(--ink); border-color:var(--pick); }
.td-chip.on::before { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--up); margin-right:6px; vertical-align:middle; }
.td-line { margin:0; font-size:14px; }
.td-acts { display:flex; flex-wrap:wrap; gap:8px; }
.td-acts button, .goal-btns button, .goal-card > button { min-height:40px; padding:8px 16px; border-radius:8px; font-weight:600; border:1px solid var(--line); background:transparent; color:var(--ink); margin:0; }
.goal-card > button { align-self:flex-start; }
.goal-btns button[type=submit] { border-color:var(--pick); color:var(--pick); }
.goal-card { display:flex; flex-direction:column; gap:8px; }
.goal-row { display:flex; align-items:center; gap:12px; }
.gauge { width:120px; height:66px; flex:0 0 auto; }
.gauge path { fill:none; stroke-width:10; stroke-linecap:round; }
.gauge .g-bg { stroke:var(--soft); }
.gauge .g-fg { stroke:var(--pick); }
.gauge .g-t { fill:var(--ink); font-size:18px; font-weight:800; font-variant-numeric:tabular-nums; }
.card.enter .gauge .g-fg { animation:gauge .8s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i, 0) * 40ms + 120ms); }
@keyframes gauge { from { stroke-dasharray:0 100; } }
@media (prefers-reduced-motion: reduce) { .card.enter .gauge .g-fg, .td-chip.on::before { animation:none !important; } }
.goal-txt { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:4px; }
.goal-txt .mini { align-self:flex-start; }
.goal-v { font-size:clamp(15px, 4.6vw, 18px); font-weight:700; white-space:normal; text-align:left; overflow-wrap:anywhere; }
.goal-v .unit { font-size:13px; font-weight:400; color:var(--muted); }
.goal-form { display:flex; flex-direction:column; gap:6px; }
.goal-form p { margin:0; }
.goal-btns { display:flex; flex-wrap:wrap; gap:8px; }
.pos-filter { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.pos-filter .fchip { display:inline-flex; align-items:center; gap:6px; }
.pos-filter .dot { width:8px; height:8px; border-radius:50%; display:block; }
.pos-filter .n { font-size:12px; opacity:.8; }
.pos-name .chip.t2 { font-size:12px; padding:0 8px; margin-top:2px; align-self:flex-start; }
.sltp-bar { position:relative; display:block; height:4px; margin:5px 0 2px; border-radius:4px; background:var(--soft); min-width:64px; }
.sltp-bar.has-sl { background:linear-gradient(90deg, color-mix(in srgb, var(--down) 55%, var(--soft)) 0 18%, var(--soft) 18% 82%, var(--soft) 82%); }
.sltp-bar.has-tp { background:linear-gradient(90deg, var(--soft) 0 82%, color-mix(in srgb, var(--up) 55%, var(--soft)) 82%); }
.sltp-bar.has-sl.has-tp { background:linear-gradient(90deg, color-mix(in srgb, var(--down) 55%, var(--soft)) 0 18%, var(--soft) 18% 82%, color-mix(in srgb, var(--up) 55%, var(--soft)) 82%); }
.sltp-bar i { position:absolute; top:-3px; width:2px; height:10px; margin-left:-1px; background:var(--ink); border-radius:1px; }
.chip.near-sl { font-size:12px; padding:0 8px; margin-top:2px; }
::view-transition-old(root), ::view-transition-new(root) { animation:none; mix-blend-mode:normal; }
@media (min-width: 720px) and (max-width: 1199px) {
  #c-today { grid-column:1 / -1; }
  #c-big { grid-row:span 2; }
}
@media (min-width: 1200px) {
  body[data-tab="portfolio"][data-sub="assets"] #p-assets { grid-template-areas:
      "today today today today today today today today goal goal goal goal"
      "big big big big big stats stats stats stats next next next"
      "big big big big big mix mix mix mix next next next"
      "pos pos pos pos pos pos pos pos pos pos pos pos"
      "daily daily daily daily daily daily daily rank rank rank rank rank"
      "fs fs fs fs fs fs fs fs fs fs fs fs"
      "eq eq eq eq eq eq eq eq eq eq eq eq"; }
  #p-assets #c-today { grid-area:today; align-self:stretch; }
  #p-assets #c-goal { grid-area:goal; align-self:stretch; }
}

/* v0.12: khối Chỉ số (Hồ sơ và hộp hồ sơ người khác) và hộp hồ sơ. Bảng dùng kiểu table.cmp của Luật chơi; cột số canh phải. */
.pstats-sec { margin:0 0 16px; }
.pstats-sec h3 { margin:0 0 8px; }
/* Cột số tự co theo số (không xuống dòng, không cắt); cột nhãn nhận phần còn lại và được xuống dòng. */
table.pstat { table-layout:auto; border:1px solid var(--line); border-radius:12px; border-collapse:separate; border-spacing:0; overflow:hidden; font-size:13px; }
table.pstat thead th { white-space:normal; }
table.pstat thead th:first-child { width:42%; }
table.pstat td.num { text-align:right; white-space:nowrap; overflow-wrap:normal; }
table.pstat th.num { text-align:right; overflow-wrap:normal; }
table.pstat th, table.pstat td { padding:7px 10px; }
table.pstat td.up { color:var(--up); } table.pstat td.down { color:var(--down); }
.pstats p.small { margin:8px 0 0; }
@media (max-width: 360px) { table.pstat th, table.pstat td { padding:6px 6px; font-size:12px; } }
.pl-link { border:0; padding:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; text-decoration:underline; text-decoration-color:color-mix(in srgb, currentColor 30%, transparent); text-underline-offset:3px; }
.pl-link:hover { color:var(--pick); text-decoration-color:currentColor; }
.pl-link:focus-visible { outline:2px solid var(--pick); outline-offset:2px; border-radius:4px; }
#pp-backdrop { z-index:44; }
.pp { position:fixed; z-index:45; left:0; right:0; bottom:0; max-height:86vh; overflow:auto; overscroll-behavior:contain; padding:16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top:1px solid var(--line); border-radius:18px 18px 0 0; box-shadow:var(--shadow); animation:sheetUp .24s var(--ease-out) both; }
.pp[hidden] { display:none; }
@media (min-width: 720px) { .pp { left:50%; right:auto; bottom:auto; top:50%; width:min(560px, calc(100vw - 48px)); max-height:min(80vh, 760px); border:1px solid var(--line); border-radius:16px;
  translate:-50% -50%; animation:ppIn .26s var(--ease-out) both; } }
/* v0.21: căn giữa bằng thuộc tính translate riêng, để hoạt cảnh mở từ nút (fx.js, transform) cộng thêm mà không lệch tâm.
   Trình duyệt chưa có thuộc tính translate (Chrome trước 104, Safari trước 14.1): căn giữa bằng transform như cũ. */
@supports not (translate: 0) { @media (min-width: 720px) { .pp { transform:translate(-50%, -50%); } } }
@keyframes ppIn { from { opacity:0; transform:translateY(12px) scale(.97); } }
.pp-x { position:absolute; top:10px; right:10px; min-width:36px; min-height:36px; border:0; border-radius:10px; background:none; color:var(--muted); font-size:22px; line-height:1; cursor:pointer; }
.pp-x:hover { color:var(--ink); background:var(--soft); }
.pp-head { display:flex; gap:14px; align-items:center; margin:0 40px 12px 0; }
.pp-av { width:56px; height:56px; font-size:22px; border-width:3px; }
.pp-av .av-lv { min-width:20px; height:20px; font-size:12px; right:-6px; bottom:-4px; }
.pp-head[data-band="1"] .pp-av, .pp-head[data-band="2"] .pp-av { border-color:var(--t-bronze); }
.pp-head[data-band="3"] .pp-av, .pp-head[data-band="4"] .pp-av, .pp-head[data-band="5"] .pp-av { border-color:var(--t-silver); }
.pp-head[data-band="6"] .pp-av, .pp-head[data-band="7"] .pp-av, .pp-head[data-band="8"] .pp-av, .pp-head[data-band="9"] .pp-av, .pp-head[data-band="10"] .pp-av { border-color:var(--t-gold); }
.pp-who { min-width:0; display:grid; gap:2px; }
.pp-who h2 { margin:0; font-size:20px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pp-title { font-weight:600; }
.pp .pf-sec { margin:12px 0 0; }
.pp .pf-sec h3 { margin:0 0 8px; }
.pp-badges .tier { font-size:12px; line-height:1.6; }
@media (prefers-reduced-motion: reduce) { .pp { animation:none; } }

/* v0.12: thẻ chào mừng người mới (app.js showWelcome). Nảy vào có vượt nhẹ, viền chuyển màu ngọc lam sang vàng, vòng sáng quét quanh logo,
   chữ tiêu đề có vệt sáng lướt một lần, ba bước hiện so le, huy hiệu đầu tiên bật lên, pháo giấy (JS). Giảm chuyển động: chỉ mờ dần. */
.wc-bd { z-index:60; background:radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--pick) 22%, transparent), rgba(0,0,0,.62) 70%);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); animation:wcFade .3s ease both; }
.wc { position:fixed; z-index:61; left:50%; top:50%; width:min(440px, calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; transform:translate(-50%, -50%);
  padding:28px 22px 20px; border-radius:20px; text-align:center; color:var(--ink);
  border:1.5px solid transparent; background:linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--pick), var(--t-gold) 55%, var(--t-special)) border-box;
  box-shadow:0 24px 70px rgba(0,0,0,.45), 0 0 0 1px color-mix(in srgb, var(--pick) 20%, transparent); animation:wcIn .62s cubic-bezier(.2, 1.35, .35, 1) both; }
.wc[hidden], .wc-bd[hidden] { display:none; }
.wc.out { animation:wcOut .2s ease both; } .wc-bd.out { animation:wcFade .2s ease reverse both; }
@keyframes wcIn { from { opacity:0; transform:translate(-50%, calc(-50% + 28px)) scale(.86); } }
@keyframes wcOut { to { opacity:0; transform:translate(-50%, calc(-50% + 12px)) scale(.96); } }
@keyframes wcFade { from { opacity:0; } }
.wc-glow { position:absolute; left:50%; top:-60px; width:260px; height:200px; margin-left:-130px; border-radius:50%; pointer-events:none;
  background:radial-gradient(closest-side, color-mix(in srgb, var(--pick) 45%, transparent), transparent); filter:blur(8px); opacity:.7; animation:wcGlow 3.2s ease-in-out infinite alternate; }
@keyframes wcGlow { to { transform:translateY(10px) scale(1.12); opacity:.95; } }
.wc-x { z-index:1; }
.wc-logo { position:relative; width:84px; height:84px; margin:0 auto 12px; display:grid; place-items:center; border-radius:50%; }
.wc-logo::before { content:""; position:absolute; inset:0; border-radius:50%; padding:3px;
  background:conic-gradient(from 0deg, var(--pick), var(--t-gold), var(--t-special), var(--pick));
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude;
  animation:spin 1.4s cubic-bezier(.3, .8, .3, 1) both, wcRing 2.4s 1.4s ease-in-out infinite; }
@keyframes wcRing { 50% { filter:drop-shadow(0 0 8px color-mix(in srgb, var(--pick) 70%, transparent)); } }
.wc-logo .logo-mark { position:relative; animation:wcPop .55s .18s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes wcPop { from { transform:scale(.5) rotate(-12deg); opacity:0; } }
.wc-t { margin:0 0 6px; font-size:22px; line-height:1.25;
  background:linear-gradient(100deg, var(--ink) 0 38%, var(--pick) 46%, var(--t-gold) 52%, var(--ink) 60% 100%); background-size:260% 100%; background-position:100% 0;
  -webkit-background-clip:text; background-clip:text; color:transparent; animation:wcShine 1.5s .45s ease-out both; }
@keyframes wcShine { from { background-position:100% 0; } to { background-position:0 0; } }
.wc-sub { margin:0 auto 16px; max-width:36ch; font-size:13px; line-height:1.5; color:var(--muted); }
.wc-steps { list-style:none; margin:0 0 12px; padding:0; display:grid; gap:8px; text-align:left; }
.wc-steps li { animation:cardRise .45s var(--ease-out) both; } /* fill both: trước giờ hiện vẫn ẩn theo khung đầu */
.wc-steps li:nth-child(1) { animation-delay:.38s; } .wc-steps li:nth-child(2) { animation-delay:.47s; } .wc-steps li:nth-child(3) { animation-delay:.56s; }
.wc-steps button { width:100%; display:flex; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--soft); color:var(--ink); font:inherit; text-align:left; cursor:pointer;
  transition:border-color .18s ease, transform .18s var(--ease-out), background-color .18s ease; }
.wc-steps button:hover { border-color:var(--pick); transform:translateY(-1px); background:color-mix(in srgb, var(--pick) 8%, var(--soft)); }
.wc-steps button:focus-visible { outline:2px solid var(--pick); outline-offset:2px; }
.wc-n { flex:0 0 auto; width:28px; height:28px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:13px; color:var(--onpick, #04201c);
  background:linear-gradient(135deg, var(--pick), color-mix(in srgb, var(--pick) 60%, var(--t-gold))); }
.wc-s { display:grid; gap:2px; min-width:0; }
.wc-s b { font-size:14px; } .wc-s small { font-size:12px; color:var(--muted); line-height:1.4; }
.wc-badge { display:flex; flex-wrap:wrap; gap:6px 8px; align-items:center; justify-content:center; margin:4px 0 0; font-size:12px; color:var(--muted); animation:wcPop .5s .75s cubic-bezier(.2, 1.6, .4, 1) both; }
.wc-badge[hidden] { display:none; }
.wc-badge .tier { font-size:12px; box-shadow:0 0 14px color-mix(in srgb, var(--t-special) 45%, transparent); }
.wc-go { margin-top:16px; border-radius:12px; min-height:48px; font-size:16px; background:linear-gradient(135deg, var(--pick), color-mix(in srgb, var(--pick) 70%, #000));
  box-shadow:0 8px 24px color-mix(in srgb, var(--pick) 35%, transparent); animation:cardRise .45s .66s var(--ease-out) both; }
/* Màn thấp (điện thoại nhỏ, laptop thấp): thu logo, chữ, khoảng cách để nút Vào chơi không phải cuộn mới thấy. */
@media (max-height: 720px) {
  .wc { padding:20px 18px 16px; } .wc-logo { width:64px; height:64px; margin-bottom:8px; } .wc-logo .logo-mark.big { width:44px; height:44px; }
  .wc-t { font-size:20px; } .wc-sub { margin-bottom:12px; font-size:12px; } .wc-steps { gap:6px; } .wc-steps button { padding:8px 10px; } .wc-n { width:24px; height:24px; font-size:12px; }
  .wc-go { margin-top:12px; min-height:44px; }
}
.wc-confetti { position:fixed; inset:0; z-index:62; pointer-events:none; overflow:hidden; }
.wc-confetti i { position:absolute; display:block; border-radius:2px; will-change:transform, opacity; }
.wc-confetti i.dot { border-radius:50%; }
@media (prefers-reduced-motion: reduce) {
  .wc, .wc-bd, .wc-logo::before, .wc-logo .logo-mark, .wc-steps li, .wc-badge, .wc-go, .wc-glow { animation:none !important; }
  .wc { animation:wcFade .2s ease both !important; }
  .wc-t { animation:none; background:none; color:var(--ink); }
}

/* ---------- 23/10 (kiểm giao diện; màu nút Mua, Bán ở khối --buy-fill phía trên) ---------- */
/* Mục 3: dòng giờ khớp lệnh chỉ ở Thị trường và Lệnh chờ (trước: mọi mục trừ Trading, điện thoại cao 162px). Tóm tắt một câu có mũi tên,
   mở bằng chuột, chạm hoặc phím (details); phần Mỹ, vàng, khớp một lần mỗi ngày nằm trong. */
body:not([data-tab="market"]) #session-note { display:none; }
body[data-tab="portfolio"][data-sub="orders"] #session-note { display:block; }
#session-note { padding:0 16px; }
#session-note > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:10px; min-height:44px; padding:6px 0; box-sizing:border-box; }
#session-note > summary::-webkit-details-marker { display:none; }
#session-note > summary::after { content:""; flex:0 0 auto; width:7px; height:7px; margin:0 4px 3px auto; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); transition:transform .2s; }
#session-note[open] > summary::after { transform:rotate(-135deg); margin-bottom:-3px; }
#session-note > p { margin:0 0 8px; color:var(--muted); }
@media (min-width: 1024px) { #session-note > summary { min-height:32px; padding:4px 0; } }
/* Máy tính màn Thị trường là lưới vừa một màn: phần Chi tiết nổi đè lên lưới, không đẩy lưới xuống (dưới 1024px và mục Lệnh chờ thì nằm trong dòng). */
@media (min-width: 1024px) {
  body[data-tab="market"] #session-note { position:relative; z-index:6; }
  body[data-tab="market"] #session-note > p { position:absolute; top:100%; left:16px; right:16px; margin:0; padding:10px 14px; background:var(--card); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); }
}
/* Mục 8: điện thoại, đầu trang một dòng (trước 76px vì nút "i" rớt xuống dòng hai) và vùng chạm 44px. Dưới 700px nút "i" vào Menu
   (như nút ngôn ngữ từ v0.8), nút Menu chỉ còn biểu tượng; dưới 360px bỏ hình logo, giữ tên game. */
.menu .menu-info, #menu-btn .menu-ico { display:none; }
@media (max-width: 699px) {
  .top .info-btn { display:none; }
  .menu .menu-info { display:block; }
  .brand { flex-wrap:nowrap; }
  .top .who { gap:4px; }
  .top .bell, #menu-btn { width:44px; height:44px; padding:0; }
  #menu-btn { display:inline-grid; place-items:center; }
  #menu-btn .menu-ico { display:block; }
  #menu-btn .menu-t { display:none; }
  .top .pf-av-btn { min-width:44px; min-height:44px; justify-content:center; }
}
@media (max-width: 359px) { .top { padding:10px 12px; gap:8px; } .brand .logo-mark { display:none; } }
/* Ô "Chi tiết" (summary) chỉ cao 20px: vùng chạm 44px, bố cục giữ nguyên (đệm và lề âm bằng nhau; chữ bên dưới vẽ sau nên vẫn bấm được). */
.r-more > summary { padding:12px 0; margin:-12px 0; }
/* Mục 9: hướng dẫn dưới biểu đồ Trading nằm trong Chi tiết (trước: máy tính cắt một dòng có dấu ba chấm). Điện thoại thêm đệm cho vùng chạm. */
.t-how > summary { cursor:pointer; width:max-content; max-width:100%; }
.t-how > p { margin:4px 0 0; }
@media (max-width: 1023px) { .t-how > summary { padding:10px 0; } }
/* Máy tính: cột biểu đồ Trading cao cố định (v0.9), hướng dẫn mở ra nổi đè lên đáy biểu đồ thay vì đẩy dòng nguồn ra khỏi khung. */
@media (min-width: 1024px) {
  .tr-chart .t-how { position:relative; z-index:3; }
  .tr-chart .t-how > p { position:absolute; left:0; right:0; bottom:calc(100% + 6px); margin:0; padding:10px 14px; background:var(--card); color:var(--ink); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); white-space:normal; }
}

/* v0.13: thẻ tổng kết mùa ở đầu mục Xếp hạng */
.season-sum { margin:0 0 12px; }
.season-sum table.cmp { margin:8px 0; }
.season-sum details summary { cursor:pointer; min-height:44px; display:flex; align-items:center; }
.season-sum details summary { font-size:14px; font-weight:600; }
.season-sum .rank-mini li.grp { display:block; font-size:13px; margin-top:4px; }
.chip.ca { background:var(--m-rights); color:#1a1408; }
#journal li.auto { border-left:3px solid var(--m-rights); padding-left:10px; }

/* ---------- Rank (Beta) (24/10/2026): huy hiệu bậc, bảng Rank, thẻ ở Hồ sơ,
   Lịch sử điểm, thẻ nhỏ ở Danh mục, thẻ luật. Rank tắt thì không phần tử nào dưới đây hiện. ---------- */
/* Màu huy hiệu theo khóa color của bậc (season.json rank.tiers): sắt, đồng, bạc, vàng, bạch kim, kim cương, lục bảo, ghế (Cá mập, Phù thủy thị trường).
   Nền sáng dùng sắc đậm để chữ 12px đủ tương phản trên nền trắng; nền tối dùng sắc sáng. */
:root[data-theme] { --rk-iron:#57534e; --rk-bronze:#a0622d; --rk-silver:#64748b; --rk-gold:#8a6400; --rk-platinum:#0e7490; --rk-diamond:#6d28d9; --rk-emerald:#047857; --rk-seat:#a21caf; }
:root[data-theme="dark"] { --rk-iron:#a8a29e; --rk-bronze:#d8955a; --rk-silver:#cbd5e1; --rk-gold:#facc15; --rk-platinum:#67e8f9; --rk-diamond:#c4b5fd; --rk-emerald:#6ee7b7; --rk-seat:#f0abfc; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --rk-iron:#a8a29e; --rk-bronze:#d8955a; --rk-silver:#cbd5e1; --rk-gold:#facc15; --rk-platinum:#67e8f9; --rk-diamond:#c4b5fd; --rk-emerald:#6ee7b7; --rk-seat:#f0abfc; } }
/* Huy hiệu: một dòng, không cắt; hình thoi nhỏ màu bậc ở đầu. Chưa đạt (đang định hạng): xám, viền đứt. */
.rk-badge { --rkc:var(--rk-iron); display:inline-flex; align-items:center; gap:6px; flex:0 0 auto; white-space:nowrap; font-size:12px; font-weight:700; line-height:1.5; padding:1px 9px 1px 8px;
  border-radius:999px; border:1px solid var(--rkc); color:var(--rkc); background:color-mix(in srgb, var(--rkc) 10%, transparent); font-variant-numeric:tabular-nums; }
.rk-badge::before { content:""; flex:0 0 auto; width:7px; height:7px; border-radius:1px; transform:rotate(45deg); background:var(--rkc); }
.rk-c-bronze { --rkc:var(--rk-bronze); } .rk-c-silver { --rkc:var(--rk-silver); } .rk-c-gold { --rkc:var(--rk-gold); } .rk-c-platinum { --rkc:var(--rk-platinum); }
.rk-c-diamond { --rkc:var(--rk-diamond); } .rk-c-emerald { --rkc:var(--rk-emerald); } .rk-c-seat { --rkc:var(--rk-seat); }
.rk-badge.rk-c-seat { background:color-mix(in srgb, var(--rkc) 18%, transparent); box-shadow:0 0 12px color-mix(in srgb, var(--rkc) 30%, transparent); }
.rk-badge.rk-wait { --rkc:var(--muted); border-style:dashed; background:transparent; font-weight:600; }
.rk-badge.rk-wait::before { display:none; }
.rk-fl { font-size:12px; color:var(--muted); font-weight:600; letter-spacing:.02em; white-space:nowrap; }
.rk-fl .chip-sim { margin-left:6px; vertical-align:1px; }
/* Nút ẩn (Rank khi tắt, Bảng Trading ở luồng Đầu tư, bốn bảng cũ ở luồng Trading) không để lại vạch ngăn: vạch chỉ đứng sau một nút đang hiện. */
.rank-seg button + button { border-left:0; }
.rank-seg button:not([hidden]) ~ button { border-left:1px solid var(--line); }
/* Bảng Rank: ghế ở đầu có viền màu ghế; nhóm cuối Đang định hạng không có số hạng. */
table.rank tr.rk-seatrow td { background:color-mix(in srgb, var(--rk-seat) 7%, transparent); border-top:1px solid color-mix(in srgb, var(--rk-seat) 55%, var(--line)); border-bottom:1px solid color-mix(in srgb, var(--rk-seat) 55%, var(--line)); }
table.rank tr.rk-seatrow td:first-child { box-shadow:inset 3px 0 0 var(--rk-seat); }
table.rank tr.rk-grp td { padding-top:14px; font-size:12px; font-weight:600; color:var(--muted); }
table.rank td.rk-nm { overflow-wrap:anywhere; }
/* Hồ sơ: mỗi luồng một thẻ (dòng luồng và điểm; huy hiệu và nút Lịch sử điểm; thanh tiến độ), máy tính bảng hai thẻ cạnh nhau. */
.rk-sec { margin:0 0 16px; }
.rk-sec h3 { margin:0 0 8px; }
.rk-cards { display:grid; gap:8px; }
@media (min-width: 560px) and (max-width: 1023px) { .rk-cards { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.rk-card { display:grid; gap:8px; align-content:start; }
.rk-card p { margin:0; }
.rk-top, .rk-row { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.rk-pts { font-size:18px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.rk-card .ach-pr { margin-top:0; }
.rk-prov { color:var(--ink); font-variant-numeric:tabular-nums; }
.rk-hk { margin:12px 0 6px; font-size:12px; color:var(--muted); font-weight:600; }
.rk-hist { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.rk-hist li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; font-size:13px; }
.rk-hf { display:inline-flex; align-items:center; gap:6px; }
/* Hồ sơ người khác: hai dòng luồng, huy hiệu, điểm. */
.rk-other { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.rk-other li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; font-size:14px; }
.rk-other .rk-fl { min-width:76px; }
.rk-other .num { margin-left:auto; }
/* Lịch sử điểm (hộp #pp): vạch trái xanh khi cộng, đỏ khi trừ; dòng tạm tính viền đứt. */
.rk-log li { padding:8px 12px; border-left:3px solid var(--line); }
.rk-log li.rk-up { border-left-color:var(--up); } .rk-log li.rk-down { border-left-color:var(--down); }
.rk-log li.rk-pv { border-style:dashed; border-left-style:solid; border-left-color:var(--pick); }
.rk-lt { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
/* Thẻ xếp hạng nhỏ ở Danh mục. */
.rk-mv { display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; margin-top:4px; }
.rk-mv b { font-size:20px; font-variant-numeric:tabular-nums; }
/* Thẻ luật: bốn dòng, Chi tiết có hai bảng ví dụ (cạnh nhau khi đủ chỗ), bảng điểm kỷ luật. */
.rk-rules .rk-rl { margin:4px 0 0; font-size:13px; line-height:1.5; }
.r-more .rk-dh { margin-top:14px; font-weight:700; color:var(--ink); }
.rk-rules .cmp-wrap { margin-top:6px; }
.rk-rules table.cmp { font-size:13px; }
.rk-ex { display:grid; gap:8px; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); }
/* Task 8 sửa vòng 1: cột Luồng và cột Điểm co theo chữ, một dòng (trước đây cột cố định 52px làm chữ Điểm xuống dòng ở khoảng 800px);
   cột chữ dài nhận phần còn lại và xuống dòng, nên bảng không rộng hơn thẻ ở 375px. */
table.rk-ext, table.rk-disc { table-layout:auto; }
table.rk-ext thead th, table.rk-disc thead th { white-space:normal; }
table.rk-ext thead th:first-child { width:auto; }
table.rk-ext .num, table.rk-disc th:last-child, table.rk-disc td:last-child { width:1%; white-space:nowrap; text-align:right; }
table.rk-disc thead th:first-child, table.rk-disc td:first-child { width:1%; white-space:nowrap; }
/* P14 (v0.19): hộp thông tin doanh nghiệp. Máy tính: thẻ giữa màn; điện thoại: tấm từ dưới lên, cuộn riêng. */
.co-open[hidden] { display:none !important; }
.co-open .sh { display:none; }
@media (max-width: 479px) { .co-open .lg { display:none; } .co-open .sh { display:inline; } }
@media (max-width: 359px) { .mk-chart .chart-head { flex-wrap:wrap; } }
.codlg { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center; padding:16px; background:color-mix(in srgb, var(--bg) 70%, transparent); }
.codlg[hidden] { display:none; }
.codlg-card { width:min(640px, 100%); max-height:min(88vh, 760px); display:flex; flex-direction:column; background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,.35); }
.codlg-h { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; border-bottom:1px solid var(--line); font-size:15px; }
.codlg-h b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.codlg-body { overflow-y:auto; padding:12px 14px 14px; -webkit-overflow-scrolling:touch; }
.codlg-body p { margin:8px 0 0; }
.co-name { font-weight:600; margin-top:0 !important; }
.co-leg { display:flex; align-items:center; flex-wrap:wrap; gap:4px 6px; color:var(--muted); }
.co-k { display:inline-block; width:10px; height:10px; border-radius:2px; }
.co-k.co-rev { background:var(--pick); } .co-k.co-ni { background:var(--up, #22c55e); }
.co-bars { display:block; width:100%; height:auto; max-height:180px; margin-top:6px; }
.co-bars .co-rev { fill:var(--pick); opacity:.85; }
.co-bars .co-ni { fill:var(--up, #22c55e); } .co-bars .co-ni.down { fill:var(--down, #ef4444); }
.co-bars .co-zero { stroke:var(--line); stroke-width:1; }
.co-bars .co-x { fill:var(--muted); font-size:10px; font-variant-numeric:tabular-nums; }
.co-tab { width:100%; border-collapse:collapse; margin-top:8px; font-size:13px; font-variant-numeric:tabular-nums; }
.co-tab th, .co-tab td { padding:6px 6px; border-bottom:1px solid var(--line); white-space:nowrap; text-align:left; }
.co-tab .num { text-align:right; }
.co-pe { margin-top:10px !important; font-size:14px; }
.co-src { margin-top:10px; font-size:13px; } .co-src summary { cursor:pointer; color:var(--pick); font-weight:600; }
.co-src a { word-break:break-all; }
body.codlg-open { overflow:hidden; }
@media (max-width: 640px) { .codlg { align-items:flex-end; padding:0; } .codlg-card { max-height:88vh; border-radius:12px 12px 0 0; padding-bottom:env(safe-area-inset-bottom, 0px); }
  .codlg-body { padding:10px 10px 12px; } .co-tab { font-size:12px; } .co-tab th, .co-tab td { padding:6px 3px; } .co-tab th { white-space:normal; vertical-align:bottom; } }

/* ===================== v0.21 (29/10/2026): giao diện mới =====================
   Phông Be Vietnam Pro tự lưu trong site (fonts/, giấy phép SIL OFL 1.1 ở fonts/OFL.txt): CSP giữ nguyên default-src 'self'.
   Nền động bg.js, chuyển động fx.js. Giảm chuyển động: tắt hết hoạt cảnh ở cuối khối này. */
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:400; font-display:swap; src:url("./fonts/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2"); unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:400; font-display:swap; src:url("./fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:500; font-display:swap; src:url("./fonts/be-vietnam-pro-vietnamese-500-normal.woff2") format("woff2"); unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:500; font-display:swap; src:url("./fonts/be-vietnam-pro-latin-500-normal.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:600; font-display:swap; src:url("./fonts/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2"); unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:600; font-display:swap; src:url("./fonts/be-vietnam-pro-latin-600-normal.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:700; font-display:swap; src:url("./fonts/be-vietnam-pro-vietnamese-700-normal.woff2") format("woff2"); unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:700; font-display:swap; src:url("./fonts/be-vietnam-pro-latin-700-normal.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:800; font-display:swap; src:url("./fonts/be-vietnam-pro-vietnamese-800-normal.woff2") format("woff2"); unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family:"Be Vietnam Pro"; font-style:normal; font-weight:800; font-display:swap; src:url("./fonts/be-vietnam-pro-latin-800-normal.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
body { font-family:"Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
:root { --spr:cubic-bezier(.34, 1.5, .64, 1); --ease-in:cubic-bezier(.55, 0, .75, .25);
  --surf:rgba(255,255,255,.78); }
:root[data-theme="dark"] { --surf:rgba(16,24,36,.8); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --surf:rgba(16,24,36,.8); } }

/* ---------- nền động (bg.js) ---------- */
/* v0.22: cao theo màn lớn nhất (100lvh, thanh địa chỉ đã ẩn), không theo khung đang thấy: điện thoại lướt làm thanh địa chỉ ẩn hiện mà canvas không đổi cỡ
   (đổi cỡ là xóa trắng canvas: lỗi chớp nền khi lướt của v0.21). Trình duyệt chưa có lvh dùng 100vh (cũng là màn lớn nhất trên điện thoại). */
#bgfx { position:fixed; left:0; top:0; width:100%; height:100vh; height:100lvh; z-index:-1; display:block; pointer-events:none; }
html.bgfx body.is-auth::before, html.bgfx body.is-auth::after { display:none; }
/* Thanh đầu và thanh mục dưới (điện thoại) thành kính mờ để nền lộ ra. */
html.bgfx .top, html.bgfx #app > .tabs { background:color-mix(in srgb, var(--bg) 66%, transparent); -webkit-backdrop-filter:blur(16px) saturate(1.3); backdrop-filter:blur(16px) saturate(1.3); }
/* v0.22: máy chạm bỏ làm mờ dưới hai thanh này (làm mờ lại mỗi khung khi lướt là phần nặng nhất trên điện thoại), dùng nền gần đặc. */
@media (pointer: coarse) {
  html.bgfx .top, html.bgfx #app > .tabs { -webkit-backdrop-filter:none; backdrop-filter:none; background:color-mix(in srgb, var(--bg) 94%, transparent); }
}
/* Máy có chuột: các thẻ lớn hơi trong suốt (chữ, số vẫn trên nền đặc 78 đến 80%). Ô nhỏ lặp lại (thành tích, luật, ô số Trading) giữ nền đặc.
   Điện thoại giữ thẻ đặc cho nhẹ máy.
   v0.22.2: KHÔNG làm mờ nền theo thời gian thực (backdrop-filter) ở các khung này. Mỗi khung nền động mới bắt trình duyệt làm mờ lại mọi khung
   kính phía trên; đo ở máy thử 2048x1100: Danh mục, Thị trường, Trading còn khoảng 12 khung mỗi giây, bỏ làm mờ ở đây thì đủ 60
   khung mỗi giây. Nền phía sau vốn mềm nên kính đục nhìn gần như kính mờ. Kính thật chỉ còn ở thanh đầu và mặt bục Xếp hạng (diện tích nhỏ). */
@media (hover: hover) and (pointer: fine) {
  html.bgfx .card, html.bgfx .cmp-wrap,
  html.bgfx .mk-list, html.bgfx .mk-chart, html.bgfx .mk-strip, html.bgfx body[data-tab="market"] #p-order,
  html.bgfx .tr-list, html.bgfx .tr-chart, html.bgfx .tr-strip, html.bgfx body[data-tab="trade"] #p-torder {
    background:var(--surf); }
}
/* v0.22.2: màn đăng nhập có nền động thì ô số và dải chữ chạy không làm mờ nền (dải chữ còn có mặt nạ và chữ chạy, làm mờ lại mỗi khung rất tốn);
   khung đăng nhập giữ kính thật. */
html.bgfx .hero-facts li, html.bgfx .hero-ticker { -webkit-backdrop-filter:none; backdrop-filter:none; }

/* ---------- intro (fx.js) ---------- */
.intro { position:fixed; inset:0; z-index:200; display:grid; place-items:center; background:var(--bg); cursor:pointer; }
.intro[hidden] { display:none; }
html.intro-on, html.intro-on body { overflow:hidden; }
.intro-core { display:grid; justify-items:center; gap:20px; }
.intro-logo { width:120px; height:120px; overflow:visible; }
.intro-logo path { fill:none; stroke-linejoin:round; stroke-linecap:round; stroke-dasharray:100; stroke-dashoffset:100; }
.intro-logo .p0 { stroke:color-mix(in srgb, var(--ink) 35%, transparent); stroke-width:.8; animation:fxDash .9s var(--ease-out) forwards .05s; }
.intro-logo .p1 { stroke:var(--ink); stroke-width:1.6; animation:fxDash .9s var(--ease-out) forwards .25s; }
.intro-logo .p2 { stroke:var(--ink); stroke-width:1.6; animation:fxDash .5s var(--ease-out) forwards .6s; }
.intro-logo .p3 { stroke:var(--pick); stroke-width:2.2; animation:fxDash .7s var(--ease-out) forwards .78s; filter:drop-shadow(0 0 4px var(--pick)); }
.intro-word { min-height:1.1em; font-size:clamp(32px, 7vw, 46px); font-weight:800; letter-spacing:-.035em; line-height:1.1; color:var(--ink); animation:fxWord .8s var(--ease-out) backwards .8s; }
.intro-line { display:block; width:200px; height:2px; border-radius:2px; background:linear-gradient(90deg, transparent, var(--pick), transparent); transform:scaleX(0); animation:fxLine .8s var(--ease-out) forwards 1.05s; }
.intro-skip { position:absolute; right:20px; bottom:calc(20px + env(safe-area-inset-bottom, 0px)); min-height:40px; padding:6px 16px; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--muted); font-weight:600; }
.intro-skip:hover, .intro-skip:focus-visible { color:var(--ink); border-color:var(--pick); }
.intro.out { animation:fxIntroOut .65s var(--ease-in) forwards; pointer-events:none; }
.intro.out-fast { animation:fxFade .26s ease forwards; pointer-events:none; }
@keyframes fxDash { to { stroke-dashoffset:0; } }
@keyframes fxWord { from { opacity:0; transform:translateY(40%); filter:blur(6px); clip-path:inset(0 0 100% 0); } }
@keyframes fxLine { to { transform:scaleX(1); } }
@keyframes fxIntroOut { to { opacity:0; transform:scale(1.3); filter:blur(14px); } }
@keyframes fxFade { to { opacity:0; } }

/* ---------- màn đăng nhập: hiện lần lượt, chờ intro (--b), khung nghiêng theo chuột ---------- */
.auth.fx-in .hero-mark { animation:fxUp .8s var(--ease-out) backwards var(--b, 0ms); }
.auth.fx-in .hero-kicker { animation:fxUp .8s var(--ease-out) backwards calc(var(--b, 0ms) + 80ms); }
.auth.fx-in .hero-name { animation:fxClip 1s var(--ease-out) backwards calc(var(--b, 0ms) + 150ms); }
.auth.fx-in .hero-sub { animation:fxUp .8s var(--ease-out) backwards calc(var(--b, 0ms) + 260ms); }
.auth.fx-in .hero-tag { animation:fxUp .8s var(--ease-out) backwards calc(var(--b, 0ms) + 320ms); }
.auth.fx-in .hero-facts li { animation:fxUp .8s var(--ease-out) backwards calc(var(--b, 0ms) + 400ms); }
.auth.fx-in .hero-facts li:nth-child(2) { animation-delay:calc(var(--b, 0ms) + 470ms); }
.auth.fx-in .hero-facts li:nth-child(3) { animation-delay:calc(var(--b, 0ms) + 540ms); }
.auth.fx-in .hero-facts li:nth-child(4) { animation-delay:calc(var(--b, 0ms) + 610ms); }
.auth.fx-in .hero-ticker { animation:fxSlide 1s var(--ease-out) backwards calc(var(--b, 0ms) + 650ms); }
.auth.fx-in .tick-note { animation:fxUp .8s var(--ease-out) backwards calc(var(--b, 0ms) + 760ms); }
.auth.fx-in .auth-card { animation:fxCard 1s var(--ease-out) backwards calc(var(--b, 0ms) + 220ms); }
.auth.fx-in .auth-card.shake { animation:shake .35s; }
.auth.fx-now *, .auth.fx-now .auth-card { animation-delay:0ms !important; }
@keyframes fxUp { from { opacity:0; transform:translateY(18px); filter:blur(8px); } }
@keyframes fxClip { from { opacity:0; transform:translateY(30%); clip-path:inset(0 0 100% 0); } }
@keyframes fxSlide { from { opacity:0; transform:translateX(60px); filter:blur(8px); } }
@keyframes fxCard { from { opacity:0; transform:perspective(1000px) translateY(46px) rotateX(10deg) scale(.96); filter:blur(10px); } }
.hero-facts b { white-space:nowrap; letter-spacing:-.01em; }
@media (min-width: 960px) { .hero-facts b { font-size:14px; } }
/* Be Vietnam Pro rộng hơn phông hệ thống: dưới 441px tên game 16px, không xuống dòng, để đầu trang vẫn một dòng. */
@media (max-width: 440px) { .brand .name { font-size:16px; letter-spacing:-.01em; white-space:nowrap; } }
/* 441 đến 699px: tên game không xuống dòng; dòng phụ cạnh tên ẩn dưới 640px, từ 640px nếu chật thì cắt bằng dấu ba chấm, không đẩy đầu trang thành hai dòng. */
@media (max-width: 699px) {
  .brand { flex-wrap:nowrap; } .brand .name { white-space:nowrap; flex-shrink:0; }
  .brand .sub-brand { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
}
@media (max-width: 639px) { .brand .sub-brand { display:none; } }
/* Nút hành động trong thẻ Danh mục: cùng cỡ chữ, chiều cao với các nút khác (phông mới rộng hơn, chữ 16px thành nút quá nặng). */
.td-acts button, .goal-btns button, .goal-card > button { display:inline-flex; align-items:center; justify-content:center; padding:0 16px; font-size:14px; }
@media (hover: hover) and (pointer: fine) {
  .auth-card::after { z-index:-1; } /* vệt sáng nằm dưới ô nhập, không phủ lên chữ */
  .auth-card { transform:perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition:transform .5s var(--ease-out); }
  .auth-card::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
    background:radial-gradient(380px circle at var(--sx, 50%) var(--sy, -20%), color-mix(in srgb, var(--ink) 7%, transparent), transparent 60%); }
}

/* ---------- vào game: thanh đầu trượt xuống, nội dung nổi lên; ảnh đại diện nảy khi khung đăng nhập bay tới ---------- */
body.fx-app .top { animation:fxTop .7s var(--ease-out) backwards; }
body.fx-app #app > .tabs { animation:fxTabs .7s var(--ease-out) backwards .1s; }
body.fx-app #app .grid { animation:fxRise .8s var(--ease-out) backwards .2s; }
@keyframes fxTop { from { opacity:0; transform:translateY(-100%); } }
@keyframes fxTabs { from { opacity:0; transform:translateY(100%); } }
@keyframes fxRise { from { opacity:0; transform:translateY(24px) scale(.985); filter:blur(8px); } }
.pf-av-btn.fx-pop .pf-av { animation:fxPop .7s var(--spr); }
.pf-av-btn.fx-pop .pf-av::after { content:""; position:absolute; inset:-5px; border-radius:50%; border:2px solid var(--pick); animation:fxRing .9s var(--ease-out) forwards; pointer-events:none; }
@keyframes fxPop { 0% { transform:scale(.6); } 60% { transform:scale(1.12); } }
@keyframes fxRing { from { opacity:.9; transform:scale(.8); } to { opacity:0; transform:scale(1.9); } }
.fx-ghost { position:fixed; z-index:90; pointer-events:none; border:1px solid color-mix(in srgb, var(--pick) 55%, var(--line)); border-radius:18px; background:var(--glass);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); box-shadow:0 0 44px -6px color-mix(in srgb, var(--pick) 60%, transparent); transform-origin:50% 50%; }
.fx-ghost.fx-shut { border-color:var(--line); box-shadow:var(--shadow); }

/* ---------- đổi mục: mờ dần vào theo hướng; Hồ sơ lan vòng tròn từ ảnh đại diện ---------- */
/* Nội dung trượt ngang lúc vào không làm trang có thanh cuộn ngang thoáng qua. */
#app { overflow-x:clip; }
#app .grid.fx-r { animation:fxInR .42s var(--ease-out) backwards; }
#app .grid.fx-l { animation:fxInL .42s var(--ease-out) backwards; }
#app .grid.fx-c { animation:fxCirc .75s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes fxInR { from { opacity:0; transform:translateX(28px); filter:blur(6px); } }
@keyframes fxInL { from { opacity:0; transform:translateX(-28px); filter:blur(6px); } }
/* Điện thoại: bỏ làm mờ (filter) khi nội dung vào, chỉ trượt và hiện dần cho nhẹ máy. */
@media (pointer: coarse) {
  #app .grid.fx-r { animation-name:fxInRm; } #app .grid.fx-l { animation-name:fxInLm; } body.fx-app #app .grid { animation-name:fxRiseM; }
}
@keyframes fxInRm { from { opacity:0; transform:translateX(28px); } }
@keyframes fxInLm { from { opacity:0; transform:translateX(-28px); } }
@keyframes fxRiseM { from { opacity:0; transform:translateY(24px); } }
@keyframes fxCirc { from { clip-path:circle(0px at var(--cx) var(--cy)); } to { clip-path:circle(150% at var(--cx) var(--cy)); } }


/* ---------- bảng thông báo dưới chuông (notify.js) ---------- */
.bell[aria-expanded="true"] { border-color:var(--pick); color:var(--pick); background:color-mix(in srgb, var(--pick) 14%, var(--card)); }
.notif-pop { position:fixed; z-index:36; top:calc(var(--toph, 60px) + 6px); right:12px; width:min(380px, calc(100vw - 24px)); max-height:min(72vh, 560px); overflow:auto; overscroll-behavior:contain;
  padding:8px; border:1px solid var(--line); border-radius:14px; background:var(--card); box-shadow:var(--shadow); } /* nền đặc: kính mờ không làm mờ được nội dung dưới thanh đầu */
.notif-pop[hidden] { display:none; }
.np-h { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 8px 8px; }
.np-h b { font-size:15px; }
.np-list { list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.np-it { display:grid; gap:2px; padding:10px; border-radius:10px; }
.np-it.new { background:color-mix(in srgb, var(--pick) 9%, transparent); }
.np-t { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.np-t b { font-size:14px; }
.np-it p { margin:0; }
.np-f { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:28px; }
.np-f .link { min-height:30px; padding:2px 12px; }
.np-empty { padding:16px 10px; }
.np-all { display:block; width:100%; margin-top:6px; }

/* ---------- đầu trang: mọi nút cao 40px (điện thoại 44px, luật ở mục điện thoại phía trên) ---------- */
.lang-q.bell { width:40px; height:40px; }

/* ---------- Trading: công cụ vẽ thành biểu tượng, tách khỏi khung giờ ---------- */
/* Dưới 1024px: nút Vẽ nổi ở góc trên trái biểu đồ; bấm thì khay biểu tượng mở ngay dưới biểu đồ (không che vùng nến, cách xa hàng khung giờ). */
.t-cbox { position:relative; display:flex; flex-direction:column; isolation:isolate; } /* nút Vẽ, nút + đặt lệnh không nổi lên trên thanh đầu, bảng thông báo */
.t-cbox > .tchart { order:1; }
.t-cbox > .t-draw { order:2; }
.t-draw { display:none; }
.t-draw button { position:relative; display:grid; place-items:center; flex:0 0 auto; width:40px; height:40px; min-height:0; padding:0; border:0; border-radius:50%; background:none; color:var(--muted);
  transition:background .2s, color .2s, box-shadow .2s, transform .15s var(--ease-out); }
.t-draw button svg path { fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.t-draw button:hover:not(:disabled), .t-draw button:focus-visible { color:var(--ink); background:color-mix(in srgb, var(--ink) 7%, transparent); }
.t-draw button:active:not(:disabled) { transform:scale(.92); }
.t-draw button[aria-pressed="true"] { color:var(--tpick); background:color-mix(in srgb, var(--tpick) 16%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--tpick) 55%, transparent), 0 0 16px -4px color-mix(in srgb, var(--tpick) 70%, transparent); }
.t-draw button:disabled { opacity:.35; cursor:default; }
.t-draw button.arm { color:var(--down); background:color-mix(in srgb, var(--down) 16%, transparent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--down) 55%, transparent); animation:fxShake .4s; }
@keyframes fxShake { 25% { transform:translateX(-2px); } 75% { transform:translateX(2px); } }
.t-draw .dr-sep { flex:0 0 auto; display:block; width:1px; height:22px; margin:0 3px; background:var(--line); }
.t-draw .dr-tip { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.t-drawfab { position:absolute; top:8px; left:8px; z-index:6; display:grid; place-items:center; width:40px; height:40px; min-height:0; padding:0; border:1px solid color-mix(in srgb, var(--tpick) 45%, var(--line)); border-radius:50%;
  background:color-mix(in srgb, var(--card) 92%, transparent); color:var(--tpick); box-shadow:var(--shadow); transition:opacity .2s, transform .3s var(--spr); }
.t-drawfab:active { transform:scale(.9); }
.t-drawn { position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:var(--tpick); color:#fff; font-size:11px; font-weight:800; line-height:18px; text-align:center; }
.t-drawn[hidden] { display:none; }
.t-cbox.tray .t-drawfab { opacity:0; visibility:hidden; transform:scale(.4) rotate(-45deg); pointer-events:none; transition:opacity .2s, transform .3s var(--spr), visibility 0s .3s; }
.t-cbox.tray .t-draw { display:flex; align-self:flex-start; align-items:center; gap:2px; max-width:100%; margin-top:8px; overflow-x:auto; scrollbar-width:none; padding:4px; border-radius:999px;
  border:1px solid color-mix(in srgb, var(--tpick) 40%, var(--line)); background:color-mix(in srgb, var(--card) 95%, transparent); box-shadow:var(--shadow); transform-origin:22px 50%; animation:fxTray .4s var(--ease-out) both; }
@keyframes fxTray { from { opacity:0; transform:scaleX(.15); } }
.t-cbox.tray .t-draw button { animation:fxTb .4s var(--ease-out) backwards; }
.t-cbox.tray .t-draw button:nth-child(3) { animation-delay:.03s; } .t-cbox.tray .t-draw button:nth-child(4) { animation-delay:.06s; } .t-cbox.tray .t-draw button:nth-child(5) { animation-delay:.09s; }
.t-cbox.tray .t-draw button:nth-child(6) { animation-delay:.12s; } .t-cbox.tray .t-draw button:nth-child(8) { animation-delay:.15s; } .t-cbox.tray .t-draw button:nth-child(9) { animation-delay:.18s; }
@keyframes fxTb { from { opacity:0; transform:translateX(-10px) scale(.6); } }
.t-tools .t-tf { flex:1 1 auto; max-width:460px; }
@media (min-width: 1024px) {
  .t-cbox { flex:1 1 auto; min-height:220px; display:grid; grid-template-columns:44px minmax(0, 1fr); grid-template-rows:minmax(0, 1fr); gap:8px; margin-top:8px; }
  .t-drawfab { display:none; }
  .t-cbox > .t-draw { order:0; }
  .t-draw, .t-cbox.tray .t-draw { position:static; display:flex; flex-direction:column; align-items:center; align-self:start; gap:2px; max-width:none; margin-top:0; overflow:visible; padding:4px 2px;
    border:1px solid var(--line); border-radius:12px; background:color-mix(in srgb, var(--ink) 3%, transparent); box-shadow:none; animation:none; }
  .t-draw .dr-close, .t-draw .dr-close + .dr-sep { display:none; }
  .t-draw .dr-sep { width:22px; height:1px; margin:3px 0; }
  .t-draw button { width:36px; height:36px; border-radius:9px; animation:none !important; }
  .t-draw .dr-tip { left:calc(100% + 10px); top:50%; z-index:8; width:auto; height:auto; overflow:visible; clip-path:none; padding:5px 10px; border:1px solid var(--line); border-radius:8px;
    background:var(--card); color:var(--ink); font-size:12px; font-weight:600; box-shadow:var(--shadow); opacity:0; transform:translate(-4px, -50%); transition:opacity .15s, transform .2s var(--ease-out); pointer-events:none; }
  .t-draw button:hover .dr-tip, .t-draw button:focus-visible .dr-tip, .t-draw button.arm .dr-tip { opacity:1; transform:translate(0, -50%); }
  .t-cbox .tchart { height:auto; min-height:220px; }
  .t-tools .t-tf { max-width:420px; }
}
/* Laptop màn thấp (650 đến 760px): cột vẽ thành hai cột nút 30px (cao khoảng 110px), để biểu đồ được co còn 140px như trước v0.21
   mà chú thích nguồn vẫn nằm trong khung (đo ở 1366x657, 1536x700). */
@media (min-width: 1024px) and (max-height: 760px) {
  .t-cbox { grid-template-columns:68px minmax(0, 1fr); min-height:140px; }
  .t-cbox .tchart { min-height:140px; }
  .t-draw, .t-cbox.tray .t-draw { display:grid; grid-template-columns:repeat(2, 30px); justify-content:center; align-content:start; gap:2px; padding:4px; }
  .t-draw button { width:30px; height:30px; }
  .t-draw button svg { width:18px; height:18px; }
  .t-draw .dr-sep { grid-column:1 / -1; justify-self:center; width:48px; margin:2px 0; }
}
/* Điện thoại hẹp (dưới 360px): khay vẽ dùng nút 36px để vừa bề ngang biểu đồ. */
@media (max-width: 359px) {
  .t-cbox.tray .t-draw { gap:0; padding:3px; }
  .t-cbox.tray .t-draw button { width:36px; height:36px; }
  .t-cbox.tray .t-draw .dr-sep { margin:0 1px; }
}
/* Danh sách mã Trading trên máy tính: nhãn GIẢ LẬP xuống dưới tên khi thiếu chỗ, nút giá gọn để đủ hai cột giá. */
@media (min-width: 1024px) {
  #t-list .tsym { flex-wrap:wrap; gap:2px 6px; }
  #t-list button.mini.qb { min-width:62px; padding:3px 4px; font-size:12px; }
  /* v0.25: dòng tiêu đề nhóm mã (kiểu .board tr.grp) không tô nền khi rê chuột như dòng mã. */
  .tr-list .tboard tbody tr.grp:hover { background:transparent; }
}

/* ---------- Trading: giá là nút vào lệnh (Bán ở giá mua vào, Mua ở giá bán ra) ---------- */
.tboard th.qcell, .tboard td.qcell { text-align:center; padding-left:3px; padding-right:3px; }
button.mini.qb { display:grid; justify-items:center; align-content:center; gap:0; width:100%; min-width:72px; min-height:44px; padding:3px 6px; border-radius:9px; line-height:1.15; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums;
  transition:background .2s, border-color .2s, transform .15s var(--ease-out); }
button.mini.qb small { font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; opacity:.9; }
button.mini.qb.btn-sell { background:color-mix(in srgb, var(--sell-fill) 13%, transparent); border-color:color-mix(in srgb, var(--sell-fill) 55%, transparent); color:var(--down); }
button.mini.qb.btn-buy { background:color-mix(in srgb, var(--buy-fill) 13%, transparent); border-color:color-mix(in srgb, var(--buy-fill) 55%, transparent); color:var(--up); }
button.mini.qb.btn-sell:hover { background:color-mix(in srgb, var(--sell-fill) 24%, transparent); }
button.mini.qb.btn-buy:hover { background:color-mix(in srgb, var(--buy-fill) 24%, transparent); }

/* ---------- v0.22: Xếp hạng thành sân khấu, Danh mục thành bảng số kính (máy tính, dash.js) ---------- */
.rk-stage[hidden], .rk-side[hidden] { display:none !important; }
@media (min-width: 1200px) {
  body[data-tab="rank"] .grid { max-width:1320px; }
  body[data-tab="rank"] #p-rank { display:flex; gap:24px; align-items:flex-start; max-width:none; }
  #p-rank .rk-main { flex:1 1 auto; min-width:0; }
  .rk-side { flex:0 0 320px; position:sticky; top:calc(var(--toph, 53px) + 16px); display:grid; gap:14px; margin-top:52px; }
  /* Bục: hạng 2, 1, 3 từ trái sang; đèn rọi của nền (bg.js) đáp đúng mép trên mỗi bục. */
  .rk-stage { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); align-items:end; gap:22px; min-height:300px; margin:6px 0 20px; padding:30px 28px 0;
    border-bottom:1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
}
/* Laptop thấp (tới 800px chiều cao): sân khấu thấp lại để bảng không bị đẩy xuống quá màn đầu. Màn rộng từ 1700px: sân khấu, cột bên lớn hơn. */
@media (min-width: 1200px) and (max-height: 800px) {
  .rk-stage { min-height:228px; padding-top:16px; }
  .rk-stage .rk-seat { --ph:96px; } .rk-stage .rk-seat.p2 { --ph:68px; } .rk-stage .rk-seat.p3 { --ph:52px; }
  .rk-stage .rk-av { width:50px; height:50px; font-size:20px; } .rk-stage .rk-seat.p1 .rk-av { width:62px; height:62px; font-size:25px; }
  .rk-stage .rk-pn { font-size:36px; }
}
@media (min-width: 1700px) {
  body[data-tab="rank"] .grid { max-width:1560px; }
  .rk-side { flex-basis:360px; }
  .rk-stage { min-height:340px; gap:30px; }
  .rk-stage .rk-seat { --ph:152px; } .rk-stage .rk-seat.p2 { --ph:110px; } .rk-stage .rk-seat.p3 { --ph:82px; }
}
.rk-seat { --sc:var(--rk-gold); --ph:132px; position:relative; display:flex; flex-direction:column; align-items:center; min-width:0; text-align:center; }
.rk-seat.p2 { --sc:var(--rk-silver); --ph:94px; } .rk-seat.p3 { --sc:var(--rk-bronze); --ph:70px; }
.rk-who { position:relative; margin-bottom:10px; }
.rk-av { display:grid; place-items:center; width:62px; height:62px; border-radius:50%; font-size:25px; font-weight:800; color:var(--ink);
  background:radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--sc) 52%, var(--card)), color-mix(in srgb, var(--sc) 14%, var(--card)) 72%);
  box-shadow:0 0 0 2px var(--sc), 0 0 30px -4px color-mix(in srgb, var(--sc) 70%, transparent); transition:transform .3s var(--spr), box-shadow .3s; }
.rk-seat.p1 .rk-av { width:78px; height:78px; font-size:31px; }
.rk-seat:hover .rk-av { transform:translateY(-5px) scale(1.05); box-shadow:0 0 0 2px var(--sc), 0 0 46px 2px color-mix(in srgb, var(--sc) 70%, transparent); }
.rk-you { position:absolute; top:-6px; right:-18px; padding:1px 7px; border-radius:999px; font-size:11px; font-weight:800; letter-spacing:.02em; color:var(--bg); background:var(--pick); }
.rk-sn { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; font-size:15px; }
.rk-seat.me .rk-sn { color:var(--pick); }
.rk-sv { margin-top:2px; font-size:19px; font-weight:800; letter-spacing:-.01em; white-space:nowrap; }
.rk-seat.p1 .rk-sv { font-size:23px; }
.rk-sl { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; color:var(--muted); }
.rk-ped { position:relative; display:grid; place-items:center; width:100%; height:var(--ph); margin-top:12px; overflow:hidden; transform-origin:50% 100%;
  border:1px solid color-mix(in srgb, var(--sc) 45%, transparent); border-bottom:0; border-radius:14px 14px 0 0;
  background:linear-gradient(180deg, color-mix(in srgb, var(--sc) 24%, transparent), color-mix(in srgb, var(--sc) 6%, transparent) 62%, transparent);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
/* Mép trên bục bắt sáng như kính, vệt sáng chéo trượt qua khi rê. */
.rk-ped::before { content:""; position:absolute; inset:0 0 auto; height:2px; background:linear-gradient(90deg, transparent, var(--sc), transparent); opacity:.9; }
.rk-ped::after { content:""; position:absolute; inset:-40% auto -40% -60%; width:40%; transform:skewX(-20deg); background:linear-gradient(90deg, transparent, color-mix(in srgb, #fff 18%, transparent), transparent); transition:left .7s var(--ease-out); }
.rk-seat:hover .rk-ped::after { left:120%; }
.rk-pn { font-size:46px; font-weight:800; line-height:1; color:color-mix(in srgb, var(--sc) 70%, var(--ink)); opacity:.8; text-shadow:0 0 24px color-mix(in srgb, var(--sc) 60%, transparent); }
.rk-seat.empty .rk-av { background:transparent; border:2px dashed color-mix(in srgb, var(--sc) 55%, transparent); box-shadow:none; color:var(--muted); }
.rk-seat.empty .rk-sn { color:var(--muted); font-weight:600; }
.rk-seat.empty .rk-ped { opacity:.6; }
/* Vào mục, đổi bảng: bục mọc lên (hạng 3, 2 rồi 1), người rơi xuống bục, số hiện sau cùng. */
.rk-stage.in .rk-ped { animation:rkPed .75s var(--spr) backwards; }
.rk-stage.in .rk-who { animation:rkDrop .6s var(--spr) backwards; }
.rk-stage.in .rk-sn, .rk-stage.in .rk-sv, .rk-stage.in .rk-sl { animation:fxUp .5s var(--ease-out) backwards; }
.rk-stage.in .p3 .rk-ped { animation-delay:.05s; } .rk-stage.in .p2 .rk-ped { animation-delay:.15s; } .rk-stage.in .p1 .rk-ped { animation-delay:.27s; }
.rk-stage.in .p3 .rk-who { animation-delay:.42s; } .rk-stage.in .p2 .rk-who { animation-delay:.5s; } .rk-stage.in .p1 .rk-who { animation-delay:.6s; }
.rk-stage.in .rk-sn, .rk-stage.in .rk-sv, .rk-stage.in .rk-sl { animation-delay:.7s; }
@keyframes rkPed { from { transform:scaleY(0); } }
@keyframes rkDrop { from { opacity:0; transform:translateY(-46px) scale(.6); } }
/* Cột bên: vị trí của bạn, mùa, thang bậc. */
.rk-sc .k .muted { font-weight:500; }
.rk-mepos { display:flex; align-items:baseline; gap:8px; margin-top:6px; }
.rk-mepos .v { font-size:30px; font-weight:800; letter-spacing:-.02em; line-height:1.1; }
.rk-mev { margin-top:4px; font-size:17px; font-weight:700; }
.rk-sc p { margin:8px 0 0; }
.rk-sc .rk-badge { margin-top:8px; }
.rk-lead { color:var(--pick); font-weight:600; }
.rk-lad { list-style:none; margin:8px 0 0; padding:0; display:grid; gap:2px; }
.rk-lad { --rkc:var(--rk-iron); }
.rk-lad li { position:relative; display:grid; grid-template-columns:10px 1fr auto; align-items:center; gap:10px; padding:5px 8px; border-radius:8px; font-size:13px; }
.rk-lad li i { width:8px; height:8px; border-radius:2px; transform:rotate(45deg); background:var(--rkc); }
.rk-lad li.me { background:color-mix(in srgb, var(--rkc) 16%, transparent); box-shadow:inset 3px 0 0 var(--rkc); font-weight:700; }
.rk-lad li.me .rk-you { position:static; margin-left:6px; }
.rk-lad li.me { grid-template-columns:10px 1fr auto auto; }
/* Danh mục: dòng chú thích cùng nhóm với thứ đang rê sáng lên (dash.js lớp lit). */
#c-mix .legend li { border-radius:8px; transition:background .2s; }
#c-mix .legend li.lit { background:color-mix(in srgb, var(--pick) 12%, transparent); }
/* Máy có chuột, từ 1200px: thẻ Danh mục và cột bên Xếp hạng trong hơn, viền bắt sáng; thẻ Tổng tài sản là khối kính chính. */
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  html.bgfx body[data-tab="portfolio"] #p-assets .card, html.bgfx .rk-side .card {
    background:color-mix(in srgb, var(--card) 68%, transparent); border-color:color-mix(in srgb, var(--ink) 11%, transparent);
    box-shadow:inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent), 0 22px 46px -28px rgba(0,0,0,.6); }
  html.bgfx body[data-tab="portfolio"] #p-assets #c-big {
    background:linear-gradient(140deg, color-mix(in srgb, var(--pick) 16%, transparent), transparent 48%), color-mix(in srgb, var(--card) 60%, transparent);
    border-color:color-mix(in srgb, var(--pick) 34%, transparent); }
  html.bgfx body[data-tab="portfolio"] #p-assets .card:hover { border-color:color-mix(in srgb, var(--ink) 22%, transparent); }
  /* Viền bắt sáng: đoạn viền gần chuột sáng lên (cùng biến --mx, --my của vệt sáng theo chuột, app.js). */
  html.bgfx body[data-tab="portfolio"] #p-assets .card::before, html.bgfx .rk-side .card::before { content:""; position:absolute; inset:-1px; border-radius:inherit; padding:1px; pointer-events:none;
    background:radial-gradient(220px circle at var(--mx) var(--my), color-mix(in srgb, var(--pick) 80%, transparent), transparent 70%);
    -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask:linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity:0; transition:opacity .25s ease; }
  html.bgfx body[data-tab="portfolio"] #p-assets .card:hover::before, html.bgfx .rk-side .card:hover::before { opacity:1; }
}

/* ---------- giảm chuyển động: bỏ mọi hoạt cảnh mới ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro, .intro *, .auth.fx-in *, body.fx-app .top, body.fx-app #app > .tabs, body.fx-app #app .grid, #app .grid.fx-r, #app .grid.fx-l, #app .grid.fx-c,
  .pf-av-btn.fx-pop .pf-av, .t-cbox.tray .t-draw, .t-cbox.tray .t-draw button, .t-draw button.arm, .rk-stage.in * { animation:none !important; }
  .rk-ped::after, .rk-av { transition:none !important; }
  .intro-logo path { stroke-dashoffset:0; } .intro-line { transform:none; }
  .auth-card { transform:none !important; }
}
/* v0.27 A1b: bảng thông báo chuyển mùa giữa màn hình (#sn-wrap, notice.js), thay dải ngang dưới thanh đầu của v0.26.2 (bỏ cả phần co lưới
   Thị trường, Trading dành cho dải đó). Lớp #sn-wrap phủ cả màn hình, là nền làm tối và căn giữa bảng; bảng nền đặc (luật 2.6), rộng tối đa 520px,
   điện thoại gần hết bề ngang có lề 16px; nội dung dài thì cuộn trong .sn-body, chân bảng (nút) luôn thấy. Mở: mờ dần và nhích lên một lần (fx), không lặp. */
.sn-wrap { position:fixed; inset:0; z-index:95; display:grid; place-items:center; padding:16px; background:rgba(4,8,14,.62); overscroll-behavior:contain; }
.sn-wrap[hidden] { display:none; }
.sn { position:relative; display:flex; flex-direction:column; width:min(520px, 100%); max-height:100%; min-height:0; overflow:hidden; border:1px solid var(--line); border-radius:16px;
  background:var(--card); color:var(--ink); box-shadow:0 24px 60px -20px rgba(0,0,0,.55), inset 0 3px 0 var(--pick); outline:none; }
.sn:focus, .sn:focus-visible { outline:none; } /* khung bảng nhận focus khi mở (đọc tiêu đề, nội dung), không phải nút: không vẽ viền */
.sn-body { flex:1 1 auto; min-height:0; overflow:auto; padding:22px 22px 6px; overscroll-behavior:contain; }
.sn-k { margin:0 48px 4px 0; color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; }
.sn-t { margin:0 48px 14px 0; font-size:22px; line-height:1.25; letter-spacing:-.01em; }
.sn-dates { list-style:none; margin:0 0 14px; padding:0; display:grid; gap:8px; }
.sn-dates li { position:relative; padding:8px 12px 8px 14px; border-radius:10px; background:var(--soft); font-size:15px; line-height:1.45; box-shadow:inset 3px 0 0 var(--pick); }
.sn-dates b { font-weight:700; }
.sn-p { margin:0 0 10px; font-size:15px; line-height:1.5; }
.sn-hof { color:var(--ink); font-weight:600; }
.sn-foot { flex:0 0 auto; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px 12px; padding:12px 22px 18px; border-top:1px solid var(--line); background:var(--card); }
.sn-ok { min-width:148px; min-height:44px; padding:10px 22px; border:0; border-radius:12px; background:var(--pick); color:var(--onpick); font:inherit; font-size:16px; font-weight:700; cursor:pointer; }
.sn-ok:hover { filter:brightness(1.06); }
.sn-more { min-height:44px; padding:10px 6px; border:0; background:none; color:var(--pick); font:inherit; font-size:15px; font-weight:600; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.sn-x { position:absolute; top:8px; right:8px; z-index:1; min-width:44px; min-height:44px; display:inline-grid; place-items:center; padding:0; border:0; border-radius:10px; background:none; color:var(--muted); cursor:pointer; }
.sn-x:hover { color:var(--ink); background:var(--soft); }
.sn-x[hidden] { display:none; }
.sn-ok:focus-visible, .sn-more:focus-visible, .sn-x:focus-visible, .sn-chip:focus-visible { outline:2px solid var(--pick); outline-offset:2px; }
/* Đang chờ: nút chính khóa (chữ muted trên nền soft vẫn đạt 4,5:1), "Xem chi tiết" mờ, bấm nền không đóng. */
.sn-wrap.locked .sn-ok { background:var(--soft); color:var(--muted); cursor:not-allowed; filter:none; box-shadow:inset 0 0 0 1px var(--line); }
.sn-wrap.locked .sn-more { color:var(--muted); cursor:not-allowed; text-decoration:none; }
.sn-n { font-variant-numeric:tabular-nums; }
.sn-sr { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }
/* Màn đăng nhập ẩn thanh đầu, Có gì mới, Luật chơi (chỉ mở được sau khi vào game) nên ẩn "Xem chi tiết". */
body.is-auth .sn-more { display:none; }
html.sn-on, html.sn-on body { overflow:hidden; }
.sn-wrap.fx { animation:snFade .22s ease-out both; } .sn-wrap.fx .sn { animation:snIn .26s var(--ease-out, ease-out) both; }
@keyframes snFade { from { opacity:0; } }
@keyframes snIn { from { opacity:0; transform:translateY(10px) scale(.98); } }
@media (max-width: 699px) {
  .sn-wrap { padding:16px; }
  .sn-body { padding:18px 16px 4px; } .sn-foot { padding:10px 16px 14px; }
  .sn-t { font-size:20px; } .sn-dates li, .sn-p { font-size:14px; }
  .sn-ok { flex:1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .sn-wrap.fx, .sn-wrap.fx .sn { animation:none; } }
/* Nhãn mở lại (#sn-chip ở thanh đầu, #sn-chip-auth dưới khung đăng nhập): viên nhỏ có chấm màu nhấn. Điện thoại: thanh đầu không còn chỗ trên một dòng
   (đo 11/11: còn 15px ở 320 và 360) nên nhãn nằm dưới tên game, thanh đầu không cao thêm. */
.sn-chip { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:2px 10px; border:1px solid color-mix(in srgb, var(--pick) 45%, var(--line)); border-radius:999px;
  background:var(--card); color:var(--ink); font:inherit; font-size:12px; font-weight:600; line-height:1.2; white-space:nowrap; cursor:pointer; }
.sn-chip:hover { border-color:var(--pick); }
.sn-chip[hidden] { display:none; }
.sn-chip-dot { width:7px; height:7px; border-radius:50%; background:var(--pick); flex:0 0 auto; }
.sn-chip-auth { display:flex; margin:12px auto 0; min-height:32px; }
.sn-chip-s { display:none; }
@media (max-width: 699px) {
  .top .brand:has(#sn-chip:not([hidden])) { display:grid; grid-template-columns:auto auto; justify-content:start; align-items:center; gap:2px 0; }
  .top .brand:has(#sn-chip:not([hidden])) .logo-mark { width:20px; height:20px; margin-right:6px; }
  .top .brand:has(#sn-chip:not([hidden])) .name { grid-column:2; line-height:20px; }
  .top .brand:has(#sn-chip:not([hidden])) .sub-brand { display:none; }
  .top .sn-chip { grid-column:1 / -1; justify-self:start; min-height:22px; padding:1px 8px; gap:5px; }
}
@media (max-width: 399px) {
  .top .sn-chip .sn-chip-l { display:none; } .top .sn-chip .sn-chip-s { display:inline; }
}
/* Máy tính bảng, laptop hẹp (700 đến 1279px): tên mùa và phụ đề nhường chỗ cho nhãn (đo 11/11: bản en ở 768 nhãn rớt dòng, thanh đầu cao thêm 17px);
   nút "i" vẫn còn, nhãn đã nói Mùa 0. */
@media (min-width: 700px) and (max-width: 1279px) {
  .top .brand:has(#sn-chip:not([hidden])) .sub-brand, .top .brand:has(#sn-chip:not([hidden])) .info-btn .season { display:none; }
}

/* A2: Bảng vàng Mùa 0 (#hof-card ở Xếp hạng) và thẻ Mùa 0 (.hof-box ở Hồ sơ, hộp hồ sơ). Chữ huy hiệu ở giao diện sáng
   đậm hơn màu bậc chung (--t-gold #a87b00 chỉ 3,6:1 trên nền thẻ) để đạt 4,5:1; giao diện tối giữ màu bậc (đã sáng). */
:root[data-theme] { --hof-gold:#7a5900; --hof-silver:#55606e; --hof-bronze:#8a4f22; --hof-special:#be185d; }
:root[data-theme="dark"] { --hof-gold:var(--t-gold); --hof-silver:var(--t-silver); --hof-bronze:var(--t-bronze); --hof-special:var(--t-special); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --hof-gold:var(--t-gold); --hof-silver:var(--t-silver); --hof-bronze:var(--t-bronze); --hof-special:var(--t-special); } }
:is(.hof-card, .hof-box) .tier.on.t-gold { color:var(--hof-gold); border-color:var(--hof-gold); } :is(.hof-card, .hof-box) .tier.on.t-silver { color:var(--hof-silver); border-color:var(--hof-silver); }
:is(.hof-card, .hof-box) .tier.on.t-bronze { color:var(--hof-bronze); border-color:var(--hof-bronze); } :is(.hof-card, .hof-box) .tier.on.t-special { color:var(--hof-special); border-color:var(--hof-special); }
.hof-box .pp-badges { margin:0 0 8px; } .hof-card .rank-mini .num .tier { margin-right:4px; }
