/* Perfil e guarda-roupa do mascote.
   (A ordem dos arquivos no index.html importa: veja o comentário lá.) */

/* ===================================================================
   PERFIL
   =================================================================== */
/* Topo: faixa em degradê com o mascote grande (tocar abre o guarda-roupa) */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 24px 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: #ffffff;
}
.profile-hero-avatar {
  position: relative;
  width: 150px;
  height: 150px;
  flex: none;
  padding: 0;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 6px 0 var(--hero-shadow);
  cursor: pointer;
}
/* o boneco fica numa camada que corta no círculo (o pincel, por cima, não é cortado) */
.profile-hero-art { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; }
.profile-hero-avatar .mascot-svg { width: 100%; height: 100%; margin-top: 6%; }
.profile-hero-avatar:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--hero-shadow); }
/* pincel no canto: mostra que dá para mudar o visual */
.profile-hero-edit {
  position: absolute;
  right: -2px;
  bottom: 6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--yellow);
  color: #6b4f00;
  font-size: 18px;
}
.profile-hero-copy { flex: 1; min-width: 0; }
.profile-hero-copy > small { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; opacity: 0.85; }
.profile-hero-copy h2 { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; font-family: "Manrope", sans-serif; font-size: 32px; font-weight: 800; overflow-wrap: anywhere; }
.profile-hero-copy > p { margin: 0 0 14px; font-size: 14px; opacity: 0.95; }
.profile-name-edit {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
}
.profile-name-edit:hover { background: rgba(255, 255, 255, 0.32); }
.profile-hero .field-label { color: #ffffff; }
.profile-hero .field-label input { border-color: transparent; }
.profile-hero .name-form-actions .text-button { color: #ffffff; font-size: 13px; }
.profile-hero .name-form { margin: 6px 0 4px; max-width: 360px; }

.profile-group { margin-top: 26px; }

/* Estatísticas: quadradinhos 3D com ícone colorido */
.profile-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.profile-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.profile-tile.is-button { cursor: pointer; }
.profile-tile.is-button:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.profile-tile > span:last-child { min-width: 0; display: grid; }
.profile-tile strong { font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 800; line-height: 1.2; }
.profile-tile small { color: var(--muted); font-size: 12px; }
.profile-tile-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; font-size: 20px; }

/* Conquistas: as próximas em cartões compactos (medalha, nome + prêmio,
   barra) e as já conquistadas como medalhas douradas numa fileira só.
   Assim a coluna não cresce conforme o aluno ganha conquistas. */
.badge-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.badge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
}
.badge-medal {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  box-shadow: 0 3px 0 var(--line);
  color: var(--muted);
  font-size: 22px;
}
.badge-card.is-done { border-color: var(--yellow); box-shadow: 0 4px 0 #c99a1c; }
.badge-card.is-done .badge-medal,
.badge-earned-medal { border: 3px solid #ffffff; background: linear-gradient(160deg, #ffd969 0%, #f3a521 100%); box-shadow: 0 3px 0 #c99a1c; color: #ffffff; }
.badge-info { flex: 1; min-width: 0; }
.badge-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.badge-info h3 { margin: 0; font-family: "Manrope", sans-serif; font-size: 16px; font-weight: 800; }
.badge-info p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.badge-info .mission-progress { margin-top: 6px; }
.badge-info .mission-progress strong { min-width: 0; font-size: 13px; }
.badge-info .mission-bar { height: 10px; }
.badge-prize { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-strong); font-size: 12px; font-weight: 700; }
.badge-done { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--accent); font-size: 13px; font-weight: 800; }
.badge-heading { flex-wrap: wrap; }
.badge-heading h2 { margin-right: auto; }
.badge-earned { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-earned-medal { width: 32px; height: 32px; display: grid; place-items: center; border-width: 2px; border-radius: 50%; font-size: 14px; }
/* Conquistas escondidas: uma linha tracejada, sem cara de cartão (ainda não é "de verdade") */
.badge-secret { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 14px; border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.badge-secret .bi { font-size: 18px; }

/* ----- Guarda-roupa (editor do mascote) ----- */
.wardrobe-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.wardrobe-heading small { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
.wardrobe-heading h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: 28px; font-weight: 800; }
.wardrobe-back {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 3px 0 var(--line);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}
.wardrobe-back:active { transform: translateY(3px); box-shadow: 0 0 0 transparent; }

.mascot-editor { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); align-items: start; gap: 22px; }

/* Palco: o mascote grande num cartão em degradê, sempre à vista */
.wardrobe-stage {
  position: sticky;
  top: 20px;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: #ffffff;
  text-align: center;
}
.wardrobe-stage-art { width: min(230px, 100%); aspect-ratio: 1; display: block; overflow: hidden; padding: 0; cursor: pointer; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 6px 0 var(--hero-shadow); }
.wardrobe-stage-art .mascot-svg { width: 100%; height: 100%; margin-top: 6%; }
.wardrobe-stage-info { width: 100%; display: grid; justify-items: center; gap: 8px; }
.wardrobe-stage-info > strong { font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 800; }
.wardrobe-progress { width: 100%; display: grid; gap: 4px; }
.wardrobe-progress .progress-track { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); }
.wardrobe-progress .progress-track span { border-radius: inherit; background: var(--yellow); }
.wardrobe-progress small { font-size: 12px; font-weight: 700; opacity: 0.95; }
.wardrobe-coins { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); font-size: 13px; font-weight: 800; }
.wardrobe-coins .bi { color: var(--yellow); }
.wardrobe-stage .text-button { color: #ffffff; font-size: 13px; }

.mascot-wardrobe { display: grid; gap: 14px; }
.mascot-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }

