html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
#map { width: 100%; height: 100%; cursor: default; }

/* Modal simples (apelido) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal-card { background: #fff; padding: 18px; border-radius: 12px; width: min(92vw, 380px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.modal-card h3 { margin: 0 0 10px; }
.modal-card input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #ccc; margin: 8px 0 12px; font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal .hidden { display: none; }

/* Upload */
#char-upload { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: #fff; padding: 8px 12px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.15); font-size: 14px; z-index: 1000; }
#char-upload small { display: block; opacity: .7; }

/* HUD */
#hud { position: absolute; top: 70px; left: 10px; background: rgba(0,0,0,.65); padding: 12px; border-radius: 10px; color: #fff; z-index: 1000; min-width: 260px; }
#health { position: relative; width: 220px; height: 20px; background: #333; border-radius: 6px; margin-bottom: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); }
#health-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d4d, #ff1a1a); transition: width .2s ease; }
#health-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
#money { margin: 6px 0 10px; font-weight: 600; }

.hud-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hud-actions button { background: #fff; color: #111; border: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.hud-actions button:hover { filter: brightness(0.95); }

/* Banner de modo */
#modeBanner { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(34,34,34,.9); color: #fff; padding: 8px 12px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 1000; font-size: 14px; }
.hidden { display: none; }

/* Inventário */
#inventory { position: absolute; top: 140px; left: 50%; transform: translateX(-50%); width: min(92%, 420px); background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 1000; border: 1px solid #e8e8e8; }
.inv-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #eee; }
.inv-header h3 { margin: 0; }
#invCloseBtn { background: transparent; border: none; font-size: 16px; cursor: pointer; }
.inv-body { padding: 14px; }

/* Chat */
#chat { position: absolute; bottom: 10px; left: 10px; width: min(320px, 80vw); background: rgba(0,0,0,.65); color: #fff; font-size: 14px; border-radius: 10px; overflow: hidden; z-index: 1000; backdrop-filter: blur(4px); }
#chat-messages { height: 160px; overflow-y: auto; padding: 8px; }
#chat-messages p { margin: 0 0 6px; line-height: 1.3; }
#chat-input { width: 100%; border: none; padding: 10px 12px; outline: none; background: rgba(255,255,255,.9); color: #111; font-size: 14px; }

/* Painel de Desenho */
#drawPanel { position: absolute; top: 70px; right: 10px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 1000; width: min(360px, 92vw); padding: 10px; border: 1px solid #eee; }
.draw-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
#palette { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.palette-color { width: 22px; height: 22px; border-radius: 5px; border: 1px solid #ccc; cursor: pointer; }
.palette-color.selected { outline: 2px solid #111; }
.draw-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Cheats */
#cheatsPanel { position: absolute; top: 140px; left: 10px; background: #fff; padding: 10px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 1000; width: min(300px, 90vw); border: 1px solid #eee; }
.cheats-row { margin-bottom: 6px; }
#cheatsInput { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #ccc; outline: none; }

/* Cursores de modo */
.leaflet-container.drawing, .leaflet-container.fasttravel { cursor: crosshair !important; }

/* Mira/Alvo visual */
.fasttravel-ping {
  width: 22px; height: 22px; border: 2px solid #ff0055; border-radius: 50%;
  box-shadow: 0 0 10px rgba(255,0,85,.8);
  background: rgba(255,0,85,.15);
}

/* Balão de fala do chat */
.speech-bubble {
  position: relative;
  background: #ffffff;
  color: #111;
  padding: 6px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  font-size: 12px;
  white-space: nowrap;
}
.speech-bubble:after {
  content: ""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  border-width: 6px 6px 0 6px; border-style: solid; border-color: #ffffff transparent transparent transparent;
}

/* Admin HUD */
.admin-overlay {
  position: absolute;
  top: 100px;
  left: 100px;
  width: 300px;
  background: rgba(0,0,0,0.88);
  color: #fff;
  padding: 10px 10px 14px;
  border: 2px solid #fff;
  border-radius: 10px;
  z-index: 9999;
  cursor: default;
  user-select: none;
}
.admin-header {
  font-weight: bold;
  padding: 6px;
  background: #1d1d1d;
  cursor: move;
  text-align: center;
  border-radius: 6px;
}
.admin-section {
  margin: 10px 0;
  padding: 8px 6px;
  border-top: 1px solid #444;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}
.admin-section h3 { margin: 0 0 8px; font-size: 16px; }
.admin-section input, .admin-section select { width: 100%; margin: 4px 0 8px; padding: 6px; border-radius: 6px; border: 1px solid #555; background: #111; color: #eee; }
.admin-section button { width: 100%; padding: 8px; border-radius: 8px; border: none; background: #fff; color: #111; font-weight: 700; cursor: pointer; }
.small { font-size: 12px; opacity: .8; }
