/* Responsive personal profile layout */
.profile-page .auth-main{
  width:min(1180px,calc(100% - clamp(16px,4vw,40px)));
  grid-template-columns:minmax(0,1fr);
  gap:clamp(14px,2vw,22px);
  place-items:stretch;
  align-items:start;
}

.profile-page .profile-stats-panel,
.profile-page .profile-cosmetics-panel,
.profile-page .profile-collections-entry,
.profile-page .guest-profile-shell,
.profile-page .member-profile-shell{
  width:100%;
  max-width:none;
  margin:0;
  grid-column:1/-1;
}

/* Guest and signed-in profiles intentionally share the same visual shell. */
.guest-profile-shell,
.member-profile-shell{
  border:1px solid rgba(119,188,255,.14);
  border-radius:clamp(18px,2vw,24px);
  background:rgba(8,19,31,.78);
  overflow:hidden;
}

.guest-profile-hero.cosmetic-profile-preview,
.member-profile-hero.cosmetic-profile-preview{
  min-height:0;
  display:block;
  position:relative;
  padding:0 0 clamp(24px,3vw,36px);
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
}

.guest-profile-hero .guest-profile-banner,
.member-profile-hero .member-profile-banner{
  position:relative;
  inset:auto;
  width:100%;
  height:clamp(150px,18vw,250px);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.guest-profile-identity,
.member-profile-identity{
  --profile-avatar-size:clamp(98px,10vw,150px);
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  width:100%;
  margin-top:calc(var(--profile-avatar-size) * -.5);
  padding:0 clamp(16px,4vw,48px);
  text-align:center;
}

.guest-profile-hero .cosmetic-profile-avatar,
.member-profile-hero .cosmetic-profile-avatar{
  width:var(--profile-avatar-size);
  height:var(--profile-avatar-size);
  margin:0;
  box-sizing:border-box;
  border-width:clamp(4px,.45vw,6px);
  font-size:clamp(30px,3vw,44px);
  background:#0b1d2d;
}

.guest-profile-name,
.member-profile-name{
  margin:clamp(12px,1.6vw,18px) 0 0;
  color:#f4f9fd;
  font-size:clamp(28px,4vw,46px);
  line-height:1;
  letter-spacing:-.035em;
}

.profile-settings-trigger{
  position:absolute;
  z-index:4;
  top:clamp(12px,1.7vw,20px);
  right:clamp(12px,1.7vw,20px);
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:8px 13px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:999px;
  background:rgba(6,15,25,.78);
  color:#f4f9fd;
  font:inherit;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  backdrop-filter:blur(10px);
  box-shadow:0 8px 30px rgba(0,0,0,.2);
}

.profile-settings-trigger:hover{
  border-color:rgba(119,188,255,.5);
  background:rgba(9,25,40,.92);
}

.profile-settings-trigger:focus-visible,
.profile-settings-close:focus-visible{
  outline:2px solid var(--blue2);
  outline-offset:2px;
}

.guest-profile-registration{
  width:min(780px,calc(100% - clamp(28px,6vw,72px)));
  margin:0 auto clamp(24px,3vw,36px);
  padding:clamp(16px,2vw,22px);
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:clamp(16px,3vw,30px);
  border:1px solid rgba(119,188,255,.14);
  border-radius:16px;
  background:linear-gradient(135deg,rgba(31,140,255,.09),rgba(54,209,255,.035)),rgba(10,22,34,.78);
}

.guest-profile-registration p{
  margin:0;
  color:var(--muted);
  font-size:clamp(11px,1.2vw,13px);
  line-height:1.65;
}

.guest-profile-registration-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
}

.guest-profile-registration-actions .primary-cta,
.guest-profile-registration-actions .secondary-cta{
  min-width:132px;
  text-align:center;
  white-space:nowrap;
}

/* The profile sections intentionally stack on wide screens as well. */
.profile-page .profile-stats-panel{
  padding:clamp(18px,2.5vw,28px);
}

.profile-page .profile-collections-entry{
  padding:clamp(20px,2.5vw,30px);
}

.profile-page .profile-cosmetics-panel{
  padding:clamp(18px,2.5vw,28px);
}

.profile-cosmetics-management{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px 24px;
  align-items:start;
  margin-top:18px;
}

.profile-cosmetics-management .profile-cosmetic-meta{
  margin:0;
}

.profile-cosmetic-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.profile-inventory-block{
  grid-column:1/-1;
  padding-top:4px;
}

/* Account settings live in a focused sheet instead of occupying the profile itself. */
.profile-settings-dialog{
  width:min(720px,calc(100% - 28px));
  max-height:min(88vh,900px);
  padding:0;
  border:1px solid rgba(119,188,255,.22);
  border-radius:24px;
  background:#091623;
  color:#f4f9fd;
  overflow:hidden;
  box-shadow:0 28px 90px rgba(0,0,0,.55);
}

.profile-settings-dialog::backdrop{
  background:rgba(2,8,14,.7);
  backdrop-filter:blur(5px);
}

.profile-settings-sheet{
  max-height:min(88vh,900px);
  overflow:auto;
  padding:clamp(20px,3vw,32px);
}

.profile-settings-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:24px;
  padding-bottom:20px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.profile-settings-head h2{
  margin:5px 0 7px;
  font-size:clamp(25px,4vw,36px);
}

