/* =========================================================
   BRsys Arcade - Avatar / Profile Screen
   Path: /arcade/css/screens/avatar.css
   ========================================================= */

.profile-screen {
  display: grid;
  gap: 14px;
  width: 100%;
  padding-bottom: 150px;
}

/* HERO */
.profile-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(57,255,136,.2);
  border-radius: 28px;
  padding: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(57,255,136,.18), transparent 35%),
    radial-gradient(circle at 88% 18%, rgba(155,92,255,.22), transparent 40%),
    linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
    var(--panel);
  box-shadow: var(--shadow);
}

.profile-avatar-stage {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 8px;
  min-width: 0;
  min-height: 210px;
  overflow: hidden;
}

.profile-avatar-img {
  width: min(230px, 68vw);
  height: 220px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 22px 28px rgba(0,0,0,.48));
}

.profile-avatar-stage span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid rgba(57,255,136,.42);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--green);
  background: rgba(57,255,136,.1);
  font-size: .66rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.profile-main {
  min-width: 0;
}

.profile-main h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 6vw, 3.45rem);
  line-height: .9;
  letter-spacing: -.075em;
}

.profile-main p {
  margin-bottom: 10px;
  color: var(--soft);
  font-size: .88rem;
}

.profile-main .xp-bar {
  max-width: 340px;
}

.profile-power-card {
  display: grid;
  gap: 2px;
  align-self: stretch;
  min-height: 92px;
  border: 1px solid rgba(57,255,136,.24);
  border-radius: 22px;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(57,255,136,.10), transparent 42%),
    rgba(255,255,255,.045);
}

.profile-power-card span,
.profile-power-card small {
  display: block;
  color: var(--muted);
  font-size: .7rem;
}

.profile-power-card strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--yellow);
  font-size: 1.85rem;
  line-height: 1;
}

/* SECTIONS */
.profile-section {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.profile-section .game-section-head {
  align-items: end;
}

.profile-account-card {
  border: 1px solid rgba(57,255,136,.18);
  border-radius: 24px;
  padding: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(57,255,136,.10), transparent 38%),
    rgba(255,255,255,.04);
}

/* FORM */
.profile-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: .74rem;
  font-weight: 900;
}

.profile-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(57,255,136,.32);
  border-radius: 15px;
  padding: 0 13px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(5,10,20,.78);
  outline: none;
  font-weight: 900;
}

.profile-form input:focus {
  border-color: rgba(57,255,136,.82);
  box-shadow: 0 0 0 3px rgba(57,255,136,.12);
}

.profile-form .btn-primary,
.profile-form button {
  min-height: 44px;
}

/* STATS */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-stats-grid .stat-card {
  min-height: 72px;
}

/* AVATAR SELECTOR */
.profile-avatar-row,
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-avatar-card,
.avatar-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  align-content: start;
  min-height: 148px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 8px;
  color: var(--text);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(57,255,136,.10), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)),
    rgba(255,255,255,.04);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.profile-avatar-card:hover,
.avatar-card:hover {
  transform: translateY(-2px);
  border-color: rgba(57,255,136,.45);
}

.profile-avatar-card-img,
.avatar-art {
  width: 84px !important;
  height: 84px !important;
  object-fit: contain !important;
  object-position: center bottom;
  margin: 0 auto;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.28));
}

.avatar-frame {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 2px solid rgba(57,255,136,.38);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(57,255,136,.1);
}

