:root{
  --bg:#0b1020; --text:#e7ecff; --muted:#97a3d6; --accent:#6aa8ff;
  --border: rgba(255,255,255,0.10);
}
*{ box-sizing:border-box; }
body{
  margin:0; height:100vh; display:grid; grid-template-rows: auto 1fr auto;
  background: #0a0a0a;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
#top{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
  padding:12px;
  min-height: 0;
}
#gameWrap{
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  position:relative;
  min-height: 0;
}
canvas{ width:100%; height:100%; display:block; }
#side{ display:flex; flex-direction:column; gap:12px; min-height:0; }

/* ── Habbo-style Header ── */
#hotelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: linear-gradient(180deg, #2e4a8a 0%, #1a2e5e 50%, #15234a 100%);
  border-bottom: 2px solid #4a7aff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  user-select: none;
  -webkit-user-select: none;
  z-index: 9000;
  flex-shrink: 0;
}
.hh-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hh-logo {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.hh-title {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6), 0 0 12px rgba(74,122,255,0.4);
}
.hh-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hh-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 5px 14px 5px 10px;
  font-size: 15px;
  font-weight: 700;
  color: #cde0ff;
  height: 36px;
}
.hh-stat-icon {
  font-size: 18px;
}
.hh-coins {
  color: #ffd75e;
}
.hh-disconnect {
  margin-left: 8px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,80,80,0.4);
  background: rgba(255,50,50,0.18);
  color: #ff8888;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.hh-disconnect:hover {
  background: rgba(255,50,50,0.45);
  color: #fff;
  border-color: rgba(255,80,80,0.7);
}

/* ── Admin Button ── */
.hh-admin-btn {
  margin-left: 14px;
  padding: 5px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,191,36,0.5);
  background: rgba(255,191,36,0.15);
  color: #ffd75e;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.hh-admin-btn:hover {
  background: rgba(255,191,36,0.30);
  color: #fff;
  transform: translateY(-1px);
}
.hh-admin-btn.hidden { display: none; }

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.panel header{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.panel header h2{ margin:0; font-size:14px; letter-spacing:.2px; }
.hint{ color:var(--muted); font-size:12px; }
.foot{ padding:10px 12px; color:var(--muted); font-size:12px; line-height:1.25; }

#inv{ padding:10px; display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; }
.item{
  background: rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding:10px;
  cursor:pointer; user-select:none;
  display:flex; flex-direction:column; gap:6px;
  min-height: 92px;
  transition: transform .06s ease, border-color .2s ease, background .2s ease;
}
.item:hover{ background: rgba(255,255,255,0.08); }
.item:active{ transform: translateY(1px); }
.item.selected{
  border-color: rgba(106,168,255,0.65);
  background: rgba(106,168,255,0.12);
}
.item .name{ font-weight:900; font-size:13px; }
.item .desc{ color:var(--muted); font-size:12px; line-height:1.2; }
.swatch{ height:14px; border-radius:999px; border:1px solid rgba(255,255,255,0.12); }


/* Bottom chat bar */
#chatBar{
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5000;
}
#menuIcons{
  display: flex;
  gap: 12px;
  align-items: center;
}
#chatBar.lobby-mode {
  justify-content: center;
}
#chatBar.lobby-mode #chatSection {
  display: none;
}
#chatBar.lobby-mode #status {
  display: none;
}
#chatBar.lobby-mode #menuIcons {
  justify-content: center;
}
#chatSection{
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 600px;
  align-items: center;
}
#chatInput{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  outline: none;
  background: rgba(0,0,0,0.3);
  color: var(--text);
  flex: 1;
  font-size: 14px;
}
#chatInput:focus{
  border-color: var(--accent);
  background: rgba(0,0,0,0.4);
}
#chatInput::placeholder{
  color: rgba(151,163,214,0.45);
}
#sendBtn{
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(106,168,255,0.4);
  background: rgba(106,168,255,0.18);
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
#sendBtn:hover{
  background: rgba(106,168,255,0.28);
  transform: translateY(-1px);
}
#sendBtn:active{
  transform: translateY(0);
}
#status{
  color: var(--muted);
  font-size: 11px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  white-space: nowrap;
}
.iconBtn{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 64px;
  height: 58px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
}
.iconBtn:hover{
  background: rgba(255,255,255,0.12);
  border-color: rgba(106,168,255,0.4);
  transform: translateY(-2px);
}
.iconBtn:active{
  transform: translateY(0);
}
.icon-emoji{
  font-size: 24px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.icon-label{
  font-size: 10px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.3px;
}

#popLayer.hidden{ display:none; }
#popLayer{
  position:fixed; inset:0;
  background: rgba(0,0,0,0);
  display:flex; align-items:center; justify-content:center;
  padding:18px;
  transition: background 0.2s ease;
  z-index: 6000;
  pointer-events: none;
}
#popLayer.pop-visible {
  pointer-events: auto;
  background: rgba(0,0,0,0.35);
}
.popup{
  width:min(720px, 96vw);
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(0, 0, 0, 0.94);
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  overflow:hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
}
.popup.popup-show {
  opacity: 1;
}
.popup header{
  padding:10px 14px;
  background: linear-gradient(180deg, #2e4a8a 0%, #1a2e5e 100%);
  border-bottom:2px solid #4a7aff;
  display:flex; justify-content:space-between; align-items:center;
  user-select: none;
  cursor: grab;
}
.popup header:active { cursor: grabbing; }
.popup header h3{
  margin:0; font-size:14px; font-weight:800;
  color:#fff; letter-spacing:0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.popup .content{ padding:14px; color: var(--text); flex:1; overflow-y:auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.popup .content::-webkit-scrollbar { width: 5px; }
.popup .content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.popup .content::-webkit-scrollbar-track { background: transparent; }
.closeBtn{
  background: rgba(255,255,255,0.08);
  border:none; color:var(--muted);
  font-size:18px; width:26px; height:26px;
  border-radius:7px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: background 0.15s;
  padding:0;
}
.closeBtn:hover{ background: rgba(255,255,255,0.16); color: var(--text); }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.small{ color:var(--muted); font-size:12px; }

/* ── Inventory grid layout ── */
.inv-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.inv-grid-wrap {
  flex: 1;
  min-width: 420px;
}
.inv-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}
.inv-grid-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.inv-grid-cell.inv-has-item {
  cursor: pointer;
}
.inv-grid-cell.inv-has-item:hover,
.inv-grid-cell.inv-hover {
  border-color: rgba(100,180,255,0.55);
  background: rgba(100,180,255,0.10);
}
.inv-grid-icon {
  width: 80%;
  height: 80%;
  object-fit: contain;
  image-rendering: pixelated;
}
.inv-grid-swatch {
  width: 65%;
  height: 65%;
  border-radius: 4px;
}
.inv-grid-qty {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
}
.inv-preview-panel {
  width: 160px;
  min-height: 180px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  text-align: center;
  gap: 8px;
}
.inv-preview-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
}
.inv-preview-name {
  font-weight: 700;
  font-size: 13px;
}
.inv-preview-desc {
  font-size: 11px;
  color: var(--muted);
}

/* ── Inventory action buttons ── */
.inv-preview-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}
.inv-action-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.inv-action-btn:active { transform: scale(0.96); }
.inv-place-btn {
  background: rgba(34,197,94,0.25);
  color: #7fd9a0;
  border: 1px solid rgba(34,197,94,0.3);
}
.inv-place-btn:hover { background: rgba(34,197,94,0.35); }
.inv-sell-btn {
  background: rgba(239,68,68,0.2);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}
.inv-sell-btn:hover { background: rgba(239,68,68,0.3); }
.inv-hint {
  margin-top: 8px;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}
.inv-grid-cell.inv-selected {
  border-color: rgba(99,102,241,0.7);
  background: rgba(99,102,241,0.18);
  box-shadow: 0 0 8px rgba(99,102,241,0.3);
}

