:root {
  --bg: #121214;
  --panel: #1c1c20;
  --panel-2: #26262c;
  --line: #34343c;
  --text: #f2f2f2;
  --muted: #9a9aa6;
  --gold: #e0a526;
  --gold-2: #f3c35a;
  --green: #3ccf7c;
  --red: #ef5a5a;
  --yellow: #f2c94c;
  --purple: #a77bf3;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Montserrat, system-ui, sans-serif; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Entrada */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #2a2418, var(--bg) 70%); padding: 16px; }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.brand { font-size: 28px; font-weight: 800; text-align: center; }
.sub { margin: -6px 0 6px; text-align: center; color: var(--muted); font-size: 14px; }
.preview { position: relative; aspect-ratio: 16 / 9; background: #0b0b0d; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.preview canvas { image-rendering: pixelated; }
.ghost { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-weight: 700; font-size: 14px; }
.ghost:hover { border-color: var(--gold); }
.ghost.wide { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none; }
.field input:focus { border-color: var(--gold); }
.primary { margin-top: 6px; background: var(--gold); color: #111; border: 0; border-radius: 12px; padding: 13px; font-weight: 800; font-size: 15px; }
.primary:hover { background: var(--gold-2); }
.primary:disabled { opacity: .6; cursor: wait; }
.hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

/* Editores (avatar e mesa) */
.modal { z-index: 50; background: rgba(0,0,0,.65); }
.card.editor { max-width: 760px; max-height: calc(100vh - 32px); padding: 20px; gap: 14px; }
.ed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ed-head b { font-size: 18px; }
.ed-tabs { display: flex; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.ed-tabs button { background: none; border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 700; font-size: 13px; color: var(--muted); }
.ed-tabs button.active { background: var(--gold); color: #111; }
.ed-tabs button:disabled { opacity: .4; cursor: not-allowed; }
.ed-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; min-height: 0; }
.ed-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; background: radial-gradient(circle, #2a2418, #0b0b0d 75%); border-radius: 14px; padding: 12px; align-self: start; }
.ed-preview canvas { image-rendering: pixelated; max-width: 100%; }
.ed-opts { overflow-y: auto; max-height: 56vh; padding-right: 6px; display: flex; flex-direction: column; gap: 8px; }
.ed-opts h5 { margin: 8px 0 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-row label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stepper { display: flex; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; min-width: 210px; }
.stepper button { background: none; border: 0; width: 34px; height: 34px; font-size: 20px; color: var(--gold); }
.stepper span { flex: 1; text-align: center; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatches button { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.08); }
.swatches button.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.ed-input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; outline: none; }
.ed-input:focus { border-color: var(--gold); }
.ed-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ed-foot .primary { margin: 0; padding: 11px 22px; }
.credits { margin-right: auto; font-size: 12px; color: var(--muted); }
#meAvatar { cursor: pointer; border-radius: 8px; }
#meAvatar:hover { box-shadow: 0 0 0 2px var(--gold); }
@media (max-width: 700px) {
  .ed-body { grid-template-columns: 1fr; }
  .ed-preview canvas { max-height: 160px; }
  .stepper { min-width: 0; flex: 1; }
}

/* App */
#app { display: grid; grid-template-rows: 52px 1fr 64px; height: 100%; }
#topbar { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.logo { font-weight: 800; white-space: nowrap; }
.spacer { flex: 1; }
.pill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.action { background: var(--gold); color: #111; border-color: var(--gold); }
button.pill:hover { border-color: var(--gold); }

main { display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
#stage { position: relative; overflow: hidden; background: #0b0b0d; }
#map { width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: pointer; }

.strip { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; max-width: calc(100% - 20px); overflow-x: auto; pointer-events: none; }
.tile { position: relative; flex: 0 0 auto; width: 168px; aspect-ratio: 16 / 10; background: #222228; border-radius: 10px; overflow: hidden; border: 2px solid transparent; pointer-events: auto; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.self video { transform: scaleX(-1); }
.tile.nocam video { opacity: 0; }
.tile .ph { position: absolute; inset: 0; display: none; place-items: center; }
.tile.nocam .ph { display: grid; }
.tile .ph canvas { image-rendering: pixelated; }
.tile .label { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); border-radius: 6px; padding: 2px 7px; font-size: 11px; font-weight: 700; max-width: calc(100% - 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.screen { width: 260px; }
.tile.screen video { object-fit: contain; background: #000; }
.tile.speaking { border-color: var(--green); }

#meeting { position: absolute; inset: 0; background: var(--bg); padding: 16px; overflow: auto; }
#meetingGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
#meetingGrid .tile { width: 100%; }
#meetingEmpty { color: var(--muted); text-align: center; margin-top: 30vh; }

.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 38px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 20px; font-weight: 700; }
#toast { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--gold); border-radius: 10px; padding: 8px 14px; font-size: 13px; opacity: 0; transition: opacity .25s; pointer-events: none; }
#toast.show { opacity: 1; }

/* Barra lateral */
#sidebar { display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; padding: 12px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text); border-color: var(--gold); }
.tabs span { background: var(--panel-2); border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
#unread { background: var(--red); color: #fff; }
.tab { flex: 1; overflow-y: auto; padding: 10px 12px; min-height: 0; display: flex; flex-direction: column; }
.tab h4 { margin: 12px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#memberList, #chatLog { list-style: none; margin: 0; padding: 0; }
#memberList li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
#memberList li:hover { background: var(--panel-2); }
#memberList canvas { flex: 0 0 auto; image-rendering: pixelated; }
.m-info { min-width: 0; flex: 1; }
.m-name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.m-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.area-row { font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); margin-bottom: 6px; }
.area-row b { display: block; font-size: 12px; margin-bottom: 2px; }
.area-row span { color: var(--muted); }

#tab-chat { padding: 0; }
#chatLog { flex: 1; overflow-y: auto; padding: 10px 12px; }
#chatLog li { margin-bottom: 10px; font-size: 13px; line-height: 1.4; word-wrap: break-word; }
#chatLog .who { font-weight: 800; }
#chatLog .tag { font-size: 10px; color: var(--gold); margin-left: 4px; }
#chatLog .time { font-size: 10px; color: var(--muted); margin-left: 4px; }
#chatForm { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
#chatForm select, #chatForm input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; }
#chatForm input:focus { border-color: var(--gold); }

/* Barra inferior */
#bottombar { display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--panel); border-top: 1px solid var(--line); min-width: 0; }
.me { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 12px; padding: 6px 10px; min-width: 0; }
.me canvas { image-rendering: pixelated; }
.me-info { display: flex; flex-direction: column; min-width: 0; }
.me-info input, .me-info select { background: none; border: 0; outline: none; padding: 0; font-size: 12px; min-width: 0; }
#meName { font-weight: 800; font-size: 13px; width: 150px; }
.me-status { display: flex; gap: 6px; }
#statusSelect { color: var(--green); font-weight: 700; }
#statusSelect option { background: var(--panel); color: var(--text); }
#statusText { color: var(--muted); width: 140px; }
.controls { display: flex; gap: 8px; }
.ctl { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 18px; }
.ctl.off { background: #4a2020; border-color: var(--red); }
.ctl.on { background: #1f3d2c; border-color: var(--green); }
.emote-wrap { position: relative; }
#emoteMenu { position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
#emoteMenu button { background: none; border: 0; font-size: 22px; padding: 4px 6px; border-radius: 8px; }
#emoteMenu button:hover { background: var(--panel-2); }
.ctl.on { background: #1f3d2c; border-color: var(--green); }
.help { margin-left: auto; font-size: 11px; color: var(--muted); text-align: right; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  #sidebar { display: none; }
  .help { display: none; }
  #statusText { display: none; }
  .tile { width: 120px; }
}

/* Botões na própria mesa */
#deskPop { position: absolute; transform: translateX(-50%); display: flex; gap: 6px; z-index: 5; pointer-events: auto; }
#deskPop button { margin: 0; padding: 7px 12px; font-size: 12px; border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.35); }

/* Faixa do gongo */
#banner { position: absolute; left: 50%; top: 18%; transform: translate(-50%, -10px) scale(.95); background: linear-gradient(90deg, #a77a1e, var(--gold), #a77a1e); color: #111; font-weight: 800; font-size: 18px; padding: 14px 26px; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.5); opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; text-align: center; z-index: 6; }
#banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Reação em cima do vídeo */
.tile-emote { position: absolute; bottom: 18%; font-size: 34px; transform: translateX(-50%); animation: tileEmote 2.6s ease-out forwards; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
#meetingGrid .tile-emote { font-size: 56px; }
@keyframes tileEmote {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(.5); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  25% { transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}
.tile { transition: opacity .4s, border-color .15s; }

/* Painel de administração */
.card.editor.admin { max-width: 640px; }
.ad-body { overflow-y: auto; max-height: 60vh; display: flex; flex-direction: column; gap: 12px; }
.ad-hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.ad-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ad-row .primary { margin: 0; padding: 10px 16px; }
.ad-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ad-list li { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 10px; padding: 9px 10px; }
.ad-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-list li b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-list li span { font-size: 11px; color: var(--muted); }
.ad-list li.empty { color: var(--muted); font-size: 13px; }
.ad-list .ghost { padding: 7px 10px; font-size: 12px; }
.ghost.danger:hover { border-color: var(--red); color: var(--red); }
.ad-switches { display: flex; flex-direction: column; gap: 6px; }
.ad-switch { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ad-switch input { width: 18px; height: 18px; accent-color: var(--gold); }

/* Editor do mapa */
#editBar { position: absolute; left: 10px; top: 10px; bottom: 10px; width: 236px; background: rgba(28,28,32,.96); border: 1px solid var(--gold); border-radius: 14px; display: flex; flex-direction: column; z-index: 7; }
.eb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.eb-head .ghost { padding: 6px 10px; font-size: 12px; }
.eb-tools { flex: 1; overflow-y: auto; padding: 4px 10px; }
.eb-tools h5 { margin: 10px 0 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.eb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.eb-grid button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.eb-grid button span { font-size: 8px; color: var(--muted); max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-grid button canvas { width: 36px; height: 36px; image-rendering: pixelated; }
.eb-grid button.sel, .eb-foot button.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.eb-foot { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.eb-foot .ghost { padding: 8px; font-size: 12px; }
.eb-hint { margin: 0; padding: 0 12px 10px; font-size: 11px; color: var(--muted); }
.pill.on { border-color: var(--gold); color: var(--gold); }

/* Seletor de itens com busca e categorias */
.ig { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ig-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.ig-cats button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
.ig-cats button.sel { background: var(--gold); border-color: var(--gold); color: #111; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; overflow-y: auto; }
.ig-grid button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 3px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ig-grid button:hover { border-color: var(--gold-2); }
.ig-grid button.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.ig-grid canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.ig-grid span { font-size: 9px; line-height: 1.15; color: var(--muted); text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ig-empty { margin: 0; color: var(--muted); font-size: 12px; }
.picker { z-index: 60; }
.picker .card.editor { max-width: 640px; height: min(620px, calc(100vh - 32px)); }
.picker .ig { flex: 1; }
.picker .ig-grid { flex: 1; align-content: start; }
.pick-btn { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px 4px 4px; min-width: 210px; }
.pick-btn:hover { border-color: var(--gold); }
.pick-btn canvas { width: 34px; height: 34px; image-rendering: pixelated; background: #1a1a1e; border-radius: 6px; }
.pick-btn span { flex: 1; text-align: left; font-size: 13px; font-weight: 700; }
.pick-btn b { font-size: 11px; color: var(--gold); }
#editBar .eb-tools { display: flex; flex-direction: column; padding: 8px 10px; }
#editBar .ig { flex: 1; }
#editBar .ig-grid { grid-template-columns: repeat(3, 1fr); flex: 1; align-content: start; }
#editBar .ig-grid canvas { width: 36px; height: 36px; }

/* Modelo do mapa */
.tpl { display: flex; flex-direction: column; gap: 10px; }
.tpl-preview { width: 100%; height: auto; background: #0b0b0d; border-radius: 12px; border: 1px solid var(--line); }
.tpl-label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.tpl-label span { color: var(--text); font-weight: 700; letter-spacing: 0; font-size: 13px; }
.tpl-size input { width: 100%; accent-color: var(--gold); }
.tpl-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tpl-themes button { background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 6px; font-weight: 700; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tpl-themes button span { font-size: 22px; }
.tpl-themes button.sel { border-color: var(--green); }
.tpl .primary:disabled { opacity: .45; cursor: default; }

/* Aparelhos, mão e reações extras */
.dev { position: relative; display: flex; }
.dev-caret { position: absolute; right: -6px; bottom: -4px; width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-size: 10px; line-height: 1; padding: 0; color: var(--muted); }
.dev-caret:hover { color: var(--gold); border-color: var(--gold); }
#deviceMenu { position: fixed; bottom: 72px; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-width: 260px; max-width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 3px; }
#deviceMenu h6 { margin: 6px 4px 2px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
#deviceMenu button { background: none; border: 0; border-radius: 8px; padding: 7px 8px; text-align: left; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#deviceMenu button:hover { background: var(--panel-2); }
#deviceMenu button.sel::before { content: '✓ '; color: var(--green); }
#deviceMenu p { margin: 2px 8px; font-size: 12px; color: var(--muted); }
#emoteMenu { flex-wrap: wrap; width: max-content; max-width: 330px; }
#emoteMenu .more { font-size: 18px; color: var(--muted); }
#emoteMore { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: 100%; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; order: 10; }
#emoteMore button { font-size: 20px; padding: 3px; }
#deskPop.above { transform: translate(-50%, -100%); }

.ig-select { width: 100%; padding: 8px 10px; font-size: 13px; font-weight: 700; }

/* Setas para girar o personagem no editor */
.turn { display: flex; gap: 10px; justify-content: center; }
.turn button { width: 40px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--gold); font-size: 14px; }
.turn button:hover { border-color: var(--gold); }

/* Loja e Pandacoins */
.coins-pill { background: #2a2416; border: 1px solid var(--gold); color: var(--gold-2); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.coins-pill:hover { background: #3a3018; }
.shop .card.editor { max-width: 860px; height: min(700px, calc(100vh - 32px)); }
.shop .ed-head .coins { font-weight: 800; color: var(--gold-2); font-size: 18px; }
.shop-tabs { flex-wrap: wrap; align-self: flex-start; }
.shop-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; align-content: start; padding-right: 4px; }
.shop-card { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.shop-card.mine { border-color: #2f5a3f; }
.shop-card.focus { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.shop-card canvas { width: 96px; height: 120px; image-rendering: pixelated; background: radial-gradient(circle, #2a2418, #141416 75%); border-radius: 8px; }
.shop-card .lock { position: absolute; top: 10px; right: 12px; font-size: 18px; filter: drop-shadow(0 1px 2px #000); }
.shop-card b { font-size: 12px; line-height: 1.2; min-height: 28px; display: flex; align-items: center; }
.shop-card .price { font-size: 12px; font-weight: 800; color: var(--gold-2); }
.shop-card.mine .price { color: var(--green); }
.shop-card button { width: 100%; margin: 2px 0 0; padding: 7px 6px; font-size: 12px; border-radius: 9px; }
.shop-card button:disabled { opacity: .55; cursor: default; }
.lock-warn { margin-right: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gold-2); font-weight: 700; flex-wrap: wrap; }
.lock-warn .ghost { padding: 6px 10px; font-size: 12px; }
.ed-foot .primary:disabled { opacity: .45; cursor: not-allowed; }

/* Regra dos quadrados no editor */
.ig-grid button { position: relative; }
.ig-size { position: absolute; top: 3px; right: 4px; font-style: normal; font-size: 9px; font-weight: 800; color: var(--gold-2); background: rgba(0,0,0,.55); border-radius: 4px; padding: 0 3px; }
.eb-row { display: flex; gap: 6px; }
.eb-row .ghost { flex: 1; }
.eb-hint b { color: var(--gold-2); }

#emoteMore .act { grid-column: span 3; font-size: 12px; font-weight: 700; padding: 6px 4px; background: var(--panel-2); border-radius: 8px; }

/* Retratos */
.tile .ph canvas.portrait { width: 62%; height: auto; max-height: 92%; aspect-ratio: 1; image-rendering: pixelated; }
.ed-portrait { width: 96px; height: 96px; image-rendering: pixelated; background: rgba(0,0,0,.25); border-radius: 12px; }
.profile .card { max-width: 300px; align-items: center; text-align: center; gap: 8px; }
.profile canvas { width: 160px; height: 160px; image-rendering: pixelated; background: radial-gradient(circle, #2a2418, #141416 75%); border-radius: 16px; }
.pf-name { font-size: 18px; }
.pf-role { font-size: 12px; color: var(--gold-2); font-weight: 700; }
.pf-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pf-status i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pf-status em { font-style: normal; }
.pf-text { margin: 0; font-size: 13px; }
.pf-actions { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.pf-actions .primary { margin: 0; }

/* Ícones do pacote de interface */
.ui-ic { display: inline-block; vertical-align: middle; image-rendering: pixelated; background-repeat: no-repeat; }
.ui-gif { width: 20px; height: 20px; vertical-align: middle; image-rendering: pixelated; }
.uikit #map { cursor: var(--cursor-hand, pointer); }
.uikit body { cursor: var(--cursor-arrow, default); }
.coins-pill { display: inline-flex; align-items: center; gap: 6px; }
.shop-title { display: flex; align-items: center; gap: 8px; }
.shop .ed-head .coins { display: inline-flex; align-items: center; gap: 6px; }
.shop-card .price { display: inline-flex; align-items: center; gap: 4px; }
.shop-card button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.shop-card .lock { top: 6px; right: 8px; }
.m-name .ui-ic { flex: 0 0 auto; }
#banner .ui-ic { margin: 0 2px; }

/* Janelas com o painel da LimeZu (só quando o pacote de interface está instalado) */
.uikit .card, .uikit #editBar {
  --panel-2: #c8ad84; --line: #8d6b47; --text: #3a281a; --muted: #6b5139;
  --gold: #b9651c; --gold-2: #8f4a10; --green: #2f8a52; --red: #b23a2c;
  color: var(--text);
  background: none;
  /* moldura: 32 px em cima e dos lados, 20 px embaixo (com o sombreado interno) */
  border-style: solid; border-color: transparent; border-width: 32px 32px 20px 32px;
  border-image: url(ui/panel-main.png) 32 32 20 32 fill / 32px 32px 20px 32px stretch;
  border-radius: 0;
  image-rendering: pixelated;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.uikit .card { padding: 2px 4px 8px; }
.uikit .card.editor { padding: 0 2px 6px; }
.uikit .card .sub, .uikit .card .hint { color: var(--muted); }
.uikit .card .primary, .uikit #editBar .primary { background: #e7b042; color: #2b1a0e; border: 2px solid #8f4a10; box-shadow: 0 2px 0 #8f4a10; }
.uikit .card .primary:hover { background: #f3c35a; }
.uikit .card .ghost, .uikit #editBar .ghost { background: #d9c29b; border: 2px solid #8d6b47; color: var(--text); }
.uikit .card .ghost:hover { border-color: #5c3d22; }
.uikit .card input, .uikit .card select, .uikit #editBar input, .uikit #editBar select { background: #efe1c4; color: var(--text); border-color: #8d6b47; }
.uikit .card input::placeholder, .uikit #editBar input::placeholder { color: #8a7258; }
.uikit .card .ed-tabs button { color: var(--muted); }
.uikit .card .ed-tabs button.active { color: #fff6e0; }
.uikit .card .stepper span { color: var(--text); }
.uikit .card .stepper button { color: #8f4a10; }
.uikit .card h5, .uikit #editBar h5 { color: #8f4a10; }
.uikit .card .ed-preview canvas, .uikit .card .ed-portrait { border-radius: 4px; }
.uikit .card .credits { color: var(--muted); }
/* cards de dentro: quadro bege com borda laranja */
.uikit .shop-card {
  background: none; border-style: solid; border-color: transparent; border-width: 12px 8px 8px;
  border-image: url(ui/panel-inner.png) 12 8 8 fill / 12px 8px 8px stretch; border-radius: 0; padding: 2px;
}
.uikit .shop-card.mine { filter: saturate(.85); }
.uikit .shop-card.focus { box-shadow: 0 0 0 3px #e7b042; }
.uikit .shop-card .price { color: #8f4a10; }
.uikit .shop-card.mine .price { color: var(--green); }
.uikit .ad-list li, .uikit .ad-switch { background: #d9c29b; border: 2px solid #b08a5f; }
.uikit .ig-grid button, .uikit .pick-btn { background: #d9c29b; border: 2px solid #b08a5f; }
.uikit .ig-grid span { color: var(--muted); }
.uikit .ig-cats button { background: #d9c29b; border-color: #b08a5f; color: var(--muted); }
.uikit .tpl-themes button { background: #d9c29b; border-color: #b08a5f; }
.uikit .card .brand { color: #3a281a; text-shadow: 0 1px 0 #f2e2c0; }
/* menus pequenos (reações e aparelhos) no quadro bege */
.uikit #emoteMenu, .uikit #deviceMenu {
  --panel-2: #c8ad84; --text: #3a281a; --muted: #6b5139; --line: #8d6b47;
  color: var(--text); background: none; border-style: solid; border-color: transparent; border-width: 12px 8px 8px;
  border-image: url(ui/panel-inner.png) 12 8 8 fill / 12px 8px 8px stretch; border-radius: 0;
}
.uikit #deviceMenu h6 { color: #8f4a10; }
.uikit #deviceMenu button:hover, .uikit #emoteMenu button:hover { background: rgba(143,74,16,.15); }

.uikit #editBar { width: 300px; }

/* Espaços no editor */
.eb-spaces { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.eb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.eb-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); cursor: pointer; font-size: 12px; }
.eb-list li:hover { outline: 2px solid var(--gold); }
.eb-list li i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.eb-list li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-list li span { color: var(--muted); font-size: 11px; }
.eb-spaces .primary { margin: 0; padding: 8px 10px; font-size: 12px; }
.eb-spaces .ghost { padding: 8px 10px; font-size: 12px; }

/* Presentes com carta */
#map.placing { cursor: copy !important; }
.gift .card { max-width: 420px; gap: 10px; }
.gf-title { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.gf-text { min-height: 140px; resize: vertical; font: 500 14px Montserrat, sans-serif; line-height: 1.5; }
.gf-letter { white-space: pre-wrap; font-size: 15px; line-height: 1.6; padding: 14px 16px; background: #fbf3df; color: #3a281a; border: 2px solid #b08a5f; border-radius: 6px; max-height: 50vh; overflow-y: auto; }
.gf-from { margin: 0; font-size: 12px; color: var(--muted); }

/* Menu de atalhos */
button.help { background: none; border: 0; padding: 6px 8px; cursor: pointer; color: var(--muted); font: 600 11px Montserrat, sans-serif; border-radius: 8px; }
button.help:hover { color: var(--text, #fff); background: rgba(255,255,255,.06); }
kbd { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 5px; background: #2a2a30; color: #f3f3f3; border-bottom: 2px solid #111; font: 700 11px Montserrat, sans-serif; text-align: center; margin: 0 1px; }
.shortcuts .card { max-width: 460px; gap: 10px; }
.sc-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.sc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 4px; border-bottom: 1px solid rgba(0,0,0,.08); font-size: 13px; }
.sc-row small { color: var(--muted); }
.sc-row > span:last-child { white-space: nowrap; }

/* Balões de fala do chat */
#talk { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.talk-stack { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bub { position: relative; display: flex; align-items: center; gap: 6px; max-width: 250px; padding: 6px 10px 6px 6px; background: #f1e3c4; color: #3a281a; border: 2px solid #b9651c; border-radius: 6px; box-shadow: 0 3px 0 #8f4a10, 0 8px 18px rgba(0,0,0,.35); animation: bub-in .22s ease-out; transition: opacity .3s, transform .3s; }
.bub.near { border-color: #2f8a52; box-shadow: 0 3px 0 #1f5e37, 0 8px 18px rgba(0,0,0,.35); }
.bub.out { opacity: 0; transform: translateY(-6px); }
.bub-face { flex: none; width: 40px; height: 40px; background: #d9c29b; border: 2px solid #8d6b47; border-radius: 4px; overflow: hidden; }
.bub-face canvas { display: block; width: 40px; height: 40px; image-rendering: pixelated; }
.bub-body { min-width: 0; padding-top: 6px; }
.bub-name { position: absolute; top: -11px; left: 50px; padding: 1px 8px; background: #e7b042; color: #2b1a0e; border: 2px solid #8f4a10; border-radius: 4px; font: 800 10px Montserrat, sans-serif; white-space: nowrap; }
.bub.near .bub-name { background: #8fd3a6; border-color: #1f5e37; }
.bub p { margin: 0; font: 600 12px/1.35 Montserrat, sans-serif; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.talk-stack .bub:last-child::after { content: ''; position: absolute; bottom: -9px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #b9651c; border-bottom: 0; }
.talk-stack .bub.near:last-child::after { border-top-color: #2f8a52; }
@keyframes bub-in { from { opacity: 0; transform: translateY(8px) scale(.94); } }

/* Cartão da mesa de alguém (passando o mouse) */
#deskCard { position: absolute; transform: translate(-50%, -100%); z-index: 6; width: 230px; padding: 34px 14px 12px; margin-top: -4px; text-align: center; background: #26283f; color: #f1f1f6; border: 2px solid #3d4063; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); pointer-events: auto; }
#deskCard .dc-face { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #d9c29b; border: 3px solid #26283f; box-shadow: 0 0 0 2px #3d4063; }
#deskCard .dc-face canvas { width: 56px; height: 56px; image-rendering: pixelated; display: block; }
#deskCard .dc-name { display: block; font-size: 15px; }
#deskCard .dc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #b8bad0; }
#deskCard .dc-status i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
#deskCard .dc-text { margin: 4px 0 0; font-size: 12px; color: #d8d9e6; min-height: 0; }
#deskCard .dc-text:empty { display: none; }
#deskCard .dc-btns { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
#deskCard .dc-btns button { width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 10px; background: #34375a; border: 0; font-size: 17px; cursor: pointer; }
#deskCard .dc-btns button:hover { background: #4a4e7d; transform: translateY(-1px); }
#deskCard .dc-like { position: absolute; top: 8px; right: 8px; margin: 0; padding: 2px 6px; background: none; border: 0; color: #f1a4c0; font-size: 14px; cursor: pointer; }
#deskCard .dc-like.liked { color: #ff6b9a; }
/* Avisos com botão (aceno, chamada) */
#notices { position: absolute; top: 70px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 7; }
.notice { width: 280px; padding: 12px 14px; background: #26283f; color: #f1f1f6; border: 2px solid #3d4063; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: bub-in .25s ease-out; font-size: 13px; }
.notice .nt-btns { display: flex; gap: 6px; margin-top: 10px; }
.notice .nt-btns button { margin: 0; padding: 6px 10px; font-size: 12px; }
.notice.ringing { border-color: #e7b042; animation: bub-in .25s ease-out, ring 1s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-1.5deg); } 20% { transform: rotate(1.5deg); } 30% { transform: rotate(0); } }
/* Membros: atalhos ir até / chamar */
.m-acts { margin-left: auto; display: none; gap: 4px; }
#memberList li:hover .m-acts, .m-acts:focus-within { display: flex; }
.m-acts button { margin: 0; padding: 4px 6px; font-size: 13px; background: rgba(255,255,255,.08); border: 0; border-radius: 6px; cursor: pointer; }
.m-acts button:hover { background: rgba(255,255,255,.18); }
/* Chat privado */
.tag.dm { background: #6b4bd8; color: #fff; }
/* Perfil: conquistas */
.profile .card { max-width: 440px; }
.pf-since { margin: 0; font-size: 12px; color: var(--muted); }
.pf-since:empty { display: none; }
.pf-badges { width: 100%; text-align: left; max-height: 38vh; overflow-y: auto; }
.pf-badges h5 { margin: 6px 0; font-size: 13px; }
.bd-group { margin-bottom: 8px; }
.bd-gname { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.bd-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bd { width: 74px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 8px; background: rgba(0,0,0,.08); border: 2px solid transparent; text-align: center; filter: grayscale(1); opacity: .55; }
.bd.done { filter: none; opacity: 1; background: rgba(231,176,66,.18); border-color: #e7b042; }
.bd-ic { font-size: 22px; line-height: 1; }
.bd-name { font-size: 10px; font-weight: 700; line-height: 1.15; }
.bd-bar { display: block; width: 100%; height: 4px; border-radius: 2px; background: rgba(0,0,0,.15); overflow: hidden; }
.bd-bar i { display: block; height: 100%; background: #b9651c; }
.pf-like.liked { border-color: #ff6b9a !important; }
.ad-since { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.ad-since input { padding: 3px 4px; font-size: 11px; }
.profile .pf-actions { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.profile .pf-actions button { flex: 1 1 28%; margin: 0; padding: 8px 6px; font-size: 12px; }
.profile .card canvas { width: 110px; height: 110px; }

/* decoração livre da mesa */
.ed-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.ed-drag { cursor: grab; touch-action: none; }
.ed-drag:active { cursor: grabbing; }
.free-list { display: flex; flex-direction: column; gap: 4px; }
.free-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; font-size: 13px; }
.free-row.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.free-row span { flex: 1; }
.free-row button { padding: 2px 8px; margin: 0; }
.free-add { align-self: flex-start; }

/* ausente: trocou de aba ou clicou fora sem estar conversando */
#awayOverlay { position: absolute; inset: 0; background: rgba(12, 12, 24, .5); z-index: 30; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 90px; }
#awayOverlay[hidden] { display: none; }
#awayOverlay .away-msg { display: flex; align-items: center; gap: 14px; max-width: 460px; background: rgba(18, 18, 22, .94); color: #fff; border-radius: 14px; padding: 14px 20px; font-size: 15px; line-height: 1.4; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
#awayOverlay .away-ic { background: #c8364a; border-radius: 999px; padding: 6px 10px; font-size: 16px; white-space: nowrap; }

/* Loja: raridade, venda e Baú Mágico */
.shop-card[style*="--rc"] { border-top: 3px solid var(--rc); }
.rar { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--rc, #9aa0a6); border: 1px solid var(--rc, #9aa0a6); border-radius: 6px; padding: 1px 6px; }
.shop-card .rar { position: absolute; top: 10px; left: 12px; background: rgba(12,12,16,.75); }
.shop-card .sell { font-size: 11px; padding: 3px 8px; }
.chest-card { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; padding: 10px 12px; border-radius: 12px; border: 2px solid #b9651c;
  background: linear-gradient(100deg, #f8dd96, #ecd3a4 70%); color: #3a2614; }
.chest-ic { font-size: 30px; }
.chest-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chest-txt b { font-size: 15px; }
.chest-txt span { font-size: 11.5px; color: #6b4a2a; }
.chest-result { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: rgba(185,101,28,.12); font-size: 13px; }
.chest-result.rolling { animation: chestShake .15s infinite alternate; }
.chest-result.r-lendario { box-shadow: 0 0 0 1px #f3c35a, 0 0 18px #f3c35a66; }
.chest-result.r-super { box-shadow: 0 0 0 1px #a46cf0; }
@keyframes chestShake { from { transform: translateX(-2px); } to { transform: translateX(2px); } }
#recBtn.rec { background: #c0392b; border-color: #ff6b5b; animation: recPulse 1.2s infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 4px #ff4d4d44; } }
#banner a { color: var(--gold); }
#sectorInput { width: 100%; }
#googleField { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0; }
