*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

:root {
  --wall: #1c1c1e;
  --slab: #111113;
  --text: #e8d5c0;
  --text-dim: #7a5a40;
  --accent: #e87c2a;
  --danger: #c0392b;
  --gap: 7px;
}

body {
  background: var(--wall);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  overflow: hidden;
}

/* ── Building ── */
#building-pan {
  position: fixed;
  top: 0;
  left: 0;
  cursor: grab;
  user-select: none;
  will-change: transform;
  transform-origin: 0 0;
}

#building-pan.panning { cursor: grabbing; }

#building {
  min-width: max(100vw, 1750px);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--gap);
  background-image: url('/images/wall.png');
  background-repeat: repeat;
  background-size: auto;
}

.floor {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: #000;
}

.viga-row {
  display: flex;
  height: var(--gap);
  flex-shrink: 0;
}

.viga-seg {
  background-image: url('/images/viga_01.png');
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.viga-col {
  width: var(--gap);
  flex-shrink: 0;
  background-image: url('/images/viga_01.png');
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.viga-dark {
  filter: brightness(0.25);
}

.coluna {
  width: var(--gap);
  flex-shrink: 0;
  align-self: stretch;
  background-image: url('/images/coluna_01.png');
  background-repeat: repeat-y;
  background-size: 100% auto;
}

.coluna-dark {
  filter: brightness(0.25);
}

/* ── Apartment ── */
.apartment {
  flex: 1;
  min-width: 0;
  aspect-ratio: 938 / 633;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.15s;
}

.apartment:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* ── Divider apartment (architectural separator) ── */
.apartment.divider {
  flex: 0.9;
  margin-top: 10px;
  margin-bottom: -4px;
  filter: brightness(0.28) saturate(0.35);
  box-shadow:
    inset 8px 0 24px rgba(0,0,0,0.95),
    inset -8px 0 24px rgba(0,0,0,0.95),
    inset 0 10px 28px rgba(0,0,0,0.9),
    inset 0 -6px 16px rgba(0,0,0,0.8);
}

.apartment.divider.divider-lit {
  filter: brightness(0.55) saturate(0.6);
  box-shadow:
    inset 6px 0 18px rgba(0,0,0,0.75),
    inset -6px 0 18px rgba(0,0,0,0.75),
    inset 0 8px 20px rgba(0,0,0,0.65),
    inset 0 -4px 10px rgba(0,0,0,0.5);
}

.apartment.divider:hover {
  transform: scale(1.02);
}

/* ── Mine marker ── */
.apartment.mine::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  z-index: 3;
}

/* ── Online dot (vizinho online) ── */
.apt-online {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
  z-index: 3;
  pointer-events: none;
}

/* ── Blocked apartment ── */
.apt-blocked {
  filter: brightness(0.35) saturate(0.2);
  cursor: default;
}
.apt-blocked-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.7;
}

/* ── Unread badge ── */
.apt-unread {
  position: absolute;
  top: 3px;
  left: 3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  z-index: 4;
  pointer-events: none;
}

/* ── Neighbor enter/leave animation ── */
@keyframes aptPulseIn {
  0%, 100% { box-shadow: none; }
  40%       { box-shadow: 0 0 0 4px rgba(46,204,113,0.7), 0 0 14px rgba(46,204,113,0.4); }
}
@keyframes aptPulseOut {
  0%, 100% { box-shadow: none; }
  40%       { box-shadow: 0 0 0 4px rgba(192,57,43,0.7), 0 0 14px rgba(192,57,43,0.4); }
}
.apt-anim-in  { animation: aptPulseIn  1.4s ease; }
.apt-anim-out { animation: aptPulseOut 1.4s ease; }

/* ── Occupant info (hover) ── */
.apt-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  z-index: 2;
  pointer-events: none;
}

.apt-name-row {
  padding: 0 5px 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
}

.apt-status-row {
  padding: 0 5px 3px;
  margin-top: -0px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
}

.apartment:hover .apt-name-row,
.apartment:hover .apt-status-row { opacity: 1; }
.apt-name-row.always-visible   { opacity: 1; }
.apt-status-row.always-visible { opacity: 1; }