.profile-avatar-card strong,
.avatar-card strong {
  max-width: 100%;
  font-size: .72rem;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-avatar-card small,
.avatar-card small,
.avatar-card em {
  max-width: 100%;
  color: var(--muted);
  font-size: .58rem;
  font-style: normal;
  line-height: 1.15;
}

.profile-avatar-card.is-selected,
.avatar-card.is-selected {
  border-color: rgba(57,255,136,.76);
  background:
    radial-gradient(circle at 50% 0%, rgba(57,255,136,.22), transparent 42%),
    rgba(57,255,136,.08);
  box-shadow: var(--glow);
}

/* TABLET */
@media (min-width: 720px) {
  .profile-form {
    grid-template-columns: 1fr 160px auto;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-avatar-row,
  .avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* DESKTOP */
@media (min-width: 980px) {
  .profile-screen {
    gap: 16px;
  }

  .profile-hero {
    grid-template-columns: 320px minmax(0, 1fr) 190px;
    gap: 22px;
    min-height: 330px;
    padding: 22px;
  }

  .profile-avatar-stage {
    min-height: 286px;
  }

  .profile-avatar-img {
    width: 290px;
    height: 270px;
  }

  .profile-main {
    align-self: center;
  }

  .profile-power-card {
    align-self: center;
  }

  .profile-avatar-row,
  .avatar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .profile-avatar-card,
  .avatar-card {
    min-height: 148px;
  }
}

/* MOBILE */
@media (max-width: 679px) {
  .profile-screen {
    gap: 12px;
    padding-bottom: 140px;
  }

  .profile-hero {
    padding: 14px;
  }

  .profile-avatar-stage {
    min-height: 190px;
  }

  .profile-avatar-img {
    width: min(190px, 62vw);
    height: 180px;
  }

  .profile-main h1 {
    font-size: 2rem;
  }

  .profile-main p {
    font-size: .78rem;
  }

  .profile-power-card {
    min-height: 78px;
  }

  .profile-power-card strong {
    font-size: 1.45rem;
  }

  .profile-avatar-row,
  .avatar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-avatar-card,
  .avatar-card {
    min-height: 132px;
  }

  .profile-avatar-card-img,
  .avatar-art,
  .avatar-frame {
    width: 70px !important;
    height: 70px !important;
  }
}

/* FIX — Poder Total visível no perfil */
.profile-power-card {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-height: 96px !important;
  overflow: visible !important;
}

.profile-power-card span {
  font-size: .72rem !important;
  margin-bottom: 4px;
}

.profile-power-card strong {
  display: block !important;
  color: var(--yellow) !important;
  font-size: 2rem !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.profile-power-card small {
  display: block !important;
  margin-top: 3px;
  font-size: .72rem !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Desktop: deixa o card do poder menor e inteiro */
@media (min-width: 980px) {
  .profile-power-card {
    align-self: center !important;
    min-height: 118px !important;
    max-height: none !important;
  }
}

/* =========================================================
   Hotel Zumbi — Avatar Fase 2
   Estrelas + fragmentos + raridades
   ========================================================= */

.profile-avatar-frame {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 28px;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(56,255,143,.18), transparent 58%),
    rgba(255,255,255,.045);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 18px 44px rgba(0,0,0,.38);
}

.profile-class-badge {
  margin-top: 8px;
}

.avatar-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 8px;
  color: rgba(255,255,255,.24);
  font-size: .9rem;
  line-height: 1;
}

.avatar-stars span.is-filled {
  color: #ffd24a;
  text-shadow: 0 0 12px rgba(255,210,74,.75);
}

.profile-avatar-card {
  position: relative;
  overflow: hidden;
}

.profile-avatar-card.rarity-rare {
  border-color: rgba(40,216,255,.38);
}

.profile-avatar-card.rarity-epic {
  border-color: rgba(180,78,255,.42);
}

.profile-avatar-card.rarity-legendary {
  border-color: rgba(255,210,74,.48);
}

.profile-avatar-card.rarity-mythic {
  border-color: rgba(255,75,95,.52);
  box-shadow: 0 0 28px rgba(255,75,95,.16);
}

.profile-avatar-card.is-locked {
  opacity: .78;
}

.profile-avatar-card.is-locked .profile-avatar-card-img {
  filter: grayscale(1) brightness(.55);
}

.profile-avatar-pick {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.profile-avatar-pick:disabled {
  cursor: not-allowed;
}

.avatar-fragment-box {
  margin-top: 10px;
  border-radius: 16px;
  padding: 9px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.08);
}

.avatar-fragment-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: .66rem;
}

.avatar-fragment-head span {
  color: rgba(225,238,255,.6);
}

.avatar-fragment-head strong {
  color: #fff;
}

.avatar-fragment-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
}

.avatar-fragment-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38ff8f, #28d8ff, #b44eff);
  box-shadow: 0 0 14px rgba(40,216,255,.34);
}

.avatar-action-btn {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border-radius: 999px;
  font-size: .72rem;
}

.avatar-action-btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}

/* Raridade no hero */

.profile-hero.rarity-rare {
  box-shadow: inset 0 0 0 1px rgba(40,216,255,.22);
}

.profile-hero.rarity-epic {
  box-shadow: inset 0 0 0 1px rgba(180,78,255,.26);
}

.profile-hero.rarity-legendary {
  box-shadow:
    inset 0 0 0 1px rgba(255,210,74,.28),
    0 0 38px rgba(255,210,74,.1);
}

.profile-hero.rarity-mythic {
  box-shadow:
    inset 0 0 0 1px rgba(255,75,95,.32),
    0 0 44px rgba(255,75,95,.14);
}

/* Mobile */

@media (max-width: 760px) {
  .avatar-fragment-head {
    flex-direction: column;
    gap: 3px;
    text-align: center;
  }

  .avatar-action-btn {
    font-size: .66rem;
  }
}
