* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1a2e;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ===== AUTH (Old School RPG style) ===== */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #0d0d14;
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(40,30,20,0.4) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(255,255,255,0.01) 31px, rgba(255,255,255,0.01) 32px),
    repeating-linear-gradient(90deg, transparent, transparent 31px, rgba(255,255,255,0.01) 31px, rgba(255,255,255,0.01) 32px);
}

.auth-box {
  background: #1a1a24;
  border: 3px solid #5a4a2a;
  border-radius: 6px 4px 5px 3px;
  box-shadow:
    0 0 0 1px #2a2015,
    0 0 0 4px #3d2e18,
    0 0 0 5px rgba(0,0,0,0.3),
    0 8px 32px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,220,150,0.05);
  padding: 0;
  text-align: center;
  min-width: 380px;
  max-width: 600px;
}
.auth-box h1 {
  font-size: 1.2rem;
  margin: 0;
  padding: 10px 16px;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-bottom: 1px solid #5a4a2a;
  color: #d4b87a;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.auth-box > p {
  color: #7a7060;
  margin: 0;
  padding: 8px 16px 0;
  font-size: 0.75rem;
}
.auth-box-body {
  padding: 16px 20px;
}

.auth-input {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid #3a3020;
  border-radius: 4px 6px 3px 5px;
  background: #0e0e16;
  background-image: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, transparent 40%, rgba(255,255,255,0.02) 100%);
  color: #c8b890;
  font-size: 0.8rem;
  outline: none;
  margin-bottom: 8px;
  font-family: Georgia, 'Times New Roman', serif;
  box-shadow:
    inset 0 1px 4px rgba(0,0,0,0.6),
    inset 0 -1px 0 rgba(255,220,150,0.03),
    0 1px 0 rgba(255,220,150,0.05);
}
.auth-input::placeholder { color: #4a4030; font-style: italic; }
.auth-input:focus {
  border-color: #7a6030;
  box-shadow:
    inset 0 1px 4px rgba(0,0,0,0.6),
    0 0 8px rgba(138,112,64,0.2);
}
.auth-select {
  color: #8a7a60;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a4a2a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.auth-select option { background: #0e0e16; color: #c8b890; }
input[type="date"].auth-input { color: #8a7a60; }
input[type="date"].auth-input::-webkit-calendar-picker-indicator {
  filter: invert(0.5) sepia(1) hue-rotate(10deg);
}

.auth-btn {
  width: 100%;
  padding: 10px;
  border: 2px solid #5a4a2a;
  border-radius: 5px 3px 6px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
  font-family: Georgia, serif;
  letter-spacing: 0.5px;
}
.auth-btn.primary {
  background: linear-gradient(180deg, #5a4a28 0%, #3d2a12 50%, #2a1a08 100%);
  border-color: #7a6a3a #3a2a10 #3a2a10 #7a6a3a;
  color: #d4b87a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,220,150,0.1);
}
.auth-btn.primary:hover {
  background: linear-gradient(180deg, #6a5a38 0%, #4a3a1a 50%, #3a2a10 100%);
  color: #f0d890;
  box-shadow: 0 2px 8px rgba(138,112,64,0.25), inset 0 1px 0 rgba(255,220,150,0.15);
}
.auth-btn.primary:active {
  border-color: #3a2a10 #7a6a3a #7a6a3a #3a2a10;
  background: linear-gradient(180deg, #2a1a08 0%, #3a2a10 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.auth-btn:disabled { opacity: 0.7; cursor: wait; }
.btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(212,184,122,0.3);
  border-top-color: #d4b87a;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.auth-footer {
  padding: 10px 16px;
  border-top: 1px solid #2a2015;
  background: rgba(0,0,0,0.15);
}
.auth-switch {
  font-size: 0.75rem;
  color: #6a6050;
  margin: 0;
}
.auth-switch a {
  color: #d4b87a;
  text-decoration: none;
}
.auth-switch a:hover { color: #f0d090; text-decoration: underline; }

/* Remember me */
.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #7a7060;
  margin-bottom: 10px;
  cursor: pointer;
}
.remember-me input { accent-color: #8a7040; cursor: pointer; }

/* Register fields */
.register-fields {
  margin-bottom: 14px;
}
.register-row {
  display: flex;
  gap: 8px;
}
.register-row .auth-input { flex: 1; }

/* Outfit customizer area */
.register-outfit {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #12121a;
  border: 1px solid #3a3020;
  padding: 12px;
  margin-bottom: 14px;
}
.outfit-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#reg-avatar-canvas {
  background: #0a0a12;
  border: 1px solid #3a3020;
  image-rendering: pixelated;
}
.avatar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
#reg-outfit-name {
  font-size: 0.7rem;
  color: #c8b890;
  min-width: 75px;
  text-align: center;
  font-family: Georgia, serif;
}
.outfit-arrow-sm {
  background: linear-gradient(180deg, #3a3020 0%, #2a2015 100%);
  border: 1px solid #5a4a2a;
  color: #d4b87a;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.75rem;
}
.outfit-arrow-sm:hover { background: linear-gradient(180deg, #4a3a2a 0%, #3a2a18 100%); }

/* Color palette */
.outfit-colors-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reg-color-tabs {
  display: flex;
  gap: 2px;
}
.reg-tab {
  flex: 1;
  padding: 6px 0;
  background: #1a1a24;
  border: 1px solid #3a3020;
  color: #7a7060;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: all 0.1s;
}
.reg-tab.active {
  background: #3a2a10;
  border-color: #8a7040;
  color: #d4b87a;
}
.reg-color-grid {
  display: grid;
  grid-template-columns: repeat(19, 1fr);
  gap: 2px;
  background: #0a0a12;
  border: 1px solid #3a3020;
  padding: 4px;
}
.reg-color-cell {
  aspect-ratio: 1;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 2px;
  min-width: 12px;
  transition: border-color 0.1s;
}
.reg-color-cell:hover { border-color: #d4b87a; }
.reg-color-cell.selected { border-color: #fff; box-shadow: 0 0 4px #d4b87a; }

/* ===== GAME ===== */
#game-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0a0a10;
  background-image:
    radial-gradient(ellipse at 50% 40%, rgba(80,60,30,0.25) 0%, transparent 45%),
    radial-gradient(circle at 6% 25%, rgba(240,160,48,0.06) 0%, transparent 25%),
    radial-gradient(circle at 94% 25%, rgba(240,160,48,0.06) 0%, transparent 25%),
    radial-gradient(circle at 6% 60%, rgba(240,160,48,0.06) 0%, transparent 25%),
    radial-gradient(circle at 94% 60%, rgba(240,160,48,0.06) 0%, transparent 25%),
    radial-gradient(ellipse at 50% 50%, transparent 25%, rgba(0,0,0,0.6) 100%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-box {
  text-align: center;
  position: relative;
  width: 100%;
  height: 100%;
}
.loading-title {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.2rem;
  color: #d4b87a;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #8a7040, #f0d890, #d4b87a, #f0d890, #8a7040);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShimmer 3s ease-in-out infinite;
  text-shadow: none;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.8));
  white-space: nowrap;
}
@keyframes titleShimmer {
  0% { background-position: 300% 0; }
  100% { background-position: -300% 0; }
}

/* Outfit animado no loading */
.loading-outfit-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}
.loading-scene-scroll {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%) scale(1.6);
  width: 384px;
  height: 384px;
  overflow: hidden;
  border: 5px solid #4a3a1a;
  border-color: #6a5530 #2a1a08 #1a1005 #5a4520;
  border-radius: 2px;
  box-shadow:
    0 0 0 2px #1a1005,
    0 0 0 4px #3a2a12,
    0 0 0 5px rgba(0,0,0,0.4),
    inset 0 0 8px rgba(0,0,0,0.5),
    0 6px 30px rgba(0,0,0,0.7);
  outline: 1px solid rgba(90,70,30,0.3);
}
#loading-scene {
  image-rendering: pixelated;
  animation: sceneScroll 8s linear infinite;
}
@keyframes sceneScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-384px); }
}
#loading-outfit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%) scale(1.6);
  width: 128px;
  height: 128px;
  z-index: 2;
}
.loading-player-name {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #d4b87a;
  text-align: center;
  letter-spacing: 0.5px;
  font-style: italic;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* Tochas pixel art */
.loading-torch {
  position: absolute;
  width: 16px;
  image-rendering: pixelated;
  z-index: 10;
  transform: scale(2);
}
.loading-torch.left { left: 60px; }
.loading-torch.right { right: 60px; }
.loading-torch.top { top: 15%; }
.loading-torch.bottom { top: 55%; }

/* Cabo da tocha (pixels) */
.torch-flame {
  position: relative;
  width: 16px;
  margin: 0 auto;
}
.torch-flame::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 4px;
  width: 8px;
  height: 30px;
  background:
    linear-gradient(180deg, #6a4a20 0%, #4a3010 100%);
  box-shadow:
    -2px 0 0 #3a2008,
    2px 0 0 #8a6a30,
    /* Borda preta */
    -4px 0 0 #000,
    4px 0 0 #000,
    0 -2px 0 #000,
    0 30px 0 #000;
}

/* Chama pixel art usando box-shadow com contorno preto */
.torch-flame::before {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  margin: 0 auto;
  background: #ffe060;
  animation: pixelFlame 0.3s steps(1) infinite;
  box-shadow:
    /* Contorno preto externo */
    0 -20px 0 #000, -8px -12px 0 #000, 8px -12px 0 #000,
    -8px -8px 0 #000, 8px -8px 0 #000,
    -8px -4px 0 #000, 8px -4px 0 #000,
    -4px 0 0 #000, 4px 0 0 #000, 0 4px 0 #000,
    /* Núcleo */
    0 -4px 0 #ffe060, 0 -8px 0 #ffb030, 0 -12px 0 #ff8010,
    -4px -4px 0 #ff8010, 4px -4px 0 #ff8010,
    -4px -8px 0 #e06010, 4px -8px 0 #e06010,
    0 -16px 0 #c04010, -4px -12px 0 #c04010, 4px -12px 0 #c04010;
}
@keyframes pixelFlame {
  0% {
    box-shadow:
      0 -20px 0 #000, -8px -12px 0 #000, 8px -12px 0 #000,
      -8px -8px 0 #000, 8px -8px 0 #000,
      -8px -4px 0 #000, 8px -4px 0 #000,
      -4px 0 0 #000, 4px 0 0 #000, 0 4px 0 #000,
      0 -4px 0 #ffe060, 0 -8px 0 #ffb030, 0 -12px 0 #ff8010,
      -4px -4px 0 #ff8010, 4px -4px 0 #ff8010,
      -4px -8px 0 #e06010, 4px -8px 0 #e06010,
      0 -16px 0 #c04010, -4px -12px 0 #c04010, 4px -12px 0 #c04010;
  }
  33% {
    box-shadow:
      0 -20px 0 #000, -8px -12px 0 #000, 8px -12px 0 #000,
      -8px -8px 0 #000, 8px -4px 0 #000,
      -8px -4px 0 #000, 8px -8px 0 #000,
      -4px 0 0 #000, 4px 0 0 #000, 0 4px 0 #000,
      0 -4px 0 #ffb030, 0 -8px 0 #ffe060, 0 -12px 0 #ffb030,
      -4px -4px 0 #e06010, 4px -8px 0 #ff8010,
      4px -4px 0 #ff8010, -4px -8px 0 #ff8010,
      0 -16px 0 #e06010, -4px -12px 0 #c04010, 4px -12px 0 #e06010;
  }
  66% {
    box-shadow:
      0 -20px 0 #000, -8px -12px 0 #000, 8px -8px 0 #000,
      8px -12px 0 #000, -8px -8px 0 #000,
      -8px -4px 0 #000, 8px -4px 0 #000,
      -4px 0 0 #000, 4px 0 0 #000, 0 4px 0 #000,
      0 -4px 0 #ffe060, 0 -8px 0 #ff8010, 0 -12px 0 #ffb030,
      4px -4px 0 #e06010, -4px -4px 0 #ffb030,
      -4px -8px 0 #ff8010, 4px -8px 0 #e06010,
      0 -16px 0 #c04010, 4px -12px 0 #ff8010, -4px -12px 0 #e06010;
  }
}

.torch-glow {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255,180,48,0.1) 0%, transparent 70%);
  animation: glowPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Partículas douradas */
.loading-particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #d4b87a;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(0) scale(0); }
  10% { opacity: 0.8; transform: scale(1); }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-200px) scale(0.3); }
}
.loading-bar-container {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 350px;
  height: 8px;
  background: rgba(0,0,0,0.6);
  border: 1px solid #3a3020;
  border-radius: 4px;
  overflow: hidden;
  z-index: 10;
}
.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5a4a28, #d4b87a, #5a4a28);
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
  animation: loadingShimmer 1.5s ease-in-out infinite;
}
@keyframes loadingShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loading-text {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  color: #c8b890;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
}
.loading-sub {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  white-space: nowrap;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  color: #4a3a22;
  margin-top: 6px;
  font-style: italic;
}

