/* Profile uses the game's PLAYER panel and keeps one set of statistics visible. */
.player-profile-dialog {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(26px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(26px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: rgba(1, 6, 12, .76);
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.player-profile-dialog[hidden],
.player-profile-result[hidden],
.profile-summary-detail[hidden],
.stat-card.profile-stats-panel[hidden] { display: none; }
.profile-panel {
  --profile-font-label: max(26px, calc(var(--ui-font-small) * 1.5));
  --profile-font-body: max(30px, calc(var(--ui-font-body) * 1.35));
  width: min(1320px, 100%);
  height: min(960px, calc(100cqh - 96px));
  max-height: min(960px, calc(100cqh - 96px));
  gap: 24px;
}
.profile-header { flex: 0 0 auto; }
.profile-heading { flex: 1; }
.profile-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 10px 2px 2px;
  scrollbar-color: rgba(232, 248, 255, .45) rgba(5, 13, 24, .98);
  scrollbar-gutter: stable;
}
.profile-content:has(> .profile-status) { display: flex; align-items: center; justify-content: center; }
.profile-footer { flex: 0 0 auto; }
.profile-action { min-width: 210px; min-height: 68px; }
.profile-signin-button {
  --chamfer-border: var(--mint);
  --chamfer-fill: #18bd8a;
  color: var(--ink);
}
.profile-hero { display: flex; align-items: center; gap: 24px; }
.profile-sigil { display: block; flex: 0 0 88px; width: 88px; height: 88px; }
.profile-identity { flex: 1; min-width: 0; }
.profile-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 52px;
  line-height: 1.1;
  font-weight: 950;
}
.profile-level { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.profile-eyebrow { color: var(--muted); font-size: var(--profile-font-label); font-weight: 900; }
.profile-level-number {
  color: var(--cyan);
  font-size: 80px;
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.profile-xp-section { margin-top: 24px; }
.profile-xp-labels {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: var(--profile-font-label);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.profile-xp-labels strong { color: var(--cyan); }
.profile-xp-progress { height: 10px; overflow: hidden; background: rgba(127, 231, 255, .12); }
.profile-xp-fill { display: block; height: 100%; max-width: 100%; background: var(--cyan); }
.profile-statistics { margin-top: 36px; }
.profile-stat-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.profile-stat-tab {
  min-width: 0;
  min-height: 72px;
  padding: 10px 12px;
  font-size: var(--profile-font-label);
}
.profile-scope-all, .profile-scope-classic { --profile-mode-accent: var(--cyan); }
.profile-scope-arena { --profile-mode-accent: var(--gold); }
.profile-scope-shooting { --profile-mode-accent: var(--violet); }
.profile-stat-tab:is(:hover, :focus-visible, .is-active) { --tab-accent: var(--profile-mode-accent); }
.profile-stat-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.stat-card.profile-stats-panel {
  --chamfer-border: rgba(127, 231, 255, .25);
  --tint: rgba(127, 231, 255, .025);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  height: 372px;
  min-height: 372px;
  max-height: 372px;
  padding: 28px 32px;
}
.profile-stats-body {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.profile-stats-body > * { flex-shrink: 0; }
.profile-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
  margin: 0;
  width: 100%;
}
.profile-metric { min-width: 0; margin: 0; }
.profile-overview > .profile-metric { padding: 18px; }
.profile-overview > .profile-metric + .profile-metric { border-left: 1px solid rgba(127, 231, 255, .16); padding-left: 32px; }
.profile-metric-label { margin: 0 0 10px; color: var(--muted); font-size: var(--profile-font-label); font-weight: 900; line-height: 1.25; }
.profile-metric-value {
  margin: 0;
  color: var(--ink);
  font-size: max(38px, var(--profile-font-body));
  line-height: 1.15;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.profile-overview .profile-metric-value { font-size: 64px; }
.profile-mode-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px 32px;
  margin: 0;
  width: 100%;
}
.profile-featured {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 32px;
  border-right: 1px solid rgba(127, 231, 255, .16);
}
.profile-featured .profile-metric-value { color: var(--profile-mode-accent); font-size: 56px; }
.profile-description {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: var(--profile-font-body);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.profile-mode-empty { font-size: var(--profile-font-label); }
.profile-status { display: flex; min-height: 420px; align-items: center; justify-content: center; flex-direction: column; gap: 24px; padding: 40px; text-align: center; }
.profile-status-emblem { display: block; width: 96px; height: 96px; color: var(--cyan); font-size: 76px; font-weight: 950; }
.profile-status.is-error .profile-status-emblem { color: var(--danger); }
.profile-status .profile-description { max-width: 900px; margin: 0 0 8px; }
.profile-person-icon {
  background: var(--cyan);
  mask: url("./assets/ui/profile.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(127, 231, 255, .28));
}

.player-profile-summary { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 68px; padding: 10px 16px 14px; text-align: left; }
.profile-summary-sigil { display: block; flex: 0 0 36px; width: 36px; height: 36px; pointer-events: none; }
.profile-summary-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.profile-summary-label { overflow: hidden; color: var(--ink); font-size: max(20px, var(--ui-font-small)); line-height: 1; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.profile-summary-detail { overflow: hidden; color: var(--muted); font-size: max(14px, var(--ui-font-small)); line-height: 1; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.profile-summary-progress { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 3px; overflow: hidden; background: rgba(127, 231, 255, .14); }
.player-profile-result { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 20px; color: var(--muted); font-size: max(21px, var(--ui-font-body)); line-height: 1.2; padding: 10px 18px; font-weight: 900; }
:is(.result-screen, .shooting-result-panel) > .player-profile-result { grid-column: 1 / -1; }
.profile-result-gain { color: var(--cyan); font-size: max(24px, var(--ui-font-body)); font-weight: 950; }
.profile-result-levelup { color: var(--gold); font-size: max(20px, var(--ui-font-body)); font-weight: 950; }
:root[data-render-quality] .player-profile-dialog { backdrop-filter: none; }

@container (max-width: 1200px) {
  .profile-stat-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
