/* ===== Account / profile redesign ===== */
.profile-shell {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
  padding: 54px 0 80px;
}

#account-content {
  display: grid;
  gap: 14px;
}

.profile-hero {
  position: relative;
  min-height: 210px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  border: 1px solid var(--public-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 25%, rgba(126,223,255,.10), transparent 22rem),
    linear-gradient(145deg, rgba(15,27,52,.96), rgba(8,15,29,.98));
  box-shadow: 0 24px 60px rgba(0,0,0,.20);
}

.profile-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -100px;
  bottom: -150px;
  border-radius: 50%;
  border: 1px solid rgba(126,223,255,.10);
  pointer-events: none;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126,223,255,.30);
  border-radius: 22px;
  color: #07111e;
  background: linear-gradient(145deg, #b9f1ff, #6edcff);
  box-shadow: 0 14px 36px rgba(53,199,255,.16);
  font-size: 34px;
  font-weight: 900;
}

.profile-identity-copy .eyebrow {
  margin-bottom: 7px;
}

.profile-identity-copy h1 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(34px, 5vw, 52px);
  line-height: .98;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}

.profile-email,
.profile-member-since {
  margin: 9px 0 0;
  color: #94a3ba;
  font-size: 13px;
}

.profile-member-since {
  margin-top: 4px;
  color: #66758d;
  font-size: 12px;
}

.profile-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-actions .button {
  white-space: nowrap;
}

.profile-stat-grid-main {
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--public-line);
  border-radius: 14px;
  background: rgba(8,15,29,.86);
}

.profile-stat-grid-main .profile-stat:last-child {
  border-right: 0;
}

.profile-stat-grid-main .profile-stat span {
  color: #718098;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.profile-stat-grid-main .profile-stat strong {
  margin-top: 7px;
  color: #f5f8ff;
  font-size: 25px;
  letter-spacing: -.035em;
}

.profile-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 10px;
}

.profile-panel {
  padding: 25px;
  border: 1px solid var(--public-line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(13,23,44,.92), rgba(8,15,29,.96));
  box-shadow: 0 16px 46px rgba(0,0,0,.13);
}

.profile-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-panel-heading h2 {
  margin: 4px 0 0;
  color: #f3f7ff;
  font-size: 23px;
  letter-spacing: -.035em;
}

.profile-section-label {
  margin: 0;
  color: #6f8099;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.profile-performance-badge {
  padding: 7px 10px;
  border: 1px solid rgba(126,223,255,.20);
  border-radius: 999px;
  color: var(--public-accent);
  background: rgba(126,223,255,.06);
  font-size: 11px;
  font-weight: 900;
}

 .profile-performance-body {
  min-height: 150px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-score-ring {
  --profile-progress: 0%;
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0a1428 59%, transparent 60%),
    conic-gradient(var(--public-accent) var(--profile-progress), rgba(255,255,255,.07) 0);
  box-shadow: 0 0 45px rgba(53,199,255,.08);
}

.profile-score-ring strong {
  color: #f7fbff;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.05em;
}

.profile-score-ring span {
  margin-top: 5px;
  color: #718098;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.profile-performance-copy {
  max-width: 470px;
}

.profile-performance-copy h3 {
  margin: 0 0 9px;
  color: #f4f8ff;
  font-size: 22px;
  letter-spacing: -.03em;
}

.profile-performance-copy p {
  margin: 0;
  color: #8d9bb1;
  line-height: 1.65;
  font-size: 13px;
}

.profile-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: var(--public-accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}

.profile-inline-link:hover {
  color: #fff;
}

.profile-details {
  margin: 14px 0 0;
  display: grid;
  gap: 0;
}

.profile-details > div {
  min-width: 0;
  padding: 13px 0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid rgba(164,192,240,.08);
}

.profile-details dt {
  color: #687991;
  font-size: 11px;
  font-weight: 800;
}