/* ── Sell-back confirm extras ── */
.sell-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 13px;
}
.sell-qty-label { color: rgba(255,255,255,0.6); font-weight: 600; }
.sell-qty-btn {
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.sell-qty-btn:hover { background: rgba(255,255,255,0.14); }
.sell-qty-value { font-weight: 700; min-width: 24px; text-align: center; }
.sell-qty-avail { font-size: 11px; color: rgba(255,255,255,0.35); }
.sell-warn { font-size: 11px; line-height: 1.45; color: rgba(255,200,100,0.8); }
.sell-confirm-btn { background: rgba(239,68,68,0.35) !important; }
.sell-confirm-btn:hover { background: rgba(239,68,68,0.5) !important; }
.sell-toast-title { color: #f87171 !important; }

/* ── Shop layout (popup) ── */
.popup.popup-shop { width: min(820px, 96vw); }
.popup.popup-shop .content { padding: 0; }
.shop-layout {
  display: flex;
  min-height: 340px;
  max-height: 420px;
}
.shop-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.shop-content-area::-webkit-scrollbar { width: 5px; }
.shop-content-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.shop-content-area::-webkit-scrollbar-track { background: transparent; }
.shop-tabs-sidebar {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  background: rgba(0,0,0,0.3);
  border-left: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.shop-tabs-sidebar::-webkit-scrollbar { width: 4px; }
.shop-tabs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.shop-tabs-sidebar::-webkit-scrollbar-track { background: transparent; }
.shop-tab {
  padding: 7px 10px;
  border-radius: 0 8px 8px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.shop-tab:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.shop-tab.active { background: rgba(70,130,220,0.14); color: #7fc4ff; border-left-color: #7fc4ff; }

/* Shop main page */
.shop-main-page { padding: 8px 0; }
.shop-main-title { font-size: 18px; font-weight: 800; color: #fff; margin: 0 0 10px; text-align: center; }
.shop-main-banner { border-radius: 10px; overflow: hidden; margin-bottom: 10px; max-height: 300px; }
.shop-main-banner img { width: 100%; display: block; object-fit: contain; max-height: 300px; }
.shop-main-text { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.5; margin-bottom: 8px; }

/* Allow popups (shop/inventory) to be resized by user */
.popup { resize: both; min-width: 320px; min-height: 200px; }

/* Inventory tabs */
.inv-tabs {
  display:flex; gap:0; margin-bottom:0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.3);
  margin: -14px -14px 14px -14px;
  padding: 0;
}
.inv-tab {
  flex: 1;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
  border-bottom: 2px solid transparent;
  text-align: center;
  user-select: none;
}
.inv-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.inv-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(106,168,255,0.06); }
.inv-tab.inv-tab-disabled { opacity: 0.45; cursor: default; }
.inv-tab.inv-tab-disabled:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.55); }
.inv-coming-soon {
  display: flex; align-items: center; justify-content: center;
  min-height: 160px; color: rgba(255,255,255,0.3); font-size: 14px;
  font-style: italic; text-align: center;
}

/* Friend panel: join button when already in same room */
.fp-join-same {
  background: rgba(239,68,68,0.18) !important;
  border-color: rgba(239,68,68,0.28) !important;
  color: #ffb4b4 !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}
.fp-join-same:hover { background: rgba(239,68,68,0.18) !important; }

/* Room delete warning text */
.rs-delete-warning {
  color: #ff9090;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 8px;
}

/* Shop page banner/desc */
.shop-page-banner { border-radius: 10px; overflow: hidden; margin-bottom: 8px; max-height: 260px; }
.shop-page-banner img { width: 100%; display: block; object-fit: contain; max-height: 260px; }
.shop-page-desc { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5; margin-bottom: 8px; }

/* Shop split: grid left + detail right */
.shop-split { display: flex; gap: 14px; align-items: flex-start; }
.shop-grid-area { flex: 1; min-width: 0; }
.shop-grid {
  display: grid;
  gap: 3px;
}
.shop-grid-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.shop-grid-item:hover { border-color: rgba(100,180,255,0.55); background: rgba(100,180,255,0.10); }
.shop-grid-item.selected { border-color: rgba(99,102,241,0.7); background: rgba(99,102,241,0.18); box-shadow: 0 0 8px rgba(99,102,241,0.3); }
.shop-grid-item.shop-grid-empty { border-style: dashed; border-color: rgba(255,255,255,0.04); cursor: default; }
.shop-grid-item.shop-grid-empty:hover { border-color: rgba(255,255,255,0.04); background: rgba(255,255,255,0.03); }
.shop-grid-img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.shop-grid-swatch { width: 65%; height: 65%; border-radius: 4px; }
.shop-grid-name {
  position: absolute;
  bottom: 1px;
  left: 2px;
  right: 2px;
  font-size: 8px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.shop-grid-price {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
}

/* Shop detail area — matches inv-preview-panel */
.shop-detail-area {
  width: 160px;
  min-height: 180px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  text-align: center;
  gap: 8px;
}
.shop-detail-empty {
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}
.shop-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.shop-detail-preview {
  /* no separate box — image sits directly */
}
.shop-detail-img { width: 120px; height: 120px; object-fit: contain; image-rendering: pixelated; }
.shop-detail-swatch { width: 60px; height: 60px; border-radius: 8px; }
.shop-detail-name { font-weight: 700; font-size: 13px; color: #fff; text-align: center; }
.shop-detail-desc { font-size: 11px; color: var(--muted); text-align: center; }
.shop-detail-cost { font-size: 14px; font-weight: 800; color: #ffd700; }
.shop-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}
.shop-qty-label { font-size: 11px; color: rgba(255,255,255,0.5); }
.shop-qty-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}
.shop-qty-btn {
  width: 24px; height: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-qty-btn:hover { background: rgba(255,255,255,0.12); }
.shop-qty-input {
  width: 36px;
  text-align: center;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}
.shop-buy-btn {
  width: 100%;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  background: rgba(34,197,94,0.25);
  color: #7fd9a0;
  border: 1px solid rgba(34,197,94,0.3);
}
.shop-buy-btn:hover { background: rgba(34,197,94,0.35); }
.shop-buy-btn:active { transform: scale(0.96); }

.shop-cat-desc {
  padding: 6px 2px 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}
.shop-cat-banner { margin-bottom: 8px; }

/* ── Buy confirmation overlay ── */
.shop-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  animation: shopConfirmFadeIn 0.2s ease;
}
@keyframes shopConfirmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.shop-confirm-box {
  width: 340px;
  background: rgba(15,23,48,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: shopConfirmSlideUp 0.25s ease;
}
@keyframes shopConfirmSlideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.shop-confirm-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.shop-confirm-preview {
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-confirm-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}
.shop-confirm-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-confirm-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.shop-confirm-qty {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.shop-confirm-cost {
  font-size: 15px;
  font-weight: 800;
  color: #ffd700;
}
.shop-confirm-msg {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}
.shop-confirm-btns {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}
.shop-confirm-btns .btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: 0.15s;
}
.shop-confirm-cancel {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.7) !important;
}
.shop-confirm-cancel:hover {
  background: rgba(255,255,255,0.14) !important;
  color: #fff !important;
}
.shop-confirm-ok {
  background: rgba(70,180,100,0.7) !important;
  color: #fff !important;
}
.shop-confirm-ok:hover {
  background: rgba(70,180,100,0.9) !important;
}

/* ── Purchase success toast (stackable) ── */
.purchase-toast {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 100001;
  opacity: 0;
  transform: translateX(120px);
  transition: opacity 0.3s ease, transform 0.3s ease, top 0.3s ease;
  pointer-events: auto;
}
.purchase-toast.show {
  opacity: 1;
  transform: translateX(0);
}
.purchase-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(10,10,10,0.94);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.55);
  min-width: 270px;
  max-width: 400px;
  position: relative;
}
.purchase-toast-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.purchase-toast-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.purchase-toast-title {
  font-size: 14px;
  font-weight: 800;
  color: #7fd9a0;
}
.purchase-toast-detail {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
}
.purchase-toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.purchase-toast-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ── Permission toast styling ── */
.perm-toast-icon {
  font-size: 28px;
  min-width: 40px;
  text-align: center;
}
.perm-granted {
  border-left: 3px solid #4caf50;
}
.perm-revoked {
  border-left: 3px solid #f44336;
}

/* ── Error toast styling (permission-denied style) ── */
.err-toast-inner {
  border-left: 3px solid #f44336;
}
.err-toast-icon {
  font-size: 28px;
  min-width: 40px;
  text-align: center;
  color: #f44336;
  font-weight: 800;
}
.err-toast-title {
  color: #f87171 !important;
}

/* ── Friend accepted toast styling ── */
.friend-accepted-inner {
  border-left: 3px solid #4caf50;
}
.friend-accepted-icon {
  font-size: 28px;
  min-width: 40px;
  text-align: center;
}
.friend-accepted-title {
  color: #7fd9a0 !important;
}

/* ── Shop tile grid ── */
.shop-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.shop-tile-card {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.shop-tile-card:hover {
  border-color: rgba(100,180,255,0.45);
  background: rgba(100,180,255,0.08);
}
.shop-tile-img-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-tile-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.shop-tile-swatch {
  width: 48px;
  height: 48px;
  border-radius: 6px;
}
.shop-tile-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.shop-tile-price {
  font-size: 11px;
  color: var(--muted);
}
.shop-tile-buy {
  padding: 3px 10px !important;
  font-size: 11px !important;
}

/* ── Tile preview bar ── */
#tilePreviewBar,
#wallPreviewBar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  animation: tileBarSlideIn 0.25s ease;
}
@keyframes tileBarSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.tile-preview-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(15,23,48,0.94);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}
.tile-preview-label {
  font-size: 14px;
  color: var(--text);
}
.tile-preview-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.tile-accept {
  background: rgba(40,180,100,0.25);
  color: #5fdb8f;
}
.tile-accept:hover {
  background: rgba(40,180,100,0.40);
}
.tile-cancel {
  background: rgba(220,60,60,0.20);
  color: #f07070;
}
.tile-cancel:hover {
  background: rgba(220,60,60,0.35);
}

/* ── Friends badge on icon ── */
#friendsBtn { position: relative; }
.friends-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff4444;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: badgePulse 0.6s ease;
  box-sizing: border-box;
}
.friends-badge.hidden { display: none; }
@keyframes badgePulse {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Friends panel (reuses nav-panel base) ── */
#friendsPanel {
  z-index: 5000;
}
.fp-tabs {
  background: rgba(0,0,0,0.3);
  padding: 0;
}
.fp-body {
  min-height: 120px;
  display: flex;
  flex-direction: column;
}
.fp-req-count {
  display: inline-block;
  background: rgba(220, 70, 70, 0.7);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 5px;
  margin-left: 3px;
}

/* Chat tab unread badge — subtle pill */
.fp-chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 80, 80, 0.55);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 7px;
  min-width: 16px;
  height: 15px;
  padding: 0 4px;
  margin-left: 4px;
  line-height: 1;
}