.profile-settings-head p,
.profile-settings-action-row p,
.profile-settings-hint{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}

.profile-settings-close{
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.12);
  border-radius:50%;
  background:rgba(255,255,255,.045);
  color:#f4f9fd;
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.profile-settings-section{
  padding:22px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.profile-settings-section:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.profile-settings-section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
}

.profile-settings-section-head span{
  color:var(--blue2);
  font-size:9px;
  font-weight:950;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.profile-settings-section-head h3{
  margin:4px 0 0;
  font-size:18px;
}

.profile-settings-section-head small,
.profile-email-change-availability{
  color:var(--muted);
  font-size:10px;
}

.profile-settings-form,
.profile-email-change-form{
  display:grid;
  gap:14px;
}

.profile-settings-grid,
.profile-email-change-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.profile-settings-form .auth-submit,
.profile-email-change-form .primary-cta{
  justify-self:start;
}

.profile-email-change-form{
  margin-top:4px;
}

.profile-email-change-form .auth-status{
  margin:0;
}

.profile-email-change-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.profile-email-change-actions a{
  color:var(--blue2);
  font-size:11px;
  font-weight:850;
}

.profile-settings-action-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 0;
}

.profile-settings-action-row + .profile-settings-action-row{
  border-top:1px solid rgba(255,255,255,.06);
}

.profile-settings-action-row strong{
  display:block;
  margin-bottom:3px;
  font-size:13px;
}

.profile-settings-link-row{
  display:flex;
  gap:10px 18px;
  flex-wrap:wrap;
}

.profile-settings-link-row a{
  color:var(--blue2);
  font-size:12px;
  font-weight:850;
  text-decoration:none;
}

@media(max-width:760px){
  /* Keep the profile header compact: the full navigation is redundant on a focused account screen. */
  .profile-page .site-header{
    padding-left:12px;
    padding-right:12px;
    gap:8px;
  }

  .profile-page .site-nav{
    display:none;
  }

  .profile-page .site-header-actions{
    margin-left:auto;
    gap:6px;
  }

  .profile-page .site-header-actions .site-play-cta{
    display:none;
  }

  .guest-profile-registration{
    grid-template-columns:1fr;
    text-align:center;
  }

  .guest-profile-registration-actions{
    justify-content:center;
  }

  .guest-profile-registration-actions .primary-cta,
  .guest-profile-registration-actions .secondary-cta{
    flex:1 1 160px;
  }

  .profile-cosmetics-management{
    grid-template-columns:1fr;
    gap:14px;
  }

  .profile-cosmetic-actions{
    justify-content:flex-start;
  }

  .profile-inventory-block{
    grid-column:auto;
    padding-top:0;
  }

  .profile-inventory-block h3{
    margin:4px 0 10px;
  }

  .profile-inventory-block .cosmetic-inventory{
    max-height:260px;
    overflow:auto;
    overscroll-behavior:contain;
    padding-right:3px;
  }

  .profile-inventory-block .cosmetic-inventory-item{
    padding:9px 10px;
  }
}

@media(max-width:620px){
  .guest-profile-hero .guest-profile-banner,
  .member-profile-hero .member-profile-banner{
    height:clamp(132px,38vw,172px);
  }

  .guest-profile-identity,
  .member-profile-identity{
    --profile-avatar-size:clamp(92px,28vw,118px);
  }

  .profile-settings-trigger{
    min-height:38px;
    padding:7px 10px;
  }

  .profile-settings-trigger span:last-child{
    display:none;
  }

  .profile-page .profile-stat-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .profile-page .profile-mode-stats{
    overflow-x:auto;
    padding-bottom:4px;
  }

  .profile-page .profile-mode-row{
    min-width:520px;
  }

  .profile-page .profile-collections-entry{
    align-items:stretch;
  }

  .profile-page .profile-collections-entry .primary-cta{
    width:100%;
    text-align:center;
  }

  .profile-settings-dialog{
    width:100%;
    max-width:none;
    max-height:100dvh;
    height:100dvh;
    margin:0;
    border:0;
    border-radius:0;
  }

  .profile-settings-sheet{
    max-height:100dvh;
    min-height:100dvh;
    padding:0 16px calc(24px + env(safe-area-inset-bottom));
  }

  .profile-settings-head{
    position:sticky;
    z-index:3;
    top:0;
    margin:0 -16px;
    padding:18px 16px 14px;
    background:rgba(9,22,35,.97);
    backdrop-filter:blur(12px);
  }

  .profile-settings-section-head,
  .profile-settings-action-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .profile-settings-section-head small{
    margin-top:-8px;
  }

  .profile-settings-grid,
  .profile-email-change-fields{
    grid-template-columns:1fr;
  }

  .profile-settings-action-row .secondary-cta,
  .profile-settings-action-row button.secondary-cta,
  .profile-email-change-form .primary-cta{
    width:100%;
    text-align:center;
  }

  .profile-email-change-actions{
    display:grid;
    grid-template-columns:1fr;
  }
}

@media(max-width:420px){
  .guest-profile-registration{
    width:calc(100% - 20px);
  }

  .guest-profile-registration-actions{
    display:grid;
    grid-template-columns:1fr;
  }

  .guest-profile-registration-actions .primary-cta,
  .guest-profile-registration-actions .secondary-cta{
    width:100%;
    min-width:0;
  }
}