.profile-details dd {
  margin: 0;
  max-width: 62%;
  color: #dfe7f4;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-results-panel,
.profile-best-panel {
  min-width: 0;
}

.profile-panel-heading-results {
  align-items: center;
}

.profile-result-list {
  margin-top: 13px;
  display: grid;
  gap: 7px;
}

.profile-result-row {
  min-width: 0;
  min-height: 58px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(164,192,240,.09);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  background: rgba(255,255,255,.022);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.profile-result-row:hover {
  transform: translateY(-1px);
  border-color: rgba(126,223,255,.24);
  background: rgba(126,223,255,.04);
}

.profile-result-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-result-main small,
.profile-best-copy small {
  color: #65748b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.profile-result-main strong,
.profile-best-copy strong {
  min-width: 0;
  overflow: hidden;
  color: #edf3fb;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-result-main > span:last-child {
  color: #687890;
  font-size: 10px;
}

.profile-result-score {
  min-width: 60px;
  display: grid;
  justify-items: end;
  gap: 2px;
}

.profile-result-score strong {
  color: #f2f7ff;
  font-size: 14px;
}

.profile-result-score small {
  color: var(--public-accent);
  font-size: 10px;
  font-weight: 850;
}

.profile-result-arrow {
  color: #56667e;
  font-size: 17px;
}

 .profile-best-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 8px;
}

.profile-best-card {
  min-width: 0;
  min-height: 105px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(164,192,240,.09);
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
  background: rgba(255,255,255,.022);
  transition: border-color 140ms ease, transform 140ms ease;
}

.profile-best-card:hover {
  transform: translateY(-2px);
  border-color: rgba(126,223,255,.24);
}

.profile-best-number {
  color: #596a83;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.profile-best-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-best-copy strong {
  font-size: 12px;
}

.profile-best-score {
  color: var(--public-accent);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.profile-loading,
.profile-empty {
  padding: 30px 15px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: #718098;
  text-align: center;
  font-size: 12px;
}

.profile-empty strong {
  color: #dfe7f4;
  font-size: 14px;
}

.profile-empty span {
  color: #6f8098;
}


/* Profile */
.profile-shell {
  width: min(1120px, calc(100% - 48px));
  padding-top: 24px;
  padding-bottom: 48px;
}

#profile-content { gap: 18px; }

.profile-hero {
  min-height: 0;
  padding: 20px 24px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}
.profile-hero h1 { margin: 2px 0 4px; font-size: clamp(32px, 4vw, 46px); }
.profile-verified { color: var(--green); font-size: 14px; }
.profile-actions { gap: 9px; }

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.profile-stat {
  min-height: 76px;
  padding: 13px 16px;
  border: 0;
  border-right: 1px solid rgba(170,192,224,0.1);
  background: transparent;
}
.profile-stat span,
.profile-history-metrics span { color: #8898ae; font-size: 11px; }
.profile-stat strong { margin-top: 3px; color: #fff; font-size: 21px; }

.profile-panel,
.profile-engagement-panel {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.profile-friends-panel,
.profile-history-panel,
#friends-leaderboard-panel,
#live-match-panel,
#email-change-panel { background: rgba(12,20,34,0.78); }

.friend-request-grid > section,
.friend-card,
.profile-history-card {
  border-color: rgba(170,192,224,0.11);
  background: rgba(255,255,255,0.025);
}

.friend-card { border-radius: 12px; }
.friend-identity span { color: var(--muted); }
.friend-challenge-picker { border-top-color: rgba(170,192,224,0.1); color: var(--muted); }
.friend-empty,
.profile-history-empty { border-color: rgba(170,192,224,0.18); color: var(--muted); }
.profile-history-main p { color: var(--muted); }

#email-change-panel { background: rgba(9,15,26,0.7); }

/* Profile page refinements */
.profile-avatar-wrap{position:relative;flex:0 0 84px;width:84px;height:84px}.profile-avatar{width:84px;height:84px;overflow:hidden;border-radius:24px}.profile-avatar img{display:block;width:100%;height:100%;object-fit:cover}.profile-avatar-edit{position:absolute;right:-7px;bottom:-7px;width:31px;height:31px;padding:0;display:grid;place-items:center;border:1px solid rgba(126,223,255,.34);border-radius:50%;color:#07111e;background:var(--public-accent,#7edfff);box-shadow:0 7px 18px rgba(0,0,0,.28);font-size:14px;font-weight:900;cursor:pointer}.profile-avatar-controls{margin-top:11px;display:flex;align-items:center;flex-wrap:wrap;gap:8px}.profile-avatar-controls .button{min-height:34px;padding:8px 12px;font-size:11px}.profile-avatar-hint{color:#74859d;font-size:10px;line-height:1.45}.profile-avatar-controls .button[hidden]{display:none}@media(max-width:620px){.profile-avatar-wrap,.profile-avatar{width:72px;height:72px}.profile-avatar-wrap{flex-basis:72px}.profile-avatar{border-radius:20px}.profile-avatar-controls{align-items:flex-start;flex-direction:column}}
.profile-account-alert{display:flex;align-items:center;gap:12px;margin:0 0 18px;padding:13px 15px;border:1px solid rgba(255,190,92,.25);border-radius:14px;background:rgba(255,190,92,.06)}
.profile-account-alert[hidden]{display:none}.profile-account-alert-icon{width:28px;height:28px;flex:0 0 28px;display:grid;place-items:center;border-radius:50%;background:rgba(255,190,92,.14);color:#ffcf79;font-weight:900}.profile-account-alert div:last-child{display:grid;gap:2px}.profile-account-alert strong{font-size:12px;color:#dfe9f5}.profile-account-alert span{font-size:11px;color:#8292a7;line-height:1.45}
.profile-quick-panel{margin-top:18px}.profile-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.profile-quick-card{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:11px;padding:14px;text-decoration:none;border:1px solid rgba(126,223,255,.10);border-radius:14px;background:rgba(255,255,255,.018);transition:transform .16s ease,border-color .16s ease,background .16s ease}.profile-quick-card:hover{transform:translateY(-2px);border-color:rgba(126,223,255,.28);background:rgba(255,255,255,.035)}.profile-quick-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:rgba(126,223,255,.09);color:var(--public-accent,#7edfff);font-size:13px;font-weight:900}.profile-quick-card span:nth-child(2){display:grid;gap:3px;min-width:0}.profile-quick-card strong{font-size:12px;color:#e7eef7}.profile-quick-card small{font-size:10px;line-height:1.4;color:#74859d}.profile-quick-arrow{color:#6f8197;font-size:15px}@media(max-width:760px){.profile-quick-grid{grid-template-columns:1fr 1fr}}@media(max-width:520px){.profile-quick-grid{grid-template-columns:1fr}.profile-quick-card{padding:12px}}