/* Status dot inside chat sub-tab */
.fp-chat-tab-status {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

/* Body */
.fp-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 30px 0;
}
.fp-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 6px 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fp-friend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  transition: background 0.12s;
}
.fp-friend-row:hover { background: rgba(255,255,255,0.05); }
.fp-friend-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fp-online { background: #3dd68c; box-shadow: 0 0 5px #3dd68c; }
.fp-offline { background: #666; }
.fp-friend-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-friend-actions { display: flex; gap: 4px; }
.fp-icon-btn {
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.fp-icon-btn:hover { background: rgba(255,255,255,0.16); }
.fp-icon-btn:disabled { opacity: 0.3; cursor: default; }
.fp-accept-btn { background: rgba(60,200,120,0.18); color: #5fdb8f; }
.fp-accept-btn:hover { background: rgba(60,200,120,0.32); }
.fp-remove-btn { background: rgba(220,60,60,0.14); color: #f07070; font-size: 11px; }
.fp-remove-btn:hover { background: rgba(220,60,60,0.28); }
.fp-tag {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

/* Search */
.fp-search-wrap { padding: 2px 0 8px; }
.fp-search-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.fp-search-input:focus { border-color: rgba(91,157,255,0.5); }

/* Room hint next to online friend name */
.fp-room-hint {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  margin-left: 4px;
}

/* Join room button */
.fp-join-btn { background: rgba(60,130,255,0.18); color: #7bb8ff; }
.fp-join-btn:hover { background: rgba(60,130,255,0.32); }

/* Intro button */
.fp-intro-btn { background: rgba(200,160,60,0.18); color: #e0c060; }
.fp-intro-btn:hover { background: rgba(200,160,60,0.32); }
.fp-intro-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Chat tab (integrated inside panel) ── */
.fp-chat-subtabs {
  display: flex;
  gap: 2px;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  flex-shrink: 0;
}
.fp-chat-subtabs::-webkit-scrollbar { height: 3px; }
.fp-chat-subtabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.fp-chat-subtab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
  font-size: 12px;
  color: var(--muted);
}
.fp-chat-subtab:hover { background: rgba(255,255,255,0.10); }
.fp-chat-subtab.active {
  background: rgba(91,157,255,0.18);
  color: var(--text);
}
.fp-chat-subtab-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.fp-chat-subtab-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}
.fp-chat-subtab-close:hover { background: rgba(220,60,60,0.3); color: #f07070; }

/* Chat messages area */
.fp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}
.fp-chat-messages::-webkit-scrollbar { width: 4px; }
.fp-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.pm-msg {
  max-width: 85%;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-msg-me {
  align-self: flex-end;
  background: rgba(91,157,255,0.22);
  color: #a8cdff;
  border-bottom-right-radius: 4px;
}
.pm-msg-them {
  align-self: flex-start;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.pm-msg-text { display: inline; }
.pm-msg-time {
  font-size: 9px;
  color: var(--muted);
  opacity: 0.6;
  align-self: flex-end;
}

/* System messages (online/offline) */
.fp-chat-system {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 3px 0;
  font-style: italic;
}

/* Chat input row */
.fp-chat-typing {
  padding: 2px 12px 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-style: italic;
  flex-shrink: 0;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fp-chat-typing.hidden { display: none; }
.fp-typing-dots {
  display: inline-flex;
  gap: 2px;
}
.fp-typing-dots::before,
.fp-typing-dots::after,
.fp-typing-dots span { content: ''; }
.fp-typing-dots::before,
.fp-typing-dots::after {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  animation: fpDotBounce 1.2s infinite ease-in-out;
}
.fp-typing-dots::before { animation-delay: 0s; }
.fp-typing-dots::after { animation-delay: 0.4s; }
@keyframes fpDotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}
.fp-chat-input-wrap {
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  position: relative;
}
.fp-chat-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.fp-chat-input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.fp-chat-input:focus { border-color: rgba(91,157,255,0.5); }
.fp-emoji-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.12s;
  flex-shrink: 0;
  line-height: 1;
}
.fp-emoji-btn:hover { background: rgba(255,255,255,0.1); }
.fp-emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 8px; right: 8px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(15,20,40,0.97);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
.fp-emoji-picker.hidden { display: none; }
.fp-emoji-picker::-webkit-scrollbar { width: 4px; }
.fp-emoji-picker::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.fp-emoji-item {
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
  user-select: none;
}
.fp-emoji-item:hover { background: rgba(255,255,255,0.12); }
.fp-chat-send {
  border: none;
  background: rgba(91,157,255,0.22);
  color: #7cc4ff;
  border-radius: 10px;
  width: 34px; height: 32px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
}
.fp-chat-send:hover { background: rgba(91,157,255,0.38); }

/* ── Status bar at bottom of friends panel ── */
.fp-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  border-radius: 0 0 18px 18px;
}
.fp-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fp-status-online { background: #3dd68c; box-shadow: 0 0 6px #3dd68c; }
.fp-status-busy { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.fp-status-afk { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.fp-status-invisible { background: #666; }
.fp-status-offline { background: #666; }
.fp-status-select {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
}
.fp-status-select:hover { background: rgba(255,255,255,0.12); }
.fp-status-select option { background: #1a1d2e; color: #fff; }

/* Status dot colors in friend rows */
.fp-busy { background: #ef4444; box-shadow: 0 0 5px #ef4444; }
.fp-afk { background: #f59e0b; box-shadow: 0 0 5px #f59e0b; }

/* ── Maintenance overlay ── */
#maintenance.hidden { display: none; }
#maintenance {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 30, 0.92);
  backdrop-filter: blur(12px);
  animation: maintFadeIn .35s ease;
}
@keyframes maintFadeIn { from { opacity: 0; } to { opacity: 1; } }
.maint-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 48px 56px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 420px;
}
.maint-icon { font-size: 56px; margin-bottom: 12px; }
.maint-card h2 {
  margin: 0 0 8px; font-size: 22px; font-weight: 900;
  color: var(--text);
}
.maint-card p {
  margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5;
}
.maint-spinner {
  width: 32px; height: 32px; margin: 0 auto 16px;
  border: 3px solid rgba(106,168,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: maintSpin .8s linear infinite;
}
@keyframes maintSpin { to { transform: rotate(360deg); } }
.maint-status { font-size: 13px; color: var(--muted); margin-bottom: 0 !important; }

/* ── Lobby overlay ── */
#lobbyOverlay.hidden { display: none; }
#lobbyOverlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 4000;
  display: flex; flex-direction: column;
  pointer-events: auto;
}
.lobby-bg {
  flex: 1;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(106,168,255,0.15), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(22,185,129,0.10), transparent 50%),
    linear-gradient(180deg, #0d1528 0%, #162040 40%, #1a2850 100%);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto;
}
.lobby-content { text-align: center; padding: 40px 20px; }
.lobby-logo { font-size: 72px; margin-bottom: 8px; filter: drop-shadow(0 4px 20px rgba(106,168,255,0.4)); }
.lobby-title {
  margin: 0; font-size: 36px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #2dd4a0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lobby-sub { color: var(--muted); font-size: 14px; margin: 8px 0 28px; }
.lobby-rooms {
  display: flex; justify-content: center; gap: 14px;
  width: 100%; max-width: none; margin: 0 auto;
}

/* Lobby hero image (center of lobby screen) */
/* lobby hero removed */
.lobby-hero {
  width: min(100%, calc(100vw - 80px));
  height: auto;
  max-height: calc(100vh - 220px);
  border-radius: 14px;
  display: block;
  margin: 18px auto 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  object-fit: contain;
}
.lobby-room-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: transform .1s ease, border-color .2s ease, background .2s ease;
}
.lobby-room-card:hover {
  background: rgba(106,168,255,0.12);
  border-color: rgba(106,168,255,0.45);
  transform: translateY(-2px);
}
.lobby-room-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--text); }
.lobby-room-card .room-desc { color: var(--muted); font-size: 12px; }

/* ── Navigator panel ── */
.nav-panel.hidden { display: none; }
.nav-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5000;
  width: 480px;
  min-width: 340px;
  min-height: 300px;
  max-height: 80vh;
  background: rgba(0, 0, 0, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Navigator resize handle ── */
.nav-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-resize-handle::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,0.25);
  border-bottom: 2px solid rgba(255,255,255,0.25);
  border-radius: 0 0 3px 0;
}
.nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, #2e4a8a 0%, #1a2e5e 100%);
  border-bottom: 2px solid #4a7aff;
  user-select: none;
  cursor: grab;
}
.nav-panel-header:active { cursor: grabbing; }
.nav-panel-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.nav-panel-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--muted);
  font-size: 18px;
  width: 26px; height: 26px;
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.nav-panel-close:hover { background: rgba(255,255,255,0.16); color: var(--text); }
.nav-panel-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.3);
  padding: 0;
}
.nav-tab {
  flex: 1;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-bottom: 2px solid transparent;
  text-align: center;
}
.nav-tab:hover:not(.disabled) { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(106,168,255,0.06);
}
.nav-tab.disabled {
  color: rgba(151,163,214,0.4);
  cursor: not-allowed;
  opacity: 0.5;
}
.nav-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nav-panel-body::-webkit-scrollbar { width: 5px; }
.nav-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.nav-tab-content { display: none; }
.nav-tab-content.active { display: block; }
.nav-room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 8px;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.nav-room-card:hover {
  background: rgba(106,168,255,0.10);
  border-color: rgba(106,168,255,0.35);
}
.nav-room-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.nav-room-info h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.nav-room-info .nav-room-desc {
  font-size: 11px;
  color: var(--muted);
}
.nav-room-go {
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid rgba(106,168,255,0.40);
  background: rgba(106,168,255,0.18);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.nav-room-go:hover {
  background: rgba(106,168,255,0.35);
}
.nav-coming-soon {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 10px;
  font-style: italic;
}

/* ── Navigator sub-tabs (inside Private Rooms) ── */
.nav-private-subtabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 4px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
}
.nav-subtab {
  flex: 0 0 auto;
  padding: 5px 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
}
.nav-subtab:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-subtab.active {
  color: #fff;
  background: rgba(106,168,255,0.25);
}
.nav-subtab-content { display: none; }
.nav-subtab-content.active { display: block; }

/* ── Navigator search bar ── */
.nav-search-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.nav-search-input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.nav-search-input:focus { border-color: var(--accent); }
.nav-search-input::placeholder { color: var(--muted); }
.nav-search-btn {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(106,168,255,0.40);
  background: rgba(106,168,255,0.18);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-search-btn:hover { background: rgba(106,168,255,0.35); }

/* ── Room Info panel (bottom-left of game area) ── */
.room-info-panel.hidden { display: none; }
.room-info-panel {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 100;
  width: 240px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 12px 14px 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  user-select: none;
}
.ri-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ri-title {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.ri-like-btn {
  background: rgba(106,168,255,0.10);
  border: 1px solid rgba(106,168,255,0.25);
  color: #7ec8ff;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.ri-like-btn:hover { background: rgba(106,168,255,0.22); border-color: rgba(106,168,255,0.5); }
.ri-like-btn.liked { color: #2979ff; border-color: rgba(41,121,255,0.6); background: rgba(41,121,255,0.18); }
.ri-desc {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.35;
  max-height: 32px;
  overflow: hidden;
}
.ri-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ri-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ri-btn:hover { background: rgba(255,255,255,0.12); }
.ri-default-btn { color: #ffd75e; }
.ri-default-btn.is-default { color: #2dd4a0; }
.ri-default-btn.is-default-remove { color: #ff6b6b; }
.ri-default-btn.hidden { display: none; }

/* Floor style controls */
.ri-floor-details {
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 4px;
}
.ri-floor-summary {
  cursor: pointer;
  font-size: 12px;
  padding: 3px 0;
  color: var(--muted);
  user-select: none;
}
.ri-floor-summary:hover { color: var(--text); }
.ri-floor-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}
.ri-floor-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ri-floor-color-input {
  width: 28px;
  height: 22px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: none;
  padding: 0;
}
.ri-floor-select {
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.ri-floor-apply-btn {
  font-size: 11px !important;
  padding: 3px 10px !important;
  background: rgba(100,180,255,0.15);
  color: #7cc4ff;
}
.ri-floor-apply-btn:hover {
  background: rgba(100,180,255,0.28);
}
.ri-floor-tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.ri-floor-remove-btn {
  font-size: 11px !important;
  padding: 3px 10px !important;
  background: rgba(220,60,60,0.18);
  color: #f07070;
  margin-left: 6px;
}
.ri-floor-remove-btn:hover {
  background: rgba(220,60,60,0.35);
}
#riFloorTileActive {
  display: flex;
  align-items: center;
  gap: 8px;
}
#riWallTileActive {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ri-wall-hide-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
  cursor: pointer;
  user-select: none;
}
.ri-wall-hide-label input[type="checkbox"] {
  accent-color: #7b9ec4;
  cursor: pointer;
}

/* Users popup */
.ri-users-popup.hidden { display: none; }
.ri-users-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 220px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.94);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 110;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ri-users-popup::-webkit-scrollbar { width: 4px; }
.ri-users-popup::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.ri-users-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.ri-users-popup-close {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px;
}
.ri-users-popup-close:hover { color: var(--text); }
.ri-users-list {
  padding: 6px 10px 8px;
}
.ri-user-item {
  padding: 4px 0;
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ri-user-item .ri-user-icon { font-size: 14px; }

/* Online count in room info - bigger and light blue */
#riUserCount {
  font-size: 15px;
  font-weight: 900;
  color: #7ec8ff;
}
#riUsersBtn {
  font-size: 13px;
}

/* ── Room Settings popup ── */
.room-settings-overlay.hidden { display: none; }
.room-settings-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5500;
  width: 380px;
  max-height: 80vh;
  background: rgba(0, 0, 0, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.room-settings-panel {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.rs-header {
  display: flex;
  align-items: center;
  cursor: grab;
  user-select: none;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #2e4a8a 0%, #1a2e5e 100%);
  border-bottom: 2px solid #4a7aff;
  border-radius: 16px 16px 0 0;
}
.rs-header span {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.rs-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--muted);
  font-size: 18px;
  width: 26px; height: 26px;
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rs-close:hover { background: rgba(255,255,255,0.16); color: var(--text); }
.rs-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rs-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rs-input {
  width: 100%;
  font-size: 13px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}
.rs-input:focus { border-color: rgba(106,168,255,0.5); background: rgba(255,255,255,0.12); }
.rs-select {
  width: 100%;
  font-size: 13px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
}
.rs-select option {
  background: #1a2040;
  color: var(--text);
}
.rs-access-opts {
  display: flex;
  gap: 6px;
}
.rs-access-opt {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rs-access-opt:hover { background: rgba(255,255,255,0.06); }
.rs-access-opt.active {
  border-color: rgba(106,168,255,0.5);
  background: rgba(106,168,255,0.12);
  color: var(--accent);
}
.rs-pw-row.hidden { display: none; }
.rs-save-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #4a7aff 0%, #6b5ce7 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.rs-save-btn:hover { opacity: 0.88; }
.rs-delete-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,60,60,0.4);
  background: rgba(255,50,50,0.12);
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.rs-delete-btn:hover { background: rgba(255,50,50,0.25); color: #ff4444; }
.rs-perm-info {
  background: rgba(70,130,255,0.15);
  color: #8ab4ff;
  border: 1px solid rgba(70,130,255,0.3);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.rs-perm-info.hidden { display: none; }
.rs-delete-confirm.hidden { display: none; }
.rs-delete-confirm {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.rs-delete-yes {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: #ff4444;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.rs-delete-no {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* Room Settings button in chat bar */
.iconBtn.room-settings-btn.hidden { display: none; }

/* ── Navigator room card capacity colors (now handled via inline style) ── */
/* Kept as fallbacks */
.nav-room-card.room-full {
  border-color: rgba(239,68,68,0.45);
  background: rgba(239,68,68,0.22);
}
.nav-room-card.room-almost-full {
  border-color: rgba(245,158,11,0.45);
  background: rgba(245,158,11,0.20);
}
.nav-room-card.room-available {
  border-color: rgba(106,168,255,0.25);
  background: rgba(106,168,255,0.04);
}
.nav-room-card.room-occupied {
  background: rgba(34,197,94,0.25);
}

/* ── Room thumbnail in navigator card ── */
.nav-room-thumb {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  margin-right: 10px;
  image-rendering: pixelated;
}
.nav-room-likes {
  font-size: 11px;
  color: #7ec8ff;
  margin-left: 4px;
}
.nav-room-players {
  font-size: 13px;
  font-weight: 800;
}
.nav-room-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ── Category tab in navigator ── */
.nav-category-bar {
  display: flex;
  gap: 4px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.nav-cat-chip {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nav-cat-chip:hover { background: rgba(255,255,255,0.08); }
.nav-cat-chip.active {
  border-color: rgba(106,168,255,0.5);
  background: rgba(106,168,255,0.12);
  color: var(--accent);
}
.nav-cat-admin.hidden { display: none; }
.nav-cat-admin {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.nav-cat-admin-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,191,36,0.3);
  background: rgba(255,191,36,0.08);
  color: #ffd75e;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.nav-cat-admin-btn:hover { background: rgba(255,191,36,0.18); }

/* Category management overlay */
.cat-manage-overlay.hidden { display: none; }
.cat-manage-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-manage-panel {
  width: 320px;
  background: rgba(0, 0, 0, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8);
  overflow: hidden;
}
.cat-manage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #2e4a8a 0%, #1a2e5e 100%);
  border-bottom: 2px solid #4a7aff;
}
.cat-manage-header span {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.cat-manage-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--muted);
  font-size: 18px;
  width: 26px; height: 26px;
  border-radius: 7px;
  cursor: pointer;
}
.cat-manage-body {
  padding: 12px 14px;
  max-height: 300px;
  overflow-y: auto;
}
.cat-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cat-manage-item-name {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.cat-manage-item-btns {
  display: flex;
  gap: 4px;
}
.cat-manage-item-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.cat-manage-item-btn:hover { background: rgba(255,255,255,0.10); }
.cat-manage-item-btn.delete { color: #ff6b6b; border-color: rgba(255,80,80,0.2); }
.cat-manage-add {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.cat-manage-add input {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 8px;
  outline: none;
}
.cat-manage-add button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #4a7aff, #6b5ce7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Player info card ── */
.player-card.hidden { display: none; }
/* ── Player Context Menu ── */
.player-ctx-menu {
  position: absolute;
  z-index: 150;
  min-width: 180px;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.7);
  padding: 6px 0;
  pointer-events: auto;
}
.player-ctx-menu.hidden { display: none; }
.ctx-menu-name {
  padding: 6px 14px 4px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #e7ecff;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .12s;
}
.ctx-menu-item:hover { background: rgba(255,255,255,0.12); }
.ctx-menu-item.hidden { display: none; }
.ctx-menu-item.ctx-menu-danger { color: #ef4444; }
.ctx-menu-item.ctx-menu-danger:hover { background: rgba(239,68,68,0.18); }

/* ── Room Info permissions / ban list ── */
.ri-list {
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 6px;
}
.ri-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ri-list-item:last-child { border-bottom: none; }
.ri-list-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  transition: opacity .15s;
}
.ri-list-remove:hover { opacity: 0.7; }
.ri-list-add {
  display: flex;
  gap: 4px;
  align-items: center;
}
.ri-list-select {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  padding: 3px 4px;
  font-family: inherit;
}
.ri-list-add-btn {
  font-size: 11px;
  padding: 3px 8px;
}
.ri-list-empty {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 4px;
}

.player-card {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  width: 260px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  padding: 14px 16px 12px;
  text-align: left;
  transition: opacity .25s ease, transform .25s ease;
  opacity: 1;
  transform: translateY(0);
}
.player-card.fade-out {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.player-card-close {
  position: absolute;
  top: 8px; right: 10px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--muted);
  font-size: 18px;
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.player-card-close:hover { background: rgba(255,255,255,0.16); color: var(--text); }
.player-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.player-card-avatar {
  font-size: 36px;
  flex-shrink: 0;
}
.player-card-info {
  flex: 1;
  min-width: 0;
}
.player-card-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-card-motto {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  min-height: 16px;
}
.player-card-motto-input {
  width: 100%;
  font-size: 12px;
  color: var(--text);
  font-style: italic;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  min-height: 16px;
}
.player-card-motto-input:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.12);
}
.player-card-motto-input.hidden { display: none; }
.player-card-motto.hidden { display: none; }
.player-card-section {
  margin-bottom: 8px;
}
.player-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 3px;
}
.player-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 20px;
  min-height: 24px;
}
.player-card-value {
  font-size: 13px;
  color: var(--text);
}

/* ── Player card: Add Friend button ── */
.pc-add-friend-btn {
  width: 100%;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
.pc-add-friend-btn:hover { filter: brightness(1.1); }
.pc-add-friend-btn:active { filter: brightness(0.95); }
.pc-add-friend-btn.hidden { display: none; }

.pc-remove-friend-btn {
  width: 100%;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
.pc-remove-friend-btn:hover { filter: brightness(1.1); }
.pc-remove-friend-btn:active { filter: brightness(0.95); }
.pc-remove-friend-btn.hidden { display: none; }

.pc-friend-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.pc-friend-tag.hidden { display: none; }
.pc-friend-ok {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.pc-friend-pending {
  background: rgba(250,204,21,0.15);
  color: #facc15;
}

/* ── Furniture info card ── */
.furni-card { z-index: 101; }
.furni-card-img {
  width: 64px;
  height: auto;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.furni-card-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.furni-card-btn:hover { background: rgba(255,255,255,0.18); }
.furni-card-remove { background: rgba(220,38,38,0.25); border-color: rgba(220,38,38,0.4); }
.furni-card-remove:hover { background: rgba(220,38,38,0.45); }

/* ── Chat log slide-down panel ── */
#chatLogPanel {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transform: translateY(calc(-100% + 28px));
  transition: none;
}
#chatLogPanel.open {
  pointer-events: auto;
}
#chatLogBody {
  background: rgba(0,0,0,0.35);
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
#chatLogBody::-webkit-scrollbar { width: 5px; }
#chatLogBody::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
#chatLogBody::-webkit-scrollbar-track { background: transparent; }
#chatLogBody:empty::before {
  content: 'No messages yet…';
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 16px 0;
  background: rgba(255,255,255,0.92);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
}
#chatLogHandle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  cursor: grab;
  background: rgba(0, 0, 0, 0.45);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  margin: 0 auto;
  width: 120px;
  user-select: none;
  -webkit-user-select: none;
}
#chatLogHandle:active { cursor: grabbing; }
.chatlog-handle-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.35);
}
/* Each message looks like a chat bubble */
.chatlog-msg {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 5px 10px 5px 6px;
  font: 13px ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: rgba(15,23,48,0.85);
  line-height: 1.4;
  align-self: flex-start;
  max-width: 45%;
  word-wrap: break-word;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.chatlog-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #6aa8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}
.chatlog-text {
  flex: 1;
  min-width: 0;
}
.chatlog-msg .chatlog-name {
  font-weight: 700;
  color: rgba(15,23,48,1);
}
.chatlog-msg .chatlog-time {
  font-size: 10px;
  color: rgba(15,23,48,0.4);
  float: right;
  margin-left: 8px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Room loading overlay ── */
#roomLoading.hidden { display: none; }
#roomLoading {
  position: fixed; inset: 0; z-index: 8500;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(30,60,130,0.25), transparent 60%),
    linear-gradient(180deg, #0a0e1a 0%, #101830 50%, #0d1528 100%);
  animation: roomLoadFadeIn 0.3s ease;
}
@keyframes roomLoadFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.room-loading-card {
  text-align: center;
  padding: 40px 50px;
  max-width: 360px;
}
.room-loading-icon {
  font-size: 52px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 16px rgba(106,168,255,0.3));
  animation: roomLoadBounce 1.2s ease-in-out infinite;
}
@keyframes roomLoadBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.room-loading-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.3px;
}
.room-loading-bar-track {
  width: 260px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
  margin: 0 auto 14px;
}
.room-loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4a7aff, #6aa8ff, #2dd4a0);
  box-shadow: 0 0 10px rgba(106,168,255,0.5);
  transition: width 0.3s ease;
}
.room-loading-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

/* ── Logout overlay ── */
#logoutOverlay.hidden { display: none; }
#logoutOverlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,12,30,0.95);
  backdrop-filter: blur(8px);
  animation: logoutFadeIn 0.2s ease;
}
@keyframes logoutFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.logout-card {
  text-align: center;
  padding: 48px 56px;
  max-width: 360px;
}
.logout-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 16px rgba(106,168,255,0.3));
  animation: logoutWave 1s ease-in-out infinite;
}
@keyframes logoutWave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(14deg); }
  75% { transform: rotate(-14deg); }
}
.logout-title {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.3px;
}
.logout-spinner {
  width: 40px; height: 40px;
  margin: 0 auto;
  border: 3px solid rgba(106,168,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: logoutSpin 0.8s linear infinite;
}
@keyframes logoutSpin {
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════════════
   Admin Tools
   ════════════════════════════════════════════════════════════════════ */

/* Admin dropdown menu */
.admin-menu {
  position: fixed;
  top: 60px; left: 20px;
  z-index: 9500;
  width: 280px;
  background: rgba(15,23,48,0.97);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: adminMenuIn 0.15s ease;
}
@keyframes adminMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.admin-menu-header {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #ffd75e;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.admin-menu-item:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
}
.admin-menu-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.admin-menu-icon {
  font-size: 22px;
  width: 32px; text-align: center;
}
.admin-menu-label {
  font-size: 14px;
  font-weight: 700;
}
.admin-menu-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Draggable/Resizable Window ── */
.admin-window {
  position: fixed;
  background: rgba(12,18,38,0.97);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: adminWinIn 0.2s ease;
}
@keyframes adminWinIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.admin-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}
.admin-window-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.admin-window-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}
.admin-window-maximize {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.admin-window-maximize:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.admin-window-close {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,80,80,0.3);
  background: rgba(255,50,50,0.12);
  color: #ff8888;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.admin-window-close:hover {
  background: rgba(255,50,50,0.35);
  color: #fff;
}
.admin-window-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-window-resizer {
  position: absolute;
  bottom: 0; right: 0;
  width: 18px; height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.15) 50%);
  border-radius: 0 0 14px 0;
}

/* ── Room Model Generator ── */
.rmg-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.2);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.rmg-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rmg-toolbar-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.rmg-input {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.rmg-input:focus {
  border-color: var(--accent);
}
.rmg-num {
  width: 54px;
  text-align: center;
}
.rmg-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.rmg-btn:hover {
  background: rgba(255,255,255,0.12);
}
.rmg-btn-save {
  border-color: rgba(45,212,160,0.4);
  background: rgba(45,212,160,0.12);
  color: #2dd4a0;
  font-weight: 800;
}
.rmg-btn-save:hover {
  background: rgba(45,212,160,0.25);
}
.rmg-tools {
  display: flex;
  gap: 4px;
}
.rmg-floor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  max-width: 400px;
}
.rmg-floor-tool-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  user-select: none;
}
.rmg-tool {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.rmg-tool:hover {
  background: rgba(255,255,255,0.12);
}
.rmg-tool.active {
  border-color: var(--accent);
  background: rgba(106,168,255,0.18);
  box-shadow: 0 0 8px rgba(106,168,255,0.3);
}
.rmg-status {
  min-height: 0;
  padding: 0;
  font-size: 12px;
  transition: all 0.2s;
}
.rmg-status:not(:empty) {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rmg-status.ok { color: #2dd4a0; background: rgba(45,212,160,0.08); }
.rmg-status.err { color: #ff6b6b; background: rgba(255,107,107,0.08); }
.rmg-canvas-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #0c1226;
}
.rmg-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.rmg-zoom-label {
  display: inline-block;
  min-width: 42px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
}

/* ── RMG 2-Column Layout ── */
.rmg-layout {
  display: flex;
  flex-direction: row;
  height: 100%;
  min-height: 0;
}
.rmg-sidebar {
  width: 220px;
  min-width: 180px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.18);
  flex-shrink: 0;
}
.rmg-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rmg-sidebar-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.rmg-btn-new {
  border-color: rgba(45,212,160,0.4);
  background: rgba(45,212,160,0.10);
  color: #2dd4a0;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 10px;
}
.rmg-btn-new:hover {
  background: rgba(45,212,160,0.22);
}
.rmg-sidebar-search {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rmg-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.rmg-sidebar-loading,
.rmg-sidebar-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 14px 12px;
  text-align: center;
}
.rmg-sidebar-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 3px solid transparent;
}
.rmg-sidebar-item:hover {
  background: rgba(255,255,255,0.05);
}
.rmg-sidebar-item.active {
  background: rgba(106,168,255,0.12);
  border-left-color: var(--accent);
}
.rmg-sidebar-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rmg-sidebar-item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rmg-sidebar-item-meta {
  font-size: 10px;
  color: var(--muted);
}
.rmg-sidebar-item-del {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255,80,80,0.2);
  background: rgba(255,50,50,0.06);
  color: #ff8888;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  flex-shrink: 0;
  opacity: 0;
}
.rmg-sidebar-item:hover .rmg-sidebar-item-del {
  opacity: 1;
}
.rmg-sidebar-item-del:hover {
  background: rgba(255,50,50,0.28);
  color: #fff;
}
.rmg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── RMG Divider / Empty State / Editor Header ── */
.rmg-divider {
  width: 5px;
  cursor: col-resize;
  background: rgba(255,255,255,0.06);
  transition: background 0.15s;
  flex-shrink: 0;
}
.rmg-divider:hover,
.rmg-divider:active {
  background: rgba(100,180,255,0.25);
}