/* ===== SIDEBAR LATERAL ===== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(180deg, #1e1a12 0%, #161210 100%);
  border-right: 1px solid #3a3020;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  z-index: 60;
  box-shadow: 2px 0 10px rgba(0,0,0,0.4);
}

.sidebar-top,
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sidebar-bottom {
  padding-bottom: 10px;
}

.sidebar-divider {
  width: 24px;
  height: 1px;
  background: #3a3020;
  margin: 4px 0;
}

.sidebar-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #6a5a40;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.sidebar-btn svg { flex-shrink: 0; }
.sidebar-btn:hover {
  color: #c8b890;
  background: rgba(90,74,42,0.15);
  border-color: rgba(90,74,42,0.3);
}
.sidebar-btn.active {
  color: #d4b87a;
  background: linear-gradient(180deg, #2a2418 0%, #1e1a12 100%);
  border-color: #5a4a2a;
  box-shadow: 0 0 8px rgba(138,112,64,0.15);
}

/* Tooltip lateral (aparece à direita) */
.sidebar-btn[data-tooltip-right]::before {
  content: attr(data-tooltip-right);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: linear-gradient(180deg, #2a2015 0%, #1a1510 100%);
  border: 2px solid #5a4a2a;
  border-color: #6a5a3a #3a2a10 #3a2a10 #6a5a3a;
  color: #d4b87a;
  font-family: Georgia, serif;
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.7);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}
.sidebar-btn[data-tooltip-right]::after {
  content: '';
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  border: 6px solid transparent;
  border-right-color: #4a3a1a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1001;
}
.sidebar-btn[data-tooltip-right]:hover::before,
.sidebar-btn[data-tooltip-right]:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ===== PAINÉIS LATERAIS ===== */
#sidebar-panels {
  position: fixed;
  top: 0;
  left: 48px;
  bottom: 0;
  z-index: 55;
  pointer-events: none;
}
.sidebar-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: linear-gradient(180deg, #1e1a12 0%, #161210 100%);
  border-right: 1px solid #3a3020;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(0,0,0,0.5);
  pointer-events: auto;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-bottom: 1px solid #5a4a2a;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #d4b87a;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.panel-close-btn {
  background: none;
  border: 1px solid #4a3a22;
  border-radius: 3px;
  color: #7a6a4a;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.panel-close-btn:hover {
  color: #d4b87a;
  border-color: #6a5a3a;
  background: rgba(90,74,42,0.2);
}
.panel-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-search {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(58,48,32,0.5);
}
.panel-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #3a3020;
  border-radius: 3px;
  background: #0e0e16;
  color: #c8b890;
  font-size: 0.75rem;
  font-family: Georgia, serif;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}
