:root {
  --bg: #121826;
  --panel: rgba(16, 22, 36, 0.88);
  --panel-solid: #161e30;
  --raise: rgba(255, 255, 255, 0.06);
  --raise-2: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9eef6;
  --muted: #93a0b5;
  --accent: #4a8cff;
  --accent-2: #2f6fe0;
  --ok: #3ecf6e;
  --warn: #f0b429;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(3, 7, 18, 0.55), 0 2px 8px rgba(3, 7, 18, 0.4);
  --pixel: 'Silkscreen', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
kbd { font: 600 10.5px var(--sans); color: var(--text); background: var(--raise-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

#game { position: fixed; inset: 0; }
#game canvas { display: block; image-rendering: pixelated; }

/* ------------------------------------------------ etiquetas sobre os avatares */
#tags { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.tag .name {
  position: absolute; bottom: 4px; left: 0; transform: translateX(-50%);
  display: flex; align-items: center; gap: 5px; white-space: nowrap; padding: 2px 8px 2px 6px; border-radius: 999px;
  background: rgba(12, 17, 29, 0.74); border: 1px solid var(--line); font-size: 11px; font-weight: 600; backdrop-filter: blur(4px);
}
.tag.me .name { background: rgba(47, 111, 224, 0.88); border-color: rgba(255, 255, 255, 0.25); }
.tag.near .name { border-color: rgba(62, 207, 110, 0.7); box-shadow: 0 0 0 2px rgba(62, 207, 110, 0.18); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 2px rgba(12, 17, 29, 0.8); }
.tag .bubble {
  position: absolute; bottom: 30px; left: 0; transform: translateX(-50%) translateY(6px) scale(0.92);
  max-width: 220px; width: max-content; padding: 7px 11px; border-radius: 12px; background: #fff; color: #1b2233;
  font-size: 12.5px; font-weight: 500; line-height: 1.35; box-shadow: 0 6px 20px rgba(3, 7, 18, 0.35);
  opacity: 0; transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3); overflow-wrap: anywhere;
}
.tag .bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.tag .bubble.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.tag .emote { position: absolute; bottom: 30px; left: 0; transform: translateX(-50%); font-size: 26px; opacity: 0; }
.tag .emote.show { animation: emote 1.8s ease-out forwards; }
@keyframes emote {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.4); }
  15% { opacity: 1; transform: translate(-50%, -4px) scale(1.25); }
  30% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(0.9); }
}

/* ------------------------------------------------ topo */
#topbar { position: fixed; top: 14px; left: 14px; z-index: 10; display: flex; gap: 8px; align-items: center; }
.brand, .room, .pill-btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.brand { font-family: var(--pixel); font-size: 14px; letter-spacing: 0.04em; }
.logo { font-family: var(--pixel); background: var(--accent); color: #fff; padding: 1px 6px 2px; border-radius: 6px; font-size: 12px; }
.room { font-weight: 600; font-size: 13px; padding-left: 6px; }
.floor-pill { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(180deg, #ffd36b, #f0a729); color: #3a2a06; font-family: var(--pixel); font-size: 13px; }
.room-floor { color: var(--text); }
.room-sep { color: var(--muted); }
.room.pulse { animation: pulse 0.6s ease-out; }
@keyframes pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 140, 255, 0.5); } 100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(74, 140, 255, 0); } }
.pill-btn { font-weight: 600; font-size: 13px; }
.pill-btn:hover { background: var(--accent); }

