:root {
  --ink: #1b1d22;
  --panel: #dfe0e2;
  --panel-2: #ecedef;
  --line: #9a9ea6;
  --head: #1f6f96;
  --head-2: #185a7b;
  --dark: #212329;
  --dark-2: #2d3038;
  --dark-3: #3a3e48;
  --txt: #f4f5f7;
  --muted: #9aa0ab;
  --green: #2f9e48;
  --green-2: #23803a;
  --gold: #ffcc1c;
  --red: #d93b3b;
  --blue: #3180ff;
  --celeste: #75aadb;
  --radius: 8px;
  --bar-h: 64px;
  font-family: "Ubuntu", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0c10; color: var(--ink); overflow: hidden; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }
img, canvas { image-rendering: pixelated; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ── landing ─────────────────────────────────────────────────────────── */
#landing { overflow-y: auto; background: #3f9ff0 url(/assets/gen/cielo.png?h=380bbd8667) center top / cover no-repeat fixed; image-rendering: pixelated; color: #10202c; }
#landing > * { image-rendering: auto; }
.l-top { position: relative; max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.l-top .logo { height: 58px; }
.l-top .l-mute { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.l-top .l-mute:hover { background: rgba(0,0,0,.5); }
.l-top .l-online { margin-left: auto; background: rgba(0,0,0,.35); color: #fff; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.l-hero { position: relative; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 0 16px; }
.l-hero .l-img { border-radius: 12px; overflow: hidden; border: 3px solid #0e4d73; box-shadow: 0 8px 0 rgba(0,0,0,.18); background: #0e4d73; aspect-ratio: 16/9; }
.l-hero .l-img img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
.l-box { background: #fff; border-radius: 12px; border: 3px solid #0e4d73; box-shadow: 0 8px 0 rgba(0,0,0,.18); overflow: hidden; align-self: start; }
.l-box h2 { margin: 0; background: #0e4d73; color: #fff; font-size: 16px; padding: 10px 14px; }
.l-box .in { padding: 16px; display: grid; gap: 12px; }
.l-box p { margin: 0; font-size: 14px; line-height: 1.45; }
.btn-x { display: flex; align-items: center; justify-content: center; gap: 10px; background: #5865f2; color: #fff; border: 0; border-radius: 8px; padding: 13px; font-weight: 700; font-size: 16px; box-shadow: 0 4px 0 #3c45a5; }
.btn-x:hover { background: #4752c4; }
.btn-x svg { width: 18px; height: 18px; }
.l-rule { font-size: 12px; color: #4a5a66; background: #f1f6f9; border: 1px dashed #9cc3d9; border-radius: 8px; padding: 8px 10px; }
.l-dev { display: flex; gap: 6px; }
.l-dev input { flex: 1; border: 2px solid #b6c8d4; border-radius: 6px; padding: 6px 8px; }
.l-sec { position: relative; max-width: 1100px; margin: 28px auto 0; padding: 0 16px; }
.l-sec h3 { font-size: 20px; margin: 0 0 12px; color: #fff; text-shadow: 0 2px 0 #0e4d73, 0 0 8px rgba(14,77,115,.6); }
.l-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.l-card { background: #fff; border-radius: 12px; border: 3px solid #0e4d73; overflow: hidden; }
.l-card .ph { height: 120px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; box-sizing: border-box; background: #d8eef8; }
.l-card .ph img { image-rendering: pixelated; height: 98px; width: auto; }
.l-card .tx { padding: 10px 12px 14px; font-size: 14px; }
.l-card .tx b { display: block; margin-bottom: 4px; }
.l-foot { max-width: 1100px; margin: 34px auto 0; padding: 20px 16px 40px; display: flex; gap: 16px; align-items: center; color: #10304a; font-size: 13px; }

/* ── loading ─────────────────────────────────────────────────────────── */
#loading { background: #0b0c10 url() center/cover; display: grid; place-items: center; }
#loading .ld { text-align: center; color: #fff; }
#loading .logo { height: 80px; }
.ld-bar { width: 300px; height: 22px; border: 2px solid #fff; border-radius: 12px; margin: 22px auto 10px; padding: 3px; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 8px; transition: width .3s; }
.ld-msg { font-size: 14px; color: #cfd3da; min-height: 20px; }

/* ── generic windows (Nitro-like) ────────────────────────────────────── */
.win { position: absolute; background: var(--panel); border: 1px solid #000; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; z-index: 50; max-width: calc(100vw - 16px); max-height: calc(100vh - var(--bar-h) - 16px); }
.win-head { background: linear-gradient(var(--head), var(--head-2)); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 34px 7px 10px; position: relative; cursor: move; user-select: none; -webkit-user-select: none; touch-action: none; text-align: center; text-shadow: 0 1px 0 rgba(0,0,0,.4); border-bottom: 1px solid #0c3a52; }
.win-x { position: absolute; right: 6px; top: 5px; width: 20px; height: 20px; border-radius: 4px; border: 1px solid #0c3a52; background: #d64b4b; color: #fff; font-weight: 700; line-height: 16px; padding: 0; }
.win-x:hover { background: #ea5d5d; }
/* fingers need a taller bar to grab (and a bigger close button) */
@media (pointer: coarse) {
  .win-head { padding-top: 12px; padding-bottom: 12px; padding-right: 44px; }
  .win-x { width: 32px; height: 32px; font-size: 20px; line-height: 28px; top: 50%; margin-top: -16px; }
}
.win-body { padding: 10px; overflow: auto; flex: 1; font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -2px -2px 8px; padding: 0 2px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); border-bottom: 0; background: #c8cacd; padding: 6px 10px; border-radius: 6px 6px 0 0; font-size: 12px; font-weight: 700; color: #3a3e48; }
.tab.on { background: var(--panel-2); color: #000; position: relative; top: 1px; }
.btn { border: 1px solid #555a63; background: linear-gradient(#fbfbfb, #d6d8db); color: #111; border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 700; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.btn:hover { background: linear-gradient(#fff, #e4e6e9); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-green { background: linear-gradient(#45c060, #2a9443); color: #fff; border-color: #1c6b2f; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn-green:hover { background: linear-gradient(#52cc6d, #30a14b); }
.btn-red { background: linear-gradient(#e56565, #c43c3c); color: #fff; border-color: #8a2323; }
.btn-red:hover { background: linear-gradient(#ec7777, #cd4747); }
.btn-blue { background: linear-gradient(#4ea0e8, #2b77c4); color: #fff; border-color: #1b4f86; }
.row { display: flex; gap: 8px; align-items: center; }
.muted { color: #5c616b; }
.empty { text-align: center; color: #5c616b; padding: 26px 10px; }
.empty img { height: 48px; display: block; margin: 0 auto 8px; }

/* ── HUD ─────────────────────────────────────────────────────────────── */
#hotel { background: #0b0c10; }
#hotelview { position: absolute; inset: 0 0 var(--bar-h) 0; background: #1d2330 center/cover no-repeat; image-rendering: pixelated; }
#hotelview > * { image-rendering: auto; }
#creator { image-rendering: pixelated; }
#creator > * { image-rendering: auto; }
#hotelview .hv-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,10,16,.55), rgba(8,10,16,0) 45%); }
.hv-widgets { position: absolute; left: 16px; top: 70px; width: 300px; display: grid; gap: 12px; }
.hv-card { background: rgba(33,35,41,.92); color: var(--txt); border: 1px solid #000; border-radius: 10px; overflow: hidden; }
.hv-card h4 { margin: 0; padding: 8px 12px; font-size: 13px; background: rgba(255,255,255,.06); border-bottom: 1px solid #000; }
.hv-card .in { padding: 10px 12px; display: grid; gap: 8px; font-size: 13px; }
.hv-go { display: flex; align-items: center; gap: 10px; background: var(--dark-3); border: 1px solid #000; border-radius: 8px; padding: 6px 8px; color: #fff; text-align: left; }
.hv-go:hover { background: #4a4f5c; }
.hv-go img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.hv-go small { display: block; color: var(--muted); font-size: 11px; }
.hv-me { display: flex; gap: 10px; align-items: center; }
.hv-me canvas, .hv-me img { width: 60px; height: 60px; image-rendering: pixelated; background: rgba(255,255,255,.06); border-radius: 8px; }
#roomhost { position: absolute; inset: 0 0 var(--bar-h) 0; overflow: hidden; }
.room-canvas { position: absolute; inset: 0; touch-action: none; }
.bubble-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble { position: absolute; left: 0; top: 0; background: #fff; border: 1px solid #000; border-radius: 7px; padding: 3px 9px 3px 34px; font-size: 12px; line-height: 18px; white-space: nowrap; max-width: 520px; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 rgba(0,0,0,.25); transition: transform .35s ease; min-height: 24px; }
.bubble::after { content: ""; position: absolute; left: var(--tail, 20px); bottom: -6px; width: 9px; height: 9px; background: inherit; border-right: 1px solid #000; border-bottom: 1px solid #000; transform: rotate(45deg); }
.bubble-head { position: absolute; left: 2px; top: -7px; width: 30px; height: 30px; }
.bubble-shout { font-weight: 700; }
.bubble-shout span { color: #d0201b; }
.bubble-whisper { font-style: italic; background: #e8e8ee; color: #444; }
.bubble-bot { background: #fff6d6; }

.hud-top-left { position: absolute; left: 10px; top: 10px; z-index: 20; display: flex; gap: 8px; }
.hud-hotel { width: 48px; height: 48px; border: 0; background: none; padding: 0; }
.hud-hotel img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }
.hud-roomname { align-self: center; background: rgba(0,0,0,.6); color: #fff; padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 700; }
.hud-right { position: absolute; right: 8px; top: 8px; width: 232px; z-index: 20; display: grid; gap: 6px; }
.purse { background: var(--dark); border: 1px solid #000; border-radius: 6px; display: grid; grid-template-columns: 1fr 1fr 1fr; overflow: hidden; }
.purse > div { display: flex; align-items: center; gap: 4px; padding: 4px 6px; color: #fff; font-weight: 700; font-size: 12px; border-right: 1px solid #000; }
.purse > div:last-child { border-right: 0; }
.purse img { width: 16px; height: 16px; }
.purse .p-coins { color: var(--gold); }
.purse .p-usd { color: #7ee08a; }
.purse .p-club { grid-column: span 3; border-top: 1px solid #000; justify-content: space-between; color: #e6e6e6; }
.hud-card { background: var(--dark-2); border: 1px solid #000; border-radius: 6px; color: #fff; font-size: 12px; overflow: hidden; }
.hud-card h5 { margin: 0; padding: 5px 8px; background: var(--dark-3); font-size: 12px; display: flex; justify-content: space-between; }
.hud-card .in { padding: 6px 8px; display: flex; gap: 8px; align-items: center; }
.hud-card .in img { width: 36px; height: 36px; }
.prog { position: relative; height: 16px; background: #15161a; border: 1px solid #000; border-radius: 4px; overflow: hidden; }
.prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#3fd0e0, #1d95a8); }
.prog span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 14px; color: #fff; font-weight: 700; }

.toolbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar-h); background: linear-gradient(#2d3038, #1b1d22); border-top: 1px solid #000; display: flex; align-items: center; gap: 6px; padding: 0 8px; z-index: 30; }
.tb-group { display: flex; gap: 2px; background: rgba(0,0,0,.25); border: 1px solid #0d0e11; border-radius: 6px; padding: 2px; }
.tb { position: relative; width: 58px; height: 54px; border: 0; background: none; border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #d6d9df; font-size: 10px; }
.tb:hover, .tb.on { background: rgba(255,255,255,.1); }
.tb.on { background: #1f6fcf; color: #fff; }
.tb img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 1px 0 rgba(0,0,0,.6)); }
.tb .badge { position: absolute; top: 2px; right: 6px; background: #e33c3c; color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 0 4px; border: 1px solid #000; }
.tb .badge.g { background: #2f9e48; }
.chatbar { flex: 1; display: flex; justify-content: center; min-width: 0; }
.chat { display: flex; align-items: center; gap: 4px; background: #111216; border: 1px solid #000; border-radius: 8px; padding: 3px 4px; width: min(420px, 100%); }
.chat input { flex: 1; min-width: 0; border: 1px solid #555; border-radius: 6px; padding: 6px 8px; background: #fff; }
.chat .cbtn { width: 30px; height: 30px; border: 1px solid #000; border-radius: 6px; background: var(--dark-3); color: #fff; font-size: 14px; padding: 0; }
.chat .cbtn.on { background: #c43c3c; }
.chat .whisper { background: #6b4fa8; color: #fff; font-size: 11px; border-radius: 6px; padding: 2px 6px; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.chat .whisper button { background: none; border: 0; color: #fff; padding: 0 2px; }

.roomtools { position: absolute; left: 10px; bottom: calc(var(--bar-h) + 10px); z-index: 20; display: flex; gap: 2px; background: rgba(33,35,41,.95); border: 1px solid #000; border-radius: 8px; padding: 3px; }
.roomtools button { width: 40px; height: 40px; border: 0; border-radius: 6px; background: none; color: #fff; font-size: 20px; padding: 0; }
.fightbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 12px); z-index: 26; display: flex; align-items: center; gap: 10px; background: var(--dark); border: 1px solid #000; border-radius: 8px; padding: 6px 8px 6px 12px; color: #fff; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.4); white-space: nowrap; }
.fightbar small { color: var(--muted); }
.fightbar .btn { font-size: 14px; padding: 6px 14px; }
.roomtools button:hover { background: rgba(255,255,255,.12); }

.infostand { position: absolute; right: 8px; bottom: calc(var(--bar-h) + 8px); width: 232px; background: var(--dark); border: 1px solid #000; border-radius: 8px; color: #fff; z-index: 25; overflow: hidden; }
.infostand h5 { margin: 0; padding: 6px 30px 6px 8px; text-align: center; font-size: 13px; border-bottom: 1px solid #000; position: relative; }
.infostand h5 .win-x { top: 4px; right: 4px; width: 18px; height: 18px; line-height: 14px; font-size: 11px; }
.is-main { display: flex; gap: 8px; padding: 8px; align-items: center; }
.is-main img.fimg { width: 64px; height: 112px; object-fit: contain; }
.is-fig { width: 72px; height: 100px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.04); border-radius: 6px; }
canvas.figure { image-rendering: pixelated; display: block; }
.is-main img.fimg { width: auto; height: auto; image-rendering: pixelated; }
.is-side { flex: 1; display: grid; gap: 4px; font-size: 11px; }
.is-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.is-badges .bdg { width: 30px; height: 30px; }
.is-motto { border-top: 1px solid #000; padding: 6px 8px; font-size: 12px; color: #ddd; font-style: italic; word-break: break-word; }
.is-motto input { width: 100%; border: 1px solid #555; border-radius: 4px; padding: 3px 6px; font-size: 12px; }
.is-btns { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px 8px; border-top: 1px solid #000; }
.is-btns .btn { flex: 1 1 auto; padding: 4px 6px; font-size: 11px; }
.is-row { display: flex; justify-content: space-between; color: var(--muted); }
.is-row b { color: #fff; font-weight: 500; }

.ctxmenu { position: absolute; z-index: 26; background: #1e2026; border: 1px solid #000; border-radius: 8px; color: #fff; width: 160px; box-shadow: 0 4px 12px rgba(0,0,0,.5); transform: translate(-50%, -100%); }
.ctxmenu h6 { margin: 0; padding: 6px 8px; text-align: center; font-size: 13px; border-bottom: 1px solid #000; }
.ctxmenu button { display: block; width: 100%; background: none; border: 0; border-bottom: 1px solid #000; color: #fff; padding: 7px 8px; font-size: 13px; text-align: center; }
.ctxmenu button:last-child { border-bottom: 0; }
.ctxmenu button:hover { background: #2f333d; }
.ctxmenu::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: #1e2026; border-right: 1px solid #000; border-bottom: 1px solid #000; transform: translateX(-50%) rotate(45deg); }

.memenu { position: absolute; left: 8px; bottom: calc(var(--bar-h) + 6px); z-index: 40; display: flex; background: #111216; border: 1px solid #000; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.memenu .fig { width: 130px; background: #1b1c20; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px; color: #fff; }
.memenu .fig canvas { margin: auto 0; }
.memenu .lvl { width: 100%; font-size: 11px; font-weight: 700; }
.memenu .lvl b { font-size: 26px; display: block; line-height: 1; }
.memenu .opts { width: 210px; display: flex; flex-direction: column; }
.memenu .opts .who { display: flex; justify-content: space-between; padding: 8px 10px; background: #000; color: #fff; font-weight: 700; font-size: 15px; }
.memenu .opts button.o { text-align: left; background: #2a2c33; color: #fff; border: 0; border-bottom: 1px solid #000; padding: 8px 12px; font-size: 14px; }
.memenu .opts button.o:hover { background: #3b6fa3; }

.toasts { position: absolute; right: 250px; top: 10px; z-index: 60; display: grid; gap: 8px; width: 290px; }
.toast { background: var(--dark); border: 1px solid #000; border-radius: 8px; color: #fff; padding: 8px 10px; display: flex; gap: 10px; align-items: center; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.5); animation: tin .25s ease; }
.toast b { display: block; font-size: 13px; }
.toast .ti { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; flex: none; border: 2px solid #000; }
@keyframes tin { from { transform: translateX(30px); opacity: 0; } }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: grid; place-items: center; }
.alert { position: relative; width: min(380px, calc(100vw - 32px)); }
.alert .win-body { display: grid; gap: 12px; }
.alert .a-ico { display: flex; gap: 12px; align-items: flex-start; }
.alert .a-ico > img { width: 64px; image-rendering: auto; }

/* ── lists / grids used by windows ───────────────────────────────────── */
.list { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: auto; }
.li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #e3e4e6; cursor: pointer; }
.li:nth-child(odd) { background: #f4f5f6; }
.li:hover, .li.on { background: #d6e8f7; }
.li .nm { flex: 1; min-width: 0; }
.li .nm b { display: block; font-size: 13px; }
.li .nm small { color: #5c616b; }
.users-pill { min-width: 44px; text-align: center; border-radius: 10px; padding: 2px 6px; font-size: 11px; font-weight: 700; color: #fff; border: 1px solid rgba(0,0,0,.4); background: #7c7c7c; }
.users-pill.lo { background: #2f9e48; }
.users-pill.mid { background: #e0a21a; }
.users-pill.hi { background: #d93b3b; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; }
.cell { position: relative; aspect-ratio: 1; background: #fff; border: 1px solid #b7bbc2; border-radius: 6px; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.cell:hover { border-color: #3180ff; }
.cell.on { border: 2px solid #3180ff; background: #e7f1ff; }
.cell img, .cell canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.cell .cnt { position: absolute; right: 3px; bottom: 2px; font-size: 10px; font-weight: 700; background: #1b1d22; color: #fff; border-radius: 6px; padding: 0 4px; }
.cell .lock { position: absolute; right: 2px; top: 2px; font-size: 10px; background: #1b1d22; color: #ffcc1c; border-radius: 6px; padding: 0 3px; line-height: 14px; display: flex; align-items: center; gap: 2px; }
.cell .lock img { width: 12px; height: 12px; }
.cell.locked canvas { opacity: .55; }
.cell.none::before { content: "✕"; color: #9aa0ab; font-size: 22px; }

/* avatar editor (like the original) */
.editor { display: grid; grid-template-columns: 1fr 190px; gap: 10px; width: 640px; max-width: 100%; }
.ed-cats { display: flex; gap: 4px; margin-bottom: 6px; }
.ed-cat { width: 52px; height: 40px; border: 1px solid #8d929a; border-radius: 6px 6px 0 0; background: #c9ccd0; display: grid; place-items: center; font-size: 20px; }
.ed-cat.on { background: #f1f2f3; border-bottom-color: #f1f2f3; }
.ed-ico { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.ed-cat:not(.on) .ed-ico { opacity: .75; }
.ed-cat.wardrobe { margin-left: auto; }
.ed-sub { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.ed-sub button { border: 1px solid #8d929a; background: #e3e5e8; border-radius: 12px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.ed-sub button.on { background: #1f6f96; color: #fff; border-color: #0c3a52; }
.ed-panel { background: #f1f2f3; border: 1px solid #8d929a; border-radius: 0 6px 6px 6px; padding: 8px; }
.ed-parts { max-height: 238px; overflow: auto; }
.ed-parts .grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.ed-colors { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 8px; }
.sw { aspect-ratio: 1; border: 1px solid #333; border-radius: 3px; cursor: pointer; }
.sw.on { outline: 2px solid #fff; box-shadow: 0 0 0 3px #1f6f96; }
.ed-gender { display: flex; gap: 20px; align-items: center; margin: 6px 0 10px; }
.ed-gender button { display: flex; align-items: center; gap: 6px; background: none; border: 2px solid transparent; border-radius: 8px; padding: 4px 8px; font-weight: 700; }
.ed-gender button.on { border-color: #1f6f96; background: #fff; }
.ed-gender .sym { font-size: 22px; }
.ed-prev { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; }
.ed-stage { position: relative; width: 190px; height: 250px; display: grid; place-items: end center; background: radial-gradient(ellipse 60px 14px at 50% 92%, #b9bdc4 90%, transparent 92%); }
.ed-stage canvas { width: 128px; height: 224px; margin-bottom: 8px; }
.ed-rot { border: 0; background: none; font-size: 30px; color: #2b77c4; line-height: 1; }
.ed-lockmsg { font-size: 11px; background: #fff6d6; border: 1px solid #e0c46a; border-radius: 6px; padding: 6px; }
.ed-motto { width: 100%; border: 1px solid #8d929a; border-radius: 6px; padding: 5px 8px; }
.wardrobe-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wslot { background: #fff; border: 1px solid #8d929a; border-radius: 6px; display: grid; justify-items: center; gap: 4px; padding: 6px 2px; }
.wslot canvas { width: 64px; height: 112px; }
.wslot .btn { padding: 2px 6px; font-size: 10px; }

/* catalog */
.cat { display: grid; grid-template-columns: 170px 1fr; gap: 8px; width: 700px; max-width: 100%; height: 470px; }
.cat-nav { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: auto; }
.cat-nav button { display: flex; width: 100%; gap: 8px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid #e3e4e6; background: none; padding: 7px 8px; font-size: 12px; font-weight: 700; }
.cat-nav button.on { background: #1f6f96; color: #fff; }
.cat-nav button .ic { width: 22px; text-align: center; font-size: 15px; }
.cat-page { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cat-banner { background: linear-gradient(90deg, #1f6f96, #2a8fbf); color: #fff; border-radius: 6px; padding: 10px 12px; border: 1px solid #0c3a52; }
.cat-banner b { font-size: 16px; display: block; }
.cat-items { flex: 1; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.cat-buy { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; min-height: 84px; }
.cat-buy .pv { width: 80px; height: 70px; display: grid; place-items: center; }
.cat-buy .pv { flex: none; overflow: hidden; }
/* big pieces (a nine-tile wall inscription) shrink to fit the preview */
.cat-buy .pv img, .cat-buy .pv canvas { image-rendering: pixelated; max-width: 100%; max-height: 100%; object-fit: contain; }
.price { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: #7a5a00; }
.price img { width: 14px; height: 14px; }
.cat-front { display: grid; gap: 8px; }
.cat-front img { width: 100%; border-radius: 6px; border: 1px solid #0c3a52; image-rendering: auto; }

/* achievements */
.ach { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.ach.done { background: #eef9ef; border-color: #7cc48a; }
.bdg { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; border: 3px solid #000; flex: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); }
.bdg.off { filter: grayscale(1); opacity: .45; }
.ach .prog { margin-top: 4px; }
.ach .prog i { background: linear-gradient(#6fd67f, #2f9e48); }
.ach .rw { font-size: 11px; color: #2f6b3a; font-weight: 700; }

/* profile */
.profile { display: grid; grid-template-columns: 140px 1fr; gap: 12px; width: 520px; max-width: 100%; }
.profile .pl { background: #1b1c20; border-radius: 8px; display: grid; place-items: center; padding: 8px; }
.profile .pl canvas { max-width: 100%; }
.emblem-box { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }

@media (max-width: 900px) {
  .l-hero { grid-template-columns: 1fr; }
  .l-cards { grid-template-columns: 1fr; }
  .hv-widgets { width: calc(100% - 32px); top: 64px; }
  .tb { width: 44px; }
  .tb span { display: none; }
  .toasts { right: 8px; top: 110px; width: min(290px, calc(100vw - 16px)); }
  .editor { grid-template-columns: 1fr; }
  .cat { grid-template-columns: 1fr; height: auto; }
  .cat-nav { display: flex; overflow-x: auto; }
  .cat-nav button { white-space: nowrap; border-bottom: 0; }
  .hud-right { width: 190px; }
  .infostand { width: 200px; }
}
@media (max-width: 620px) {
  /* phones: the chat gets its own row above the buttons, everything a size smaller */
  :root { --bar-h: 100px; }
  .tb-group.secondary { display: none; }
  .memenu .fig { display: none; }
  .toolbar { flex-wrap: wrap; justify-content: center; align-content: center; gap: 4px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  .chatbar { order: -1; flex-basis: 100%; }
  .chat { width: 100%; }
  .chat .cbtn { width: 34px; height: 34px; }
  .chat input { padding: 8px; font-size: 16px; } /* 16px keeps iOS from zooming in */
  .tb { width: 46px; height: 44px; }
  .tb img { width: 28px; height: 28px; }
  .hud-right { width: 150px; right: 6px; top: 6px; }
  .hud-right .hud-card { display: none; }
  .purse > div { font-size: 11px; padding: 3px 4px; }
  .hud-hotel, .hud-hotel img { width: 36px; height: 36px; }
  .hud-roomname { font-size: 12px; padding: 4px 10px; max-width: calc(100vw - 220px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .roomtools { left: 6px; bottom: calc(var(--bar-h) + 6px); }
  .roomtools button { width: 34px; height: 34px; font-size: 17px; }
  .infostand { width: 176px; right: 6px; bottom: calc(var(--bar-h) + 6px); }
  .bubble { max-width: calc(100vw - 16px); font-size: 11px; }
  .yt-mini { top: 52px; left: 6px; max-width: 60vw; }
}

.ed-faces { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.ed-faces .cell canvas { width: 56px; height: 56px; }

/* DJ booth track: audio only — a small "now playing" bar, the player itself invisible */
.yt-mini { position: fixed; left: 12px; top: 64px; max-width: 240px; z-index: 40; display: flex; align-items: center; gap: 6px; background: #14121a; border: 2px solid #000; border-radius: 6px; padding: 4px 8px; box-shadow: 0 4px 0 rgba(0,0,0,.35); font-size: 11px; color: #ffd23c; }
.yt-mini span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-mini button { border: 0; border-radius: 4px; background: #ffd23c; color: #14121a; font-weight: 700; cursor: pointer; padding: 1px 6px; }
.yt-mini .yt-host { position: fixed; width: 200px; height: 200px; overflow: hidden; opacity: 0.01; pointer-events: none; left: 0; bottom: 0; z-index: -1; }

/* text label for non-player characters */
.npc-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: #5a5f6e; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .5px; vertical-align: middle; line-height: 1.4; }

/* a page you read from a piece of furniture (the ANCLAH cover) */
.read-win { width: min(440px, 92vw); }
.read-win .win-body { max-height: 78vh; overflow-y: auto; padding: 6px; }
.read-body img { display: block; width: 100%; height: auto; border-radius: 4px; }

/* first-visit name picker */
.nick-in { width: 100%; box-sizing: border-box; border: 2px solid #b6c8d4; border-radius: 6px; padding: 8px 10px; font-size: 15px; }
.nick-in:focus { outline: none; border-color: #3180ff; }
.nick-msg { min-height: 18px; margin-top: 6px; color: #d23c3c; font-size: 12px; line-height: 1.35; }

/* staff tools */
.mod-win { width: 330px; max-width: 100%; display: grid; gap: 8px; }
.mod-row { display: flex; gap: 6px; align-items: center; }
.mod-row .btn { flex: 1 1 auto; }
.mod-row select, .mod-in { border: 2px solid #b6c8d4; border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 13px; }
.mod-in { width: 100%; box-sizing: border-box; }
.mod-text { width: 100%; box-sizing: border-box; border: 2px solid #b6c8d4; border-radius: 6px; padding: 6px 8px; resize: vertical; font-size: 13px; }

.ban-win { width: 320px; max-width: 100%; display: grid; gap: 8px; }
.ban-list { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; font-size: 12px; }
.ban-list > .muted { padding: 6px; }
.ban-item { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 4px; }
.ban-item:nth-child(odd) { background: #f1f4f7; }
.ban-info { flex: 1; min-width: 0; }
.ban-info .muted { font-size: 11px; }
.ban-why { font-size: 11px; font-style: italic; color: #555; word-break: break-word; }
.ban-item .btn { flex: none; padding: 3px 8px; font-size: 11px; }
.rep-win { width: 380px; }
.rep-list { max-height: 420px; }
.rep-item { display: grid; gap: 3px; padding: 6px; border-radius: 4px; border-left: 3px solid #d93b3b; }
.rep-item:nth-child(odd) { background: #f1f4f7; }
.rep-item.closed { border-left-color: #b9c2cc; opacity: 0.7; }
.rep-item .mod-row { gap: 4px; flex-wrap: wrap; }
.rep-item .btn, .rep-item select { flex: none; padding: 3px 8px; font-size: 11px; }
.rep-item summary { cursor: pointer; font-size: 11px; color: #3180ff; }
.rep-log { font-family: ui-monospace, monospace; font-size: 11px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 4px; max-height: 160px; overflow-y: auto; word-break: break-word; }
.rep-them { color: #c0262d; font-weight: 600; }

.mod-toggle { display: flex; align-items: center; gap: 10px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.mod-toggle > div { flex: 1; }
.mod-toggle .muted { font-size: 11px; }
.switch { flex: none; width: 40px; height: 22px; border-radius: 11px; border: 1px solid #8d929a; background: #c9ccd0; position: relative; padding: 0; cursor: pointer; transition: background .15s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: left .15s; }
.switch.on { background: #2f9e48; border-color: #237a37; }
.switch.on i { left: 20px; }

/* sticker reactions */
.react-grid { display: grid; grid-template-columns: repeat(5, 56px); gap: 6px; }
.react-cell { width: 56px; height: 56px; padding: 0; border: 2px solid #b6c8d4; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.react-cell:hover { border-color: #3180ff; transform: scale(1.05); }
.react-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* public rooms closed for now */
.li.closed { opacity: .45; filter: grayscale(1); }
.li .soon { font-size: 10px; font-weight: 700; color: #555; background: #d9dbe0; border-radius: 8px; padding: 2px 6px; white-space: nowrap; }

/* Gente: friends and requests */
.friends-win { width: 340px; max-width: 100%; display: grid; gap: 8px; }
.friends-win .list { max-height: 280px; overflow-y: auto; }
.friends-win .li { display: flex; align-items: center; gap: 6px; }
.friends-win .li .nm { flex: 1; min-width: 0; }
.friends-win .li .btn { padding: 3px 8px; font-size: 11px; }

/* laptop playlist */
.pl-win { width: 320px; max-width: 100%; }
.pl-list { display: grid; gap: 3px; max-height: 260px; overflow: auto; }
.pl-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid #0003; border-radius: 4px; background: #fff8; }
.pl-row.on { background: #dff0ff; border-color: #3180ff; }
.pl-n { width: 18px; text-align: center; font-weight: 700; color: #3180ff; flex: none; }
.pl-t { flex: 1; min-width: 0; display: grid; }
.pl-t b, .pl-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-t small { color: #666; }
.pl-row .btn { padding: 1px 7px; flex: none; }

/* friends online */
.li .dot { width: 10px; height: 10px; border-radius: 50%; background: #9a9ea6; border: 1px solid rgba(0,0,0,.35); flex: none; }
.li .dot.on { background: #2bb56c; box-shadow: 0 0 4px #2bb56c; }
.li .nm b, .li .nm small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