.panel-input::placeholder { color: #4a4030; font-style: italic; }
.panel-input:focus { border-color: #5a4a2a; }

.panel-section {
  padding: 8px 0;
}
.panel-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 6px;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  color: #7a6a4a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.panel-count {
  background: rgba(138,112,64,0.2);
  color: #8a7040;
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(138,112,64,0.2);
}
.panel-list {
  display: flex;
  flex-direction: column;
}
.panel-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  transition: background 0.15s;
  cursor: default;
}
.panel-member:hover {
  background: rgba(90,74,42,0.12);
}
.panel-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2a2418;
  border: 1px solid #3a3020;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  position: relative;
}
.panel-member-avatar .status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #1a1510;
  background: #8a9a60;
}
.panel-member-avatar .status-dot.offline {
  background: #4a4030;
}
.panel-member-info {
  flex: 1;
  min-width: 0;
}
.panel-member-name {
  font-family: Georgia, serif;
  font-size: 0.78rem;
  color: #c8b890;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-member-status {
  font-family: Georgia, serif;
  font-size: 0.62rem;
  color: #6a5a3a;
  font-style: italic;
}

/* Chat */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg {
  font-size: 0.75rem;
  font-family: Georgia, serif;
  color: #b0a080;
  line-height: 1.4;
}
.chat-msg .chat-author {
  color: #d4b87a;
  font-weight: 600;
}
.chat-input-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid rgba(58,48,32,0.5);
}
.chat-input-row .panel-input { flex: 1; }
.chat-send-btn {
  background: linear-gradient(180deg, #3a3020 0%, #2a2015 100%);
  border: 1px solid #5a4a2a;
  border-radius: 3px;
  color: #8a7a5a;
  width: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.chat-send-btn:hover { color: #d4b87a; border-color: #6a5a3a; }

.panel-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 0.8rem;
  color: #4a3a22;
  font-style: italic;
}

/* ===== HUD - Barra inferior ===== */
#hud {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: linear-gradient(180deg, #2a2015 0%, #1a1510 100%);
  border: 1px solid #5a4a2a;
  border-color: #6a5a3a #3a2a10 #3a2a10 #6a5a3a;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,220,150,0.05);
  z-index: 50;
  gap: 8px;
}

#hud-left, #hud-right {
  display: none;
}

