/* ============================================================
   /perfil — página de administración de perfil (KoruGames).
   Hereda el tema de styles.css (tokens, av-frame-*, md-*, fr-card,
   frames-grid, .btn, toasts). Acá solo va lo propio de la página:
   topbar de vuelta, hero de identidad, layout y skeletons.
   Mobile-first. El único backdrop-filter es la topbar (1 elemento).
   ============================================================ */

.perfil-body { padding-bottom: 40px; }

/* ── Topbar: volver + título + monedas ─────────────────────── */
.pf-top {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 10, 23, 0.82); backdrop-filter: blur(12px);
}
.pf-back {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
  transition: border-color .15s, background .15s, transform .12s;
}
.pf-back:hover { border-color: var(--accent); background: rgba(139, 92, 246, 0.12); }
.pf-back:active { transform: scale(0.96); }
.pf-top-title { justify-self: center; font-weight: 800; font-size: 15px; letter-spacing: .2px; white-space: nowrap; }
.pf-coins {
  justify-self: end;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 14px;
  border: 1px solid rgba(245, 200, 66, 0.35); background: rgba(245, 200, 66, 0.1); color: #f7d774;
}
.pf-coin { font-size: 14px; }

/* ── Contenedor ────────────────────────────────────────────── */
.pf-wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 18px 16px; }

/* ── Carga / sin sesión ────────────────────────────────────── */
.pf-gate { text-align: center; padding: 64px 16px; color: var(--muted); }
.pf-gate p { margin-top: 14px; font-size: 14px; }
.pf-gate .btn { margin-top: 18px; }
.pf-spin {
  width: 34px; height: 34px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: pfSpin .8s linear infinite;
}
@keyframes pfSpin { to { transform: rotate(360deg); } }

/* ── HERO: identidad (avatar + marco = el protagonista) ────── */
.pf-hero {
  position: relative; text-align: center;
  padding: 26px 16px 30px; margin-bottom: 16px;
  display: flex; flex-direction: column; align-items: center;
}
/* Aura ambiental detrás del avatar: el "brillo" de la identidad. */
.pf-aura {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 230px; height: 230px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.32), rgba(34, 211, 238, 0.12) 45%, transparent 70%);
  filter: blur(6px); animation: pfBreathe 5s ease-in-out infinite;
}
@keyframes pfBreathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

.pf-avatar { width: 116px; height: 116px; position: relative; z-index: 1; }
.pf-avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.pf-eyebrow {
  margin-top: 16px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-2); min-height: 16px;
}
.pf-name {
  margin-top: 3px; font-size: clamp(24px, 7vw, 32px); font-weight: 800; line-height: 1.1;
  background: linear-gradient(135deg, #fff 30%, #c9b8ff); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}
.pf-badges { justify-content: center; margin-top: 12px; }

/* ── Tarjetas de sección ───────────────────────────────────── */
.pf-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.pf-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pf-sec-head h2 { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.pf-sec-hint { font-size: 12px; color: var(--muted); text-align: right; }

/* Progreso: stats + acciones + mascota reusan .md-* de styles.css. */
#pfMaru .md-stats { margin-bottom: 12px; }
#pfMaru .md-actrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
#pfMaru .md-actbtn { flex: 1 1 auto; min-width: 140px; }
.pf-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 8px 4px; }

/* ── Tienda en página completa: grilla más generosa que en el modal ── */
.pf-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 0; }
.pf-grid .fr-card { padding: 14px 8px; }
.pf-grid .fr-card .av-fr { width: 70px; height: 70px; }
@media (min-width: 560px) { .pf-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 380px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Skeletons (carga sin saltos de layout) ────────────────── */
.pf-skel { border-radius: 12px; background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 70%); background-size: 200% 100%; animation: pfShimmer 1.3s linear infinite; }
.pf-skel-stats { height: 120px; }
.pf-skel-grid { height: 180px; }
@keyframes pfShimmer { to { background-position: -200% 0; } }

/* ── Entrada de la página (suave, una sola vez) ────────────── */
.pf-content.pf-in > * { animation: pfRise .5s cubic-bezier(.2, .7, .2, 1) both; }
.pf-content.pf-in > *:nth-child(2) { animation-delay: .06s; }
.pf-content.pf-in > *:nth-child(3) { animation-delay: .12s; }
@keyframes pfRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Piso de calidad: foco visible + menos movimiento ──────── */
.pf-back:focus-visible, .pf-coins:focus-visible, .pf-grid .btn:focus-visible, #pfMaru .btn:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .pf-aura, .pf-skel, .pf-content.pf-in > * { animation: none !important; }
  .pf-back, .fr-card { transition: none !important; }
}