/* ------------------------------------------------ por perto */
#near {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 8px; padding: 8px;
  max-width: calc(100vw - 720px); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px); overflow-x: auto; animation: rise 0.3s ease-out;
}
.ncard { position: relative; width: 104px; height: 78px; flex: none; border-radius: 11px; overflow: hidden; background: linear-gradient(160deg, #2a3a5c, #1a2438); display: grid; place-items: center; }
.ncard canvas { image-rendering: pixelated; margin-top: -8px; }
.nlabel { position: absolute; left: 6px; right: 6px; bottom: 5px; display: flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------ painel lateral */
#side {
  position: fixed; top: 14px; right: 14px; bottom: 86px; width: 330px; z-index: 10; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#side.collapsed { transform: translateX(calc(100% + 14px)); }
.side-toggle { position: absolute; left: -34px; top: 10px; width: 28px; height: 36px; border-radius: 10px 0 0 10px; background: var(--panel); border: 1px solid var(--line); border-right: 0; }
#side.collapsed .side-toggle { transform: rotate(180deg); border-radius: 0 10px 10px 0; }
.tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; height: 34px; border-radius: 9px; background: transparent; border: 0; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab:hover { background: var(--raise); color: var(--text); }
.tab.active { background: var(--raise-2); color: var(--text); }
.tab em { font-style: normal; font-size: 11px; background: var(--raise-2); padding: 0 6px; border-radius: 999px; }
#unread { background: var(--danger); color: #fff; }
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#people { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; }
.person:hover { background: var(--raise); }
.pp { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; background: linear-gradient(160deg, #2f4570, #1d2940); display: grid; place-items: center; overflow: hidden; }
.person .pp { width: 34px; height: 34px; overflow: visible; }
.pp canvas { image-rendering: pixelated; border-radius: 50%; }
.person .pp .dot { position: absolute; right: -1px; bottom: -1px; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinfo b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinfo span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pacts { display: flex; gap: 2px; opacity: 0.55; transition: opacity 0.15s; }
.person:hover .pacts { opacity: 1; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; font-size: 14px; }
.icon-btn:hover { background: var(--raise-2); }
.scopes { display: flex; gap: 6px; padding: 8px 10px 4px; }
.scope { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.scope.on { background: var(--accent); border-color: transparent; color: #fff; }
#messages { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg-head { display: flex; gap: 8px; align-items: baseline; }
.msg-head b { font-size: 12.5px; }
.msg-head span { font-size: 11px; color: var(--muted); }
.msg p { margin: 2px 0 0; font-size: 13px; color: #d5dceb; overflow-wrap: anywhere; }
.msg.near { border-left: 2px solid var(--ok); padding-left: 8px; }
.msg.mine b { color: #8fb6ff; }
#chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
#chat-input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); color: var(--text); font: inherit; outline: none; }
#chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 140, 255, 0.2); }
#chat-form button { width: 38px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; }

/* ------------------------------------------------ minimapa */
.mini-wrap { position: fixed; left: 14px; bottom: 50px; z-index: 9; width: 236px; padding: 6px 8px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.mini-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 6px; font-size: 12px; }
.mini-head button { border: 0; background: transparent; color: var(--muted); width: 24px; height: 20px; }
#minimap { display: block; width: 220px; height: 158px; border-radius: 8px; cursor: pointer; }
.mini-wrap.closed #minimap { display: none; }
.mini-wrap.closed .mini-head { padding-bottom: 0; }
.mini-wrap.closed .mini-head button { transform: rotate(180deg); }

/* ------------------------------------------------ prompt de interação e seguir */
.prompt {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 22, 36, 0.92); box-shadow: var(--shadow); font-weight: 600; animation: rise2 0.2s ease-out;
}
.prompt kbd { font-size: 12px; padding: 3px 8px; background: var(--accent); border-color: transparent; color: #fff; }
.prompt:hover { border-color: var(--accent); }
@keyframes rise2 { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.follow { position: fixed; left: 50%; top: 62px; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--accent); font-size: 13px; box-shadow: var(--shadow); }
.follow button { border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(0, 0, 0, 0.25); font-weight: 600; }

/* ------------------------------------------------ dock */
#dock {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 6px; padding: 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(12px); max-width: calc(100vw - 28px);
}
.me-card { position: relative; display: flex; align-items: center; gap: 9px; padding: 3px 12px 3px 3px; border-radius: 13px; border: 0; background: var(--raise); text-align: left; }
.me-card:hover { background: var(--raise-2); }
.me-dot { position: absolute; left: 33px; top: 33px; }
.me-info { display: flex; flex-direction: column; line-height: 1.2; max-width: 130px; }
.me-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info span { font-size: 11.5px; color: var(--muted); }
.status-menu { position: absolute; left: 7px; bottom: calc(100% + 8px); min-width: 180px; padding: 6px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.status-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.status-menu button:hover { background: var(--raise-2); }
.sep { width: 1px; height: 28px; background: var(--line); margin: 0 2px; }
.emotes { display: flex; gap: 2px; }
.emo, .dbtn { width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; font-size: 18px; display: grid; place-items: center; transition: background 0.15s, transform 0.15s; }
.emo:hover, .dbtn:hover { background: var(--raise-2); transform: translateY(-2px); }
.emo:active, .dbtn:active { transform: translateY(0) scale(0.94); }
.dbtn { font-size: 17px; font-weight: 700; }
.dbtn.soon { opacity: 0.45; }
.dbtn.active { background: var(--accent); }
.hint { position: fixed; right: 18px; bottom: 30px; z-index: 9; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.hint kbd { margin-right: 3px; }
.offline { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--warn); color: #1b2233; font-weight: 700; padding: 6px 14px; border-radius: 999px; }
#toasts { position: fixed; left: 14px; top: 64px; z-index: 30; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 12px; border-radius: 10px; font-size: 12.5px; animation: toastIn 0.3s ease-out; transition: opacity 0.4s, transform 0.4s; max-width: 340px; }
.toast.strong { background: var(--accent); border-color: transparent; font-weight: 700; font-size: 14px; padding: 12px 16px; }
.toast.out { opacity: 0; transform: translateX(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ elevador */
.elev { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 35; display: none; }
.elev.open { display: block; animation: pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.elev-card { width: min(380px, calc(100vw - 32px)); padding: 16px; border-radius: 18px; background: linear-gradient(180deg, #2a3142, #1b2130); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: var(--shadow); }
.elev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.elev-head > span { font-size: 26px; }
.elev-head div { flex: 1; display: flex; flex-direction: column; }
.elev-head b { font-size: 16px; }
.elev-head small { color: var(--muted); }
.elev-head button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: var(--raise); }
#elev-floors { display: flex; flex-direction: column; gap: 8px; }
.elev-btn { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); text-align: left; transition: transform 0.15s, border-color 0.15s, background 0.15s; }
.elev-btn:hover:not(:disabled) { transform: translateX(3px); border-color: var(--accent); background: rgba(74, 140, 255, 0.12); }
.elev-btn.here { opacity: 0.55; }
.elev-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #ffe39a, #e8a42a); color: #3a2a06; font-family: var(--pixel); font-size: 15px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 0 0 3px #11151d; }
.elev-btn.here .elev-num { background: radial-gradient(circle at 35% 30%, #ffffff, #9aa3ad); }
.elev-txt { display: flex; flex-direction: column; }
.elev-txt b { font-size: 14px; }
.elev-txt span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------ modais */
.modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(10, 14, 26, 0.35), rgba(8, 11, 20, 0.82)); backdrop-filter: blur(3px); }
.modal.open { display: flex; }
.card { position: relative; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 26px; animation: cardIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); max-height: calc(100vh - 32px); overflow-y: auto; }
.card.small { width: min(440px, 100%); }
.card.wide { width: min(1080px, 100%); padding: 18px; }
.card h2 { margin: 0 0 6px; font-size: 20px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.actions .btn-primary { flex: 1; }
.sub { margin: 0 0 16px; color: var(--muted); }
.sub.center { text-align: center; margin: 10px 0 0; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field span, .pick > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .invite-row input, .nt-form textarea {
  height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); color: var(--text); font: inherit; outline: none;
}
.field input:focus, .nt-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 140, 255, 0.2); }
.field input:disabled { opacity: 0.6; }
.error { margin: 8px 0 0; color: var(--danger); font-weight: 600; font-size: 13px; }
.btn-primary { height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; box-shadow: 0 8px 22px rgba(47, 111, 224, 0.35); transition: transform 0.15s, box-shadow 0.15s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(47, 111, 224, 0.45); }
.btn-primary:disabled { opacity: 0.6; }
.btn-primary.big { width: 100%; height: 48px; margin-top: 16px; font-size: 15px; }
.btn-ghost { height: 38px; border: 1px solid var(--line); background: var(--raise); border-radius: 10px; padding: 0 14px; font-weight: 600; }
.btn-ghost:hover { background: var(--raise-2); }
.b-x { width: 32px; height: 32px; border-radius: 9px; border: 0; background: var(--raise); flex: none; }
.b-x:hover { background: var(--raise-2); }
.invite-row { display: flex; gap: 8px; }
.invite-row input { flex: 1; min-width: 0; font-size: 12.5px; }

/* ------------------------------------------------ entrada / editor */
.lobby { background: radial-gradient(ellipse at center, rgba(10, 14, 26, 0.2), rgba(8, 11, 20, 0.78)); }
.lobby-card { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 28px; width: min(980px, 100%); height: min(820px, calc(100vh - 32px)); max-height: none; padding: 26px; overflow: hidden; }
.lobby-close { display: none; position: absolute; top: 12px; right: 12px; z-index: 3; }
.lobby.editing .lobby-close { display: block; }
.lobby.editing .only-lobby, .lobby.invited .code-field { display: none; }
.lobby-left { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stage {
  position: relative; width: 100%; height: 360px; border-radius: 18px; overflow: hidden; display: grid; place-items: end center;
  background: radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 211, 107, 0.18), transparent 70%), linear-gradient(180deg, #24365c 0%, #1a2742 62%, #141d31 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.stage::before { content: ''; position: absolute; left: 50%; bottom: 18px; width: 190px; height: 46px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at center, #3a5078, #22324f 70%); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.4); }
.stage::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px); background-size: 34px 34px; opacity: 0.12; pointer-events: none; }
.stage canvas { position: relative; z-index: 1; image-rendering: pixelated; margin-bottom: 8px; }
.rot { position: absolute; z-index: 2; left: 10px; right: 10px; top: 10px; display: flex; justify-content: space-between; }
.rot button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(10, 14, 24, 0.45); font-size: 18px; }
.rot button:hover { background: var(--accent); }
#randomize { width: 100%; height: 42px; }
.stage-tip { margin: 0; font-size: 11.5px; color: var(--muted); }
.kicker { margin: 0; font-family: var(--pixel); font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.lobby-right { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.lobby-right h1 { margin: 6px 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lobby.editing .fields, .lobby.invited .fields { grid-template-columns: 1fr; }
.gender { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.gender button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); font-weight: 700; font-size: 14px; color: var(--muted); transition: all 0.15s; }
.gender button span { font-size: 20px; }
.gender button:hover { color: var(--text); background: var(--raise-2); }
.gender button.on { color: #fff; border-color: transparent; background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(47, 111, 224, 0.35); }
.presets-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.preset { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 211, 107, 0.35); background: rgba(255, 211, 107, 0.08); color: #ffe39a; font-size: 12.5px; font-weight: 700; }
.preset:hover { background: rgba(255, 211, 107, 0.2); }
.etabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.etab { flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.etab.on { background: var(--raise-2); color: var(--text); }
.epanels { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 8px 8px 0; margin-right: -8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.25) transparent; }
.epanels::-webkit-scrollbar { width: 8px; }
.epanels::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 8px; }
.lobby-right .btn-primary.big { margin-top: 12px; }
.lobby-left { min-height: 0; }
.stage { height: min(360px, calc(100vh - 200px)); min-height: 220px; }
.pick { margin-bottom: 14px; }
.pick-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.presets-wrap .pick-label { margin: 0; white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 28px; height: 28px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, 0.12); transition: transform 0.12s; }
.sw:hover { transform: scale(1.12); }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 7px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); transition: transform 0.12s, background 0.12s, border-color 0.12s; }
.opt canvas { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 9px; background: radial-gradient(circle at 50% 55%, #2f4570, #1b2740); }
.opt span { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15; }
.opt:hover { transform: translateY(-2px); background: var(--raise-2); }
.opt.on { border-color: var(--accent); background: rgba(74, 140, 255, 0.16); box-shadow: 0 0 0 1px var(--accent); }
.opt.on span { color: var(--text); }
.btn-primary.big { flex: none; }

/* ------------------------------------------------ lousa e mural */
.wb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.wb-head h2 { margin: 0 8px 0 0; font-size: 18px; }
.wb-head .b-x { margin-left: auto; }
.wb-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); }
.wb-color.on { box-shadow: 0 0 0 2px var(--accent); border-color: #fff; }
.wb-size { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--raise); display: grid; place-items: center; }
.wb-size i { display: block; border-radius: 50%; background: var(--text); }
.wb-size.on, .wb-tool.on { border-color: var(--accent); background: rgba(74, 140, 255, 0.18); }
.wb-tool { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--raise); padding: 0 10px; font-size: 12.5px; font-weight: 600; }
#wb-canvas { display: block; width: 100%; aspect-ratio: 5 / 3; border-radius: 12px; background: #fff; cursor: crosshair; touch-action: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.nt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; min-height: 180px; max-height: 52vh; overflow-y: auto; padding: 14px; border-radius: 12px; background: #c99a66 radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px); background-size: 9px 9px; }
.nt-card { position: relative; padding: 14px 12px 10px; border-radius: 4px; color: #2b2410; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25); transform: rotate(var(--tilt)); min-height: 120px; display: flex; flex-direction: column; }
.nt-card::before { content: ''; position: absolute; top: -5px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: #e5484d; transform: translateX(-50%); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3); }
.nt-card p { margin: 0 0 8px; flex: 1; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.nt-card span { font-size: 11px; opacity: 0.7; font-weight: 600; }
.nt-del { position: absolute; top: 4px; right: 6px; border: 0; background: transparent; color: rgba(0, 0, 0, 0.45); font-size: 18px; line-height: 1; }
.nt-del:hover { color: #000; }
.nt-empty { grid-column: 1 / -1; text-align: center; color: #3a2a12; font-weight: 600; margin: 50px 0; }
.nt-form { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.nt-form textarea { flex: 1; height: 52px; padding: 10px 12px; resize: none; }
.nt-colors { display: flex; gap: 6px; }
.nt-color { width: 26px; height: 26px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.15); }
.nt-color.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* ------------------------------------------------ construtor */
#builder {
  position: fixed; top: 64px; left: 14px; bottom: 86px; width: 300px; z-index: 12; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px); animation: slideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.b-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.b-head b { display: block; font-size: 15px; }
.b-head span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 16px; }
.b-tools { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tool { flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--raise); font-size: 12.5px; font-weight: 600; }
.tool:hover:not(:disabled) { background: var(--raise-2); }
.tool.on { background: var(--accent); border-color: transparent; color: #fff; }
.tool:disabled { opacity: 0.4; }
.b-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.b-scroll h4 { margin: 14px 0 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.brushes { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.brush { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--raise); font-size: 12px; font-weight: 600; text-align: left; }
.brush i { width: 18px; height: 18px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.brush:hover { background: var(--raise-2); }
.brush.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74, 140, 255, 0.35); }
.items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px 7px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); transition: transform 0.12s, background 0.12s; }
.item canvas { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 8px; background: radial-gradient(circle at 50% 60%, rgba(239, 231, 216, 0.16), transparent 70%); }
.item span { font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15; }
.item:hover { background: var(--raise-2); transform: translateY(-2px); }
.item.on { border-color: var(--accent); background: rgba(74, 140, 255, 0.16); }
.item.on span { color: var(--text); }
.b-foot { padding: 9px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
body.building .hint, body.building .mini-wrap, body.building .prompt { display: none !important; }
body.building #game { cursor: crosshair; }

@media (max-height: 860px) {
  .lobby-card { padding: 20px; gap: 22px; }
  .lobby-right h1 { font-size: 20px; margin: 2px 0 8px; }
  .lobby-right .sub, .lobby-right .kicker { display: none; }
  .field { margin-bottom: 8px; }
  .field input { height: 38px; }
  .gender { margin-bottom: 8px; }
  .gender button { height: 40px; }
  .presets-wrap { margin-bottom: 8px; }
  .etabs { margin-bottom: 8px; }
  .etab { height: 32px; }
  .opt canvas { width: 48px; height: 48px; }
  .opts { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .stage-tip { display: none; }
}
@media (max-width: 1180px) { #near { max-width: calc(100vw - 420px); } .hint { display: none; } }
@media (max-width: 760px) {
  .lobby-card { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; max-height: calc(100vh - 32px); gap: 16px; padding: 20px; overflow-y: auto; }
  .lobby-right { height: auto; }
  .epanels { overflow: visible; }
  .stage { height: 250px; }
  .fields { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 1fr; gap: 4px; }
  #side { width: auto; left: 14px; top: auto; height: 46vh; bottom: 84px; }
  #side.collapsed { transform: translateY(calc(100% + 100px)); }
  #near { max-width: calc(100vw - 28px); }
  .me-info, .room-floor, .room-sep, .brand span:last-child { display: none; }
  .me-card { padding: 3px; }
  .mini-wrap { display: none; }
  #builder { width: auto; right: 14px; top: auto; height: 50vh; }
  .nt-form { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ------------------------------------------------ contas */
.auth { background: radial-gradient(ellipse at 50% 30%, rgba(30, 48, 86, 0.55), rgba(8, 11, 20, 0.9)); }
.auth-card { width: min(420px, 100%); padding: 30px; }
.auth-brand { display: inline-flex; gap: 8px; align-items: center; font-family: var(--pixel); color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 14px; }
.auth-title { font-size: 24px !important; letter-spacing: -0.02em; margin: 0 0 14px !important; }
.auth .only-criar { display: none; }
.auth.criar .only-criar { display: flex; }
.auth.criar h2.only-criar { display: block; }
.auth.criar .only-entrar { display: none; }
.auth.invited .code-field, .auth.invited .atabs { display: none !important; }
.auth-invite { display: none; margin: -6px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(62, 207, 110, 0.12); border: 1px solid rgba(62, 207, 110, 0.35); color: #b9f2cc; font-size: 13px; font-weight: 600; }
.auth.invited .auth-invite { display: block; }
.auth.invite-bad .auth-invite { display: block; background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.4); color: #ffc9c9; }
.atabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); margin-bottom: 16px; }
.atab { height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; }
.atab.on { background: var(--raise-2); color: var(--text); }
.auth-foot { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-foot a, .link { color: #8fb6ff; background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--raise); font-size: 13px; color: var(--muted); }
.who b { color: var(--text); }
.who em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(74, 140, 255, 0.18); color: #a9c8ff; }
.who-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(62, 207, 110, 0.2); }
.iroles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.irole { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); text-align: left; }
.irole span { font-size: 12px; color: var(--muted); }
.irole.on { border-color: var(--accent); background: rgba(74, 140, 255, 0.14); box-shadow: 0 0 0 1px var(--accent); }
.small-note { margin: 10px 0 0; font-size: 12.5px; }
.menu-out { border-top: 1px solid var(--line) !important; border-radius: 0 0 8px 8px !important; margin-top: 4px; color: #ffb4b4; }
.tag.guest .name::after { content: 'visitante'; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: rgba(240, 180, 41, 0.25); color: #ffe39a; font-size: 9.5px; }
.tag.admin .name span::before { content: '★ '; color: #ffd36b; }

/* ------------------------------------------------ administração */
.admin-card { width: min(980px, 100%); }
.adm-count { color: var(--muted); font-size: 13px; }
.adm-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.adm-grid h4 { margin: 4px 0 10px; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.adm-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.adm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-info b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-info span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-role { height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #10172a; color: var(--text); padding: 0 8px; font: inherit; font-size: 12.5px; }
.adm-empty { color: var(--muted); font-size: 13px; margin: 6px 2px; }
.adm-help { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 211, 107, 0.07); border: 1px solid rgba(255, 211, 107, 0.2); font-size: 12.5px; color: var(--muted); }
.adm-help p { margin: 6px 0 0; }
.adm-help b { color: var(--text); }
.icon-btn.danger { width: auto; padding: 0 8px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; }
.btn-mini { border: 1px solid var(--line); background: var(--raise); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.btn-mini:hover { background: var(--accent); border-color: transparent; }
@media (max-width: 760px) { .adm-grid { grid-template-columns: 1fr; } .iroles { grid-template-columns: 1fr; } }

.auth .only-rapido { display: none; }
.auth.rapido h2.only-rapido { display: block; }
.auth.rapido .only-entrar, .auth.rapido .field, .auth.rapido .atabs { display: none !important; }
.auth.rapido .field.name-field { display: flex !important; }
.quick-toggle { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 211, 107, 0.08); border: 1px solid rgba(255, 211, 107, 0.25); font-size: 13px; color: var(--muted); cursor: pointer; }
.quick-toggle b { color: var(--text); }
.quick-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ------------------------------------------------ áudio, vídeo e tela */
.ncard video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b1020; }
.ncard.mirror video { transform: scaleX(-1); }
.ncard.screen { width: 170px; cursor: zoom-in; }
.ncard.screen video { object-fit: contain; background: #05070d; }
.ncard .nlabel { z-index: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.ncard.speaking { box-shadow: 0 0 0 3px var(--ok), 0 0 18px rgba(62, 207, 110, 0.55); }
.ncard.linking::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.dbtn.av { position: relative; }
.dbtn.av.off::after { content: ''; position: absolute; left: 9px; right: 9px; top: 50%; height: 2px; background: var(--danger); transform: rotate(-35deg); border-radius: 2px; }
.dbtn.av.on { background: rgba(62, 207, 110, 0.22); box-shadow: inset 0 0 0 1px rgba(62, 207, 110, 0.6); }
#btn-screen.on { background: rgba(74, 140, 255, 0.3); box-shadow: inset 0 0 0 1px var(--accent); }
.tag.speaking .name { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(62, 207, 110, 0.35); }
.screen-card { padding: 14px; }
#screen-video { display: block; width: 100%; max-height: calc(100vh - 140px); border-radius: 12px; background: #05070d; }

/* ------------------------------------------------ chamada: faixa de participantes */
.callwrap { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 740px); pointer-events: none; }
.callwrap > * { pointer-events: auto; }
.callbar { max-width: 100%; min-width: 260px; padding: 8px 10px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(12px); animation: drop 0.3s ease-out; }
.call-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 8px; font-size: 12px; color: var(--muted); }
.call-head b { color: var(--text); font-size: 12.5px; }
.call-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(62, 207, 110, 0.2); }
.call-btn { margin-left: auto; height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--raise); font-size: 12px; font-weight: 600; }
.call-btn:hover { background: var(--accent); border-color: transparent; }
.call-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.tile { position: relative; flex: none; width: 168px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #10172a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); transition: box-shadow 0.15s; }
.tile-media { position: absolute; inset: 0; }
.tile-ava { position: absolute; inset: 0; display: grid; place-items: center; }
.tile-ava canvas { image-rendering: pixelated; width: 64px; height: 64px; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.tile.has-video video { display: block; }
.tile.has-video .tile-ava { display: none; }
.tile.mirror video { transform: scaleX(-1); }
.tile-name { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 5px; border-radius: 8px; background: rgba(8, 11, 20, 0.78); backdrop-filter: blur(4px); font-size: 12px; font-weight: 700; }
.tile-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-mic { font-size: 11px; }
.tile-mic.off { filter: grayscale(1); opacity: 0.8; }
.tile.speaking { box-shadow: 0 0 0 3px var(--ok), 0 0 20px rgba(62, 207, 110, 0.45); }
.tile.pinned { box-shadow: 0 0 0 3px var(--gold, #ffd36b); }
.tile.linking::after { content: 'conectando…'; position: absolute; top: 6px; right: 6px; padding: 1px 7px; border-radius: 6px; background: rgba(240, 180, 41, 0.9); color: #1b2233; font-size: 10px; font-weight: 800; }
.tile-tools { position: absolute; top: 6px; left: 6px; right: 6px; display: flex; gap: 4px; align-items: center; opacity: 0; transition: opacity 0.15s; }
.tile:hover .tile-tools { opacity: 1; }
.tile-btn { width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(8, 11, 20, 0.8); font-size: 12px; }
.tile-btn:hover { background: var(--accent); }
.tile-vol { width: 60px; accent-color: var(--ok); }

/* palco: tela compartilhada ou pessoa destacada */
.callstage { width: min(720px, calc(100vw - 740px)); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: drop 0.3s ease-out; }
.callstage.big { width: min(1180px, calc(100vw - 380px)); }
.callwrap:has(.callstage.big) { max-width: calc(100vw - 380px); z-index: 13; }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.stage-head b { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-actions { display: flex; gap: 4px; }
.stage-actions button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--raise); }
.stage-actions button:hover { background: var(--accent); }
.stage-body { position: relative; aspect-ratio: 16 / 9; background: #05070d; }
.callstage .stage-body video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-ava { position: absolute; inset: 0; display: none; place-items: center; }
.stage-ava canvas { image-rendering: pixelated; }
.callstage.no-video .stage-ava { display: grid; }
.callstage.no-video video { display: none; }
.share-banner { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: #1f4fb8; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; }
.share-banner button { border: 0; border-radius: 999px; padding: 6px 14px; background: #ff6b6b; color: #fff; font-weight: 800; }

/* grade */
.call-grid { background: rgba(6, 9, 18, 0.94); }
.grid-wrap { width: min(1280px, 100%); height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 10px; }
.grid-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.grid-tiles { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-auto-rows: minmax(180px, 1fr); gap: 12px; overflow-y: auto; }
.grid-tiles .tile { width: 100%; height: 100%; aspect-ratio: auto; }
.grid-tiles .tile-ava canvas { width: 120px; height: 120px; }
.grid-tiles .tile-name { font-size: 14px; padding: 5px 10px; }

/* configurações de áudio e vídeo */
.av-card { width: min(860px, 100%); }
.av-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; }
.s-preview { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #05070d; display: grid; place-items: center; }
.s-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.s-preview video.mirror { transform: scaleX(-1); }
.s-preview.on video { display: block; }
.s-preview.on .s-preview-off { display: none; }
.s-preview-off { color: var(--muted); font-size: 13px; }
.s-meter { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.s-meter-track { flex: 1; height: 8px; border-radius: 99px; background: var(--raise-2); overflow: hidden; }
#s-meter-bar { width: 0; height: 100%; background: linear-gradient(90deg, #3ecf6e, #f0b429 70%, #ff6b6b); transition: width 0.08s; }
.s-test { width: 100%; }
.av-form select { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #10172a; color: var(--text); padding: 0 10px; font: inherit; }
.toggles { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tg { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--raise); cursor: pointer; }
.tg input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.tg span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.tg b { color: var(--text); font-size: 13px; }
.tag .name .media { font-size: 10px; letter-spacing: 1px; }
.tag .name .media:empty { display: none; }
@media (max-width: 1180px) { .callwrap { max-width: calc(100vw - 420px); } .callstage { width: min(640px, calc(100vw - 420px)); } }
@media (max-width: 760px) { .callwrap { max-width: calc(100vw - 28px); } .callstage, .callstage.big { width: calc(100vw - 28px); } .av-grid { grid-template-columns: 1fr; } }

@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- volume por pessoa ---------- */
.s-vol { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.s-vol h3 { margin: 0 0 2px; font-size: 15px; }
.s-note { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.s-sub { margin: 12px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.vrow { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr 46px 34px; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--raise); margin-bottom: 6px; }
.vname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow input[type=range] { width: 100%; accent-color: var(--accent); }
.vval { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.vmute { width: 32px; height: 30px; border: 0; border-radius: 8px; background: var(--raise-2); font-size: 15px; }
.s-empty { margin: 0; font-size: 12px; color: var(--muted); padding: 8px 2px; }

/* ---------- mesa fixa ---------- */
.desk-ask { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 18px; border-radius: 16px; background: rgba(16, 23, 42, 0.96); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); animation: deskIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); max-width: calc(100vw - 32px); }
.desk-ask .da-txt { display: flex; flex-direction: column; gap: 2px; }
.desk-ask b { font-size: 14px; }
.desk-ask span { font-size: 12px; color: var(--muted); }
.da-btns { display: flex; gap: 8px; flex: none; }
.da-yes, .da-no { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; font-weight: 700; }
.da-yes { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #fff; }
.da-no { background: var(--raise-2); color: var(--text); }
@keyframes deskIn { from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@media (max-width: 760px) { .desk-ask { flex-direction: column; align-items: stretch; bottom: 84px; } .vrow { grid-template-columns: 1fr 1.4fr 40px 32px; } }

/* ---------- foco ---------- */
.tag.focus .name::after { content: '🎯'; margin-left: 3px; font-size: 10px; }

/* ---------- reunião em tela cheia ---------- */
.meet { position: fixed; left: 0; right: 0; top: 0; bottom: 78px; z-index: 20; display: none; grid-template-rows: 58px minmax(0, 1fr); background: #0c1120; animation: meetIn 0.25s ease-out; }
.meet.open { display: grid; }
body.in-meet #dock { z-index: 22; }
body.in-meet #side, body.in-meet #topbar, body.in-meet .mini-wrap, body.in-meet .hint, body.in-meet #prompt { visibility: hidden; }
@keyframes meetIn { from { opacity: 0; } to { opacity: 1; } }
.meet-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 14px; }
.meet-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--raise); font-size: 14px; }
.meet-title { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.meet-pin { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #f0734f; font-size: 14px; }
.meet-right { display: flex; justify-content: flex-end; gap: 8px; }
.meet-btn { height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--raise-2); color: var(--text); font-weight: 700; font-size: 14px; }
.meet-btn:hover, .meet-icon:hover { background: var(--accent); }
.meet-icon { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--raise-2); font-size: 16px; }
.meet:not(.nochat) .meet-icon { background: var(--accent); }
.meet-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 8px; padding: 0 8px 8px; min-height: 0; }
.meet.nochat .meet-body { grid-template-columns: minmax(0, 1fr); }
.meet.nochat .meet-chat { display: none; }
.meet-main { position: relative; min-height: 0; min-width: 0; }
.meet-grid { position: absolute; inset: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 8px; }
.meet-grid .tile { width: var(--tw, 320px); height: calc(var(--tw, 320px) / 1.6); aspect-ratio: auto; border-radius: 10px; background: #161c2f; cursor: pointer; }
.meet .tile-ava { background: #161c2f !important; }
.meet .tile-ava canvas { width: 72px; height: 72px; border-radius: 50%; background: #2a3555; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1); }
.meet .tile.screen video { object-fit: contain; background: #0a0d18; }
.meet .tile-name { left: 8px; bottom: 8px; font-size: 14px; padding: 4px 9px 4px 6px; background: rgba(8, 11, 20, 0.85); }
.meet .tile-mic.off { filter: none; opacity: 1; background: #e5484d; border-radius: 5px; padding: 0 3px; font-size: 11px; }
.meet .tile:hover { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22); }
.meet .tile.speaking { box-shadow: 0 0 0 3px var(--ok), 0 0 20px rgba(62, 207, 110, 0.35); }
.meet-stage { display: none; position: relative; min-height: 0; border-radius: 12px; overflow: hidden; background: #0a0d18; }
.meet.focus .meet-main { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 8px; }
.meet.focus .meet-grid { position: static; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; align-content: stretch; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.meet.focus .meet-grid .tile { width: 100%; height: auto; aspect-ratio: 6 / 5; flex: none; }
.meet.focus .meet-stage { display: block; }
.meet-view { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; touch-action: none; }
.meet-view.zoomed { cursor: grab; }
.meet-view.zoomed:active { cursor: grabbing; }
.meet-view video { width: 100%; height: 100%; object-fit: contain; transform-origin: center; transition: transform 0.08s linear; }
.meet-stage.no-video video { display: none; }
.meet-stage-ava { display: none; }
.meet-stage.no-video .meet-stage-ava { display: grid; place-items: center; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--c, #3b5bdb), #10172a 120%); }
.meet-stage-ava canvas { image-rendering: pixelated; width: 140px; height: 140px; }
.meet-stage-name { position: absolute; left: 10px; bottom: 10px; padding: 5px 11px; border-radius: 9px; background: rgba(8, 11, 20, 0.85); font-weight: 700; font-size: 14px; }
.meet-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; align-items: center; }
.meet-tools button { height: 34px; min-width: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: rgba(8, 11, 20, 0.85); color: var(--text); font-weight: 700; }
.meet-tools button:hover { background: var(--accent); }
.meet-zoom { display: flex; align-items: center; gap: 4px; padding: 0 4px; border-radius: 10px; background: rgba(8, 11, 20, 0.85); }
.meet-zoom button { background: transparent; font-size: 18px; }
.meet-zoom input { width: 110px; accent-color: #3ecf9e; }
.meet-chat { display: flex; flex-direction: column; min-height: 0; border-radius: 12px; background: #1b2238; overflow: hidden; }
.mc-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; font-size: 17px; }
.mc-head b { flex: 1; }
.mc-pin { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #f0734f; font-size: 15px; }
.mc-who { margin: 0 0 6px; padding: 12px 16px; background: rgba(255, 255, 255, 0.05); font-size: 14px; font-weight: 600; }
.mc-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.mc-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 17px; }
.mc-bubble { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: #313b58; font-size: 38px; }
.mc-msg { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.mc-msg b { font-size: 13px; }
.mc-msg span { font-size: 11px; color: var(--muted); }
.mc-msg p { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.mc-msg.mine b { color: #8fb4ff; }
.mc-form { margin: 8px; border-radius: 12px; background: #252e49; overflow: hidden; }
.mc-note { padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mc-row { display: flex; gap: 6px; padding: 6px; background: #141a2c; border: 1px solid var(--line); border-radius: 12px; }
.mc-row input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 0 8px; outline: none; }
.mc-row button { width: 40px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-size: 16px; }
@media (max-width: 900px) {
  .meet-body { grid-template-columns: minmax(0, 1fr); }
  .meet:not(.nochat) .meet-main { display: none; }
  .meet.focus .meet-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: 110px minmax(0, 1fr); }
  .meet.focus .meet-grid { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .meet.focus .meet-grid .tile { height: 100%; width: auto; aspect-ratio: 16 / 10; }
  .meet-btn { font-size: 0; padding: 0 10px; } .meet-btn::first-letter { font-size: 16px; }
  .meet-zoom input { width: 70px; }
}
.meet-stage.no-video .meet-zoom, .meet-stage.no-video #meet-full { display: none; }

#builder.personal #b-brushes, #builder.personal .b-tiles, #builder.personal [data-mode="tile"] { display: none !important; }

/* reações num botão só */
.emo-wrap { position: relative; }
.emo-pop { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(6, 38px); gap: 4px; padding: 8px; border-radius: 14px; background: var(--panel-solid, #141b2d); border: 1px solid var(--line); box-shadow: var(--shadow); animation: emoIn 0.18s ease-out; z-index: 5; }
.emo-pop[hidden] { display: none; }
@keyframes emoIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* barra enxuta: menu ⋯ e zoom no canto */
.me-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-wrap { position: relative; }
#btn-more { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.more-menu { position: absolute; bottom: calc(100% + 12px); right: -6px; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--panel-solid, #141b2d); border: 1px solid var(--line); box-shadow: var(--shadow); animation: emoIn2 0.18s ease-out; z-index: 5; }
.more-menu[hidden] { display: none; }
@keyframes emoIn2 { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mitem { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; }
.mitem:hover { background: var(--raise-2); }
.mitem i { font-style: normal; width: 22px; text-align: center; font-size: 16px; }
.mitem[hidden] { display: none; }
.mitem kbd, .mtip kbd { font-size: 10.5px; padding: 1px 5px; border-radius: 5px; background: var(--raise); border: 1px solid var(--line); }
.mtip { margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.zoom-stack { position: fixed; right: 14px; bottom: 96px; z-index: 9; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.zoom-stack button { width: 40px; height: 38px; border: 0; background: transparent; color: var(--text); font-size: 20px; font-weight: 700; }
.zoom-stack button:hover { background: var(--raise-2); }
.zoom-stack button + button { border-top: 1px solid var(--line); }
body:has(#dock[hidden]) .zoom-stack, body.in-meet .zoom-stack { display: none; }
#side:not(.collapsed) ~ .zoom-stack { right: 358px; }
@media (max-width: 760px) {
  #dock { gap: 3px; padding: 5px; max-width: calc(100vw - 16px); }
  #dock .dbtn { width: 36px; height: 36px; font-size: 17px; }
  #dock .sep { margin: 0; }
  .more-menu { right: -4px; min-width: 230px; }
  .emo-pop { left: auto; right: -40px; transform: none; grid-template-columns: repeat(4, 38px); }
  .zoom-stack { bottom: 84px; right: 8px; }
}