.rmg-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}

.rmg-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.rmg-editor-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #e0e6f0;
}

.rmg-btn-discard {
  background: rgba(255,255,255,0.06);
  color: #a0a8b8;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.rmg-btn-discard:hover {
  background: rgba(255,255,255,0.12);
  color: #d0d4dc;
}

/* ── Floor Tabs Bar ── */
.rmg-floor-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  overflow-x: auto;
}
.rmg-floor-bar:empty { display: none; }
.rmg-floor-tab {
  position: relative;
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
}
.rmg-floor-tab:hover { background: rgba(255,255,255,0.10); color: var(--text); }
.rmg-floor-tab.active {
  border-color: var(--accent);
  background: rgba(106,168,255,0.18);
  color: var(--text);
  box-shadow: 0 0 6px rgba(106,168,255,0.2);
}
.rmg-floor-tab-add {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px dashed rgba(45,212,160,0.4);
  background: rgba(45,212,160,0.06);
  color: #2dd4a0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s;
}
.rmg-floor-tab-add:hover { background: rgba(45,212,160,0.18); }
.rmg-floor-tab-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  margin-left: 6px;
  border-radius: 4px;
  background: rgba(255,50,50,0.15);
  color: #ff8888;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.12s;
  vertical-align: middle;
}
.rmg-floor-tab-del:hover { background: rgba(255,50,50,0.4); color: #fff; }

/* ── Stair Config Panel ── */
.rmg-stair-config {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(40,30,10,0.4);
  border-bottom: 1px solid rgba(255,200,80,0.15);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.rmg-stair-config label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,200,120,0.85);
}
.rmg-stair-config select,
.rmg-stair-config input {
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,200,80,0.25);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 12px;
  outline: none;
  width: 56px;
}
.rmg-stair-config select:focus,
.rmg-stair-config input:focus { border-color: rgba(255,200,80,0.6); }
.rmg-stair-hint {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
}

