/* ─────────────────────────────────────────────────────────────────────────────
   avatar.css — Fabula-Zen
   Estilos do sistema de avatar: onboarding + seleção + perfil.
   Adicione no <head> do index.html após o styles.css principal.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Overlay base ──────────────────────────────────────────────────────────── */
#fz-onboarding,
#fz-perfil {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 12, 4, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

#fz-onboarding.visivel,
#fz-perfil.visivel {
  opacity: 1;
}

#fz-onboarding.saindo,
#fz-perfil.saindo {
  opacity: 0;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.fz-onboarding-modal {
  background: #FDFCF0;          /* --paleta-zen: fundo pérola do projeto */
  border-radius: 24px;
  padding: 36px 32px 32px;
  width: min(560px, 92vw);
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

#fz-onboarding.visivel .fz-onboarding-modal,
#fz-perfil.visivel .fz-onboarding-modal {
  transform: translateY(0) scale(1);
}

/* ── Topo do onboarding ────────────────────────────────────────────────────── */
.fz-onboarding-topo {
  text-align: center;
  margin-bottom: 28px;
}

.fz-onboarding-estrelas {
  font-size: 18px;
  color: #D4AF37;
  letter-spacing: 8px;
  margin-bottom: 12px;
}

.fz-onboarding-titulo {
  font-family: 'Playfair Display', serif;  /* tipografia do projeto */
  font-size: 26px;
  font-weight: 700;
  color: #1A1208;
  margin: 0 0 8px;
  line-height: 1.2;
}

.fz-onboarding-sub {
  font-size: 15px;
  color: #6B5A3E;
  margin: 0;
}

/* ── Passos ────────────────────────────────────────────────────────────────── */
.fz-onboarding-passo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fz-oculto {
  display: none !important;
}

/* ── Label ─────────────────────────────────────────────────────────────────── */
.fz-label {
  font-size: 14px;
  font-weight: 600;
  color: #4A3820;
  margin: 0;
  letter-spacing: 0.3px;
}

/* ── Input de nome ─────────────────────────────────────────────────────────── */
.fz-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #E8D5A3;
  border-radius: 14px;
  font-size: 18px;
  font-family: 'Inter', sans-serif;
  color: #1A1208;
  background: white;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fz-input:focus {
  border-color: #D4AF37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.fz-input::placeholder {
  color: #B8A080;
}

/* ── Botões ────────────────────────────────────────────────────────────────── */
.fz-btn-proximo,
.fz-btn-confirmar {
  padding: 14px 28px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-family: 'Inter', sans-serif;
  align-self: center;
}

.fz-btn-proximo {
  background: #D4AF37;
  color: #1A1208;
  min-width: 160px;
}

.fz-btn-proximo:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fz-btn-proximo:not(:disabled):hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.fz-btn-confirmar {
  background: #2E7D50;
  color: white;
  width: 100%;
  margin-top: 8px;
}

.fz-btn-confirmar:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.fz-btn-fechar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F0E8D0;
  color: #6B5A3E;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.fz-btn-fechar:hover {
  background: #E8D5A3;
}

/* ── Grid de avatares ──────────────────────────────────────────────────────── */
.fz-avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px 0;
}

@media (max-width: 380px) {
  .fz-avatar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ── Card de avatar ────────────────────────────────────────────────────────── */
.fz-avatar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: 16px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.fz-avatar-card:hover {
  transform: translateY(-4px);
}

.fz-avatar-card.selecionado {
  border-color: #D4AF37;
  background: rgba(212, 175, 55, 0.05);
}

.fz-avatar-svg {
  width: 72px;
  height: 84px;
}

.fz-avatar-svg svg {
  width: 100%;
  height: 100%;
}

.fz-avatar-nome {
  font-size: 11px;
  font-weight: 600;
  color: #6B5A3E;
  text-align: center;
  line-height: 1.2;
}

/* ── Lock overlay (bloqueado) ──────────────────────────────────────────────── */
.fz-avatar-card.fz-avatar-locked {
  cursor: default;
}

.fz-avatar-card.fz-avatar-locked:hover {
  transform: none;
}

.fz-avatar-locked-overlay {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  z-index: 5;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}

/* ── Topo do perfil ────────────────────────────────────────────────────────── */
.fz-perfil-topo {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid #E8D5A3;
}

.fz-perfil-avatar-grande {
  width: 96px;
  height: 112px;
  flex-shrink: 0;
}

.fz-perfil-avatar-grande svg {
  width: 100%;
  height: 100%;
}

.fz-perfil-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fz-perfil-nome {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: #1A1208;
  margin: 0;
}

.fz-perfil-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #D4AF37;
  color: #1A1208;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.fz-perfil-secao {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Mini-avatar no menu ───────────────────────────────────────────────────── */
#fz-menu-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #D4AF37;
  background: linear-gradient(135deg, #fff, #FFF5D0);
  cursor: pointer;
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(212, 175, 55, 0.4);
  animation: avatarFloat 4s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes avatarFloat {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(0deg); }
  75% { transform: translateY(-5px) rotate(3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

#fz-menu-avatar:hover {
  animation: none;
  transform: scale(1.15) rotate(5deg) translateY(-5px);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.6);
  border-color: #FFD700;
}

#fz-menu-avatar .fz-avatar-wrap {
  width: 100% !important;
  height: 100% !important;
}

#fz-menu-avatar svg {
  width: 100%;
  height: 100%;
}
