/* =============================================================
   LIM — estilo base
   Paleta: roxo (#5b3df5) + amarelo (#ffd166) + neutro escuro
   ============================================================= */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1020;
  color: #f1f1f5;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

/* ---------- Telas (login vs app) ---------- */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ---------- Login ---------- */
#screen-login {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #5b3df5 0%, #0f1020 70%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
}
.brand { font-size: 48px; margin: 0; letter-spacing: 6px; color: #ffd166; }
.tagline { color: #c8c8d8; margin: 4px 0 24px; }
#form-login label {
  display: block;
  text-align: left;
  font-size: 13px;
  margin-bottom: 12px;
  color: #d0d0e0;
}
#form-login input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: white;
  outline: none;
}
#form-login input:focus { border-color: #ffd166; }
.btn-primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #ffd166;
  color: #2a1a00;
  font-weight: 700;
  margin-top: 6px;
}
.error { color: #ff6b6b; min-height: 18px; font-size: 13px; }
.hint { color: #a8a8c0; font-size: 12px; text-align: left; margin-top: 14px; }
.hint summary { cursor: pointer; }

/* ---------- App shell ---------- */
#screen-app { background: #0f1020; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1a1b35;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #5b3df5, #b06bff);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
  font-size: 18px;
}
.who small { color: #ffd166; }
.btn-ghost {
  background: transparent; color: #c8c8d8;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 6px 12px;
}

/* ---------- Abas ---------- */
#main-area { flex: 1; overflow: auto; padding: 14px; }
.tab { display: none; }
.tab.active { display: block; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Bottom nav (6 abas) ---------- */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #1a1b35;
}
.nav-btn {
  background: transparent; color: #c8c8d8;
  border: 0; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px;
}
.nav-btn.active { color: #ffd166; }
.nav-btn span { font-size: 10px; }

/* ---------- Cartões genéricos ---------- */
.card {
  background: #1a1b35;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 4px 0; color: #c8c8d8; font-size: 14px; }

.row { display: flex; gap: 8px; align-items: center; }
.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  background: #2a2b50; color: #ffd166; font-size: 12px;
}

/* ---------- Chat ---------- */
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 200px); }
.chat-list {
  flex: 1; overflow-y: auto;
  padding: 8px 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; }
.msg.me { align-self: flex-end; background: #5b3df5; color: white; border-bottom-right-radius: 4px; }
.msg.other { align-self: flex-start; background: #2a2b50; border-bottom-left-radius: 4px; }
.msg small { display: block; font-size: 10px; opacity: 0.7; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; padding-top: 8px; }
.chat-form input {
  flex: 1; padding: 10px 12px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.1);
  background: #1a1b35; color: white; outline: none;
}

/* Painel de emojis do chat */
.emoji-panel {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 4px;
  max-height: 110px; overflow-y: auto;
  background: #1a1b35;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-top: 6px;
}
.emoji-btn {
  background: transparent; border: 0;
  font-size: 20px; line-height: 1;
  padding: 4px 6px; border-radius: 6px;
}
.emoji-btn:hover { background: #2a2b50; }

/* ---------- Pet ---------- */
.pet-stage {
  display: flex; flex-direction: column; align-items: center; padding: 10px 0;
}
.pet-sprite {
  width: 140px; height: 140px;
  background: #2a2b50;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  border: 4px solid #ffd166;
}
.pet-stats { width: 100%; margin-top: 10px; }
.bar { background: #2a2b50; height: 10px; border-radius: 6px; overflow: hidden; margin: 4px 0 10px; }
.bar > span { display: block; height: 100%; background: #ffd166; transition: width .25s; }
.equip-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Loja ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.shop-item {
  background: #1a1b35;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.shop-item .ico { font-size: 36px; }
.shop-item.owned { opacity: 0.6; }

/* ---------- Missões ---------- */
.mission { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mission .progress { font-size: 12px; color: #c8c8d8; }

/* ---------- Mapa ---------- */
.map-slot {
  display: flex; align-items: center; gap: 10px;
  background: #2a2b50; border-radius: 10px; padding: 8px 10px; margin-top: 8px;
}
.map-slot .mini { font-size: 28px; }

/* ---------- Perfil ---------- */
.profile-card { padding: 16px; }
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  border: 3px solid #ffd166;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.avatar-pick {
  border: 0; border-radius: 50%;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto;
  outline: 2px solid transparent;
}
.avatar-pick.active { outline-color: #ffd166; }

/* ---------- Botões auxiliares ---------- */
.btn {
  padding: 8px 12px; border: 0; border-radius: 10px;
  background: #5b3df5; color: white; font-weight: 600;
}
.btn.secondary { background: #2a2b50; }
.btn.danger { background: #d63454; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