.apt-name   { display: block; font-size: 9px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt-status { display: block; font-size: 8px; color: rgba(255,255,255,0.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Apartment tooltip ── */
.apt-tooltip {
  position: fixed;
  background: #000;
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 130px;
  max-width: 200px;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.7));
}
.apt-tooltip::after {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--tail-x, 16px);
  border: 7px solid transparent;
  border-bottom-color: #000;
  border-top: 0;
  transform: translateX(-50%);
}
.apt-tooltip.above::after {
  top: auto;
  bottom: -7px;
  border-bottom-color: transparent;
  border-top-color: #000;
  border-bottom: 0;
  border-top-width: 7px;
}
.apt-tooltip.visible { opacity: 1; }
.apt-tooltip-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.apt-tooltip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.apt-tooltip-initial {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.apt-tooltip-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apt-tooltip-status {
  font-size: 11px;
  color: #aaa;
  margin-top: 5px;
  line-height: 1.35;
}

/* ── Modal Splash ── */
.modal-splash-box {
  padding: 0;
  overflow: hidden;
  width: 360px;
  gap: 0;
}
.splash-preview {
  width: 100%;
  display: block;
  max-height: 240px;
  object-fit: cover;
  object-position: center top;
}
.splash-copy {
  padding: 22px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.splash-line {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.splash-line-ok {
  color: var(--text-dim);
  font-style: italic;
}
.splash-brand {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  border-top: 1px solid #2a1208;
  padding-top: 12px;
}
.splash-enter-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
}
.modal-splash-box .modal-actions {
  padding: 12px 24px 20px;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }

.modal-box {
  background: #1a0b05;
  border: 1px solid #3a1a08;
  border-radius: 10px;
  padding: 28px 28px 24px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-box h2  { font-size: 18px; font-weight: 700; }
.modal-sub     { font-size: 13px; color: var(--text-dim); }
.field-label   { font-size: 12px; color: var(--text-dim); }

.modal-box input[type="text"],
.modal-box input[type="email"],
.modal-box input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  background: #100704;
  border: 1px solid #3a1a08;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.modal-box input[type="text"]:focus,
.modal-box input[type="email"]:focus,
.modal-box input[type="password"]:focus { border-color: var(--accent); }

/* ── Style picker ── */
.style-picker {
  display: flex;
  gap: 10px;
}

.style-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.style-option input[type="radio"] { display: none; }

.style-option img {
  width: 100%;
  aspect-ratio: 938 / 633;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #2a1208;
  transition: border-color 0.2s, transform 0.2s;
}

.style-option input:checked + img {
  border-color: var(--accent);
  transform: scale(1.04);
}

.style-option span { font-size: 11px; color: var(--text-dim); }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Panel ── */
.panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: #160a04;
  border-left: 1px solid #2a1208;
  display: flex;
  flex-direction: column;
  z-index: 90;
  box-shadow: -8px 0 32px rgba(0,0,0,0.6);
}
.panel.hidden { display: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #2a1208;
  font-size: 14px;
  font-weight: 600;
}

.panel-sub   { display: block; font-size: 11px; color: var(--text-dim); font-weight: 400; }
.panel-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 14px; }
.panel-close:hover { color: var(--text); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field-row label { font-size: 12px; color: var(--text-dim); width: 72px; flex-shrink: 0; }

.field-row input[type="text"],
.field-row input[type="email"],
.field-row select {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background: #100704;
  border: 1px solid #3a1a08;
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.field-row input:focus,
.field-row select:focus { border-color: var(--accent); }
.field-row input[readonly] { opacity: 0.5; cursor: default; }
.field-row input[readonly]:focus { border-color: #3a1a08; }

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* ── Panel cards ── */
.panel-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-card-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.syndico-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  font-size: 13px;
}
.syndico-user-item:hover { background: rgba(255,255,255,0.08); }

/* ── Chat ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg { display: flex; flex-direction: column; gap: 2px; max-width: 85%; }
.chat-msg.sent  { align-self: flex-end; align-items: flex-end; }
.chat-msg.recv  { align-self: flex-start; }

.chat-bubble {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.chat-msg.sent .chat-bubble { background: var(--accent); color: #fff; }
.chat-msg.recv .chat-bubble { background: #2a1208; color: var(--text); }
.chat-meta { font-size: 10px; color: var(--text-dim); display: flex; gap: 5px; align-items: center; }
.chat-time { opacity: 0.6; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #2a1208;
}
.chat-input-row input {
  flex: 1;
  padding: 8px 12px;
  background: #100704;
  border: 1px solid #3a1a08;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-disabled { opacity: 0.45; cursor: not-allowed !important; }
.chat-input-row button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Typing indicator ── */
.chat-typing {
  padding: 4px 16px 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}
.chat-typing.hidden { display: none; }

/* ── Info panel ── */
.info-name   { font-size: 18px; font-weight: 700; margin-top: 4px; }
.info-status { font-size: 14px; color: var(--text-dim); margin-top: 4px; }
.info-hint      { font-size: 11px; color: #4a2a10; margin-top: 16px; }
.contract-info  { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.contract-info.urgent { color: #e8882a; }

/* ── Histórico ── */
.history-section { margin-top: 12px; }
.history-title   { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #2a1208;
  font-size: 12px;
}
.history-item:last-child { border-bottom: none; }
.history-item-name  { flex: 1; color: var(--text); }
.history-item-dates { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.history-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: #2a1208;
}

/* ── Vizinho online item ── */
.neighbor-online-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #2a1208;
  cursor: pointer;
}
.neighbor-online-item:last-child { border-bottom: none; }
.neighbor-online-item:hover { opacity: 0.8; }
.neighbor-online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71; box-shadow: 0 0 5px #2ecc71; flex-shrink: 0;
}
.neighbor-online-name    { font-size: 13px; flex: 1; }
.neighbor-online-address { font-size: 10px; color: var(--text-dim); }

/* ── Mine panel redesign ── */
.mine-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #2a1208;
}
.mine-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mine-profile-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mine-profile-username {
  font-size: 11px;
  color: var(--text-dim);
}
.mine-profile-status {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.mine-avatar-clickable { cursor: pointer; }
.mine-avatar-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s;
}
.mine-avatar-clickable:hover .mine-avatar-edit { opacity: 1; }

.mine-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mine-nav {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a1208;
}
.mine-nav-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  background: #1a0a04;
  border: 1px solid #3a1a08;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.mine-nav-btn:hover,
.mine-nav-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-logout {
  margin-top: 14px;
  width: 100%;
  font-size: 12px;
  color: #666;
  border-color: #333;
  box-sizing: border-box;
}
.btn-logout:hover { color: #e05555; border-color: #e05555; }

.mine-section {
  padding: 12px 14px;
  border-bottom: 1px solid #2a1208;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mine-footer {
  padding: 10px 14px;
  border-top: 1px solid #2a1208;
  flex-shrink: 0;
}
.mine-footer .btn-primary { width: 100%; }

.mine-list-section {
  padding: 10px 14px 6px;
}
.mine-list-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.mine-list-body { display: flex; flex-direction: column; gap: 6px; }
.mine-list-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.mine-list-item:hover { background: rgba(255,255,255,0.05); }
.mine-list-item-name  { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-list-item-sub   { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.mine-list-item-last  { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mine-list-empty { font-size: 12px; color: var(--text-dim); padding: 4px 0; }

/* ── Avatar ── */
.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
}
.avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2a1208;
  border: 2px solid #3a1a08;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.avatar-img.loaded { display: block; }
.avatar-initial {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}
.avatar-side { display: flex; flex-direction: column; gap: 5px; }
.avatar-hint { font-size: 10px; color: var(--text-dim); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* avatar pequeno no hover do apê */
.apt-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.apt-info-inner {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Buttons ── */
.btn-primary {
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

@keyframes save-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,124,42,0.7); }
  50%       { box-shadow: 0 0 0 6px rgba(232,124,42,0); }
}
.btn-primary.dirty {
  animation: save-pulse 1.2s ease infinite;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-ghost {
  padding: 9px 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid #3a1a08;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  padding: 9px 16px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(192,57,43,0.1); }

.btn-warn {
  padding: 9px 16px;
  background: transparent;
  color: #e0892a;
  border: 1px solid #e0892a;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-warn:hover { background: rgba(224,137,42,0.1); }

.btn-toggle {
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #3a1a08;
  background: #1a0a04;
  color: var(--text-dim);
  transition: all 0.2s;
}
.btn-toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: #2a1208;
  color: var(--text);
  border: 1px solid #4a2010;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
  opacity: 0;
  z-index: 200;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.clickable { pointer-events: auto; cursor: pointer; border-color: var(--accent); }
#toast.clickable:hover { background: #3a1a0a; }

/* ── Neighbor popup ── */
.neighbor-popup {
  position: fixed;
  background: #1a0d06;
  border: 1px solid #3a1a08;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 150;
  min-width: 160px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.neighbor-popup.hidden { display: none; }

.popup-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding-bottom: 4px;
  border-bottom: 1px solid #2a1208;
  margin-bottom: 2px;
}

.popup-btn {
  padding: 7px 10px;
  background: transparent;
  border: 1px solid #3a1a08;
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.popup-btn:hover { background: #2a1208; }
.popup-btn.popup-btn-danger  { color: #e05555; }
.popup-btn.popup-btn-warn    { color: #e0892a; }
.popup-btn.popup-btn-listen  { color: var(--accent); }

/* Ear animation when listening */
@keyframes ear-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30%       { transform: scale(1.15) rotate(-8deg); }
  60%       { transform: scale(1.1) rotate(6deg); }
}
.listening-active {
  display: inline-block;
  animation: ear-pulse 1.4s ease-in-out infinite;
  color: var(--accent);
}
.np-item-listen, .popup-btn-listen {
  transition: opacity 0.2s;
}
.np-item-listen.playing { color: var(--accent); }
.popup-btn-listen.playing { color: var(--accent); font-weight: 700; }
.popup-btn.active { background: #2a1208; color: var(--accent); border-color: #4a2010; }

/* ── Chat events ── */
.chat-event {
  align-self: center;
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 2px 8px;
}

/* ── Login corner button ── */
.corner-buttons {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 150;
}
.btn-login-corner {
  padding: 8px 16px;
  background: #2a2a2e;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-login-corner:hover    { background: #3a3a3e; color: #fff; }
.btn-login-corner.logged-in { color: var(--accent); border-color: var(--accent); }

/* ── Now-playing corner button ── */
.btn-now-playing { color: #4caf50; border-color: #4caf50; }
.btn-now-playing:hover { background: #1a3320; color: #6fcf74; }
.btn-now-playing.pulsing {
  animation: np-pulse 1.4s ease-in-out infinite;
}
@keyframes np-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0.7); border-color: #4caf50; }
  50%       { box-shadow: 0 0 0 6px rgba(76,175,80,0);  border-color: #6fcf74; }
}

/* ── Now-playing modal ── */
.modal-now-playing-box { min-width: 300px; max-width: 420px; width: 90vw; }
.modal-now-playing-box h2 { margin-bottom: 16px; font-size: 16px; color: #4caf50; }

.now-playing-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }

.np-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
}
.np-item-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #888;
  flex-shrink: 0;
  overflow: hidden;
}
.np-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.np-item-info { flex: 1; min-width: 0; }
.np-item-name  { font-size: 13px; font-weight: 600; color: #ddd; margin-bottom: 2px; }
.np-item-track { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-item-track a { color: #888; text-decoration: none; }
.np-item-track a:hover { color: #4caf50; text-decoration: underline; }
.np-item-react {
  background: transparent;
  border: 1px solid #444;
  border-radius: 50%;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.np-item-react:hover   { background: #3a1a1a; border-color: #e05555; }
.np-item-react.reacted { background: #3a1a1a; border-color: #e05555; opacity: 0.5; }

/* ── Form error ── */
.form-error { font-size: 12px; color: #e05555; }
.form-error.hidden { display: none; }

/* ── Go-home button ── */
.btn-go-home {
  position: fixed;
  bottom: 20px;
  right: 20px;
  transition: background 0.2s, color 0.2s, right 0.25s;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(26,11,5,0.88);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.btn-go-home:hover { background: var(--accent); color: #fff; }
.btn-go-home.hidden { display: none; }

/* ── Zoom buttons ── */
.btn-zoom {
  position: fixed;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(26,11,5,0.88);
  border: 1px solid #444;
  color: #ccc;
  font-size: 20px;
  font-weight: 300;
  cursor: pointer;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, right 0.25s;
  line-height: 1;
}
#btn-zoom-out  { bottom: 66px;  }
#btn-zoom-in   { bottom: 112px; }
#btn-fullscreen{ bottom: 158px; }
.btn-zoom:hover { background: #3a3a3e; color: #fff; }
body.panel-open .btn-zoom,
body.panel-open .btn-go-home { right: 300px; }

/* ── Fullscreen mode: hide all regular UI ── */
body.fullscreen-mode .btn-zoom,
body.fullscreen-mode .btn-go-home,
body.fullscreen-mode .corner-buttons,
body.fullscreen-mode .btn-debug { display: none !important; }

/* ── Fullscreen side panel ── */
.fs-panel {
  display: none;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  z-index: 500;
  transition: transform 0.35s ease;
  flex-direction: row;
  align-items: center;
}
body.fullscreen-mode .fs-panel { display: flex; }
.fs-panel.collapsed { transform: translateY(-50%) translateX(56px); }

.fs-handle {
  width: 20px;
  height: 64px;
  background: rgba(26,11,5,0.88);
  border: 1px solid #444;
  border-right: none;
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  user-select: none;
}
.fs-handle:hover { background: #2a2a2e; color: #fff; }
.fs-panel.collapsed .fs-handle { color: #666; }

.fs-panel-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(26,11,5,0.88);
  border: 1px solid #444;
  border-radius: 0 8px 8px 0;
}

.fs-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.fs-btn:hover { background: #3a3a3e; color: #fff; }
#fs-exit { border-color: #a04040; color: #e07070; }
#fs-exit:hover { background: #a04040; color: #fff; }

body.panel-open .corner-buttons { right: 308px; transition: right 0.25s; }
.corner-buttons { transition: right 0.25s; }

@media (max-width: 600px) {
  body.panel-open .corner-buttons { display: none; }
}

/* ── Debug button ── */
.btn-debug {
  position: fixed;
  bottom: 204px;
  right: 20px;
  padding: 8px 14px;
  background: #2a2a2e;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  z-index: 150;
  transition: background 0.2s;
}
.btn-debug:hover { background: #3a3a3e; color: #fff; }
.btn-debug.hidden { display: none; }

/* ── New floor animation ── */
@keyframes floorIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.floor-new { animation: floorIn 0.5s ease; }

/* ── Spotify ── */
.mine-spotify-card {
  margin: 10px 14px;
  padding: 12px;
  background: #0d1a0f;
  border: 1px solid #1a3a1a;
  border-radius: 8px;
}
.mine-spotify-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1DB954;
  margin-bottom: 10px;
}
.spotify-logo-icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-spotify {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: #1DB954;
  color: #000;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  justify-content: center;
}
.btn-spotify:hover { background: #1ed760; }
.spotify-now-playing-mine {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.4;
}
.spotify-now-playing-mine strong { color: var(--text); }

/* now-playing widget on apartment card */
/* tooltip react button */
.tooltip-react-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 0 0 0 4px;
  line-height: 1;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s;
}
.tooltip-react-btn:hover  { opacity: 1; transform: scale(1.3); }
.tooltip-react-btn.reacted { opacity: 1; }

/* Floating heart reaction animation */
@keyframes heartFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.4); }
}
.reaction-float {
  position: absolute;
  font-size: 18px;
  animation: heartFloat 1s ease forwards;
  pointer-events: none;
  z-index: 9999;
}

/* ── Tooltip now playing ── */
.apt-tooltip-now-playing {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #1DB954;
  margin-top: 4px;
  min-width: 0;
  max-width: 220px;
}
.apt-tooltip-now-playing .np-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  cursor: pointer;
}
.apt-tooltip-now-playing .np-text:hover { text-decoration: underline; }

/* ── Mine panel header now playing ── */
.mine-profile-now-playing {
  font-size: 11px;
  color: #1DB954;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  cursor: pointer;
}
.mine-profile-now-playing:hover { text-decoration: underline; }

/* ── Spotify action buttons ── */
.btn-spotify-stop,
#btn-mine-spotify-disconnect {
  width: 100%;
  margin-top: 6px;
  font-size: 12px;
  box-sizing: border-box;
}

/* ── Login divider ── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
  color: #555;
  font-size: 12px;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: #333; }

/* ── Discord card (mine panel) ── */
.mine-discord-card {
  margin: 10px 14px;
  padding: 12px;
  background: #111116;
  border: 1px solid #5865F2;
  border-radius: 8px;
}
.mine-discord-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #5865F2;
  margin-bottom: 10px;
}
.discord-logo-icon { width: 18px; height: 18px; flex-shrink: 0; }

.discord-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #ccc;
  margin-bottom: 10px;
}
.discord-user-info img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}

.btn-discord-connect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-discord-connect:hover { background: #4752c4; }
.btn-discord-full { width: 100%; justify-content: center; box-sizing: border-box; }

#btn-mine-discord-disconnect {
  width: 100%;
  margin-top: 6px;
  font-size: 12px;
  box-sizing: border-box;
}

/* ── Discord connect in occupy form ── */
.occupy-discord-connected {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #5865F2;
  padding: 6px 8px;
  background: #1a1a2e;
  border: 1px solid #5865F2;
  border-radius: 6px;
  margin-bottom: 6px;
}
.discord-check { font-weight: 700; }
.btn-discord-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
.btn-discord-remove:hover { color: #e05555; }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: #0a0402;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #2a1208;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Modal 18+ ── */
.modal-age-box {
  text-align: center;
  max-width: 340px;
}
.modal-age-icon {
  font-size: 40px;
  margin-bottom: 10px;
}
.modal-age-box h2 {
  margin-bottom: 10px;
}
.modal-age-box p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 8px;
}
.modal-age-box .modal-actions {
  flex-direction: column;
  gap: 8px;
}
.modal-age-box .btn-primary,
.modal-age-box .btn-ghost {
  width: 100%;
}

/* Invite modal */
.invite-modal-box {
  text-align: center;
  gap: 10px;
}
.invite-modal-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}
.invite-modal-apt {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 6px;
}
.invite-modal-box .modal-actions {
  flex-direction: column;
  gap: 8px;
}
/* ── Report modal ── */
.report-target-name {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.report-reason-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.report-reason-opt input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.report-details-input {
  width: 100%;
  min-height: 70px;
  max-height: 140px;
  background: #1a1a1e;
  border: 1px solid #3a3a3e;
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.report-details-input:focus { outline: none; border-color: var(--accent); }

/* ── Admin reports panel ── */
.btn-admin-reports { position: relative; }
.admin-reports-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  background: #c0392b;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}
.report-item {
  padding: 12px 14px;
  border-bottom: 1px solid #2a1208;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.report-item:last-child { border-bottom: none; }
.report-item-header {
  font-size: 12px;
  color: var(--text-dim);
}
.report-item-header strong { color: var(--text); }
.report-item-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.report-reason-tag {
  background: rgba(224,85,85,0.15);
  color: #e07070;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}
.report-item-details {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.report-item-date {
  font-size: 10px;
  color: var(--text-dim);
}
.report-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ── Mobile backdrop (fecha painel ao tocar fora) ── */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
@media (max-width: 600px) {
  body.panel-open .mobile-backdrop { display: block; }
}

/* ── Btn-chats badge ── */
.btn-chats { position: relative; }
.btn-chats-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* ── Panel chats ── */
.chats-panel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.chats-section-label {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: 1px solid #2a1208;
  flex-shrink: 0;
}
.chats-section-label:first-child { border-top: none; }
.chats-neighbors-list {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  flex-shrink: 0;
}
.chats-convs-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.invite-modal-box .btn-primary,
.invite-modal-box .btn-ghost {
  width: 100%;
}
