/* ===== fonts (Google Sans, tu host; demo thay bang Be Vietnam Pro) ===== */
/*FONTS-START*/
@font-face { font-family: "Google Sans"; font-weight: 400; font-display: swap; src: url("/app/fonts/google-sans-vietnamese-400.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: "Google Sans"; font-weight: 400; font-display: swap; src: url("/app/fonts/google-sans-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Google Sans"; font-weight: 500; font-display: swap; src: url("/app/fonts/google-sans-vietnamese-500.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: "Google Sans"; font-weight: 500; font-display: swap; src: url("/app/fonts/google-sans-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Google Sans"; font-weight: 700; font-display: swap; src: url("/app/fonts/google-sans-vietnamese-700.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: "Google Sans"; font-weight: 700; font-display: swap; src: url("/app/fonts/google-sans-latin-700.woff2") format("woff2"); }
:root { --font: "Google Sans", "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; }
/*FONTS-END*/

/* ===== tokens: rung dem, xanh ngoc, ho phach ===== */
:root {
  --bg: #0a1710; --bg2: #0e1e15; --surface: #122419; --raised: #182f22; --raised2: #1e3a2a;
  --line: #24402f; --line2: #2f5a40; --text: #e9f1ec; --muted: #97b0a2; --muted2: #6f8a7c;
  --green: #34d399; --green2: #22c55e; --green3: #86efac; --green-deep: #15803d;
  --amber: #f5b53f; --amber2: #ffd479; --red: #f0655f; --blue: #6cc4f0; --violet: #c4b5fd;
  --r-lg: 22px; --r: 16px; --r-sm: 11px; --shadow: 0 14px 40px rgba(0, 0, 0, .35); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --container: 2200px;   /* 0.9.67: full chieu ngang man hinh (chu server 21/09: "dung de trong 2 ben"); tran 2200 chi de khong keo qua dai tren man hinh sieu rong */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(1100px 520px at 12% -8%, rgba(34, 197, 94, .16), transparent 60%), radial-gradient(800px 500px at 105% 8%, rgba(20, 120, 80, .22), transparent 55%), var(--bg); }
a { color: var(--green3); text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ===== top bar ===== */
.topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); background: rgba(10, 23, 16, .78); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: var(--container); margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 9px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--text); }
.brand img { height: 40px; width: 40px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow-sm); }
.nav { display: flex; gap: 2px; margin-left: 10px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }   /* 0.9.67: hep thi cuon ngang, khong tran */
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; }
.topbar .in > .pill, .topbar .in > .lang, .topbar .in > #userBox { flex: none; }
#userBox .userchip .bones { white-space: nowrap; }
.nav a { padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; transition: .15s; }
.nav a:hover { color: var(--text); background: var(--raised); }
.nav a.active { color: #06180d; background: var(--green); font-weight: 700; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.pill.on { color: var(--green3); border-color: var(--line2); }
.pill.off { color: var(--red); border-color: #5a2a2a; }
.pill.live { color: var(--amber2); border-color: #5a4a20; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.pill.on .dot { box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); } 50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, .05); } }
@media (prefers-reduced-motion: reduce) { .pill.on .dot { animation: none; } * { transition: none !important; } }
.lang { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 11px; cursor: pointer; font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.lang:hover { color: var(--text); border-color: var(--line2); }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.userchip:hover { border-color: var(--line2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--raised); border: 2px solid var(--line2); }
.avatar.lg { width: 72px; height: 72px; border-width: 3px; }

/* ===== buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--raised); color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--green); transform: translateY(-1px); }
.btn:focus-visible, .lang:focus-visible, input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.pri { background: linear-gradient(135deg, var(--green), var(--green-deep)); border-color: transparent; color: #04140a; font-weight: 700; }
.btn.amber { background: linear-gradient(135deg, var(--amber2), var(--amber)); border-color: transparent; color: #1a1200; font-weight: 700; }
.btn.danger { background: #3a1818; border-color: #5a2a2a; color: #fecaca; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }

/* ===== layout ===== */
main { max-width: var(--container); margin: 0 auto; padding: 18px 20px 80px; display: grid; gap: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-home { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }   /* 0.9.67: the cao theo noi dung, khong keo dai de lo khoang trong */
.g-side { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); align-items: start; }
.g-side-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1000px) { .g3, .g4, .g-home { grid-template-columns: 1fr 1fr; } .g-side, .g-side-r { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4, .g-home { grid-template-columns: 1fr; } .nav { display: none; } .mobile-nav { display: flex !important; } main { padding-bottom: 96px; } }
/* 0.9.67: dien thoai - topbar gon: logo + ten ngan, pill server chi con cham, chip xuong; khong con tran ngang */
@media (max-width: 640px) { .topbar .in { gap: 8px; padding: 8px 12px; } .brand { font-size: 15px; gap: 6px; } .brand img { width: 32px; height: 32px; } #pillServer span { display: none; } #pillServer { padding: 6px 8px; gap: 0; } .lang { padding: 4px 8px; } .userchip { padding: 3px 8px 3px 3px; } .userchip .avatar { width: 24px; height: 24px; } }
@media (max-width: 480px) { #brandName { display: none; } .brand::after { content: none; } .userchip .avatar { display: none; } .userchip { padding: 5px 10px; } }

.card { background: linear-gradient(180deg, var(--surface), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; }
.card > .body { flex: 1; }
.card h2 { font-size: 19px; letter-spacing: -.01em; }
.card h3, .eyebrow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }   /* 0.9.67: hep thi nut/pill xuong hang, khong tran */
.card .head > .row { min-width: 0; max-width: 100%; }
.card .head .pill, .card .head .badge, .empty .badge, .empty .pill { white-space: normal; max-width: 100%; text-align: left; }
.card .head > div { min-width: 0; max-width: 100%; }   /* dien thoai (.head xep doc, align flex-start): khong de tieu de/sub tran ra ngoai the */
.card .head .sub { max-width: min(62ch, 100%); overflow-wrap: break-word; }
.card .foot { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bones { color: var(--amber2); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== hero ===== */
.hero { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line2); display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 28px; align-items: center; padding: 30px 32px; box-shadow: var(--shadow); background: #0c1d13 url("/app/hero.jpg") center/cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 20, 13, .96) 0%, rgba(8, 20, 13, .82) 45%, rgba(8, 20, 13, .35) 100%), linear-gradient(0deg, rgba(8, 20, 13, .9), transparent 55%); }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.02em; margin: 10px 0 12px; }
.hero h1 em { font-style: normal; color: var(--green3); }
.hero p { max-width: 64ch; color: #cfe0d6; margin: 0 0 18px; font-size: 15.5px; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; }
/* 0.9.67: 4 o tinh nang duoi nut - lap cho trong ben trai hero, moi o la link toi muc do */
.hero .lead { min-width: 0; }
.hero .btn.dl { font-weight: 800; }
.hero .feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
@media (min-width: 1500px) { .hero .feats { grid-template-columns: repeat(4, 1fr); } }   /* man hinh rong: 4 o mot hang; hep hon: 2x2 (khong bao gio le 1 o) */
.hero .feat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: rgba(12, 29, 19, .78); border: 1px solid var(--line2); color: inherit; text-decoration: none; min-width: 0; transition: transform .12s, border-color .12s; }
a.hero-feat:hover, .hero a.feat:hover { border-color: var(--green3); transform: translateY(-1px); }
.hero .feat .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--raised); display: grid; place-items: center; font-size: 19px; flex: none; }
.hero .feat > div:last-child { min-width: 0; }
.hero .feat b { display: block; font-size: 13.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .feat span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
@media (max-width: 520px) { .hero .feats { grid-template-columns: 1fr; } }
.servercard { align-self: center; width: 100%; max-width: 640px; justify-self: end; background: rgba(12, 29, 19, .82); backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.servercard .name { font-weight: 700; font-size: 16px; }
.servercard .cap { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.servercard .ip { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 6px 6px 12px; min-width: 0; }
.servercard .ip code { flex: 1; min-width: 0; font-size: 13.5px; color: var(--green3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.servercard .ip .btn { flex: none; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 22px; } }

/* ===== stat tiles ===== */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--raised); display: grid; place-items: center; font-size: 20px; flex: none; }
.stat b { display: block; font-size: 22px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ===== lists / tables ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--raised); color: var(--muted); }
.rank.r1 { background: linear-gradient(135deg, #ffd479, #d99a1b); color: #1a1200; } .rank.r2 { background: #cbd5e1; color: #111; } .rank.r3 { background: #d9a066; color: #1a0f00; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; } .who > * { min-width: 0; }
/* 0.9.67: ten / SteamID duoc xuong dong -> o bang co the co lai theo the (truoc: nowrap lam bang rong hon the, nut cuoi hang tran ra ngoai) */
.who span { overflow-wrap: anywhere; } .who .mono { overflow-wrap: anywhere; word-break: break-all; }
.who h2, .who h3 { overflow-wrap: anywhere; }
td .mono, .mono.muted { overflow-wrap: anywhere; }
td.num.small, td.num.muted { white-space: nowrap; }
.tscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }   /* 0.9.67: bang rong hon the -> cuon ngang trong the (JS tu boc moi <table>) */
.tscroll > table { min-width: 100%; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.item .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; font-size: 22px; flex: none; }
.item .tx { flex: 1; min-width: 0; } .item .tx b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .item .tx span { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { display: flex; flex-direction: column; }
.feed .ev { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; min-width: 0; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ev .t { color: var(--muted2); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed .ev .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: var(--raised); }
.bar { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green3)); }
.bar.amber i { background: linear-gradient(90deg, #b07a12, var(--amber2)); }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; outline: none; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }
.field { display: grid; gap: 6px; } .field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { background: var(--raised); border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; }
.tabs button.active { color: #06180d; background: var(--green3); border-color: transparent; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: var(--raised); border: 1px solid var(--line); color: var(--muted); font-weight: 600; white-space: nowrap; }
.badge.ok { color: var(--green3); border-color: var(--line2); } .badge.warn { color: var(--amber2); border-color: #5a4a20; } .badge.bad { color: var(--red); border-color: #5a2a2a; } .badge.info { color: var(--blue); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--r); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--raised2); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 18px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; font-weight: 500; }
.toast.err { border-color: #7a2e2e; background: #3a1818; }

/* ===== earn strip ===== */
.earn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* 0.9.67: o cuoi keo dai het hang de khong con o trong (6 o = 2x3; 5 o = 3 + 2 rong; 4 o = 3 + 1 rong) */
.earn .e:last-child:nth-child(3n+1) { grid-column: span 3; } .earn .e:last-child:nth-child(3n+2) { grid-column: span 2; }
@media (max-width: 900px) { .earn { grid-template-columns: 1fr 1fr; } .earn .e:last-child:nth-child(3n+1), .earn .e:last-child:nth-child(3n+2) { grid-column: auto; } .earn .e:last-child:nth-child(odd) { grid-column: span 2; } }
@media (max-width: 520px) { .earn { grid-template-columns: 1fr; } .earn .e:last-child:nth-child(odd) { grid-column: auto; } }
.earn .e { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; }
.earn .e .ic { font-size: 24px; } .earn .e b { display: block; font-size: 15px; } .earn .e span { color: var(--muted); font-size: 12.5px; }
.cmds { display: grid; gap: 6px; } .cmds div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line); } .cmds div:last-child { border-bottom: 0; } .cmds code { color: var(--green3); font-family: ui-monospace, Consolas, monospace; }

/* ===== profile ===== */
.identity { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 700px) { .identity { grid-template-columns: 1fr; } }
.identity .name { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.balance-big { text-align: right; } .balance-big b { display: block; font-size: 34px; color: var(--amber2); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; } .balance-big span { color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kv .k { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; } .kv .k b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; } .kv .k span { color: var(--muted); font-size: 12px; }
.dino { display: grid; gap: 10px; } .dino .sp { font-size: 22px; font-weight: 700; }

/* ===== garage / shop cards ===== */
.slot { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--raised); min-height: 178px; display: flex; flex-direction: column; gap: 9px; }
.slot.empty { border-style: dashed; border-color: var(--line2); justify-content: center; align-items: center; color: var(--muted); text-align: center; background: transparent; }
.slot .sp { font-size: 20px; font-weight: 700; }
.shopcard { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--raised); display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.shopcard .ic { width: 50px; height: 50px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; font-size: 28px; }
.shopcard .nm { font-size: 17px; font-weight: 700; }
.shopcard .ds { color: var(--muted); font-size: 13.5px; flex: 1; }

/* ===== map ===== */
.mapwrap { position: relative; width: 100%; aspect-ratio: 1000/1003; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line2); background: #0b1d12; cursor: grab; }
.mapwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.legend { display: grid; gap: 6px; } .legend div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 8px; border-radius: 8px; background: var(--raised); }

/* ===== mobile nav / footer ===== */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(10, 23, 16, .94); border-top: 1px solid var(--line); justify-content: space-around; padding: 8px 4px; z-index: 40; backdrop-filter: blur(10px); }
.mobile-nav { overflow-x: auto; scrollbar-width: none; } .mobile-nav::-webkit-scrollbar { display: none; } .mobile-nav a { flex: 1 0 auto; min-width: 56px; padding: 0 4px; white-space: nowrap; }
.mobile-nav a { color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mobile-nav a.active { color: var(--green3); } .mobile-nav a i { font-style: normal; font-size: 18px; }
footer { border-top: 1px solid var(--line); margin-top: 10px; }
footer .in { max-width: var(--container); margin: 0 auto; padding: 22px 20px 40px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted2); font-size: 13px; }
footer a { color: var(--muted); }
.announce { border-left: 4px solid var(--amber); }
.login-wall { max-width: 560px; margin: 30px auto; text-align: center; padding: 34px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.podium .p { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.podium .p.first { border-color: #7a5a14; background: linear-gradient(180deg, rgba(245, 181, 63, .12), var(--raised)); }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } }

/* skin editor */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.sw { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); cursor: pointer; }
.sw input[type="color"] { width: 44px; height: 44px; border: none; background: none; padding: 0; border-radius: 10px; cursor: pointer; }
.sw input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; } .sw input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line2); border-radius: 10px; }
.preview-strip { display: flex; height: 56px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.preview-strip i { flex: 1; display: block; }

/* skin 3D viewer */
.skin-viewport { position: relative; height: 460px; border-radius: var(--r); border: 1px solid var(--line); background: #0b0f0c center/cover no-repeat; overflow: hidden; }
.skin-viewport canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.skin-viewport-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.skin-viewbar { gap: 16px; margin-top: 10px; flex-wrap: wrap; } .skin-viewbar select { padding: 4px 8px; }
@media (max-width: 640px) { .skin-viewport { height: 320px; } }

/* garage: model nho + o mua ngan */
.gview { height: 190px; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, #1c2a20 0%, #0b0f0c 75%); border: 1px solid var(--line); }
.gview canvas { width: 100% !important; height: 100% !important; display: block; }
.slot.empty.buy { cursor: pointer; border-color: var(--green3); color: var(--text); }
.slot.empty.buy:hover { background: var(--raised); }
.slot.empty.buy .plus { font-size: 44px; line-height: 1; font-weight: 700; color: var(--green3); }
.btn.xs { padding: 2px 7px; font-size: 12px; }

/* modal theo giao dien web */
.modal-back { position: fixed; inset: 0; background: rgba(4, 8, 6, 0.62); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity .15s; padding: 16px; }
.modal-back.show { opacity: 1; }
.modal { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); transform: translateY(6px); transition: transform .15s; }
.modal-back.show .modal { transform: none; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal-text { color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-input { width: 100%; margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
/* garage cards */
.slot { text-align: center; align-items: stretch; }
.slot .gname { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.slot .gname .sp { font-size: 19px; font-weight: 700; }
.row.center { justify-content: center; }
.small.center { text-align: center; }
.gview { height: 200px; }

/* vien vang (mau xuong) cho ngan trong va o mua ngan */
.slot.empty { border: 1px solid rgba(255, 212, 121, 0.55); }
.slot.empty:hover { border-color: var(--amber2); }
.slot.empty.buy { border: 1px solid var(--amber2); }
.slot.empty.buy .plus { color: var(--amber2); }
.slot.empty.buy:hover { background: rgba(255, 212, 121, 0.06); }

/* admin: full man, cot nguoi choi hep - gara rong */
body.wide main, body.wide .topbar .in, body.wide footer .in { max-width: min(1720px, 98vw); }
.g-admin { grid-template-columns: 360px minmax(0, 1fr); }
.g-admin .who span { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
@media (max-width: 1000px) { .g-admin { grid-template-columns: 1fr; } }
/* gara: dang cho dung yen */
.banner.wait { background: rgba(255, 210, 63, .16); border: 2px solid #e0a52a; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* role gate */
.rl-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rl-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: 13px; cursor: pointer; }
.rl-item input[type="checkbox"] { width: 34px; height: 20px; }
.rl-item input[type="checkbox"]::before { width: 14px; height: 14px; top: 1px; left: 1px; }
.rl-item input[type="checkbox"]:checked::before { left: 15px; }
.rl-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
/* admin player bars */
.pbar { display: grid; gap: 4px; }
.pbar-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.pbar-track i { display: block; height: 100%; border-radius: 999px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn.active { outline: 2px solid var(--green); }
/* admin: log */
.lg-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-cats .chip { border: 1px solid var(--line); background: var(--raised); color: var(--muted); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.lg-cats .chip b { background: rgba(0, 0, 0, .22); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.lg-cats .chip .share { font-style: normal; font-size: 11px; }
.lg-cats .chip.active { background: var(--green3); color: #06180d; border-color: transparent; font-weight: 800; }
.lg-table td { vertical-align: top; }
.lg-msg { line-height: 1.45; word-break: break-word; }
.lg-msg code { background: rgba(0, 0, 0, .25); padding: 0 5px; border-radius: 4px; font-size: 12px; }
.badge .x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 11px; opacity: .8; }
.badge .x:hover { opacity: 1; color: #f85149; }
/* admin: API key */
.api-scope { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.api-scope code { background: rgba(0, 0, 0, .25); padding: 1px 6px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.api-scope span { font-size: 13px; color: var(--muted); }
.api-ex { background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 8px 0 12px; }
.api-docs td { vertical-align: top; }
tr.muted td { opacity: .55; }

/* bang loai dang online (trang chu + admin) */
.sp-table{width:100%;border-collapse:collapse}.sp-table td{padding:6px 4px;border-bottom:1px solid var(--line,rgba(255,255,255,.06));vertical-align:middle}
.sp-table{table-layout:fixed}.sp-table .sp-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:52%}.sp-table .sp-bar{width:22%;min-width:56px}.sp-table .sp-n{width:26%}
.sp-toggle{width:100%;margin-top:8px}.sp-table tr[hidden]{display:none}
.shopcard .locknote{margin-top:8px;padding:8px 10px;border-radius:10px;background:rgba(248,81,73,.12);border:1px solid rgba(248,81,73,.45);font-size:12.5px;line-height:1.35}.shopcard .locknote a{color:var(--amber2,#e3b341);font-weight:700;white-space:nowrap}.btn.locked{background:#4a2420;border-color:#8a3a3a;color:#ffb4a8;box-shadow:none}.btn.locked[disabled]{opacity:.9;cursor:not-allowed}
.sp-full{display:inline-block;font-size:10px;font-weight:800;letter-spacing:.04em;padding:1px 5px;border-radius:6px;background:#f85149;color:#fff;vertical-align:middle}.sp-table .sp-bar i{display:block;height:8px;border-radius:99px;background:linear-gradient(90deg,var(--accent,#3fb950),var(--accent2,#58a6ff));min-width:6px}
.sp-table .sp-n{text-align:right;white-space:nowrap}.sp-table tr.full .sp-bar i{background:linear-gradient(90deg,#f0883e,#f85149)}.sp-table tr.full .sp-name{color:#ff7b72}
.sp-note{margin-bottom:8px}.sp-admin td,.sp-admin th{padding:6px 8px}.sp-admin tr.full td.sp-name{color:#ff7b72}

/* anh loai chup tu model 3D */
.sp-img{display:inline-block;vertical-align:middle;object-fit:contain}
.sp-img.sm{width:40px;height:26px;margin-right:6px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))}
.sp-img.lg{width:100%;height:150px;filter:drop-shadow(0 6px 10px rgba(0,0,0,.45))}
.sp-fb{display:inline-flex;align-items:center;justify-content:center;font-size:20px}.sp-fb.lg{font-size:64px;height:150px}
.shopcard.unlock .sp-hero{margin:-4px -4px 8px;padding:6px;border-radius:12px;background:radial-gradient(ellipse at 50% 70%,rgba(255,255,255,.10),transparent 70%)}

/* ---- che do an ---- */
.diet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 14px; margin-top: 14px; }
.diet-card.mine { outline: 2px solid var(--ok, #3fb950); }
.diet-list.single { grid-template-columns: minmax(340px, 720px); }
.diet-hero { width: 56px; height: 56px; object-fit: contain; }
.diet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 16px 14px; }
.diet-col { min-width: 0; }
.diet-h { font-weight: 700; margin-bottom: 6px; font-size: 13px; letter-spacing: .02em; overflow-wrap: break-word; }
.diet-src { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; padding: 3px 0; min-width: 0; overflow-wrap: break-word; line-height: 1.3; }
.diet-src .diet-img { flex: 0 0 auto; }
.diet-src.dino { font-weight: 600; }
.diet-src.organ { opacity: .85; }
.diet-img { width: 22px; height: 22px; object-fit: contain; }
@media (max-width: 480px) { .diet-grid { grid-template-columns: 1fr; } }

/* 0.9.35: o trong grid khong duoc tran ra ngoai the (chu server 18/09: "Do bien the" nam de ra ngoai) */
.grid > *, .g2 > *, .g3 > *, .g4 > * { min-width: 0; }
.field { min-width: 0; }
.field input[type="range"] { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; accent-color: var(--green3, #3fb950); }
.field input, .field select, .field textarea { max-width: 100%; box-sizing: border-box; }

/* 0.9.39: bang chi tiet module trong the Hieu nang */
.perf-mods { margin-top: 10px; }
.perf-mods > summary { cursor: pointer; font-size: 12px; opacity: .85; }
.perf-mods table { margin-top: 8px; width: 100%; }