/* Cada item: cartão 3D com o mascote já vestindo o item */
.mascot-option {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: center;
}
.mascot-option:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.mascot-option.is-equipped { border-color: var(--hero-from); box-shadow: 0 4px 0 var(--hero-shadow); }
.mascot-option strong { font-size: 13px; line-height: 1.25; }
.mascot-option.is-locked .mascot-option-art { opacity: 0.5; filter: saturate(0.6); }
.mascot-option-art { width: 92px; height: 92px; display: block; overflow: hidden; margin-bottom: 4px; border-radius: 50%; }
.mascot-option-art .mascot-svg { width: 100%; height: 100%; margin-top: 8%; }
.mascot-option-art.is-head .mascot-svg { margin-top: 0; }
/* etiqueta: Usar, Em uso, preço, conquista ou fora da loja */
.mascot-option-status { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 2px 10px; border-radius: 10px; line-height: 1.35; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 800; }
.mascot-option-status.is-equipped { background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%); color: #ffffff; }
.mascot-option-status.is-price { background: var(--yellow-soft); color: #8a6a0c; }
.mascot-option-status.is-price .bi { color: #d9a20f; }
.mascot-option-check { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--hero-from); color: #ffffff; font-size: 14px; }
.wardrobe-hint { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-soft); color: var(--muted); font-size: 13px; line-height: 1.5; }
.wardrobe-hint .bi { color: var(--coral); }
.wardrobe-hint .text-button { padding: 0; font-size: 13px; text-decoration: underline; }

@media (max-width: 1100px) {
  .profile-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  /* Perfil: mascote em cima, centralizado */
  .profile-hero { flex-direction: column; gap: 14px; padding: 20px 18px; border-radius: 20px; text-align: center; }
  .profile-hero-avatar { width: 128px; height: 128px; }
  .profile-hero-copy h2 { justify-content: center; font-size: 26px; }
  .profile-hero-copy .button-3d { width: 100%; }
  .profile-hero .name-form { margin-inline: auto; text-align: left; }
  .profile-tiles { gap: 10px; }
  .profile-tile { gap: 10px; padding: 12px 10px; }
  .profile-tile-icon { width: 36px; height: 36px; font-size: 17px; border-radius: 12px; }
  .profile-tile strong { font-size: 17px; }
  .profile-tile small { font-size: 11px; }
  .badge-grid { grid-template-columns: minmax(0, 1fr); }

  /* Guarda-roupa: o palco fica preso no topo, em linha, enquanto rola as opções */
  .wardrobe-heading { margin-bottom: 14px; }
  .wardrobe-heading h2 { font-size: 24px; }
  .mascot-editor { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .wardrobe-stage {
    top: calc(64px + env(safe-area-inset-top));
    z-index: 5;
    grid-template-columns: 96px minmax(0, 1fr);
    justify-items: start;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 20px;
    text-align: left;
  }
  .wardrobe-stage-art { width: 96px; border-width: 3px; box-shadow: 0 4px 0 var(--hero-shadow); }
  .wardrobe-stage-info { justify-items: start; gap: 6px; }
  .wardrobe-stage-info > strong { font-size: 17px; }
  .wardrobe-coins { padding: 3px 10px; font-size: 12px; }
  .mascot-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mascot-option { padding: 8px 4px 10px; border-radius: 16px; }
  .mascot-option-art { width: min(84px, 100%); height: auto; aspect-ratio: 1; }
  .mascot-option-check { top: 4px; right: 4px; width: 22px; height: 22px; font-size: 12px; }
  .mascot-option-status { padding: 2px 6px; font-size: 10px; }
}

@media (max-width: 360px) {
  .mascot-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 400px) {
  .streak-hero { gap: 14px; padding: 18px 48px 18px 16px; }
  .streak-flame { width: 58px; height: 58px; font-size: 28px; }
  .streak-hero h2 strong { font-size: 28px; }
  .streak-content { padding: 14px; }
  .calendar-card { padding: 10px; }
}

/* Visitante: convite para criar a conta e guardar o progresso */
.guest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px 18px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  background: var(--accent-soft);
  box-shadow: 0 4px 0 var(--accent);
}
.guest-card > div { flex: 1; min-width: 0; }
.guest-card h2 { margin: 0 0 4px; font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 800; }
.guest-card p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; }
.guest-card .button-3d { flex: none; }
.guest-card-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent); color: #fff; font-size: 22px; }

@media (max-width: 700px) {
  .guest-card { flex-wrap: wrap; }
  .guest-card .button-3d { width: 100%; }
}
