/* ==========================================================================
 * SOCIAL — Chat thế giới · Tin nhắn · Bạn bè · Thăm tiệm
 * Cùng họ màu với game: nền giấy kem, khung viền mực như các modal khác, tiêu đề vàng, nút .btn (viền mảnh + gờ 3D cùng tông).
 * Mỗi mục có màu nhấn riêng: THẾ GIỚI = xanh dương · TIN NHẮN = cam vàng · BẠN BÈ = xanh lá.
 * Mobile portrait là ưu tiên: mỗi lúc một màn, composer dính đáy và nâng theo bàn phím ảo.
 * ========================================================================== */
/* Nút Chat nằm góc phải dưới, xếp ngay trên nút "về giữa quán" (#zoom-ctrl) để không đè HUD phía trên */
#btn-chat { position: fixed; z-index: 19; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(#fffaf0, #ffe7b8); border: 1.5px solid #cfa862; border-radius: 12px; box-shadow: 0 3px 0 #a87d3c, inset 0 1px 0 #fff; }
#btn-chat .pxi { height: 20px; } #btn-chat:active { transform: translateY(2px); box-shadow: 0 1px 0 #a87d3c; }
#btn-chat.offline { opacity: .55; }
.sc-badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff; font: 800 11px/17px var(--font); font-style: normal; text-align: center; border: 2px solid #fff; box-shadow: 0 2px 0 #8f1d1b; animation: scPulse .6s ease-out 1; }
.sc-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.sc-dot.world { top: -4px; right: -4px; background: #2f8fe8; }
.sc-dot.friend { bottom: -4px; right: -4px; background: #ffcf33; }
@keyframes scPulse { from { transform: scale(1.6); } to { transform: scale(1); } }

#social { --paper: #f8ecd0; --paper2: #f0dcb2; --card: #fffaf0; --line: #e2cf9f; --line2: #cdb079; --ink: #2a1c1c; --ink2: #5a4a3a; --mute: #7a6a5a;
  --acc: #2f8fe8; --acc-d: #1c6fbf; --acc-soft: #dcefff; --acc-line: #8cc4f5; --danger: #d33a34; --gold: #ffcf33;
  position: fixed; inset: 0; z-index: 60; color: var(--ink); font-family: var(--font); -webkit-user-select: text; user-select: text; touch-action: pan-x pan-y; }
#social[hidden] { display: none; }
#social [hidden] { display: none !important; }
#social button, #social input, #social textarea, #social select { font-family: var(--font); }
/* iOS Safari tự phóng trang khi focus vào trường nhập có chữ dưới 16px. */
#social input, #social textarea, #social select { font-size: 16px; }
#social *:focus-visible { outline: 3px solid #ff8f1f; outline-offset: 2px; }
.sc-backdrop { position: absolute; inset: 0; background: rgba(42, 28, 28, .55); animation: fadein .18s; }
.sc-panel[data-nav="world"] { --acc: #2f8fe8; --acc-d: #1c6fbf; --acc-soft: #dcefff; --acc-line: #8cc4f5; }
.sc-panel[data-nav="dm"] { --acc: #ff9f1c; --acc-d: #c7600a; --acc-soft: #fff0c2; --acc-line: #f2cf6a; }
.sc-panel[data-nav="friends"] { --acc: #4caf50; --acc-d: #2f8034; --acc-soft: #dff6df; --acc-line: #8fd394; }
.sc-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(940px, calc(100vw - 24px)); height: min(82vh, 660px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink), 0 22px 50px rgba(0, 0, 0, .45); animation: popin .22s cubic-bezier(.2, 1.4, .5, 1); }

.sc-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; background: linear-gradient(#ffe777, #ffcf33); border-bottom: 3px solid var(--ink); }
.sc-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.sc-title h2 { margin: 0; font: 800 21px var(--display); letter-spacing: .3px; color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-conn { font-size: 11px; font-weight: 700; color: #7a5a1a; white-space: nowrap; }
.sc-conn[data-state="online"] { color: #1f7a34; } .sc-conn[data-state="offline"], .sc-conn[data-state="error"] { color: #c2352f; }
.sc-head-actions { display: flex; align-items: center; gap: 6px; }
.sc-iconbtn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; border: 1.5px solid #cfa862; background: linear-gradient(#fffaf0, #ffe7b8); box-shadow: 0 3px 0 #a87d3c, inset 0 1px 0 #fff; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.sc-iconbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a87d3c; } .sc-iconbtn .pxi { height: 14px; }
.sc-back { font-size: 26px; padding-bottom: 3px; font-weight: 800; }

.sc-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 9px 10px 8px; background: var(--paper2); border-bottom: 2px solid var(--line2); }
.sc-tabs button { position: relative; min-height: 44px; border: 1.5px solid var(--line2); border-radius: 12px; background: #fff; color: var(--ink2); font: 800 13px var(--display); letter-spacing: .5px; cursor: pointer; box-shadow: 0 3px 0 var(--line2); }
.sc-tabs button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line2); }
.sc-tabs button.on { color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.sc-tabs button[data-nav="world"].on { background: linear-gradient(#59b1f7, #2f8fe8); border-color: #1c6fbf; box-shadow: 0 3px 0 #185e9f; }
.sc-tabs button[data-nav="dm"].on { background: linear-gradient(#ffc04d, #ff9f1c); border-color: #c7600a; box-shadow: 0 3px 0 #a94f06; }
.sc-tabs button[data-nav="friends"].on { background: linear-gradient(#6fcb73, #43a047); border-color: #2f8034; box-shadow: 0 3px 0 #276b2c; }
.sc-tab-badge { display: inline-block; min-width: 19px; height: 19px; margin-left: 6px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff; font: 800 11px/16px var(--font); font-style: normal; vertical-align: 1px; border: 2px solid #fff; }
.sc-tab-badge.dot { min-width: 11px; width: 11px; height: 11px; padding: 0; background: #2f8fe8; vertical-align: 3px; }
.sc-tabs button[data-nav="friends"] .sc-tab-badge.dot { background: #ffcf33; border-color: #fff; }
.sc-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; background: #fff0b8; color: #6b4a00; font-size: 12.5px; font-weight: 600; border-bottom: 2px solid #f0cf6a; }

.sc-main { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sc-list { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--paper2); border-right: 2px solid var(--line2); }
.sc-stage { min-height: 0; min-width: 0; position: relative; background: var(--paper); }
.sc-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; font: 800 13px var(--display); color: var(--ink2); letter-spacing: .5px; text-transform: uppercase; }
.sc-cap { font-size: 12px; color: var(--mute); }
.sc-list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 10px; overscroll-behavior: contain; }
.sc-sec { padding: 10px 6px 4px; font: 800 11px var(--display); letter-spacing: .6px; color: var(--mute); text-transform: uppercase; }
.sc-sec.hot { color: #c7600a; } .sc-sec.toggle { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; }
.sc-row-item { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; min-height: 58px; padding: 7px 9px; margin: 4px 0; text-align: left; color: var(--ink); background: #fffaf0; border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 2px 0 var(--line); cursor: pointer; }
.sc-row-item:hover { background: #fff6d8; border-color: var(--line2); } .sc-row-item.on { background: var(--acc-soft); border-color: var(--acc); box-shadow: 0 2px 0 var(--acc-line); }
.sc-row-item.unread { border-color: #ffb54d; background: #fffaf0; } .sc-row-item.unread b { color: #000; }
.sc-ri-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sc-ri-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sc-ri-main small { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-ri-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; } .sc-ri-side time { font-size: 10.5px; color: var(--mute); }
.sc-quick { display: flex; flex-direction: row; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sc-ub { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff; font: 800 11px/17px var(--font); font-style: normal; text-align: center; border: 2px solid #fff; }
.sc-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #f2e6c8; color: var(--ink2); } .sc-tag.hot { background: #ffd76a; color: #6b4a00; }
em.pin { font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; margin-left: 4px; border-radius: 6px; background: #ffe08a; color: #7a4a00; }
.sc-av { flex: 0 0 auto; display: inline-grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: 10px; background: hsl(var(--h) 75% 62%); border: 2px solid hsl(var(--h) 55% 38%); color: #fff; font: 800 16px var(--display); text-shadow: 0 1px 0 rgba(0, 0, 0, .3); box-shadow: 0 2px 0 hsl(var(--h) 55% 38%); }
.sc-av.big { width: 62px; height: 62px; font-size: 28px; border-radius: 14px; }
.sc-av img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; border-radius: inherit; }
.sc-av.custom img { object-fit: cover; image-rendering: auto; }
.sc-pres { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #b8a98a; vertical-align: 1px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #b8a98a; }
.sc-pres.online { background: #43c463; box-shadow: 0 0 0 1px #1f8a3a; } .sc-pres.active { background: #ffb31f; box-shadow: 0 0 0 1px #c78400; } .sc-pres.hidden { background: #fff; }
.sc-lv { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 6px; background: #ffe08a; color: #7a4a00; font: 800 10px/16px var(--font); }
.sc-search { display: flex; gap: 6px; padding: 4px 10px 8px; } .sc-search input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line2); background: #fff; color: var(--ink); font-size: 14px; }
.sc-search input:focus { border-color: var(--acc); outline: none; }
.sc-mycode { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; border-top: 2px solid var(--line2); font-size: 12px; color: var(--ink2); background: #e9d3a3; } .sc-mycode b { color: var(--ink); letter-spacing: 1px; }
.sc-worldinfo p { margin: 6px 8px; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.sc-avbtn { padding: 0; border: 0; background: none; cursor: pointer; flex: 0 0 auto; } .sc-av-gap { width: 36px; flex: 0 0 auto; }

.sc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px 18px; text-align: center; color: var(--mute); font-size: 13px; }
.sc-empty b { color: var(--ink); font: 800 16px var(--display); } .sc-empty.big { height: 100%; }
.sc-skel { display: grid; gap: 10px; padding: 16px 14px; } .sc-skel i { display: block; height: 46px; border-radius: 12px; background: linear-gradient(90deg, #f3e6c8, #fbf1d6, #f3e6c8); background-size: 200% 100%; animation: scSkel 1.2s linear infinite; }
@keyframes scSkel { to { background-position: -200% 0; } }

/* ---- hội thoại ---- */
.sc-chat { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sc-chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 2px solid var(--acc-line); background: var(--acc-soft); min-height: 56px; }
.sc-chat-head.world b { font: 800 16px var(--display); color: var(--ink); } .sc-chat-head small { display: block; color: var(--ink2); font-size: 12px; }
.sc-head-info { flex: 1; min-width: 0; } .sc-head-info b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sc-head-btns { display: flex; gap: 5px; }
.sc-reqbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff0b8; color: #6b4a00; font-size: 12.5px; font-weight: 600; border-bottom: 2px solid #f0cf6a; }
.sc-timeline { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 3px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background-color: #f3e3bf; background-image: radial-gradient(#e3cd9a 1.3px, transparent 1.3px); background-size: 20px 20px; }
.sc-day { display: flex; justify-content: center; margin: 10px 0 6px; } .sc-day span { padding: 2px 12px; border-radius: 10px; background: #f6e7bf; color: var(--ink2); font-size: 11px; font-weight: 700; }
.sc-older { align-self: center; margin: 2px 0 8px; padding: 6px 14px; border-radius: 12px; border: 1.5px solid var(--line2); background: #fff; color: var(--ink2); font-size: 12px; font-weight: 700; box-shadow: 0 2px 0 var(--line2); cursor: pointer; min-height: 36px; }
.sc-keep { align-self: center; margin: 2px 0 8px; font-size: 11px; color: var(--ink2); opacity: .75; }
.sc-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; margin-top: 8px; } .sc-msg.cont { margin-top: 0; }
.sc-msg.mine { flex-direction: row-reverse; }
.sc-bubble { position: relative; min-width: 0; max-width: min(78%, 560px); padding: 6px 30px 6px 11px; background: #fffaf0; border: 1.5px solid var(--line2); border-radius: 4px 14px 14px 14px; box-shadow: 0 2px 0 var(--line2); }
.sc-msg.mine .sc-bubble { background: var(--acc-soft); border-color: var(--acc-line); border-radius: 14px 4px 14px 14px; box-shadow: 0 2px 0 var(--acc-line); }
.sc-msg.local.sending .sc-bubble, .sc-msg.local.queued .sc-bubble { opacity: .7; } .sc-msg.local.failed .sc-bubble { border-color: var(--danger); background: #ffe8e6; }
.sc-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-bottom: 2px; }
.sc-name { padding: 0; border: 0; background: none; color: #1c5f9f; font: 800 13px var(--display); cursor: pointer; } .sc-name:hover { text-decoration: underline; }
.sc-meta time { margin-left: auto; font-size: 10.5px; color: var(--mute); }
.sc-text { font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: var(--ink); } .sc-text.gone { color: var(--mute); font-style: italic; }
/* tin chỉ có emoji: hiện to như sticker, không khung */
.sc-msg.sticker .sc-bubble { background: transparent; border-color: transparent; box-shadow: none; padding: 0 6px; }
.sc-msg.sticker .sc-meta time { margin-left: 8px; } .sc-msg.sticker.mine .sc-bubble { background: transparent; }
.sc-text.big { font-size: 46px; line-height: 1.15; letter-spacing: 2px; animation: scPop .4s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .12)); }
@keyframes scPop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.sc-att { margin-top: 4px; }
/* Tin rao có giá và số lượng rõ ràng; thẻ chỉ mở chi tiết mua từ server. */
.sc-msg.market .sc-bubble { width: 320px; padding: 8px; }
.sc-msg.market .sc-meta { margin-bottom: 6px; padding-right: 22px; }
.sc-msg.market .sc-name { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.sc-msg.market .sc-att { margin-top: 0; }
.sc-msg.market .sc-text { margin-bottom: 6px; }
.sx-market { width: 100%; max-width: 100%; padding: 8px; border: 1.5px solid #b5a77a; border-radius: 10px; background: #fffaf0; color: var(--ink); }
.sx-market-head { display: flex; align-items: center; gap: 8px; }
.sx-market-head > div { flex: 1; min-width: 0; }
.sx-market-head b { display: block; margin: 2px 0; font: 800 14px/1.3 var(--display); overflow-wrap: anywhere; }
.sx-market-head span { color: var(--ink2); font-size: 12px; }
.sx-market-art { flex: 0 0 auto; width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.sx-market-status { padding: 2px 6px; border-radius: 5px; background: #ece4d4; color: #736b5b; font-size: 11px; font-weight: 700; }
.sx-market-status.active { background: #deefdb; color: #316636; }
.sx-market-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-top: 7px; padding: 6px 8px; border: 1px solid #e2d8bc; border-radius: 8px; background: #fff; }
.sx-market-offer small { display: block; font-size: 10.5px; color: var(--mute); }
.sx-market-offer b { display: block; font: 800 16px/1.35 var(--display); color: #7c4b11; }
.sx-market-stock { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; font-weight: 700; color: var(--ink2); }
.sx-market .sx-market-open { width: 100%; min-height: 44px; margin-top: 7px; }
.sc-more { position: absolute; top: 2px; right: 2px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--mute); font-size: 18px; font-weight: 800; cursor: pointer; opacity: 0; } .sc-bubble:hover .sc-more, .sc-more:focus-visible { opacity: 1; }
@media (hover: none) { .sc-more { opacity: .7; } }
.sc-state { font-size: 11px; color: var(--mute); } .sc-state:empty { display: none; } .sc-st.bad { color: var(--danger); font-weight: 700; } .sc-st.seen { color: #2a8a3e; font-weight: 700; }
.sc-link { padding: 0 2px; border: 0; background: none; color: #1c6fbf; text-decoration: underline; font-size: 11.5px; font-weight: 700; cursor: pointer; min-height: 30px; }
.sc-msg.fly .sc-att { animation: scFly .32s ease-out; } @keyframes scFly { from { transform: translateY(24px); opacity: 0; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sc-newpill { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); padding: 8px 16px; border-radius: 16px; border: 1.5px solid #1664ad; background: linear-gradient(#45a5f5, #1c79cf); color: #fff; font: 800 13px var(--font); box-shadow: 0 3px 0 #115291, 0 6px 14px rgba(0, 0, 0, .3); cursor: pointer; z-index: 3; }

/* ---- composer ---- */
.sc-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #e9d3a3; border-top: 2px solid #c9ab6c; }
.sc-composer.off { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 14px; color: var(--ink2); font-size: 13px; font-weight: 600; }
.sc-lockbar { margin-bottom: 8px; padding: 9px 12px; border-radius: 12px; border: 2px solid #ff8f5f; background: #ffe1d3; color: #7a2a0c; font-size: 13px; font-weight: 600; line-height: 1.4; animation: scShake .4s; }
.sc-lockbar b { color: #c2331f; } .sc-row textarea:disabled { background: #efe4cc; color: #9a8b70; cursor: not-allowed; } .sc-emoji:disabled { filter: grayscale(.8); opacity: .6; cursor: not-allowed; }
@keyframes scShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.sc-attachrow { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sc-attachrow:has(.sx-market-draft) { flex-wrap: wrap; }
.sc-attachrow .sx-market-draft { flex: 1; min-width: 0; }
.sc-ad-draft-note { flex-basis: 100%; color: #735922; font-size: 11px; line-height: 1.35; }
.sc-x2 { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line2); background: #fff; color: var(--ink); font-weight: 800; cursor: pointer; }
.sc-row { display: flex; align-items: flex-end; gap: 6px; }
.sc-plus, .sc-emoji { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; color: #fff; font: 800 24px/1 var(--font); cursor: pointer; }
.sc-plus { border: 1.5px solid #1664ad; background: linear-gradient(#45a5f5, #1c79cf); box-shadow: 0 3px 0 #115291; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.sc-emoji { border: 1.5px solid #cf9800; background: linear-gradient(#ffe066, #ffbf1a); box-shadow: 0 3px 0 #b07f00; font-size: 25px; }
.sc-emoji[aria-expanded="true"] { background: linear-gradient(#ffbf1a, #ffe066); transform: translateY(2px); box-shadow: 0 1px 0 #b07f00; }
.sc-plus:active { transform: translateY(2px); box-shadow: 0 1px 0 #115291; }
.sc-row textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; resize: none; padding: 10px 12px; border-radius: 12px; border: 2px solid #c9ab6c; background: #fffbf1; color: var(--ink); font-size: 16px; line-height: 1.35; }
.sc-row textarea::placeholder { color: #a8997c; } .sc-row textarea:focus { border-color: var(--acc); outline: none; }
.sc-send { flex: 0 0 auto; height: 44px; min-width: 62px; font-size: 14px; } .sc-count { align-self: center; font-size: 11px; color: var(--mute); } .sc-count.over { color: var(--danger); font-weight: 800; }

/* ---- khay emoji hề hước ---- */
.sc-emoji-tray { margin-bottom: 8px; max-height: min(240px, 34dvh); border: 2px solid #c9ab6c; border-radius: 14px; background: #fbf1da; overflow-y: auto; overscroll-behavior: contain; animation: sheetup .18s ease-out; }
.sc-et-tabs { position: sticky; top: 0; z-index: 1; display: flex; gap: 4px; padding: 6px 6px 4px; overflow-x: auto; scrollbar-width: none; background: #efdbae; border-bottom: 2px solid var(--line); }
.sc-et-tabs button { flex: 0 0 auto; min-width: 44px; height: 40px; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 21px; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.sc-et-tabs button.on { background: #ffe08a; border-color: #e0a72a; box-shadow: 0 2px 0 #c28a10; }
.sc-et-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 2px; max-height: 176px; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.sc-et-grid button { height: 44px; border: 0; border-radius: 10px; background: transparent; font-size: 27px; line-height: 1; cursor: pointer; }
.sc-et-grid button:hover, .sc-et-grid button:active { background: #ffe9a8; transform: scale(1.12); }
.sc-et-grid.stickers { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; } .sc-et-grid.stickers button { height: 64px; font-size: 34px; border: 1.5px solid var(--line); background: #fff; box-shadow: 0 2px 0 var(--line); }
.sc-et-grid.stickers button:hover { background: #fff3c9; border-color: #e0a72a; }
.sc-et-note { padding: 2px 10px 6px; font-size: 11px; color: var(--mute); font-weight: 600; } .sc-et-recent { padding: 2px 6px 0; font-size: 11px; font-weight: 800; color: var(--mute); text-transform: uppercase; }

/* ---- sheet ---- */
.sc-sheet-wrap { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(42, 28, 28, .5); animation: fadein .15s; }
.sc-sheet { width: min(480px, 100%); max-height: 90%; overflow-y: auto; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); background: #f8ecd0; color: var(--ink); border: 3px solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 0 rgba(42, 28, 28, .25), 0 -10px 30px rgba(0, 0, 0, .3); animation: sheetup .2s ease-out; }
.sc-sheet h3 { margin: 0 0 8px; font: 800 19px var(--display); color: var(--ink); } .sc-sheet p { margin: 6px 0; color: var(--ink2); font-size: 13px; line-height: 1.5; }
.sc-btnrow { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; } .sc-btnrow .btn { min-height: 40px; padding-left: 14px; padding-right: 14px; }
.sc-sheet.sc-compact-sheet { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.sc-compact-sheet .sc-sheet-head { flex: 0 0 auto; min-width: 0; margin: 0; padding: 10px 12px 8px; border-bottom: 1.5px solid var(--line2); background: #fff3d7; overflow-wrap: anywhere; }
.sc-compact-sheet .sx-top.sc-sheet-head { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; gap: 8px; }
.sc-compact-sheet .sc-sheet-head h3 { margin: 0; font-size: max(16px, calc(19px * var(--ui-scale, 1))); }
.sc-compact-sheet .sc-sheet-head .sc-iconbtn { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
.sc-compact-sheet .sc-sheet-form { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }
.sc-compact-sheet .sc-sheet-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; padding: 8px 12px; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 10px; }
.sc-compact-sheet .sc-sheet-foot { flex: 0 0 auto; margin: 0; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line2); background: #fff3d7; }
.sc-compact-sheet .sc-sheet-foot .btn { min-width: 44px; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.sc-compact-sheet .sc-sheet-foot .sc-err { flex: 1 0 100%; grid-column: 1 / -1; min-height: 0; margin: 0; }
.sc-compact-sheet .sc-sheet-foot .sc-err:empty { display: none; }
.sc-compact-sheet .sc-settings .btn { min-width: 44px; min-height: 44px; }
.sc-compact-sheet > .sc-menu-cancel { width: auto; margin: 8px 12px calc(10px + env(safe-area-inset-bottom)); min-height: 44px; }
.sc-form input[type="text"], .sc-form input:not([type]), .sc-form input[type="search"] { width: 100%; height: 44px; padding: 0 12px; margin-top: 6px; border-radius: 12px; border: 2px solid var(--line2); background: #fff; color: var(--ink); font-size: 15px; }
.sc-form input[type="text"]:focus, .sc-form input:not([type]):focus { border-color: var(--acc); outline: none; }
.sc-err { display: block; min-height: 16px; margin-top: 4px; color: var(--danger); font-size: 12px; font-weight: 700; }
.sc-form fieldset { margin: 12px 0 0; padding: 8px 10px 8px; border: 2px solid var(--line); border-radius: 14px; background: #fffdf5; min-width: 0; }
.sc-form legend { padding: 2px 10px; border-radius: 10px; background: #ffe08a; color: #7a4a00; font: 800 11.5px var(--display); text-transform: uppercase; letter-spacing: .4px; }
.sc-radio, .sc-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 5px 0; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.sc-radio input, .sc-check input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: #ff8f1f; cursor: pointer; }
.sc-radio span, .sc-check span { flex: 1; min-width: 0; line-height: 1.35; }
.sc-radio:has(input:checked), .sc-check:has(input:checked) { background: #fff0b8; border-color: #f0b21f; box-shadow: 0 2px 0 #e0a72a; }
.sc-check { margin-top: 8px; }
.sc-code { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fff3d7; border: 1.5px dashed #e0a72a; font-size: 13px; font-weight: 700; } .sc-code b { letter-spacing: 1.5px; color: #b45f06; font-size: 15px; }
.sc-namerow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 6px 10px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-size: 13px; } .sc-blockrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-size: 13px; font-weight: 600; }
.sc-settings .sc-hint { margin: 2px 4px 0; font-size: 11.5px; color: var(--mute); line-height: 1.4; }
.sc-menu { display: grid; gap: 6px; } .sc-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 8px 12px; text-align: left; border-radius: 12px; border: 1.5px solid var(--line2); background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: 0 2px 0 var(--line2); cursor: pointer; }
.sc-menu-item:active { transform: translateY(2px); box-shadow: none; } .sc-menu-item.danger { color: #c2352f; } .sc-menu-item small { color: var(--mute); }
.sc-menu-cancel { width: 100%; margin-top: 10px; min-height: 44px; }

/* ---- chọn và tải avatar ---- */
.sc-avatarsheet { width: min(540px, 100%); }
.sc-avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.sc-avatar-pick button { min-width: 0; aspect-ratio: 1; display: grid; place-items: center; padding: 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 2px 0 var(--line); cursor: pointer; }
.sc-avatar-pick button:hover { background: #fff6d8; border-color: var(--line2); }
.sc-avatar-pick button.on { border-color: #ff8f1f; background: #fff0b8; box-shadow: 0 2px 0 #e0a72a; }
.sc-av.pick { width: 44px; height: 44px; border: 0; box-shadow: none; background: transparent; }
.sc-av.preview { width: 76px; height: 76px; border-radius: 15px; }
.sc-community-note { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding: 9px 11px; border-radius: 12px; border: 1.5px solid #f0cf6a; background: #fff0b8; color: #6b4a00; font-size: 12px; line-height: 1.4; }

/* ---- hồ sơ ---- */
.sc-stage-scroll { height: 100%; overflow-y: auto; padding: 16px; }
.sc-profile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: 100%; min-width: 0; max-width: 520px; margin: 0 auto; padding: 14px; border-radius: 16px; border: 2px solid var(--line2); background: #fff; box-shadow: 0 3px 0 var(--line2); }
.sc-pf-head { display: flex; gap: 12px; align-items: flex-start; min-width: 0; } .sc-pf-head > .sc-fr { flex: 0 0 auto; } .sc-pf-head > div { flex: 1; min-width: 0; overflow-wrap: anywhere; } .sc-pf-head b { display: block; font: 800 21px/1.3 var(--display); } .sc-pf-head small { display: block; color: var(--ink2); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.sc-pf-meta { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; } .sc-pf-meta span { max-width: 100%; padding: 3px 10px; border-radius: 10px; background: #fff0b8; color: #6b4a00; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.sc-pf-actions, .sc-pf-more { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; } .sc-pf-actions .btn, .sc-pf-more .btn { min-height: 44px; min-width: 44px; max-width: 100%; padding: 6px 12px; white-space: normal; overflow-wrap: anywhere; }
.sc-quick .sc-heart, .sc-pf-actions .sc-heart { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; min-width: 64px; padding: 5px 8px; border: 1.5px solid #b44259; background: #ffe4eb; color: #a22b44; box-shadow: 0 2px 0 #b44259; }
.sc-heart svg { width: 19px; height: 19px; fill: currentColor; }
.sc-heart.done { color: #775f64; background: #f5e7eb; border-color: #c4a7b0; box-shadow: none; opacity: 1; }
.sc-heart-note { display: grid; gap: 3px; padding: 10px 12px; margin: 8px; border: 1.5px solid #dcafb8; border-radius: 12px; background: #fff0f4; color: #8c354b; font-size: 12px; line-height: 1.4; }
.sc-heart-note b { font-size: 13px; }.sc-pf-heart-note { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ink2); }
.sc-loan { margin: 6px 8px; padding: 10px; border: 1.5px solid var(--line2); border-radius: 12px; background: #fffdf5; }
.sc-profile .sc-loan { margin: 0; }.sc-loan-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-size: 13px; line-height: 1.4; min-width: 0; }.sc-loan-head b { flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }.sc-loan-head span { max-width: 100%; color: #8b5914; font-size: 12px; overflow-wrap: anywhere; }
.sc-loan p { margin: 5px 0 8px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; color: var(--ink2); }.sc-loan-actions,.sc-borrow-presets { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }.sc-loan-actions .btn { flex: 1 1 84px; min-height: 44px; min-width: 44px; max-width: 100%; padding: 6px 8px; white-space: normal; overflow-wrap: anywhere; }
.sc-loan-history { margin: 8px; }.sc-loan-history summary { min-height: 44px; display: flex; align-items: center; color: var(--ink2); font-size: 12px; cursor: pointer; }
.sc-loan .sc-loan-warning { padding: 8px; border: 2px solid var(--line2); border-radius: 4px; background: #fff3c9; color: var(--ink); }
.sc-borrow-form label { display: block; margin-top: 12px; font-size: 13px; font-weight: 700; }.sc-borrow-form input[name="amount"] { width: 100%; height: 44px; margin-top: 6px; padding: 0 12px; border: 2px solid var(--line2); border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; }.sc-borrow-form input[name="amount"]:focus { outline: 3px solid #2468a8; outline-offset: 2px; }.sc-borrow-presets { margin-top: 10px; }.sc-borrow-presets .btn { min-height: 44px; }
.sc-heart:focus-visible { outline: 3px solid #2468a8; outline-offset: 3px; }
/* Player metadata and actions have separate tracks; long names cannot squeeze
 * the text column or push buttons outside a narrow list/sidebar. */
.sc-row-item.person { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 8px; min-width: 0; }
.sc-row-item.person > .sc-ri-main { min-width: 0; gap: 2px; }
.sc-row-item.person > .sc-ri-main b, .sc-row-item.person > .sc-ri-main small { white-space: normal; line-height: 1.4; overflow-wrap: anywhere; }
.sc-row-item.person > .sc-ri-side { grid-column: 1 / -1; width: 100%; min-width: 0; flex-direction: row; align-items: center; justify-content: flex-end; }
.sc-row-item.person .sc-tag { max-width: 100%; overflow-wrap: anywhere; }
.sc-row-item.person .sc-quick { gap: 8px; min-width: 0; }
.sc-row-item.person .sc-quick > .btn, .sc-row-item.person > .sc-ri-side > .btn { min-height: 44px; min-width: 44px; max-width: 100%; padding: 6px 8px; white-space: normal; overflow-wrap: anywhere; }
.sc-row-item.person > .sc-friend-side { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; gap: 6px; }
.sc-row-item.person .sc-friend-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.sc-row-item.person .sc-request-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-row-item.person .sc-heart { min-width: 0; }
.sc-row-item.person .sc-heart svg { flex: 0 0 17px; width: 17px; height: 17px; }
.sc-row-item.person .sc-heart span { min-width: 0; }
.sc-list[data-mode="friends"] .sc-list-head { flex-wrap: wrap; }
.sc-list[data-mode="friends"] .sc-list-head b { flex: 1; }
.sc-list[data-mode="friends"] .sc-list-head .sc-myprofile { min-height: 44px; }
.sc-list[data-mode="friends"] .sc-search { min-width: 0; }
.sc-list[data-mode="friends"] .sc-search input { height: 44px; font-size: 16px; }
.sc-list[data-mode="friends"] .sc-search > .btn { min-width: 44px; min-height: 44px; }
.sc-list[data-mode="friends"] .sc-mycode { flex-wrap: wrap; }
.sc-list[data-mode="friends"] .sc-mycode b { overflow-wrap: anywhere; }
.sc-list[data-mode="friends"] .sc-mycode .btn { min-width: 44px; min-height: 44px; margin-left: auto; }
.sc-friends-scroll .sc-sec.toggle { min-height: 44px; }
.sc-borrow-form, .sc-borrow-form label { min-width: 0; }
.sc-borrow-presets .btn { flex: 1 1 100px; min-width: 44px; max-width: 100%; white-space: normal; }
.sc-borrowsheet, .sc-loan-confirm { min-width: 0; overscroll-behavior: contain; scroll-padding-block: 12px; }
.sc-borrowsheet .sx-top { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; }
.sc-borrowsheet .sx-top h3, .sc-loan-confirm h3, .sc-borrowsheet p, .sc-loan-confirm p { min-width: 0; overflow-wrap: anywhere; }
.sc-borrowsheet .sx-top .sc-iconbtn { width: 44px; height: 44px; }
.sc-borrowsheet .sc-borrow-form input { min-width: 0; font-size: 16px; }
.sc-borrowsheet .sc-btnrow, .sc-loan-confirm .sc-btnrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-borrowsheet .sc-btnrow .btn, .sc-loan-confirm .sc-btnrow .btn { min-width: 44px; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.sc-borrowsheet [data-check-offer] { min-width: 44px; min-height: 44px; margin-block: 4px; white-space: normal; }
@media (max-width: 440px) {
  .sc-profile { padding: 12px; }
  .sc-pf-actions, .sc-pf-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-pf-actions > .btn:last-child:nth-child(odd), .sc-pf-more > .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sc-pf-head { gap: 10px; }
  .sc-pf-head .sc-av.big { width: 52px; height: 52px; }
  .sc-pf-head b { font-size: 19px; }
}
.sx-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .sx-top h3 { margin: 0; }

/* ---- item link + thẻ chi tiết ---- */
[data-r="common"] { --rc: #6b7a72; --rb: #eef3ef; } [data-r="uncommon"] { --rc: #248a54; --rb: #e2f6ea; } [data-r="rare"] { --rc: #1f6fc4; --rb: #e0efff; } [data-r="legendary"] { --rc: #8a3fc9; --rb: #f1e6fd; } [data-r="sss"] { --rc: #c26f00; --rb: #fff0cf; }
.sx-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 36px; padding: 3px 10px 3px 6px; border-radius: 8px; border: 1.5px solid var(--rc, #6b7a72); border-bottom-width: 3px; background: var(--rb, #eef3ef); color: var(--rc, #6b7a72); font: 800 13px var(--font); text-align: left; cursor: pointer; }
.sx-link:hover { filter: brightness(.97); transform: translateY(-1px); } .sx-lt { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; } .sx-link.gone { opacity: .7; }
@media (pointer: coarse) { .sx-link { min-height: 44px; } }
.sx-ic { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; flex: 0 0 auto; } .sx-ic.pxi { height: 20px; width: auto; } .sx-big { width: 60px; height: 60px; object-fit: contain; image-rendering: pixelated; flex: 0 0 auto; }
.sx-q { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #ffe08a; color: #7a4a00; font: 800 15px var(--display); } .sx-head .sx-q { width: 60px; height: 60px; font-size: 30px; }
.sx-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 8px; padding: 10px; border-radius: 14px; border: 2px solid var(--rc, var(--line2)); background: var(--rb, #fff); } .sx-head b { display: block; font: 800 17px var(--display); color: var(--rc, var(--ink)); } .sx-head small { color: var(--ink2); }
.sx-body { display: grid; gap: 2px; } .sx-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 4px; border-bottom: 1.5px dashed var(--line); font-size: 13px; } .sx-row span { color: var(--mute); } .sx-row b { text-align: right; overflow-wrap: anywhere; }
.sx-note { font-size: 12px; color: var(--ink2); line-height: 1.45; } .sx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; } .sx-actions .btn { min-height: 42px; }
.sx-compare { margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line2); } .sx-compare label { display: block; font-size: 12px; color: var(--ink2); font-weight: 700; } .sx-compare select { width: 100%; height: 42px; margin: 4px 0 8px; border-radius: 10px; border: 2px solid var(--line2); background: #fffdf5; color: var(--ink); }
.sx-cmp-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; } .sx-cmp-row span { color: var(--mute); } #social .pos { color: #1f8a3a; } #social .neg { color: #c2352f; }
.sx-pickersheet { width: min(520px, 100%); } .sx-picker-top { display: flex; align-items: center; justify-content: space-between; } .sx-picker-top h3 { margin: 0; }
.sx-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 10px 0 8px; } .sx-tabs button { min-height: 42px; border-radius: 10px; border: 1.5px solid var(--line2); background: #fff; color: var(--ink2); font: 800 12px var(--font); box-shadow: 0 2px 0 var(--line2); cursor: pointer; } .sx-tabs button.on { background: linear-gradient(#59b1f7, #2f8fe8); border-color: #1c6fbf; color: #fff; box-shadow: 0 2px 0 #185e9f; }
.sx-search { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line2); background: #fff; color: var(--ink); font-size: 14px; }
.sx-list { max-height: 46vh; overflow-y: auto; margin-top: 8px; overscroll-behavior: contain; }
.sx-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 9px; margin-bottom: 5px; text-align: left; border-radius: 12px; border: 1.5px solid var(--line); border-left: 5px solid var(--rc, #6b7a72); background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); cursor: pointer; } .sx-item:hover { background: #fff6d8; }
.sx-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .sx-item-main b { font-size: 13.5px; color: var(--rc, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sx-item-main small { color: var(--mute); font-size: 11.5px; } .sx-own { font-size: 11.5px; font-weight: 800; color: var(--ink2); }

/* ---- thăm tiệm ---- */
body.shop-visit-on #floor-nav, body.shop-visit-on #hud, body.shop-visit-on #side-actions, body.shop-visit-on #zoom-ctrl, body.shop-visit-on #bottom-bar, body.shop-visit-on #quest-tracker, body.shop-visit-on #hud-events, body.shop-visit-on #pause-banner, body.shop-visit-on #btn-chat, body.shop-visit-on #build-bar, body.shop-visit-on #popup, body.shop-visit-on #panel, body.shop-visit-on #coach, body.shop-visit-on #coach-arrow { display: none !important; }
#shop-visit-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: linear-gradient(var(--bar-2), var(--bar)); border-bottom: 3px solid var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); color: var(--bar-text); }
#shop-visit-bar[hidden] { display: none; } .sv-who small { display: block; font: 800 10px var(--display); letter-spacing: 1.1px; color: #ffe14d; } .sv-who b { display: block; font: 800 20px var(--display); line-height: 1.15; color: #fff; } .sv-who span { font-size: 11.5px; color: var(--bar-muted); }
.sv-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .sv-actions .btn { min-height: 40px; } .sv-likes { padding: 0 10px; color: #ffe14d; font-weight: 800; }
.sv-who .sv-preview-note { display:block; font-size:11px; }
.sv-floor { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--bar-text); }
.sv-floor select { min-height:44px; max-width:190px; padding:6px 8px; border:2px solid var(--ink); border-radius:8px; background:var(--paper); color:var(--ink); font:700 12px var(--display); }
#shop-visit-info { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45; width: min(440px, calc(100vw - 20px)); max-height: 46vh; overflow-y: auto; padding: 10px 12px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink), 0 12px 28px rgba(0, 0, 0, .4); font-size: 13px; }
#shop-visit-info[hidden] { display: none; } .vi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; } .vi-head b { font: 800 16px var(--display); } .vi-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1.5px dashed var(--line); } .vi-row span { color: var(--mute); } .vi-row b { text-align: right; } .vi-body p { margin: 4px 0; color: var(--ink2); }

/* ---- màn hình nhỏ / dọc ---- */
@media (max-width: 760px), (max-aspect-ratio: 1/1), (orientation: landscape) and (max-height: 520px) {
  .sc-panel { left: 0; top: var(--vvt, 0px); transform: none; width: 100%; height: var(--vvh, 100dvh); max-height: none; border: 0; border-radius: 0; box-shadow: none; animation: sheetup .2s ease-out; }
  .sc-head { padding-top: calc(9px + env(safe-area-inset-top)); border-bottom-width: 3px; flex-shrink: 0; }
  .sc-title { flex-direction: column; align-items: flex-start; gap: 1px; }
  .sc-title h2 { max-width: 100%; line-height: 1.2; }
  .sc-head-actions { flex: 0 0 auto; }
  .sc-head-actions .btn, .sc-iconbtn { min-width: 44px; min-height: 44px; height: auto; }
  .sc-tabs, .sc-banner { flex-shrink: 0; }
  .sc-main { grid-template-columns: minmax(0, 1fr); }
  .sc-panel[data-view="stage"] .sc-list, .sc-panel[data-view="list"] .sc-stage { display: none; }
  .sc-list { border-right: 0; }
  .sc-head-actions .btn { display: none; } .sc-panel[data-nav] .sc-head-actions .btn[data-sc="settings"] { display: inline-flex; }
  .sc-bubble { max-width: 86%; } .sc-text { font-size: 15px; }
  .sc-sheet-wrap { align-items: flex-end; } .sc-sheet { width: 100%; }
  .sc-quick .btn { min-height: 38px; }
  .sc-avatar-pick { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 761px) and (min-aspect-ratio: 1/1) and (min-height: 521px) {
  .sc-sheet-wrap { align-items: center; } .sc-sheet { border-radius: 18px; border-bottom: 3px solid var(--ink); max-height: 84%; box-shadow: 0 6px 0 var(--ink), 0 20px 50px rgba(0, 0, 0, .4); }
}
@media (prefers-reduced-motion: reduce) { .sc-panel, .sc-backdrop, .sc-sheet, .sc-sheet-wrap, .sc-msg.fly .sc-att, .sc-badge, .sc-skel i, .sc-text.big, .sc-emoji-tray { animation: none !important; } }

/* ---- popup khai trương: tên người chơi + tên tiệm ---- */
.modal.naming .name-player, .modal.naming .name-label { display: block; }
.name-player { margin: 4px 0 8px; }
.name-player label, .name-label { display: block; margin: 6px 2px 4px; font: 800 12px var(--display); letter-spacing: .6px; color: var(--ink-2); }
.name-player label small { font-weight: 600; letter-spacing: 0; color: var(--muted); }
.name-player input { width: 100%; padding: 6px 12px; font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; }
.name-player input:focus { border-color: var(--orange); outline: none; }
.name-player input::placeholder { color: #b4a48a; font-weight: 600; }

/* ---- tạo chủ quán khi bắt đầu game ---- */
.modal.naming { width: min(640px, calc(100vw - 24px)); max-height: min(92vh, 760px); overflow-y: auto; }
.char-create { display: grid; grid-template-columns: 128px 1fr; gap: 12px; margin: 10px 0 12px; padding: 12px; border: 2.5px solid var(--ink); border-radius: 15px; background: linear-gradient(135deg, #fff8df, #f2dfb4); box-shadow: inset 0 -4px 0 rgba(102, 65, 30, .08); }
.char-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 154px; padding: 10px; border: 2px solid #b98e52; border-radius: 13px; background: radial-gradient(circle at 50% 35%, #fff 0 32%, #f6d58e 70%); }
.char-preview img { width: 84px; height: 114px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(70, 42, 30, .18)); }
.char-preview small { font: 800 10px var(--display); letter-spacing: .5px; color: #79552f; text-align: center; }
.char-options { display: grid; gap: 7px; min-width: 0; }
.char-field { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; }
.char-field > span { font: 800 11px var(--display); color: #66503b; }
.char-choices, .char-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.char-choices button { min-height: 30px; padding: 4px 9px; border: 1.5px solid #b98e52; border-radius: 9px; background: #fffdf5; color: var(--ink); font: 800 11px var(--font); box-shadow: 0 2px 0 #c9a66d; cursor: pointer; }
.char-choices button.on { color: #fff; border-color: #75411f; background: linear-gradient(#ef9538, #cf6423); box-shadow: 0 2px 0 #87411f; }
.char-swatches button { position: relative; width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 9px; background: var(--sw); box-shadow: 0 0 0 1.5px #9a7650, 0 2px 0 #9a7650; cursor: pointer; }
.char-swatches button.on::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 900 16px var(--font); text-shadow: -1px 0 #2a1c1c, 0 1px #2a1c1c, 1px 0 #2a1c1c, 0 -1px #2a1c1c; }
.char-choices button:focus-visible, .char-swatches button:focus-visible { outline: 3px solid #2468a8; outline-offset: 2px; }
@media (max-width: 560px) {
  .char-create { grid-template-columns: 96px 1fr; padding: 9px; gap: 9px; }
  .char-preview { min-height: 134px; padding: 6px; }
  .char-preview img { width: 68px; height: 92px; }
  .char-field { grid-template-columns: 1fr; gap: 3px; }
  .char-options { gap: 6px; }
  .char-choices button { min-height: 32px; }
}

/* Friend loan terms use the same light card and 44px input targets as social sheets. */
.sc-borrowsheet .sc-loan-terms { padding: 10px 12px; background: #fffdf5; border: 2px solid var(--line2); border-radius: 12px; color: var(--ink); }
.sc-borrowsheet .sc-loan-terms p { color: var(--ink); }
.sc-borrowsheet .sc-form label { display: block; margin: 10px 0; font-weight: 700; }
.sc-borrowsheet .sc-form input[type="number"], .sc-borrowsheet .sc-form input[name="amount"] { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 6px; padding: 8px 12px; border: 2px solid var(--line2); border-radius: 12px; background: #fff; color: var(--ink); font: 16px var(--body); }
.sc-borrowsheet .sc-form input[type="number"]:focus-visible, .sc-borrowsheet .sc-form input[name="amount"]:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
