/* core/css/font.css */
/* Be Vietnam Pro (SIL OFL 1.1, xem core/font/BE-VIETNAM-PRO-LICENSE.txt), tự lưu trên web để khỏi phụ thuộc fonts.googleapis.com.
   Trình duyệt chỉ tải phần chữ (unicode-range) và độ đậm đang dùng. */
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../font/be-vietnam-pro-400-vietnamese.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;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../font/be-vietnam-pro-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../font/be-vietnam-pro-400-latin.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;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../font/be-vietnam-pro-600-vietnamese.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;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../font/be-vietnam-pro-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../font/be-vietnam-pro-600-latin.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;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../font/be-vietnam-pro-700-vietnamese.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;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../font/be-vietnam-pro-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../font/be-vietnam-pro-700-latin.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;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../font/be-vietnam-pro-800-vietnamese.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;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../font/be-vietnam-pro-800-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../font/be-vietnam-pro-800-latin.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;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(../font/be-vietnam-pro-900-vietnamese.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;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(../font/be-vietnam-pro-900-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(../font/be-vietnam-pro-900-latin.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;
}

/* core/css/theme.css */
/* LÕI — hệ thiết kế dùng chung. Xem HOP-DONG.md mục 4. */
:root {
  --nen: #5b3df5; --nen-2: #1fb6ff;
  --mat: #ffffff; --mat-2: #f3f1ff;
  --chu: #23194d; --chu-nhat: #6b6493;
  --chinh: #7c5cff; --phu: #ff5ca8; --xanh: #1fb6ff; --la: #20c997; --vang: #ffd43b; --cam: #ff922b; --do: #fa5252;
  --ban-go: #e9b872; --ban-go-dam: #b9783a;
  --ni: #148a5c; --ni-dam: #0b5e3e;
  --bo: 14px; --bo-lon: 24px;
  --bong: 0 4px 14px rgba(35, 25, 77, .18);
  --bong-lon: 0 14px 40px rgba(35, 25, 77, .30);
  --font: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mau-ghe-0: #ff5c5c; --mau-ghe-1: #2f7cff; --mau-ghe-2: #20c997; --mau-ghe-3: #ffb020; --mau-ghe-4: #b45cff; --mau-ghe-5: #ff7ac8;
  --rong-bai: 80px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--chu); overflow: hidden;
  background: radial-gradient(1200px 700px at 15% 10%, #8a6bff 0%, transparent 60%),
              radial-gradient(900px 600px at 90% 90%, #29d3ff 0%, transparent 60%),
              linear-gradient(135deg, var(--nen), var(--nen-2));
  -webkit-tap-highlight-color: transparent; user-select: none;
}
button { font-family: inherit; }

/* Nút */
.th-nut {
  --c: var(--chinh);
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 0; border-radius: 999px; padding: .7em 1.4em; font-weight: 700; font-size: 1rem;
  color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff), var(--c));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 65%, #000), var(--bong);
  cursor: pointer; transition: transform .12s, box-shadow .12s, filter .12s;
}
.th-nut:hover { filter: brightness(1.07); transform: translateY(-1px); }
.th-nut:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 65%, #000), var(--bong); }
.th-nut:disabled { filter: grayscale(.8) opacity(.6); cursor: default; transform: none; }
.th-nut.phu { --c: var(--phu); } .th-nut.la { --c: var(--la); } .th-nut.cam { --c: var(--cam); } .th-nut.do { --c: var(--do); }
.th-nut.vien { background: var(--mat); color: var(--chinh); box-shadow: inset 0 0 0 2px var(--chinh), var(--bong); }
.th-nut.nho { padding: .45em .9em; font-size: .88rem; }
.th-nut.lon { padding: .9em 2em; font-size: 1.2rem; }
.th-nut.tron { width: 2.6em; height: 2.6em; padding: 0; }

.th-the { background: var(--mat); border-radius: var(--bo-lon); box-shadow: var(--bong-lon); padding: 18px; }
.th-ban-go {
  background: repeating-linear-gradient(92deg, rgba(0,0,0,.035) 0 3px, transparent 3px 11px),
              linear-gradient(135deg, #f1c98a, var(--ban-go) 55%, #d9a05c);
  box-shadow: inset 0 0 0 6px var(--ban-go-dam), var(--bong-lon); border-radius: var(--bo);
}
.th-ni { background: radial-gradient(ellipse at center, #1db574 0%, var(--ni) 55%, var(--ni-dam) 100%); }
.th-token {
  --c: var(--mau-ghe-0);
  border-radius: 50%; aspect-ratio: 1;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 35%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 3px 6px rgba(0,0,0,.35), inset 0 -3px 4px rgba(0,0,0,.2);
}
.th-hop-nen { position: fixed; inset: 0; background: rgba(20, 10, 60, .45); display: flex; align-items: center; justify-content: center; z-index: 900; backdrop-filter: blur(3px); }
.th-hop { background: var(--mat); border-radius: var(--bo-lon); box-shadow: var(--bong-lon); padding: 22px 24px; min-width: min(360px, 92vw); max-width: 92vw; max-height: 90vh; overflow: auto; }
.th-hop h2 { margin: 0 0 10px; font-size: 1.35rem; }
.th-hop .nut-hang { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.th-o-nhap { font: inherit; padding: .65em .9em; border-radius: 12px; border: 2px solid #ddd8ff; width: 100%; outline: none; color: var(--chu); }
.th-o-nhap:focus { border-color: var(--chinh); }

/* Thông báo */
#th-thong-bao { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.th-tb { background: rgba(35,25,77,.92); color: #fff; padding: .6em 1.2em; border-radius: 999px; font-weight: 600; box-shadow: var(--bong); }

/* Lớp hiệu ứng */
#th-fx { position: fixed; inset: 0; pointer-events: none; z-index: 950; overflow: hidden; }
.th-chu-noi { position: absolute; font-weight: 800; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 12px rgba(0,0,0,.25); white-space: nowrap; }
.th-hat { position: absolute; width: 10px; height: 10px; border-radius: 2px; will-change: transform, opacity; }

/* Lá bài tây */
.th-bai { width: var(--rong-bai); aspect-ratio: 5/7; position: relative; transform-style: preserve-3d; transition: transform calc(.45s * var(--tg, 1)) cubic-bezier(.3,1.3,.5,1); flex: none; }
.th-bai.up { transform: rotateY(180deg); }
.th-bai > .mat, .th-bai > .lung { position: absolute; inset: 0; border-radius: calc(var(--rong-bai) * .09); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.th-bai > .lung { background: repeating-linear-gradient(45deg, #ff5ca8 0 6px, #e8418f 6px 12px); border: calc(var(--rong-bai) * .05) solid #fff; }
.th-bai > .lung::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: calc(var(--rong-bai) * .4); opacity: .85; }
.th-bai > .mat { background: linear-gradient(160deg, #fff, #f4f2fb); transform: rotateY(180deg); color: #1d1d1d; font-weight: 800; }
.th-bai > .mat.do { color: #e8212e; }
.th-bai .goc { position: absolute; left: 7%; top: 4%; line-height: .95; text-align: center; font-size: calc(var(--rong-bai) * .22); }
.th-bai .goc.duoi { left: auto; top: auto; right: 7%; bottom: 4%; transform: rotate(180deg); }
.th-bai .goc small { display: block; font-size: .8em; }
.th-bai .giua { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--rong-bai) * .5); }
.th-bai .giua.mat-nguoi { font-size: calc(var(--rong-bai) * .42); }
.th-bai.chon { transform: rotateY(180deg) translateY(-18%); }
.th-bai.chon > .mat { box-shadow: 0 0 0 3px var(--vang), 0 8px 14px rgba(0,0,0,.35); }

/* Xúc xắc */
.th-xx { --s: 56px; width: var(--s); height: var(--s); position: relative; transform-style: preserve-3d; transform: rotateX(-20deg) rotateY(25deg); }
.th-xx .m { position: absolute; inset: 0; background: linear-gradient(145deg, #fff, #ece8ff); border-radius: 18%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.06); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; }
.th-xx .m span { display: flex; align-items: center; justify-content: center; }
.th-xx .m i { width: 70%; aspect-ratio: 1; border-radius: 50%; background: #2b2250; place-self: center; }
.th-xx .m.m1 i { background: var(--do); width: 85%; }
.th-xx .m1 { transform: translateZ(calc(var(--s)/2)); }
.th-xx .m6 { transform: rotateY(180deg) translateZ(calc(var(--s)/2)); }
.th-xx .m2 { transform: rotateY(90deg) translateZ(calc(var(--s)/2)); }
.th-xx .m5 { transform: rotateY(-90deg) translateZ(calc(var(--s)/2)); }
.th-xx .m3 { transform: rotateX(90deg) translateZ(calc(var(--s)/2)); }
.th-xx .m4 { transform: rotateX(-90deg) translateZ(calc(var(--s)/2)); }
.cl0 .th-xx .m { box-shadow: none; }
.cl0 *, .cl0 *::before, .cl0 *::after { backdrop-filter: none !important; }
/* Lá bài dùng ảnh Blender */
.th-bai > .lung.anh, .th-bai > .mat.anh { background-color: transparent; border: 0; background-repeat: no-repeat; }
.th-bai > .lung.anh::after { content: none; }

/* ===== Icon SVG + avatar (HOP-DONG mục 15) ===== */
.th-ic { display: inline-flex; line-height: 0; flex: none; }
.th-ic svg, .th-svg { width: 1.15em; height: 1.15em; display: block; }
.th-nut .th-ic + span { margin-left: .05em; }
.th-nut.tron .th-ic svg { width: 1.3em; height: 1.3em; }
.th-sticker { width: 1.6em; height: 1.6em; display: block; }
.th-av { --av: 40px; width: var(--av); height: var(--av); --rong-anh: var(--av); border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background-color: var(--mat-2); background-repeat: no-repeat; font-size: calc(var(--av) * .55); color: var(--chinh); }
.th-av.av-may { background: linear-gradient(135deg, #e7f5ff, #d0ebff); color: #1c7ed6; }
.th-av.av-trong { background: transparent; border: 2px dashed currentColor; color: var(--chu-nhat); }
.th-av svg { width: 60%; height: 60%; }

/* ===== Theme trắng/hồng tối giản (mặc định) ===== */
.theme-trang {
  --nen: #ffffff; --nen-2: #fff5f9;
  --mat: #ffffff; --mat-2: #fff0f6;
  --chu: #2a2230; --chu-nhat: #8b8093;
  --chinh: #ec4f8c; --phu: #ff7eb3; --xanh: #4dabf7; --la: #2fb67c; --vang: #ffc53d; --cam: #f08c3a; --do: #f0506e;
  --vien: #f1e4ea; --hong-nhat: #ffe3ee;
  --bong: 0 2px 8px rgba(42, 34, 48, .07);
  --bong-lon: 0 10px 30px rgba(42, 34, 48, .10);
}
.theme-trang body { background: var(--nen-app, #fbf9fa); color: var(--chu); }
.theme-trang .th-nut { box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 70%, #000 0%), 0 4px 12px color-mix(in srgb, var(--c) 30%, transparent); background: var(--c); }
.theme-trang .th-nut:active { box-shadow: none; }
.theme-trang .th-nut.la { --c: var(--chinh); }
.theme-trang .th-nut.phu { --c: #2a2230; }
.theme-trang .th-nut.cam { --c: var(--cam); }
.theme-trang .th-nut.vien { background: var(--mat); color: var(--chu); box-shadow: inset 0 0 0 1.5px var(--vien), var(--bong); }
.theme-trang .th-nut.vien:hover { color: var(--chinh); box-shadow: inset 0 0 0 1.5px var(--chinh), var(--bong); }
.theme-trang .th-hop-nen { background: rgba(42, 34, 48, .28); backdrop-filter: blur(2px); }
.theme-trang .th-hop { border: 1px solid var(--vien); }
.theme-trang .th-o-nhap { border-color: var(--vien); }
.theme-trang .th-o-nhap:focus { border-color: var(--chinh); }
.theme-trang .th-tb { background: rgba(42, 34, 48, .92); }

/* core/css/ui.css */
/* LÕI — sảnh, phòng chờ, màn chơi */
#app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.man { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- Sảnh ---------- */

/* ---------- Hộp chọn chế độ ---------- */
.hop-che-do .dau-tro { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.hop-che-do .dau-tro .bt { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 38px; color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: var(--bong); flex: none; }
.hop-che-do .dau-tro .bt svg { width: 44px; height: 44px; }
.hop-che-do p { margin: 0; color: var(--chu-nhat); }
.cac-che-do { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.che-do { border: 2px solid #ece8ff; border-radius: 18px; padding: 14px; cursor: pointer; text-align: center; transition: border-color .15s, transform .15s, background .15s; background: #fff; }
.che-do:hover { transform: translateY(-2px); border-color: var(--chinh); }
.che-do.bat { border-color: var(--chinh); background: var(--mat-2); }
.che-do .i { font-size: 34px; } .che-do b { display: block; margin-top: 4px; } .che-do small { color: var(--chu-nhat); font-size: .78rem; }
.dong-cau-hinh { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.dong-cau-hinh > label { min-width: 110px; font-weight: 700; font-size: .92rem; }
.nhom-chon { display: flex; gap: 6px; flex-wrap: wrap; }
.nhom-chon button { border: 2px solid #ece8ff; background: #fff; border-radius: 999px; padding: .4em .9em; font-weight: 700; cursor: pointer; color: var(--chu); }
.nhom-chon button.bat { border-color: var(--chinh); background: var(--chinh); color: #fff; }

/* ---------- Phòng chờ ---------- */
.phong { align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.phong .th-the { width: min(720px, 100%); }
.ma-phong { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.ma-phong .ma { font-size: 2.4rem; font-weight: 900; letter-spacing: .25em; color: var(--chinh); background: var(--mat-2); padding: .1em .5em; border-radius: 14px; }
.ds-ghe { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ghe { border-radius: 16px; padding: 12px; background: var(--mat-2); display: flex; align-items: center; gap: 10px; min-height: 64px; border: 2px solid transparent; }
.ghe .av { font-size: 30px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--mat); border-radius: 50%; flex: none; }
.ghe b { display: block; font-size: .92rem; } .ghe small { color: var(--chu-nhat); font-size: .75rem; }
.ghe.trong { border: 2px dashed #cfc6ff; background: var(--mat); color: var(--chu-nhat); justify-content: center; cursor: pointer; }
.ghe.toi { border-color: var(--chinh); }
.ghi-chu { font-size: .82rem; color: var(--chu-nhat); background: #fff8e1; border-radius: 12px; padding: 10px 12px; margin-top: 12px; line-height: 1.45; }

/* ---------- Màn chơi ---------- */
.man-choi { background: rgba(10, 5, 40, .12); }
.thanh-tren { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); z-index: 5; flex-wrap: nowrap; overflow-x: auto; }
.thanh-tren .ten-tro { color: #fff; font-weight: 800; font-size: 1.05rem; white-space: nowrap; margin-right: 6px; }
.ds-nguoi { display: flex; gap: 6px; flex: 1; justify-content: center; }
.nguoi { position: relative; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.9); border-radius: 999px; padding: 3px 12px 3px 3px; font-size: .85rem; font-weight: 700; transition: transform .2s, box-shadow .2s; white-space: nowrap; border: 3px solid transparent; }
.nguoi .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--c, #ddd); }
.nguoi.luot { transform: scale(1.08); border-color: var(--vang); box-shadow: 0 0 0 4px rgba(255, 212, 59, .45), var(--bong); }
.nguoi.luot::after { content: ''; position: absolute; inset: -9px; border-radius: inherit; border: 4px solid rgba(255, 212, 59, .3); pointer-events: none; animation: nhip-luot calc(1.2s * var(--tg, 1)) ease-in-out infinite; will-change: opacity, transform; } /* lớp riêng: nhịp lượt không vẽ lại cả trang trên máy không GPU */
@keyframes nhip-luot { 50% { opacity: 0; transform: scale(.96); } }
.cl0 .nguoi.luot::after { animation: none; }
.nguoi .bong-chat { position: absolute; top: 110%; left: 50%; transform: translateX(-50%); background: var(--mat); border-radius: 14px; padding: 4px 10px; font-size: 1.4rem; box-shadow: var(--bong-lon); z-index: 20; white-space: nowrap; }
.nguoi .bong-chat.chu { font-size: .9rem; }
.khung-tro { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.bang-emoji { position: absolute; right: 10px; top: 56px; background: var(--mat); border-radius: 18px; padding: 10px; box-shadow: var(--bong-lon); display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; z-index: 30; width: 260px; }
.bang-emoji button { border: 0; background: transparent; font-size: 1.6rem; cursor: pointer; border-radius: 10px; padding: 4px; }
.bang-emoji button:hover { background: var(--mat-2); }
.bang-emoji .cau { grid-column: 1 / -1; font-size: .85rem; text-align: left; padding: 6px 10px; background: var(--mat-2); }
.man-ket { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20,10,60,.45); z-index: 40; backdrop-filter: blur(2px); }
.man-ket .th-the { text-align: center; min-width: min(380px, 92vw); }
.man-ket h2 { font-size: 2.4rem; margin: 6px 0; }
.man-ket .lon-bt { font-size: 72px; }
.man-chuyen-may { position: absolute; inset: 0; z-index: 35; display: grid; place-items: center; background: linear-gradient(135deg, #7c5cff, #ff5ca8); color: #fff; text-align: center; cursor: pointer; }
.man-chuyen-may .av { font-size: 90px; }
@media (max-width: 640px) {
  .thanh-tren .ten-tro { display: none; }
  .nguoi { padding-right: 6px; } .nguoi .ten-n { display: none; }
}

/* Ảnh Blender gói 4–5: nền sảnh, logo, ảnh bìa trò */

/* Ván dở */
.van-do { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #e6fcf5; border: 2px solid var(--la); border-radius: 16px; padding: 10px 12px; margin: 10px 0 4px; }
.van-do > div { flex: 1; min-width: 150px; }
.van-do b { display: block; }
.van-do small { color: var(--chu-nhat); }

/* ===== Theo thiết bị (TH.thietBi, HOP-DONG mục 13) ===== */
.nut-ngan-keo, .nut-toan-man, .nhac-xoay { display: none !important; }
/* Điện thoại / máy tính bảng: nút đủ lớn để chạm */
.cham .th-nut { min-height: 44px; }
.cham .th-nut.tron { min-width: 44px; min-height: 44px; }
.cham .nhom-chon button { min-height: 40px; }
.cham:not(.ung-dung) .man-choi .nut-toan-man { display: inline-flex !important; }

/* Điện thoại xoay ngang: chiều cao thấp, tận dụng chiều ngang */
/* Ngăn kéo: trò gắn class th-bang-ben cho bảng bên; trên điện thoại ngang bảng trượt ra từ phải */
.tb-dt-ngang .man-choi:has(.th-bang-ben) .nut-ngan-keo { display: inline-flex !important; }
.tb-dt-ngang .th-bang-ben { position: absolute !important; top: 0; right: 0; bottom: 0; left: auto !important; width: min(340px, 48vw) !important; max-width: none !important; height: auto !important;
  z-index: 60; overflow-y: auto; background: var(--mat); box-shadow: -10px 0 30px rgba(0,0,0,.3); padding: 10px 10px 10px 12px; padding-right: calc(10px + env(safe-area-inset-right));
  transform: translateX(105%); transition: transform .25s cubic-bezier(.3,.8,.4,1); }
.tb-dt-ngang .th-bang-ben.mo { transform: none; }
.tb-dt-ngang .man-choi.ngan-keo-mo .nut-ngan-keo { background: var(--chinh); color: #fff; }
/* Nhắc xoay ngang (trò có huongUuTien: 'ngang') */
.tb-dt-doc .nhac-xoay { display: flex !important; position: absolute; left: 50%; top: calc(62px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 45; align-items: center; gap: 8px;
  background: rgba(20,10,60,.88); color: #fff; padding: 6px 6px 6px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; box-shadow: var(--bong-lon); width: max-content; max-width: 94vw; }
.nhac-xoay .i { display: inline-block; animation: th-xoay 1.6s ease-in-out infinite; }
@keyframes th-xoay { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* PC: bảng rộng, hover */

/* Nhiệm vụ hôm nay + thành tích (HOP-DONG mục 14) */
.hop-thanh-tich { width: min(720px, 94vw); }
.bang-thanh-tich h3 { margin: 14px 0 6px; font-size: 1rem; color: var(--chinh); }
.tt-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tt { display: flex; gap: 10px; align-items: center; background: var(--mat-2); border-radius: 12px; padding: 8px 10px; filter: grayscale(.6); opacity: .8; }
.tt.dat { filter: none; opacity: 1; background: #fff8e1; box-shadow: inset 0 0 0 2px var(--vang); }
.tt-bt { font-size: 26px; }
.tt > div:nth-child(2) { flex: 1; min-width: 0; }
.tt b { display: block; font-size: .88rem; } .tt small { color: var(--chu-nhat); font-size: .75rem; }
.tt-xu { font-size: .75rem; font-weight: 800; color: var(--cam); white-space: nowrap; }
.tt-thanh { height: 5px; border-radius: 3px; background: #ddd8ff; margin-top: 4px; overflow: hidden; } .tt-thanh i { display: block; height: 100%; background: var(--chinh); }

/* ===== Theme trắng/hồng: sảnh, phòng, màn chơi ===== */
.chip-xu { display: inline-flex; align-items: center; gap: 4px; }
.chip-xu .th-ic { color: var(--vang); }
/* hộp chọn chế độ */
.hop-che-do .dau-tro .bt.co-bia { width: 96px; height: 60px; --rong-anh: 96px; background-color: transparent; box-shadow: var(--bong); border-radius: 12px; }
.che-do .i { line-height: 0; display: flex; justify-content: center; color: var(--chinh); }
.che-do .i svg { width: 34px; height: 34px; }
.theme-trang .che-do { border-color: var(--vien); }
.theme-trang .che-do.bat { border-color: var(--chinh); background: var(--mat-2); }
.theme-trang .nhom-chon button { border-color: var(--vien); }
.theme-trang .nhom-chon button.bat { border-color: var(--chinh); background: var(--chinh); }
.theme-trang .ghi-chu { background: var(--mat-2); }
.theme-trang .van-do { background: var(--mat-2); border-color: var(--chinh); }
.luoi-avatar { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin: 12px 0; max-height: 236px; overflow-y: auto; padding: 2px; }
.chon-av { border: 2px solid transparent; background: var(--mat-2); border-radius: 16px; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.chon-av .th-av { --av: 52px; }
.chon-av.bat { border-color: var(--chinh); background: var(--mat); }
/* thành tích */
.tt-bt { line-height: 0; color: var(--chu-nhat); } .tt-bt svg { width: 28px; height: 28px; }
.tt.dat .tt-bt { color: var(--vang); }
.tt-xu { display: inline-flex; align-items: center; gap: 3px; } .tt-xu .th-ic { color: var(--vang); }
.theme-trang .tt.dat { background: var(--mat); box-shadow: inset 0 0 0 2px var(--chinh); }
.theme-trang .bang-thanh-tich h3 { color: var(--chinh); }
/* phòng online */
.ghe .av.th-av { --av: 44px; }
.theme-trang .ghe { background: var(--mat-2); }
.theme-trang .ghe.trong { border-color: var(--vien); }
.theme-trang .ma-phong .ma { color: var(--chinh); background: var(--mat-2); }
/* màn chơi */
.theme-trang .man-choi { background: var(--nen-choi, linear-gradient(180deg, #fff 0%, #fff4f8 100%)); }
.theme-trang .thanh-tren { background: var(--mat); border-bottom: 1px solid var(--vien); backdrop-filter: none; }
.theme-trang .thanh-tren .ten-tro { color: var(--chu); }
.nguoi .av.th-av { --av: 30px; }
.theme-trang .nguoi { box-shadow: inset 0 0 0 1.5px var(--vien); }
.man-chuyen-may .av.th-av { --av: 120px; margin: 0 auto 10px; }
.theme-trang .man-chuyen-may { background: linear-gradient(135deg, #ff8ab5, #ec4f8c); }
.man-ket .lon-bt { line-height: 0; display: flex; justify-content: center; color: var(--vang); }
.man-ket .lon-bt svg { width: 72px; height: 72px; }
.man-ket .lon-bt.bt-buon { color: var(--chu-nhat); } .man-ket .lon-bt.bt-xinHoa { color: var(--xanh); }
.theme-trang .man-ket { background: rgba(42,34,48,.25); }
.nguoi .bong-chat .th-sticker { width: 1.8em; height: 1.8em; }
.bang-emoji button .th-sticker { width: 34px; height: 34px; margin: auto; }
.nhac-xoay .i svg { width: 20px; height: 20px; }
.theme-trang .nhac-xoay { background: rgba(42,34,48,.9); }

/* core/css/app.css */
/* LÕI — khung ứng dụng kiểu điện thoại (HOP-DONG mục 17). Nạp sau theme.css và ui.css.
   Một giao diện cho cả 3 loại máy: điện thoại dọc (kieu-doc), điện thoại ngang (kieu-ngang),
   PC = khung điện thoại đặt giữa cửa sổ (khung-pc + khung-ngang | khung-doc | khung-toan). */

/* ---------- Kích thước chuẩn (token) ---------- */
:root {
  --co-1: 11px; --co-2: 12.5px; --co-3: 14px; --co-4: 16px; --co-5: 19px; --co-6: 24px;   /* cỡ chữ */
  --cham: 44px; --cham-nho: 36px;                                                     /* vùng chạm */
  --k1: 4px; --k2: 8px; --k3: 12px; --k4: 16px; --k5: 24px;                          /* khoảng cách */
  --bo-1: 10px; --bo-2: 14px; --bo-3: 20px;                                           /* bo góc */
  --cao-dau: 52px; --cao-nav: 56px; --rong-nav: 74px; --cao-thanh-choi: 44px;       /* thanh trên, thanh điều hướng */
  --an-tren: env(safe-area-inset-top, 0px); --an-duoi: env(safe-area-inset-bottom, 0px);
  --an-trai: env(safe-area-inset-left, 0px); --an-phai: env(safe-area-inset-right, 0px);
  --app-w: 100vw; --app-h: 100vh;   /* lõi ghi đè bằng cỡ khung thật (px) */
  --nen-app: #fbf9fa;
}
.kieu-ngang { --cao-dau: 46px; --cao-thanh-choi: 40px; }
.khung-pc { --an-tren: 0px; --an-duoi: 0px; --an-trai: 0px; --an-phai: 0px; }
html:not(.theme-trang) { --vien: #e6e0ff; --hong-nhat: #ece6ff; --nen-app: transparent; }

/* ---------- Khung ---------- */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: manipulation; }
#khung-app { position: fixed; inset: 0; overflow: hidden; contain: layout paint; font-size: var(--co-3); background: var(--nen-app); }
.dang-tai { display: grid; place-items: center; height: 100%; font: 700 var(--co-4) var(--font); color: var(--chu-nhat); }
/* PC: khung điện thoại giữa cửa sổ */
.khung-pc body { background: radial-gradient(900px 600px at 20% 10%, #ffe3ee 0%, transparent 60%), radial-gradient(800px 600px at 85% 90%, #f3e6ff 0%, transparent 60%), #f6eff2; }
html.khung-pc:not(.theme-trang) body { background: #1c1440; }
html.khung-pc:not(.theme-trang) #khung-app { background: radial-gradient(1200px 700px at 15% 10%, #8a6bff 0%, transparent 60%), linear-gradient(135deg, var(--nen), var(--nen-2)); }
.khung-pc #khung-app { margin: auto; border-radius: 22px; box-shadow: 0 24px 60px rgba(42, 34, 48, .18), 0 0 0 1px rgba(42, 34, 48, .06); }
.khung-ngang #khung-app { width: min(calc(100vw - 32px), 1280px); height: min(calc(100vh - 32px), 800px); }
.khung-doc #khung-app { width: min(calc(100vw - 32px), 430px); height: min(calc(100vh - 32px), 900px); }
.khung-toan #khung-app { width: auto; height: auto; border-radius: 0; box-shadow: none; }
@media (max-width: 760px), (max-height: 500px) {
  .khung-ngang #khung-app, .khung-doc #khung-app { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
}
.app-than, .th-hop, .bb-than { scrollbar-width: thin; scrollbar-color: var(--vien) transparent; }

/* ---------- Nút, ô chọn: gọn ---------- */
.th-nut { font-size: var(--co-3); padding: .62em 1.15em; }
.th-nut.nho { font-size: var(--co-2); padding: .48em .9em; }
.th-nut.lon { font-size: var(--co-4); padding: .72em 1.4em; }
.th-nut.tron { width: 2.6em; height: 2.6em; padding: 0; }
.th-nut.tron.nho { width: var(--cham-nho); height: var(--cham-nho); min-width: var(--cham-nho); min-height: var(--cham-nho); font-size: 13px; flex: none; position: relative; }
.th-nut.tron.nho::after { content: ''; position: absolute; inset: -4px; }   /* vùng chạm 44px */
.th-o-nhap { font-size: var(--co-4); padding: .55em .8em; border-width: 1.5px; }
/* Ô chọn kiểu "segmented" */
.nhom-chon { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 19px; background: var(--mat-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; align-self: flex-start; }
.nhom-chon::-webkit-scrollbar { display: none; }
.nhom-chon button, .theme-trang .nhom-chon button { border: 0; background: transparent; color: var(--chu-nhat); border-radius: 999px; padding: 0 12px; height: 32px; min-height: 32px;
  font: 700 var(--co-2) var(--font); white-space: nowrap; flex: none; cursor: pointer; position: relative; }
.nhom-chon button::after { content: ''; position: absolute; inset: -6px 0; }
.nhom-chon button.bat, .theme-trang .nhom-chon button.bat { background: var(--chinh); color: #fff; box-shadow: 0 1px 4px rgba(42, 34, 48, .15); }
.cham .nhom-chon button { min-height: 32px; }

/* ---------- Thanh trên ---------- */
.app-dau { grid-area: dau; display: flex; align-items: center; gap: var(--k2); min-width: 0;
  height: calc(var(--cao-dau) + var(--an-tren)); padding: var(--an-tren) calc(var(--k3) + var(--an-phai)) 0 calc(var(--k3) + var(--an-trai));
  background: var(--mat); border-bottom: 1px solid var(--vien); z-index: 3; }
.app-tieu-de { flex: 1; min-width: 0; margin: 0; font-size: var(--co-5); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-dau .logo { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--k2); color: var(--chu); }
.app-dau .logo img { height: 32px; width: auto; display: block; }
.kieu-ngang .app-dau .logo img { height: 28px; }
/* Logo co lại khi đầu sảnh hẹp (không bị đồng xu che); bản chữ trắng logo-toi chỉ hiện ở theme Tối */
.app-dau .logo img { max-width: 100%; object-fit: contain; object-position: left center; }
.app-dau .logo img.logo-toi, .bang-toi .app-dau .logo:has(.logo-toi) img.logo-sang { display: none; }
.bang-toi .app-dau .logo img.logo-toi { display: block; }
.app-dau .logo .huy-hieu { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--chinh); color: #fff; flex: none; }
.app-dau .logo .huy-hieu svg { width: 20px; height: 20px; }
.app-dau .logo h1 { margin: 0; font-size: var(--co-4); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-dau-phai { display: flex; align-items: center; gap: 6px; flex: none; }
.chip-xu { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--mat-2);
  font: 800 var(--co-2) var(--font); color: var(--chu); cursor: pointer; white-space: nowrap; }
.chip-xu .th-ic { color: var(--vang); }
.nut-av { border: 0; background: none; padding: 0; width: var(--cham-nho); height: var(--cham-nho); border-radius: 50%; cursor: pointer; flex: none; display: grid; place-items: center; }
.nut-av .th-av { --av: 34px; box-shadow: 0 0 0 2px var(--hong-nhat); }
.nut-ngon-ngu span { font-size: var(--co-1); font-weight: 900; letter-spacing: .02em; }

/* ---------- Màn kiểu ứng dụng (sảnh, phòng) ---------- */
.man.man-app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "dau" "than" "nav"; background: var(--nen-app); overflow: hidden; padding: 0; }
.kieu-ngang .man.sanh.man-app { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "nav dau" "nav than"; }
.kieu-ngang .sanh .app-dau { padding-left: var(--k4); }
.man.phong.man-app { grid-template-areas: "dau" "than" "chan"; }
.app-than { grid-area: than; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--k3); padding: var(--k3) calc(var(--k3) + var(--an-phai)) var(--k4) calc(var(--k3) + var(--an-trai)); }
.kieu-ngang .sanh .app-than { padding-left: var(--k4); padding-bottom: calc(var(--k3) + var(--an-duoi)); }
.app-chan { grid-area: chan; background: var(--mat); border-top: 1px solid var(--vien); padding: var(--k2) calc(var(--k3) + var(--an-phai)) calc(var(--k2) + var(--an-duoi)) calc(var(--k3) + var(--an-trai)); }
.app-chan .nut-hang { display: flex; gap: var(--k2); margin: 0; }
.app-chan .nut-hang .th-nut { flex: 1 1 0; min-width: 0; }
.kieu-ngang .app-chan .nut-hang { justify-content: flex-end; } .kieu-ngang .app-chan .nut-hang .th-nut { flex: 0 1 220px; }
.app-the { flex: none; background: var(--mat); border-radius: var(--bo-3); box-shadow: inset 0 0 0 1px var(--vien); padding: var(--k3); min-width: 0; }
.app-the h3 { display: flex; align-items: center; gap: var(--k2); margin: 0 0 var(--k2); font-size: var(--co-4); font-weight: 800; }
.app-the h3 .th-ic { color: var(--chinh); }
.app-goi-y { margin: 0 0 var(--k3); color: var(--chu-nhat); font-size: var(--co-2); line-height: 1.4; }
.hai-cot { display: flex; flex-direction: column; gap: var(--k3); min-height: 0; }
.kieu-ngang .hai-cot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; flex: 1; }

/* ---------- Thanh điều hướng: dưới (dọc) / cột trái (ngang) ---------- */
.app-nav { grid-area: nav; display: flex; align-items: stretch; background: var(--mat); border-top: 1px solid var(--vien); z-index: 3;
  height: calc(var(--cao-nav) + var(--an-duoi)); padding: 0 var(--an-phai) var(--an-duoi) var(--an-trai); }
.kieu-ngang .app-nav { flex-direction: column; justify-content: center; gap: 4px; height: auto; width: calc(var(--rong-nav) + var(--an-trai));
  border-top: 0; border-right: 1px solid var(--vien); padding: calc(6px + var(--an-tren)) 0 calc(6px + var(--an-duoi)) var(--an-trai); }
.nav-o, .man-app .app-nav .th-nut.bb-nut { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--chu-nhat); font: 700 var(--co-1)/1.1 var(--font); padding: 4px 2px; min-height: var(--cham);
  cursor: pointer; position: relative; transform: none; filter: none; }
.kieu-ngang .nav-o, .kieu-ngang .man-app .app-nav .th-nut.bb-nut { flex: 0 0 auto; height: 56px; }
.nav-o > .th-ic, .man-app .app-nav .bb-nut > .th-ic { padding: 4px 16px; border-radius: 999px; transition: background .15s; }
.nav-o .th-ic svg, .man-app .app-nav .bb-nut .th-ic svg { width: 22px; height: 22px; }
.nav-o > span, .man-app .app-nav .bb-nut .bb-chu { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-o.bat { color: var(--chinh); }
.nav-o.bat > .th-ic { background: var(--hong-nhat); }
.tb-pc .nav-o:hover, .tb-pc .man-app .app-nav .bb-nut:hover { color: var(--chu); }
.man-app .app-nav .bb-nut .bb-dem { top: 2px; right: calc(50% - 26px); }
.kieu-ngang .man-app .app-nav .bb-nut .bb-dem { top: 4px; }

/* ---------- Trang Trò chơi ---------- */
.app-loc { display: flex; gap: 6px; flex: none; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--k3)); padding: 2px var(--k3); }
.app-loc::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--mat); box-shadow: inset 0 0 0 1.5px var(--vien);
  color: var(--chu-nhat); font: 700 var(--co-2) var(--font); cursor: pointer; position: relative; white-space: nowrap; }
.chip::after { content: ''; position: absolute; inset: -6px 0; }
.chip.bat { background: var(--chinh); color: #fff; box-shadow: none; }
.nv-gon { flex: none; display: flex; align-items: center; gap: var(--k2); height: var(--cham); padding: 0 var(--k3); border: 0; border-radius: var(--bo-2);
  background: var(--mat); box-shadow: inset 0 0 0 1px var(--vien); font: inherit; color: var(--chu); cursor: pointer; text-align: left; min-width: 0; }
.nv-gon > .th-ic:first-child { color: var(--chinh); }
.nv-gon > .th-ic:last-child { color: var(--chu-nhat); }
.nv-gon b { font-size: var(--co-2); white-space: nowrap; }
.nv-gon-ten { flex: 1; min-width: 0; font-size: var(--co-2); color: var(--chu-nhat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-cham { display: flex; gap: 3px; flex: none; }
.nv-cham i { width: 14px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--chinh) var(--p), var(--hong-nhat) var(--p)); }
.nv-cham i.xong { background: var(--la); }
.nv-gon-so { font: 800 var(--co-2) var(--font); color: var(--chinh); flex: none; }
.kieu-doc .nv-gon b { display: none; }
.app-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--k3) 10px; align-content: start; }
.kieu-ngang .app-luoi { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.kieu-ngang .trang-tro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; }
.kieu-ngang .trang-tro .app-luoi { grid-column: 1 / -1; }
.kieu-ngang .trang-tro .app-loc { margin-right: 0; }
.kieu-ngang .trang-tro .nv-gon { height: 36px; }
.kieu-ngang .trang-tro .nv-gon-ten { display: none; }
.khung-pc.kieu-ngang .app-luoi { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--k4) 14px; }
.o-tro { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; background: none; font: inherit; color: var(--chu); cursor: pointer; text-align: left; position: relative; min-width: 0; container-type: inline-size; }
.o-bia { display: block; width: 100%; aspect-ratio: 8 / 5; border-radius: var(--bo-2); background-color: var(--mat-2); background-repeat: no-repeat; --rong-anh: 100cqw;
  box-shadow: 0 2px 8px rgba(42, 34, 48, .10); transition: transform .15s, box-shadow .15s; }
.o-bia.khong-anh { display: grid; place-items: center; background: linear-gradient(150deg, var(--a), var(--b)); color: #fff; }
.o-bia.khong-anh svg { width: 38%; height: auto; }
.o-tro:active .o-bia { transform: scale(.96); }
.tb-pc .o-tro:hover .o-bia { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(42, 34, 48, .16); }
.o-ten { font: 700 var(--co-2)/1.25 var(--font); padding: 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.khung-pc.kieu-ngang .o-ten { font-size: var(--co-3); }
.o-nhan { position: absolute; top: 6px; right: 6px; font: 800 var(--co-1)/1 var(--font); padding: 4px 7px; border-radius: 999px; background: var(--mat); color: var(--chu); box-shadow: var(--bong); }
.o-nhan.moi { background: var(--chinh); color: #fff; }
.o-tro.sap-co .o-bia { filter: saturate(.4) opacity(.8); }
.luoi-nho { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) !important; gap: 10px 8px !important; }
.o-tro.nho { gap: 3px; } .o-tro.nho .o-ten { font-size: var(--co-1); }
.o-tro.nho .o-bia { border-radius: var(--bo-1); }

/* ---------- Trang Phòng ---------- */
.hang-ma { display: flex; gap: var(--k2); }
.o-ma { flex: 1; min-width: 0; height: var(--cham); padding: 0 8px; font-size: 20px; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; text-align: center; }
.hang-ma .th-nut { flex: none; min-width: 84px; }
.o-ma::placeholder { font-size: var(--co-3); letter-spacing: .08em; font-weight: 600; color: var(--chu-nhat); opacity: .7; }
.kieu-ngang .trang-phong { display: grid; grid-template-columns: minmax(230px, 34%) minmax(0, 1fr); align-items: start; align-content: start; }

/* ---------- Trang Nhiệm vụ ---------- */
.seg-trang { display: flex; width: 100%; flex: none; }
.seg-trang button { flex: 1 1 0; }
.kieu-ngang .seg-trang { display: none; }
.kieu-doc .trang-nhiemVu.xem-homNay .cot-thanhTich, .kieu-doc .trang-nhiemVu.xem-thanhTich .cot-homNay { display: none; }
.kieu-doc .trang-nhiemVu:not(.xem-xepHang) .cot-xepHang, .kieu-doc .trang-nhiemVu.xem-xepHang .cot-homNay, .kieu-doc .trang-nhiemVu.xem-xepHang .cot-thanhTich { display: none; }
.kieu-ngang .trang-nhiemVu .hai-cot.co-xh { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nvt-dau { margin-top: var(--k3); }
.nvt-dau small { margin-left: auto; font-size: var(--co-1); font-weight: 700; color: var(--chu-nhat); }
.kieu-ngang .trang-nhiemVu .hai-cot { height: 100%; align-items: stretch; }
.kieu-ngang .trang-nhiemVu .app-the { overflow-y: auto; min-height: 0; }
.dong-nv, .dong-tt { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--vien); min-height: 52px; }
.dong-tt { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.app-the h3 + .dong-nv, .app-the h3 + .dong-tt { border-top: 0; }
.dn-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--mat-2); color: var(--chinh); display: grid; place-items: center; flex: none; }
.dn-ic svg { width: 20px; height: 20px; }
.dong-nv.xong .dn-ic { background: color-mix(in srgb, var(--la) 14%, #fff); color: var(--la); }
.dn-giua { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.dn-giua b { font-size: var(--co-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thanh-tien { display: block; height: 6px; border-radius: 3px; background: var(--hong-nhat); overflow: hidden; }
.thanh-tien i { display: block; height: 100%; background: var(--chinh); border-radius: 3px; }
.dong-nv.xong .thanh-tien i { background: var(--la); }
.dn-so { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-size: var(--co-1); font-weight: 700; color: var(--chu-nhat); }
.dn-xu { display: inline-flex; align-items: center; gap: 3px; color: var(--cam); font-size: var(--co-2); }
.dn-xu .th-ic { color: var(--vang); }
.dong-tt > .th-ic:last-child { color: var(--chu-nhat); }

/* ---------- Trang Tôi ---------- */
.hs-dong { display: flex; align-items: center; gap: var(--k3); }
.hs-av.th-av { --av: 56px; box-shadow: 0 0 0 3px var(--hong-nhat); }
.hs-ten { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.hs-ten b { font-size: var(--co-5); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-ten small { color: var(--chu-nhat); font-size: var(--co-2); }
.hs-ten .chip-xu { height: 24px; cursor: default; }
.hs-nut { display: flex; gap: var(--k2); flex-wrap: wrap; margin-top: var(--k3); }
.kieu-ngang .trang-toi .hai-cot { grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); height: 100%; }
.kieu-ngang .trang-toi .the-cai-dat { overflow-y: auto; max-height: 100%; }
.ds-cai-dat .dong-cau-hinh { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; margin: 0; padding: 9px 0; border-top: 1px solid var(--vien); }
.ds-cai-dat .dong-cau-hinh:first-child { border-top: 0; padding-top: 0; }
.ds-cai-dat .dong-cau-hinh > label { min-width: 0; font-size: var(--co-2); font-weight: 700; color: var(--chu-nhat); }
.ds-cai-dat .app-goi-y { margin: 0; font-size: var(--co-1); }
.ds-cai-dat .phien-ban { margin-top: var(--k2); }
.kieu-ngang .ds-cai-dat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--k4); }
.kieu-ngang .ds-cai-dat .dong-cau-hinh:nth-child(2) { border-top: 0; padding-top: 0; }
.kieu-ngang .ds-cai-dat .phien-ban { grid-column: 1 / -1; }
.thanh-am { width: 100%; height: 28px; accent-color: var(--chinh); margin: 0; }

/* ---------- Hộp thoại: tấm trượt từ dưới (dọc), hộp giữa (ngang) ---------- */
.th-hop-nen { position: absolute; padding: 0; }
.theme-trang .th-hop-nen { backdrop-filter: none; }
.th-hop { display: flex; flex-direction: column; width: min(460px, calc(100% - 24px)); min-width: 0; max-width: none; max-height: calc(100% - 24px);
  padding: var(--k4) var(--k4) 0; border-radius: var(--bo-3); overflow-y: auto; overscroll-behavior: contain; }
.th-hop > * { flex: none; }
.th-hop h2 { font-size: var(--co-5); margin: 0 0 var(--k2); }
.th-hop > p { font-size: var(--co-3); line-height: 1.45; margin: 0 0 var(--k2); white-space: pre-line; }
.th-hop > .nut-hang, .tb-dt-ngang .th-hop > .nut-hang { position: sticky; bottom: 0; z-index: 2; display: flex; gap: var(--k2); justify-content: flex-end; flex-wrap: nowrap;
  margin: var(--k3) calc(-1 * var(--k4)) 0; padding: 10px var(--k4) calc(12px + var(--an-duoi)); background: var(--mat); border-top: 1px solid var(--vien); box-shadow: none; }
.th-hop > .nut-hang .th-nut { flex: 1 1 0; min-width: 0; }
.kieu-doc .th-hop-nen { align-items: flex-end; }
.kieu-doc .th-hop { width: 100%; max-height: 92%; border-radius: var(--bo-3) var(--bo-3) 0 0; border-bottom: 0; scale: 1 !important; animation: th-truot-len calc(.22s * var(--tg, 1)) ease-out; }
.kieu-doc .th-hop::before { content: ''; display: block; flex: none; width: 36px; height: 4px; border-radius: 2px; background: var(--vien); margin: -6px auto 8px; }
@keyframes th-truot-len { from { transform: translateY(30%); opacity: .4; } }
.kieu-ngang .th-hop { max-height: calc(100% - 16px); }
.cl0 .kieu-doc .th-hop, .cl0.kieu-doc .th-hop { animation: none; }

/* Hộp chọn chế độ */
.hop-cd { padding-top: var(--k3); }
.kieu-doc .hop-cd { padding-top: var(--k2); }
.hop-che-do .dau-tro { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.hop-che-do .dau-tro .bt, .hop-che-do .dau-tro .bt.co-bia { width: 80px; height: 50px; --rong-anh: 80px; border-radius: var(--bo-1); font-size: 26px; flex: none; }
.hop-che-do .dau-tro .bt svg { width: 30px; height: 30px; }
.dau-tro-chu { flex: 1; min-width: 0; }
.dau-tro-chu h2 { margin: 0; font-size: var(--co-5); line-height: 1.2; }
.hop-che-do .dau-tro-chu p { margin: 2px 0 0; font-size: var(--co-2); line-height: 1.35; color: var(--chu-nhat); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nut-dong-hop { align-self: flex-start; }
.cac-che-do { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 var(--k2); }
.che-do, .theme-trang .che-do { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; border-radius: var(--bo-2);
  border: 1.5px solid var(--vien); background: var(--mat); text-align: center; min-height: 58px; }
.che-do:hover { transform: none; }
.che-do .i { font-size: 1em; } .che-do .i svg { width: 24px; height: 24px; }
.che-do b { font-size: var(--co-2); margin: 0; }
.che-do small { display: none; }
.che-do.bat, .theme-trang .che-do.bat { border-color: var(--chinh); background: var(--mat-2); }
.van-do { gap: 8px; padding: 8px 10px; margin: 0 0 var(--k2); border-radius: var(--bo-2); border-width: 1.5px; }
.van-do > div { min-width: 120px; } .van-do b { font-size: var(--co-3); } .van-do small { font-size: var(--co-1); }
.cd-tuy-chon .dong-cau-hinh { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; margin: 0; padding: 7px 0; border-top: 1px solid var(--vien); }
.cd-tuy-chon .dong-cau-hinh > label { min-width: 0; font-size: var(--co-2); font-weight: 700; color: var(--chu-nhat); }
.cd-tuy-chon .ghi-chu { margin: 4px 0 6px; }
.kieu-ngang .hop-cd { width: min(780px, calc(100% - 24px)); }
.kieu-ngang .hop-che-do { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: var(--k4); }
.kieu-ngang .cac-che-do { grid-template-columns: 1fr; }
.kieu-ngang .che-do { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 6px 10px; min-height: 44px; }
.kieu-ngang .cd-tuy-chon .dong-cau-hinh:first-child { border-top: 0; padding-top: 0; }
.kieu-ngang .hop-cd .nut-hang { justify-content: flex-end; } .kieu-ngang .hop-cd .nut-hang .th-nut { flex: 0 1 240px; }
.ghi-chu { font-size: var(--co-2); margin-top: 10px; padding: 8px 10px; border-radius: var(--bo-1); }

/* ---------- Phòng chờ online ---------- */
.ma-phong { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.ma-phong small { width: 100%; color: var(--chu-nhat); font-weight: 700; font-size: var(--co-2); }
.ma-phong .ma { font-size: 28px; letter-spacing: .2em; padding: 2px 12px; border-radius: 12px; }
.phong-than .ds-ghe { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--k2); }
.phong-than .ghe { padding: 8px; min-height: 56px; border-radius: var(--bo-2); gap: 8px; }
.phong-than .ghe .av.th-av { --av: 38px; }
.phong-than .ghe > div { min-width: 0; }
.phong-than .ghe b { font-size: var(--co-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kieu-ngang .phong-than { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; align-content: start; }
.khung-pc.kieu-ngang .phong-than .ds-ghe { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Màn chơi ---------- */
.man-choi { padding: 0 !important; }
/* Họa tiết nền màn chơi: ảnh mask sanh/hoa-tiet, theme tự tô màu (--hoa-tiet-mau, --hoa-tiet-dam) */
.man-choi { isolation: isolate; }
.co-hoa-tiet .man-choi::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--hoa-tiet-mau, var(--chinh)); opacity: var(--hoa-tiet-dam, .09);
  -webkit-mask: var(--anh-hoa-tiet, none) repeat; mask: var(--anh-hoa-tiet, none) repeat; -webkit-mask-size: 320px; mask-size: 320px; }
/* Trò tự vẽ nền riêng thì tắt họa tiết: thêm lớp khong-hoa-tiet vào khung trò (Ô Ăn Quan sân đất) */
.co-hoa-tiet .man-choi:has(.khong-hoa-tiet, .tro-o-an-quan)::before { display: none; }
.thanh-tren, .tb-dt-ngang .thanh-tren { flex: none; height: calc(var(--cao-thanh-choi) + var(--an-tren)); gap: 6px; scrollbar-width: none;
  padding: var(--an-tren) calc(8px + var(--an-phai)) 0 calc(8px + var(--an-trai)); }
.thanh-tren::-webkit-scrollbar { display: none; }
.thanh-tren .ten-tro { font-size: var(--co-3); }
.nguoi, .tb-dt-ngang .thanh-tren .nguoi { font-size: var(--co-2); padding: 2px 10px 2px 2px; border-width: 2px; }
.nguoi .av.th-av { --av: 26px; }
/* Ký hiệu ghế cạnh màu (Đợt 4): hình riêng mỗi ghế, cùng màu ghế, nằm ở góc dưới ảnh đại diện */
.nguoi .ky-hieu-ghe { position: absolute; left: 18px; bottom: -1px; width: 13px; height: 13px; color: var(--c, var(--chinh)); pointer-events: none; display: block; }
.nguoi .ky-hieu-ghe svg { width: 100%; height: 100%; display: block; }
.co-lon .nguoi .ky-hieu-ghe { left: 23px; width: 15px; height: 15px; }
.nguoi .ten-n { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.nguoi.luot { transform: scale(1.04); }
.kieu-doc .thanh-tren .ten-tro { display: none; }
.kieu-doc .nguoi .ten-n { max-width: 5.5em; }
.kieu-doc .ds-nguoi:has(> .nguoi:nth-child(4)) .ten-n { display: none; }
.kieu-doc .ds-nguoi:has(> .nguoi:nth-child(4)) .nguoi { padding-right: 2px; }
/* Trò khai nguoiRieng: chip tên ẩn (vẫn giữ trong DOM để lõi cập nhật lượt), tên trò lấp chỗ trống */
.man-choi.nguoi-rieng .thanh-tren .ds-nguoi { display: none; }
.man-choi.nguoi-rieng .thanh-tren .ten-tro, .kieu-doc .man-choi.nguoi-rieng .thanh-tren .ten-tro { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bang-emoji { top: calc(var(--cao-thanh-choi) + var(--an-tren) + 6px); right: calc(8px + var(--an-phai)); width: min(260px, calc(100% - 16px)); }
.man-ket, .theme-trang .man-ket { display: flex; align-items: center; justify-content: center; background: rgba(42, 34, 48, .3); backdrop-filter: none; }
.ket-the { width: min(400px, calc(100% - 24px)); min-width: 0 !important; padding: var(--k4); text-align: center; border-radius: var(--bo-3); max-height: calc(100% - 16px); overflow-y: auto; }
.kieu-doc .man-ket { align-items: flex-end; }
.kieu-doc .ket-the { width: 100%; border-radius: var(--bo-3) var(--bo-3) 0 0; padding-bottom: calc(14px + var(--an-duoi)); scale: 1 !important; animation: th-truot-len calc(.25s * var(--tg, 1)) ease-out; }
.ket-the .lon-bt svg { width: 56px; height: 56px; }
.kieu-ngang .ket-the .lon-bt svg { width: 40px; height: 40px; }
.ket-the h2, .man-ket .ket-the h2 { font-size: var(--co-6); margin: 4px 0; }
.ket-the p { margin: 4px 0; font-size: var(--co-3); }
.ket-nut { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--k2); margin-top: var(--k3); }
.ket-nut .th-nut { width: 100%; min-width: 0; padding: .6em .8em; }
.ket-nut .th-nut.la { grid-column: 1 / -1; order: -1; }
.ket-nut > p { grid-column: 1 / -1; margin: 0; }
.nut-xem-ket { position: absolute; left: calc(12px + var(--an-trai)); bottom: calc(12px + var(--an-duoi)); z-index: 30; }
.nhac-xoay, .tb-dt-doc .nhac-xoay { top: calc(var(--cao-thanh-choi) + var(--an-tren) + 8px); font-size: var(--co-2); }

/* ---------- Thông báo ---------- */
#th-thong-bao { position: absolute; top: calc(var(--cao-dau) + var(--an-tren) + 6px);   /* dưới thanh trên, không che tên người chơi (Lô Tô) */ max-width: calc(100% - 24px); }
.th-tb { font-size: var(--co-2); padding: .55em 1.1em; text-align: center; }
#th-fx { position: absolute; }

/* ---------- Bạn bè, tài khoản trong khung ---------- */
.bb-nen, .tk-man { position: absolute; }
.kieu-doc .bb-ngan { width: 100%; }

/* ---------- Ô trò ở sảnh: dạng danh sách (luoi-ds), Tri chọn 27/10 ---------- */
.o-chu { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.o-phu, .o-di { display: none; }
.o-ten { font-weight: 700; }
.app-luoi.luoi-ds { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.kieu-ngang .app-luoi.luoi-ds { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.luoi-ds .o-tro { flex-direction: row; align-items: center; gap: 10px; background: var(--mat); border-radius: var(--bo-2); padding: 6px 10px 6px 6px; box-shadow: 0 0 0 1px var(--vien); }
.luoi-ds .o-bia { width: 84px; flex: none; --rong-anh: 84px; border-radius: var(--bo-1); box-shadow: none; }
.luoi-ds .o-chu { flex: 1; }
.luoi-ds .o-ten { font-size: var(--co-3); -webkit-line-clamp: 1; padding: 0; }
.luoi-ds .o-phu { display: block; color: var(--chu-nhat); font-size: var(--co-1); font-weight: 600; }
.luoi-ds .o-di { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--hong-nhat); color: var(--chinh); flex: none; }
.luoi-ds .o-di svg { width: 16px; height: 16px; }
.luoi-ds .o-nhan { top: 9px; left: 9px; right: auto; font-size: var(--co-1); padding: 3px 6px; box-shadow: none; }
.tb-pc .luoi-ds .o-tro:hover { box-shadow: 0 0 0 1.5px var(--chinh); }
.tb-pc .luoi-ds .o-tro:hover .o-bia { transform: none; box-shadow: none; }

.luoi-ds .o-nhan.moi::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--chinh); margin-right: 4px; vertical-align: 1px; }
.luoi-ds .o-nhan.moi { background: rgba(255, 255, 255, .94); color: var(--chu); }
.khung-pc.kieu-ngang .app-luoi.luoi-ds { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }

/* ---------- Ba cách chơi (HOP-DONG 17.6): màn chọn + sảnh Với máy / Online / Cùng máy ---------- */
/* Màu riêng mỗi cách chơi: --cd đậm, --cd-nhat nền nhạt */
.cd-may, .o-cd.cd-may { --cd: var(--chinh); --cd-nhat: var(--hong-nhat); }
.cd-online, .o-cd.cd-online { --cd: #2563c9; --cd-nhat: #e3edfc; }
.cd-cungMay, .o-cd.cd-cungMay { --cd: #c2560f; --cd-nhat: #fdeadb; }
.bang-toi .cd-online, .bang-toi .o-cd.cd-online { --cd: #3d7fe6; --cd-nhat: #1f2a3d; }
.bang-toi .cd-cungMay, .bang-toi .o-cd.cd-cungMay { --cd: #d9661a; --cd-nhat: #3a2a1f; }

/* Thanh trên có dải màu: hàng tiêu đề + thanh đổi nhanh */
.app-dau.dau-cd { height: auto; flex-direction: column; align-items: stretch; gap: 0; background: var(--cd); color: #fff; border-bottom: 0; padding-bottom: var(--k2); }
.dau-cd-hang { display: flex; align-items: center; gap: var(--k2); height: var(--cao-dau); min-width: 0; }
.dau-cd .nut-ve-chon, .dau-cd .nut-ve-chon:hover { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; border-color: transparent; }
.dau-cd .chip-xu { background: rgba(255, 255, 255, .2); color: #fff; }
.dau-cd .chip-xu .th-ic { color: #ffd25a; }
.doi-cd { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.doi-cd button { flex: 1 1 0; min-width: 0; height: 36px; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer;
  font: 700 var(--co-2) var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.doi-cd button .th-ic { width: 16px; height: 16px; flex: none; }
.doi-cd button.bat { background: #fff; color: var(--cd); }
.kieu-ngang .app-dau.dau-cd { flex-direction: row; align-items: center; gap: var(--k3); padding-bottom: 0; height: calc(var(--cao-dau) + var(--an-tren)); }
.kieu-ngang .dau-cd-hang { flex: 1; }
.kieu-ngang .doi-cd { flex: 0 1 380px; }
.kieu-ngang .doi-cd button { height: 32px; }

/* Màn chọn: 3 ô màu (Với máy to ở trên, 2 ô nửa ở dưới; màn ngang 3 ô một hàng) */
.chon-hoi { margin: 0; font-size: var(--co-5); font-weight: 800; }
.chon-cd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--k2); flex: none; }
.o-cd { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 128px; padding: var(--k3); border: 0; border-radius: var(--bo-3);
  background: var(--cd); color: #fff; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.o-cd.cd-may { grid-column: 1 / -1; min-height: 140px; }
.o-cd:active { transform: scale(.98); }
.o-cd-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); margin-bottom: auto; }
.o-cd-ic svg { width: 26px; height: 26px; }
.o-cd b { font-size: var(--co-4); font-weight: 800; margin-top: var(--k2); }
.o-cd small { font-size: var(--co-1); font-weight: 600; opacity: .92; line-height: 1.3; }
.kieu-ngang .chon-cd { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kieu-ngang .o-cd.cd-may { grid-column: auto; }
.khung-pc.kieu-ngang .o-cd { min-height: 180px; }
.app-nhan-muc { margin: var(--k1) 0 0; font-size: var(--co-3); font-weight: 800; color: var(--chu); flex: none; }
.gan-day { display: flex; gap: var(--k2); overflow-x: auto; flex: none; padding-bottom: 2px; scrollbar-width: none; }
.o-gan-day { flex: 0 0 116px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 0; border-radius: var(--bo-2); background: var(--mat);
  box-shadow: inset 0 0 0 1px var(--vien); font: inherit; color: var(--chu); text-align: left; cursor: pointer; min-width: 0; container-type: inline-size; }
.o-gan-day .o-bia { border-radius: var(--bo-1); box-shadow: none; margin-bottom: 3px; }
.o-gan-day b { font-size: var(--co-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-gan-day small { font-size: var(--co-1); color: var(--chu-nhat); font-weight: 600; }

/* Sảnh: dòng trò có nút làm ngay bên phải (Chơi / Tiếp / Tạo) */
.o-boc { position: relative; min-width: 0; }
.o-boc .o-tro { width: 100%; padding-right: 96px; }
.luoi-ds .o-boc .o-di { display: none; }
.o-hanh { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); height: 40px; min-width: 76px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--cd, var(--chinh)); color: #fff; font: 800 var(--co-2) var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.o-hanh .th-ic { width: 14px; height: 14px; }
.o-hanh:active { transform: translateY(-50%) scale(.96); }
.o-hanh:disabled { background: var(--mat-2); color: var(--chu-nhat); cursor: default; }
.khong-hop .o-tro { opacity: .55; }
.tb-pc .luoi-ds .o-boc .o-tro:hover { box-shadow: 0 0 0 1.5px var(--cd, var(--chinh)); }
.sanh-may .app-loc .chip.bat, .sanh-online .app-loc .chip.bat, .sanh-cungMay .app-loc .chip.bat { background: var(--cd); color: #fff; }

/* Với máy: hàng chọn độ khó */
.hang-muc-do { display: flex; align-items: center; gap: var(--k2); flex: none; }
.hang-muc-do > span { font-size: var(--co-2); font-weight: 700; color: var(--chu-nhat); white-space: nowrap; }
.hang-muc-do .nhom-chon { flex: 1; }
.hang-muc-do .nhom-chon button.bat { background: var(--cd); }
.kieu-ngang .sanh-may .hang-muc-do { grid-column: 1 / -1; max-width: 420px; }

/* Online + Cùng máy: màn dọc 1 cột, màn ngang 2 cột (trái: vào phòng / người chơi, phải: danh sách trò) */
.sanh-online .hai-cot > div, .sanh-cungMay .hai-cot > div { display: flex; flex-direction: column; gap: var(--k3); min-width: 0; }
.kieu-ngang .sanh-online .hai-cot, .kieu-ngang .sanh-cungMay .hai-cot { grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); flex: none; }
.kieu-ngang .sanh-online, .kieu-ngang .sanh-cungMay, .kieu-ngang .sanh-chon { display: flex; }
.sanh-online .the-vao h3 .th-ic, .sanh-cungMay .cm-the h3 .th-ic { color: var(--cd); }
.sanh-online .the-vao .th-nut.la, .sanh-online .van-online .th-nut.la { --c: var(--cd); }
.so-buoc { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--cd); color: #fff; font-size: var(--co-2); font-weight: 900; flex: none; }
.cm-the h3 { flex-wrap: wrap; }
.cm-the h3 .buoc-so { margin-left: auto; }
.cm-the .buoc-so-gt { color: var(--cd); }
.cm-the .cm-ngoi-o.bat { border-color: var(--cd); background: var(--cd-nhat); }
.cm-the .cm-ngoi-o.bat b, .cm-the .cm-ngoi-o.bat .cm-ngoi-hinh { color: var(--cd); }
.cm-the .app-goi-y { display: block; margin: var(--k2) 0 0; }
.cm-the .nhom-chon button.bat { background: var(--cd); }

/* Ví xu: hộp điểm danh 7 ngày (HOP-DONG 20, core/js/th-vi.js) */
.dd-hop p { margin: 0 0 var(--k2, 8px); }
.dd-luoi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: var(--k2, 8px) 0; }
.dd-o { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: var(--bo-1, 10px);
  background: var(--mat-2, #fff0f6); border: 1.5px solid var(--vien, #f1e4ea); font-size: var(--co-1, 11px); color: var(--chu-nhat, #8b8093); }
.dd-o .th-ic { width: 20px; height: 20px; color: var(--cam, #ff9f4a); }
.dd-o b { font-size: var(--co-2, 12px); color: var(--chu, #2a2230); }
.dd-o.dd-7 { grid-column: span 2; background: color-mix(in srgb, var(--cam, #ff9f4a) 14%, var(--mat, #fff)); }
.dd-o.da { opacity: .55; }
.dd-o.da .dd-ngay::after { content: ' \2713'; color: var(--la, #3ddc97); }
.dd-o.nay { border-color: var(--chinh, #ec4f8c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--chinh, #ec4f8c) 25%, transparent); color: var(--chinh, #ec4f8c); }
.dd-da { font-weight: 700; color: var(--chinh, #ec4f8c); text-align: center; }

/* Hộp tùy chọn mở từ sảnh (17.5): không có danh sách 3 cách chơi, màu theo cách chơi, thẻ tóm tắt bên trái */
.cd-nhan { display: inline-block; font-size: var(--co-1); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--cd); margin-bottom: 1px; }
.hop-cd[class*="cd-"] .nut-bat-dau { --c: var(--cd); }
.hop-cd.cd-online .nhom-chon button.bat, .hop-cd.cd-cungMay .nhom-chon button.bat, .hop-cd.cd-may .nhom-chon button.bat { background: var(--cd); color: #fff; }
.hop-cd.cd-online .buoc-so-gt, .hop-cd.cd-cungMay .buoc-so-gt { color: var(--cd); }
.hop-cd.cd-cungMay .cm-ngoi-o.bat { border-color: var(--cd); background: var(--cd-nhat); }
.hop-cd.cd-cungMay .cm-ngoi-o.bat b, .hop-cd.cd-cungMay .cm-ngoi-o.bat .cm-ngoi-hinh { color: var(--cd); }
.cd-tom-tat { display: flex; flex-direction: column; gap: var(--k2); background: var(--cd-nhat); border-radius: var(--bo-2); padding: var(--k3); }
.cd-vi { display: flex; align-items: flex-start; gap: var(--k2); }
.cd-vi > .th-ic { width: 22px; height: 22px; color: var(--vang); flex: none; margin-top: 1px; }
.cd-vi b { display: block; font-size: var(--co-3); font-weight: 800; }
.cd-vi small { display: block; font-size: var(--co-2); color: var(--chu-nhat); line-height: 1.35; margin-top: 2px; }
.cd-vi.thieu small { color: var(--do); font-weight: 700; }
.cd-buoc { margin: 0; padding: 0; list-style: none; counter-reset: b; display: flex; flex-direction: column; gap: 6px; }
.cd-buoc li { counter-increment: b; display: flex; align-items: center; gap: var(--k2); font-size: var(--co-2); font-weight: 600; line-height: 1.3; }
.cd-buoc li::before { content: counter(b); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--cd); color: #fff; font-size: var(--co-1); font-weight: 900; }
.cd-goi-y { margin: 0; font-size: var(--co-2); line-height: 1.4; color: var(--chu); }
/* Màn dọc: thẻ tóm tắt gọn một dòng ví + bước rút gọn để tùy chọn lên gần */
.kieu-doc .cd-tom-tat { padding: var(--k2) var(--k3); }
.kieu-doc .cd-buoc { flex-direction: row; gap: var(--k2); }
.kieu-doc .cd-buoc li { flex: 1 1 0; flex-direction: column; align-items: flex-start; gap: 3px; font-size: var(--co-1); }
.kieu-doc .cd-tom-tat.chi-goi-y { display: none; }   /* màn dọc: Với máy / Cùng máy bỏ gợi ý để tùy chọn lên gần */
.hop-cd.cd-online .bien-the-mota, .hop-cd.cd-cungMay .bien-the-mota { background: var(--cd-nhat); }

/* ---------- Phòng chờ online, điện thoại ngang (Tri 27/10 16:09: chat đè thanh nút) ----------
   Màn .phong cũ (ui.css) căn giữa nội dung nên vùng giữa cao theo nội dung và tràn xuống thanh nút: kéo giãn lại.
   Ngang: trái = mã + QR (gọn) và ghế (tự cuộn); phải = chat cao hết cột, ô nhập nằm trong thẻ chat. */
.man.phong.man-app { align-items: stretch; justify-items: stretch; overflow: hidden; }
.kieu-ngang:not(.co-lon) .phong-than { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch; gap: var(--k2) var(--k3); overflow: hidden; padding-top: var(--k2); padding-bottom: var(--k2); }
.kieu-ngang:not(.co-lon) .phong-than > .the-ma { grid-column: 1; grid-row: 1; padding: var(--k2) var(--k3); }
.kieu-ngang:not(.co-lon) .phong-than > .the-ghe { grid-column: 1; grid-row: 2; min-height: 0; overflow-y: auto; padding: var(--k2) var(--k3); overscroll-behavior: contain; }
.kieu-ngang:not(.co-lon) .phong-than > .chat-phong { grid-column: 2; grid-row: 1 / span 2; min-height: 0; padding: var(--k2) var(--k3); gap: 6px; }
.kieu-ngang:not(.co-lon) .phong-than > :not(.the-ma):not(.the-ghe):not(.chat-phong) { grid-column: 1 / -1; }
.kieu-ngang:not(.co-lon) .the-ma .ghi-chu { display: none; }   /* hướng dẫn dài: ngang không đủ chỗ */
.kieu-ngang:not(.co-lon) .the-ma .ma-qr { gap: var(--k2); }
.kieu-ngang:not(.co-lon) .the-ma .ma-phong { gap: 4px 8px; }
.kieu-ngang:not(.co-lon) .the-ma .ma-phong small { width: auto; }
.kieu-ngang:not(.co-lon) .the-ma .ma-phong .ma { font-size: 20px; padding: 0 8px; }
.kieu-ngang:not(.co-lon) .the-ma .qr-nho { width: 64px; height: 64px; padding: 3px; }
.kieu-ngang:not(.co-lon) .the-ma .ma-nut .th-nut { min-height: 32px; padding-top: 0; padding-bottom: 0; }
.kieu-ngang:not(.co-lon) .the-ghe .ds-ghe { margin-top: 6px; }
.kieu-ngang:not(.co-lon) .phong-than .ghe { min-height: 48px; padding: 6px; }
.kieu-ngang:not(.co-lon) .phong-than .ghe .av.th-av { --av: 32px; }
.kieu-ngang:not(.co-lon) .chat-phong h3 { font-size: var(--co-3); }
.kieu-ngang:not(.co-lon) .chat-phong .chat-log { flex: 1; min-height: 0; max-height: none; }
.kieu-ngang:not(.co-lon) .chat-phong .chat-stk button { width: 34px; height: 34px; padding: 2px; }
.kieu-ngang:not(.co-lon) .chat-phong .chat-cau { flex: none; }
.kieu-ngang:not(.co-lon) .chat-phong .chat-nhap { flex: none; }
.kieu-ngang:not(.co-lon) .chat-phong .chat-nhap .th-o-nhap { height: 36px; }
.kieu-ngang:not(.co-lon) .man.phong .app-chan { padding-top: 6px; padding-bottom: calc(6px + var(--an-duoi)); }
.co-lon.kieu-ngang .phong-than { height: 100%; align-items: start; grid-template-rows: minmax(0, 1fr); }
.co-lon.kieu-ngang .the-ma .ma-phong .ma { font-size: 22px; letter-spacing: .12em; }
.co-lon.kieu-ngang .phong-than > .chat-phong { align-self: stretch; }
.co-lon.kieu-ngang .phong-than > .chat-phong .chat-log { flex: 1; max-height: none; }
.hop-cd.cd-online .bb-nhac-moi { background: var(--cd-nhat); color: var(--cd); }

/* Cách chơi (HOP-DONG 24) */
.cc-hop { max-height: min(60vh, 460px); overflow-y: auto; text-align: left; }
.cc-ds { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: var(--co-2); line-height: 1.5; }
.cc-ghi { margin: 10px 0 0; font-size: var(--co-1); color: var(--chu-nhat); }
/* Chơi nhanh (HOP-DONG 24): hàng cuộn ngang, màn ngang không bị căn giữa cắt mép */
.sanh-chon > .gan-day, .sanh-chon > .app-nhan-muc { align-self: stretch; max-width: 100%; }
.kieu-ngang .choi-nhanh .o-gan-day { flex-basis: 108px; }
.khung-pc .sanh-chon > .gan-day { justify-content: safe center; }
.khung-pc .sanh-chon > .app-nhan-muc { text-align: center; }
/* 3 cột (có Xếp hạng tuần) trên màn ngang: tên nhiệm vụ xuống 2 dòng thay vì cắt */
.kieu-ngang .trang-nhiemVu .co-xh .dong-nv .dn-giua b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }

/* core/css/bang-mau.css */
/* LÕI — các bảng màu (theme) dựng trên cấu trúc .theme-trang. HOP-DONG mục 18.
   Mỗi theme chỉ đổi biến màu; trò dùng biến (--mat, --mat-2, --chu, --chu-nhat, --chinh, --phu, --vien, --hong-nhat, --nen-app, --nen-choi)
   thì tự hợp mọi theme. Nhẹ cho máy yếu: không blur, không gradient chuyển động. */

/* Trắng hồng (mặc định) */
.bang-trang { --nen-app: #fbf9fa; --nen-choi: linear-gradient(180deg, #fff 0%, #fff4f8 100%); }

/* Tối: nền đen than, chữ sáng, nhấn hồng */
.bang-toi {
  --nen-app: #121117; --nen-choi: #16151b;
  --mat: #1d1b23; --mat-2: #27242f; --chu: #f2eef5; --chu-nhat: #a69eaf;
  --chinh: #ff5c9a; --phu: #ff9cc4; --xanh: #5cb8ff; --la: #3ddc97; --vang: #ffd25a; --cam: #ff9f4a; --do: #ff6b81;
  --vien: #34303d; --hong-nhat: #3a2533;
  --bong: 0 2px 8px rgba(0, 0, 0, .4); --bong-lon: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
.bang-toi .th-hop-nen, .bang-toi .man-ket { background: rgba(0, 0, 0, .55); }
.bang-toi .th-tb { background: #f2eef5; color: #121117; }
.bang-toi .th-o-nhap { background: var(--mat-2); color: var(--chu); }
.bang-toi .o-bia { box-shadow: none; }
/* Nút phụ (.phu) ở theme sáng là màu mực tối: trên nền tối đổi thành nút sáng chữ tối */
.bang-toi .th-nut.phu { --c: #f2eef5; color: #121117; }
.bang-toi .khung-tro:not(.ho-tro-toi) .th-nut.phu { --c: #2a2230; color: #fff; }
.khung-pc.bang-toi body { background: #08070b; }
/* Màn chơi của trò chưa khai hoTroToi giữ bảng màu sáng để chữ luôn đọc được */
.bang-toi .khung-tro:not(.ho-tro-toi) {
  --mat: #ffffff; --mat-2: #fff0f6; --chu: #2a2230; --chu-nhat: #8b8093; --vien: #f1e4ea; --hong-nhat: #ffe3ee;
  --nen-choi: linear-gradient(180deg, #fff 0%, #fff4f8 100%);
  color: var(--chu); color-scheme: light; background: var(--nen-choi);
}

/* Chung cho mọi theme sáng/tối */
.theme-trang .nguoi { background: var(--mat); color: var(--chu); }
.theme-trang .man-choi { background: var(--nen-choi); }

/* Ô chọn theme có mẫu màu (trang Tôi → Cài đặt) */
.chon-theme { display: grid; align-content: start; grid-auto-rows: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.o-theme { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1.5px solid var(--vien); border-radius: var(--bo-2); background: var(--mat);
  color: var(--chu); font: 700 var(--co-2) var(--font); cursor: pointer; text-align: left; min-height: var(--cham); }
.o-theme.bat { border-color: var(--chinh); box-shadow: 0 0 0 2px var(--hong-nhat); }
.o-theme .mau-mau { display: flex; align-items: center; gap: 4px; height: 34px; border-radius: 9px; padding: 0 7px; border: 1px solid rgba(0, 0, 0, .06); }
.o-theme .mau-mau i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.o-theme .mau-mau b { flex: 1; height: 14px; border-radius: 4px; }
.o-theme span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* core/css/choi-chung.css */
/* LÕI — giao diện Cùng máy & Online (HOP-DONG mục 19). Nạp sau app.css và bang-mau.css.
   Máy tính bảng (.co-lon), chuẩn bị cùng máy, màn chuyền máy, đồng hồ lượt, chấm mạng, phòng chờ, chat, chơi lại. */

/* ---------- 19.1 Máy tính bảng: chữ, nút, thanh to hơn khoảng 15% ---------- */
.co-lon {
  --co-1: 12.5px; --co-2: 14px; --co-3: 16px; --co-4: 18px; --co-5: 22px; --co-6: 28px;
  --cham: 50px; --cham-nho: 44px;
  --cao-dau: 58px; --cao-nav: 64px; --rong-nav: 86px; --cao-thanh-choi: 52px;
}
.co-lon.kieu-ngang { --cao-dau: 54px; --cao-thanh-choi: 48px; }
.co-lon .nguoi .av.th-av { --av: 32px; }
.co-lon .nhom-chon button { height: 38px; min-height: 38px; padding: 0 16px; }
.co-lon .th-hop { max-width: min(640px, calc(100% - 48px)); }
.co-lon.kieu-ngang .hop-cd { width: min(900px, calc(100% - 48px)); }

/* ---------- Chấm mạng, chip mạng ---------- */
.av-boc { position: relative; display: inline-grid; flex: none; }
.cham-mang { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--mat); background: var(--chu-nhat); display: none; }
.cham-mang.mang-tot, .cham-mang.mang-yeu, .cham-mang.mang-mat { display: block; }
.mang-tot { --mm: var(--la); } .mang-yeu { --mm: var(--vang); } .mang-mat { --mm: var(--do); }
.cham-mang.mang-tot, .cham-mang.mang-yeu, .cham-mang.mang-mat { background: var(--mm); }
.co-lon .cham-mang { width: 13px; height: 13px; }
.chip-mang { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--mat-2); color: var(--chu);
  font: 700 var(--co-1) var(--font); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip-mang i { width: 8px; height: 8px; border-radius: 50%; background: var(--mm, var(--chu-nhat)); }
.chip-mang.mang-yeu { background: color-mix(in srgb, var(--vang) 20%, var(--mat)); }
.chip-mang.mang-mat { background: color-mix(in srgb, var(--do) 16%, var(--mat)); color: var(--do); }
.kieu-doc .thanh-tren .chip-mang span { display: none; }
.kieu-doc .thanh-tren .chip-mang { padding: 0 8px; }
.nguoi.th-mang-mat, .th-o-ghe.th-mang-mat { opacity: .55; }
.chip-rot { font-size: var(--co-1); font-weight: 700; color: var(--do); }
.chip-rot:empty { display: none; }

/* ---------- 19.4 Đồng hồ lượt ---------- */
.th-thanh-gio { position: absolute; left: 10%; right: 10%; bottom: -2px; height: 3px; border-radius: 2px; display: none; pointer-events: none; z-index: 2;
  background: linear-gradient(to right, var(--chinh) calc(var(--th-gio, 0) * 100%), color-mix(in srgb, var(--chu-nhat) 25%, transparent) 0); }
.th-dem > .th-thanh-gio { display: block; }
.th-gap > .th-thanh-gio { background: linear-gradient(to right, var(--do) calc(var(--th-gio, 0) * 100%), color-mix(in srgb, var(--do) 20%, transparent) 0); }
.nguoi.th-gap { border-color: var(--do); }
.chip-luot { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px; border-radius: 14px;
  background: var(--mat); box-shadow: inset 0 0 0 2px var(--c, var(--chinh)); color: var(--chu); font: 800 var(--co-2) var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip-luot .th-ic svg { width: 15px; height: 15px; }
.chip-luot.gap { background: var(--do); color: #fff; box-shadow: none; animation: th-nhay-gio calc(1s * var(--tg, 1)) steps(2) infinite; }
@keyframes th-nhay-gio { 50% { opacity: .75; } }
.kieu-doc .man-choi:not(.nguoi-rieng) .chip-luot .th-ic { display: none; }
@media (prefers-reduced-motion: reduce) { .chip-luot.gap { animation: none; } }

/* ---------- 19.2 Chuẩn bị Cùng máy (trong hộp chọn chế độ) ---------- */
.cm-nguoi { align-items: stretch !important; flex-direction: column; }
.cm-ds { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.cm-dong { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cm-av { border: 0; padding: 2px; border-radius: 50%; background: var(--c); cursor: pointer; display: grid; position: relative; }
.cm-av .th-av { --av: 32px; box-shadow: 0 0 0 2px var(--mat); }
.cm-av::after { content: ''; position: absolute; inset: -6px; }
.cm-dong .th-o-nhap { padding: .4em .7em; font-size: var(--co-3); min-width: 0; width: 100%; height: 40px; }
.cm-dong .th-o-nhap:disabled { color: var(--chu-nhat); background: var(--mat-2); }
.cm-loai-co-dinh { font: 700 var(--co-2) var(--font); color: var(--chu-nhat); padding: 0 12px; }
.cm-ngoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; width: 100%; }
.cm-ngoi-o { border: 1.5px solid var(--vien); background: var(--mat); border-radius: var(--bo-1); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 600 var(--co-1) var(--font); color: var(--chu-nhat); cursor: pointer; min-height: 44px; }
.cm-ngoi-o b { font-size: var(--co-2); color: var(--chu); }
.cm-ngoi-o.bat { border-color: var(--chinh); background: var(--hong-nhat); }
.cm-ngoi-o.bat b { color: var(--chinh); }
.cm-ngoi-hinh svg { width: 46px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cm-ngoi-hinh svg .d { fill: currentColor; stroke: none; }
.cm-ngoi-o.bat .cm-ngoi-hinh { color: var(--chinh); }

/* ---------- 19.2 Màn chuyền máy (che bài) ---------- */
.man-chuyen-may, .theme-trang .man-chuyen-may { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; overflow: hidden;
  background: #221d27; color: #fff; text-align: center; cursor: default; padding: calc(var(--an-tren) + 12px) calc(var(--an-phai) + 16px) calc(var(--an-duoi) + 12px) calc(var(--an-trai) + 16px); }
.cm-giua { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(420px, 100%); max-height: 100%; }
.cm-tro { font: 600 var(--co-2) var(--font); color: #d9cfe0; background: rgba(255, 255, 255, .08); padding: 4px 12px; border-radius: 999px; }
.cm-av { padding: 4px; border-radius: 50%; background: var(--c); display: grid; }
.man-chuyen-may .cm-av .th-av { --av: 88px; margin: 0; box-shadow: 0 0 0 3px #221d27; }
.man-chuyen-may h2 { margin: 2px 0 0; font-size: var(--co-6); font-weight: 800; }
.man-chuyen-may p { margin: 0; color: #cfc5d6; font-size: var(--co-3); max-width: 300px; }
.cm-vua-xay-ra { width: 100%; background: rgba(255, 255, 255, .07); border-radius: var(--bo-2); padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.cm-vua-xay-ra small { font: 700 var(--co-1) var(--font); letter-spacing: .06em; color: #a99fb1; }
.cm-dong-nk { display: flex; align-items: center; gap: 8px; font-size: var(--co-3); }
.cm-dong-nk i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.nut-giu { position: relative; width: 132px; height: 132px; margin-top: 6px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 3px var(--chinh); color: #fff; font: 800 var(--co-3) var(--font); line-height: 1.25; display: grid; place-items: center; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; flex: none; }
.nut-giu-vong { position: absolute; inset: 0; border-radius: 50%; background: var(--chinh); transform: scale(0); transition: transform .12s ease-in; }
.nut-giu.dang-giu .nut-giu-vong { transform: scale(1); transition: transform .65s linear; }
.nut-giu-chu { position: relative; padding: 0 18px; }
.nut-giu:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.cm-goi-y { color: #a99fb1; font-size: var(--co-1); }
.cm-chip-ghe { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cm-chip-ghe .chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #e9e2ee;
  font: 600 var(--co-2) var(--font); border: 0; }
.cm-chip-ghe .chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cm-chip-ghe .chip.bat { box-shadow: inset 0 0 0 1.5px var(--c); color: #fff; }
.kieu-ngang .cm-giua { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "tro tro" "av h" "av p" "nk nut" "nk goi" "chip chip";
  width: min(640px, 100%); column-gap: 20px; row-gap: 6px; align-items: center; text-align: left; }
.kieu-ngang .cm-tro { grid-area: tro; justify-self: center; } .kieu-ngang .cm-giua .cm-av { grid-area: av; justify-self: center; align-self: center; } .kieu-ngang .cm-giua h2 { grid-area: h; align-self: end; }
.kieu-ngang .cm-giua p { grid-area: p; align-self: start; } .kieu-ngang .cm-vua-xay-ra { grid-area: nk; align-self: stretch; }
.kieu-ngang .nut-giu { grid-area: nut; justify-self: center; width: 112px; height: 112px; } .kieu-ngang .cm-goi-y { grid-area: goi; text-align: center; }
.kieu-ngang .cm-chip-ghe { grid-area: chip; }
.kieu-ngang:not(.co-lon) .man-chuyen-may .cm-av .th-av { --av: 64px; }
/* Báo lượt (cùng máy, không giấu bài) */
.bao-luot { position: absolute; inset: 0; z-index: 38; display: grid; place-items: center; pointer-events: none; }
.bao-luot-the { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 10px; border-radius: 999px; background: var(--mat); box-shadow: 0 0 0 3px var(--c), var(--bong-lon);
  font: 800 var(--co-5) var(--font); color: var(--chu); animation: th-bao-luot calc(1.3s * var(--tg, 1)) ease-out both; }
.bao-luot-the .th-av { --av: 40px; }
@keyframes th-bao-luot { 0% { opacity: 0; transform: scale(.85); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bao-luot-the { animation-duration: .01s; animation-delay: 1s; } }

/* ---------- 19.6 Dải mất mạng ---------- */
.dai-mang { position: absolute; z-index: 45; left: calc(10px + var(--an-trai)); right: calc(10px + var(--an-phai)); top: calc(var(--cao-thanh-choi) + var(--an-tren) + 8px);
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: var(--bo-2); background: #fff4d6; border: 1px solid #f3dc9b; color: #7a4f00; box-shadow: var(--bong); }
.man.phong .dai-mang { top: calc(var(--cao-dau) + var(--an-tren) + 8px); }
.dai-mang-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dai-mang-chu b { font-size: var(--co-3); } .dai-mang-chu small { font-size: var(--co-1); }
.xoay-cho { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(122, 79, 0, .25); border-top-color: #7a4f00; flex: none; animation: th-xoay-cho 1s linear infinite; }
@keyframes th-xoay-cho { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .xoay-cho { animation: none; } }

/* ---------- 19.7 Phòng chờ ---------- */
.ma-qr { display: flex; align-items: center; gap: var(--k3); }
.ma-qr .ma-phong { flex: 1; min-width: 0; }
.ma-nut { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.qr-nho { flex: none; width: 92px; height: 92px; padding: 4px; border-radius: 10px; border: 1px solid var(--vien); background: #fff; cursor: zoom-in; }
.qr-nho svg, .qr-lon svg { width: 100%; height: 100%; display: block; }
.co-lon .qr-nho { width: 132px; height: 132px; }
.hop-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr-lon { width: min(300px, 70vw, 50vh); aspect-ratio: 1; background: #fff; padding: 8px; border-radius: 12px; }
.qr-ma { font: 900 30px var(--font); letter-spacing: .2em; color: var(--chinh); }
.the-ghe-dau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.the-ghe-dau h3 { margin: 0; }
.luat-van { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-luat { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; border: 0; background: var(--mat-2); color: var(--chu);
  font: 700 var(--co-1) var(--font); white-space: nowrap; }
.chip-luat .th-ic svg { width: 14px; height: 14px; }
.chip-luat.doi-duoc { cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--vien); position: relative; }
.chip-luat.doi-duoc::after { content: ''; position: absolute; inset: -8px -2px; }
.phong-than .the-ghe .ds-ghe { margin-top: var(--k2); }
.phong-than .ghe > div:not(.av) { flex: 1; }
.the-tt { display: block; font-size: var(--co-1); font-weight: 700; color: var(--chu-nhat); }
.the-tt.san { color: var(--la); } .the-tt.chu { color: var(--chinh); }
.ghe.trong.bam-duoc { cursor: pointer; }
.nut-moi-ra { margin-left: auto; }
.nut-phu { display: block; font-size: var(--co-1); font-weight: 600; opacity: .85; }
.th-nut:has(.nut-phu) { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 6px; row-gap: 0; line-height: 1.15; }
.kieu-ngang .phong-than { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.kieu-ngang .phong-than .chat-phong { grid-column: 1; }
.kieu-ngang .phong-than .the-ghe { grid-column: 2; grid-row: 1 / span 2; }
.co-lon.kieu-ngang .phong-than { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); }
.co-lon.kieu-ngang .phong-than .the-ghe { grid-column: 2; grid-row: 1; }
.co-lon.kieu-ngang .phong-than .chat-phong { grid-column: 3; grid-row: 1; }
.co-lon .phong-than .ds-ghe { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- 19.7 Chat ---------- */
.khung-chat { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.khung-chat h3 { margin: 0; }
.chat-log { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 60px; max-height: 180px; overscroll-behavior: contain; padding-right: 2px; }
.co-lon .chat-log { max-height: 320px; }
.chat-trong { margin: auto; color: var(--chu-nhat); font-size: var(--co-2); }
.chat-tin { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 85%; }
.chat-tin.toi { align-self: flex-end; align-items: flex-end; }
.chat-tin p { margin: 0; padding: 6px 10px; border-radius: 4px 12px 12px 12px; background: var(--mat-2); font-size: var(--co-3); overflow-wrap: anywhere; }
.chat-tin.toi p { background: var(--chinh); color: #fff; border-radius: 12px 4px 12px 12px; }
.chat-ten { border: 0; background: none; padding: 0 2px; font: 700 var(--co-1) var(--font); color: var(--chu-nhat); cursor: pointer; }
.chat-stk-1 svg { width: 40px; height: 40px; }
.chat-stk { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chat-stk::-webkit-scrollbar { display: none; }
.chat-stk button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; padding: 3px; cursor: pointer; }
.chat-stk button:hover, .chat-stk button:focus-visible { background: var(--mat-2); }
.chat-stk svg { width: 100%; height: 100%; }
.chat-cau { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chat-cau::-webkit-scrollbar { display: none; }
.chat-cau .chip { flex: none; height: 30px; border: 0; border-radius: 15px; padding: 0 12px; background: var(--hong-nhat); color: var(--chu); font: 600 var(--co-2) var(--font); cursor: pointer; }
.chat-nhap { display: flex; gap: 8px; align-items: center; }
.chat-nhap .th-o-nhap { flex: 1; min-width: 0; height: 40px; padding: .4em .8em; font-size: var(--co-3); }
/* Chat trong màn chơi: tấm trượt dưới (dọc), cột phải (ngang) */
.nut-chat { position: relative; }
/* Nút mic (giọng nói online, th-giong.js) */
.nut-giong { touch-action: none; -webkit-user-select: none; user-select: none; }
.nut-giong.giong-noi { background: var(--la); color: #fff; border-color: var(--la); box-shadow: 0 0 0 3px color-mix(in srgb, var(--la) 30%, transparent); }
.nut-giong.giong-khoa { opacity: .45; }
.huy-chat { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--do); color: #fff;
  font: 800 11px/17px var(--font); text-align: center; }
.huy-chat:empty { display: none; }
.tam-chat { position: absolute; z-index: 42; left: 0; right: 0; bottom: 0; max-height: 62%; display: flex; flex-direction: column; background: var(--mat);
  border-radius: var(--bo-3) var(--bo-3) 0 0; box-shadow: 0 -10px 30px rgba(42, 34, 48, .18); padding: 10px calc(12px + var(--an-phai)) calc(10px + var(--an-duoi)) calc(12px + var(--an-trai)); }
.tam-chat-dau { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
.tam-chat-dau b { font-size: var(--co-4); } .tam-chat-dau small { flex: 1; min-width: 0; }
.tam-chat .khung-chat { background: none; border: 0; padding: 0; box-shadow: none; flex: 1; }
.tam-chat .chat-log { max-height: none; flex: 1; }
.kieu-ngang .tam-chat { left: auto; top: calc(var(--cao-thanh-choi) + var(--an-tren)); width: min(340px, 45%); max-height: none; border-radius: var(--bo-3) 0 0 0;
  box-shadow: -10px 0 30px rgba(42, 34, 48, .15); }
.bong-chat.bong-o-ghe { position: absolute; top: auto; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; z-index: 30; background: var(--mat); border-radius: 14px;
  padding: 4px 10px; box-shadow: var(--bong-lon); white-space: nowrap; font-size: var(--co-3); font-weight: 700; color: var(--chu); }
.bong-chat svg { width: 34px; height: 34px; display: block; }

/* ---------- 19.8 Chơi lại online ---------- */
.ds-dong-y { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.ds-dong-y:empty { display: none; }
.chip-dong-y { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--mat-2); color: var(--chu-nhat); font: 700 var(--co-1) var(--font); }
.chip-dong-y.co { background: color-mix(in srgb, var(--la) 18%, var(--mat)); color: var(--la); }
.chip-dong-y svg { width: 13px; height: 13px; }
.nut-choi-lai-onl.da-bam { opacity: .75; }

/* Sửa sau rà soát ảnh: ảnh đại diện trong ghế phòng giữ đúng cỡ --av (khung .ghe .av cũ ép 44px làm lệch ảnh ghép),
   tên ghế xuống 2 dòng thay vì cắt, chip lượt ẩn hẳn khi chưa dùng. */
.ghe .av.th-av { width: var(--av); height: var(--av); }
.phong-than .ghe { gap: 8px; }
.phong-than .ghe b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; overflow-wrap: anywhere; }
.phong-than .ghe small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.kieu-doc:not(.co-lon) .phong-than .ghe .av.th-av { --av: 34px; }
.phong-than .nut-moi-ra { width: 34px; height: 34px; min-width: 34px; }
.chip-luot[hidden], .chip-mang[hidden] { display: none; }
.phong-than .nut-moi-ra { position: relative; }
.phong-than .nut-moi-ra::after { content: ''; position: absolute; inset: -5px; }

/* Ván online dở của chủ phòng (sảnh) và dải "Chủ phòng tạm rời" ở máy khách — HOP-DONG 19.6 */
.van-online { flex-wrap: nowrap; }
.van-online > div { min-width: 0; }
.van-online .vo-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--chinh) 14%, var(--mat)); color: var(--chinh); }
.van-online .vo-ic svg { width: 20px; height: 20px; }
.kieu-doc:not(.co-lon) .van-online { flex-wrap: wrap; }
.kieu-doc:not(.co-lon) .van-online > div { flex: 1 1 calc(100% - 50px); }
.dai-mang.cho-chu { background: color-mix(in srgb, var(--chinh) 12%, var(--mat)); border-color: var(--vien); color: var(--chu); }
.chip-luot .cl-ten { overflow: hidden; text-overflow: ellipsis; max-width: 9em; font-weight: 700; }
.chip-luot .cl-giay { font-weight: 800; }
.chip-luot .cl-ten:not(:empty) + .cl-giay::before { content: '· '; font-weight: 700; }
.kieu-doc:not(.co-lon) .chip-luot .cl-ten { display: none; }
.kieu-doc:not(.co-lon) .chip-luot .cl-giay::before { content: none; }

/* Số người kiểu − n + (khoảng rộng, vd. Lô Tô 2–15) */
.buoc-so { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--mat-2); }
.buoc-so-nut { width: 44px; height: 38px; border: 0; border-radius: 999px; background: var(--mat); color: var(--chu); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.buoc-so-nut svg { width: 18px; height: 18px; }
.buoc-so-nut:disabled { opacity: .35; cursor: default; box-shadow: none; }
.buoc-so-gt { min-width: 2.4em; text-align: center; font: 800 var(--co-4) var(--font); font-variant-numeric: tabular-nums; color: var(--chinh); }
.buoc-so-pv { padding: 0 10px 0 4px; font-size: var(--co-1); color: var(--chu-nhat); }

/* Thanh trên nhiều người (tới 15): từ 7 người chỉ còn ảnh, chip nhỏ lại, quá chỗ thì vuốt ngang */
.thanh-tren .ds-nguoi { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; justify-content: safe center; }
.thanh-tren .ds-nguoi::-webkit-scrollbar { display: none; }
.thanh-tren .ds-nguoi > .nguoi { flex: none; }
.ds-nguoi:has(> .nguoi:nth-child(7)) .ten-n { display: none; }
.ds-nguoi:has(> .nguoi:nth-child(7)) .nguoi { padding-right: 2px; }
.ds-nguoi:has(> .nguoi:nth-child(7)) { gap: 4px; }
.kieu-doc .ds-nguoi:has(> .nguoi:nth-child(7)) .nguoi .av.th-av { --av: 24px; }

/* Máy bật "giảm chuyển động" (Đợt 4): mọi hiệu ứng lặp mãi (nhấp nháy, nhún, xoay) chỉ chạy một lần rồi đứng yên.
   Hiệu ứng ngắn (chia bài, đi quân) vẫn chạy để người chơi thấy chuyện gì vừa xảy ra. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------- Xem lại ván chung (Đợt 9): thanh dưới màn chơi, khung trò co lại nhường chỗ ---------- */
.man-choi.dang-xem-lai .khung-tro { pointer-events: none; }
.man-choi.dang-xem-lai .khung-tro .th-bang-ben { pointer-events: auto; }
.xem-lai-chung { flex: none; display: flex; align-items: center; gap: 10px 14px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--mat); border-top: 1px solid var(--vien, #f1e4ea); box-shadow: 0 -6px 18px rgba(42, 34, 48, .08); z-index: 5; }
.xem-lai-chung .xl-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xem-lai-chung .xl-buoc { font: 800 var(--co-2, 14px) var(--font); color: var(--chinh); font-variant-numeric: tabular-nums; }
.xem-lai-chung .xl-mo-ta { font: 600 var(--co-2, 14px) var(--font); color: var(--chu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.3em; }
.xem-lai-chung .xl-van { display: flex; flex-wrap: wrap; gap: 4px; }
.xem-lai-chung .xl-van button { height: 26px; min-width: 26px; padding: 0 9px; border: 0; border-radius: 13px; background: var(--mat-2); color: var(--chu);
  font: 700 var(--co-1, 12px) var(--font); cursor: pointer; }
.xem-lai-chung .xl-van button.bat { background: var(--chinh); color: #fff; }
.xem-lai-chung .xl-nut { flex: none; display: flex; gap: 6px; }
.xem-lai-chung .xl-nut .th-nut { width: var(--cham-nho, 40px); height: var(--cham-nho, 40px); min-width: 0; padding: 0; }
.xem-lai-chung .xl-nut .xl-chay { background: var(--chinh); color: #fff; box-shadow: var(--bong); }
.kieu-doc .xem-lai-chung { flex-direction: column; align-items: stretch; gap: 8px; }
.kieu-doc .xem-lai-chung .xl-nut { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .xem-lai-chung * { transition: none !important; } }

/* ---------- Ván tập có hướng dẫn (Đợt 9, core/js/th-huong-dan.js) ---------- */
.hd-the { position: absolute; z-index: 40; left: 50%; top: calc(var(--cao-thanh-choi, 48px) + 10px); transform: translateX(-50%);
  width: min(440px, calc(100% - 24px)); padding: 12px 14px; border-radius: 16px; background: var(--mat); color: var(--chu);
  border: 2px solid var(--chinh); box-shadow: 0 10px 28px rgba(42, 34, 48, .22); display: grid; gap: 8px; }
.hd-the.hd-duoi { top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
/* màn ngang / máy tính: thẻ nằm góc dưới trái, đỡ che bàn chơi ở giữa */
.kieu-ngang .hd-the { left: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: none; width: min(360px, 34%); }
.kieu-ngang .hd-the.hd-tren { top: calc(var(--cao-thanh-choi, 48px) + 10px); bottom: auto; }
.hd-the .hd-dau { display: flex; align-items: center; gap: 8px; font: 800 var(--co-1, 12px) var(--font); color: var(--chinh); text-transform: uppercase; letter-spacing: .04em; }
.hd-the .hd-dau b { flex: 1; min-width: 0; }
.hd-the .hd-ic { display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--mat-2); }
.hd-the .hd-ic svg { width: 14px; height: 14px; }
.hd-the .hd-bo { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--chu-nhat); cursor: pointer; display: grid; place-items: center; }
.hd-the .hd-bo svg { width: 16px; height: 16px; }
.hd-the .hd-bo:hover { background: var(--mat-2); }
.hd-the p { margin: 0; font: 600 var(--co-3, 15px)/1.45 var(--font); }
.hd-the .hd-hang { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.hd-the .hd-goi-y { color: var(--chu-nhat); font: 600 var(--co-1, 12px) var(--font); }
.hd-chi { outline: 3px solid var(--chinh) !important; outline-offset: 2px; border-radius: 10px; animation: hd-nhay 1.2s ease-in-out infinite; }
@keyframes hd-nhay { 50% { outline-color: color-mix(in srgb, var(--chinh) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .hd-chi { animation: none; } }
.kieu-doc .hd-the p { font-size: var(--co-2, 14px); }
.hop-cd .nut-van-tap[hidden] { display: none; }
/* Vào giữa trận: chờ ván sau (HOP-DONG 19.10) */
.cho-van-sau { display: flex; align-items: center; gap: 10px; }
.cho-van-sau b { display: block; }
.cho-van-sau small { color: var(--chu-nhat); }

/* tai-khoan/tai-khoan.css */
/* TÀI KHOẢN — màn đăng nhập/đăng ký và hộp Tài khoản. Mọi selector bắt đầu bằng .tk- */
.tk-man {
  position: fixed; inset: 0; z-index: 850; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(1200px 700px at 15% 10%, color-mix(in srgb, var(--phu) 35%, transparent) 0%, transparent 60%),
              radial-gradient(900px 600px at 90% 90%, color-mix(in srgb, var(--chinh) 25%, transparent) 0%, transparent 60%),
              var(--mat-2);
}
.tk-man .tk-the { width: min(440px, 100%); margin: auto 0; padding: 22px clamp(16px, 4vw, 28px) 18px; }
.tk-man input, .tk-hop input { user-select: text; -webkit-user-select: text; }
.tk-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tk-logo b { display: block; font-size: 1.35rem; font-weight: 900; color: var(--chu); }
.tk-logo small { color: var(--chu-nhat); font-weight: 600; }
.tk-huy-hieu { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, var(--chinh), var(--phu)); box-shadow: var(--bong); }
.tk-tab { display: grid; grid-template-columns: 1fr 1fr; background: var(--mat-2); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.tk-tab button { border: 0; background: transparent; border-radius: 999px; padding: .6em; font-weight: 800; font-size: 1rem; color: var(--chu-nhat); cursor: pointer; transition: background .15s, color .15s; }
.tk-tab button.bat { background: var(--mat); color: var(--chinh); box-shadow: var(--bong); }
.tk-form { display: flex; flex-direction: column; gap: 10px; }
.tk-tieu-de { margin: 0; font-size: 1.3rem; }
.tk-mo-ta { margin: 0; color: var(--chu-nhat); font-size: .92rem; line-height: 1.45; }
.tk-truong { display: flex; flex-direction: column; gap: 4px; }
.tk-nhan { font-weight: 700; font-size: .9rem; }
.tk-goi-y { color: var(--chu-nhat); font-size: .78rem; line-height: 1.35; }
.tk-loi { color: var(--do); font-size: .8rem; font-weight: 700; min-height: 0; }
.tk-loi:empty { display: none; }
.tk-truong.co-loi .th-o-nhap { border-color: var(--do); background: color-mix(in srgb, var(--do) 6%, var(--mat)); }
.tk-o-mk { position: relative; }
.tk-o-mk .th-o-nhap { padding-right: 2.8em; }
.tk-mat { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; padding: 4px 6px; line-height: 1; }
.tk-gioi-tinh button { flex: 1; min-width: 70px; }
.tk-do-manh { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.tk-do-manh i { height: 5px; border-radius: 3px; background: var(--vien, #ece8ff); transition: background .2s; }
.tk-do-manh[data-muc="1"] i:nth-child(-n+1) { background: var(--do); }
.tk-do-manh[data-muc="2"] i:nth-child(-n+2) { background: var(--cam); }
.tk-do-manh[data-muc="3"] i:nth-child(-n+3) { background: var(--vang); }
.tk-do-manh[data-muc="4"] i { background: var(--la); }
.tk-dong-y-hang { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; line-height: 1.4; }
.tk-dong-y-o { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--chinh); flex: none; }
.tk-lien-ket { border: 0; background: none; padding: 0; color: var(--chinh); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; align-self: center; }
.tk-form > .tk-lien-ket { margin-top: 2px; font-size: .92rem; }
.tk-nut-gui { width: 100%; margin-top: 6px; font-size: 1.05rem; }
.tk-nut-gui.dang-gui { position: relative; color: transparent; }
.tk-nut-gui.dang-gui::after { content: ''; position: absolute; width: 1.1em; height: 1.1em; border: 3px solid #fff; border-right-color: transparent; border-radius: 50%; animation: tk-xoay .7s linear infinite; }
@keyframes tk-xoay { to { transform: rotate(360deg); } }
.tk-bao { border-radius: 12px; padding: .65em .85em; font-size: .9rem; font-weight: 600; line-height: 1.4; }
.tk-bao.loi { background: #fff0f0; color: #c92a2a; }
.tk-bao.tot { background: #e6fcf5; color: #087f5b; }
.tk-bao.canh-bao { background: #fff9db; color: #8a6100; }
.tk-hop { width: min(440px, 92vw); }
.tk-hop .tk-form .nut-hang { margin-top: 8px; }
.tk-hop .tk-bao { margin-top: 10px; }
.tk-dieu-khoan p { margin: 0 0 8px; font-size: .9rem; line-height: 1.5; }
.tk-ho-so .tk-dong { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--vien, #f0edff); font-size: .95rem; }
.tk-ho-so .tk-dong span { color: var(--chu-nhat); }
.tk-ho-so .tk-dong b { text-align: right; word-break: break-all; }
.tk-ho-so .tk-goi-y { margin: 10px 0 0; }
.tk-nut-hang { justify-content: flex-start !important; }
.th-nut.tk-nut { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
@media (max-width: 420px) {
  .tk-man { padding-left: 10px; padding-right: 10px; }
  .tk-logo b { font-size: 1.2rem; }
}
.tk-logo > div:nth-child(2) { flex: 1; min-width: 0; }
.tk-ngon-ngu { border: 2px solid var(--vien, #e5dbff); background: var(--mat); display: inline-flex; align-items: center; gap: .35em; color: var(--chinh); border-radius: 999px; padding: .35em .8em; font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer; flex: none; }
.tk-ngon-ngu:hover { border-color: var(--chinh); }

/* ---- Logo ảnh + bố cục theo thiết bị (HOP-DONG mục 13: tb-pc / tb-dt-ngang / tb-dt-doc / tb-mtb trên <html>) ---- */
.tk-logo-anh { height: 56px; width: auto; max-width: 62%; object-fit: contain; flex: none; filter: drop-shadow(0 3px 6px rgba(35,25,77,.18)); }
.tk-logo-chu { flex: 1; min-width: 0; }
.tk-logo-chu small { display: block; }
.tk-man .tk-the { transition: width .2s; }

/* PC và máy tính bảng: đăng ký 2 cột trong thẻ rộng, đăng nhập giữ khung gọn */
.tb-pc .tk-man .tk-the.tk-rong, .tb-mtb .tk-man .tk-the.tk-rong { width: min(780px, 100%); }
.tb-pc .tk-form-dk, .tb-mtb .tk-form-dk, .tb-dt-ngang .tk-form-dk { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; align-items: start; }
.tk-form-dk > .tk-bao, .tk-form-dk > .tk-dong-y, .tk-form-dk > .tk-nut-gui { grid-column: 1 / -1; }
.tb-pc .tk-man { align-items: center; }

/* Điện thoại xoay ngang: màn thấp (~360–430px) -> đầu thẻ 1 hàng, 2 cột, chữ gợi ý ẩn bớt, ít đệm */
.tb-dt-ngang .tk-man { padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); align-items: flex-start; }
.tb-dt-ngang .tk-man .tk-the { width: min(860px, 100%); padding: 10px 16px 12px; border-radius: 18px; margin: auto 0; }
.tb-dt-ngang .tk-man .tk-the:not(.tk-rong) { width: min(640px, 100%); }
.tb-dt-ngang .tk-dau { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tb-dt-ngang .tk-dau .tk-logo { margin: 0; flex: 1; min-width: 0; gap: 8px; }
.tb-dt-ngang .tk-dau .tk-tab { margin: 0; flex: 0 0 min(300px, 45%); order: 2; }
.tb-dt-ngang .tk-dau .tk-tab button { padding: .45em; }
.tb-dt-ngang .tk-logo-anh { height: 38px; }
.tb-dt-ngang .tk-huy-hieu { width: 38px; height: 38px; font-size: 22px; border-radius: 12px; }
.tb-dt-ngang .tk-logo b { font-size: 1.05rem; }
.tb-dt-ngang .tk-logo small { font-size: .75rem; }
.tb-dt-ngang .tk-form { gap: 6px; }
.tb-dt-ngang .tk-form-dk { gap: 6px 16px; }
.tb-dt-ngang .tk-form-dn { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.tb-dt-ngang .tk-form-dn > .tk-bao, .tb-dt-ngang .tk-form-dn > .tk-nut-gui, .tb-dt-ngang .tk-form-dn > .tk-lien-ket { grid-column: 1 / -1; }
.tb-dt-ngang .tk-nhan { font-size: .8rem; }
.tb-dt-ngang .tk-man .th-o-nhap { padding: .5em .8em; min-height: 42px; }
.tb-dt-ngang .tk-form > .tk-truong > .tk-goi-y:not(.tk-manh-chu) { display: none; }
.tb-dt-ngang .tk-nut-gui { margin-top: 2px; }
.tb-dt-ngang .tk-dong-y-hang { font-size: .85rem; align-items: center; }
.tb-dt-ngang .tk-mo-ta { font-size: .85rem; }
.tb-dt-ngang .tk-tieu-de { font-size: 1.1rem; }
.tb-dt-ngang .tk-hop { max-height: 92dvh; }
/* Điện thoại ngang: 3 cột để cả form đăng ký nằm gọn trong 1 màn (7 ô = 3 hàng, ô đồng ý nằm cạnh ô nhập lại mật khẩu) */
.tb-dt-ngang .tk-form-dk { grid-template-columns: repeat(3, 1fr); }
.tb-dt-ngang .tk-form-dk > .tk-dong-y { grid-column: span 2; align-self: center; }
.tb-dt-ngang .tk-gioi-tinh button { min-width: 0; padding: .4em .3em; }

/* ---- Tài khoản khách ---- */
.tk-hoac { display: flex; align-items: center; gap: 10px; color: var(--chu-nhat); font-size: .82rem; font-weight: 700; margin: 2px 0; }
.tk-hoac::before, .tk-hoac::after { content: ''; flex: 1; height: 1px; background: var(--vien, #e5dbff); }
.tk-nut-khach { width: 100%; font-size: 1rem; }
.tk-khach-goi-y { text-align: center; }
.tk-dong-cong { border: 0; background: var(--mat-2); color: var(--chu-nhat); width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; font-weight: 900; cursor: pointer; flex: none; }
.tk-dong-cong:hover { color: var(--chinh); }
.th-nut.tk-nut-la-khach { border-color: var(--chinh); color: var(--chinh); }
.tb-dt-ngang .tk-form-dn > .tk-hoac, .tb-dt-ngang .tk-form-dn > .tk-khach-goi-y { display: none; }
.tb-dt-ngang .tk-form-dn > .tk-nut-khach { grid-column: 2; margin-top: 2px; }
.tb-dt-ngang .tk-form-dn:has(> .tk-nut-khach) > .tk-nut-gui { grid-column: 1; }
.tb-dt-ngang .tk-form-dn > .tk-lien-ket { order: 3; }   /* nút gửi + nút khách nằm cùng hàng, "quên mật khẩu" xuống dưới */

/* ---- Icon SVG của lõi (HOP-DONG mục 15: không dùng emoji) ---- */
.tk-man .th-nut, .tk-hop .th-nut { display: inline-flex; align-items: center; justify-content: center; gap: .45em; }
.tk-huy-hieu { color: #fff; }
.tk-huy-hieu .th-svg { width: 28px; height: 28px; }
.tb-dt-ngang .tk-huy-hieu .th-svg { width: 20px; height: 20px; }
.tk-mat { color: var(--chu-nhat); display: grid; place-items: center; }
.tk-mat.tk-mat-mo { color: var(--chinh); }
.tk-mat:not(.tk-mat-mo)::after { content: ''; position: absolute; width: 1.25em; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 2px; }
.tk-lien-ket { display: inline-flex; align-items: center; gap: .35em; }
.tk-dong-cong { display: grid; place-items: center; }
.th-nut.tk-nut { display: inline-flex; align-items: center; gap: .4em; }
.th-nut.tk-nut > span { overflow: hidden; text-overflow: ellipsis; }
.tb-dt-ngang .tk-form-dn > .tk-lien-ket { justify-self: center; }

/* ban-be/ban-be.css */
/* BẠN BÈ — nút ở sảnh, ngăn kéo Bạn bè, thẻ lời mời chơi, khung nhắn tin, thẻ hồ sơ. Mọi selector bắt đầu bằng .bb- hoặc #bb- */

/* Nút ở sảnh + huy hiệu số */
.bb-nut { position: relative; }
.bb-dem { display: none; position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--do); color: #fff; font: 800 .72rem/20px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--mat); }
.bb-dem.co { display: block; }
.tb-dt-ngang .bb-nut .bb-chu, .tb-dt-doc .bb-nut .bb-chu { display: none; }

/* Ngăn kéo */
.bb-nen { position: fixed; inset: 0; z-index: 880; background: rgba(42, 34, 48, 0); transition: background .2s; }
.bb-nen.mo { background: rgba(42, 34, 48, .28); }
.bb-ngan { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--mat); color: var(--chu);
  border-left: 1px solid var(--vien, #eee); box-shadow: var(--bong-lon); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease-out;
  padding-top: env(safe-area-inset-top); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
.bb-nen.mo .bb-ngan { transform: none; }
.bb-dau { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px 18px; }
.bb-dau h2 { margin: 0; font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.bb-dau h2 .th-ic { color: var(--chinh); font-size: 1.3rem; }

.bb-toi { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; margin: 4px 14px 8px; padding: 10px 12px;
  background: var(--mat-2); border-radius: var(--bo); }
.bb-toi > .av { grid-row: span 2; }
.bb-toi .av.th-av { --av: 46px; }
.bb-toi-ten { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bb-toi-ten > b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.bb-ma { border: 1px dashed var(--chinh); background: var(--mat); color: var(--chu); border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font: inherit; }
.bb-ma small { color: var(--chu-nhat); font-size: .72rem; }
.bb-ma b { letter-spacing: .08em; font-size: .9rem; }
.bb-ma .th-ic { color: var(--chinh); }
.bb-an { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--chu-nhat); cursor: pointer; }
.bb-an input { accent-color: var(--chinh); width: 16px; height: 16px; }

.bb-tab { display: flex; gap: 4px; padding: 0 12px 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.bb-tab::-webkit-scrollbar { display: none; }
.bb-t { border: 0; background: transparent; padding: .5em .8em; border-radius: 999px; font: 700 .9rem var(--font); color: var(--chu-nhat);
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; }
.bb-t.bat { background: var(--hong-nhat, var(--mat-2)); color: var(--chinh); }
.bb-so { font-style: normal; background: var(--do); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font: 800 .7rem/18px var(--font); text-align: center; }

.bb-than { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 10px 16px; overscroll-behavior: contain; }
.bb-nhan { display: flex; justify-content: space-between; color: var(--chu-nhat); font-size: .8rem; font-weight: 700; padding: 4px 8px; text-transform: uppercase; letter-spacing: .04em; }
.bb-goi-y { color: var(--chu-nhat); font-size: .88rem; margin: 6px 8px 10px; }
.bb-trong { text-align: center; color: var(--chu-nhat); padding: 28px 16px; }
.bb-trong p { margin: 6px 0 14px; }
.bb-trong-ic { font-size: 44px; color: var(--phu); display: flex; justify-content: center; }

/* Một dòng người */
.bb-dong { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: var(--bo); min-height: 56px; }
.bb-dong:hover { background: var(--mat-2); }
.bb-dong.den { background: var(--hong-nhat, var(--mat-2)); }
.bb-ai { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.bb-ai > .av.th-av, .bb-av .av.th-av { --av: 42px; }
.bb-ten { min-width: 0; display: flex; flex-direction: column; }
.bb-ten b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-ten small { color: var(--chu-nhat); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-dong.online .bb-ten small { color: var(--la); font-weight: 600; }
.bb-hd { display: flex; align-items: center; gap: 6px; flex: none; }
.bb-hd .th-nut.nho { padding: .4em .8em; font-size: .85rem; }
.bb-nut-nhan { position: relative; }
.bb-nut-nhan .bb-so { position: absolute; top: -5px; right: -5px; }
.bb-the-nho { font-size: .78rem; font-weight: 700; color: var(--chu-nhat); background: var(--mat-2); padding: 4px 10px; border-radius: 999px; }
.bb-av { position: relative; flex: none; display: inline-flex; }
.bb-cham { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: #c9c2cf; box-shadow: 0 0 0 2px var(--mat); }
.bb-av.online .bb-cham { background: var(--la); }
.bb-av.dang-choi .bb-cham { background: var(--cam); }
.bb-av.offline .av { filter: grayscale(.6); opacity: .75; }

.bb-menu { position: absolute; right: 6px; top: calc(100% - 4px); z-index: 5; background: var(--mat); border: 1px solid var(--vien, #eee); border-radius: var(--bo);
  box-shadow: var(--bong-lon); padding: 6px; display: flex; flex-direction: column; min-width: 170px; }
.bb-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font: 600 .92rem var(--font); color: var(--chu); cursor: pointer; text-align: left; }
.bb-menu button:hover { background: var(--mat-2); }
.bb-menu button.do { color: var(--do); }

/* Tìm bạn */
.bb-o-tim { display: flex; gap: 8px; margin: 6px 4px 10px; }
.bb-o-tim input { flex: 1; min-width: 0; user-select: text; -webkit-user-select: text; }
.bb-chia-se { margin: 18px 6px 4px; padding: 12px; border-radius: var(--bo); background: var(--mat-2); text-align: center; }
.bb-chia-se p { margin: 0 0 8px; color: var(--chu-nhat); font-size: .88rem; }
.bb-ma-lon b { letter-spacing: .12em; font-size: 1.1rem; }

/* Nhắn tin (thay phần thân của ngăn kéo) */
.bb-ngan.dang-chat > .bb-toi, .bb-ngan.dang-chat > .bb-tab, .bb-ngan.dang-chat > .bb-than { display: none; }
.bb-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bb-chat-dau { display: flex; align-items: center; gap: 10px; padding: 4px 14px 8px; border-bottom: 1px solid var(--vien, #eee); }
.bb-chat-dau .bb-ai b { font-size: 1.05rem; }
.bb-tin-ds { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.bb-tin { align-self: flex-start; max-width: 80%; background: var(--mat-2); border-radius: 16px 16px 16px 4px; padding: 7px 12px; display: flex; flex-direction: column; }
.bb-tin.toi { align-self: flex-end; background: var(--chinh); color: #fff; border-radius: 16px 16px 4px 16px; }
.bb-tin span { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.bb-tin small { font-size: .68rem; opacity: .7; align-self: flex-end; }
.bb-chat-nhap { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px 10px; border-top: 1px solid var(--vien, #eee); }
.bb-chat-nhap textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; font: inherit; user-select: text; -webkit-user-select: text; }
.bb-chat-nhap.tat { justify-content: center; color: var(--chu-nhat); padding: 14px; }

/* Thẻ lời mời chơi (trên cùng màn hình, cả khi đang chơi) */
#bb-moi-den { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 20px)); pointer-events: none; }
.bb-the-moi { pointer-events: auto; position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center;
  background: var(--mat); color: var(--chu); border: 1px solid var(--vien, #eee); border-left: 5px solid var(--chinh); border-radius: var(--bo);
  box-shadow: var(--bong-lon); padding: 10px 12px 12px; }
.bb-the-moi > .av.th-av { --av: 44px; }
.bb-moi-chu { display: flex; flex-direction: column; min-width: 0; }
.bb-moi-chu b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-moi-chu span { color: var(--chinh); font-weight: 800; }
.bb-moi-nut { display: flex; gap: 8px; justify-content: flex-end; }
.bb-vach { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--phu); transform-origin: left; }

/* Chọn trò để mời */
.bb-hop { width: min(560px, 94vw); }
.bb-luoi-tro { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.bb-o-tro { border: 1px solid var(--vien, #eee); background: var(--mat); border-radius: var(--bo); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: 700 .88rem var(--font); color: var(--chu); cursor: pointer; text-align: center; min-height: 44px; }
.bb-o-tro:hover { border-color: var(--chinh); box-shadow: var(--bong); }
.bb-bt { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; display: grid; place-items: center; font-size: 34px; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--b)); background-size: cover; background-position: center; }
.bb-bt.co-bia { background-color: var(--mat-2); }
.bb-bt svg { width: 1em; height: 1em; }

/* Thẻ hồ sơ */
.bb-ho-so { min-width: min(320px, 80vw); }
.bb-hs-dau { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bb-hs-dau .av.th-av { --av: 72px; }
.bb-hs-dau > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bb-hs-ten { font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; }
.bb-hs-dau small { color: var(--chu-nhat); }
.bb-hs-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bb-hs-so > div { background: var(--mat-2); border-radius: var(--bo); padding: 10px 4px; text-align: center; display: flex; flex-direction: column; }
.bb-hs-so b { font-size: 1.15rem; color: var(--chinh); }
.bb-hs-so small { color: var(--chu-nhat); font-size: .75rem; }
.bb-khach { text-align: center; max-width: 380px; }
.bb-khach p { color: var(--chu-nhat); }

/* Điện thoại dọc: tấm trượt từ dưới lên */
.tb-dt-doc .bb-ngan { top: auto; left: 0; width: 100%; height: 88vh; height: 88dvh; border-left: 0; border-radius: 22px 22px 0 0; transform: translateY(100%); }
.tb-dt-doc .bb-nen.mo .bb-ngan { transform: none; }
.tb-dt-doc .bb-dau::before { content: ''; position: absolute; left: 50%; top: 6px; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: var(--vien, #ddd); }
.tb-dt-doc .bb-hs-so { grid-template-columns: repeat(2, 1fr); }
.tb-dt-doc .bb-the-moi { grid-template-columns: auto 1fr; }
.tb-dt-doc .bb-moi-nut { grid-column: 1 / -1; }
.tb-dt-doc .bb-moi-nut .th-nut { flex: 1; }
.tb-dt-doc .bb-hd .th-nut.nho > span:not(.th-ic) { display: none; }

/* Điện thoại ngang: ngăn kéo hẹp hơn, gọn chiều cao */
.tb-dt-ngang .bb-ngan { width: min(440px, 62vw); padding-left: 0; }
.tb-dt-ngang .bb-dau { padding: 6px 10px 2px 14px; }
.tb-dt-ngang .bb-dau h2 { font-size: 1.05rem; }
.tb-dt-ngang .bb-toi { margin: 2px 10px 4px; padding: 6px 10px; }
.tb-dt-ngang .bb-toi .av.th-av { --av: 36px; }
.tb-dt-ngang .bb-an { display: none; }
.tb-dt-ngang .bb-dong { min-height: 48px; padding: 3px 6px; }
.tb-dt-ngang .bb-ai > .av.th-av, .tb-dt-ngang .bb-av .av.th-av { --av: 36px; }
.tb-dt-ngang .bb-hd .th-nut.nho > span:not(.th-ic) { display: none; }
.tb-dt-ngang #bb-moi-den { top: 6px; }
.tb-dt-ngang .bb-the-moi { padding: 6px 10px 8px; }
.tb-dt-ngang .bb-the-moi > .av.th-av { --av: 36px; }
.tb-dt-ngang .bb-luoi-tro { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

/* Nhắc trong hộp chọn chế độ khi đang mời bạn */
.bb-nhac-moi { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; padding: 8px 12px; border-radius: var(--bo);
  background: var(--hong-nhat, var(--mat-2)); color: var(--chinh); font-weight: 700; font-size: .9rem; }

/* sanh-online/sanh.css */
/* SẢNH ONLINE — danh sách phòng công khai, kênh chat chung, công khai/riêng tư ở phòng chờ. Mọi selector bắt đầu bằng .sn- */

/* Bố cục: dọc = 1 cột, chat là tấm trượt từ dưới (nút Chat nổi); ngang đủ rộng = danh sách | cột chat bên phải */
.sn-khung { display: flex; flex-direction: column; gap: var(--k3); flex: none; min-width: 0; }
.sn-phong { display: flex; flex-direction: column; gap: var(--k2); }
.sn-dau { display: flex; align-items: center; gap: var(--k2); }
.sn-dau-chu { flex: 1; min-width: 0; }
.sn-phong .sn-dau h3 { margin: 0; }
.sn-phong h3 .th-ic { color: var(--cd, var(--chinh)); }
.sn-dem { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: var(--co-2); color: var(--chu-nhat); margin-top: 2px; }
.sn-dem.an { visibility: hidden; }
.sn-cham { width: 8px; height: 8px; border-radius: 50%; background: var(--la); box-shadow: 0 0 0 3px color-mix(in srgb, var(--la) 22%, transparent); }
.sn-so-online { font-weight: 700; color: var(--chu); }
.sn-nut-nhanh { --c: var(--cd, var(--chinh)); flex: none; }

.sn-loc { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.sn-loc::-webkit-scrollbar { display: none; }
.sn-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 0 12px; height: 34px;
  font: 700 var(--co-2) var(--font); color: var(--chu-nhat); background: var(--mat-2); cursor: pointer; }
.sn-chip.bat { background: var(--cd, var(--chinh)); color: #fff; }
.sn-chip:focus-visible, .sn-dong:focus-visible, .sn-tin-ten:focus-visible { outline: 2px solid var(--chinh); outline-offset: 2px; }
.sn-chip-cuoc { margin-left: auto; }

.sn-ds { display: flex; flex-direction: column; gap: 6px; min-height: 64px; }
.sn-trong { margin: 10px 4px; color: var(--chu-nhat); font-size: var(--co-3); text-align: center; }
.sn-dong { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--bo-2); background: var(--mat-2); cursor: pointer; }
.sn-dong:hover { background: color-mix(in srgb, var(--cd, var(--chinh)) 9%, var(--mat)); }
.sn-dong.mo { opacity: .55; cursor: default; }
.sn-dong.mo:hover { background: var(--mat-2); }
.sn-bia { width: 44px; height: 44px; border-radius: 12px; background-size: cover; background-position: center; background-color: var(--mat); flex: none;
  box-shadow: inset 0 0 0 1px var(--vien); display: grid; place-items: center; overflow: hidden; }
.sn-bia.chu b { font-size: var(--co-5); color: var(--cd, var(--chinh)); }
.sn-giua { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sn-hang1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sn-ten-tro { font-size: var(--co-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-luc { color: var(--chu-nhat); font-size: var(--co-1); white-space: nowrap; }
.sn-chu { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; border: 0; background: none; padding: 0; font: 600 var(--co-2) var(--font);
  color: var(--chu); cursor: pointer; align-self: flex-start; }
.sn-chu:disabled { cursor: default; color: var(--chu); opacity: 1; }
.sn-chu .th-av { --av: 20px; flex: none; }
.sn-chu > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-elo { font-style: normal; font-size: var(--co-1); font-weight: 800; color: var(--cd, var(--chinh)); background: var(--mat); border-radius: 6px; padding: 0 5px; }
.sn-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--co-1); color: var(--chu-nhat); }
.sn-tag { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.sn-tag .th-ic { font-size: 13px; }
.sn-ghe { color: var(--chu); font-weight: 700; }
.sn-mang { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sn-mang.mang-tot { background: var(--la); } .sn-mang.mang-vua { background: var(--vang); } .sn-mang.mang-yeu { background: var(--do); }
.sn-vao { --c: var(--cd, var(--chinh)); min-width: 64px; }
.sn-tt { font-size: var(--co-2); font-weight: 700; color: var(--chu-nhat); white-space: nowrap; min-width: 64px; text-align: center; }
.sn-elo-toi { margin: 2px 2px 0; font-size: var(--co-2); color: var(--chu-nhat); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.sn-elo-toi[hidden] { display: none; }
.sn-elo-o { font-weight: 700; color: var(--chu); white-space: nowrap; }

/* Kênh chat chung */
.sn-chat { display: flex; flex-direction: column; min-height: 0; background: var(--mat); border-radius: var(--bo-3); box-shadow: inset 0 0 0 1px var(--vien); padding: var(--k3); gap: var(--k2); }
.sn-chat-dau { display: flex; align-items: center; justify-content: space-between; gap: var(--k2); }
.sn-chat-dau h3 { margin: 0; display: flex; align-items: center; gap: var(--k2); font-size: var(--co-4); font-weight: 800; }
.sn-chat-dau h3 .th-ic { color: var(--cd, var(--chinh)); }
.sn-chat-ds { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.sn-tin { display: flex; gap: 8px; align-items: flex-start; position: relative; }
.sn-tin > .th-av { --av: 28px; flex: none; margin-top: 2px; }
.sn-tin-than { min-width: 0; flex: 1; background: var(--mat-2); border-radius: 4px 14px 14px 14px; padding: 5px 10px 6px; }
.sn-tin.toi .sn-tin-than { background: var(--hong-nhat, var(--mat-2)); }
.sn-tin-dau { display: flex; align-items: baseline; gap: 8px; }
.sn-tin-dau small { color: var(--chu-nhat); font-size: var(--co-1); }
.sn-tin-ten { border: 0; background: none; padding: 0; font: 700 var(--co-2) var(--font); color: var(--cd, var(--chinh)); cursor: pointer; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-tin.toi .sn-tin-ten { color: var(--chu); cursor: default; }
.sn-tin-nd { margin: 1px 0 0; font-size: var(--co-3); line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.sn-tin-rao { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: var(--co-2); font-weight: 600; }
.sn-tin-rao .sn-bia { width: 32px; height: 32px; border-radius: 9px; }
.sn-tin-rao > span { flex: 1; min-width: 0; }
.sn-tin-rao .th-nut { --c: var(--cd, var(--chinh)); flex: none; }
.sn-menu { position: absolute; z-index: 5; top: 26px; left: 36px; background: var(--mat); border-radius: var(--bo-2); box-shadow: var(--bong-lon), 0 0 0 1px var(--vien);
  padding: 4px; display: flex; flex-direction: column; min-width: 160px; }
.sn-menu button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0 12px; min-height: 40px; font: 600 var(--co-3) var(--font); color: var(--chu); border-radius: 10px; cursor: pointer; text-align: left; }
.sn-menu button:hover { background: var(--mat-2); }
.sn-menu button.do { color: var(--do); }
.sn-chat-luat { margin: 0; font-size: var(--co-1); color: var(--chu-nhat); }
.sn-chat-nhap { display: flex; gap: 6px; }
.sn-chat-nhap[hidden], .sn-chat-khach[hidden] { display: none; }
.sn-chat-o { flex: 1; min-width: 0; padding: .55em .8em; }
.sn-chat-gui { --c: var(--cd, var(--chinh)); flex: none; }
.sn-chat-gui.doi { opacity: .6; }
.sn-chat-khach { display: flex; align-items: center; gap: 8px; font-size: var(--co-2); color: var(--chu-nhat); }
.sn-chat-khach span { flex: 1; }
.sn-chat-dong { display: none; }

/* Điện thoại / màn hẹp: chat là tấm trượt từ dưới, có nút Chat nổi */
.sn-nen { position: fixed; inset: 0; z-index: 40; background: rgba(42, 34, 48, .28); }
.sn-chat { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; height: min(72%, 560px); border-radius: var(--bo-3) var(--bo-3) 0 0;
  padding-bottom: calc(var(--k3) + var(--an-duoi)); box-shadow: var(--bong-lon); transform: translateY(105%); transition: transform .22s ease-out; visibility: hidden; }
.sn-chat.mo { transform: none; visibility: visible; }
.sn-chat .sn-chat-dong { display: inline-flex; }
.sn-fab { display: inline-flex; position: fixed; z-index: 30; right: calc(14px + var(--an-phai)); bottom: calc(var(--cao-nav) + var(--an-duoi) + 14px);
  align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 0 16px; height: 46px; font: 800 var(--co-3) var(--font); color: #fff;
  background: var(--cd, var(--chinh)); box-shadow: 0 6px 18px color-mix(in srgb, var(--cd, var(--chinh)) 40%, transparent); cursor: pointer; }
.sn-fab .th-ic { font-size: 20px; }
.kieu-ngang .sn-fab { bottom: calc(14px + var(--an-duoi)); }
.sn-chat-mo .sn-fab { display: none; }
.sn-fab-so { display: none; font-style: normal; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--do); color: #fff; font: 800 11px/20px var(--font); text-align: center; }
.sn-fab-so.co { display: inline-block; }
.kieu-ngang .sn-chat { left: auto; top: 0; height: auto; width: min(380px, 100%); border-radius: var(--bo-3) 0 0 var(--bo-3); transform: translateX(105%); padding-bottom: var(--k3); }
.kieu-ngang .sn-chat.mo { transform: none; }
.sanh-online { padding-bottom: calc(var(--k4) + 64px); }
.kieu-ngang .sanh-online { padding-bottom: calc(var(--k3) + 64px + var(--an-duoi)); }

/* Màn ngang đủ rộng (PC, máy tính bảng ngang): danh sách phòng | cột chat luôn hiện */
@media (min-width: 900px) and (min-height: 560px) {
  .kieu-ngang .sn-khung { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 34%); align-items: stretch; }
  .kieu-ngang .sn-khung .sn-phong { min-height: 300px; }
  .kieu-ngang .sn-chat { position: static; transform: none; visibility: visible; width: auto; height: auto; max-height: 460px; border-radius: var(--bo-3); box-shadow: inset 0 0 0 1px var(--vien); transition: none; }
  .kieu-ngang .sn-chat .sn-chat-dong, .kieu-ngang .sn-fab, .kieu-ngang .sn-nen { display: none; }
  .kieu-ngang .sanh-online { padding-bottom: calc(var(--k3) + var(--an-duoi)); }
  .kieu-ngang .sn-ds { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
}
@media (prefers-reduced-motion: reduce) { .sn-chat { transition: none; } }

/* Phòng chờ: công khai / riêng tư, rao phòng, chờ Vào nhanh */
.sn-loai { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: var(--k2); padding-top: var(--k2); border-top: 1px dashed var(--vien); }
.sn-loai-hang { display: flex; align-items: center; gap: 8px; }
.sn-loai-hang label { font-size: var(--co-2); font-weight: 700; color: var(--chu-nhat); }
.sn-loai-chon button.bat { background: var(--cd, var(--chinh)); color: #fff; }
.sn-loai-mo { flex: 1 1 180px; color: var(--chu-nhat); font-size: var(--co-1); }
.sn-cho-nhanh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--bo-2); background: var(--vang-nhat, #fff4d6); color: #7a4f00; font-size: var(--co-2); font-weight: 600; flex: none; }
.sn-cho-nhanh > span:nth-child(2) { flex: 1 1 180px; }
.sn-elo-ket { margin: 6px 0 0; font-weight: 700; color: var(--chinh); font-size: var(--co-3); }
.sn-tag.sn-dang-choi { background: color-mix(in srgb, var(--la) 18%, var(--mat)); color: var(--chu); }

/* quang-cao/quang-cao.css */
/* QUẢNG CÁO THƯỞNG — thẻ "Nhận thêm xu" (trang Nhiệm vụ) và hộp quảng cáo mẫu. Dùng biến màu của theme (HOP-DONG 15, 18). */
.qc-the { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.qc-the h3 { margin: 0; }
.qc-mo-ta { margin: 0; color: var(--chu-nhat); font-size: var(--co-2); line-height: 1.4; }
.qc-nut { width: 100%; min-height: 44px; justify-content: center; }
.qc-nut[disabled] { opacity: .55; cursor: default; }
.qc-trang-thai { color: var(--chu-nhat); font-size: var(--co-1, 12px); text-align: center; }
.qc-chinh-sach { justify-self: center; color: var(--chu-nhat); font-size: var(--co-1, 12px); }
/* màn ngang thấp: gọn một hàng để không chiếm chỗ danh sách nhiệm vụ */
.kieu-ngang .qc-the { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--k3, 12px); padding-block: 8px; }
.kieu-ngang .qc-the .qc-mo-ta, .kieu-ngang .qc-the .qc-chinh-sach { display: none; }
.kieu-ngang .qc-the .qc-trang-thai { text-align: left; }
.kieu-ngang .qc-the .qc-nut { width: auto; grid-column: 3; grid-row: 1; }
.qc-mau { max-width: 360px; }
.qc-mau-khung { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 110px; max-width: 100%;
  border-radius: var(--bo-2, 12px); background: var(--chinh); color: #fff; font-size: var(--co-4); margin: 0 0 var(--k2, 8px); }
.qc-mau-khung .th-ic, .qc-mau-khung svg { width: 40px; height: 40px; }
.qc-mau-dem { text-align: center; font-weight: 700; min-height: 1.4em; }

/* xep-hang/xep-hang.css */
/* Bảng xếp hạng tuần (xep-hang/th-xep-hang.js), cột ở trang Nhiệm vụ */
.xh-the h3 small { margin-left: auto; font-size: var(--co-1); font-weight: 700; color: var(--chu-nhat); }
.xh-loc-hang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 6px; }
.xh-seg { flex: 1 1 180px; display: flex; }
.xh-seg button { flex: 1 1 0; }
.xh-loc { flex: 1 1 140px; min-width: 0; min-height: 40px; }
.xh-khach { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 4px; border-radius: 10px; background: var(--mat-2); font-size: var(--co-2); }
.xh-khach span { flex: 1; min-width: 0; }
.xh-ds { display: flex; flex-direction: column; }
.xh-dong { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--vien); min-height: 48px; }
.xh-ds > .xh-dong:first-child { border-top: 0; }
.xh-dong.toi { background: color-mix(in srgb, var(--chinh) 9%, transparent); border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.xh-hang { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: var(--co-2); color: var(--chu-nhat); background: var(--mat-2); }
.xh-dong.top .xh-hang { color: #fff; }
.xh-dong.top-1 .xh-hang { background: #c99a1e; }
.xh-dong.top-2 .xh-hang { background: #8d96a3; }
.xh-dong.top-3 .xh-hang { background: #b0703f; }
.xh-av.th-av { --av: 34px; flex: none; }
.xh-ten { flex: 1; min-width: 0; font-size: var(--co-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh-so { display: flex; flex-direction: column; align-items: flex-end; flex: none; gap: 1px; }
.xh-so b { font-size: var(--co-2); color: var(--chinh); }
.xh-so small { font-size: var(--co-1); color: var(--chu-nhat); font-weight: 700; }
.xh-cach { height: 0; border-top: 2px dashed var(--vien); margin: 6px 0; }
.xh-trong { margin: 10px 2px; color: var(--chu-nhat); font-size: var(--co-2); line-height: 1.45; }
.xh-ghi-chu { display: block; margin-top: 8px; color: var(--chu-nhat); font-size: var(--co-1); line-height: 1.4; }