#player-count {
  font-size: 0.7rem;
  color: #6a6050;
  font-family: Georgia, serif;
}

#voice-status {
  font-size: 0.75rem;
  color: #8a9a60;
  font-family: Georgia, serif;
}

/* Sidebar profile wrapper */
.sidebar-profile {
  position: relative;
}

.menu-icon {
  font-size: 0.75rem;
  color: #8a7040;
  font-style: normal;
  width: 14px;
  text-align: center;
  display: inline-block;
}

/* Menu dropdown do perfil */
.profile-menu {
  position: absolute;
  bottom: 0;
  left: calc(100% + 8px);
  margin-bottom: 0;
  background: linear-gradient(180deg, #221c14 0%, #1a1510 100%);
  border: 2px solid #5a4a2a;
  border-color: #6a5a3a #3a2a10 #3a2a10 #6a5a3a;
  border-radius: 3px;
  overflow: hidden;
  min-width: 170px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.3),
    0 6px 20px rgba(0,0,0,0.7);
  z-index: 100;
}
.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-bottom: 1px solid #5a4a2a;
  color: #d4b87a;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}
.profile-menu-header svg {
  color: #8a7040;
  flex-shrink: 0;
}
#profile-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(90,74,42,0.15);
  color: #b0a080;
  font-size: 0.76rem;
  font-family: Georgia, serif;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.profile-menu-item svg {
  color: #6a5a3a;
  flex-shrink: 0;
  transition: color 0.15s;
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover {
  background: linear-gradient(90deg, rgba(90,74,42,0.2) 0%, transparent 100%);
  color: #f0d890;
}
.profile-menu-item:hover svg {
  color: #d4b87a;
}
.profile-menu-item.logout {
  color: #a06050;
}
.profile-menu-item.logout svg {
  color: #7a4a3a;
}
.profile-menu-item.logout:hover {
  background: linear-gradient(90deg, rgba(160,80,64,0.15) 0%, transparent 100%);
  color: #c07060;
}
.profile-menu-item.logout:hover svg {
  color: #a06050;
}

#hud-center {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hud-separator {
  width: 1px;
  height: 22px;
  background: #3a3020;
  margin: 0 2px;
}

