/* Giao diện dựa trên Tabler (/vendor/tabler.min.css). File này chỉ giữ phần riêng của app. */
:root, [data-bs-theme] {
  /* Màu chính: tím Discord */
  --tblr-primary: #5865f2;
  --tblr-primary-rgb: 88, 101, 242;
  /* Biến cũ của app, trỏ sang biến Tabler để tự đổi theo sáng/tối */
  --surface: var(--tblr-bg-surface);
  --border: var(--tblr-border-color);
  --text: var(--tblr-body-color);
  --muted: var(--tblr-secondary);
  --accent: var(--tblr-primary);
  --row-hover: var(--tblr-bg-surface-secondary);
  --ok: var(--tblr-green);
  --bad: var(--tblr-red);
  --ally-bg: color-mix(in srgb, var(--tblr-primary) 10%, transparent);
  /* Màu trạng thái cho biểu đồ (đã kiểm tra phân biệt được với người mù màu) */
  --st-good: #0ca30c;
  --st-warn: #fab219;
  --st-short: #e8710a;
  --st-bad: #d03b3b;
}

[hidden] { display: none !important; }

/* ---------- Thanh trên cùng ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; padding: 0; min-height: 56px; }
.topbar-inner { display: flex; flex-wrap: nowrap; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; margin: 0; }
.logo { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(212,168,90,.55); flex: none; }
.tabs { flex: 1; flex-wrap: nowrap; overflow-x: auto; gap: 2px; }
.tabs .nav-link { white-space: nowrap; font-weight: 500; }
.tabs .nav-link.active { background: var(--tblr-primary); color: #fff; }
.user { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

main { padding-top: 24px; padding-bottom: 24px; }

.login-logo {
  display: block; width: 128px; height: 128px; margin: 0 auto 12px; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(212,168,90,.6), 0 8px 28px rgba(212,168,90,.25);
}

/* ---------- Thanh công cụ đầu trang ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.toolbar h2 { margin: 0 auto 0 0; }
.toolbar .form-control, .toolbar .form-select, .period .form-control { width: auto; }

/* Thẻ số liệu: tự chia cột theo số thẻ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* ---------- Bảng ---------- */
.table th, .table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sorted { color: var(--text); }
.sort-arrow { opacity: .45; }
th.sorted .sort-arrow { opacity: 1; }
tr.clickable { cursor: pointer; }
.who-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.badge + .badge { margin-left: 4px; }

/* Nút chọn chế độ (Ngày/Tuần/Tháng, tab con…) */
.btn-group > .btn.active { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }
/* Tab con Cài đặt (5 nút): màn hẹp cho xuống dòng thay vì tràn ngang trang. */
.btn-group.sub-tabs { flex-wrap: wrap; max-width: 100%; }

