
/* Shared TGS module profile UI. Kept consistent with Tournament Manager account page. */
.profile-page{max-width:1320px;margin:0 auto;padding-bottom:40px}
.profile-page .topbar{margin-bottom:24px}
.account-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.45fr);gap:18px}
.profile-card{min-width:0}
.profile-photo-area{display:flex;align-items:center;gap:28px;min-height:170px}
.profile-avatar-wrap{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:128px;height:128px}
.profile-avatar{width:128px;height:128px;min-width:128px;max-width:128px;border-radius:50%;object-fit:contain;object-position:center;display:block;border:2px solid var(--line);background:var(--panel-2);padding:6px}
.profile-avatar-placeholder{display:grid;place-items:center;color:var(--text);font-weight:900;font-size:40px;background:linear-gradient(135deg,var(--accent),var(--accent-2));padding:0}
.profile-photo-actions{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.profile-photo-actions form{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.profile-photo-actions .subtle{font-size:.82rem;color:var(--muted)}
.profile-page .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.profile-page .form-grid .field{min-width:0}
.profile-page .form-grid>button{justify-self:start}
.module-profile-link{display:inline-flex;align-items:center;gap:7px}
.module-profile-avatar{width:24px;height:24px;border-radius:50%;object-fit:contain;background:var(--panel-2);border:1px solid currentColor}
@media(max-width:900px){
 .account-grid{grid-template-columns:1fr}
}
@media(max-width:650px){
 .profile-page{padding:14px}
 .profile-photo-area{flex-direction:column;align-items:flex-start}
 .profile-page .form-grid{grid-template-columns:1fr}
 .profile-avatar-wrap,.profile-avatar{width:104px;height:104px;min-width:104px;max-width:104px}
}


/* FINAL PROFILE CONSISTENCY OVERRIDES
   Profile images are always contained: the uploaded image is never cropped.
   Common profile/back/logout controls use the same dimensions and placement. */
.profile-avatar,
.profile-page img.profile-avatar {
  object-fit: contain !important;
  object-position: center center !important;
  width: 128px !important;
  height: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;
  min-height: 128px !important;
  max-height: 128px !important;
  padding: 6px !important;
  box-sizing: border-box !important;
  background: var(--panel-2) !important;
}
.brand-avatar, .module-profile-avatar {
  object-fit: contain !important;
  object-position: center center !important;
  background: var(--panel-2) !important;
}
.module-top-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.module-top-actions > a,
.module-top-actions > button {
  min-height: 40px !important;
  min-width: 124px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}
.module-profile-link {
  min-height: 40px !important;
  min-width: 124px !important;
  justify-content: center !important;
}
.module-profile-link .module-profile-avatar { width:24px !important; height:24px !important; min-width:24px !important; max-width:24px !important; padding:0 !important; border-radius:50% !important; }
@media(max-width:680px){
  .module-top-actions { width:100%; justify-content:flex-start !important; }
  .module-top-actions > a, .module-top-actions > button, .module-profile-link { min-width:118px !important; }
}

/* TGS unified profile image behavior */
.profile-avatar, .module-profile-avatar, .sidebar-avatar, .brand-avatar {
  object-fit: contain !important;
  object-position: center !important;
  box-sizing: border-box !important;
  background: var(--panel-2, #fff) !important;
  padding: 4px !important;
}

/* Unified module account actions */
.module-top-actions .module-profile-link,
.module-top-actions .module-logout-link,
.top-actions .module-profile-link,
.top-actions .module-logout-link,
.qr-user-actions .module-profile-link,
.qr-user-actions .module-logout-link,
.live-user .module-profile-link,
.live-user .module-logout-link {
  min-height: 40px !important;
  min-width: 118px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
}

/* v4: account/logout controls live in the sidebar/footer, not the module header. */
.account-page-actions{display:flex;justify-content:flex-end;gap:10px;margin:-8px 0 16px}.sidebar-footer a{display:inline-block;margin-right:10px}.module-profile-link,.module-logout-link{display:none!important}
