/* ---------- tokens ---------- */
:root {
  --ink: #1A1C3A;
  --ink-2: #5B6080;
  --ink-3: #8E93AE;
  --paper: #EEF1F8;
  --surface: #FFFFFF;
  --line: #DCE1EE;
  --hover: #F4F6FC;
  --cobalt: #2E54F0;
  --cobalt-ink: #FFFFFF;
  --cobalt-soft: #E4EAFF;
  --gift: #F0407A;
  --gift-soft: #FFE6EF;
  --gold: #B88400;
  --gold-soft: #FFF3D1;
  --online: #12A36A;
  --away: #F2A93B;
  --busy: #E5484D;
  --offline: #B4B8CC;
  --danger: #C4253F;
  --t1: #6B7393; --t2: #12A36A; --t3: #2E54F0; --t4: #8B3FE0; --t5: #E8601A; --t6: #C99500;
  --admin: #D7263D;
  --radius: 12px;
  --display: "Baloo 2", "Baloo Da 2", "Baloo Bhaijaan 2", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Noto Sans Devanagari", "Noto Naskh Arabic", "Noto Nastaliq Urdu", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E8EAF6; --ink-2: #A9AECB; --ink-3: #7A7F9E; --paper: #10122A; --surface: #191C3A; --line: #2B2F55; --hover: #22264A;
    --cobalt: #5B7BFF; --cobalt-soft: #26306B; --gift-soft: #4A1E33; --gold: #F2C14E; --gold-soft: #3D3214;
    --t1: #9AA1C2; --t3: #7D95FF; --t4: #B07CFF; --admin: #FF5C70; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E8EAF6; --ink-2: #A9AECB; --ink-3: #7A7F9E; --paper: #10122A; --surface: #191C3A; --line: #2B2F55; --hover: #22264A;
  --cobalt: #5B7BFF; --cobalt-soft: #26306B; --gift-soft: #4A1E33; --gold: #F2C14E; --gold-soft: #3D3214;
  --t1: #9AA1C2; --t3: #7D95FF; --t4: #B07CFF; --admin: #FF5C70; color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--cobalt); }
:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.2; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip { transform: scaleX(-1); }

.boot { height: 100dvh; display: grid; place-items: center; }
.boot-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--cobalt); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { transform: scale(1.6); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 600; background: var(--cobalt); color: var(--cobalt-ink); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--cobalt-soft); color: var(--cobalt); }
.btn.plain { background: transparent; color: var(--ink-2); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.gift { background: var(--gift); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.on { color: var(--gold); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--cobalt); }
.form-row { display: flex; gap: 10px; } .form-row > * { flex: 1; }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- auth ---------- */
.auth { height: 100dvh; overflow-y: auto; }
.auth-art { background: var(--cobalt); color: #fff; padding: 32px 20px 24px; }
.auth-art .brand { font: 800 34px/1 var(--display); letter-spacing: -.5px; }
.auth-art p { font-size: 17px; max-width: 30ch; margin: 10px 0 0; opacity: .92; }
.auth-feed { margin-top: 22px; display: grid; gap: 6px; font-size: 14px; max-width: 360px; }
.auth-feed div { background: rgba(255, 255, 255, .13); padding: 7px 11px; border-radius: 10px; width: fit-content; }
.auth-feed b { font-family: var(--display); font-weight: 700; }
.auth-feed .g { background: rgba(255, 255, 255, .22); }
.auth-form { padding: 28px 20px 40px; max-width: 440px; width: 100%; margin: 0 auto; }
.seg { display: flex; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 22px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { flex: 1; min-height: 40px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--cobalt); color: #fff; }
.lang-pick { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.lang-pick select { width: auto; min-height: 36px; padding: 4px 10px; }
@media (min-width: 900px) {
  .auth { display: grid; grid-template-columns: 1.1fr 1fr; }
  .auth-art { padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; }
  .auth-art .brand { font-size: 56px; }
  .auth-art p { font-size: 20px; }
  .auth-form { align-self: center; padding: 40px; }
}

/* ---------- app shell ---------- */
.app { height: 100dvh; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.rail { display: none; }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.pane-list { grid-row: 1; }
.pane-main { grid-row: 1; display: none; background: var(--paper); }
.app.show-main .pane-list { display: none; }
.app.show-main .pane-main { display: flex; }
.app.show-main .tabbar { display: none; }
.scroll { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }

.pane-head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.pane-head h1 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-head .back { margin-inline-start: -6px; }

.tabbar { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); position: relative; }
.tabbar button.on { color: var(--cobalt); }
.badge { position: absolute; top: 3px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gift); color: #fff; font: 700 11px/18px var(--body); text-align: center; }
.icon-btn .badge { top: 2px; inset-inline-start: auto; inset-inline-end: 0; }

@media (min-width: 900px) {
  .app { grid-template-columns: 76px 340px 1fr; grid-template-rows: 1fr; }
  .app .pane-list, .app.show-main .pane-list { display: flex; grid-column: 2; border-inline-end: 1px solid var(--line); }
  .app .pane-main, .app.show-main .pane-main { display: flex; grid-column: 3; }
  .tabbar, .app.show-main .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; background: var(--ink); grid-column: 1; }
  :root[data-theme="dark"] .rail { background: #0A0B1E; }
  .rail .mark { width: 44px; height: 44px; margin-bottom: 14px; }
  .rail button { width: 60px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 7px; border-radius: 12px; color: #AEB3D3; font-size: 11px; font-weight: 600; position: relative; }
  .rail button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .rail button.on { background: var(--cobalt); color: #fff; }
  .rail .spacer { flex: 1; }
  .rail .coins { color: #FFD66B; font: 700 13px var(--display); text-align: center; line-height: 1.1; padding: 6px 0; }
  .pane-head .back { display: none; }
}
@media (min-width: 1280px) { .app { grid-template-columns: 76px 370px 1fr; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rail { background: #0A0B1E; } }

/* ---------- lists ---------- */
.section-label { padding: 16px 16px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.section-label .count { background: var(--hover); padding: 0 7px; border-radius: 7px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; text-align: start; position: relative; }
button.row:hover, a.row:hover, .row[data-go]:hover, .row[data-act]:hover { background: var(--hover); }
.row[data-go], .row[data-act] { cursor: pointer; }
.row.active { background: var(--cobalt-soft); }
.row .meta { flex: 1; min-width: 0; }
.row .title { font-weight: 600; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.row .title .name { overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { display: flex; align-items: center; gap: 6px; flex: none; }
.row .unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gift); color: #fff; font: 700 12px/22px var(--body); text-align: center; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-2); }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }
a.row { color: inherit; text-decoration: none; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 13px; border-radius: 18px; background: var(--hover); color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--surface); }
.search { padding: 10px 16px 0; flex: none; }
.search .input { min-height: 40px; padding-inline-start: 38px; background: var(--hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238E93AE' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 12px center; border-color: transparent; }
[dir="rtl"] .search .input { background-position: calc(100% - 12px) center; }

.room-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; font: 700 19px var(--display); color: #fff; }
.room-ic.flag { background: var(--hover); font-size: 26px; }
.occ { font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--hover); padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.occ.live { color: var(--online); background: color-mix(in srgb, var(--online) 13%, transparent); }

/* ---------- people ---------- */
.av { width: 44px; height: 44px; border-radius: 50%; flex: none; position: relative; background: var(--hover); display: grid; place-items: center; font: 700 18px var(--display); color: #fff; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av.s { width: 32px; height: 32px; font-size: 14px; }
.av.xl { width: 104px; height: 104px; font-size: 42px; }
.av .dot { position: absolute; bottom: 0; inset-inline-end: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: var(--offline); display: inline-block; flex: none; }
.av.xl .dot { width: 22px; height: 22px; border-width: 4px; bottom: 4px; inset-inline-end: 4px; }
.dot.online { background: var(--online); } .dot.away { background: var(--away); } .dot.busy { background: var(--busy); }

.lv { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 6px; font: 700 11px/1 var(--display); color: #fff; background: var(--t1); letter-spacing: .2px; flex: none; }
.tier1 { --tier: var(--t1); } .tier2 { --tier: var(--t2); } .tier3 { --tier: var(--t3); } .tier4 { --tier: var(--t4); } .tier5 { --tier: var(--t5); } .tier6 { --tier: var(--t6); }
.lv[class*="tier"] { background: var(--tier); }
.role-admin { color: var(--admin) !important; }
.shield { color: var(--admin); font-size: 13px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.chat-head { gap: 6px; }
.chat-head .meta { flex: 1; min-width: 0; }
.chat-head .meta h1 { font-size: 19px; }
.chat-head .meta .sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: none; flex: none; }
.strip::-webkit-scrollbar { display: none; }
.strip a { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 16px; background: var(--hover); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; max-width: 170px; }
.strip a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip a.on { background: var(--cobalt); color: #fff; }
.strip a i { font-style: normal; min-width: 8px; height: 8px; border-radius: 4px; background: var(--gift); }

.msgs { flex: 1; overflow-y: auto; padding: 10px 0 14px; min-height: 0; overscroll-behavior: contain; }
.older { display: block; margin: 4px auto 10px; font-size: 13px; color: var(--cobalt); font-weight: 600; padding: 6px 12px; }

/* room lines: compact "name: text", the classic chatroom look */
.m { padding: 3px 16px; line-height: 1.5; overflow-wrap: anywhere; position: relative; }
.m .who { font: 700 15px var(--display); color: var(--tier, var(--t1)); cursor: pointer; }
.m .who .lv { vertical-align: 2px; margin-inline-start: 3px; height: 16px; font-size: 10px; padding: 0 4px; }
.m .who.self { color: var(--cobalt); }
.m time { font-size: 11px; color: var(--ink-3); margin-inline-start: 6px; white-space: nowrap; }
.m.mention { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] .m.mention { box-shadow: inset -3px 0 0 var(--gold); }
.m.act { font-style: italic; color: var(--ink-2); }
.m.sys { font-size: 13px; color: var(--ink-3); padding-top: 1px; padding-bottom: 1px; }
.m.notice { font-size: 13px; color: var(--ink-2); background: var(--hover); margin: 6px 12px; border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; }
.m.announce { margin: 8px 12px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); font-weight: 600; }
.m.roll { color: var(--ink-2); }
.m.roll b { font: 800 17px var(--display); color: var(--ink); }

/* the one loud thing: gifts take the whole width and get a big emoji */
.m.giftline { margin: 8px 12px; padding: 10px 14px; border-radius: 14px; background: var(--gift-soft); display: flex; align-items: center; gap: 12px; }
.m.giftline .gi { font-size: 38px; line-height: 1; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.m.giftline .gt { flex: 1; min-width: 0; }
.m.giftline .gt b { font-family: var(--display); }
@keyframes pop { from { transform: scale(.2) rotate(-25deg); } }

/* private chat bubbles */
.bub-row { display: flex; padding: 2px 12px; }
.bub-row.mine { justify-content: flex-end; }
.bub { max-width: min(78%, 520px); padding: 8px 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 0 var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.bub-row.mine .bub { background: var(--cobalt); color: #fff; }
.bub-row.mine .bub a { color: #fff; }
.bub time { display: block; font-size: 11px; opacity: .65; margin-top: 2px; text-align: end; }
.day { text-align: center; font-size: 12px; color: var(--ink-3); margin: 12px 0 6px; }

.composer { display: flex; align-items: flex-end; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); flex: none; }
.composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 14px; border-radius: 21px; border: 1.5px solid var(--line); background: var(--paper); line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--cobalt); }
.composer .send { width: 42px; height: 42px; border-radius: 50%; background: var(--cobalt); color: #fff; display: grid; place-items: center; flex: none; }
.composer .icon-btn { width: 42px; height: 42px; }
.composer .icon-btn.giftb { color: var(--gift); }
.blocked-bar { padding: 14px; text-align: center; background: var(--surface); border-top: 1px solid var(--line); color: var(--ink-2); }

.sheet { position: absolute; inset-inline: 8px; bottom: 66px; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(20, 24, 60, .22); padding: 10px; z-index: 5; max-height: 46%; overflow-y: auto; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.emoji-grid button { font-size: 25px; height: 44px; border-radius: 10px; }
.emoji-grid button:hover { background: var(--hover); }

.drawer-back { position: absolute; inset: 0; background: rgba(10, 12, 30, .35); z-index: 6; }
.drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(320px, 88%); background: var(--surface); z-index: 7; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(10, 12, 30, .2); }
.tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--hover); color: var(--ink-2); }
.tag.owner { background: var(--gold-soft); color: var(--gold); }
.tag.mod { background: var(--cobalt-soft); color: var(--cobalt); }
.tag.admin { background: color-mix(in srgb, var(--admin) 15%, transparent); color: var(--admin); }

.popover { position: fixed; z-index: 40; background: var(--surface); border-radius: 12px; box-shadow: 0 10px 34px rgba(20, 24, 60, .25); padding: 6px; min-width: 190px; }
.popover button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; text-align: start; }
.popover button:hover { background: var(--hover); }
.popover .ph { padding: 6px 10px 8px; font: 700 15px var(--display); border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }

/* ---------- placeholder for empty main pane ---------- */
.placeholder { flex: 1; display: grid; place-items: center; text-align: center; color: var(--ink-2); padding: 24px; }
.placeholder .mark { width: 84px; height: 84px; margin: 0 auto 14px; opacity: .9; }
.placeholder h2 { font-size: 26px; color: var(--ink); margin-bottom: 4px; }

/* ---------- pages (profile, wallet, settings, admin) ---------- */
.page { max-width: 680px; width: 100%; margin: 0 auto; padding: 20px 16px 48px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.profile-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 18px 20px; }
.profile-top h1 { font-size: 28px; display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.profile-top .handle { color: var(--ink-2); }
.profile-top .status { font-size: 15px; margin-top: 2px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; color: var(--ink-2); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats b { display: block; font: 800 22px var(--display); }
.stats span { font-size: 13px; color: var(--ink-2); }
.gift-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.gift-wall div { text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--hover); }
.gift-wall .e { font-size: 30px; display: block; line-height: 1.2; }
.gift-wall small { font-size: 12px; color: var(--ink-2); }
.xp { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; margin: 8px 0 4px; }
.xp i { display: block; height: 100%; background: var(--tier, var(--cobalt)); border-radius: 4px; }

.me-card { padding: 18px 16px; display: flex; gap: 14px; align-items: center; }
.me-card .meta { flex: 1; min-width: 0; }
.me-card h2 { font-size: 20px; display: flex; gap: 6px; align-items: center; }
.coin-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 14px; background: var(--gold-soft); color: var(--gold); font: 700 14px var(--display); }
.presence-pick { display: flex; gap: 6px; padding: 0 16px 10px; flex-wrap: wrap; }
.presence-pick button { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 16px; background: var(--hover); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.presence-pick button.on { box-shadow: inset 0 0 0 2px var(--cobalt); color: var(--ink); }

.balance { font: 800 44px/1 var(--display); color: var(--gold); display: flex; align-items: baseline; gap: 8px; }
.balance small { font: 600 15px var(--body); color: var(--ink-2); }
.tx { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tx:last-child { border-bottom: 0; }
.tx .amt { font: 700 16px var(--display); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.tx .amt.plus { color: var(--online); } .tx .amt.minus { color: var(--ink-2); }

.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.gift-grid button { border-radius: 12px; padding: 10px 4px 8px; background: var(--hover); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gift-grid button .e { font-size: 34px; line-height: 1.15; }
.gift-grid button .n { font-size: 13px; font-weight: 600; }
.gift-grid button .p { font-size: 12px; color: var(--gold); font-weight: 700; }
.gift-grid button.on { box-shadow: inset 0 0 0 2.5px var(--gift); background: var(--gift-soft); }

/* admin */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.tabs button { padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat-grid div { background: var(--surface); border-radius: 12px; padding: 14px; }
.stat-grid b { display: block; font: 800 28px var(--display); }
.stat-grid span { font-size: 13px; color: var(--ink-2); }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: 0; }
.admin-row .meta { flex: 1; min-width: 160px; }
.admin-row .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.gift-edit { display: grid; grid-template-columns: 56px 1fr 80px 64px auto auto; gap: 6px; align-items: center; padding: 6px 0; }
.gift-edit .input { min-height: 38px; padding: 6px 8px; }
@media (max-width: 560px) { .gift-edit { grid-template-columns: 52px 1fr 70px; } }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 30, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 460px; border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; }
.modal h2 { font-size: 21px; margin-bottom: 12px; }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 18px; } }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; pointer-events: none; }
#toast div { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); max-width: 90vw; }
#toast div.err { background: var(--danger); color: #fff; }
.net { background: var(--away); color: #3A2600; text-align: center; font-size: 13px; font-weight: 600; padding: 4px; }

/* ---------- avatars ---------- */
.av svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.figure { width: 168px; aspect-ratio: 2 / 3; border-radius: 20px; overflow: hidden; box-shadow: 0 1px 0 var(--line); margin-bottom: 6px; }
.figure svg { width: 100%; height: 100%; display: block; }
.av-page { display: grid; gap: 16px; padding: 16px 16px 48px; max-width: 980px; margin: 0 auto; }
.av-stage { width: min(170px, 46vw); aspect-ratio: 2 / 3; margin: 0 auto; border-radius: 22px; overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.av-stage svg { width: 100%; height: 100%; display: block; }
.av-panel .chips { padding: 0 0 12px; flex-wrap: wrap; overflow: visible; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.av-item { background: var(--surface); border-radius: 14px; padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.av-item.on { box-shadow: inset 0 0 0 2.5px var(--cobalt); }
.av-thumb { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: block; background: var(--hover); }
.av-thumb svg { width: 100%; height: 100%; display: block; }
.av-item .n { font-size: 13px; font-weight: 600; text-align: center; }
.av-item .p { font-size: 12px; font-weight: 700; color: var(--gold); }
.av-item .p.own { color: var(--online); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; padding: 2px 2px 14px; }
.sw { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.sw.on { outline: 3px solid var(--cobalt); outline-offset: 2px; }
@media (min-width: 900px) {
  .av-page { grid-template-columns: 260px 1fr; align-items: start; }
  .av-stage { width: 100%; position: sticky; top: 16px; }
}
.visitors { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.visitors a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: inherit; font-size: 13px; text-align: center; }
.visitors a span:not(.av) { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visitors small { color: var(--ink-3); font-size: 11px; }

/* ---------- merchants, store, leaderboard ---------- */
:root { --merchant: #0E8F9A; }
:root[data-theme="dark"] { --merchant: #3FD0DB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --merchant: #3FD0DB; } }
.role-merchant { color: var(--merchant) !important; }
.tag.merchant { background: color-mix(in srgb, var(--merchant) 15%, transparent); color: var(--merchant); }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pack { background: var(--hover); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.pack b { font: 800 22px var(--display); color: var(--gold); }
.pack > span { font-weight: 700; }
.pack-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rank { width: 28px; text-align: center; font: 800 16px var(--display); color: var(--ink-2); flex: none; }
.url { display: block; padding: 8px 10px; background: var(--hover); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; margin: 4px 0 12px; }
.rail .coins { width: 60px; }

/* ---------- gift tiers ---------- */
.gf { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; font-size: 28px; line-height: 1; position: relative; isolation: isolate; flex: none; }
.gf.big { width: 58px; height: 58px; font-size: 34px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.chip .gf { width: 16px; height: 16px; font-size: 0; vertical-align: -3px; margin-inline-end: 2px; }
.gf.t0 { background: transparent; }
.gf.t1 { background: radial-gradient(circle, #FFF4C9 0%, transparent 72%); }
.gf.t1::after, .gf.t5::after, .gf.t7::after { position: absolute; top: -3px; inset-inline-end: -3px; font-size: 14px; }
.gf.t1::after { content: '✨'; }
.gf.t2 { background: #F6E1CC; box-shadow: inset 0 0 0 3px #C47A3A; }
.gf.t3 { background: #EEF1F6; box-shadow: inset 0 0 0 3px #A9B3C1; }
.gf.t4 { background: #FFF2C2; box-shadow: inset 0 0 0 3px #E2AE00, 0 0 12px rgba(226, 174, 0, .45); }
.gf.t5 { background: #E6FAFF; box-shadow: inset 0 0 0 3px #62D5EE, 0 0 14px rgba(98, 213, 238, .55); }
.gf.t5::after { content: '💎'; font-size: 12px; }
.gf.t6, .gf.t7 { background: conic-gradient(#FF5E7E, #FFB14D, #FFE45E, #5EE08F, #5EC3FF, #9C6BFF, #FF5E7E); }
.gf.t6::before, .gf.t7::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); z-index: -1; }
.gf.t7 { box-shadow: 0 0 16px rgba(255, 94, 126, .55); animation: glow 2.4s ease-in-out infinite alternate; }
.gf.t7::after { content: '👑'; font-size: 13px; top: -6px; }
.chip .gf::after, .chip .gf::before { display: none; }
@keyframes glow { to { box-shadow: 0 0 22px rgba(94, 195, 255, .7); } }
.m.giftline .gf { margin-inline-end: 2px; }
.gift-grid button .gf { margin-bottom: 2px; }
.gift-grid .more { grid-column: 1 / -1; background: transparent; color: var(--cobalt); font-weight: 700; padding: 10px; }
.gift-grid { max-height: 340px; }
.gift-wall div .gf { margin: 0 auto 2px; }
.chips.tight { padding: 0 0 8px; flex-wrap: wrap; overflow: visible; }
.chip.sub { font-size: 13px; padding: 5px 11px; }
.chip.sub small { opacity: .6; font-weight: 600; }
.gift-admin { display: flex; align-items: center; gap: 8px; }
.gift-admin .gift-edit { flex: 1; }
select.input.sm { min-height: 34px; width: auto; padding: 4px 8px; font-size: 13px; }

/* ---------- wardrobe and shop ---------- */
.av-panel .seg { margin-bottom: 12px; }
.av-stage { position: relative; }
.av-ribbon { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
div.av-item { gap: 4px; }
button.av-thumb { padding: 0; cursor: pointer; }
.av-item .buy { min-height: 30px; padding: 0 8px; font-size: 12px; width: 100%; }
.av-thumb.mini { width: 48px; height: 48px; flex: none; }
.pane-head .coin-pill { margin-inline-end: 4px; }

/* ---------- roles ---------- */
:root { --gadmin: #E8601A; --mentor: #6F42C1; --headmentor: #B5179E; }
:root[data-theme="dark"] { --gadmin: #FF9A5C; --mentor: #B08CFF; --headmentor: #F06AD8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gadmin: #FF9A5C; --mentor: #B08CFF; --headmentor: #F06AD8; } }
.role-gadmin { color: var(--gadmin) !important; }
.role-mentor { color: var(--mentor) !important; }
.role-headmentor { color: var(--headmentor) !important; }
.tag.gadmin { background: color-mix(in srgb, var(--gadmin) 15%, transparent); color: var(--gadmin); }
.tag.mentor { background: color-mix(in srgb, var(--mentor) 15%, transparent); color: var(--mentor); }
.tag.headmentor { background: color-mix(in srgb, var(--headmentor) 15%, transparent); color: var(--headmentor); }
.shield.g { color: var(--gadmin); }
.m.sys.mod { color: var(--danger); font-weight: 600; }
.popover button.danger-text { color: var(--danger); }

.av-stage-wrap { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 4px 0 8px; margin: -4px 0 0; }
@media (max-width: 899px) { .av-stage { width: min(124px, 32vw); } .av-page { padding-top: 8px; } }
@media (min-width: 900px) { .av-stage-wrap { top: 16px; padding: 0; } .av-stage { position: static; } }
@media (max-width: 899px) { #av-slots, #av-styles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } #av-slots::-webkit-scrollbar, #av-styles::-webkit-scrollbar { display: none; } }

/* ---------- feed ---------- */
.feed-list { padding: 4px 0 20px; }
.post { background: var(--surface); border-radius: var(--radius); margin: 0 12px 12px; padding: 12px 14px; box-shadow: 0 1px 0 var(--line); }
.pane-list .post { margin: 0 10px 10px; border: 1px solid var(--line); box-shadow: none; }
.page .post { margin: 0 0 14px; }
.post header { display: flex; align-items: center; gap: 10px; }
.post header .meta { flex: 1; min-width: 0; }
.pname { font: 700 15px var(--display); color: var(--ink); text-decoration: none; }
.post-body { margin: 10px 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.post-photo { display: block; width: 100%; margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--hover); }
.post-photo img { width: 100%; max-height: 520px; object-fit: cover; display: block; }
.post footer { display: flex; gap: 6px; margin-top: 10px; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; background: var(--hover); font-size: 14px; font-weight: 600; color: var(--ink-2); filter: grayscale(1); }
.pbtn.on { filter: none; background: var(--gift-soft); color: var(--gift); }
.pbtn:hover { filter: none; }
.post-new { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 4px 10px 12px; padding: 10px; }
.page .post-new { margin: 0 0 14px; }
.post-new textarea { min-height: 64px; border: 0; padding: 4px 2px; background: transparent; }
.post-new textarea:focus { outline: none; }
.post-new-row { display: flex; align-items: center; gap: 8px; }
.post-new-row .post-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comments { display: grid; gap: 12px; margin-bottom: 14px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .meta { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.comment-new { display: flex; gap: 8px; }
.comment-new .input { flex: 1; }
h2.split { display: flex; align-items: baseline; gap: 8px; }
h2.split a { margin-inline-start: auto; font-family: var(--body); font-weight: 600; }

/* ---------- photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.photo-grid button { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--hover); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.album { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.album-cover { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--hover); display: grid; place-items: center; font-size: 34px; margin-bottom: 4px; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal.wide { max-width: 860px; }
.viewer img { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 10px; background: #000; display: block; }
.viewer p { margin: 10px 0 0; }

/* ---------- groups ---------- */
.group-top { display: flex; gap: 14px; align-items: flex-start; }
.group-top .room-ic { width: 64px; height: 64px; font-size: 28px; border-radius: 16px; }
.group-top .meta { flex: 1; min-width: 0; }
.group-top h1 { font-size: 24px; }

/* ---------- badges ---------- */
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--gold-soft); font-size: 22px; flex: none; }
.badge-ic.big { width: 64px; height: 64px; font-size: 34px; border-radius: 18px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-card { background: var(--surface); border-radius: var(--radius); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.badge-card.locked .badge-ic { filter: grayscale(1); opacity: .45; background: var(--hover); }
.badge-card .ok { color: var(--online); font-weight: 600; }
.stats { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }

/* ---------- games ---------- */
.m.bot { margin: 4px 12px; padding: 8px 12px; border-radius: 12px; background: var(--cobalt-soft); line-height: 1.6; }
.botname { font: 700 13px var(--display); color: var(--cobalt); margin-inline-end: 4px; }
.pcard { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700; color: var(--ink); }
.pcard.red { color: #D7263D; }
.dice { font-size: 20px; vertical-align: -2px; }
.game-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.game-row .meta { flex: 1; }
.gicon { font-size: 30px; }
.pcard + .pcard { margin-inline-start: 2px; }
.game-row code { display: inline-block; margin-top: 3px; padding: 0 6px; border-radius: 5px; background: var(--hover); color: var(--ink-2); font-size: 12px; }
.g-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; margin: 6px 0; }
.g-opts span { padding: 4px 8px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.g-opts b { color: var(--cobalt); margin-inline-end: 4px; }
.usdt { color: var(--ink-2); font-size: .88em; font-weight: 600; white-space: nowrap; }
.pack .bonus { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--cobalt-soft); color: var(--cobalt); font-size: 12px; font-weight: 700; }
.cmd { font-weight: 700; color: var(--cobalt); white-space: nowrap; }
/* names keep their room in narrow rows; role tags give way first */
.row .title .name { flex: 0 1 auto; min-width: 4.5em; }
.row .title .tag { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row.req { flex-wrap: wrap; row-gap: 8px; }
.row.req .end { width: 100%; padding-inline-start: 56px; }
/* keep the avatar editor inside the screen on phones */
.av-page { grid-template-columns: minmax(0, 1fr); }
.av-page > * { min-width: 0; }
@media (min-width: 900px) { .av-page { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 600px) { .row.acts { flex-wrap: wrap; row-gap: 6px; } .row.acts .end { width: 100%; padding-inline-start: 56px; flex-wrap: wrap; } }

/* ---------- MigYo brand ---------- */
.auth-art { background: #FFF2E2; padding: 0; display: grid; place-items: center; overflow: hidden; }
.auth-banner { width: 100%; max-width: 640px; height: auto; display: block; }
.auth-logo { display: block; width: min(220px, 60%); height: auto; margin: 0 auto 4px; }
.auth-tag { text-align: center; color: var(--ink-2); margin: 0 0 18px; font-weight: 600; }
@media (max-width: 899px) { .auth-art { max-height: 34dvh; } .auth-banner { width: auto; max-height: 34dvh; } .auth-logo { display: none; } .auth-tag { display: none; } }
@media (min-width: 900px) { .auth-art { padding: 24px; } .auth-banner { border-radius: 28px; } }
.placeholder .logo-big { width: min(300px, 70%); height: auto; display: block; margin: 0 auto 10px; }
.rail .mark { object-fit: contain; }

/* ---------- level looks ---------- */
.lv { gap: 2px; padding: 0 6px 0 1px; border-radius: 9px; background: var(--lvc, #2A9C74); }
.lv img { width: 20px; height: 20px; margin-block: -2px; margin-inline-start: -2px; flex: none; }
.m .who .lv { padding: 0 5px 0 1px; }
.m .who .lv img { width: 18px; height: 18px; }
.lv.f-mint { --lvc: #23946C; } .lv.f-bronze { --lvc: #A65A25; } .lv.f-silver { --lvc: #66758E; } .lv.f-gold { --lvc: #A97405; }
.lv.f-emerald { --lvc: #0C8559; } .lv.f-sapphire { --lvc: #2A5FD6; } .lv.f-ruby { --lvc: #C21F45; } .lv.f-amethyst { --lvc: #7B35D6; }
.lv.f-diamond { --lvc: #1C7FAF; } .lv.f-rainbow { background: linear-gradient(90deg, #E8455E, #E8861E, #2E9E52, #2D86D6, #7B45E0); }
.lvbadge { width: 72px; height: 72px; display: block; flex: none; }
.lvbadge.xl { width: 156px; height: 156px; }
.lvbadge.pop { animation: lvpop .7s cubic-bezier(.3, 1.6, .5, 1) both; margin: 0 auto; }
@keyframes lvpop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
.me-card .me-badge { flex: none; border-radius: 50%; }
.me-card .me-badge .lvbadge { width: 58px; height: 58px; }
.profile-top .figure { position: relative; overflow: visible; }
.profile-top .figure > svg { border-radius: 20px; }
.fig-badge { position: absolute; inset-inline-end: -34px; bottom: -18px; border-radius: 50%; }
.fig-badge .lvbadge { width: 96px; height: 96px; filter: drop-shadow(0 4px 8px rgba(20, 24, 60, .25)); }
.levelup { text-align: center; }
.levelup h2 { margin: 6px 0 2px; font-size: 24px; }
.levelup .new-look { font-weight: 700; color: var(--cobalt); }
.lv-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.lv-hero .meta { flex: 1; min-width: 200px; }
.lv-hero h1 { font-size: 30px; margin: 0; }
.look-name { display: inline-block; font: 800 15px var(--display); color: #fff; background: var(--lvc, var(--cobalt)); padding: 2px 10px; border-radius: 999px; }
.look-name.f-mint { --lvc: #23946C; } .look-name.f-bronze { --lvc: #A65A25; } .look-name.f-silver { --lvc: #66758E; } .look-name.f-gold { --lvc: #A97405; }
.look-name.f-emerald { --lvc: #0C8559; } .look-name.f-sapphire { --lvc: #2A5FD6; } .look-name.f-ruby { --lvc: #C21F45; } .look-name.f-amethyst { --lvc: #7B35D6; }
.look-name.f-diamond { --lvc: #1C7FAF; } .look-name.f-rainbow { background: linear-gradient(90deg, #E8455E, #E8861E, #2E9E52, #2D86D6, #7B45E0); }
.next-look { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.next-look img { width: 30px; height: 30px; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.look { position: relative; background: var(--surface); border-radius: 16px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 1px 0 var(--line); text-align: center; }
.look img { width: 96px; height: 96px; }
.look b { font: 800 15px var(--display); }
.look.on { box-shadow: inset 0 0 0 2px var(--cobalt); }
.look.locked img { filter: saturate(.3); opacity: .62; }
.look .lock { position: absolute; top: 8px; inset-inline-end: 10px; font-style: normal; font-size: 14px; }
.look-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.look-levels > div { display: flex; flex-direction: column; align-items: center; font: 700 13px var(--display); color: var(--ink-2); }
.look-levels .lvbadge { width: 100%; height: auto; aspect-ratio: 1; max-width: 96px; }
.look-levels .locked .lvbadge { filter: saturate(.3); opacity: .55; }
.look-levels .on span { color: var(--cobalt); }
@media (max-width: 480px) { .look-levels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- stickers ---------- */
.stk { width: 120px; height: 120px; display: block; }
.stk.big { width: 168px; height: 168px; }
.m.stkline time { float: none; margin-inline-start: 8px; }
.m.stkline > div { margin-top: 2px; }
.bub.stkbub { background: none !important; box-shadow: none; padding: 0; }
.bub-row.mine .bub.stkbub time { color: var(--ink-2); }
.stk-wrap { padding: 0; }
.sheet.stk-wrap { max-height: 58%; padding: 0 10px 10px; }
.stk-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; position: sticky; top: 0; background: var(--surface); z-index: 1; scrollbar-width: none; }
.stk-tabs button { position: relative; flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.stk-tabs button.on { background: var(--cobalt-soft); }
.stk-tabs button img { width: 36px; height: 36px; }
.stk-tabs button i { position: absolute; bottom: 0; inset-inline-end: 0; font-size: 11px; font-style: normal; }
.stk-tabs .shop { color: var(--ink-2); background: var(--hover); }
.stk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 2px 8px; }
.stk-head b { font: 800 16px var(--display); flex: 1; }
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; }
.stk-grid button { border-radius: 12px; padding: 4px; aspect-ratio: 1; }
.stk-grid button:hover { background: var(--hover); }
.stk-grid img { width: 100%; height: 100%; display: block; }
.stk-grid.locked { opacity: .45; pointer-events: none; }
.modal .stk-wrap { max-height: 60dvh; overflow-y: auto; }
.stk-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.stk-preview img { width: 100%; aspect-ratio: 1; display: block; }
.stk-pack h2 { flex-wrap: wrap; gap: 8px; }
.stk-pack .buy-wrap { display: inline-flex; align-items: center; gap: 8px; }
.tag.ok { background: color-mix(in srgb, var(--online) 15%, transparent); color: var(--online); font-size: 12px; }
.stk-thumb { width: 44px; height: 44px; flex: none; }
.post-stk { margin-top: 8px; }
.post-stk-pick { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0 8px; }
.post-stk-pick .stk { width: 88px; height: 88px; }
.comment .stk { width: 96px; height: 96px; }
.comment-new { align-items: center; }

/* ---------- miniblog ---------- */
.htag, .mlink { color: var(--cobalt); font-weight: 600; text-decoration: none; unicode-bidi: plaintext; }
.htag:hover, .mlink:hover { text-decoration: underline; }
.plink { color: inherit; text-decoration: none; }
.reshare-by { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin: -2px 0 8px; }
.reshare-by .i { width: 16px; height: 16px; }
.reshare-by a { color: var(--ink); font-weight: 700; text-decoration: none; }
.reshare-by .icon-btn { margin-inline-start: auto; }
.quoted { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.quoted .post-body { margin-bottom: 0; }
.pbtn .i { width: 17px; height: 17px; }
.pbtn.rs.on { background: color-mix(in srgb, var(--online) 15%, transparent); color: var(--online); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.htag-chip { unicode-bidi: plaintext; padding: 6px 12px; border-radius: 999px; background: var(--cobalt-soft); color: var(--cobalt); font-weight: 700; text-decoration: none; }
.htag-chip small { color: var(--ink-2); font-weight: 600; margin-inline-start: 2px; }
.mb-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mb-hero .meta { flex: 1; min-width: 120px; }
.mb-hero > a, .stats > a { text-align: center; color: inherit; text-decoration: none; }
.mb-hero > a b { display: block; font: 800 22px var(--display); }
.mb-hero > a span, .stats > a span { font-size: 13px; color: var(--ink-2); }
.stats > a b { display: block; font: 800 22px var(--display); }
.follow-btn .i { width: 16px; height: 16px; }
@media (max-width: 420px) { .hide-s { display: none; } }

/* ---------- local money ---------- */
.money-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.money-line .usdt { font-size: 1em; }
.fx-note { margin: 8px 0 0; }
.fx-note a { color: inherit; }
.pack .local { font: 800 18px var(--display); color: var(--ink); }
.fx-sample { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.fx-sample b { color: var(--ink); margin-inline-end: 3px; }
details summary { cursor: pointer; color: var(--cobalt); font-weight: 600; margin: 4px 0 10px; }

/* phones: keep the message box wide enough with the sticker button added */
@media (max-width: 480px) {
  .composer { gap: 2px; padding-inline: 6px; }
  .composer .icon-btn { width: 36px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
}
@media (max-width: 480px) { .mb-hero .meta { flex: 1 1 calc(100% - 64px); } .mb-hero > a { flex: 1 1 0; } }

/* ================= v8: USDC wallet, photos, group chats, reports, alerts, invites ================= */
:root { --coin: #2264B5; --coin-soft: #E7F0FB; --coin-hi: #7FB8F5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --coin: #82B6F0; --coin-soft: #172A42; } }
:root[data-theme="dark"] { --coin: #82B6F0; --coin-soft: #172A42; }

/* amounts: a small round "$" in USDC blue, then the number */
.coin-sym { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border-radius: 50%; background: var(--coin); color: #fff;
  font: 800 .7em/1 var(--display); vertical-align: -.12em; flex: none; }
.coin-pill.cur { background: var(--coin-soft); color: var(--coin); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.coin-pill.cur .coin-sym { font-size: .8em; }
.rail .coins .coin-big { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--coin-hi); color: #0B2A4F;
  font: 800 14px/1 var(--display); margin-bottom: 3px; }
.balance { color: var(--coin); direction: ltr; unicode-bidi: isolate; flex-wrap: wrap; align-items: center; }
[dir="rtl"] .balance { justify-content: flex-end; }
.balance .coin-sym { font-size: .62em; }
.wallet-top { background: linear-gradient(135deg, var(--coin-soft), var(--surface) 70%); }
.wallet-top p { margin: 10px 0 0; }
.gift-grid button .p, .price { direction: ltr; unicode-bidi: isolate; }
.gift-grid button .p { color: var(--coin); }
/* deposit address with its QR code */
.dep-box { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 4px 0 12px; }
.dep-box .qr { flex: none; width: 168px; height: 168px; padding: 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.dep-box .qr svg { display: block; width: 100%; height: 100%; }
.dep-box .dep-info { flex: 1 1 240px; min-width: 0; }
.dep-info .url { word-break: break-all; font-size: 14px; }
#admin-depscan .form-row { align-items: stretch; }
#admin-depscan .input { min-width: 0; }
.ok-line { color: var(--online); margin: 8px 0; }
/* the recovery phrase, numbered, in two columns */
.phrase { list-style: none; counter-reset: w; columns: 2; gap: 10px; padding: 0; margin: 12px 0; }
.phrase li { counter-increment: w; break-inside: avoid; margin: 0 0 6px; padding: 6px 10px; border-radius: 8px; background: var(--hover); font: 600 15px var(--display); }
.phrase li::before { content: counter(w) '. '; color: var(--ink-3, var(--ink-2)); font-weight: 500; }
.phrase li span { user-select: all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: -.2px; overflow-wrap: anywhere; }

/* label + value + copy button */
.kv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.kv > span { flex: 0 0 100%; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kv .url { flex: 1; min-width: 0; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; text-align: left; user-select: all; }
.kv .url.big { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--coin); background: var(--coin-soft); flex: 0 1 auto; padding: 6px 14px; }
.kv .btn { flex: none; }
.warn { background: var(--gold-soft); color: var(--ink); border-radius: 10px; padding: 9px 12px; margin: 0 0 10px; box-shadow: inset 3px 0 0 var(--away); }
[dir="rtl"] .warn { box-shadow: inset -3px 0 0 var(--away); }
.kvs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kvs span { background: var(--hover); border-radius: 8px; padding: 4px 9px; font-size: 13px; color: var(--ink-2); }
.kvs b { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.kvs b.plus { color: var(--online); } .kvs b.minus { color: var(--danger); }
.field > small { display: block; margin-top: 4px; font-size: 12px; }
.seg.wd-mode { margin-bottom: 14px; }
.seg.wd-mode button { font-size: 14px; padding: 4px 8px; line-height: 1.2; }
.tx > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.tx .tag { white-space: nowrap; }
.tx .btn.sm { margin-top: 6px; }

/* forms */
.check { display: flex; align-items: center; gap: 9px; padding: 7px 0; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--cobalt); flex: none; margin: 0; }
.radio-list { margin: 0 0 12px; }
.radio-list .check { padding: 9px 10px; border-radius: 10px; }
.radio-list .check:hover { background: var(--hover); }
.pick-list { max-height: 240px; overflow-y: auto; margin: 0 -6px 12px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; cursor: pointer; }
.pick:hover { background: var(--hover); }
.pick span { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick small { font-weight: 400; }
.pick input { width: 20px; height: 20px; accent-color: var(--cobalt); flex: none; }

/* sign in */
.auth-h { font-size: 22px; margin-bottom: 8px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.verify-bar { margin: 0 16px 12px; padding: 9px 12px; border-radius: 10px; background: var(--gold-soft); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.verify-bar .btn { margin-inline-start: auto; background: var(--surface); }

/* photos in chat */
.chat-img { display: block; width: min(260px, 64vw); max-height: 320px; border-radius: 12px; overflow: hidden; background: var(--hover); padding: 0; }
.chat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m.imgline > div { margin-top: 4px; }
.bub.imgbub { padding: 4px; }
.bub.imgbub time { padding: 0 6px 2px; }
.m.act.center { text-align: center; font-style: normal; padding: 6px 16px; }
.mrep { align-self: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3); display: grid; place-items: center; opacity: 0; flex: none; margin-inline-start: 2px; }
.mrep svg.i { width: 16px; height: 16px; }
.bub-row:hover .mrep, .mrep:focus-visible { opacity: 1; }
@media (hover: none) { .mrep { opacity: .45; } }
.mrep:hover { background: var(--hover); color: var(--danger); }
.composer label.icon-btn { cursor: pointer; flex: none; }
.composer .icon-btn { flex: none; }
@media (max-width: 400px) { .composer { gap: 0; padding-inline: 4px; } .composer .icon-btn, .composer .send { width: 38px; height: 40px; } .composer textarea { padding-inline: 11px; margin-inline: 2px; } }

/* group chats */
.room-ic.gc svg.i { width: 24px; height: 24px; stroke-width: 2.2; }
.push-card { margin: 10px 12px 2px; padding: 10px 6px 10px 12px; border-radius: 12px; background: var(--cobalt-soft); display: flex; align-items: center; gap: 8px; font-size: 14px; }
.push-card span { flex: 1; min-width: 0; }
.push-card .icon-btn { width: 32px; height: 32px; }

/* invite */
.invite-top { text-align: center; }
.invite-top .kv, .invite-top .acts { justify-content: center !important; }
.big-ic { font-size: 46px; line-height: 1.1; margin-bottom: 6px; }
.perks { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; text-align: start; }
.perks li { background: var(--hover); border-radius: 10px; padding: 10px 12px 10px 38px; position: relative; }
.perks li::before { content: '$'; position: absolute; left: 12px; top: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--coin); color: #fff; font: 800 11px/18px var(--display); text-align: center; }
[dir="rtl"] .perks li { padding: 10px 38px 10px 12px; } [dir="rtl"] .perks li::before { left: auto; right: 12px; }
p.acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }

/* games */
.stake-box { background: var(--coin-soft); border-radius: 12px; padding: 12px 14px 4px; margin-bottom: 6px; }
.stake-box .field { margin-bottom: 6px; }
.stake-box .input { font: 700 20px var(--display); max-width: 200px; }
.stake-box p { margin: 6px 0 8px; }
.game-list { max-height: 46dvh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }

/* admin */
.stat-grid div.alert { box-shadow: inset 0 0 0 2px var(--danger); }
.stat-grid div.alert b { color: var(--danger); }
.stat-grid a { color: inherit; text-decoration: none; display: block; }
.stat-grid b { direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-size: clamp(18px, 5vw, 28px); }
.panel .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat-grid b small.cur, .stats b small.cur { font-size: .5em; font-weight: 700; margin-inline-start: 4px; color: var(--ink-2); letter-spacing: 0; }
@media (min-width: 900px) { .stat-grid b { font-size: 24px; } }
.panel .stat-grid div { background: var(--hover); padding: 12px; }
.panel .stat-grid b { font-size: clamp(17px, 4.6vw, 24px); }
[dir="rtl"] .stat-grid b { text-align: right; }
.admin-row.off { opacity: .6; }
.admin-row .gf { width: 44px; height: 44px; font-size: 24px; }
.gf img { width: 78%; height: 78%; object-fit: contain; display: block; }
.gift-wall .gf img, .gift-grid .gf img { width: 80%; height: 80%; }
.gift-pic { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.gift-pic > div { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.gift-pic p { margin: 0; }
.gift-pic .gf { width: 72px; height: 72px; font-size: 40px; animation: none; }
.report { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.report:first-child { padding-top: 0; } .report:last-child { border-bottom: 0; padding-bottom: 0; }
.report blockquote { margin: 2px 0; padding: 8px 12px; border-radius: 10px; background: var(--hover); border-inline-start: 3px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; max-height: 180px; overflow-y: auto; }
.report blockquote img { max-width: 160px; max-height: 160px; border-radius: 8px; display: block; }
.report .acts { display: flex; gap: 6px; }
.wd-admin { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wd-admin:first-child { padding-top: 0; } .wd-admin:last-child { border-bottom: 0; padding-bottom: 0; }
.wd-admin .tx { border-bottom: 0; padding: 4px 0; }
.wd-admin .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.dep-assign { margin-top: 8px; max-width: 320px; align-items: center; }
.dep-assign .btn { flex: none; }
.panel h3 { font-family: var(--body); }
.room-ic.flag { color: var(--coin); }
.rail .coins br { display: none; }
details.fold { padding-block: 12px; }
details.fold > summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
details.fold[open] > summary { margin-bottom: 10px; }
.report > .tag { justify-self: start; }
.panel > .acts, form.panel .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- v9: dice in colour, the live game banner ---------- */
.die { display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 24px; height: 24px; padding: 3px; gap: 1px; border-radius: 6px; vertical-align: -6px; margin-inline-end: 3px;
  background: var(--die, #888); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22), 0 1px 2px rgba(10, 12, 30, .25); }
.die i { display: block; }
.die i.p { width: 4.5px; height: 4.5px; border-radius: 50%; background: #fff; place-self: center; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15); }
.die.d1 { --die: #E5484D; } .die.d2 { --die: #E8801A; } .die.d3 { --die: #C99500; } .die.d4 { --die: #12A36A; } .die.d5 { --die: #2E54F0; } .die.d6 { --die: #8B3FE0; }
.g-draw { white-space: nowrap; }
.g-meta { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.m.bot s { text-decoration-thickness: 1.5px; }
.game-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--cobalt-soft); border-bottom: 1px solid var(--line); line-height: 1.35; }
.game-bar .gb-l { flex: 1; min-width: 0; }
.game-bar .gb-r { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.game-bar .cd { font-variant-numeric: tabular-nums; color: var(--cobalt); font-size: 15px; }
.game-bar.ph-join { background: var(--gold-soft); }
.game-bar.ph-join .cd { color: var(--gold); }
.game-bar.must { box-shadow: inset 4px 0 0 var(--cobalt); }
.game-bar.must .gb-r .btn { animation: g-pulse 1.4s ease-in-out infinite; }
@keyframes g-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--cobalt) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .game-bar.must .gb-r .btn { animation: none; } }
.tag.game { background: var(--gold-soft); color: var(--gold); margin-inline-start: 4px; }
.tag.head { background: color-mix(in srgb, var(--t4) 15%, transparent); color: var(--t4); }
.tag.pv { font-family: var(--body); font-weight: 600; margin-inline-start: 6px; vertical-align: 2px; }
h2.split > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.modal h3 { font: 700 15px var(--display); margin: 16px 0 6px; }
.inline-form { display: flex; gap: 8px; margin: 0 0 8px; }
.inline-form .input { flex: 1; min-height: 36px; }
.conf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }
.conf-grid .field span { font-size: 12px; }
.game-conf h3.split { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font: 700 16px var(--display); }
.av-link { display: inline-flex; }
.imp-bar { position: fixed; z-index: 40; bottom: 16px; left: 92px; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 108px);
  padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; box-shadow: 0 6px 24px rgba(10, 12, 30, .3); }
.imp-bar .btn { white-space: nowrap; }
.imp-bar > span { flex: 1; min-width: 0; line-height: 1.35; }
.die { vertical-align: middle; }
@media (max-width: 600px) { .imp-bar { top: auto; left: 10px; right: 10px; transform: none; max-width: none; bottom: calc(66px + env(safe-area-inset-bottom)); border-radius: 14px; } .form-row { flex-wrap: wrap; } .form-row > * { min-width: 140px; } }