.hud-btn {
  background: linear-gradient(180deg, #2a2418 0%, #1e1a12 100%);
  border: 1px solid #4a3a22;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all 0.15s;
  color: #8a7a5a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,220,150,0.06), 0 1px 3px rgba(0,0,0,0.4);
}
.hud-btn svg { flex-shrink: 0; }
.hud-btn:hover {
  background: linear-gradient(180deg, #3a3020 0%, #2a2418 100%);
  color: #d4b87a;
  border-color: #6a5a3a;
}
.hud-btn.active {
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-color: #8a7040;
  color: #f0d890;
  box-shadow: 0 0 8px rgba(138,112,64,0.25), inset 0 1px 0 rgba(255,220,150,0.1);
}
.hud-btn.muted {
  background: linear-gradient(180deg, #2a1a14 0%, #1e1410 100%);
  border-color: #5a3020;
  color: #905040;
}
.hud-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== TOOLTIP RPG ===== */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  left: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: linear-gradient(180deg, #2a2015 0%, #1a1510 100%);
  border: 2px solid #5a4a2a;
  border-color: #6a5a3a #3a2a10 #3a2a10 #6a5a3a;
  color: #d4b87a;
  font-family: Georgia, serif;
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.5px;
  padding: 7px 16px;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.3),
    0 4px 12px rgba(0,0,0,0.7);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  z-index: 1000;
}
[data-tooltip]::after {
  content: '';
  bottom: calc(100% + 2px);
  transform: translateX(-50%) translateY(4px);
  border: 6px solid transparent;
  border-top-color: #4a3a1a;
  z-index: 1001;
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== SIDEBAR - Participantes (estilo RPG) ===== */
#call-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 220px;
  background: linear-gradient(180deg, #1e1a12 0%, #161210 100%);
  border-left: 1px solid #3a3020;
  z-index: 40;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 10px rgba(0,0,0,0.4);
}

#call-sidebar.minimized-sidebar {
  bottom: auto;
  height: auto;
}
#call-sidebar.minimized-sidebar #participants-list {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  font-size: 0.8rem;
  font-family: Georgia, serif;
  color: #d4b87a;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-bottom: 1px solid #5a4a2a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  cursor: grab;
  user-select: none;
}
.drag-grip {
  color: #4a3a22;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: -1px;
  transition: color 0.15s;
  cursor: grab;
}
.sidebar-header:hover .drag-grip {
  color: #8a7040;
}
.sidebar-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-toggle-btn {
  background: none;
  border: 1px solid #4a3a22;
  border-radius: 3px;
  color: #7a6a4a;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.sidebar-toggle-btn:hover {
  color: #d4b87a;
  border-color: #6a5a3a;
  background: rgba(90,74,42,0.2);
}

.call-count {
  background: rgba(138,112,64,0.25);
  color: #d4b87a;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-family: Georgia, serif;
  border: 1px solid rgba(138,112,64,0.3);
}

#participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.participant {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.76rem;
  font-family: Georgia, serif;
  color: #c8b890;
  background: rgba(42,32,21,0.4);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s;
}
.participant:hover {
  background: rgba(90,74,42,0.2);
  border-color: rgba(90,74,42,0.3);
}

.participant .avatar-icon { font-size: 1.1rem; }
.participant .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.participant .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8a9a60;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(138,154,96,0.4);
}
.participant .dot.sharing {
  background: #d4b87a;
  animation: pulse-live 1.5s ease-in-out infinite;
  box-shadow: 0 0 4px rgba(212,184,122,0.4);
}
.participant .badge {
  font-size: 0.55rem;
  color: #d4b87a;
  background: rgba(138,112,64,0.3);
  border: 1px solid rgba(138,112,64,0.4);
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  font-family: Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.participant .badge.hand {
  background: rgba(138,112,64,0.25);
  font-size: 0.75rem;
  animation: hand-wave 1s ease-in-out infinite;
  border: none;
  padding: 0;
}
@keyframes hand-wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(12deg); }
  75% { transform: rotate(-12deg); }
}

/* ===== SCREEN SHARE ===== */
#screen-share-container {
  position: fixed;
  background: rgba(0,0,0,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  z-index: 100;
  transition: all 0.25s ease;
}

/* Quem compartilha - preview pequeno */
#screen-share-container.sharing-self {
  bottom: 70px;
  right: 230px;
  width: 300px;
  top: auto;
  left: auto;
}

/* Quem assiste - tela grande */
#screen-share-container.viewing-remote {
  top: 10px;
  left: 10px;
  right: 230px;
  bottom: 70px;
  width: auto;
}

/* Minimizado */
#screen-share-container.minimized {
  top: auto !important;
  left: auto !important;
  right: 230px !important;
  bottom: 70px !important;
  width: 280px !important;
  height: auto !important;
  transform: none !important;
}
#screen-share-container.minimized #screen-video {
  height: 160px;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  font-size: 0.8rem;
  color: #888;
  cursor: grab;
  user-select: none;
}
.screen-header:active { cursor: grabbing; }

