/* City Online · warm ink, carved wood and parchment. Loaded after base HUD. */
:root {
  --bg: #fff3dceF;
  --bg-solid: #fff3dc;
  --line: #ceb58b;
  --text: #4e3c2a;
  --muted: #806b50;
  --accent: #78894c;
  --accent-2: #a86a2f;
  --radius: 13px;
  --wood: #44392b;
  --wood-line: #8b7655;
  --cream: #fff0c9;
  --shadow: 0 3px 0 #35291d40, 0 8px 22px #35291d24;
}
button:focus-visible, [role="button"]:focus-visible, input:focus-visible {
  outline: 3px solid #e9bd69; outline-offset: 3px;
}
.glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
#hud-stats, #hud-clock, #map-wrap, #quest, #chat, #drive-hud {
  color: var(--cream);
  background: repeating-linear-gradient(4deg, #ffffff03 0 1px, transparent 1px 7px), linear-gradient(145deg, #514533f5, #302b22f5);
  border: 2px solid #3a3024;
  outline: 1px solid #a78d5d90;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px #a18a5955, 0 4px 0 #30291c40, 0 8px 20px #30291c20;
}
#hud-stats { top: 16px; left: 16px; width: 254px; padding: 13px; }
.hud-top { position: relative; display: grid; grid-template-columns: 1fr auto; min-height: 52px; padding-left: 60px; gap: 2px 5px; align-content: center; }
.citizen-label { grid-column: 1 / -1; color: #bfa982; font: 800 8px var(--display); letter-spacing: 1px; }
#hud-name { color: #ffefc8; font: 900 17px var(--display); }
#hud-level { align-self: center; background: #756448; color: #ffdf98; border: 1px solid #9e8558; padding: 2px 6px; font-size: 9px; }
.citizen-portrait { position: absolute; left: 0; top: 0; width: 50px; height: 50px; overflow: hidden; border: 2px solid #bda376; border-radius: 50%; background: #827952; box-shadow: 0 0 0 3px #30291f; }
.citizen-portrait i { display: block; position: absolute; }
.portrait-face { width: 28px; height: 28px; top: 9px; left: 9px; background: var(--portrait-skin, #eac29d); border-radius: 40% 40% 45% 45%; border: 1px solid #513d30; z-index: 2; }
.portrait-face::before { content: ''; position: absolute; top: 11px; left: 6px; width: 3px; height: 4px; background: #3a3029; border-radius: 50%; box-shadow: 10px 0 #3a3029; }
.portrait-face::after { content: ''; position: absolute; left: 10px; top: 18px; width: 5px; height: 3px; border-bottom: 1px solid #9d6551; border-radius: 50%; }
.portrait-hair { top: 4px; left: 6px; width: 34px; height: 25px; background: var(--portrait-hair, #44382e); border-radius: 48% 45% 28% 25%; z-index: 3; clip-path: polygon(0 0, 100% 0, 100% 100%, 84% 75%, 80% 43%, 30% 52%, 13% 45%, 11% 100%, 0 100%); }
.portrait-shirt { width: 34px; height: 23px; top: 34px; left: 6px; border: 1px solid #493d2b; border-radius: 12px 12px 0 0; background: var(--portrait-shirt, #819f8b); }
.bar, .bar.xp, .energy-row .bar { background: #241f19; border: 1px solid #1c1a15; box-shadow: inset 0 1px 3px #0005; }
.bar.xp { height: 12px; margin: 8px 0; }
.bar.xp > div { background: linear-gradient(#edc272, #b68a44); }
#hud-xp-text, .bar.xp > span { display: block; color: #fff5db; text-shadow: 0 1px 2px #1b1710; font-size: 8.5px; line-height: 10px; }
.hud-money { margin: 10px 0; gap: 8px; padding: 8px 0; border-top: 1px solid #a58a4b35; border-bottom: 1px solid #a58a4b35; }
.hud-money b { color: #f2d58c; font-size: 13px; }
.energy-row { margin: 5px 0; gap: 8px; }
.energy-row .bar { height: 14px; }
.bar.energy > div { background: linear-gradient(#98be62, #638b3e); }
.bar.need > div { background: linear-gradient(#8fc8d1, #579cae); }
.bar.energy > span, .bar.need > span { color: #fff5db; text-shadow: 0 1px 2px #1b281b; font-size: 9px; line-height: 12px; }
#hud-housing, #room-exit { border: 1px solid #87734f; background: #6b5b3d66; color: #e8d6af; border-radius: 6px; font-size: 10px; }
#hud-housing:hover, #room-exit:hover { background: #89704788; }
#hud-clock { top: 16px; padding: 9px 13px; border-radius: 10px; gap: 10px; }
#clock-time { color: #ffe3a1; font-size: 18px; }
#clock-day { color: #d6c4a0; }
#hud-clock .weather-pill { background: #8f825433; color: #e7dab6; border-color: #a8945c44; }
#hud-clock .weather-pill b { color: #e7dab6; }
.in-interior #hud-clock::after { color: #ead5a9; }
#map-wrap { top: 16px; right: 16px; padding: 7px; }
#minimap { width: 164px !important; border: 1px solid #b7a477; border-radius: 7px; filter: sepia(.16) saturate(.8); }
.hud-toggle { border-color: #9c865e; background: #f3dfb3; }
#quest { top: 171px; right: 16px; width: 222px; padding: 15px; }
#quest::before { content: 'BẢNG NHIỆM VỤ'; display: block; color: #f2dda7; font: 900 13px var(--display); letter-spacing: .8px; border-bottom: 1px solid #b7a16b55; padding-bottom: 9px; margin-bottom: 10px; }
#quest .quest-tag { color: #bca87b; font-size: 9px; }
#quest .quest-title { color: #f5e7c1; font-size: 15px; margin: 6px 0 0; white-space: normal; line-height: 1.4; }
#quest.open { width: 222px; }
#quest .quest-desc { color: #d6c6a4; font-size: 12px; line-height: 1.7; }
#quest .quest-reward { color: #c7da91; border-color: #baa16c55; font-size: 11px; }
#map-wrap.collapsed + #quest { top: 70px; }
#menu { bottom: 16px; gap: 6px; padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
#menu button, #menu button:nth-child(n) { width: 66px; height: 68px; padding: 6px 3px; gap: 3px; font-size: 25px; border: 2px solid #382e22; border-radius: 12px; background: linear-gradient(#61543e, #3e3529); box-shadow: inset 0 0 0 1px #b29a6855, 0 4px 0 #30291a55; }
#menu button span { display: block; margin: 0; color: #f1dfb6; font-size: 10px; font-weight: 700; }
#menu kbd { top: 4px; right: 5px; color: #d9c89d; font-size: 8px; }
#menu button:hover, #menu button:focus-visible { transform: translateY(-4px); background: linear-gradient(#d9aa60, #b5803f); }
/* Thanh menu luôn vừa màn hình: nút co lại khi nhiều nút (Ví, Cảm xúc...) thay vì tràn ra hai mép. */
#menu { max-width: calc(100vw - 16px); }
#menu button, #menu button:nth-child(n) { flex: 0 1 auto; min-width: 38px; }
#menu button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Thanh menu gọn trên máy tính: chỉ giữ Túi đồ, Gọi xe, Bản đồ và nút ☰ "Tất cả"; bấm ☰ mở bảng đủ mọi chức năng
   kèm phím tắt (phím tắt vẫn dùng được khi bảng đóng). Máy cảm ứng có kiểu riêng trong mobile.css. */
#menu-more { color: #f1dfb6; }
body:not(.touch):not(.menu-open) #menu button:not(.m-main):not(#menu-more) { display: none; }
body:not(.touch).menu-open #menu { display: grid; grid-template-columns: repeat(8, 66px); gap: 6px; padding: 10px; z-index: 30;
  background: linear-gradient(145deg, #514533f8, #302b22f8); border: 2px solid #3a3024; outline: 1px solid #a78d5d90; border-radius: 14px; box-shadow: 0 8px 24px #1a150f66; }
body:not(.touch).menu-open #menu #menu-more { background: linear-gradient(#d9aa60, #b5803f); }
body:not(.touch).menu-open #menu #menu-more, body:not(.touch).menu-open #menu #menu-more span { color: #3a2a17; }
@media (max-width: 900px) { body:not(.touch).menu-open #menu { grid-template-columns: repeat(8, 53px); gap: 4px; padding: 8px; } }
@media (max-width: 700px) { body:not(.touch).menu-open #menu { grid-template-columns: repeat(4, 53px); } }
@media (max-width: 540px) {
  body:not(.touch) #menu { width: auto; }
  body:not(.touch) #menu button, body:not(.touch) #menu button:nth-child(n) { flex: none; width: 53px; }
}
/* Thanh menu giờ hẹp, không còn chạy dưới khung chat: khung chat về sát đáy như màn hình rộng. */
@media (min-width: 701px) and (max-width: 1200px) { body:not(.touch) #chat { bottom: 16px; } }
@media (min-width: 701px) and (max-width: 900px) { body:not(.touch) #chat { bottom: 10px; } }
#chat { bottom: 16px; left: 16px; width: 265px; padding: 9px; }
#chat-log { height: 88px; font-size: 11px; line-height: 1.6; }
.chat-line { color: #e8dabb; }
.chat-line b { color: #b8d5c0; }
.chat-line b.me { color: #f0d28c; }
.chat-line.sys { color: #cabc98; }
.chat-time { color: #b4a17e; }
#chat-input { color: #f5e7c2; background: #211f1780; border: 1px solid #8b7953; border-radius: 7px; }
#chat-input::placeholder { color: #baac8c; }
#chat.idle:not(:hover):not(:focus-within) { background: #3b3326bc; border-color: #716041; }
#chat.idle:not(:hover):not(:focus-within) #chat-log { opacity: .48; }
#chat.idle:not(:hover):not(:focus-within) #chat-input { opacity: .85; }
#prompt { bottom: 98px; color: #594027; background: #fff0d2f5; border-color: #a48a5a; }
#dialog { bottom: 98px; border: 2px solid #8e744c; border-radius: 14px; background: #fff1d8fa; }
.dialog-name, .modal-card h2, .work-title { color: #674b2e; }
.dialog-text, .option-sub, .help-sec ul { color: #7a674d; }
.modal-card, .work-card, .confirm-card { border: 2px solid #92784e; background: #fff1d8; border-radius: 14px; }
.modal-card header { background: #eddbb5; border-radius: 12px 12px 0 0; }
.option, .item-row, .stat, .inv-cell { background: #f6e7c9; border-color: #d7c39c; border-radius: 9px; }
.btn { background: linear-gradient(#e7b86c, #c59249); color: #48331e; border: 1px solid #ab7d3d; box-shadow: 0 2px 0 #785b2e33; }
.btn.ghost { color: #6f5838; border-color: #c3ae83; background: #f1e3c4; }
.tabs button.active { background: #e9d5a8; color: #60462c; }
#drive-hud { top: 262px; left: 16px; }
#drive-hud .drive-title b, #drive-hud .drive-target { color: #f1d595; }
#drive-hud .drive-steps li.now { color: #fff0c9; }
#drive-hud .drive-steps, #drive-hud .drive-order span { color: #d2c19b; }
#toasts { top: 76px; }
.fishing-hud { bottom: 106px; }
#auth { background: linear-gradient(90deg, #f6e9cae8, #f6e9ca18 52%, #c8b68d50), linear-gradient(0deg, #f4e6cabb, transparent 28%, transparent 75%, #f4e6cacc); }
.auth-card { background: #fff3dcf5; border: 2px solid #9e8559; border-radius: 16px; box-shadow: 0 7px 0 #765c3420, 0 20px 60px #3e342b25; }
.auth-intro h2, .wordmark, .auth-brand h1, .auth-brand h1 span, .preview-caption h2 { color: #654d32; }
.auth-brand p, .auth-intro p, .brand-points, .auth-footer { color: #7d6749; }
.auth-card .field input { background: #fbedd1; border-color: #d1ba8e; color: #5b482f; }
.town-caption { background: #fff0d4ee; border-color: #c5ac7d; outline: none; border-radius: 12px; }
.town-caption b { color: #775c37; }
.sun-mark, .welcome-sticker { background: #e8c281; color: #9a6d36; }
/* Parchment surfaces keep warm tracks; the dark wood track is only for the HUD. */
.modal-card .bar, .work-card .bar, .confirm-card .bar, #dialog .bar { background: #ead8b3; border: 1px solid #d3bd92; box-shadow: inset 0 1px 2px #6b4f2a22; }
.modal-card .bar > div, .work-card .bar > div, #dialog .bar > div { background: linear-gradient(#e9bf72, #c18d45); }
.skill .bar { height: 10px; }
.skill > span { color: #6f5a3e; font-weight: 600; }
.auth-card .tabs { background: #f3e5c6; border-color: #e0cca3; }
.auth-card .tabs button { color: #8a7352; }
.auth-card .tabs button.active { background: #fff8e8; color: #654d32; box-shadow: 0 2px 4px #76593018; }
.auth-card .chip { background: #f7ead0; border-color: #dfcaa0; color: #7a6243; }
.auth-card .chip:hover, .auth-card .chip.active { background: #ecd6a9; border-color: #b8925a; color: #5c4428; }
.auth-card .swatch.active { box-shadow: 0 0 0 2px #a8793f; }
.auth-card .auth-note, #look-picker { border-top-color: #e3cfa6; }
#look-picker .swatches.small { gap: 4px; }
@media (min-width: 541px) { #look-picker .swatches.small { flex-wrap: nowrap; } }
#look-picker .swatches.small .swatch { width: 22px; height: 22px; flex: none; }
#look-picker .swatch:hover { transform: translateY(-2px); }
#look-picker .swatch { transition: transform .15s ease; }
/* The avatar preview fills the lower page; keep the corner link from running under the card. */
#auth.previewing .auth-brand { opacity: 0; pointer-events: none; }
#auth.previewing .auth-footer > span:last-child, #auth.previewing .world-label { display: none; }
.preview-caption { text-shadow: 0 1px 0 #fff6e2, 0 0 18px #fbf1dc; }
.modal-body::-webkit-scrollbar-thumb, #chat-log::-webkit-scrollbar-thumb { background: #cbb288; border-radius: 99px; }
.modal-body::-webkit-scrollbar-thumb:hover, #chat-log::-webkit-scrollbar-thumb:hover { background: #b49462; }
.modal-body::-webkit-scrollbar-track { background: #f4e6c9; }
@media (max-width: 1200px) {
  #chat { bottom: 99px; width: 238px; }
  #chat-log { height: 62px; }
}
@media (max-width: 900px) {
  #hud-stats { top: 10px; left: 10px; width: 218px; padding: 10px; }
  #hud-clock { top: 10px; right: 10px; left: auto; transform: none; padding: 7px 10px; }
  #map-wrap { top: 61px; right: 10px; }
  #minimap { width: 126px !important; }
  #quest, #quest.open { top: 188px; right: 10px; width: 192px; padding: 11px; }
  #map-wrap.collapsed + #quest { top: 112px; }
  #quest::before { font-size: 11px; }
  #quest .quest-title { font-size: 13px; }
  #menu { bottom: 10px; gap: 4px; }
  #menu button, #menu button:nth-child(n) { width: 53px; height: 59px; font-size: 22px; }
  #menu button span { font-size: 8px; }
  #chat { left: 10px; bottom: 83px; width: 218px; }
  #prompt { bottom: 86px; max-width: calc(100vw - 32px); }
  #drive-hud { left: 10px; top: 250px; width: 200px; }
  #dialog { bottom: 83px; }
  #toasts { top: auto; bottom: 165px; }
  .auth-brand h1 { text-shadow: 0 1px 0 #fff8e7, 0 0 18px #f7ecd4; }
  .auth-brand p { color: #5b452d; font-weight: 600; text-shadow: 0 1px 0 #fff8e7, 0 0 14px #f7ecd4, 0 0 6px #f7ecd4; }
  #auth.previewing { padding-top: 248px; }
  #auth.previewing .auth-card { padding: 18px 18px 16px; }
  #auth.previewing .auth-intro { margin-bottom: 10px; }
  #auth.previewing .tabs { margin-bottom: 10px; }
  #auth.previewing .field { margin: 8px 0; }
  #look-picker { margin-top: 10px; padding-top: 10px; gap: 7px; }
}
@media (max-width: 540px) {
  #hud-stats { width: 184px; padding: 9px; }
  .hud-top { padding-left: 45px; min-height: 43px; }
  .citizen-portrait { width: 40px; height: 40px; }
  .citizen-label { font-size: 6px; letter-spacing: .5px; }
  #hud-name { font-size: 13px; }
  #hud-level { font-size: 8px; padding: 2px 4px; }
  .hud-money { gap: 5px; padding: 5px 0; margin: 6px 0; }
  .hud-money b { font-size: 10px; }
  #hud-clock { padding: 6px; gap: 5px; }
  #clock-time { font-size: 14px; }
  #map-wrap { top: 58px; }
  #minimap { width: 100px !important; }
  #quest, #quest.open { top: 162px; width: 148px; padding: 9px; }
  #quest::before { font-size: 9px; padding-bottom: 6px; margin-bottom: 7px; }
  #quest .quest-title { font-size: 12px; }
  #quest .quest-desc { font-size: 10px; }
  #menu { width: calc(100% - 16px); gap: 3px; justify-content: center; }
  #menu button, #menu button:nth-child(n) { flex: 1; min-width: 0; width: auto; height: 53px; border-radius: 8px; font-size: 20px; }
  #menu button span { font-size: 7px; }
  #chat { width: 190px; bottom: 75px; }
  #chat-log { height: 48px; font-size: 10px; }
  #drive-hud { top: 235px; width: 184px; }
}
@media (max-height: 600px) {
  #chat-log { height: 35px; }
  #quest.open { max-height: calc(100dvh - 275px); overflow-y: auto; }
  #hud-stats { padding-top: 8px; padding-bottom: 8px; }
}
@media (max-width: 380px) {
  #hud-stats { width: 166px; }
  .hud-top { grid-template-columns: 1fr; }
  #hud-level { position: absolute; right: 0; top: -3px; font-size: 7px; }
  .citizen-label { max-width: 70px; }
  #quest, #quest.open { width: 126px; }
  .hud-money { flex-direction: column; align-items: flex-start; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  #menu button, #chat, #chat-log, #chat-input { transition: none; }
}

#chat-send { background: linear-gradient(#d9aa60, #b5803f); color: #3a2a17; border: 1px solid #8b7953; border-radius: 7px; }
#chat.idle:not(:hover):not(:focus-within) #chat-send { opacity: .85; }

/* ---------- Lịch thị trấn (phần 23) ---------- */
#hud-clock { cursor: pointer; }
.almanac-today { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.almanac-big { font-family: var(--display); font-size: 54px; font-weight: 900; line-height: 1; color: #a0503a; min-width: 74px; text-align: center; border: 2px solid #d7c39c; border-radius: 14px; padding: 8px 10px; background: #fff8e8; }
.almanac-today small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.almanac-banner { background: #fbe6c8; border: 1px solid #e3b877; border-radius: 10px; padding: 8px 12px; color: #7a4b22; }
.almanac-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0 4px; }
.almanac-head { text-align: center; font-weight: 800; font-size: 12px; color: var(--muted); }
.almanac-cell { min-height: 46px; border: 1px solid #e0d2b4; border-radius: 8px; padding: 4px 6px; background: #fdf6e6; display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; overflow: hidden; }
.almanac-cell.blank { border: 0; background: transparent; }
.almanac-cell.festival { background: #fde3c4; border-color: #e8b27d; }
.almanac-cell.today { outline: 2px solid #c8794a; background: #fff1cf; }
.almanac-cell span { font-size: 12px; min-height: 15px; white-space: nowrap; }

/* ---------- Sổ tay tài chính (phần 24) ---------- */
.ledger .good, .receipt .good, .amt-in { color: #2f7d4f; }
.ledger .bad, .receipt .bad, .amt-out { color: #b3402f; }
.amt-bank { color: #c2681f; }
.amt-move { color: var(--muted); }
.ledger p.good { margin: 8px 0; font-weight: 700; }
.ledger-card { margin-bottom: 12px; }
.ledger-card h3 { margin-bottom: 4px; }
.ledger-pie-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ledger-pie { width: 110px; height: 110px; border-radius: 50%; flex: none; border: 3px solid #fff8e8; box-shadow: 0 0 0 1px #d7c39c; }
.ledger-legend { display: grid; gap: 4px; font-size: 13px; }
.ledger-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.ledger-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; border: 1px solid #e0d2b4; background: #f6e7c9; margin-bottom: 5px; cursor: pointer; font: inherit; color: inherit; }
.ledger-row:hover { background: #fbefd2; }
.ledger-row .item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ledger-row small { color: var(--muted); }
.ledger-row > b { white-space: nowrap; font-size: 13px; }
.ledger-search { margin: 8px 0; }
.ledger-search input { flex: 1; min-width: 160px; padding: 7px 10px; border-radius: 9px; border: 1px solid #d7c39c; background: #fffaf0; font: inherit; }
.receipt { position: relative; background: #fffdf5; border: 1px dashed #c9b48a; border-radius: 10px; padding: 14px 16px; }
.receipt-head { text-align: center; border-bottom: 1px dashed #c9b48a; padding-bottom: 8px; margin-bottom: 8px; display: grid; gap: 2px; }
.receipt-head small { color: var(--muted); }
.receipt-row { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border-bottom: 1px dotted #e3d6b8; font-size: 13.5px; }
.receipt-row span { color: var(--muted); flex: none; }
.receipt-row b { text-align: right; }
.receipt-row.total { font-size: 16px; border-bottom: 2px solid #c9b48a; }
.receipt-stamp { position: absolute; right: 18px; bottom: 54px; transform: rotate(-12deg); border: 3px solid #c0392b; color: #c0392b; border-radius: 8px; padding: 4px 12px; font-weight: 900; letter-spacing: 2px; opacity: .55; pointer-events: none; }

/* ---------- Đếm ngược giao thừa (phần 23.3) ---------- */
.countdown { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); z-index: 40; pointer-events: none; font-family: "Be Vietnam Pro", "Segoe UI", sans-serif; font-weight: 800; font-size: clamp(72px, 16vw, 160px); line-height: 1; color: #fff7e0; text-shadow: 0 0 18px rgba(255, 196, 64, 0.85), 0 6px 0 rgba(122, 59, 28, 0.6); animation: countdown-pop 0.5s ease-out infinite alternate; }
.countdown.hidden { display: none; }
@keyframes countdown-pop { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.08); } }

/* ---------- Chung cư Bình Minh (phần 16.3) ---------- */
.apt-floor { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.apt-units { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.apt-unit { display: grid; gap: 1px; padding: 5px 2px; border-radius: 8px; border: 1px solid #c9d6dc; background: #f3f8f9; font: inherit; font-size: 12px; cursor: pointer; }
.apt-unit small { font-size: 10px; color: #6b7c84; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apt-unit.sold { background: #e9e4dc; color: #8a8278; cursor: default; }
.apt-unit.mine { background: #d8f0df; border-color: #4f9a6a; font-weight: 700; }
.apt-unit:not(:disabled):hover { background: #e0f0f4; }
@media (max-width: 720px) { .apt-floor { grid-template-columns: 1fr; } .apt-units { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- Cuối game cho giới siêu giàu (phần 20) ---------- */
.endgame-panel .item-main small { display: block; margin-top: 2px; }
.endgame-panel .item-row.active { background: #fff1c9; border-radius: 10px; }
.endgame-panel .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 6px 0; }
.endgame-panel .form-grid label { display: grid; gap: 3px; font-size: 12.5px; }

/* ---------- Thời trang (phần 21) ---------- */
.fashion-shop { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.fashion-stage { position: sticky; top: 0; display: grid; gap: 6px; justify-items: center; }
.fashion-preview { width: 260px; height: 330px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #fffaf0, #efe2c6); cursor: grab; touch-action: none; }
.fashion-preview:active { cursor: grabbing; }
.fashion-caption { text-align: center; font-size: 12.5px; min-height: 2.4em; }
.fashion-list .item-row.active { background: #fff1c9; border-radius: 10px; }
@media (max-width: 720px) { .fashion-shop { grid-template-columns: 1fr; } .fashion-stage { position: static; } }

/* ---------- Bày nội thất (phần 18.1) ---------- */
.decor-editor { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
.decor-plan svg { width: 100%; height: auto; display: block; border-radius: 10px; cursor: crosshair; touch-action: none; }
.decor-plan .decor-item { cursor: pointer; }
.decor-side, .decor-side-inner { display: grid; gap: 8px; align-content: start; }
.decor-side .chip { text-align: left; }
.decor-stock { display: flex; gap: 6px; align-items: center; }
.decor-stock .chip { flex: 1; min-width: 0; }
.decor-stock .btn { flex: none; padding: 5px 9px; }
.wardrobe-picker { display: grid; gap: 8px; margin-bottom: 10px; }
.wardrobe-picker .look-row { display: flex; align-items: center; gap: 10px; }
.wardrobe-picker .look-row > span { width: 44px; font-weight: 700; }
.wardrobe-picker .swatch.active { box-shadow: 0 0 0 3px #a8793f; }
@media (max-width: 720px) { .decor-editor { grid-template-columns: 1fr; } }

/* ---------- Bánh xe cảm xúc (phần 22.4) ---------- */
.emote-wheel { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(30, 20, 10, .28), rgba(30, 20, 10, 0) 60%); }
.emote-ring { position: relative; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 248, 232, .9); box-shadow: 0 12px 34px rgba(40, 24, 10, .35), inset 0 0 0 2px #d7c39c; }
.emote-item { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; border: 2px solid #e2d2ad; background: #fffaf0; display: grid; place-items: center; align-content: center; gap: 0; cursor: pointer; padding: 0; transition: transform .12s, background .12s; }
.emote-item .emote-icon { font-size: 25px; line-height: 1; }
.emote-item small { font-size: 10px; color: #8a7558; font-weight: 700; }
.emote-item.active, .emote-item:hover { background: #ffe9b3; border-color: #d4a640; transform: translate(-50%, -50%) scale(1.14); }
.emote-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 120px; text-align: center; font-weight: 800; color: #5b3a1e; font-size: 14px; }
.emote-hint { position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 10px; background: rgba(54, 36, 16, .85); color: #fff3d6; font-size: 12.5px; white-space: nowrap; }
@media (max-width: 420px) { .emote-ring { transform: scale(.86); } .emote-hint { white-space: normal; width: calc(100vw - 32px); text-align: center; } }
@media (prefers-reduced-motion: reduce) { .emote-item { transition: none; } }

/* ---------- Ví da công dân (phần 19.2) ---------- */
.wallet { display: grid; gap: 12px; }
.wallet-slots { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-radius: 14px; background: linear-gradient(135deg, #7a4a2b, #5b3520); box-shadow: inset 0 0 0 2px #a8724a, inset 0 0 0 5px #5b3520, inset 0 0 0 6px #c99a6b; }
.wallet-slot { border: 1px dashed #e8c79c; background: #6b3f24; color: #fbe9d0; border-radius: 9px; padding: 6px 11px; font-weight: 700; font-size: 12.5px; line-height: 1.2; cursor: pointer; }
.wallet-slot.active { background: #fbe9d0; color: #5b3520; border-style: solid; }
.wallet-view { display: flex; justify-content: center; padding: 6px 0; }
.doc-card { position: relative; width: min(520px, 100%); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 26px rgba(40, 24, 10, .28); overflow: hidden; color: #2c2218; }
.doc-head { display: grid; gap: 1px; text-align: center; margin-bottom: 10px; }
.doc-head b { letter-spacing: .06em; font-size: 14px; }
.doc-head small { color: #6d5a45; font-size: 11.5px; }
.doc-body { display: flex; gap: 14px; align-items: flex-start; }
.doc-fields { display: grid; gap: 6px; flex: 1; min-width: 0; }
.doc-field small { display: block; font-size: 10.5px; color: #6d5a45; text-transform: uppercase; letter-spacing: .04em; }
.doc-field b { font-size: 14px; overflow-wrap: anywhere; }
.doc-photo { position: relative; flex: none; width: 74px; height: 92px; border-radius: 8px; overflow: hidden; background: #c9d6e2; border: 2px solid #fff; box-shadow: 0 0 0 1px #8d9bab; }
.doc-photo i { display: block; position: absolute; }
.doc-photo .portrait-face { top: 22px; left: 22px; }
.doc-photo .portrait-hair { top: 16px; left: 19px; }
.doc-photo .portrait-shirt { top: 48px; left: 19px; height: 44px; }
.doc-qr { flex: none; display: grid; grid-template-columns: repeat(9, 7px); gap: 1px; padding: 4px; background: #fff; border-radius: 4px; align-self: flex-end; }
.doc-qr i { width: 7px; height: 7px; background: #f1f1f1; }
.doc-qr i.on { background: #1d1d1d; }
.doc-id { background: linear-gradient(140deg, #f4f8fb 0%, #dfeaf3 55%, #f7efe0 100%); border: 1px solid #b7c6d3; }
.doc-id .doc-head b { color: #8a1c14; }
.doc-chip { position: absolute; right: 18px; top: 16px; width: 34px; height: 26px; border-radius: 5px; background: linear-gradient(135deg, #e8cf7e, #b8963a); box-shadow: inset 0 0 0 1px #8f7228, inset 10px 0 0 -9px #8f7228, inset -10px 0 0 -9px #8f7228; }
.doc-driver { background: repeating-linear-gradient(120deg, #f6e7a6 0 14px, #f1dd91 14px 28px); border: 1px solid #c8ad57; }
.doc-driver .doc-head b { color: #7a1f14; }
.doc-land { background: #fdf3e6; border: 10px solid #9e1b12; border-radius: 10px; }
.doc-land .doc-head b { color: #9e1b12; font-size: 13px; }
.doc-emblem { display: inline-grid; place-items: center; justify-self: center; width: 34px; height: 34px; border-radius: 50%; background: #c8102e; color: #ffd84d; font-size: 18px; box-shadow: 0 0 0 2px #d9b44a; }
.doc-plot { flex: none; }
.doc-sign { position: relative; display: grid; justify-items: end; align-content: end; gap: 2px; margin-top: 14px; padding-right: 8px; min-height: 84px; }
.doc-sign small { color: #6d5a45; font-size: 11px; }
.doc-sign i { font: italic 600 18px/1.2 'Segoe Script', 'Brush Script MT', cursive; color: #1d3c7a; }
.doc-stamp { position: absolute; right: 96px; bottom: 2px; transform: rotate(-14deg); border: 3px double #c0392b; color: #c0392b; border-radius: 50%; box-sizing: border-box; width: 80px; height: 80px; padding: 6px; display: grid; place-items: center; font-weight: 900; font-size: 8.5px; line-height: 1.15; text-align: center; opacity: .78; }
.doc-permit, .doc-paper { background: #fffdf6; border: 1px solid #d6c7a6; background-image: linear-gradient(#efe5cf 1px, transparent 1px); background-size: 100% 26px; }
.doc-permit .doc-head b, .doc-paper .doc-head b { color: #7a3b16; }
.doc-bhyt { background: linear-gradient(135deg, #e9f6ff, #cfe8f7); border: 1px solid #8fb8d6; }
.doc-bhyt .doc-head b { color: #0e5c8f; }
/* Nhượng quyền thương hiệu trong bàn đăng ký thương hiệu (phần 18.3). */
.franchise-box { display: grid; gap: 4px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed #c9a96e; background: #fffaf0; }
.franchise-box .row.wrap label.field { flex: 1; min-width: 150px; }
/* Menu chuột phải lên người chơi khác (phần 19.2). */
.player-menu { position: fixed; z-index: 40; display: grid; gap: 4px; min-width: 170px; padding: 8px; border-radius: 12px;
  background: linear-gradient(145deg, #514533f8, #302b22f8); border: 2px solid #3a3024; outline: 1px solid #a78d5d90; box-shadow: 0 8px 24px #1a150f66; }
.player-menu b { color: #f1dfb6; font-size: 13px; padding: 2px 6px 6px; border-bottom: 1px solid #a78d5d60; }
.player-menu button { text-align: left; padding: 7px 10px; border-radius: 8px; border: 1px solid #382e22; background: linear-gradient(#61543e, #3e3529); color: #f1dfb6; font: inherit; font-size: 13px; cursor: pointer; }
.player-menu button:hover:not(:disabled) { background: linear-gradient(#d9aa60, #b5803f); color: #3a2a17; }
.player-menu button:disabled { opacity: .5; cursor: not-allowed; }
/* GP4 chứng nhận ATTP (viền xanh y tế), GP7 cà-vẹt xe (thẻ xanh dương nhạt), GP5 trang bổ sung sổ hồng. */
.doc-attp { border-left: 6px solid #2e8b57; }
.doc-attp .doc-head b { color: #1f6b43; }
.doc-vehicle { background: linear-gradient(135deg, #eef4ff, #d9e6fb); border: 1px solid #9fb6dc; }
.doc-vehicle .doc-head b { color: #1d3c7a; }
.doc-history { display: grid; gap: 3px; margin-top: 10px; padding: 8px 10px; border-top: 1px dashed #c9a27a; color: #5a2a1a; font-size: 12px; }
.doc-history small { color: #8a6a4a; font-size: 11px; }
.doc-mortgage { color: #8a1c14; font-weight: 700; }
.wallet-show { border-top: 1px dashed #d7c39c; padding-top: 8px; }
.declare-box { margin: 10px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #d7c39c; background: #fffaf0; }
.declare-box .row input { flex: 1; min-width: 140px; padding: 7px 10px; border-radius: 9px; border: 1px solid #d7c39c; font: inherit; }
@media (max-width: 560px) { .doc-body { flex-wrap: wrap; } .doc-qr { display: none; } .doc-stamp { right: 40px; } }

/* ---------- Giao dịch giữa người chơi, hòm thư, loa phường ---------- */
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trade-side { border: 2px solid #d7c39c; border-radius: 12px; padding: 10px 12px; background: #fffaf0; min-height: 150px; }
.trade-side.locked { border-color: #e0a800; background: #fff3c4; }
.trade-side h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 0; }
.trade-tag { font-size: 12px; font-weight: 800; color: #8a5a00; background: #ffe08a; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.trade-invite { position: fixed; left: 50%; top: 96px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: #fffaf0; border: 2px solid #c9b48a; box-shadow: 0 8px 24px rgba(60, 40, 10, .28); font-weight: 700; }
.mail-note { display: block; font-style: italic; color: #7a5a2a; }
.radio-banner { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 29; /* dưới hộp thoại (30) để không che bảng đang mở */ width: min(640px, calc(100vw - 620px)); padding: 10px 16px; border-radius: 14px; background: rgba(54, 36, 16, .9); color: #fff3d6; border: 1px solid rgba(255, 220, 150, .5); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); pointer-events: none; animation: radio-in .5s ease-out; }
.radio-banner p { margin: 3px 0; font-size: 13.5px; line-height: 1.45; }
@keyframes radio-in { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 640px) { .trade-grid { grid-template-columns: 1fr; } }
/* Màn hình hẹp: bản tin nằm dưới thẻ nhân vật và bản đồ nhỏ để không che HUD. */
@media (max-width: 1180px) { .radio-banner { left: 16px; top: 250px; transform: none; animation: none; width: min(640px, calc(100vw - 340px)); min-width: 260px; } }
@media (prefers-reduced-motion: reduce) { .radio-banner { animation: none; } }

/* ---------- Pháo hoa giao thừa ---------- */
.fireworks { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.fireworks i { position: absolute; font-style: normal; opacity: 0; animation: firework 2.6s ease-out 3; }
.fireworks-title { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); font: 900 34px/1.2 var(--display); color: #fff3c4; text-shadow: 0 2px 0 #7a3b1c, 0 0 18px rgba(255, 196, 86, .9); white-space: nowrap; animation: firework-title 9s ease-out forwards; }
@keyframes firework { 0% { opacity: 0; transform: translateY(60px) scale(.2); } 25% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-20px) scale(1.5); } }
@keyframes firework-title { 0% { opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fireworks i { animation: none; opacity: .8; } }

/* Hòm thư góp ý */
.feedback > .row.wrap { margin: 10px 0 6px; gap: 6px; }
.modal-body textarea.feedback-text { font: 14px/1.55 "Be Vietnam Pro", "Segoe UI", sans-serif; min-height: 150px; margin-top: 6px; }
.feedback label.row { gap: 6px; align-items: center; margin: 8px 0 2px; cursor: pointer; }
/* ⚙️ Cài đặt: độ nét hình */
.settings-panel h3 { margin: 2px 0 8px; font-size: 15px; }
.settings-options { display: grid; gap: 8px; }
.settings-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 10px 13px; border: 1px solid #dfcaa0; border-radius: 13px; background: #fbf3e2; color: #5c4428; font: inherit; cursor: pointer; }
.settings-opt b { font-size: 14px; }
.settings-opt b small { font-weight: 600; color: var(--muted); }
.settings-opt span { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.settings-opt:hover { background: #f5e6c8; }
.settings-opt.active { background: #e6ecd2; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.settings-opt.active b::after { content: " ✓"; color: var(--accent); }
.settings-status { margin: 12px 0 4px; padding: 9px 12px; border-radius: 11px; background: #f7efdd; font-size: 13px; line-height: 1.5; }
.settings-status p { margin: 2px 0; }
.settings-status .settings-warn { color: #a3482f; font-weight: 600; }
.settings-status p.muted { font-size: 12px; overflow-wrap: anywhere; }
