/* Perfil público de jugador (#/perfil/<usuario>)
   (archivo: css/components/profile.css) */
#prof-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(4,4,6,.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#prof-overlay.open { opacity: 1; pointer-events: all; }

#prof-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(96vw, 1040px);
  height: min(90vh, 900px);
  overflow: hidden;
  background: #12161f;
  border: 5px solid #000;
  border-radius: 22px;
  box-shadow: 8px 9px 0 #000, 0 26px 70px rgba(0,0,0,.85);
  transform: translateY(16px) scale(.97);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
#prof-overlay.open #prof-modal { transform: none; }
#prof-modal::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 9px;
  z-index: 2;
  background: repeating-linear-gradient(45deg, var(--yellow-stripe1, #F0B800) 0 12px, #111 12px 24px);
}
#prof-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 16px 12px;
  border-bottom: 4px solid #000;
  background: linear-gradient(180deg, #1e2430 0%, #131821 100%);
  flex-shrink: 0;
}
#prof-title {
  flex: 1;
  margin: 0;
  font-family: 'Fredoka One', cursive;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: var(--yellow-bright, #FFD700);
  text-shadow: 2px 2px 0 #000;
}
#prof-close {
  width: 38px; height: 38px;
  font-family: 'Fredoka One', cursive;
  color: #fff;
  background: linear-gradient(180deg, #3a3a42, #202026);
  border: 4px solid #000;
  border-radius: 12px;
  box-shadow: 0 4px 0 #000;
  cursor: pointer;
}
#prof-close:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
#prof-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: #3a4152 transparent;
}
#prof-modal :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Botones */
.prof-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-family: 'Fredoka One', cursive;
  font-size: .86rem;
  color: #1a1400;
  text-decoration: none;
  background: linear-gradient(180deg, var(--yellow-bright, #FFD700), var(--yellow-dark, #C89A00));
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 0 4px 0 #000;
  cursor: pointer;
}
.prof-btn.ghost { color: #fff; background: linear-gradient(180deg, #3a3a42, #202026); }
.prof-btn:hover { filter: brightness(1.08); }
.prof-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.prof-btn:disabled { opacity: .6; cursor: default; }

/* Mensajes (cargando, privado…) */
.prof-msg { margin: auto; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: #c9ced8; }
.prof-msg-icon { font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 0 #000); }
.prof-msg p { margin: 0; font-size: .95rem; line-height: 1.5; }
.prof-msg b { color: #fff; }

/* Tarjeta del jugador */
#prof-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: #0b0e14;
  border: 4px solid #000;
  border-radius: 18px;
  box-shadow: 0 5px 0 #000;
}
#prof-avatar {
  width: 86px; height: 86px;
  object-fit: cover;
  background: #2e2e2e;
  border: 4px solid #000;
  border-radius: 18px;
  transform: rotate(-3deg);
}
#prof-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.45rem;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  overflow-wrap: anywhere;
}
#prof-user { font-size: .92rem; color: var(--yellow-bright, #FFD700); }
#prof-updated { margin-top: 4px; font-size: .76rem; color: #8b93a3; }
#prof-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Fichas */
#prof-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.prof-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  background: #0b0e14;
  border: 3px solid #000;
  border-radius: 14px;
}
.prof-label { font-size: .76rem; color: #8b93a3; }
.prof-value { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1.5rem; line-height: 1.15; color: #f2f2f2; }
.prof-value small { font-size: .9rem; font-weight: 400; color: #8b93a3; }
.prof-meter { display: block; height: 10px; margin-top: 5px; background: #262c38; border: 2px solid #000; border-radius: 999px; overflow: hidden; }
.prof-meter i { display: block; height: 100%; background: var(--yellow-bright, #FFD700); }
.prof-cmp-line { font-size: .74rem; color: #b7bdca; }
.prof-tile-cmp { border-color: #000; background: linear-gradient(180deg, #1b1630, #0b0e14); }

/* Filtros */
#prof-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.prof-filter {
  padding: 6px 12px;
  font-family: 'Fredoka One', cursive;
  font-size: .8rem;
  color: #d7dbe3;
  background: #1b2029;
  border: 3px solid #000;
  border-radius: 999px;
  cursor: pointer;
}
.prof-filter span { margin-left: 4px; font-family: 'Fredoka', sans-serif; color: #8b93a3; }
.prof-filter.active { color: #1a1400; background: var(--yellow-bright, #FFD700); }
.prof-filter.active span { color: #4a3b00; }

/* Rejilla de maestrías */
#prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.prof-m {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #d7dbe3;
  text-decoration: none;
}
.prof-m-img {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1b2029;
  border: 4px solid #000;
  border-radius: 12px;
  box-shadow: 0 4px 0 #000;
  transition: transform .15s, box-shadow .15s;
}
.prof-m-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.85) brightness(.65); }
.prof-m.done .prof-m-img img { filter: none; }
.prof-m.done .prof-m-img { border-color: #39d353; }
.prof-m:hover .prof-m-img { transform: translateY(-2px); box-shadow: 0 6px 0 #000; }
.prof-m-tick {
  position: absolute; top: 5px; right: 5px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
  color: #04210a;
  background: #39d353;
  border: 2px solid #000;
  border-radius: 50%;
}
.prof-m-you {
  position: absolute; left: 5px; bottom: 5px;
  padding: 1px 7px;
  font-family: 'Fredoka One', cursive;
  font-size: .62rem;
  color: #1a1400;
  background: var(--yellow-bright, #FFD700);
  border: 2px solid #000;
  border-radius: 999px;
}
.prof-m-name { font-family: 'Fredoka One', cursive; font-size: .86rem; color: #fff; }
.prof-m-state { font-size: .72rem; color: #8b93a3; }
.prof-m.done .prof-m-state { color: #7ee08f; }
.prof-m-bar { display: block; height: 6px; background: #262c38; border-radius: 999px; overflow: hidden; }
.prof-m-bar i { display: block; height: 100%; background: #C08600; }
.prof-empty { color: #8b93a3; font-size: .9rem; }

/* Guantes */
#prof-gloves { background: #0b0e14; border: 3px solid #000; border-radius: 14px; padding: 10px 14px; }
#prof-gloves summary { cursor: pointer; font-family: 'Fredoka One', cursive; font-size: .95rem; color: #fff; }
#prof-glove-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prof-chip {
  padding: 3px 9px;
  font-size: .78rem;
  color: #f2f2f2;
  text-decoration: none;
  background: #1b2029;
  border: 2px solid #000;
  border-radius: 999px;
}
a.prof-chip:hover { border-color: var(--yellow-bright, #FFD700); }

@media (max-width: 760px) {
  #prof-overlay { padding: 0; }
  #prof-modal { width: 100vw; height: 100dvh; border-radius: 0; border-width: 0; box-shadow: none; }
  #prof-body { padding: 14px 12px 28px; }
  #prof-card { grid-template-columns: auto minmax(0, 1fr); }
  #prof-actions { grid-column: 1 / -1; justify-content: flex-start; }
  #prof-avatar { width: 68px; height: 68px; }
  #prof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  #prof-modal, .prof-m-img { transition: none; transform: none; }
}
