/* =====================================================================================
   COTUONG68 — giao diện dùng chung.
   Hai chủ đề, đổi bằng thuộc tính data-bs-theme trên <html> (xem theme.js):
     dark  = "Tối ánh vàng": nền gỗ đen, viền vàng kim (mặc định)
     light = "Cổ phong": giấy dó, gỗ ấm, mực nâu
   ===================================================================================== */
:root {
  --xq-red: #C0392B;
  --xq-red-hi: #e0533f;
  --xq-ink: #2C3E50;
  --xq-ivory: #FDF6E2;
  --xq-gold: #e8b84b;
  --xq-gold-hi: #f8e08e;
  --xq-gold-lo: #b8862a;
  --xq-gold-grad: linear-gradient(180deg, #fbe9a0 0%, #e8b84b 48%, #b8862a 100%);
  --xq-radius: 14px;
  --xq-font-ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --xq-font-display: "Playfair Display", "Noto Serif TC", Georgia, serif;
  --xq-font-han: "Noto Serif TC", "KaiTi", "SimSun", "Microsoft YaHei", serif;
  --xq-font-brush: "Pacifico", "Lobster", "Brush Script MT", cursive;
}
[data-bs-theme="dark"] {
  --xq-bg: #120c07;
  --xq-bg-2: #1a120a;
  --xq-surface: #1e150d;
  --xq-surface-2: #281d11;
  --xq-surface-3: #34261a;
  --xq-border: #4a3516;
  --xq-border-strong: #8a6a2b;
  --xq-text: #f3e8d0;
  --xq-muted: #ad9c7e;
  --xq-gold-text: #f2c75c;
  --xq-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --xq-glow: rgba(232, 184, 75, .16);
  --xq-chip: rgba(255, 255, 255, .06);
  --xq-field: #130d07;
  --xq-nav-bg: linear-gradient(180deg, #2a1c0e 0%, #170f07 100%);
  --xq-panel-bg: linear-gradient(180deg, #24190f 0%, #1b130b 100%);
  --xq-tile-bg: linear-gradient(180deg, #33250f 0%, #231809 100%);
  --bs-body-bg: var(--xq-bg);
  --bs-body-bg-rgb: 18, 12, 7;
  --bs-body-color: var(--xq-text);
  --bs-body-color-rgb: 243, 232, 208;
  --bs-secondary-color: var(--xq-muted);
  --bs-secondary-color-rgb: 173, 156, 126;
  --bs-tertiary-bg: var(--xq-surface-2);
  --bs-secondary-bg: var(--xq-surface-2);
  --bs-emphasis-color: #fff6df;
  --bs-border-color: var(--xq-border);
  --bs-border-color-translucent: rgba(138, 106, 43, .35);
  --bs-link-color: #f2c75c;
  --bs-link-color-rgb: 242, 199, 92;
  --bs-link-hover-color: #ffe596;
  --bs-link-hover-color-rgb: 255, 229, 150;
  --bs-heading-color: #fff0cc;
  --bs-code-color: #ffd47a;
}
[data-bs-theme="light"] {
  --xq-bg: #f4ead3;
  --xq-bg-2: #efe2c4;
  --xq-surface: #fffaf0;
  --xq-surface-2: #f7edd3;
  --xq-surface-3: #efe0bb;
  --xq-border: #dac79b;
  --xq-border-strong: #b89a5a;
  --xq-text: #2b1d12;
  --xq-muted: #7b6a50;
  --xq-gold-text: #9a6b10;
  --xq-shadow: 0 8px 24px rgba(90, 58, 20, .18);
  --xq-glow: rgba(184, 134, 42, .18);
  --xq-chip: rgba(90, 58, 20, .07);
  --xq-field: #fffdf7;
  --xq-nav-bg: linear-gradient(180deg, #4a2f17 0%, #35200e 100%);
  --xq-panel-bg: linear-gradient(180deg, #fffdf6 0%, #fbf3df 100%);
  --xq-tile-bg: linear-gradient(180deg, #fff8e3 0%, #f5e7c3 100%);
  --bs-body-bg: var(--xq-bg);
  --bs-body-color: var(--xq-text);
  --bs-secondary-color: var(--xq-muted);
  --bs-border-color: var(--xq-border);
  --bs-tertiary-bg: var(--xq-surface-2);
  --bs-link-color: #9a2f22;
  --bs-link-color-rgb: 154, 47, 34;
  --bs-link-hover-color: #7c2218;
  --bs-link-hover-color-rgb: 124, 34, 24;
}

/* ------------------------------------------------------------------ nền & chữ */
html { scroll-behavior: smooth; font-size: 15px; } /* Bootstrap tính theo rem: 15px thay vì 16px làm gọn toàn bộ giao diện */
body {
  font-family: var(--xq-font-ui);
  color: var(--xq-text);
  min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--xq-bg);
  background-image:
    radial-gradient(1100px 520px at 50% -140px, var(--xq-glow), transparent 70%),
    url("/static/img/bg-clouds.svg");
  background-repeat: no-repeat, repeat;
  background-size: auto, 520px 260px;
  background-attachment: fixed, scroll;
}
main { flex: 1; }
h1, h2, h3, .display-5, .display-6 { font-family: var(--xq-font-display); }
.han { font-family: var(--xq-font-han); }
a { text-underline-offset: 3px; }
::selection { background: var(--xq-gold); color: #2a1a05; }
:focus-visible { outline: 2px solid var(--xq-gold); outline-offset: 2px; }
.text-gold { color: var(--xq-gold-text) !important; }
.text-muted, .text-body-secondary { color: var(--xq-muted) !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--xq-border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }

/* ------------------------------------------------------------------ thanh điều hướng */
.navbar-xq {
  background: var(--xq-nav-bg);
  border-bottom: 1px solid var(--xq-border-strong);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  position: relative; z-index: 1030;
}
.navbar-xq::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--xq-gold), transparent); opacity: .7; }
.navbar-xq .navbar-brand { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; }
.brand-logo { width: 42px; height: 42px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.brand-word { font-family: var(--xq-font-display); font-weight: 800; font-size: 1.28rem; letter-spacing: .6px; line-height: 1.3; margin-block: -.15em; background: var(--xq-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-word small { font-family: var(--xq-font-ui); font-size: .62rem; font-weight: 700; letter-spacing: 1.5px; color: #e9d7a5; -webkit-text-fill-color: #e9d7a5; opacity: .85; margin-left: 1px; }
.navbar-xq .nav-link { color: #e9dcc0; font-weight: 500; font-size: .93rem; padding: .6rem .85rem; border-radius: 10px; position: relative; transition: color .15s, background .15s; }
.navbar-xq .nav-link:hover { color: #fff3cf; background: rgba(255, 255, 255, .06); }
.navbar-xq .nav-link.active { color: #ffe08a; font-weight: 700; }
.navbar-xq .nav-link.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--xq-gold-grad); }
.navbar-xq .navbar-toggler { border-color: rgba(255, 255, 255, .25); }
.navbar-xq .navbar-toggler-icon { filter: invert(1) brightness(1.4) sepia(.5); }
.navbar-xq .dropdown-menu { background: var(--xq-surface-2); border: 1px solid var(--xq-border-strong); box-shadow: var(--xq-shadow); }
.navbar-xq .dropdown-item { color: var(--xq-text); }
.navbar-xq .dropdown-item:hover, .navbar-xq .dropdown-item:focus { background: var(--xq-surface-3); color: var(--xq-gold-hi); }
.nav-icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #f0dfb4; background: rgba(255, 255, 255, .06); border: 1px solid rgba(232, 184, 75, .3); transition: .15s; }
.nav-icon-btn:hover { color: #fff3cf; background: rgba(232, 184, 75, .18); border-color: var(--xq-gold); }
.nav-user { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .7rem .25rem .3rem; border-radius: 999px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(232, 184, 75, .35); color: #f6e7bd; text-decoration: none; }
.nav-user:hover { color: #fff; border-color: var(--xq-gold); }
.nav-user .nu-name { font-weight: 600; font-size: .88rem; line-height: 1.1; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .nu-sub { font-size: .72rem; color: #cdb98a; line-height: 1.1; }
.navbar-xq.navbar-slim { padding-top: .1rem; padding-bottom: .1rem; }
.navbar-slim .container-fluid, .navbar-slim .container { min-height: 46px; }
.navbar-slim .brand-logo { width: 32px; height: 32px; }
.announce { background: linear-gradient(90deg, #5a3a0a, #7a520f, #5a3a0a); color: #ffeab0; border-bottom: 1px solid var(--xq-gold-lo); font-size: .9rem; }

/* ------------------------------------------------------------------ nút bấm */
.btn { border-radius: 10px; font-weight: 600; }
.btn-xq { background: linear-gradient(180deg, #d4503f 0%, var(--xq-red) 55%, #9c2a1d 100%); color: #fff; border: 1px solid #7e2116; box-shadow: 0 2px 0 #6e1c12, 0 6px 14px rgba(192, 57, 43, .28); }
.btn-xq:hover, .btn-xq:focus { background: linear-gradient(180deg, #e0604f 0%, #cc4130 55%, #a82e20 100%); color: #fff; }
.btn-xq:active { transform: translateY(1px); box-shadow: 0 1px 0 #6e1c12; }
.btn-xq:disabled { opacity: .55; }
.btn-gold { background: var(--xq-gold-grad); color: #3a2506; border: 1px solid #8a6419; box-shadow: 0 2px 0 #7a5614, 0 6px 14px rgba(232, 184, 75, .25); font-weight: 700; }
.btn-gold:hover, .btn-gold:focus { color: #2a1a05; filter: brightness(1.07); }
.btn-gold:active { transform: translateY(1px); box-shadow: 0 1px 0 #7a5614; }
.btn-ghost { background: var(--xq-chip); color: var(--xq-text); border: 1px solid var(--xq-border-strong); }
.btn-ghost:hover { background: var(--xq-glow); color: var(--xq-gold-hi); border-color: var(--xq-gold); }
[data-bs-theme="light"] .btn-ghost:hover { color: var(--xq-red); }
.btn-outline-dark, .btn-outline-secondary { --bs-btn-color: var(--xq-text); --bs-btn-border-color: var(--xq-border-strong); --bs-btn-hover-color: var(--xq-bg); --bs-btn-hover-bg: var(--xq-gold); --bs-btn-hover-border-color: var(--xq-gold); --bs-btn-active-color: var(--xq-bg); --bs-btn-active-bg: var(--xq-gold-lo); --bs-btn-active-border-color: var(--xq-gold-lo); --bs-btn-disabled-color: var(--xq-muted); --bs-btn-disabled-border-color: var(--xq-border); }
[data-bs-theme="light"] .btn-outline-dark:hover, [data-bs-theme="light"] .btn-outline-secondary:hover { --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #6b4421; --bs-btn-hover-border-color: #6b4421; }
.btn-dark { --bs-btn-bg: var(--xq-surface-3); --bs-btn-border-color: var(--xq-border-strong); --bs-btn-color: var(--xq-text); --bs-btn-hover-bg: var(--xq-gold); --bs-btn-hover-color: #2a1a05; --bs-btn-hover-border-color: var(--xq-gold); --bs-btn-active-bg: var(--xq-gold-lo); }
.btn-light { --bs-btn-bg: var(--xq-surface-3); --bs-btn-color: var(--xq-text); --bs-btn-border-color: var(--xq-border); --bs-btn-hover-bg: var(--xq-surface-2); --bs-btn-hover-color: var(--xq-gold-hi); }
.btn-outline-primary { --bs-btn-color: #7fb2ff; --bs-btn-border-color: #4a7bc8; --bs-btn-hover-bg: #2f5fb3; --bs-btn-hover-border-color: #2f5fb3; --bs-btn-hover-color: #fff; }
[data-bs-theme="light"] .btn-outline-primary { --bs-btn-color: #1f4f9d; --bs-btn-border-color: #5f86c9; }
.btn-warning { --bs-btn-bg: var(--xq-gold); --bs-btn-border-color: #8a6419; --bs-btn-color: #2a1a05; --bs-btn-hover-bg: var(--xq-gold-hi); --bs-btn-hover-border-color: #8a6419; --bs-btn-hover-color: #2a1a05; }

/* ------------------------------------------------------------------ thẻ, bảng, form (ghi đè Bootstrap) */
.card { --bs-card-bg: var(--xq-surface); --bs-card-border-color: var(--xq-border); --bs-card-cap-bg: var(--xq-surface-2); --bs-card-cap-color: var(--xq-text); --bs-card-color: var(--xq-text); border-radius: var(--xq-radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
[data-bs-theme="dark"] .card { box-shadow: 0 8px 26px rgba(0, 0, 0, .4); }
.card-header { font-weight: 600; border-bottom-color: var(--xq-border); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--xq-text); --bs-list-group-border-color: var(--xq-border); --bs-list-group-action-hover-bg: var(--xq-surface-2); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--xq-text); --bs-table-border-color: var(--xq-border); --bs-table-hover-bg: var(--xq-glow); --bs-table-hover-color: var(--xq-text); --bs-table-striped-bg: var(--xq-chip); }
.table > :not(caption) > * > * { border-bottom-color: var(--xq-border); }
.form-control, .form-select { background-color: var(--xq-field); border-color: var(--xq-border-strong); color: var(--xq-text); border-radius: 10px; }
.form-control::placeholder { color: var(--xq-muted); opacity: .8; }
.form-control:focus, .form-select:focus { background-color: var(--xq-field); color: var(--xq-text); border-color: var(--xq-gold); box-shadow: 0 0 0 .22rem var(--xq-glow); }
.form-check-input { background-color: var(--xq-field); border-color: var(--xq-border-strong); }
.form-check-input:checked { background-color: var(--xq-gold-lo); border-color: var(--xq-gold); }
.input-group-text { background: var(--xq-surface-3); border-color: var(--xq-border-strong); color: var(--xq-text); }
.dropdown-menu { --bs-dropdown-bg: var(--xq-surface-2); --bs-dropdown-border-color: var(--xq-border-strong); --bs-dropdown-link-color: var(--xq-text); --bs-dropdown-link-hover-bg: var(--xq-surface-3); --bs-dropdown-link-hover-color: var(--xq-gold-hi); --bs-dropdown-divider-bg: var(--xq-border); --bs-dropdown-color: var(--xq-text); }
.modal-content { --bs-modal-bg: var(--xq-surface); --bs-modal-border-color: var(--xq-border-strong); --bs-modal-color: var(--xq-text); border-radius: 18px; box-shadow: var(--xq-shadow); }
.modal-header, .modal-footer { border-color: var(--xq-border); }
.offcanvas { --bs-offcanvas-bg: var(--xq-surface); --bs-offcanvas-color: var(--xq-text); --bs-offcanvas-border-color: var(--xq-border-strong); }
.nav-tabs { --bs-nav-tabs-border-color: var(--xq-border); --bs-nav-tabs-link-active-bg: var(--xq-surface); --bs-nav-tabs-link-active-color: var(--xq-gold-text); --bs-nav-tabs-link-active-border-color: var(--xq-border-strong) var(--xq-border-strong) var(--xq-surface); --bs-nav-link-color: var(--xq-muted); --bs-nav-link-hover-color: var(--xq-text); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--xq-gold-lo); --bs-nav-pills-link-active-color: #fff7dc; --bs-nav-link-color: var(--xq-muted); }
.progress { background: var(--xq-chip); }
.badge.text-bg-dark { background: var(--xq-surface-3) !important; color: var(--xq-gold-hi) !important; border: 1px solid var(--xq-border-strong); }
.badge.text-bg-light { background: var(--xq-chip) !important; color: var(--xq-text) !important; }
.badge.text-bg-warning { background: var(--xq-gold-grad) !important; color: #3a2506 !important; }
.bg-light, .bg-white { background-color: var(--xq-surface-2) !important; color: var(--xq-text) !important; }
.text-dark, .text-dark-emphasis { color: var(--xq-text) !important; }
.border { border-color: var(--xq-border) !important; }
.alert-warning { --bs-alert-bg: rgba(232, 184, 75, .14); --bs-alert-border-color: rgba(232, 184, 75, .5); --bs-alert-color: var(--xq-text); }
.alert-info { --bs-alert-bg: rgba(70, 140, 220, .14); --bs-alert-border-color: rgba(70, 140, 220, .45); --bs-alert-color: var(--xq-text); }
.alert-danger { --bs-alert-bg: rgba(220, 60, 50, .15); --bs-alert-border-color: rgba(220, 60, 50, .5); --bs-alert-color: var(--xq-text); }
.alert-success { --bs-alert-bg: rgba(60, 170, 100, .15); --bs-alert-border-color: rgba(60, 170, 100, .5); --bs-alert-color: var(--xq-text); }
.alert-secondary { --bs-alert-bg: var(--xq-chip); --bs-alert-border-color: var(--xq-border); --bs-alert-color: var(--xq-text); }
.toast { --bs-toast-border-radius: 12px; box-shadow: var(--xq-shadow); }
.rating-pill { background: var(--xq-surface-3); color: var(--xq-gold-hi); border: 1px solid var(--xq-border-strong); border-radius: 999px; padding: 0 .55rem; font-size: .75rem; font-weight: 700; }
[data-bs-theme="light"] .rating-pill { background: #4a2f17; color: #ffe8a8; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #d9c39b; border: 2px solid var(--xq-border-strong); }
.avatar-lg { width: 96px; height: 96px; border-width: 3px; }
.avatar-sm { width: 28px; height: 28px; border-width: 1px; }
.table-hover tbody tr { cursor: default; }
.rank-1 { color: #f5c542; } .rank-2 { color: #c4ccd6; } .rank-3 { color: #d08a4e; }
.toast-container { z-index: 2000; }
code.room-code { font-size: 1.4rem; letter-spacing: .25rem; background: var(--xq-field); padding: .15rem .6rem; border-radius: .4rem; border: 1px dashed var(--xq-gold-lo); color: var(--xq-gold-text); }
.rule-piece { font-family: var(--xq-font-han); font-size: 1.6rem; font-weight: 700; }

/* ------------------------------------------------------------------ khung có viền vàng (panel) */
.panel { position: relative; background: var(--xq-panel-bg); border: 1px solid var(--xq-border-strong); border-radius: var(--xq-radius); box-shadow: var(--xq-shadow); overflow: hidden; }
.panel::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--xq-gold), transparent); opacity: .9; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1rem .6rem; }
.panel-title { margin: 0; font-family: var(--xq-font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .2px; color: var(--xq-gold-text); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.panel-title i { font-size: 1.05rem; }
.panel-head { flex-wrap: wrap; }
.seg button { white-space: nowrap; }
.panel-body { padding: .25rem 1rem 1rem; }
.link-more { font-size: .8rem; color: var(--xq-muted); text-decoration: none; }
.link-more:hover { color: var(--xq-gold-hi); }

/* ------------------------------------------------------------------ TRANG CHỦ */
.home { max-width: 1480px; margin: 0 auto; width: 100%; padding: 1.1rem 1.25rem 1.5rem; }
.home-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; gap: 1.1rem; align-items: start; }
.home-right { align-self: stretch; }
@media (max-width: 1199.98px) { .home-grid { grid-template-columns: minmax(0, 1fr) 330px; } .home-left { grid-column: 1 / -1; order: 3; } }
@media (max-width: 991.98px) { .home { padding: .8rem .75rem 1.2rem; } .home-grid { grid-template-columns: minmax(0, 1fr); } .home-center { order: 1; } .home-right { order: 2; align-self: auto; } .home-left { order: 3; } }

.hero-xq { position: relative; text-align: center; padding: 1.5rem 1rem 1.2rem; border-radius: 20px; overflow: hidden; margin-bottom: 1.1rem;
  background: radial-gradient(520px 260px at 50% 0%, rgba(232, 184, 75, .22), transparent 70%), linear-gradient(180deg, var(--xq-surface-2), var(--xq-surface)); border: 1px solid var(--xq-border-strong); box-shadow: var(--xq-shadow); }
.hero-xq::before, .hero-xq::after { content: ""; position: absolute; width: 56px; height: 56px; border: 2px solid var(--xq-gold); opacity: .7; }
.hero-xq::before { left: 10px; top: 10px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.hero-xq::after { right: 10px; bottom: 10px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.hero-xq .hero-mark { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: space-between; padding: 0 1.4rem; font-family: var(--xq-font-han); font-weight: 900; font-size: 8.5rem; line-height: 1; opacity: .055; color: var(--xq-gold); user-select: none; }
.hero-logo { width: 96px; height: 96px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.hero-title { font-family: var(--xq-font-display); font-weight: 800; font-size: clamp(1.45rem, 3.6vw, 2.1rem); line-height: 1.3; padding-block: .06em; margin: .2rem 0 .2rem; background: var(--xq-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-title small { display: block; font-family: var(--xq-font-ui); font-size: .72rem; letter-spacing: .35em; font-weight: 600; margin-top: .3rem; background: none; -webkit-text-fill-color: var(--xq-muted); color: var(--xq-muted); }
.hero-sub { color: var(--xq-muted); max-width: 520px; margin: 0 auto; font-size: .95rem; }
.hero-live { display: inline-flex; gap: .4rem; align-items: center; margin-top: .8rem; font-size: .82rem; color: var(--xq-muted); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: ping 1.8s infinite; display: inline-block; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

.tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.time-tile { position: relative; text-align: center; padding: .85rem .5rem .75rem; cursor: pointer; border-radius: 14px; background: var(--xq-tile-bg); border: 1px solid var(--xq-border-strong); color: var(--xq-text); transition: transform .12s, box-shadow .15s, border-color .15s; font-family: inherit; }
.time-tile:hover { transform: translateY(-2px); border-color: var(--xq-gold); box-shadow: 0 8px 22px var(--xq-glow), inset 0 0 0 1px rgba(232, 184, 75, .25); }
.time-tile:active { transform: translateY(0); }
.time-tile .tt-num { display: block; font-family: var(--xq-font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; background: var(--xq-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.time-tile .tt-num sup { font-size: .95rem; top: -.9em; margin-left: 1px; }
.time-tile .tt-name { display: block; font-weight: 700; margin-top: .3rem; letter-spacing: .3px; font-size: .92rem; }
.time-tile .tt-sub { display: block; font-size: .72rem; color: var(--xq-muted); margin-top: .1rem; }
.time-tile .tt-ico { position: absolute; right: 8px; top: 6px; font-size: .8rem; color: var(--xq-gold); opacity: .8; }
.time-tile[disabled] { opacity: .5; pointer-events: none; }

.feature-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 1rem; border-radius: 16px; background: var(--xq-panel-bg); border: 1px solid var(--xq-border-strong); box-shadow: var(--xq-shadow); }
.feature-card .fc-ico { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: .6rem; background: var(--xq-gold-grad); color: #3a2506; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.feature-card h3 { font-size: 1.05rem; margin: 0 0 .25rem; color: var(--xq-gold-text); font-weight: 700; }
.feature-card p { font-size: .84rem; color: var(--xq-muted); margin-bottom: .8rem; }
.feature-card .btn { margin-top: auto; }
.feature-wide { flex-direction: row; align-items: center; gap: 1rem; height: auto; }
.feature-wide .fc-ico { margin: 0; flex: none; width: 54px; height: 54px; font-size: 1.6rem; }
.feature-wide .fc-main { flex: 1; min-width: 0; }
.feature-wide .fc-main p { margin-bottom: .5rem; }
.feature-wide .fc-actions { flex: none; width: 210px; display: flex; flex-direction: column; gap: .5rem; }
.feature-wide .fc-actions .btn { margin-top: 0; }
@media (max-width: 767.98px) { .feature-wide { flex-wrap: wrap; } .feature-wide .fc-main { flex-basis: calc(100% - 70px); } .feature-wide .fc-actions { width: 100%; flex-direction: row; } .feature-wide .fc-actions .form-select { flex: 1; } .feature-wide .fc-actions .btn { width: auto !important; flex: none; } }
.level-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.lv-pill { border: 1px solid var(--xq-border-strong); background: var(--xq-chip); color: var(--xq-text); font-size: .78rem; font-weight: 600; padding: .28rem .65rem; border-radius: 999px; cursor: pointer; transition: .12s; font-family: inherit; }
.lv-pill:hover { border-color: var(--xq-gold); color: var(--xq-gold-hi); }
.lv-pill.on { background: var(--xq-gold-grad); color: #3a2506; border-color: #8a6419; box-shadow: 0 2px 8px var(--xq-glow); }
.mini-board.board-wrap, .mini-board { max-width: 168px; margin: 0 auto .7rem; pointer-events: none; }
.mini-board svg { border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }

.lb-list { list-style: none; margin: 0; padding: 0 .35rem .6rem; }
.lb-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem; border-radius: 12px; transition: background .12s; }
.lb-item:hover { background: var(--xq-glow); }
.lb-rank { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; flex: none; background: var(--xq-chip); color: var(--xq-muted); }
.lb-item:nth-child(1) .lb-rank { background: var(--xq-gold-grad); color: #3a2506; }
.lb-item:nth-child(2) .lb-rank { background: linear-gradient(180deg, #e6e9ee, #a9b0bb); color: #2b303a; }
.lb-item:nth-child(3) .lb-rank { background: linear-gradient(180deg, #e8b07a, #a8672f); color: #2e1708; }
.lb-name { font-weight: 600; font-size: .9rem; line-height: 1.15; min-width: 0; flex: 1; }
.lb-name a { color: var(--xq-text); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name a:hover { color: var(--xq-gold-hi); }
.lb-name small { color: var(--xq-muted); font-weight: 400; font-size: .72rem; }
.lb-score { font-weight: 800; color: var(--xq-gold-text); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--xq-chip); border: 1px solid var(--xq-border); }
.seg button { border: 0; background: transparent; color: var(--xq-muted); padding: .15rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; font-family: inherit; }
.seg button.on { background: var(--xq-gold-grad); color: #3a2506; }

.wchat { display: flex; flex-direction: column; height: 100%; min-height: 420px; }
.wchat-box { flex: 1; min-height: 300px; overflow-y: auto; padding: .25rem 1rem; display: flex; flex-direction: column; gap: .5rem; scroll-behavior: smooth; }
.wchat-msg { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; }
.wchat-msg .avatar { width: 28px; height: 28px; border-width: 1px; flex: none; margin-top: 2px; }
.wchat-msg .wc-name { font-weight: 700; color: var(--xq-gold-text); font-size: .8rem; }
.wchat-msg .wc-name.vip::after { content: "VIP"; margin-left: .3rem; font-size: .6rem; padding: 0 .3rem; border-radius: 4px; background: var(--xq-gold-grad); color: #3a2506; vertical-align: 1px; }
.wchat-msg .wc-text { word-break: break-word; line-height: 1.35; }
.wchat-msg.me .wc-name { color: var(--xq-red-hi); }
.wchat-msg .wc-del { opacity: 0; margin-left: .35rem; font-size: .7rem; color: var(--xq-muted); cursor: pointer; }
.wchat-msg:hover .wc-del { opacity: 1; }
.wchat-form { padding: .6rem .75rem .8rem; border-top: 1px solid var(--xq-border); display: flex; gap: .4rem; position: relative; }
.wchat-form .form-control { font-size: .88rem; }
.emoji-pop { position: absolute; bottom: calc(100% + 4px); left: .5rem; right: .5rem; background: var(--xq-surface-2); border: 1px solid var(--xq-border-strong); border-radius: 12px; padding: .5rem; display: none; grid-template-columns: repeat(8, 1fr); gap: 2px; box-shadow: var(--xq-shadow); z-index: 10; }
.emoji-pop.open { display: grid; }
.emoji-pop button { border: 0; background: transparent; font-size: 1.25rem; border-radius: 8px; padding: .15rem; line-height: 1.2; }
.emoji-pop button:hover { background: var(--xq-glow); transform: scale(1.15); }

.home-foot { margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; padding: .75rem 1.1rem; border-radius: 14px; background: var(--xq-nav-bg); border: 1px solid var(--xq-border-strong); color: #e9dcc0; font-size: .86rem; }
.home-foot a { color: #f0dfb4; text-decoration: none; }
.home-foot a:hover { color: #fff; }
.home-foot .hf-group { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.soc { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(232, 184, 75, .35); font-size: .95rem; }
.soc:hover { background: var(--xq-gold); color: #2a1a05 !important; }
.site-foot { text-align: center; color: var(--xq-muted); font-size: .8rem; padding: 1rem 0 1.3rem; }
.site-foot a { color: var(--xq-muted); }
.site-foot a:hover { color: var(--xq-gold-hi); }

/* màn hình chờ ghép trận */
.overlay-wait { position: fixed; inset: 0; z-index: 1900; background: rgba(8, 5, 2, .78); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 1rem; }
.overlay-wait.open { display: flex; }
.overlay-box { width: min(92vw, 380px); text-align: center; padding: 1.6rem 1.4rem; border-radius: 20px; background: var(--xq-panel-bg); border: 1px solid var(--xq-gold); box-shadow: 0 0 0 4px rgba(232, 184, 75, .12), var(--xq-shadow); }
.spin-coin { width: 74px; height: 74px; margin: 0 auto .8rem; animation: coin 1.6s linear infinite; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
@keyframes coin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

/* ------------------------------------------------------------------ BÀN CỜ & VÁN ĐẤU */
.board-wrap { position: relative; width: 100%; max-width: 640px; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.board-wrap svg { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 3px rgba(232, 184, 75, .55), 0 0 0 5px rgba(0, 0, 0, .35); }
.piece-text { font-family: var(--xq-font-han); font-weight: 900; pointer-events: none; }
.xq-check-flash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 5; animation: chk-bg 1.4s ease-out forwards; }
.xq-check-text { font-family: var(--xq-font-brush); font-size: clamp(3rem, 14vw, 5.6rem); color: #ff4a36; text-shadow: 0 0 18px rgba(255, 70, 50, .9), 0 3px 0 #7a1208, 0 8px 20px rgba(0, 0, 0, .6); transform: rotate(-6deg); animation: chk-pop 1.4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.xq-check-han { font-family: var(--xq-font-han); font-weight: 900; font-size: clamp(1.1rem, 4vw, 1.7rem); letter-spacing: .5em; margin-top: -.2em; color: #ffd9a0; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); animation: chk-pop 1.4s ease-out forwards; }
@keyframes chk-pop { 0% { opacity: 0; transform: scale(.4) rotate(-14deg); } 18% { opacity: 1; transform: scale(1.18) rotate(-6deg); } 30% { transform: scale(1) rotate(-6deg); } 78% { opacity: 1; } 100% { opacity: 0; transform: scale(1.06) rotate(-6deg); } }
@keyframes chk-bg { 0%, 100% { background: transparent; } 12% { background: radial-gradient(closest-side, rgba(255, 40, 20, .28), transparent); } 60% { background: radial-gradient(closest-side, rgba(255, 40, 20, .1), transparent); } }
.sq-hit { fill: transparent; cursor: pointer; }

/* khung ván 3 cột */
.gm { display: grid; gap: 1rem; padding: .9rem 1rem 1.2rem; max-width: 1560px; margin: 0 auto; width: 100%; grid-template-columns: 210px minmax(0, 1fr) 370px; align-items: start; }
.gm-left, .gm-right { position: sticky; top: .9rem; }
.gm-center { min-width: 0; }
.gm .board-wrap { max-width: min(100%, calc((100vh - 240px) * 0.905)); }
.side-menu { list-style: none; margin: 0; padding: .35rem; }
.side-menu a, .side-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .8rem; border-radius: 10px; color: var(--xq-text); text-decoration: none; font-weight: 500; font-size: .92rem; background: transparent; border: 0; text-align: left; font-family: inherit; }
.side-menu a:hover, .side-menu button:hover { background: var(--xq-glow); color: var(--xq-gold-hi); }
.side-menu a.on { color: var(--xq-gold-text); background: var(--xq-glow); font-weight: 700; }
.side-menu i { color: var(--xq-gold); width: 1.15em; text-align: center; }
.side-sep { height: 1px; margin: .35rem .6rem; background: linear-gradient(90deg, transparent, var(--xq-border-strong), transparent); }
.side-label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--xq-muted); padding: .35rem .85rem .15rem; }
.face-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: .25rem .6rem .5rem; }
.face-opt { border: 1px solid var(--xq-border); background: var(--xq-chip); border-radius: 10px; padding: .3rem .2rem; text-align: center; font-size: .66rem; color: var(--xq-muted); cursor: pointer; line-height: 1.15; font-family: inherit; }
.face-opt .fo-pc { display: block; width: 30px; height: 30px; border-radius: 50%; margin: 0 auto .2rem; background: var(--xq-ivory); border: 2px solid #a07c43; color: var(--xq-red); font: 900 16px/26px var(--xq-font-han); position: relative; }
.face-opt.on { border-color: var(--xq-gold); color: var(--xq-gold-hi); background: var(--xq-glow); }
.face-opt .fo-pc i { position: absolute; left: -2px; top: -2px; font-size: 9px; line-height: 1; background: var(--xq-ivory); border-radius: 50%; padding: 1px; font-style: normal; color: var(--xq-ink); }
.face-opt .fo-pc.ico { font-size: 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .85rem; font-size: .88rem; }

.pbar { display: flex; align-items: center; gap: .65rem; padding: .4rem .7rem; border-radius: 14px; background: var(--xq-panel-bg); border: 1px solid var(--xq-border); transition: border-color .2s, box-shadow .2s; }
.pbar.active { border-color: var(--xq-gold); box-shadow: 0 0 0 3px var(--xq-glow); }
.pbar.offline { opacity: .6; }
.pbar .avatar { width: 44px; height: 44px; }
.pbar .pb-main { min-width: 0; flex: 1; }
.pbar .pb-name { font-weight: 700; display: flex; align-items: center; gap: .4rem; line-height: 1.2; }
.pbar .pb-name a { color: var(--xq-text); text-decoration: none; }
.pbar .pb-sub { font-size: .76rem; color: var(--xq-muted); }
.caps { display: flex; flex-wrap: wrap; gap: 2px; min-height: 22px; margin-top: 3px; }
.cap { width: 21px; height: 21px; border-radius: 50%; background: var(--xq-ivory); border: 1.5px solid #a07c43; font: 900 13px/18px var(--xq-font-han); text-align: center; flex: none; }
.cap.r { color: #C0392B; } .cap.b { color: #2C3E50; }
.pb-clock { text-align: right; flex: none; }
.clock { display: inline-block; font-variant-numeric: tabular-nums; font-family: var(--xq-font-ui); font-size: 1.55rem; font-weight: 800; padding: .08rem .65rem; border-radius: 10px; background: #0d0804; color: #ffe9b0; border: 1px solid var(--xq-border-strong); min-width: 96px; text-align: center; letter-spacing: .5px; }
[data-bs-theme="light"] .clock { background: #3a2412; }
.clock.low { background: var(--xq-red); color: #fff; border-color: #ff8a7a; animation: pulse 1s infinite; }
.pb-move { font-size: .72rem; color: var(--xq-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pb-move b { color: var(--xq-gold-text); }
@keyframes pulse { 50% { opacity: .6; } }
.side-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255, 255, 255, .55); flex: none; }
.side-dot.red { background: #C0392B; } .side-dot.black { background: #2C3E50; }

.record { max-height: 300px; overflow-y: auto; padding: 0 .4rem .5rem; font-size: .88rem; }
.record table { width: 100%; border-collapse: collapse; }
.record td { padding: 1px 2px; }
.record td.no { width: 2.1rem; color: var(--xq-muted); text-align: right; padding-right: .4rem; font-variant-numeric: tabular-nums; }
.mv { display: inline-block; min-width: 4.4em; cursor: pointer; padding: .12rem .45rem; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mv.r { color: #ff8a78; } .mv.b { color: #9fc1e8; }
[data-bs-theme="light"] .mv.r { color: #b3261e; } [data-bs-theme="light"] .mv.b { color: #1f4f7a; }
.mv:hover { background: var(--xq-glow); }
.mv.cur { background: var(--xq-gold-grad); color: #3a2506; }
.mv .chk { color: #ff5b49; font-weight: 800; }
.mv.cur .chk { color: #8a1409; }
.view-banner { display: none; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .7rem; margin-bottom: .5rem; border-radius: 10px; background: rgba(232, 184, 75, .15); border: 1px solid var(--xq-gold-lo); font-size: .85rem; }
.view-banner.on { display: flex; }

.act-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; padding: .25rem .8rem .8rem; }
.act-grid .btn { font-size: .86rem; padding: .45rem .5rem; white-space: nowrap; }
.act-grid .wide { grid-column: 1 / -1; }

.chat-box { height: 200px; overflow-y: auto; background: var(--xq-field); border: 1px solid var(--xq-border); border-radius: 10px; padding: .5rem; font-size: .88rem; }
.chat-box .me { color: var(--xq-red-hi); font-weight: 700; }
.quick-emoji { display: flex; flex-wrap: wrap; gap: 3px; padding: .35rem 0 0; }
.quick-emoji button { border: 1px solid var(--xq-border); background: var(--xq-chip); border-radius: 10px; font-size: 1.15rem; line-height: 1.1; padding: .2rem .4rem; }
.quick-emoji button:hover { background: var(--xq-glow); border-color: var(--xq-gold); transform: translateY(-1px); }
.float-emoji { position: absolute; z-index: 6; font-size: 3rem; pointer-events: none; animation: floatUp 2.2s ease-out forwards; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(20px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-90px) scale(1); } }

.conn-banner { position: sticky; top: 0; z-index: 5; }
.status-chip { font-size: .75rem; }
.turn-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--xq-chip); border: 1px solid var(--xq-border); }
.turn-chip.mine { background: rgba(61, 220, 132, .14); border-color: rgba(61, 220, 132, .55); color: #5be39c; }
[data-bs-theme="light"] .turn-chip.mine { color: #167a45; }
.turn-chip.check { background: rgba(255, 70, 50, .16); border-color: rgba(255, 70, 50, .6); color: #ff7d6c; }

/* thanh công cụ đáy (điện thoại) */
.m-bar { display: none; }
@media (max-width: 991.98px) {
  .gm { grid-template-columns: minmax(0, 1fr); padding: .5rem .5rem 5.2rem; gap: .5rem; }
  .gm-left, .gm-right { position: static; }
  .gm-left { display: none; }
  .gm .board-wrap { max-width: min(100%, calc((100vh - 270px) * 0.905)); }
  .gm-center .board-wrap { margin-left: auto; margin-right: auto; }
  .pbar { padding: .35rem .5rem; gap: .5rem; }
  .pbar .avatar { width: 36px; height: 36px; }
  .clock { font-size: 1.2rem; min-width: 78px; padding: .02rem .45rem; }
  .m-bar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; background: var(--xq-nav-bg); border-top: 1px solid var(--xq-border-strong); padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0, 0, 0, .45); }
  .m-bar button { border: 0; background: transparent; color: #f0dfb4; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; padding: .35rem 0; border-radius: 10px; font-family: inherit; position: relative; }
  .m-bar button i { font-size: 1.3rem; color: var(--xq-gold); }
  .m-bar button:active { background: rgba(255, 255, 255, .1); }
  .m-bar .badge-dot { position: absolute; top: 4px; right: calc(50% - 20px); width: 9px; height: 9px; background: var(--xq-red-hi); border-radius: 50%; }
  .offcanvas-bottom { height: min(72vh, 560px); border-top: 2px solid var(--xq-gold); border-radius: 18px 18px 0 0; }
  .offcanvas-bottom .panel { border: 0; box-shadow: none; background: transparent; }
  .offcanvas-bottom .panel::before { display: none; }
  .record { max-height: none; }
}
@media (min-width: 992px) { .offcanvas-lg .offcanvas-header { display: none; } .offcanvas-lg { background: transparent !important; } }

/* ------------------------------------------------------------------ các trang khác */
.page-title { font-family: var(--xq-font-display); font-weight: 800; color: var(--xq-gold-text); }
.puzzle-card { transition: transform .12s, border-color .12s; cursor: pointer; }
.puzzle-card:hover { transform: translateY(-2px); border-color: var(--xq-gold) !important; }
.puzzle-card.solved { border-color: rgba(61, 220, 132, .55) !important; }
.share-btn { display: inline-flex; align-items: center; gap: .4rem; }

@media (max-width: 575.98px) {
  .hero-logo { width: 74px; height: 74px; }
  .brand-word { font-size: 1.05rem; }
  .tile-row { gap: .5rem; }
  .time-tile .tt-num { font-size: 1.8rem; }
  .wchat-box { height: 260px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }

/* ------------------------------------------------------------------ chỉnh theo giao diện sáng & màn hình nhỏ */
.navbar-xq .btn-ghost { color: #f6e7bd; background: rgba(255, 255, 255, .06); border-color: rgba(232, 184, 75, .5); }
.navbar-xq .btn-ghost:hover { color: #fff; background: rgba(232, 184, 75, .2); }
[data-bs-theme="light"] .hero-title, [data-bs-theme="light"] .time-tile .tt-num { background: linear-gradient(180deg, #c0392b 0%, #8f2418 100%); -webkit-background-clip: text; background-clip: text; }
[data-bs-theme="light"] .hero-title small { -webkit-text-fill-color: var(--xq-muted); }
[data-bs-theme="light"] .page-title { color: #8f2418; }
[data-bs-theme="light"] .panel-title, [data-bs-theme="light"] .feature-card h3 { color: #8a5a0c; }
[data-bs-theme="light"] .hero-xq .hero-mark { color: #b8862a; opacity: .12; }
@media (max-width: 575.98px) {
  #nav-sound { display: none; }
  .navbar-xq .navbar-brand { margin-right: .25rem !important; }
  .brand-logo { width: 36px; height: 36px; }
  .navbar-xq .btn-sm { padding: .25rem .6rem; font-size: .8rem; }
  .wchat { min-height: 0; }
  .wchat-box { min-height: 0; height: 240px; flex: none; }
}

.navbar-slim .navbar-toggler { display: none; }


/* tương thích các trang cũ (replay, vip, phòng chờ) */
.hero { position: relative; border-radius: 20px; padding: 2rem 1.2rem; background: radial-gradient(520px 260px at 50% 0%, rgba(232, 184, 75, .2), transparent 70%), linear-gradient(180deg, var(--xq-surface-2), var(--xq-surface)); border: 1px solid var(--xq-border-strong); box-shadow: var(--xq-shadow); }
.hero h1 { font-weight: 800; color: var(--xq-gold-text); }
.player-box { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; border-radius: 14px; background: var(--xq-panel-bg); border: 1px solid var(--xq-border); transition: border-color .2s, box-shadow .2s; }
.player-box.active { border-color: var(--xq-gold); box-shadow: 0 0 0 3px var(--xq-glow); }
.player-box.offline { opacity: .6; }
.move-list { max-height: 280px; overflow-y: auto; font-size: .9rem; }
.navbar-xq .nav-link, .navbar-xq .btn, .navbar-xq .nav-user { white-space: nowrap; }
@media (min-width: 1200px) and (max-width: 1399.98px) { .navbar-xq .nav-link { padding: .6rem .6rem; font-size: .9rem; } }
[data-bs-theme="light"] .face-opt.on, [data-bs-theme="light"] .pz-item.on, [data-bs-theme="light"] .side-menu a:hover, [data-bs-theme="light"] .side-menu button:hover,
[data-bs-theme="light"] .link-more:hover, [data-bs-theme="light"] .lb-name a:hover, [data-bs-theme="light"] .lv-pill:hover { color: #8f2418; }
[data-bs-theme="light"] .side-menu a.on { color: #8f2418; }
[data-bs-theme="light"] .lv-pill.on, [data-bs-theme="light"] .seg button.on { color: #3a2506; }
@media (max-width: 575.98px) {
  .brand-word { font-size: .92rem; letter-spacing: .2px; }
  .brand-word small { font-size: .5rem; letter-spacing: .8px; }
  .navbar-xq .container, .navbar-xq .container-fluid { padding-left: .6rem; padding-right: .6rem; }
  .navbar-xq .navbar-toggler { padding: .2rem .45rem; margin-left: .15rem !important; }
  .nav-icon-btn { width: 34px; height: 34px; }
  .navbar-xq .brand-logo { width: 34px; height: 34px; }
}
@media (max-width: 375.98px) {
  .brand-word small { display: none; }
  .navbar-xq .btn-sm { padding: .22rem .5rem; }
  .navbar-xq .navbar-brand { gap: .4rem; }
}

/* =====================================================================================
   THANH ĐẦU TRANG COTUONG68 (hx-*) — dựng theo ảnh mẫu, co giãn theo --u (1 đơn vị = 1px của ảnh mẫu rộng 2000px)
   ===================================================================================== */
:root { --u: calc(min(100vw, 1920px) / 2000); --fu: calc(var(--u) * .62); --fh: calc(var(--u) * .78); --font-cond: "Barlow Condensed", "Be Vietnam Pro", "Arial Narrow", sans-serif; }
.hx-header { position: relative; z-index: 1035; background: #1b1b1b; border-bottom: 2px solid #6b5333; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.hx-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: linear-gradient(90deg, transparent 0, #c79a4a 22%, #c79a4a 78%, transparent 100%); opacity: .55; pointer-events: none; }
.hx-inner { display: flex; align-items: stretch; gap: calc(14 * var(--u)); height: max(60px, calc(130 * var(--u))); padding: 0 calc(40 * var(--u)) 0 calc(48 * var(--u)); }
.hx-logo { display: flex; align-items: center; flex: none; padding-right: calc(14 * var(--u)); }
.hx-logo img { height: max(44px, calc(120 * var(--u))); width: auto; display: block; }
.hx-nav { display: flex; align-items: stretch; flex: 1; min-width: 0; }
.hx-tab { display: flex; align-items: center; position: relative; padding: 0 calc(16 * var(--u)); color: #f0e6d2; font-family: var(--font-cond); font-weight: 700; text-transform: uppercase; font-size: max(14px, calc(29 * var(--fh))); letter-spacing: .02em; text-decoration: none; white-space: nowrap; transition: color .15s, background .15s; cursor: pointer; }
.hx-tab:hover { color: #ffd98a; background: rgba(255, 255, 255, .04); }
.hx-tab.on { color: #fff; background: linear-gradient(180deg, #23211e 0%, #34291c 55%, #6a4d26 100%); box-shadow: inset 0 -3px 0 #f1c25f, 0 8px 22px rgba(241, 194, 95, .28); }
.hx-tab.on::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; background: #ffe39a; filter: blur(.4px); box-shadow: 0 0 12px 2px rgba(255, 214, 110, .8); }
.hx-pay { align-self: center; margin: 0 calc(8 * var(--u)); padding: calc(9 * var(--u)) calc(26 * var(--u)); color: #5b2606; background: linear-gradient(180deg, #ffe6a0 0%, #f0b946 50%, #c98a1e 100%); border-radius: 8px; border: 2px solid #ffefba; box-shadow: 0 0 0 2px #a87218, 0 0 18px rgba(255, 196, 72, .45), inset 0 1px 0 #fff6d2; }
.hx-pay:hover { color: #3d1503; background: linear-gradient(180deg, #fff0bd 0%, #f6c75a 50%, #d79a2a 100%); }
.hx-dd { display: flex; align-items: stretch; }
.hx-dd .hx-tab::after { display: none; }
.hx-dd .dropdown-toggle::after { display: inline-block; margin-left: .35em; border-top-color: currentColor; }
.hx-menu { background: #232018; border: 1px solid #8a6a3b; --bs-dropdown-link-color: #efe3cc; --bs-dropdown-link-hover-bg: #3a2f1e; --bs-dropdown-link-hover-color: #ffd98a; box-shadow: 0 12px 30px rgba(0, 0, 0, .55); }
.hx-burger { display: none; margin-left: auto; align-self: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid #8a6a3b; background: #262219; color: #f0dfb4; font-size: 1.6rem; line-height: 1; }

.hx-user { display: flex; align-items: center; gap: calc(16 * var(--u)); flex: none; }
.hx-avatar { position: relative; display: block; width: calc(92 * var(--u)); min-width: 44px; aspect-ratio: 1; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, #f9de8d, #b9852c, #f9de8d, #8a5f1c, #f9de8d); box-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.hx-avatar .avatar { width: 100%; height: 100%; border: 2px solid #1b1b1b; }
.hx-avatar.vip { margin-top: calc(26 * var(--u)); width: calc(84 * var(--u)); }
.hx-crown { position: absolute; left: 50%; top: -34%; width: 58%; transform: translateX(-50%); mix-blend-mode: lighten; pointer-events: none; }
.hx-vip { position: absolute; left: 50%; bottom: -18%; width: 96%; transform: translateX(-50%); mix-blend-mode: lighten; pointer-events: none; }
.hx-info { line-height: 1.25; min-width: 0; }
.hx-name { font-size: max(13px, calc(28 * var(--fu))); font-weight: 700; color: #fff; white-space: nowrap; }
.hx-name a { display: inline-block; max-width: calc(210 * var(--u)); min-width: 60px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: #fff; text-decoration: none; }
.hx-elo { color: #cfc3aa; font-weight: 500; }
.hx-gold { display: flex; align-items: center; gap: .4em; font-size: max(12px, calc(26 * var(--fu))); color: #ffcf55; font-weight: 700; white-space: nowrap; }
.hx-coin { width: 1.15em; height: 1.15em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2b3, #f0b52c 55%, #a96f10); box-shadow: inset 0 0 0 2px #fbd96a, 0 0 4px rgba(0, 0, 0, .5); display: inline-block; }
.hx-icos { display: grid; grid-template-columns: repeat(2, auto); gap: calc(8 * var(--u)); }
.hx-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; width: max(32px, calc(66 * var(--u))); height: max(32px, calc(54 * var(--u))); border-radius: 8px; border: 1px solid #5d4b2d; background: linear-gradient(180deg, #2d2a25, #1f1d1a); color: #f1e6cc; font-size: max(14px, calc(30 * var(--fu))); text-decoration: none; transition: .15s; }
.hx-ico:hover { color: #ffd98a; border-color: #c79a4a; background: #38312a; }
.hx-dot { position: absolute; top: 3px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 2px #222; }
.hx-btn { align-items: center; padding: .32em .9em; border-radius: 8px; font-weight: 700; font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .02em; font-size: max(13px, calc(25 * var(--fh))); text-decoration: none; white-space: nowrap; }
.hx-btn-line { color: #f1e6cc; border: 1px solid #8a6a3b; background: rgba(255, 255, 255, .04); }
.hx-btn-line:hover { color: #ffd98a; border-color: #e1b35a; }
.hx-btn-gold { color: #4a2204; background: linear-gradient(180deg, #ffe6a0, #e6a93a 60%, #c58a1e); border: 1px solid #ffeab0; }
.hx-btn-gold:hover { color: #2d1402; filter: brightness(1.06); }
.hx-out-tab { position: absolute; right: 0; top: 100%; z-index: 3; padding: calc(10 * var(--u)) calc(30 * var(--u)) calc(12 * var(--u)) calc(70 * var(--u)); background: #1b1b1b; color: #f1e6cc; font-size: max(13px, calc(28 * var(--fu))); text-decoration: none; border-bottom: 2px solid #6b5333; clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%); box-shadow: -4px 6px 14px rgba(0, 0, 0, .4); }
.hx-out-tab:hover { color: #ffd98a; }
.hx-header.is-slim .hx-inner { height: 56px; padding: 0 14px; }
.hx-header.is-slim .hx-logo img { height: 44px; }
.hx-header.is-slim .hx-avatar { width: 40px; margin-top: 0; }
.hx-header.is-slim .hx-gold, .hx-header.is-slim .hx-elo { display: none; }
.hx-header.is-slim .hx-tab { font-size: 14px; padding: 0 12px; }
.hx-header.is-slim .hx-ico { width: 34px; height: 34px; font-size: 15px; }
.hx-header.is-slim .hx-icos { grid-template-columns: repeat(4, auto); }

@media (max-width: 1199.98px) {
  .hx-tab { padding: 0 calc(16 * var(--u)); font-size: max(14px, calc(28 * var(--fh))); }
  .hx-icos { grid-template-columns: repeat(4, auto); }
  .hx-gold { display: none; }
}
@media (max-width: 991.98px) {
  .hx-inner { height: 60px; padding: 0 12px; gap: 10px; flex-wrap: wrap; align-items: center; }
  .hx-logo { padding-right: 0; height: 60px; }
  .hx-logo img { height: 44px; }
  .hx-burger { display: inline-flex; align-items: center; justify-content: center; order: 3; }
  .hx-user { order: 2; margin-left: auto; gap: 8px; }
  .hx-info { display: none; }
  .hx-avatar { width: 40px; margin-top: 0 !important; }
  .hx-crown, .hx-vip { display: none; }
  .hx-icos { display: none; }
  .hx-guest .hx-icos { display: grid; grid-template-columns: repeat(2, auto); }
  .hx-ico { width: 38px; height: 38px; font-size: 16px; }
  .hx-nav { order: 4; flex: 0 0 100%; flex-direction: column; background: #1f1d1a; margin: 0 -12px; border-top: 1px solid #5d4b2d; }
  .hx-nav:not(.show) { display: none; }
  .hx-tab { padding: 13px 18px; height: auto; font-size: 17px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
  .hx-tab.on { box-shadow: inset 4px 0 0 #f1c25f; background: #2a2218; }
  .hx-tab.on::after { display: none; }
  .hx-pay { margin: 10px 14px; align-self: flex-start; padding: 10px 22px; }
  .hx-dd { flex-direction: column; }
  .hx-dd .hx-menu { position: static !important; transform: none !important; border: 0; background: #17150f; margin: 0; border-radius: 0; }
  .hx-out-tab { display: none; }
  .hx-header.is-slim .hx-icos { display: grid; grid-template-columns: repeat(2, auto); }
  .hx-header.is-slim .hx-icos > .dropdown, .hx-header.is-slim #nav-bell { display: none; }
}
@media (min-width: 992px) { .hx-nav.collapse:not(.show) { display: flex; } }
@media (max-width: 991.98px) { .hx-nav { flex: 0 0 calc(100% + 24px); margin: 0 -12px; width: calc(100% + 24px); } }
