/* ==================================================================
   DS 5.1 — Perfil como "sala de estar"

   O perfil do usuário é redesenhado como um ambiente acolhedor:
   avatar no centro como peça principal, badges em "estantes",
   favoritos como "quadros na parede" e estatísticas como troféus.
   ================================================================== */

/* Container principal: a "sala" */
.profile-room {
  position: relative;
  overflow: hidden;
  padding: var(--sp-8, 32px) var(--gutter) var(--sp-6, 24px);
  min-height: 320px;
}

/* Parede de fundo com textura sutil */
.profile-room__wall {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    var(--bg);
}
:root[data-theme="dark"] .profile-room__wall,
:root[data-theme="neon"] .profile-room__wall {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--depth-1, var(--bg)) 0%, var(--bg) 100%);
}

/* Avatar central — peça de destaque */
.profile-room__avatar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3, 12px);
  margin-bottom: var(--sp-5, 20px);
}
.profile-room__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 20%, rgba(0,0,0,.25));
  transition: transform .3s var(--ease-spring);
}
.profile-room__photo:hover {
  transform: scale(1.06);
}
.profile-room__name {
  font-size: var(--fs-xl);
  font-weight: var(--display-weight, 750);
  text-align: center;
}
.profile-room__bio {
  font-size: var(--fs-sm);
  color: var(--text-soft);
  text-align: center;
  max-width: 420px;
}

/* Estante de badges (scroll horizontal) */
.profile-room__shelf {
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-5, 20px);
}
.profile-room__shelf-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: var(--sp-2, 8px);
}
.profile-room__badges {
  display: flex;
  gap: var(--sp-3, 12px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: var(--sp-2, 8px) 0;
}
.profile-room__badges::-webkit-scrollbar { display: none; }
.profile-room__badge {
  flex: none;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
  padding: var(--sp-2, 8px);
  border-radius: var(--r-panel);
  background: var(--glass-tint, var(--surface-2));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border, var(--border));
  transition: transform .2s var(--ease-spring);
}
.profile-room__badge:hover { transform: translateY(-3px) scale(1.04); }
.profile-room__badge img,
.profile-room__badge .icon {
  width: 36px;
  height: 36px;
}
.profile-room__badge span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Quadros na parede: favoritos como grid visual */
.profile-room__gallery {
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-5, 20px);
}
.profile-room__frames {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-2, 8px);
}
.profile-room__frame {
  aspect-ratio: 2/3;
  border-radius: var(--r-frame);
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .25s var(--ease-spring), box-shadow .25s ease;
}
.profile-room__frame:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 8px 24px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.1);
}
.profile-room__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Troféus: estatísticas como peças de destaque */
.profile-room__stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--sp-3, 12px);
}
.profile-room__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-3, 12px);
  border-radius: var(--r-panel);
  background: var(--glass-tint, var(--surface-2));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border, var(--border));
}
.profile-room__stat-value {
  font-size: var(--fs-2xl);
  font-weight: var(--display-weight, 750);
  color: var(--accent);
  line-height: 1;
}
.profile-room__stat-label {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .profile-room__photo,
  .profile-room__badge,
  .profile-room__frame { transition: none; }
  .profile-room__photo:hover { transform: none; }
  .profile-room__badge:hover { transform: none; }
  .profile-room__frame:hover { transform: none; }
}