.live-badge {
  background: #e94560;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.screen-header-btns { display: flex; gap: 2px; }

#minimize-screen-btn,
#close-screen-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
#minimize-screen-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
#close-screen-btn:hover { background: rgba(233,69,96,0.2); color: #e94560; }

#screen-video {
  width: 100%;
  height: calc(100% - 34px);
  display: block;
  object-fit: contain;
  background: #000;
}

/* ===== MODAL DE CUSTOMIZAÇÃO (Tibia-style) ===== */
#customize-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 300;
}

.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
}

.modal-content.outfit-selector {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a24;
  border: 3px solid #5a4a2a;
  border-radius: 6px 4px 5px 3px;
  width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px #2a2015,
    0 0 0 4px #3d2e18,
    0 0 0 5px rgba(0,0,0,0.3),
    0 8px 32px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,220,150,0.05);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-bottom: 1px solid #5a4a2a;
}
.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #d4b87a;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#close-modal-btn {
  background: none; border: none; color: #7a6a4a;
  font-size: 1rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
#close-modal-btn:hover { color: #d4b87a; background: rgba(138,112,64,0.2); }

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
}

/* Top: preview + controls */
.outfit-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.customize-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a12;
  border: 1px solid #3a3020;
  border-radius: 4px;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
}
#preview-canvas {
  image-rendering: pixelated;
}

.outfit-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #7a7060;
  font-size: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-family: Georgia, serif;
}
.outfit-checkbox input { cursor: pointer; accent-color: #8a7040; }

.outfit-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 128px;
}

.outfit-nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

#outfit-name {
  color: #c8b890;
  font-size: 0.95rem;
  font-weight: 400;
  min-width: 100px;
  text-align: center;
  font-family: Georgia, serif;
}

