/* Hội Chủ Quán — bản thử local (lifestyle/ls-guild.js). Lấy nguyên từ mockup docs/art-previews/guild-mockup/index.html, chỉnh để chạy trong game. */
.pxi { image-rendering: pixelated; }

/* ===== Panel Hội: cùng khung với bảng xếp hạng (lb-*) ===== */
.modal.gd-modal { width: min(560px, 100%); height: min(760px, calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); padding: 0; overflow: hidden; display: flex; flex-direction: column; background: #fff8ea; }
.gd { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.gd-emblem { position: relative; flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 2px 0 #0003, inset 0 2px 0 #fff6, inset 0 -3px 0 #0002; }
.gd-emblem .pxi { height: 26px; filter: drop-shadow(0 1px 0 #0005); }
.gd-emblem.sm { width: 36px; height: 36px; border-radius: 8px; } .gd-emblem.sm .pxi { height: 20px; }
.gd-emblem b { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); padding: 0 4px; border-radius: 5px; background: var(--ink); color: #ffe066; font: 800 9px/13px var(--font); white-space: nowrap; }
.gd-tag { display: inline-flex; align-items: center; padding: 0 5px; border-radius: 5px; font: 800 10px/16px var(--font); letter-spacing: .4px; color: #fff; background: var(--tag, #1f6fc4); border: 1px solid #0004; box-shadow: inset 0 1px 0 #fff5; vertical-align: 1px; white-space: nowrap; }
.gd-tag.t-bronze { background: linear-gradient(#d7894a, #a5582a); } .gd-tag.t-silver { background: linear-gradient(#b9c6d3, #7f8fa1); }
.gd-tag.t-gold { background: linear-gradient(#ffd34d, #d99a00); color: #3a2400; } .gd-tag.t-diamond { background: linear-gradient(#8ff3ff, #6a7cff); color: #102050; }

.gd-level { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 12px; background: #fdefd2; border-bottom: 2px solid #e6d0a0; }
.gd-level small { font-size: 11px; color: #7a6a5a; font-weight: 700; }
.gd-level .gd-chips { grid-column: 1 / -1; }
.gd-bar { position: relative; height: 12px; border-radius: 6px; background: #fff; border: 1.5px solid #c9a96c; overflow: hidden; }
.gd-bar > span { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, #ffbf1a 0 6px, #ffd34d 6px 12px); border-right: 1.5px solid #b07f00; }
.gd-bar.green > span { background: repeating-linear-gradient(90deg, #43a047 0 6px, #5cc261 6px 12px); border-color: #2e7d32; }
.gd-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gd-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; background: #fff; border: 1.5px solid #e6d0a0; font: 800 11px/18px var(--font); color: #5a4a3a; white-space: nowrap; }
.gd-chip .pxi { height: 12px; }
.gd-chip.buff { background: #e6f7df; border-color: #8fcf86; color: #2e6b2a; }
.gd-chip.warn { background: #fff3c9; border-color: #e6b84d; color: #8a5a10; white-space: normal; max-width: 100%; }   /* 18/10: câu chờ buff dài, cho xuống dòng thay vì lấn mép phải */
.gd-chip.off { background: #f1ece2; border-color: #d8ccb6; color: #8a7f70; }

.gd-tabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 8px 10px; background: #fdefd2; border-bottom: 2px solid #e6d0a0; overflow-x: auto; scrollbar-width: none; }
.gd-tabs button { position: relative; flex: 1 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; padding: 2px 8px; border-radius: 12px; border: 1.5px solid #d9bf8a; background: #fff; color: #5a4a3a; font: 800 11.5px var(--font); box-shadow: 0 3px 0 #d9bf8a; cursor: pointer; white-space: nowrap; }
.gd-tabs button .pxi { height: 16px; }
.gd-tabs button.on { background: linear-gradient(#ffc04d, #ff9f1c); border-color: #c7600a; color: #fff; text-shadow: 0 1px 0 #0004; box-shadow: 0 3px 0 #a94f06; }
.gd-tabs button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a94f06; }
.gd-tabs button:focus-visible, .gd button:focus-visible, .gd input:focus-visible, .gd textarea:focus-visible { outline: 3px solid #1e88e5; outline-offset: 2px; }
.gd-tabs .panel-tab-alert { position: absolute; top: -6px; right: -4px; }

.gd-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.gd-body > * { flex-shrink: 0; }   /* danh sách dài cuộn, không co thẻ */
.gd-card { background: #fff; border: 1.5px solid #e6d0a0; border-radius: 12px; box-shadow: 0 2px 0 #e6d0a0; padding: 10px 12px; }
.gd-card h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 800 15px/1.2 var(--display); }
.gd-card h3 .pxi { height: 16px; } .gd-card h3 small { margin-left: auto; font: 700 11px var(--font); color: #7a6a5a; }
.gd-card p { margin: 4px 0 0; font-size: 12px; color: #5a4a3a; }
.gd-card.me { background: #e6f7df; border-color: #43a047; box-shadow: 0 2px 0 #2f8034; }
.gd-card.info { background: #e6f4ff; border-color: #8cc2ef; box-shadow: 0 2px 0 #8cc2ef; }
.gd-card.warn { background: #fff3c9; border-color: #e6b84d; box-shadow: 0 2px 0 #e6b84d; }

/* Tiến độ tuần + 4 rương */
.gd-week-num { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 8px; }
.gd-week-num b { font: 800 26px/1 var(--display); color: #a5480a; } .gd-week-num span { font-size: 12px; color: #7a6a5a; font-weight: 700; }
.gd-track { position: relative; height: 16px; margin: 0 14px 34px; border-radius: 8px; background: #f3e6c8; border: 2px solid var(--ink); }
.gd-track > span { position: absolute; inset: 0 auto 0 0; border-radius: 6px 0 0 6px; background: repeating-linear-gradient(90deg, #ff9f1c 0 8px, #ffc04d 8px 16px); border-right: 2px solid var(--ink); }
.gd-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; }
.gd-mark img { height: 28px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #0004); }
.gd-mark small { margin-top: 2px; font: 800 10px var(--font); color: #5a4a3a; white-space: nowrap; }
.gd-mark.done small { color: #2e7d32; }
.gd-chests { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gd-chest { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 6px; border-radius: 10px; border: 1.5px solid #e6d0a0; background: #fffaf0; box-shadow: 0 2px 0 #e6d0a0; cursor: pointer; font: inherit; color: inherit; }
.gd-chest img { height: 34px; image-rendering: pixelated; }
.gd-chest b { font: 800 12px var(--display); } .gd-chest small { font: 700 10px/1.2 var(--font); color: #7a6a5a; text-align: center; }
.gd-chest.done { background: #e6f7df; border-color: #8fcf86; box-shadow: 0 2px 0 #6fae66; } .gd-chest.done small { color: #2e7d32; }
.gd-chest.locked img { filter: grayscale(1) brightness(1.15); opacity: .7; }
.gd-chest.sel { border-color: #c7600a; box-shadow: 0 0 0 2px #ffc04d, 0 2px 0 #a94f06; }
.gd-chest:active { transform: translateY(2px); }
.gd-loot { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.gd-loot div { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; background: #fdefd2; border: 1.5px solid #e6d0a0; font: 800 11.5px var(--font); }
.gd-loot .pxi { height: 18px; }
.pxi.plat-ico { filter: grayscale(1) brightness(1.35) contrast(1.15) drop-shadow(0 0 0 #5a7a9a); }   /* bao bạch kim: bạc, tách khỏi bao vàng đỏ */
.gd-loot .gold { background: #fff3c9; border-color: #e6b84d; color: #8a4a00; }
.gd-loot .plat { background: linear-gradient(#f4f8fc, #dce7f1); border-color: #8fa6bd; color: #2f4a66; box-shadow: inset 0 1px 0 #fff; }
.gd-split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; font-size: 12px; }
.gd-split dt { color: #7a6a5a; font-weight: 700; } .gd-split dd { margin: 0; font-weight: 800; text-align: right; }

/* Dòng thành viên (cùng nhịp với lb-row) */
.gd-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 58px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid #e6d0a0; background: #fff; box-shadow: 0 2px 0 #e6d0a0; }
.gd-row.me { background: #e6f7df; border-color: #43a047; box-shadow: 0 2px 0 #2f8034; }
.gd-row.low { border-color: #e6b84d; }
.gd-role { display: grid; justify-items: center; gap: 1px; font: 800 9px var(--font); color: #8a5a10; text-align: center; } .gd-role .pxi { height: 18px; }
.gd-main { min-width: 0; } .gd-main strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-main small { display: block; font-size: 11px; color: #7a6a5a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-main small.warn { color: #b0600a; font-weight: 700; }
.gd-side { display: grid; justify-items: end; gap: 4px; }
.gd-side .lb-score { font-size: 13.5px; }
.gd-acts { display: flex; gap: 4px; }
.gd-like { min-width: 40px; } .gd-like .pxi { height: 12px; }
.gd-like.liked { background: linear-gradient(#ff8fb0, #e8577f); --edge: #b83a5e; --lip: #9a2d4d; }
.gd-progress-mini { width: 74px; height: 6px; border-radius: 3px; background: #f1e4c6; overflow: hidden; } .gd-progress-mini span { display: block; height: 100%; background: #ff9f1c; }
.gd-progress-mini.ok span { background: #43a047; }


/* Nhiệm vụ hội (ngày + chung) */
.gd-today { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.gd-today > div { display: grid; gap: 3px; padding: 6px 8px; border-radius: 10px; background: #fdefd2; border: 1.5px solid #e6d0a0; }
.gd-today small { font-size: 10.5px; color: #7a6a5a; font-weight: 700; } .gd-today b { font: 800 15px var(--display); }
.gd-tasks { display: grid; gap: 6px; }
.gd-task { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1.5px solid #e6d0a0; background: #fffaf0; }
.gd-task.done { background: #f1f9ec; border-color: #b9dfb0; }
.gd-task-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1.5px solid #e6d0a0; } .gd-task-ico .pxi { height: 18px; }
.gd-task-main { min-width: 0; } .gd-task-main b { display: block; font-size: 12.5px; line-height: 1.25; }
.gd-task.done .gd-task-main b { color: #4a6a40; }
.gd-task-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-top: 3px; } .gd-task-bar .gd-bar { height: 8px; } .gd-task-bar small { font: 700 10.5px var(--font); color: #7a6a5a; }
.gd-pts { display: grid; justify-items: center; min-width: 50px; padding: 2px 6px; border-radius: 8px; background: #fff3c9; border: 1.5px solid #e6b84d; font: 800 13px var(--display); color: #a5480a; }
.gd-pts em { font: 700 9px var(--font); font-style: normal; color: #8a6a30; }
.gd-pts.ok { background: #e6f7df; border-color: #8fcf86; color: #2e7d32; }
.gd-chip.sm { font-size: 10px; line-height: 16px; padding: 0 5px; }
/* Phố Hội */
.gd-listhead { display: flex; align-items: center; gap: 8px; } .gd-listhead > span { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; font: 800 12px var(--font); color: #7a6a5a; } .gd-listhead .pxi { height: 12px; }
.gd-sort { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: #f3e3c0; border: 1.5px solid #d9bf8a; }
.gd-sort button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; font: 800 12px var(--font); color: #6a5a40; cursor: pointer; }
.gd-sort button[aria-pressed="true"] { background: linear-gradient(#ffc04d, #ff9f1c); color: #fff; text-shadow: 0 1px 0 #0004; box-shadow: 0 2px 0 #a94f06; }
.gd-sort button:active { transform: translateY(1px); }
.gd-row { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 6px; }
.gd-row .gd-acts, .gd-row .gd-manage, .gd-row .gd-low { grid-column: 2 / -1; }
.gd-acts { display: flex; justify-content: flex-end; gap: 6px; }
.gd-acts .btn { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; min-height: 32px; } .gd-acts .btn .pxi { height: 12px; }
.gd-like.liked { color: #fff; } .gd-more-btn { min-width: 40px; letter-spacing: 1px; }
.gd-av { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--ink); background: #ffe7b8; font: 800 18px var(--display); box-shadow: inset 0 -3px 0 #0001; }
.gd-av.r-leader { background: linear-gradient(#ffe066, #ffbf1a); } .gd-av.r-vice { background: linear-gradient(#e4eef6, #b9c6d3); }
.gd-row.me .gd-av { background: #d8f0d0; }
.gd-badge { display: inline-flex; align-items: center; gap: 2px; margin-right: 5px; padding: 0 5px; border-radius: 5px; font: 800 9.5px/15px var(--font); vertical-align: 1px; color: #fff; }
.gd-badge .pxi { height: 9px; } .gd-badge.r-leader { background: #c78a00; } .gd-badge.r-vice { background: #6f8296; } .gd-badge.r-me { background: #2e7d32; }
.gd-low { margin: 0; font: 700 11px var(--font); color: #b0600a; display: flex; align-items: center; gap: 4px; } .gd-low .pxi { height: 11px; }
.gd-manage { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; padding: 6px; border-radius: 10px; background: #fdefd2; border: 1.5px dashed #d9bf8a; }
.gd-manage small { flex-basis: 100%; text-align: right; font-size: 10.5px; color: #7a6a5a; }
.gd-morelist { min-height: 40px; border-radius: 12px; border: 1.5px dashed #c9a96c; background: #fffaf0; font: 800 12.5px var(--font); color: #6a5a40; cursor: pointer; }
.gd-morelist:active { transform: translateY(2px); }
.gd-count { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 4px; border-radius: 8px; background: #fff; color: #c7600a; font: 800 10px var(--font); font-style: normal; }
.gd-inline-tag { font-weight: 800; color: #1f6fc4; }

/* Cửa hàng xu hội */
.pxi.hcpn { image-rendering: pixelated; }
.gd-chip .pxi.hcpn { height: 12px; } .gd-preset .pxi.hcpn { height: 14px; } .gd-card h3 .pxi.hcpn { height: 18px; } .btn .pxi.hcpn { height: 16px; }
.gd-back { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid #cdb48a; background: #fff; box-shadow: 0 2px 0 #c6a771; font: 800 22px/1 var(--display); color: var(--ink); cursor: pointer; }
.gd-back:active { transform: translateY(2px); box-shadow: 0 0 0 #c6a771; }
.gd-wallet b.gd-coins { display: flex; align-items: center; gap: 6px; font: 800 22px/1.1 var(--display); color: #a5480a; } .gd-wallet b.gd-coins .pxi { height: 22px; }
.gd-note { margin: 0; font-size: 12px; color: #6a5a40; padding: 6px 10px; border-radius: 10px; background: #fdefd2; border: 1.5px dashed #e6d0a0; }
.gd-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1.5px solid #e6d0a0; background: #fff; box-shadow: 0 2px 0 #e6d0a0; }
.gd-item-ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; border: 2px solid var(--ink); background: linear-gradient(#fff6dc, #ffe7b8); box-shadow: inset 0 -3px 0 #0001; } .gd-item-ico .pxi { height: 30px; }
.gd-item-main { min-width: 0; } .gd-item-main b { display: block; font-size: 13.5px; line-height: 1.25; } .gd-item-main small { display: block; font-size: 11px; color: #7a6a5a; margin-top: 1px; }
.gd-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gd-price { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 6px; background: #fff3c9; border: 1.5px solid #e6b84d; font: 800 12px/18px var(--display); color: #a5480a; } .gd-price .pxi { height: 12px; }
.gd-item .btn { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; min-height: 36px; min-width: 76px; justify-content: center; } .gd-item .btn .pixel-ui-icon { width: 14px; height: 14px; }
.gd-item.locked .gd-item-ico { filter: grayscale(.8); opacity: .75; } .gd-item.done { background: #f6fbf3; }

/* Đồ Khoe: thẻ trưng bày */
.gd-show { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gd-sc { position: relative; display: flex; flex-direction: column; border: 2px solid var(--rar); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--rar-d); overflow: hidden; }
.gd-sc-stage { position: relative; height: 118px; display: grid; place-items: center; padding: 22px 10px 10px; box-sizing: border-box;
  background: linear-gradient(#0000, #0003), repeating-linear-gradient(0deg, #ffffff08 0 1px, transparent 1px 8px), #2b2233; border-bottom: 2px solid var(--rar); }
.gd-sc-stage.k-flag { background: linear-gradient(#8a7a6a 0 58%, #6b5a4a 58% 60%, transparent 60%), repeating-conic-gradient(#e9dcc4 0 25%, #dccdb0 0 50%) 0 0 / 24px 24px; }
.gd-sc-stage.k-title2 { background: radial-gradient(circle at 50% 60%, #6a3fc944, transparent 70%), #241a33; }
.gd-rar { position: absolute; left: 8px; top: 7px; padding: 0 7px; border-radius: 6px; background: var(--rar); color: #fff; font: 800 10px/18px var(--font); letter-spacing: .3px; text-transform: uppercase; box-shadow: 0 2px 0 var(--rar-d); }
.gd-own { position: absolute; right: 8px; top: 7px; padding: 0 7px; border-radius: 6px; background: #2e7d32; color: #fff; font: 800 10px/18px var(--font); box-shadow: 0 2px 0 #1b5e20; }
.gd-sc-body { display: grid; gap: 3px; padding: 8px 10px 10px; } .gd-sc-body b { font-size: 13.5px; line-height: 1.25; } .gd-sc-body small { font-size: 11px; color: #7a6a5a; min-height: 28px; }
.gd-sc-body .btn { margin-top: 4px; width: 100%; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px; min-height: 38px; }
.gd-sc-body .btn .pxi { height: 14px; } .gd-sc-body .btn .pixel-ui-icon { width: 14px; height: 14px; }
.gd-sc.locked .gd-sc-stage > :not(.gd-rar):not(.gd-lockcap) { filter: saturate(.75) brightness(.85); }   /* khóa vẫn thấy rõ món để muốn mở */
.gd-lockcap { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; background: #000c; color: #fff; font: 800 11px var(--font); white-space: nowrap; } .gd-lockcap .pixel-ui-icon { width: 12px; height: 12px; }
.pv-chat { display: flex; align-items: flex-start; gap: 8px; width: 100%; max-width: 230px; }
.pv-av { position: relative; flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 2px solid #4a3a5a; background: #ffe7b8; font: 800 15px var(--display); color: var(--ink); }
.pv-av.gfr { border: 3px solid var(--g); box-shadow: 0 0 0 2px #0008, 0 0 12px var(--g); animation: gGlow 1.8s ease-in-out infinite alternate; }
.pv-av.gfr img { position: absolute; right: -10px; top: -12px; width: 18px; height: 18px; image-rendering: pixelated; }
.pv-line { min-width: 0; color: #f4eefc; font-size: 12px; } .pv-line b { color: #ffe066; } .pv-line .pv-msg { display: block; color: #e6dcf2; margin-top: 2px; }
.pv-bub { position: relative; min-width: 0; padding: 6px 10px 7px; border-radius: 4px 12px 12px 12px; border: 2px solid var(--g); color: #1d1a26; font-size: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--g) 28%, #fff), #fff 70%); box-shadow: 0 2px 0 color-mix(in srgb, var(--g) 70%, #000); }
.pv-bub::after { content: ''; position: absolute; right: -2px; top: -10px; width: 22px; height: 12px; background: var(--g); clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); border-left: 2px solid #2a1c1c; }
.pv-bub b { color: color-mix(in srgb, var(--g) 70%, #000); } .pv-bub .pv-msg { display: block; margin-top: 2px; }
.pv-titlebox { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pv-name { font: 800 13px var(--display); color: #fff; }
.gttl { position: relative; overflow: hidden; margin: 0; font-size: 12.5px !important; padding: 3px 10px 3px 7px !important; }
.gttl .pxi { height: 12px; }
.gttl.g-pillar { color: #fff; border-color: #0006 !important; background: linear-gradient(90deg, color-mix(in srgb, var(--g) 80%, #000), var(--g), color-mix(in srgb, var(--g) 80%, #000)); text-shadow: 0 1px 0 #0007; box-shadow: 0 0 0 2px #fff3, 0 0 10px var(--g); }
.gttl.g-legend { color: #3a2200; border-color: #8a5a00 !important; background: linear-gradient(90deg, #ffd34d, #fff1a8, #ffbf1a, #fff1a8, #ffd34d); background-size: 200% 100%; animation: ttlSlide 2.6s linear infinite; box-shadow: 0 0 0 2px #8a3fc9, 0 0 16px #ffd34d; }
.gttl::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, #ffffff99 50%, transparent 65%); transform: translateX(-120%); animation: gShine 2.8s ease-in-out infinite; }
.pv-spark { position: absolute; width: 4px; height: 4px; background: #fff6c0; box-shadow: 0 0 6px #ffd34d; animation: gTwinkle 1.6s ease-in-out infinite; }
.pv-spark.s1 { left: -10px; top: 26px; } .pv-spark.s2 { right: -8px; top: 18px; animation-delay: .5s; } .pv-spark.s3 { right: 24px; bottom: -8px; animation-delay: 1s; }
.pv-floor { position: relative; display: grid; justify-items: center; align-self: end; }
.pv-flag { height: 90px; image-rendering: pixelated; filter: drop-shadow(2px 3px 0 #0003); }
.pv-floor-tip { position: absolute; right: -74px; bottom: 4px; padding: 0 6px; border-radius: 6px; background: #fff; border: 1.5px solid #c9a96c; font: 800 10px/16px var(--font); color: #6a5a40; white-space: nowrap; }
@keyframes gGlow { to { box-shadow: 0 0 0 2px #0008, 0 0 20px var(--g); } }
@keyframes gShine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes gTwinkle { 50% { opacity: .2; transform: scale(.5); } }
@media (max-width: 520px) { .gd-show { grid-template-columns: 1fr; } .gd-sc-stage { height: 110px; } .gd-sc-body small { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .pv-av.gfr, .gttl.g-legend, .gttl::after, .pv-spark { animation: none; } }
/* Bảng cấp hội */
.gd-lv { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 10px; border-radius: 12px; border: 1.5px solid #e6d0a0; background: #fff; box-shadow: 0 2px 0 #e6d0a0; }
.gd-lv .n { display: grid; justify-items: center; font: 800 20px/1 var(--display); color: #b07f00; } .gd-lv .n small { font: 700 9.5px var(--font); color: #7a6a5a; margin-top: 2px; }
.gd-lv .u { font-size: 11px; color: #5a4a3a; margin-top: 3px; }
.gd-lv.past { background: #f6fbf3; } .gd-lv.past .n { color: #2e7d32; }
.gd-lv.cur { background: #fff3c9; border-color: #cf9800; box-shadow: 0 0 0 2px #ffcf33, 0 2px 0 #b07f00; }
.gd-lv.next .n, .gd-lv.lock .n { color: #9a8c78; }
.gd-lv.lock { opacity: .78; }
.gd-donate { display: grid; gap: 8px; }
.gd-ups { display: grid; gap: 4px; margin: 4px 0 2px; }
.gd-up { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto 52px; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 8px; background: #fff; border: 1.5px solid #b9d9f3; font-size: 12px; }
.gd-up span { display: flex; align-items: center; gap: 4px; font-weight: 700; color: #3a4a5a; } .gd-up span .pxi { height: 12px; }
.gd-up b { font: 800 13px var(--display); color: #6a7a8a; } .gd-up b.to { color: #2e7d32; font-size: 15px; } .gd-up i { font-style: normal; color: #9aaaba; }
.gd-up em { font: 800 11px var(--font); font-style: normal; color: #2e7d32; text-align: right; }
.gd-lv.mile { border-color: #c7600a; } .gd-mile { display: inline-block; padding: 0 5px; border-radius: 5px; background: linear-gradient(#ffc04d, #ff9f1c); color: #fff; font: 800 9.5px/15px var(--font); text-shadow: 0 1px 0 #0004; }
.gd-presets { display: flex; gap: 6px; } .gd-presets .btn { flex: 1; }
.gd-preset { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; border-radius: 12px; border: 1.5px solid #d9bf8a; background: #fff; color: #5a4a3a; font: 800 13px var(--font); box-shadow: 0 3px 0 #d9bf8a; cursor: pointer; }
.gd-preset .pxi { height: 12px; }
.gd-preset[aria-pressed="true"] { background: linear-gradient(#ffc04d, #ff9f1c); border-color: #c7600a; color: #fff; text-shadow: 0 1px 0 #0004; box-shadow: 0 3px 0 #a94f06; }
.gd-preset:active { transform: translateY(2px); box-shadow: 0 1px 0 #a94f06; }

/* Chat hội */
.gd-chat { display: grid; gap: 8px; }
.gd-msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: start; }
.gd-msg .av { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--ink); display: grid; place-items: center; background: #ffe7b8; font: 800 13px var(--display); }
.gd-msg .bub { background: #fff; border: 1.5px solid #e6d0a0; border-radius: 4px 12px 12px 12px; padding: 5px 9px; font-size: 13px; box-shadow: 0 2px 0 #e6d0a0; }
.gd-msg .who { display: flex; align-items: center; gap: 4px; font: 800 12px var(--font); margin-bottom: 1px; } .gd-msg .who time { margin-left: auto; font: 600 10.5px var(--font); color: #9a8c78; }
.gd-msg.me { grid-template-columns: minmax(0, 1fr) 32px; } .gd-msg.me .av { order: 2; background: #d8f0d0; } .gd-msg.me .bub { background: #e6f7df; border-color: #8fcf86; border-radius: 12px 4px 12px 12px; box-shadow: 0 2px 0 #8fcf86; }
.gd-msg.sys .bub { background: #fdefd2; border-style: dashed; font-size: 12px; color: #6a5a40; }
.gd-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.gd-composer textarea, .gd-field input { width: 100%; box-sizing: border-box; min-height: 42px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #c9a96c; background: #fff; font: 600 14px var(--font); color: var(--ink); resize: none; }
.gd-composer .btn { min-height: 42px; }

.gd-foot { flex: 0 0 auto; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: #fdefd2; border-top: 2px solid #e6d0a0; display: grid; gap: 8px; }
.gd-foot-row { display: flex; align-items: center; gap: 8px; } .gd-foot-row > div { flex: 1; min-width: 0; }
.gd-foot-row b { display: block; font-size: 13px; } .gd-foot-row small { display: block; font-size: 11px; color: #5a4a3a; }
.gd-foot .btn { min-height: 40px; }
.gd-foot .lb-mine { padding: 6px 10px; }

/* Danh sách hội (chưa có hội) */
.gd-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.gd-search input { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid #c9a96c; font: 600 14px var(--font); }
.gd-guild { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px 10px; border-radius: 12px; border: 1.5px solid #e6d0a0; background: #fff; box-shadow: 0 2px 0 #e6d0a0; }
.gd-guild .gd-main strong { display: flex; align-items: center; gap: 5px; }
.gd-lock { display: flex; gap: 10px; align-items: center; }
.gd-lock .pxi { height: 28px; }
.gd-req { display: grid; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.gd-req li { display: flex; align-items: center; gap: 6px; } .gd-req .pxi { height: 12px; }
.gd-req li.ok { color: #2e7d32; font-weight: 700; } .gd-req li.no { color: #b0330f; font-weight: 700; }

/* Lập hội */
.gd-field { display: grid; gap: 4px; } .gd-field label { font: 800 12px var(--font); display: flex; justify-content: space-between; } .gd-field label span { color: #7a6a5a; font-weight: 700; }
.gd-field.bad input { border-color: var(--red); background: #fff2f0; } .gd-field .err { font-size: 11px; color: #c2352f; font-weight: 700; }
.gd-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 44px)); justify-content: space-between; gap: 4px; }
.gd-pick button { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1.5px solid #d9bf8a; background: #fff; box-shadow: 0 2px 0 #d9bf8a; cursor: pointer; padding: 0; }
.gd-pick button .pxi { height: 20px; } .gd-pick button[aria-pressed="true"] { border-color: #c7600a; box-shadow: 0 0 0 2px #ffc04d, 0 2px 0 #a94f06; }
.gd-pick.colors button { border-color: #0005; }
.gd-preview { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #271f30; color: #f4eefc; font-size: 13px; }
.gd-preview .nm { font-weight: 800; color: #ffe066; }
.gd-cost, .gd-foot .btn { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; }
.gd-foot .btn .pixel-ui-icon { height: 16px; width: 16px; }
.gd-cost .pxi { height: 16px; }

/* Popup nhận rương (dùng lại cơ chế popup quà sự kiện BXH) */
.modal.gd-claim { width: min(380px, 100%); text-align: center; }
.gd-claim .big { height: 72px; image-rendering: pixelated; margin: 4px auto 0; display: block; filter: drop-shadow(0 3px 0 #0004); }
.gd-claim .gd-loot { text-align: left; }

@media (max-width: 520px) {
  .modal.gd-modal { height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .lb-title { font-size: 19px; }
  .gd-tabs { gap: 5px; padding: 6px 8px; } .gd-tabs button { padding: 2px 4px; font-size: 11px; min-height: 44px; }
  .gd-body { padding: 8px 10px 12px; }
  .gd-row { grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 6px; padding: 6px 8px; } .gd-av { width: 36px; height: 36px; }
  .gd-today { grid-template-columns: 1fr; } .gd-sort button { padding: 0 7px; }
}
/* Điện thoại ngang: thấp → header gọn, tabs thành cột trái để giữ chiều cao nội dung */
@media (max-height: 500px) and (orientation: landscape) {
  .modal.gd-modal { width: min(760px, 100%); height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .modal-wrap:has(.gd-modal) { padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
  .gd > .lb-head { padding: 4px 8px 4px 10px; gap: 8px; }
  .gd .lb-trophy .gd-emblem { width: 30px; height: 30px; border-radius: 8px; } .gd .lb-trophy .gd-emblem .pxi { height: 18px; }
  .modal .lb-title { font-size: 17px; } .lb-titles small { font-size: 9px; }
  .gd .pp-x { width: 32px; height: 32px; }
  .gd-level { padding: 4px 10px; } .gd-level .gd-chips { display: none; }
  .gd-foot { padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); } .gd-foot .lb-mine { padding: 4px 8px; } .gd-foot .lb-mine-rank { font-size: 18px; min-width: 40px; }
  /* Có tabs: tabs thành cột trái để giữ chiều cao nội dung */
  .gd:has(.gd-tabs) { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .gd:has(.gd-tabs) > .lb-head, .gd:has(.gd-tabs) > .gd-level { grid-column: 1 / -1; }
  .gd-tabs { grid-row: 3 / 5; flex-direction: column; overflow-y: auto; border-bottom: 0; border-right: 2px solid #e6d0a0; }
  .gd-tabs button { flex: 0 0 auto; flex-direction: row; gap: 6px; justify-content: flex-start; min-height: 40px; }
  .gd:has(.gd-tabs) > .gd-body, .gd:has(.gd-tabs) > .gd-foot { grid-column: 2; }
}
/* 18/10 (QA bản test): nút nhỏ trong Hội ("Đi like" 24px, "Nhận vào túi" 25px) đủ vùng chạm 32px */
.gd-task .btn.tiny, .gd-card .btn.small, .gd-card .btn.tiny { min-height: 32px; }

/* ===== Hội thật (18/10): dải mất kết nối, ô tìm hội, trạng thái trống, "chờ lưu" ===== */
.gd-offline { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: #fff3c9; border: 1.5px solid #e6b84d; font: 700 12px/1.35 var(--font); color: #8a5a10; }
.gd-offline .pxi { height: 12px; } .gd-offline .btn { margin-left: auto; min-height: 32px; }
.gd-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.gd-search input { width: 100%; box-sizing: border-box; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid #c9a96c; background: #fff; font: 600 14px var(--font); color: var(--ink); }
.gd-search .btn { min-height: 40px; }
.gd-empty h3 { margin-bottom: 2px; }
.gd-wait { font: 700 10.5px var(--font); font-style: normal; color: #2e7d32; }
.gd-msg.sys .bub time { display: block; margin-top: 2px; font: 600 10px var(--font); color: #9a8c78; }
.gd-field .gd-sort { justify-self: start; }
.gd-acts .btn[aria-busy="true"] { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .gd-chest:active, .gd-tabs button:active, .gd-morelist:active { transform: none; } }

/* ===== Danh hiệu top BXH Hội tuần (18/10): viền pixel, chữ chạy ánh kim, vệt sáng quét, sao lấp lánh. Chủ hội: viền đôi + 2 vương miện + nhịp sáng ===== */
.ttl.gtt { position: relative; overflow: hidden; isolation: isolate; gap: 4px; padding: 2px 9px 2px 6px; border: 2px solid var(--gtt-edge); border-radius: 6px; background: var(--gtt-bg); color: var(--gtt-t1); box-shadow: 0 0 0 1px #000a, 0 2px 0 #0006, 0 0 10px var(--gtt-glow), inset 0 1px 0 #ffffff55; }
.ttl.gtt .pxi { height: 13px; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #000a); position: relative; z-index: 1; }
.ttl.gtt b { position: relative; z-index: 1; font-weight: 900; letter-spacing: .2px; background: linear-gradient(90deg, var(--gtt-t1) 0%, var(--gtt-t2) 35%, #fff 50%, var(--gtt-t2) 65%, var(--gtt-t1) 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gttText 2.6s linear infinite; filter: drop-shadow(0 1px 0 #000c); }
.ttl.gtt em { position: relative; z-index: 1; font: 800 9px/14px var(--font, sans-serif); font-style: normal; padding: 0 4px; border-radius: 3px; background: #0007; border: 1px solid #fff4; color: #fff; }
.ttl.gtt.sm .pxi { height: 11px; } .ttl.gtt.sm { padding: 1px 7px 1px 4px; border-width: 1.5px; }
.gtt-shine { position: absolute; inset: -2px; z-index: 0; background: linear-gradient(105deg, transparent 38%, #ffffffaa 47%, #fff6 52%, transparent 60%); transform: translateX(-130%); animation: gttShine 3s ease-in-out infinite; pointer-events: none; }
.gtt-sp { position: absolute; z-index: 2; width: 5px; height: 5px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 2px #fff); animation: gttTw 1.8s ease-in-out infinite; pointer-events: none; }
.gtt-sp.s1 { top: 1px; left: 34%; } .gtt-sp.s2 { bottom: 1px; right: 22%; animation-delay: .6s; } .gtt-sp.s3 { top: 2px; right: 5px; animation-delay: 1.2s; }
.gtt-1 { --gtt-bg: linear-gradient(180deg, #6b1220 0%, #3a0812 55%, #1e040a 100%); --gtt-edge: #ffd34d; --gtt-glow: #ffb300aa; --gtt-t1: #fff3b0; --gtt-t2: #ffbf1a; }
.gtt-2 { --gtt-bg: linear-gradient(180deg, #24476a 0%, #11263d 55%, #08121f 100%); --gtt-edge: #dbe6f0; --gtt-glow: #9fd2ff99; --gtt-t1: #ffffff; --gtt-t2: #8fd0ff; }
.gtt-3 { --gtt-bg: linear-gradient(180deg, #5c240a 0%, #2e1004 55%, #160702 100%); --gtt-edge: #ff9a3c; --gtt-glow: #ff6a0099; --gtt-t1: #ffe0b0; --gtt-t2: #ff8a2a; }
.ttl.gtt.gtt-lead { border-style: double; border-width: 4px; padding: 1px 9px 1px 5px; animation: gttPulse 2.2s ease-in-out infinite; }
.ttl.gtt.gtt-lead.sm { border-width: 3px; }
.ttl.gtt-1.gtt-lead { box-shadow: 0 0 0 1px #000, 0 2px 0 #0006, 0 0 0 3px #ffd34d33, 0 0 16px #ffc400cc, inset 0 1px 0 #fff6; }
@keyframes gttText { to { background-position: -220% 0; } }
@keyframes gttShine { 0%, 55% { transform: translateX(-130%); } 85%, 100% { transform: translateX(130%); } }
@keyframes gttTw { 0%, 100% { opacity: .15; transform: scale(.5); } 50% { opacity: 1; transform: scale(1); } }
@keyframes gttPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@media (prefers-reduced-motion: reduce) { .ttl.gtt, .ttl.gtt b, .gtt-sp { animation: none !important; } .gtt-shine { display: none; } }

/* Đua top + thưởng + danh hiệu đang có (tab Tuần), huy hiệu trên dòng thành viên */
.gd-race details { margin-top: 6px; } .gd-race summary { cursor: pointer; font: 800 12px var(--font); color: #6a5a40; min-height: 32px; display: flex; align-items: center; }
.gd-last { font-weight: 700; } .gd-last b { color: #a5480a; }
.gd-prizes { display: grid; gap: 6px; margin-top: 4px; }
.gd-prize { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1.5px solid #e6d0a0; background: #fffaf0; }
.gd-prize img { width: 32px; height: 32px; image-rendering: pixelated; } .gd-prize b { display: block; font-size: 12.5px; }
.gd-prize span { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; font-size: 11px; color: #7a6a5a; } .gd-prize .ttl { margin: 0; }
.gd-prize.p1 { background: #fff7d6; border-color: #e6b84d; } .gd-prize.p2 { background: #f1f6fb; border-color: #b9c6d3; } .gd-prize.p3 { background: #fff0e4; border-color: #e6a070; }
.gd-own-titles { display: grid; gap: 6px; margin-top: 6px; }
.gd-own-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: #1b1420; border: 1.5px solid #3a2d40; }
.gd-own-title .ttl { margin: 0; } .gd-own-title .btn { margin-left: auto; min-height: 32px; } .gd-own-title small { flex-basis: 100%; font: 700 10.5px var(--font); color: #d8c9b0; }
.gd-row-title { display: block; margin-top: 3px; max-width: 100%; overflow: hidden; } .gd-row-title .ttl { margin: 0; max-width: 100%; }
.gd-title-won { margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-weight: 800; }
/* 19/10: Bảng tin — thông báo ghim của Chủ/Phó hội (tách khỏi Chat) */
.gd-board { margin-bottom: 10px; background: #fffbea; border-color: #e6b84d; box-shadow: 0 2px 0 #e6b84d; }
.gd-board.empty { background: #fff; border-style: dashed; box-shadow: none; }
.gd-board-text { margin: 6px 0 0; font: 600 14px/1.45 var(--font); color: var(--ink, #2a1c1c); white-space: normal; overflow-wrap: anywhere; }
.gd-board textarea { width: 100%; box-sizing: border-box; min-height: 120px; margin-top: 4px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #c9a96c; background: #fff; font: 600 14px/1.4 var(--font); color: var(--ink, #2a1c1c); resize: vertical; }
.gd-board-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.gd-board-acts .btn { min-height: 40px; display: inline-flex; align-items: center; gap: 4px; }
.gd-board-acts .btn.tiny { min-height: 34px; }
@media (max-width: 420px) { .gd-board textarea { min-height: 100px; font-size: 15px; } .gd-board-acts .btn { flex: 1 1 auto; justify-content: center; } }