/* ── In-game Floor Indicator ── */
.floor-indicator {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.55);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 200;
  pointer-events: none;
  user-select: none;
}
.floor-ind-tab {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
}
.floor-ind-tab.active {
  color: #fff;
  background: rgba(106,168,255,0.5);
  box-shadow: 0 0 6px rgba(106,168,255,0.4);
}

/* ═══════════════════════════════════════════
   Private Rooms — Create Room Form
   ═══════════════════════════════════════════ */

.nav-create-room-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px dashed rgba(106,168,255,0.45);
  background: rgba(106,168,255,0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-create-room-btn:hover {
  background: rgba(106,168,255,0.20);
  border-color: rgba(106,168,255,0.7);
}

.nav-room-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-room-players {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-access-icon {
  font-size: 12px;
  margin-left: 4px;
}
.nav-private-card .nav-room-desc {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Create Room window (navigator-style) ── */
.create-room-overlay.hidden { display: none; }

.create-room-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5100;
  width: 460px;
  min-width: 360px;
  min-height: 340px;
  max-height: 85vh;
  background: rgba(0, 0, 0, 0.94);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.create-room-panel.hidden { display: none; }

.create-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(180deg, #2e4a8a 0%, #1a2e5e 100%);
  border-bottom: 2px solid #4a7aff;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  user-select: none;
  cursor: grab;
}
.create-room-header:active { cursor: grabbing; }

.cr-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cr-resize-handle::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,0.25);
  border-bottom: 2px solid rgba(255,255,255,0.25);
  border-radius: 0 0 3px 0;
}

.create-room-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.cr-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 4px;
}
.cr-req { color: #ff6b6b; }

.cr-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cr-input:focus {
  border-color: var(--accent);
}

/* Model picker buttons */
.cr-model-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.cr-model-loading {
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
  width: 100%;
  text-align: center;
}
.cr-model-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cr-model-btn:hover {
  background: rgba(106,168,255,0.12);
  border-color: rgba(106,168,255,0.3);
}
.cr-model-btn.selected {
  border-color: var(--accent);
  background: rgba(106,168,255,0.18);
}
.cr-model-btn-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.cr-model-btn-size {
  font-size: 10px;
  color: var(--muted);
}

/* Model preview */
.cr-model-preview {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
  padding: 8px;
  text-align: center;
}
.cr-model-preview.hidden { display: none; }
.cr-model-preview canvas {
  border-radius: 6px;
  width: 100%;
  max-width: 420px;
}

/* Access type radios */
.cr-access-opts {
  display: flex;
  gap: 8px;
}
.cr-radio {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 12px;
  color: var(--text);
}
.cr-radio:hover {
  background: rgba(255,255,255,0.06);
}
.cr-radio input[type="radio"] {
  accent-color: var(--accent);
}
.cr-radio span {
  white-space: nowrap;
}

.cr-password-row.hidden { display: none; }

.cr-error {
  color: #ff6b6b;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,80,80,0.08);
  border: 1px solid rgba(255,80,80,0.2);
}
.cr-error.hidden { display: none; }

.cr-submit {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #4a7aff 0%, #6b5ce7 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 6px;
}
.cr-submit:hover { opacity: 0.88; }
.cr-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════
   Doorbell & Password overlays
   ═══════════════════════════════════════════ */

.doorbell-overlay {
  position: fixed;
  inset: 0;
  z-index: 5500;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.doorbell-overlay.hidden { display: none; }

.doorbell-panel {
  width: 340px;
  padding: 28px 24px;
  background: rgba(0, 0, 0, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.doorbell-icon {
  font-size: 42px;
  line-height: 1;
}

.doorbell-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.doorbell-sub {
  font-size: 13px;
  color: var(--muted);
  max-width: 280px;
}

.doorbell-timer {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  min-height: 36px;
}

.doorbell-cancel {
  padding: 8px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.doorbell-cancel:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

.doorbell-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.doorbell-accept {
  padding: 9px 22px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.doorbell-accept:hover { opacity: 0.88; }

.doorbell-reject {
  padding: 9px 22px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #ff4444 0%, #cc3333 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.doorbell-reject:hover { opacity: 0.88; }

.doorbell-ring-again {
  transition: opacity 0.15s;
}
.doorbell-ring-again:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}

.doorbell-panel .cr-input {
  width: 240px;
  text-align: center;
}

/* Intro textarea (bigger text area for introductions) */
.intro-textarea {
  width: 280px;
  min-height: 80px;
  max-height: 140px;
  text-align: left;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
}

.pw-error {
  color: #ff6b6b;
  font-size: 12px;
}
.pw-error.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   Furni Manager (Beta)
   ═══════════════════════════════════════════════════ */

.fm-layout {
  display: flex;
  height: 100%;
  background: var(--bg-dark, #0e1525);
  color: #d4dae4;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
}

.fm-sidebar {
  width: 280px;
  min-width: 120px;
  max-width: 500px;
  border-right: none;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
  overflow: hidden;
}

.fm-divider {
  width: 5px;
  cursor: col-resize;
  background: rgba(255,255,255,0.06);
  transition: background 0.15s;
  flex-shrink: 0;
}
.fm-divider:hover,
.fm-divider:active {
  background: rgba(100,180,255,0.25);
}

.fm-sidebar-header {
  padding: 10px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  align-items: center;
  overflow: hidden;
  min-height: 38px;
}

.fm-search {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #ddd;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
}
.fm-search:focus { border-color: rgba(100,180,255,0.3); }

.fm-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.fm-category-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  user-select: none;
  border-radius: 5px;
  margin: 2px 0;
  transition: background 0.12s;
}
.fm-category-header:hover { background: rgba(255,255,255,0.06); }
.fm-category-header.open { color: rgba(255,255,255,0.75); }
.fm-cat-arrow { font-size: 10px; width: 12px; text-align: center; }
.fm-cat-count { font-weight: 400; color: rgba(255,255,255,0.3); font-size: 10px; margin-left: auto; }

.fm-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.12s;
}
.fm-list-item:hover { background: rgba(255,255,255,0.06); }
.fm-list-item.active { background: rgba(70,130,220,0.22); border: 1px solid rgba(70,130,220,0.3); }
.fm-list-item.fm-builtin .fm-list-name { color: #8a95a8; }

.fm-list-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.fm-list-meta {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}

.fm-main {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.fm-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}

.fm-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.fm-editor-3pane {
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.fm-pane-left {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.fm-pane-mid {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.fm-pane-right {
  flex: 2 1 300px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.fm-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 220px;
  overflow: hidden;
}

.fm-preview-canvas {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0c1226;
  width: 100%;
  flex: 1;
  min-height: 180px;
  display: block;
}

.fm-preview-controls {
  display: flex;
  gap: 6px;
}

.fm-props {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fm-prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fm-prop-row label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  min-width: 50px;
}

.fm-prop-row-half {
  display: flex;
  gap: 12px;
}
.fm-prop-row-half > div {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.fm-prop-checks {
  flex-wrap: wrap;
  gap: 10px !important;
  margin-top: 4px;
}
.fm-prop-checks label {
  font-size: 12px;
  min-width: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

.fm-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: #ddd;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  flex: 1;
  min-width: 0;
}
.fm-input:focus { border-color: rgba(100,180,255,0.3); }

.fm-input-sm {
  max-width: 70px;
  flex: unset;
}

.fm-btn {
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  background: rgba(255,255,255,0.08);
  color: #cdd;
  transition: background 0.12s;
}
.fm-btn:hover { background: rgba(255,255,255,0.14); }

.fm-btn-new {
  background: rgba(70,180,120,0.2);
  color: #7fd9a0;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 14px;
}
.fm-btn-new:hover { background: rgba(70,180,120,0.35); }

.fm-btn-sm { padding: 4px 10px; font-size: 11px; }

.fm-btn-save {
  background: rgba(70,130,220,0.22);
  color: #7fc4ff;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 20px;
}
.fm-btn-save:hover { background: rgba(70,130,220,0.38); }

.fm-btn-delete {
  background: rgba(220,60,60,0.2);
  color: #ff8a8a;
  font-weight: 600;
}
.fm-btn-delete:hover { background: rgba(220,60,60,0.38); }

.fm-btn-discard {
  background: rgba(255,255,255,0.06);
  color: #a0a8b8;
  font-weight: 500;
}
.fm-btn-discard:hover { background: rgba(255,255,255,0.12); color: #d0d4dc; }

.fm-preview-dir-label {
  font-size: 12px;
  font-weight: 700;
  color: #7fc4ff;
  min-width: 28px;
  text-align: center;
}

.fm-floor-tile .fm-list-name {
  color: #c4a878;
}

.fm-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.fm-editor-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #e0e6f0;
}

.fm-range {
  flex: 1;
  min-width: 80px;
  accent-color: #4a8cd8;
  cursor: pointer;
}

.fm-section-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.fm-sprites-section, .fm-adjust-section {
  background: rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
}

.fm-sprites-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.fm-sprite-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.fm-sprite-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.fm-sprite-preview {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fm-sprite-preview img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}
.fm-sprite-preview span {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
}

.fm-adjust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.fm-adjust-row label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  min-width: 62px;
  flex-shrink: 0;
}

.fm-adjust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 16px;
}

.fm-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.fm-status {
  font-size: 12px;
  min-height: 18px;
}

.fm-seat-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.fm-seat-btn.active {
  background: rgba(70,130,220,0.35);
  color: #7fc4ff;
  font-weight: 600;
}

.fm-seat-offsets-section {
  margin-top: 4px;
}
.fm-status.ok { color: #7fd9a0; }
.fm-status.err { color: #ff8a8a; }

/* ════════════════════════════════════════════════════════════════════
   Shop Manager
   ════════════════════════════════════════════════════════════════════ */

.sm-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.sm-content-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Tabs sidebar (right bookmark strip) ── */
.sm-tabs-sidebar {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  background: rgba(0,0,0,0.3);
  border-left: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
}
.sm-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sm-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 0 8px 8px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-tab:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.sm-tab.active {
  background: rgba(70,130,220,0.14);
  color: #7fc4ff;
  border-left-color: #7fc4ff;
}
.sm-tab-label { pointer-events: none; overflow: hidden; text-overflow: ellipsis; }
.sm-tab-del {
  width: 14px; height: 14px;
  border: none; background: none;
  color: rgba(255,255,255,0.3);
  font-size: 12px; cursor: pointer;
  line-height: 1; padding: 0;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: auto;
}
.sm-tab-del:hover { color: #ff6666; background: rgba(255,50,50,0.2); }
.sm-tab-add {
  width: 100%;
  height: 26px;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: none;
  color: rgba(255,255,255,0.35);
  font-size: 14px; cursor: pointer;
  flex-shrink: 0;
  transition: 0.15s;
  margin-top: 4px;
}
.sm-tab-add:hover { background: rgba(255,255,255,0.08); color: #7fc4ff; border-color: rgba(70,130,220,0.4); }

/* ── Page editor ── */
.sm-page-editor {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.sm-page-form { display: flex; flex-direction: column; gap: 14px; }
.sm-form-row { display: flex; flex-direction: column; gap: 4px; }
.sm-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }
.sm-input {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.sm-input:focus { border-color: rgba(70,130,220,0.5); }
.sm-input-sm { width: 64px; text-align: center; }
.sm-textarea {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 13px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.sm-textarea:focus { border-color: rgba(70,130,220,0.5); }

/* ── Banner ── */
.sm-banner-wrap { display: flex; gap: 8px; align-items: flex-start; }
.sm-banner-preview {
  width: 100%;
  max-width: 400px;
  height: 100px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s;
}
.sm-banner-preview:hover { border-color: rgba(70,130,220,0.4); }
.sm-banner-img { width: 100%; height: 100%; object-fit: cover; }
.sm-banner-placeholder { font-size: 12px; color: rgba(255,255,255,0.3); }

/* ── Grid config ── */
.sm-grid-config > div { flex-direction: row; }

/* ── Items grid ── */
.sm-grid-container {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 8px;
}
.sm-grid {
  display: grid;
  gap: 4px;
  max-width: 100%;
}
.sm-grid-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  min-height: 48px;
  max-height: 64px;
  flex-direction: column;
  overflow: hidden;
}
.sm-grid-cell.sm-empty:hover { border-color: rgba(70,130,220,0.4); background: rgba(70,130,220,0.06); }
.sm-grid-cell.sm-has-item { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); }
.sm-grid-cell.sm-has-item:hover { border-color: rgba(70,130,220,0.3); }
.sm-grid-icon { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.sm-grid-swatch { width: 24px; height: 24px; border-radius: 6px; pointer-events: none; }
.sm-grid-plus { font-size: 16px; color: rgba(255,255,255,0.2); pointer-events: none; }
.sm-grid-price {
  font-size: 8px;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
  pointer-events: none;
}
.sm-grid-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  border: none;
  background: rgba(255,50,50,0.5);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.sm-grid-cell:hover .sm-grid-remove { opacity: 1; }
.sm-grid-remove:hover { background: rgba(255,50,50,0.8); }

/* ── Bottom bar ── */
.sm-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.sm-status { font-size: 12px; color: rgba(255,255,255,0.5); }
.sm-status.ok { color: #7fd9a0; }
.sm-status.err { color: #ff8a8a; }
.sm-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.sm-btn:active { transform: scale(0.97); }
.sm-btn-primary { background: rgba(70,130,220,0.7); color: #fff; }
.sm-btn-primary:hover { background: rgba(70,130,220,0.9); }
.sm-btn-secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.sm-btn-secondary:hover { background: rgba(255,255,255,0.14); color: #fff; }
.sm-btn-small { padding: 5px 10px; font-size: 11px; }
.sm-empty-state { color: rgba(255,255,255,0.3); text-align: center; padding: 40px 20px; font-size: 14px; }

/* ── Furni Picker Overlay ── */
.sm-picker-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.sm-picker {
  width: 520px;
  max-height: 480px;
  background: rgba(12,18,38,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sm-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}
.sm-picker-close {
  width: 24px; height: 24px;
  border: none; background: rgba(255,50,50,0.15);
  color: #ff8888; border-radius: 6px;
  font-size: 14px; cursor: pointer;
}
.sm-picker-close:hover { background: rgba(255,50,50,0.35); color: #fff; }
.sm-picker-search {
  margin: 8px 12px 4px;
}
.sm-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}
.sm-picker-cat-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  user-select: none;
  border-radius: 5px;
  transition: background 0.12s;
}
.sm-picker-cat-header:hover { background: rgba(255,255,255,0.06); }
.sm-picker-cat-header.open { color: rgba(255,255,255,0.75); }
.sm-picker-cat-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px 0;
}
.sm-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: 0.15s;
}
.sm-picker-item:hover { border-color: rgba(70,130,220,0.3); background: rgba(70,130,220,0.06); }
.sm-picker-item.selected { border-color: rgba(70,130,220,0.6); background: rgba(70,130,220,0.12); }
.sm-picker-icon { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.sm-picker-swatch { width: 32px; height: 32px; border-radius: 6px; }
.sm-picker-name { font-size: 10px; color: rgba(255,255,255,0.6); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sm-picker-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
}

/* ── Preview (admin, new layout) ── */
.sm-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* Preview window */
.smp-window {
  width: 700px;
  max-height: 85%;
  background: rgba(12,18,38,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.smp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.smp-close {
  width: 28px; height: 28px;
  border: none; background: rgba(255,50,50,0.15);
  color: #ff8888; border-radius: 8px;
  font-size: 16px; cursor: pointer;
}
.smp-close:hover { background: rgba(255,50,50,0.35); color: #fff; }
.smp-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.smp-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  min-width: 0;
}
.smp-tabs-sidebar {
  width: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  background: rgba(0,0,0,0.3);
  border-left: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
}
.smp-tab {
  padding: 7px 10px;
  border-radius: 0 8px 8px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.smp-tab:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.smp-tab.active { background: rgba(70,130,220,0.14); color: #7fc4ff; border-left-color: #7fc4ff; }

/* Main page preview */
.smp-main-page { padding: 8px 0; }
.smp-main-title { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 12px; text-align: center; }
.smp-main-banner { border-radius: 10px; overflow: hidden; margin-bottom: 10px; max-height: 140px; }
.smp-main-banner img { width: 100%; display: block; object-fit: cover; max-height: 140px; }
.smp-main-text { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.5; margin-bottom: 8px; }

/* Page banner/desc */
.smp-page-banner { border-radius: 10px; overflow: hidden; margin-bottom: 8px; max-height: 100px; }
.smp-page-banner img { width: 100%; display: block; object-fit: cover; max-height: 100px; }
.smp-page-desc { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.5; margin-bottom: 10px; }

/* Split: grid left + detail right */
.smp-split { display: flex; gap: 12px; }
.smp-grid-area { flex: 1; min-width: 0; }
.smp-grid {
  display: grid;
  gap: 4px;
}
.smp-grid-item {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.15s;
  padding: 4px;
  min-height: 54px;
}
.smp-grid-item:hover { border-color: rgba(70,130,220,0.4); background: rgba(70,130,220,0.06); }
.smp-grid-item.selected { border-color: rgba(70,130,220,0.6); background: rgba(70,130,220,0.12); }
.smp-grid-item.smp-empty { border-style: dashed; border-color: rgba(255,255,255,0.04); cursor: default; min-height: 40px; }
.smp-grid-img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.smp-grid-swatch { width: 28px; height: 28px; border-radius: 6px; }
.smp-grid-name { font-size: 9px; color: rgba(255,255,255,0.5); text-align: center; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Detail area */
.smp-detail-area {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.smp-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 10px;
}
.smp-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}
.smp-detail-preview {
  width: 100%;
  height: 110px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.06);
}
.smp-detail-img { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; }
.smp-detail-swatch { width: 56px; height: 56px; border-radius: 8px; }
.smp-detail-name { font-size: 14px; font-weight: 700; color: #fff; text-align: center; }
.smp-detail-desc { font-size: 11px; color: rgba(255,255,255,0.45); text-align: center; }
.smp-detail-cost { font-size: 16px; font-weight: 800; color: #ffd700; }
.smp-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}
.smp-qty-label { font-size: 11px; color: rgba(255,255,255,0.5); }
.smp-qty-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}
.smp-qty-btn {
  width: 26px; height: 26px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.smp-qty-btn:hover { background: rgba(255,255,255,0.12); }
.smp-qty-input {
  width: 40px;
  text-align: center;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.smp-buy-btn { width: 100%; opacity: 0.5; cursor: not-allowed; }

/* ── Build version footer ── */
#buildVersion {
  position: fixed;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  pointer-events: none;
  z-index: 10;
  font-family: monospace;
  letter-spacing: 0.3px;
}

/* ── Avatar / Profile Panel ── */
.popup-avatar .content { padding: 0; }
.avatar-panel { display: flex; flex-direction: column; min-width: 340px; }
.avatar-panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
}
.av-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-bottom: 2px solid transparent;
}
.av-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.av-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  background: rgba(106,168,255,0.06);
}
.av-tab-content { padding: 16px; }
.av-tab-content:not(.active) { display: none; }

.av-info-section { display: flex; flex-direction: column; gap: 10px; }
.av-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.av-info-label {
  min-width: 80px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.av-info-value {
  font-size: 15px;
  color: var(--text);
  flex: 1;
}
.av-placeholder { color: rgba(255,255,255,0.25); font-style: italic; }
.av-coins { color: #ffd75e; font-weight: 700; }
.av-info-editable { cursor: default; }

/* Audio tab */
.av-audio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.av-audio-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.av-audio-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.av-audio-select:focus { border-color: rgba(106,168,255,0.5); }
.av-audio-select option { background: #1a2040; color: #fff; }
.av-voice-mode-row {
  display: flex;
  gap: 6px;
}
.av-voice-mode-btn {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  border: 2px solid rgba(106,168,255,0.25);
  background: rgba(106,168,255,0.06);
  color: rgba(200,210,230,0.7);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.av-voice-mode-btn:hover { background: rgba(106,168,255,0.15); }
.av-voice-mode-btn.active {
  border-color: var(--accent);
  background: rgba(106,168,255,0.18);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(106,168,255,0.2);
}
.av-ptt-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.av-ptt-btn {
  min-width: 54px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid rgba(106,168,255,0.4);
  background: rgba(106,168,255,0.12);
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.av-ptt-btn:hover { background: rgba(106,168,255,0.22); }
.av-ptt-btn.av-ptt-listening {
  border-color: #ffd75e;
  background: rgba(255,215,94,0.15);
  color: #ffd75e;
  animation: ptt-pulse 0.8s ease infinite;
}
@keyframes ptt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,94,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,215,94,0); }
}
.av-ptt-hint {
  font-size: 12px;
  color: var(--muted);
}
.av-audio-info {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(106,168,255,0.06);
  border-left: 3px solid rgba(106,168,255,0.3);
}

/* ── Slider controls ── */
.av-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.av-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  outline: none;
  cursor: pointer;
}
.av-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6aa8ff;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(106,168,255,0.5);
}
.av-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6aa8ff;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
}
.av-slider-val {
  min-width: 36px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.av-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  padding: 0 2px;
}

/* ── Mic level meter ── */
.av-mic-meter-wrap {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  margin-top: 6px;
  overflow: hidden;
}
.av-mic-meter {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: #2ecc71;
  transition: width 0.06s linear;
}

/* ── Toggle rows (checkboxes) ── */
.av-toggle-row {
  margin: 4px 0;
}
.av-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.av-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6aa8ff;
  cursor: pointer;
}

/* ── Voice Indicator (in-game overlay) ── */
.voice-indicator {
  position: absolute;
  bottom: 60px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  z-index: 500;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}
.voice-indicator.voice-speaking {
  border-color: rgba(22,185,129,0.6);
  background: rgba(22,185,129,0.15);
}
.voice-ind-icon { font-size: 18px; }
.voice-ind-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

/* ── Voice Room badge in navigator ── */
.nav-room-voice {
  font-size: 13px;
  vertical-align: middle;
}

/* ── Voice checkbox in Create Room / Room Settings ── */
.cr-voice-toggle, .rs-voice-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  padding: 6px 0;
}
.cr-voice-toggle input[type="checkbox"],
.rs-voice-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Screen Sharing ── */

/* Streamer indicator bar (top center of game) */
.screen-stream-indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(220, 38, 38, 0.92);
  border: 1px solid rgba(255, 80, 80, 0.6);
  border-radius: 8px;
  padding: 6px 16px;
  z-index: 900;
  font-size: 13px;
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.4);
  animation: screen-pulse 2s ease-in-out infinite;
}
@keyframes screen-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 2px 20px rgba(220, 38, 38, 0.7); }
}
.screen-stream-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4444;
  animation: screen-dot-blink 1s ease-in-out infinite;
}
@keyframes screen-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.screen-stream-label {
  font-weight: 600;
  letter-spacing: 0.5px;
}
.screen-stream-viewers {
  opacity: 0.85;
  font-size: 12px;
}
.screen-stream-stop {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}
.screen-stream-stop:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Viewer floating panel */
.screen-viewer-panel {
  position: absolute;
  width: 420px;
  height: 300px;
  background: #1a1a2e;
  border: 1px solid rgba(100, 140, 255, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transition: height 0.25s ease;
}
.screen-viewer-panel.minimized {
  height: 34px !important;
  min-height: 34px;
  overflow: hidden;
}
.screen-viewer-panel.minimized .screen-viewer-video,
.screen-viewer-panel.minimized .screen-viewer-resize {
  display: none;
}
.screen-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(30, 30, 60, 0.95);
  border-bottom: 1px solid rgba(100, 140, 255, 0.2);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.screen-viewer-header:active { cursor: grabbing; }
.screen-viewer-title {
  font-size: 12px;
  font-weight: 600;
  color: #c8d6ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-viewer-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.screen-viewer-btn {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #aab;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}
.screen-viewer-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.screen-viewer-btn.svb-close:hover {
  background: rgba(239, 68, 68, 0.6);
  color: #fff;
}
.screen-viewer-btn.svb-mute {
  font-size: 13px;
  color: #f59e0b;
}
.screen-viewer-btn.svb-mute:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.screen-viewer-video {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.screen-viewer-video-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.screen-viewer-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(100, 140, 255, 0.4) 50%);
  border-radius: 0 0 10px 0;
}

/* ════════════════════════════════════════════ */
/* User Manager                               */
/* ════════════════════════════════════════════ */

.um-stats {
  padding: 6px 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.um-stat-online { color: #4ade80; }

.um-online-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 2px;
}

.um-list-info {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.um-rank-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.um-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px;
  overflow-y: auto;
  height: 100%;
}

.um-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.um-avatar-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.um-avatar-icon {
  font-size: 22px;
}
.um-editor-name {
  font-size: 16px;
  font-weight: 700;
  color: #e7ecff;
}
.um-editor-id {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-family: monospace;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.um-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 12px 14px;
}
.um-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

.um-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.um-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.um-field-row label {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  min-width: 100px;
  flex-shrink: 0;
}
.um-field-row select.fm-input {
  appearance: auto;
  cursor: pointer;
}

.um-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.um-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.um-info-label {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.um-info-value {
  font-size: 13px;
  color: #d4dae4;
}

.um-inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}
.um-inv-item {
  background: rgba(255,255,255,0.06);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}
.um-inv-more { color: rgba(255,255,255,0.3); font-style: italic; }

.um-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.um-toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(50,180,120,0.9);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  animation: um-toast-in 0.25s ease;
  pointer-events: none;
}
.um-toast-err {
  background: rgba(220,60,60,0.9);
}
@keyframes um-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