.outfit-arrow {
  background: linear-gradient(180deg, #3a3020 0%, #2a2015 100%);
  border: 1px solid #5a4a2a;
  color: #d4b87a;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.outfit-arrow:hover { background: linear-gradient(180deg, #4a3a2a 0%, #3a2a18 100%); color: #f0d890; }

.gender-toggle {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.gender-option {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #7a7060;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  font-family: Georgia, serif;
}
.gender-option input { cursor: pointer; accent-color: #8a7040; }

.addon-toggles {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Color palette section */
.color-palette-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.palette-tabs {
  display: flex;
  gap: 2px;
  border-bottom: none;
}

.palette-tab {
  flex: 1;
  background: #1a1a24;
  border: 1px solid #3a3020;
  border-bottom: none;
  color: #7a7060;
  padding: 6px 0;
  font-size: 0.7rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.1s;
  font-family: Georgia, serif;
}
.palette-tab:first-child { border-radius: 4px 0 0 0; }
.palette-tab:last-child { border-radius: 0 4px 0 0; }
.palette-tab:hover { background: #2a2015; color: #c8b890; }
.palette-tab.active {
  background: #3a2a10;
  border-color: #8a7040;
  color: #d4b87a;
}

.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(19, 1fr);
  gap: 2px;
  padding: 4px;
  background: #0a0a12;
  border: 1px solid #3a3020;
  border-radius: 0 0 4px 4px;
}

.color-cell {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  min-width: 12px;
  min-height: 12px;
  transition: border-color 0.1s;
}
.color-cell:hover {
  border-color: #d4b87a;
}
.color-cell.selected {
  border-color: #fff;
  box-shadow: 0 0 4px #d4b87a;
}

.modal-footer {
  padding: 0 20px 16px;
  display: flex;
  justify-content: stretch;
}
#save-customize-btn {
  width: 100%;
  padding: 10px;
  border: 2px solid #5a4a2a;
  border-radius: 5px 3px 6px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: Georgia, serif;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #5a4a28 0%, #3d2a12 50%, #2a1a08 100%);
  border-color: #7a6a3a #3a2a10 #3a2a10 #7a6a3a;
  color: #d4b87a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,220,150,0.1);
}
#save-customize-btn:hover {
  background: linear-gradient(180deg, #6a5a38 0%, #4a3a1a 50%, #3a2a10 100%);
  color: #f0d890;
  box-shadow: 0 2px 8px rgba(138,112,64,0.25), inset 0 1px 0 rgba(255,220,150,0.15);
}
#save-customize-btn:active {
  border-color: #3a2a10 #7a6a3a #7a6a3a #3a2a10;
  background: linear-gradient(180deg, #2a1a08 0%, #3a2a10 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* ===== MAP EDITOR ===== */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(58,48,32,0.4);
}
.editor-tool {
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #2a2418 0%, #1e1a12 100%);
  border: 1px solid #3a3020;
  border-radius: 4px;
  color: #6a5a3a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.editor-tool:hover { color: #c8b890; border-color: #5a4a2a; }
.editor-tool.active {
  color: #d4b87a;
  border-color: #8a7040;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  box-shadow: 0 0 6px rgba(138,112,64,0.2);
}
.editor-tool-sep {
  width: 1px;
  height: 20px;
  background: #3a3020;
  margin: 0 4px;
}
.editor-cursor-label {
  font-family: Georgia, serif;
  font-size: 0.65rem;
  color: #5a4a2a;
  margin-left: auto;
}
.editor-filter {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(58,48,32,0.4);
}
.editor-select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #3a3020;
  border-radius: 3px;
  background: #0e0e16;
  color: #c8b890;
  font-size: 0.72rem;
  font-family: Georgia, serif;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a4a2a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.editor-select option { background: #0e0e16; color: #c8b890; }
.editor-tile-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 40px);
  gap: 4px;
  align-content: start;
}
.editor-tile-cell {
  width: 40px;
  height: 40px;
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,18,0.5);
  transition: all 0.12s;
  position: relative;
}
.editor-tile-cell:hover { border-color: #5a4a2a; background: rgba(90,74,42,0.15); }
.editor-tile-cell.active { border-color: #d4b87a; box-shadow: 0 0 6px rgba(212,184,122,0.3); background: rgba(90,74,42,0.25); }
.editor-tile-cell img { width: 32px; height: 32px; image-rendering: pixelated; }
.editor-tile-cell[data-tooltip]::before { bottom: calc(100% + 6px); font-size: 0.62rem; padding: 3px 8px; }
.editor-tile-cell[data-tooltip]::after { bottom: calc(100% + 1px); border-width: 4px; }
.load-more-btn {
  grid-column: 1 / -1;
  text-align: center;
  padding: 8px;
  color: #8a7040;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  cursor: pointer;
  border: 1px dashed #3a3020;
  border-radius: 3px;
  transition: all 0.15s;
}
.load-more-btn:hover { color: #d4b87a; border-color: #5a4a2a; background: rgba(90,74,42,0.1); }
.editor-footer {
  padding: 10px;
  border-top: 1px solid rgba(58,48,32,0.4);
}
.editor-save-msg { display: block; margin-top: 6px; font-size: 0.68rem; font-family: Georgia, serif; text-align: center; }
/* Editor SQM highlight */
#editor-sqm-highlight {
  position: fixed;
  pointer-events: none;
  border: 2px solid #d4b87a;
  z-index: 100;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
  overflow: hidden;
}
#editor-sqm-highlight img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0.6;
}

/* Editor context menu */
#editor-context-menu {
  position: fixed;
  z-index: 500;
  background: linear-gradient(180deg, #221c14 0%, #1a1510 100%);
  border: 2px solid #5a4a2a;
  border-color: #6a5a3a #3a2a10 #3a2a10 #6a5a3a;
  border-radius: 4px;
  min-width: 140px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
  overflow: hidden;
  padding: 4px 0;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #b0a080;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.1s;
}
.ctx-item svg { color: #6a5a3a; flex-shrink: 0; transition: color 0.1s; }
.ctx-item:hover { background: rgba(90,74,42,0.2); color: #f0d890; }
.ctx-item:hover svg { color: #d4b87a; }
.ctx-item[data-action="delete"] { color: #905040; }
.ctx-item[data-action="delete"]:hover { background: rgba(140,70,55,0.15); color: #c07060; }
.ctx-item[data-action="delete"]:hover svg { color: #a06050; }
.ctx-sep { height: 1px; background: rgba(58,48,32,0.4); margin: 3px 0; }
.ctx-info {
  padding: 5px 12px;
  font-family: Georgia, serif;
  font-size: 0.62rem;
  color: #5a4a2a;
  font-style: italic;
}

body.map-editor-mode #game-canvas { cursor: default; }
.editor-grid-indicator {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border: 1px solid #5a4a2a; color: #d4b87a; font-family: Georgia, serif;
  font-size: 0.75rem; padding: 6px 16px; border-radius: 4px;
  z-index: 200; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
body.map-editor-mode .editor-grid-indicator { display: block; }

/* Interact hint */
#interact-hint {
  position: fixed;
  pointer-events: none;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #2a2015 0%, #1a1510 100%);
  border: 1px solid #5a4a2a;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.6);
  animation: hintPulse 1.5s ease-in-out infinite;
}
.interact-key {
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border: 1px solid #6a5a3a;
  color: #f0d890;
  font-family: Georgia, serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  min-width: 18px;
  text-align: center;
}
.interact-text {
  color: #c8b890;
  font-family: Georgia, serif;
  font-size: 0.7rem;
  font-style: italic;
}
@keyframes hintPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== SETTINGS MODAL ===== */
#settings-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 400;
}
.settings-container {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 750px;
  max-width: 90vw;
  height: 520px;
  max-height: 85vh;
  display: flex;
  background: #1a1a24;
  border: 3px solid #5a4a2a;
  border-radius: 6px 4px 5px 3px;
  box-shadow:
    0 0 0 1px #2a2015,
    0 0 0 4px #3d2e18,
    0 0 0 5px rgba(0,0,0,0.3),
    0 8px 32px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,220,150,0.05);
  overflow: hidden;
}

/* Nav lateral */
.settings-nav {
  width: 210px;
  background: linear-gradient(180deg, #1e1a12 0%, #161210 100%);
  border-right: 1px solid #3a3020;
  padding: 14px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.settings-nav-section {
  padding: 8px 16px 4px;
  font-family: Georgia, serif;
  font-size: 0.6rem;
  color: #5a4a2a;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.settings-nav-section:first-child { padding-top: 0; }
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  color: #9a8a6a;
  font-family: Georgia, serif;
  font-size: 0.76rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.settings-nav-item svg { color: #6a5a3a; flex-shrink: 0; transition: color 0.15s; }
.settings-nav-item:hover {
  color: #c8b890;
  background: rgba(90,74,42,0.1);
}
.settings-nav-item:hover svg { color: #8a7040; }
.settings-nav-item.active {
  color: #d4b87a;
  background: rgba(90,74,42,0.2);
  border-left-color: #d4b87a;
}
.settings-nav-item.active svg { color: #d4b87a; }
.settings-nav-item.admin-only,
.settings-nav-section.admin-only { display: none; }
body.is-admin .settings-nav-item.admin-only,
body.is-admin .settings-nav-section.admin-only { display: flex; }

/* Admin-only elements genéricos */
.admin-only-el { display: none !important; }
body.is-admin .admin-only-el { display: flex !important; }

/* Conteúdo */
.settings-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.settings-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, #3d2e18 0%, #2a2015 100%);
  border-bottom: 1px solid #5a4a2a;
}
.settings-content-header h3 {
  font-family: Georgia, serif;
  font-size: 1rem;
  color: #d4b87a;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#settings-close-btn {
  background: none;
  border: 1px solid #4a3a22;
  border-radius: 3px;
  color: #7a6a4a;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
#settings-close-btn:hover { color: #d4b87a; border-color: #6a5a3a; background: rgba(90,74,42,0.2); }

.settings-content-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Formulários dentro das settings */
.settings-group {
  margin-bottom: 20px;
}
.settings-group-title {
  font-family: Georgia, serif;
  font-size: 0.68rem;
  color: #5a4a2a;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(58,48,32,0.3);
}
.settings-group p {
  font-family: Georgia, serif;
  font-size: 0.72rem;
  color: #7a6a4a;
  margin-bottom: 12px;
  line-height: 1.5;
}
.settings-field {
  margin-bottom: 14px;
}
.settings-label {
  display: block;
  font-family: Georgia, serif;
  font-size: 0.72rem;
  color: #9a8a6a;
  margin-bottom: 4px;
}
.settings-label .required { color: #a06050; }
.settings-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #3a3020;
  border-radius: 4px;
  background: #0e0e16;
  color: #c8b890;
  font-size: 0.78rem;
  font-family: Georgia, serif;
  outline: none;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.4);
}
.settings-input::placeholder { color: #4a4030; font-style: italic; }
.settings-input:focus { border-color: #5a4a2a; }
.settings-input:disabled { opacity: 0.5; cursor: not-allowed; }
textarea.settings-input { resize: vertical; min-height: 80px; }

.settings-btn {
  padding: 8px 20px;
  border: 2px solid #5a4a2a;
  border-radius: 4px;
  font-family: Georgia, serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.settings-btn.primary {
  background: linear-gradient(180deg, #5a4a28 0%, #3d2a12 50%, #2a1a08 100%);
  border-color: #7a6a3a #3a2a10 #3a2a10 #7a6a3a;
  color: #d4b87a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.settings-btn.primary:hover {
  background: linear-gradient(180deg, #6a5a38 0%, #4a3a1a 50%, #3a2a10 100%);
  color: #f0d890;
}
.settings-btn.danger {
  background: linear-gradient(180deg, #4a2a20 0%, #3a1a10 100%);
  border-color: #6a3a2a;
  color: #a06050;
}
.settings-btn.danger:hover { color: #c07060; }

/* Tabela de membros */
.settings-members-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
}
.settings-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(42,32,21,0.3);
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  color: #c8b890;
}
.settings-member-row .member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-member-row .member-name {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-member-row .member-email {
  color: #6a5a3a;
  font-size: 0.65rem;
  font-style: italic;
}
.member-role-select {
  font-family: Georgia, serif;
  flex-shrink: 0;
}
.member-icon-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid #3a3020;
  border-radius: 4px;
  color: #6a5a3a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.member-icon-btn:hover { color: #c8b890; border-color: #5a4a2a; background: rgba(90,74,42,0.15); }
.member-icon-btn.danger:hover { color: #a06050; border-color: #5a3020; background: rgba(160,80,64,0.1); }
.member-icon-btn.primary:hover { color: #8a9a60; border-color: #5a6a3a; background: rgba(100,130,60,0.1); }
.member-icon-btn[data-tooltip]::before {
  bottom: calc(100% + 6px);
  font-size: 0.65rem;
  padding: 3px 8px;
}
.member-icon-btn[data-tooltip]::after {
  bottom: calc(100% + 1px);
  border-width: 4px;
}
.settings-member-row.inactive {
  opacity: 0.5;
}
.settings-member-row.inactive .member-name {
  color: #6a5a3a;
  text-decoration: line-through;
  text-decoration-color: #4a3a22;
}

/* ===== WALK TOAST ===== */
#walk-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 32, 0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(10px);
  z-index: 1000;
  animation: toastSlideIn 0.25s ease-out;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#walk-toast-text {
  color: #ccc;
  font-size: 0.85rem;
  white-space: nowrap;
}

#walk-toast-stop {
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
#walk-toast-stop:hover { background: #c73852; }