.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.weeknav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.week-label { font-weight: 600; min-width: 170px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .form-grid.cols-3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.field .form-check-input { margin: 0 6px 0 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checks .form-check-input { margin: 0; }
.actions { margin-top: 16px; display: flex; gap: 8px; }

.income-form { display: grid; grid-template-columns: minmax(140px, 200px) 1fr auto; gap: 8px; }
@media (max-width: 720px) { .income-form { grid-template-columns: 1fr; } }

/* ---------- Tổng quan (biểu đồ tự vẽ) ---------- */
.chart { font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; color: var(--muted); border-radius: 0; }
.legend span { display: inline-flex; align-items: center; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; flex: none; }
.plot { position: relative; height: 180px; margin-left: 44px; }
.grid-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.grid-line span { position: absolute; right: calc(100% + 6px); transform: translateY(-50%); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 4px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; gap: 2px; cursor: default; }
.col:hover { background: var(--row-hover); }
.col .seg-bar { width: 100%; max-width: 28px; margin: 0 auto; flex: none; }
.col .seg-bar:last-child { border-radius: 4px 4px 0 0; }
.xaxis { display: flex; gap: 4px; margin: 6px 0 0 44px; color: var(--muted); }
.xaxis span { flex: 1; min-width: 0; text-align: center; }
.chart-tip {
  position: fixed; z-index: 1090; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px;
  box-shadow: var(--tblr-box-shadow-dropdown, 0 6px 20px rgba(0,0,0,.15)); display: grid; gap: 2px;
}
.chart-tip span { display: inline-flex; align-items: center; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.rank { padding: 8px 16px 12px; }
.rank-row { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; align-items: center; gap: 10px; padding: 5px 0; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 8px; }
.rank-bar { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.rank-val { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* ---------- Thông báo nhanh ---------- */
.toast-msg {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); padding: 10px 18px; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 1100; max-width: calc(100% - 32px);
}
.toast-msg.error { background: var(--bad); color: #fff; }

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .tabs { order: 3; flex-basis: 100%; }
  .user .name { display: none; }
  main { padding-top: 16px; }
}

/* ---------- Popup (thẻ dialog gốc, không dùng JS của Bootstrap) ---------- */
.app-dialog {
  padding: 0; border: 1px solid var(--border); border-radius: var(--tblr-border-radius-lg, 8px);
  background: var(--surface); color: var(--text);
  max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); min-height: min(400px, calc(100vh - 32px));
  flex-direction: column; box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.app-dialog[open] { display: flex; }
.app-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.app-dialog .modal-header { border-bottom: 1px solid var(--border); }
.dialog-body { flex: 1; overflow: auto; }
.dialog-body thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.dialog-body .card-body { padding: 16px; }
.cong-yes { color: var(--ok); font-weight: 700; }

/* ---------- Voice ---------- */
.voice-room { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.voice-room .name { font-size: 18px; font-weight: 600; }
.voice-people { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.vp { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.vp .avatar { outline: 2px solid transparent; outline-offset: 1px; transition: outline-color .15s; }
.vp.speaking .avatar { outline-color: var(--ok); }

/* ---------- Từ điển ---------- */
.doc p { margin: 0 0 8px; }
.doc p:last-child { margin-bottom: 0; }
.doc ul { margin: 0; padding-left: 20px; }
.doc li + li { margin-top: 6px; }

/* Ô tìm tên ngay trên bảng, thẳng cột Thành viên */
/* Ô tìm + ô lọc (nếu có) cùng một hàng, màn hình hẹp thì xuống dòng */
.table-search-row { padding: 10px 12px 2px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-filter { width: auto; }
.table-search { width: 200px; max-width: 100%; }

/* Dòng "Của bạn": bản sao dòng của người đang đăng nhập, phía trên ô tìm */
.mine-block { padding-top: 10px; border-bottom: 1px solid var(--border); }
.mine-label { padding: 0 12px 4px; font-size: 12px; font-weight: 600; color: var(--accent); }
.mine-block tbody tr > * { background: var(--ally-bg); border-bottom: 0; }

/* ---------- Giao thương ---------- */
.seller-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.seller { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.market-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.market-img { margin: 0; }
.market-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.market-img figcaption { margin-top: 4px; }
.market-full { display: block; max-width: 100%; margin: 0 auto; }
/* Album kỷ niệm: dòng thời gian 1 cột như Facebook, ảnh ghép trong bài, trình xem có nút ‹ › */
.album-feed, .album-list { max-width: 680px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.album-post { margin: 0; overflow: hidden; }
.album-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.album-post.pinned { border-color: #d4a85a; }
.album-big { font-size: 1.25rem; }
/* Menu ⋯ của bài */
.album-menu { position: relative; }
.album-menu summary { list-style: none; cursor: pointer; padding: 0 8px; font-size: 20px; line-height: 1.2; border-radius: 6px; }
.album-menu summary::-webkit-details-marker { display: none; }
.album-menu summary:hover { background: var(--tblr-bg-surface-secondary, rgba(127, 127, 127, .15)); }
.album-menu-list { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 170px; padding: 4px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--tblr-bg-surface, #fff); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
/* Cảm xúc + bình luận */
.album-social { padding: 4px 16px 12px; }
.album-sum { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.album-actions { display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.album-actions > * { flex: 1; }
.album-act { width: 100%; font-weight: 600; }
.album-act.r-like { color: #2d7ff9; }
.album-act.r-love { color: #e5484d; }
.album-act.r-haha, .album-act.r-wow, .album-act.r-sad { color: #e2a400; }
.album-act.r-angry { color: #e8590c; }
.album-react { position: relative; }
.album-picker { position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 6; display: none; gap: 2px; padding: 4px 6px; border-radius: 999px; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.album-react.open .album-picker { display: flex; }
.album-picker button { border: 0; background: none; font-size: 26px; line-height: 1; padding: 2px; cursor: pointer; transition: transform .1s; }
.album-picker button:hover { transform: scale(1.3); }
.btn-link { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.album-thread { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.album-cmt { display: flex; gap: 8px; align-items: flex-start; }
.album-cmt.reply, .album-cmt-form.reply, .album-replies { margin-left: 40px; }
.album-cmt-main { min-width: 0; }
.album-bubble { display: inline-block; max-width: 100%; padding: 6px 12px; border-radius: 16px; background: var(--tblr-bg-surface-secondary, rgba(127, 127, 127, .15)); }
.album-cmt-likes { margin-left: auto; }
.album-cmt-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 12px; font-size: 12px; color: var(--tblr-secondary, #888); }
.album-cmt-actions .liked { color: #e5484d; font-weight: 600; }
.album-more-cmt, .album-replies { font-size: 14px; font-weight: 600; margin-bottom: 6px; text-align: left; }
.album-cmt-form { align-items: center; margin-top: 6px; }
.album-cmt-input { border-radius: 999px; }
.album-who { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.album-sentinel { padding: 12px 0 24px; }
.album-mention { color: var(--tblr-primary, #4c8bf5); font-weight: 600; }
.album-post.album-focus { box-shadow: 0 0 0 3px #d4a85a; transition: box-shadow .3s; }
/* Gợi ý khi gõ @ */
.mention-box { position: fixed; z-index: 2000; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--tblr-bg-surface, #fff); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.mention-box button { display: block; width: 100%; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: inherit; text-align: left; cursor: pointer; }
.mention-box button.active, .mention-box button:hover { background: var(--tblr-bg-surface-secondary, rgba(127, 127, 127, .15)); }
/* Chuông thông báo */
.notif-bell { position: relative; }
.notif-count { position: absolute; top: -6px; right: -6px; padding: 2px 5px; font-size: 10px; }
.notif-panel { position: fixed; right: 12px; z-index: 1050; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: inherit; text-align: left; cursor: pointer; }
.notif-item:hover { background: var(--tblr-bg-surface-secondary, rgba(127, 127, 127, .1)); }
.notif-item.unread { background: rgba(212, 168, 90, .12); }
.notif-body { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .notif-panel { right: 8px; left: 8px; width: auto; } }
/* Khoảng hở rộng + nền theo màu thẻ + bo góc: ảnh poster nhiều chữ đặt cạnh nhau vẫn nhìn ra từng tấm riêng */
.album-collage { display: grid; gap: 6px; }
.album-collage.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.album-collage.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4 / 3; }
.album-collage.n3 .album-cell:first-child { grid-row: span 2; }
.album-collage.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1; }
.album-cell { position: relative; display: block; padding: 0; border: 0; border-radius: 6px; background: #000; cursor: zoom-in; min-height: 0; overflow: hidden; }
.album-cell img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-collage.n1 .album-cell img { height: auto; max-height: 600px; object-fit: contain; margin: 0 auto; }
.album-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 28px; font-weight: 700; }
.album-embed { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.album-embed.tiktok { aspect-ratio: 9 / 16; max-height: 70vh; width: auto; max-width: 100%; margin: 0 auto; }
.album-viewer { position: relative; display: flex; align-items: center; justify-content: center; min-height: 200px; background: #000; border-radius: 8px; overflow: hidden; touch-action: pan-y; }
.album-viewer img { display: block; max-width: 100%; max-height: 70vh; }
.album-viewer .album-embed { border-radius: 0; }
.album-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #111; font-size: 26px; line-height: 1; cursor: pointer; }
.album-nav.prev { left: 8px; }
.album-nav.next { right: 8px; }
.album-count { position: absolute; top: 8px; right: 10px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; }

/* ---------- Menu 2 tầng: module ở trên, tab con của module (VD Chấm công) ở hàng dưới ---------- */
.topbar { flex-direction: column; align-items: stretch; }
.subbar:has(.subtabs[hidden]) { display: none; }
.subtabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 4px 0 8px; }
.subtabs .nav-link { white-space: nowrap; font-size: 13px; padding: 4px 12px; }
.subtabs .nav-link.active { background: color-mix(in srgb, var(--tblr-primary) 18%, transparent); color: var(--tblr-primary); }

/* ---------- Trang chủ ---------- */
.news + .news { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.news.pinned h3 { color: var(--tblr-orange); }
.news-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.leaders { display: grid; gap: 10px; }
.home-banner { display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 16px; box-shadow: 0 0 0 1px rgba(212,168,90,.45), 0 8px 28px rgba(0,0,0,.25); }
/* Banner ảnh + chữ: khung theo tỷ lệ ảnh banner.jpg (1024×434), chữ co giãn theo bề ngang banner (đơn vị cqw) để giữ đúng bố cục trên mọi màn hình */
div.home-banner { position: relative; aspect-ratio: 1024 / 434; overflow: hidden; background: #12081a; container-type: inline-size; }
.banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-fx { position: absolute; inset: 0; pointer-events: none; }

/* ---------- Cảnh 3D (public/scene3d.js) ---------- */
.scene3d { position: relative; height: 380px; touch-action: pan-y; cursor: grab; }
.scene3d:active { cursor: grabbing; }
.scene3d-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
@media (max-width: 576px) { .scene3d { height: 280px; } }

/* Phòng Nghị sự: đại sảnh 3D + chữ HTML đè lên (tiêu đề, người vào/ra, ai đang phát biểu) */
.council-card { overflow: hidden; }
.scene3d.council-hall { height: 540px; }
@media (max-width: 576px) { .scene3d.council-hall { height: 420px; } }
.council-overlay { position: absolute; inset: 0; pointer-events: none; font-family: "Noto Serif", "Times New Roman", serif; }
.council-title {
  position: absolute; top: 34%; left: 0; right: 0; text-align: center; color: #f5c04a; opacity: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,.9); animation: council-title 5.5s ease forwards;
}
.council-title div:first-child { font-size: 13px; letter-spacing: .5em; color: #fbe3b0; }
.council-title div:last-child { font-size: clamp(28px, 6vw, 52px); font-weight: 700; letter-spacing: .12em; }
@keyframes council-title { 0% { opacity: 0; transform: translateY(8px); } 20%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.council-feed { position: absolute; top: 12px; left: 12px; display: grid; gap: 6px; max-width: 70%; }
.council-note {
  padding: 4px 12px; border-radius: 6px; color: #fbe3b0; background: rgba(40,12,6,.82); border: 1px solid rgba(201,151,28,.6);
  font-size: 14px; animation: council-note 5s ease forwards;
}
@keyframes council-note { 0% { opacity: 0; transform: translateX(-8px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.council-speakers {
  position: absolute; top: 12px; right: 12px; max-width: 45%; padding: 5px 14px; border-radius: 999px;
  color: #d8ffe6; background: rgba(10,30,18,.8); border: 1px solid rgba(109,255,160,.55); font-size: 14px; text-align: center;
}
.council-hall .scene3d-canvas:focus { outline: none; }
.council-hint {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(251,227,176,.75);
  text-shadow: 0 1px 4px #000;
}
/* Cần di chuyển (joystick) góc trái dưới */
.council-joy {
  position: absolute; left: 28px; bottom: 28px; width: 128px; height: 128px; border-radius: 50%; pointer-events: auto;
  touch-action: none; user-select: none; cursor: grab;
  background: radial-gradient(circle, rgba(40,12,6,.35) 0%, rgba(40,12,6,.6) 70%);
  border: 2px solid rgba(201,151,28,.55); box-shadow: inset 0 0 18px rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.4);
}
.council-joy.active { cursor: grabbing; border-color: rgba(245,192,74,.9); }
.council-joy-knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5d27a, #b07a18 70%, #6b4410); border: 2px solid #fff3c4;
  box-shadow: 0 3px 10px rgba(0,0,0,.6); transition: transform .08s ease-out; pointer-events: none;
}
.council-joy.active .council-joy-knob { transition: none; }
/* Cụm chiêu thức góc phải dưới: gốc tọa độ là tâm nút chính, các nút đặt theo vòng cung (vị trí tính trong JS) */
.council-skills { position: absolute; right: 66px; bottom: 66px; width: 0; height: 0; }
.council-skill {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0;
  border-radius: 50%; pointer-events: auto; touch-action: manipulation; user-select: none; cursor: pointer;
  color: #fbe3b0; font-family: inherit; line-height: 1;
  background: radial-gradient(circle at 35% 30%, rgba(122,30,18,.95), rgba(40,12,6,.95) 75%);
  border: 2px solid rgba(201,151,28,.8); box-shadow: 0 3px 10px rgba(0,0,0,.55), inset 0 0 8px rgba(0,0,0,.5);
  transition: transform .08s, filter .15s;
}
.council-skill .ico { font-size: 22px; }
.council-skill .lbl { font-size: 10px; letter-spacing: .02em; white-space: nowrap; }
.council-skill .lbl:empty { display: none; }
.council-skill:hover:not(:disabled) { filter: brightness(1.2); }
.council-skill:active:not(:disabled) { transform: scale(.92); }
.council-skill:disabled { opacity: .4; filter: grayscale(.6); cursor: default; }
.council-skill.main { border-width: 3px; border-color: #f5c04a; background: radial-gradient(circle at 35% 30%, #d4381e, #7a1212 70%, #3a0808); }
.council-skill.main .ico { font-size: 34px; }
.council-skill.main .lbl { font-size: 12px; font-weight: 700; }
.council-skill.util .ico { font-size: 18px; }
.council-skill.util.on { border-color: #f5c04a; }
/* ---------- Nghị Sự Đường: thế giới riêng phủ kín màn hình (trên thanh menu, dưới tooltip / thông báo) ---------- */
body.in-world { overflow: hidden; }
.world {
  position: fixed; inset: 0; z-index: 1050; background: #120a06; color: #fbe3b0;
  font-family: "Noto Serif", "Times New Roman", serif;
}
.world-stage { position: absolute; inset: 0; }
.world .scene3d.council-hall { height: 100%; }
.world-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px 18px; background: linear-gradient(rgba(18,10,6,.9), rgba(18,10,6,0)); pointer-events: none;
}
.world-hud > * { pointer-events: auto; }
.world-title { margin-right: auto; font-size: 20px; font-weight: 700; letter-spacing: .04em; color: #f5c04a; text-shadow: 0 2px 8px #000; }
.world-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.world .btn { color: #fbe3b0; background: rgba(40,12,6,.85); border-color: rgba(201,151,28,.7); font-family: inherit; }
.world .btn:hover { background: rgba(122,18,18,.95); color: #fff; }
.world .btn.world-leave { border-color: #c41e1e; }
.world-panel {
  position: absolute; top: 60px; right: 12px; z-index: 3; width: min(320px, calc(100% - 24px)); max-height: 60%; overflow: auto;
  padding: 10px 12px; border-radius: 10px; background: rgba(25,8,4,.92); border: 1px solid rgba(201,151,28,.7);
}
.world-panel-title { font-weight: 700; color: #f5c04a; }
.world-panel .voice-people { color: #fbe3b0; }
.world-status {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 16px; text-align: center; font-size: 16px;
}
.world-status-title { font-size: clamp(28px, 6vw, 48px); font-weight: 700; color: #f5c04a; letter-spacing: .1em; }
.world-no3d {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; font-size: 18px; text-align: center;
}
.world-no3d-icon { font-size: 64px; line-height: 1; }
/* ---------- Bảng đấu giá trước mặt nhân vật: sơn son thếp vàng, giữa trên, dưới thanh HUD ---------- */
.world-auction {
  --gold: #f5c04a; --gold-dim: rgba(201,151,28,.75);
  position: absolute; top: 100px; left: 50%; transform: translateX(-50%); z-index: 3; width: min(440px, calc(100% - 24px));
  border-radius: 12px; overflow: hidden; color: #fbe3b0;
  background: linear-gradient(180deg, rgba(58,14,8,.96), rgba(22,7,4,.96));
  border: 2px solid var(--gold-dim); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 10px 32px rgba(0,0,0,.65), inset 0 0 24px rgba(245,192,74,.08);
}
.world-auction.live { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 10px 32px rgba(0,0,0,.65), 0 0 22px rgba(245,192,74,.28); }
/* Dải tiêu đề kiểu hoành phi: nền đỏ son, chữ vàng, hai đầu có khuy vàng */
.wa-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  font-size: 13px; color: var(--gold); background: linear-gradient(180deg, #a3190f, #6e0f0a); border-bottom: 1px solid var(--gold-dim);
}
.wa-head > span:nth-child(2) { flex: 1; }
.wa-gavel { display: inline-block; transform-origin: 70% 70%; }
.world-auction.live .wa-gavel { animation: wa-gavel 2.4s ease-in-out infinite; }
@keyframes wa-gavel { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-28deg); } 92% { transform: rotate(8deg); } }
.wa-fold { border: 1px solid var(--gold-dim); background: rgba(0,0,0,.25); color: var(--gold); border-radius: 6px; width: 26px; height: 22px; line-height: 1; padding: 0; }
.wa-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.wa-top { display: grid; grid-template-columns: 132px 1fr; gap: 10px; align-items: center; }
.wa-show { height: 112px; border-radius: 10px; background: radial-gradient(circle at 50% 70%, rgba(245,192,74,.22), rgba(0,0,0,0) 70%); }
.wa-show { display: grid; place-items: center; }
/* Túi tiền 2D: lắc nhẹ khi đang đấu, nảy khi có lượt tố, xu vàng bung ra */
.wa-chest { position: relative; font-size: 60px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.wa-chest-icon { display: inline-block; }
.world-auction.live .wa-chest-icon { animation: wa-sway 3s ease-in-out infinite; }
@keyframes wa-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.wa-chest.bump .wa-chest-icon { animation: wa-bump .5s ease-out; }
.wa-chest.sold .wa-chest-icon { animation: wa-sold .9s ease-out; }
@keyframes wa-bump { 0% { transform: scale(1); } 35% { transform: translateY(-10px) scale(1.15); filter: brightness(1.5); } 100% { transform: none; } }
@keyframes wa-sold { 0% { transform: scale(1); } 30% { transform: translateY(-14px) scale(1.25) rotate(-10deg); filter: brightness(1.7); } 60% { transform: rotate(8deg); } 100% { transform: none; } }
.wa-coin { position: absolute; left: 50%; top: 40%; font-size: 18px; pointer-events: none; opacity: 0; animation: wa-coin .9s ease-out forwards; }
@keyframes wa-coin {
  0% { opacity: 1; transform: translate(-50%, 0) scale(.6); }
  45% { opacity: 1; transform: translate(calc(-50% + var(--dx) * .7), var(--dy)) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), 24px) scale(.9); }
}
.wa-lite { border: 1px solid var(--gold-dim); background: rgba(0,0,0,.25); color: var(--gold); border-radius: 6px; height: 22px; padding: 0 7px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.wa-lite.on { background: rgba(245,192,74,.22); border-color: var(--gold); }
/* Chế độ nhẹ: đại sảnh chỉ vẽ 1 khung/giây, phủ tối + ghi chú */
.council-hall.scene-paused::after {
  content: '🍃 Chế độ nhẹ: đại sảnh vẽ 1 khung hình/giây khi đấu giá'; position: absolute; inset: 0; display: grid; place-items: start center; padding-top: 62px;
  background: rgba(0,0,0,.45); color: #fbe3b0; font-size: 13px; pointer-events: none;
}
.wa-side { display: grid; gap: 4px; justify-items: start; text-align: left; }
.wa-item-price { color: #ffd76a; white-space: nowrap; }
.wa-item { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; text-shadow: 0 2px 6px #000; }
.wa-qty, .wa-host, .wa-next { font-size: 12px; color: #d9c4a0; }
.wa-wait { font-size: 15px; font-weight: 700; color: var(--gold); }
/* Vòng đếm ngược */
.wa-ring { position: relative; width: 58px; height: 58px; margin-top: 2px; }
.wa-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wa-ring circle { fill: none; stroke-width: 5; }
.wa-ring .bg { stroke: rgba(255,255,255,.12); }
.wa-ring .fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 163.36; transition: stroke-dashoffset .2s linear, stroke .2s; }
.wa-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.wa-ring.urgent .fg { stroke: #ff5b4a; }
.wa-ring.urgent span { color: #ff8a7a; animation: wa-pulse .5s ease-in-out infinite alternate; }
@keyframes wa-pulse { to { transform: scale(1.18); } }
/* Giá */
.wa-price { text-align: center; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(201,151,28,.35); }
.wa-price.mine { border-color: #6dd38c; background: rgba(20,60,30,.35); }
.wa-price-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #d9c4a0; }
.wa-price-num { font-size: 30px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff3c4, #f5c04a 55%, #c98a10); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wa-leader { font-size: 14px; color: #fbe3b0; }
.wa-price.flash { animation: wa-flash .9s ease-out; }
@keyframes wa-flash { 0% { box-shadow: 0 0 0 0 rgba(245,192,74,.9); transform: scale(1.04); } 100% { box-shadow: 0 0 0 14px rgba(245,192,74,0); transform: scale(1); } }
.wa-outbid { text-align: center; padding: 5px 8px; border-radius: 8px; font-weight: 700; color: #fff; background: #b3261e; animation: wa-shake .45s ease; }
@keyframes wa-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.world .btn.world-auction-bid {
  width: 100%; font-size: 20px; font-weight: 800; letter-spacing: .04em; padding: 10px 12px; color: #fff; border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 0%, #e8452a, #8f140e 70%); box-shadow: 0 4px 0 #4a0805, 0 6px 16px rgba(0,0,0,.5); text-shadow: 0 2px 4px rgba(0,0,0,.6);
  transition: transform .08s, box-shadow .08s;
}
.world .btn.world-auction-bid b { color: #ffe08a; }
.world .btn.world-auction-bid:not(:disabled):hover { background: radial-gradient(circle at 50% 0%, #ff5a3a, #a8180f 70%); }
.world .btn.world-auction-bid:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #4a0805, 0 3px 8px rgba(0,0,0,.5); }
.world .btn.world-auction-bid:disabled { opacity: .5; filter: grayscale(.4); }
.wa-why { text-align: center; font-size: 12px; color: #e8c98a; }
.wa-bids { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; max-height: 118px; overflow: auto; }
.wa-bids li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 6px; color: #d9c4a0; }
.wa-bids li:first-child { color: #fff; background: rgba(245,192,74,.12); }
.wa-bids li b { color: var(--gold); font-variant-numeric: tabular-nums; }
.wa-bids li.new { animation: wa-slide .5s ease-out; }
@keyframes wa-slide { from { opacity: 0; transform: translateY(-8px); background: rgba(245,192,74,.45); } }
.wa-last { text-align: center; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.25); }
.wa-last.sold { border: 1px solid rgba(109,211,140,.5); }
.world-auction.folded { width: min(300px, calc(100% - 24px)); }
/* Dấu mộc chốt giá giữa màn hình */
.auction-stamp {
  position: absolute; top: 42%; left: 50%; z-index: 6; transform: translate(-50%, -50%) rotate(-8deg); pointer-events: none; text-align: center;
  padding: 14px 28px; border-radius: 14px; border: 5px double #f5c04a; background: rgba(110,15,10,.92); color: #fbe3b0;
  box-shadow: 0 0 40px rgba(245,192,74,.5); animation: wa-stamp 3.4s ease forwards; font-size: 16px; max-width: calc(100% - 32px);
}
.auction-stamp.none { border-color: #9a8f80; background: rgba(40,34,30,.92); box-shadow: 0 0 30px rgba(0,0,0,.6); }
.auction-stamp-word { font-size: clamp(34px, 7vw, 56px); font-weight: 900; letter-spacing: .12em; color: #f5c04a; text-shadow: 0 3px 0 #4a0805; }
.auction-stamp.none .auction-stamp-word { color: #d8d0c4; text-shadow: none; }
.auction-stamp-item { font-size: 20px; font-weight: 700; color: #fff; }
@keyframes wa-stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.4); }
  12% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(.94); }
  18% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
}
@media (max-width: 576px) {
  .world-auction { top: 140px; }
  .wa-top { grid-template-columns: 96px 1fr; }
  .wa-show { height: 86px; }
  .wa-chest { font-size: 46px; }
  .council-hall.scene-paused::after { content: ""; } /* HUD xuống dòng sẽ đè chữ; nút "Nhẹ: Bật" đã đủ báo */
  .wa-item { font-size: 17px; }
  .wa-price-num { font-size: 24px; }
  .wa-bids { max-height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .world-auction *, .auction-stamp { animation: none !important; }
}

/* ---------- Popup Đấu giá: cùng giao diện đại sảnh ---------- */
.app-dialog.auction-dialog {
  --gold: #f5c04a; --gold-dim: rgba(201,151,28,.6);
  background: linear-gradient(180deg, #2a0c06, #170704); color: #fbe3b0; border: 2px solid var(--gold-dim);
  font-family: "Noto Serif", "Times New Roman", serif;
}
.auction-dialog .modal-header { background: linear-gradient(180deg, #a3190f, #6e0f0a); border-bottom: 1px solid var(--gold-dim); }
.auction-dialog .modal-title { color: var(--gold); letter-spacing: .05em; font-family: inherit; }
.auction-dialog .btn-close { filter: invert(1) sepia(1) saturate(3); }
.auction-dialog .dialog-body { padding: 14px 16px 18px; display: grid; gap: 14px; align-content: start; }
.auction-dialog .dialog-body thead th { background: #2a0c06; color: #d9c4a0; }
.auction-dialog .table { --tblr-table-bg: transparent; --tblr-table-color: #fbe3b0; color: #fbe3b0; }
.auction-dialog .table td, .auction-dialog .table th { border-color: rgba(201,151,28,.2); }
.ad-section { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid rgba(201,151,28,.3); }
.ad-title { font-size: 16px; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.ad-count { font-size: 12px; font-weight: 600; color: #d9c4a0; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--gold-dim); }
.ad-hint { margin: 0; font-size: 12px; color: #c9b38c; }
.ad-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ad-field { display: grid; gap: 6px; }
.ad-field > span { font-size: 13px; font-weight: 600; color: #e8c98a; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ad-chip { border: 1px solid var(--gold-dim); background: rgba(0,0,0,.3); color: #fbe3b0; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; }
.ad-chip:hover { border-color: var(--gold); }
.ad-chip.on { background: var(--gold); color: #2a1a00; font-weight: 700; border-color: var(--gold); }
.auction-dialog .ad-input { background: rgba(0,0,0,.35); color: #fff; border-color: rgba(201,151,28,.45); font-family: inherit; }
.auction-dialog .ad-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,192,74,.2); }
.auction-dialog .ad-input::placeholder { color: rgba(251,227,176,.35); }
.ad-small { width: 90px; }
.ad-row { display: grid; grid-template-columns: 26px minmax(140px, 2.2fr) 80px minmax(90px, 1fr) minmax(80px, 1fr) 30px; gap: 6px; align-items: end; }
.ad-rows { display: grid; gap: 10px; }
/* Nhãn ngay trên từng ô nhập */
.ad-cell { display: grid; gap: 3px; min-width: 0; margin: 0; }
.ad-cell > span { font-size: 12px; font-weight: 600; color: #e8c98a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-row > .ad-seq { margin-bottom: 7px; }
.ad-row > .ad-del { margin-bottom: 3px; }
.ad-seq { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #2a1a00; background: var(--gold); }
.ad-del { border: 0; background: transparent; color: #e88a7a; font-size: 16px; border-radius: 6px; height: 30px; }
.ad-del:hover { background: rgba(232,138,122,.15); }
.ad-add { justify-self: start; border: 1px dashed var(--gold-dim); background: transparent; color: var(--gold); border-radius: 8px; padding: 6px 14px; font: inherit; }
.ad-add:hover { background: rgba(245,192,74,.1); }
.ad-submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ad-summary { font-size: 13px; color: #e8c98a; }
.auction-dialog .btn { font-family: inherit; }
.auction-dialog .ad-btn-main { color: #fff; font-weight: 700; border: 1px solid var(--gold); background: radial-gradient(circle at 50% 0%, #e8452a, #8f140e 75%); padding: 8px 18px; }
.auction-dialog .ad-btn-main:hover { background: radial-gradient(circle at 50% 0%, #ff5a3a, #a8180f 75%); color: #fff; }
.auction-dialog .ad-btn-warn { color: #2a1a00; font-weight: 700; background: #e8a33a; border-color: #e8a33a; }
.auction-dialog .ad-btn-ghost { color: #e88a7a; background: transparent; border-color: rgba(232,138,122,.5); }
.auction-dialog .btn:disabled { opacity: .45; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #e8c98a; }
.ad-lots { display: grid; gap: 6px; }
.ad-lot { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(201,151,28,.2); }
.ad-lot.running { border-color: var(--gold); background: rgba(245,192,74,.12); box-shadow: 0 0 12px rgba(245,192,74,.2); }
.ad-lot.unsold, .ad-lot.cancelled { opacity: .7; }
.ad-lot-name { font-weight: 700; color: #fff; }
.ad-lot-sub { font-size: 12px; color: #c9b38c; }
/* Popup Lệnh cấm (cùng giao diện popup đấu giá) */
.ban-hint { margin: 0; font-size: 13px; color: #e8c98a; }
.ban-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.ban-cell { display: grid; gap: 3px; margin: 0; min-width: 0; }
.ban-cell > span { font-size: 12px; font-weight: 600; color: #e8c98a; }
.ban-cell-wide { grid-column: 1 / -1; }
.ban-cell-btn { grid-column: 1 / -1; justify-self: start; }
.ban-form .form-select, .ban-form .form-control { background-color: rgba(0,0,0,.35); color: #fff; border-color: rgba(201,151,28,.45); font-family: inherit; }
.ban-form .form-select option { background: #2a0c06; color: #fbe3b0; }
.ban-title { font-weight: 700; color: var(--gold); border-top: 1px solid rgba(201,151,28,.3); padding-top: 10px; }
.ban-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ban-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(201,151,28,.2); }
.ban-list b { color: #fff; }
.ban-kind { margin-left: 8px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(232,163,58,.2); color: #f0c070; }
.ban-kind.hall { background: rgba(232,69,42,.25); color: #ff9c86; }
.ban-meta { font-size: 12px; color: #c9b38c; margin-top: 2px; }
.ban-empty { margin: 0; color: #c9b38c; }
.vp-ban { margin-left: auto; padding: 2px 6px; }
@media (max-width: 640px) { .ban-form { grid-template-columns: 1fr; } }
.ad-lot-end { text-align: right; display: grid; gap: 2px; justify-items: end; }
.ad-empty { text-align: center; padding: 18px; display: grid; gap: 4px; color: #d9c4a0; }
.ad-empty-icon { font-size: 40px; }
/* Màn hẹp: dòng 1 = số thứ tự + tên + ✕, dòng 2 = số lượng / giá khởi điểm / bước giá */
@media (max-width: 640px) {
  .ad-row { grid-template-columns: 24px repeat(3, minmax(0, 1fr)) 30px; }
  .ad-row > .ad-cell-item { grid-column: 2 / 5; }
  .ad-row > .ad-del { grid-column: 5; grid-row: 1; }
  .ad-row > .ad-cell-qty { grid-column: 2; }
  .ad-rows .ad-row { padding-bottom: 8px; border-bottom: 1px solid rgba(201,151,28,.2); }
}
/* Chữ nổi trong đại sảnh nằm dưới thanh HUD */
.world .council-feed { top: 64px; }
.world .council-speakers { top: 64px; }
@media (max-width: 576px) {
  .world-title { font-size: 16px; width: 100%; }
  .world .council-feed, .world .council-speakers { top: 104px; }
}

/* Bảng chọn vũ khí, mở phía trên thanh nút */
.council-picker {
  position: absolute; bottom: 290px; right: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: 6px; max-width: min(360px, calc(100% - 24px)); padding: 8px; border-radius: 10px; background: rgba(25,8,4,.92);
  border: 1px solid rgba(201,151,28,.7); pointer-events: auto; z-index: 1;
}
.council-picker { flex-direction: column; align-items: stretch; }
.council-picker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.council-picker-title { width: 100%; font-size: 12px; font-weight: 700; color: #f5c04a; }
.council-picker .btn { color: #fbe3b0; background: rgba(60,18,8,.9); border-color: rgba(201,151,28,.5); font-family: inherit; }
.council-picker .btn.active, .council-picker .btn:hover { background: rgba(122,18,18,.95); color: #fff; border-color: #f5c04a; }
@media (max-width: 576px) {
  .council-hint { display: none; }
  .council-speakers { max-width: 60%; font-size: 12px; }
  .council-joy { left: 18px; bottom: 22px; width: 112px; height: 112px; }
  .council-skills { right: 58px; bottom: 58px; }
}
@media (prefers-reduced-motion: reduce) { .council-title { display: none; } .council-note { animation: none; } }
.banner-text {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding-left: 5cqw;
  /* nền tối dần sang trái để chữ luôn đọc được trên mọi ảnh */
  background: linear-gradient(90deg, rgba(18,8,26,.85) 0%, rgba(18,8,26,.55) 30%, rgba(18,8,26,0) 55%);
  font-family: 'Times New Roman', Georgia, 'Noto Serif', serif; text-shadow: 0 0 1.2cqw rgba(245,184,58,.45);
}
.banner-kicker { font-size: 1.5cqw; letter-spacing: .6cqw; color: #f2c46b; }
.banner-title {
  font-size: 4.4cqw; font-weight: 700; line-height: 1.05; letter-spacing: .2cqw;
  background: linear-gradient(180deg, #fff3c4, #f5c04a 45%, #a86a12); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .12cqw #3b1f04; filter: drop-shadow(0 0 .5cqw rgba(245,184,58,.5));
}
.banner-rule { width: 16cqw; height: 1px; margin: 1.2cqw 0; background: linear-gradient(90deg, #f2c46b, transparent); }
.banner-motto { font-size: 1.6cqw; font-style: italic; color: #fbe3b0; }

/* ---------- Xếp hạng công tuần ---------- */
.rank-no { font-size: 18px; font-weight: 700; min-width: 28px; display: inline-block; text-align: center; }
.rank-big { font-size: 40px; font-weight: 800; color: var(--tblr-orange); line-height: 1; }
.event-intro { border-left: 4px solid var(--tblr-orange); background: color-mix(in srgb, var(--tblr-orange) 7%, var(--tblr-bg-surface)); }
.event-intro .card-body { font-size: 15px; line-height: 1.6; }

/* ---------- Trợ lý AI hướng dẫn sử dụng: nút nổi góc phải dưới ---------- */
.ai-fab { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 1050; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.ai-panel { position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 1060; width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100dvh - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
.ai-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { max-width: 88%; padding: 8px 12px; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.ai-msg.model { align-self: flex-start; background: var(--row-hover); }
.ai-msg.err { align-self: flex-start; background: color-mix(in srgb, var(--bad) 15%, transparent); }
.ai-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.ai-form input { font-size: 16px; }
.ai-note { padding: 0 12px 8px; font-size: .78rem; color: var(--muted); }
body.in-world .ai-fab, body.in-world .ai-panel { display: none !important; }
