/* Player Profiles V1 */
body.profile-v1-open {
  overflow: hidden;
}

.profile-v1-open-button,
.profile-v1-small-button,
.profile-v1-action {
  border: 1px solid #566157;
  border-radius: 999px;
  background: #202720;
  color: #edf1e9;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.profile-v1-open-button {
  min-height: 38px;
  padding: 7px 12px;
  border-color: rgba(216, 244, 82, .48);
  color: #dff453;
}

.profile-v1-account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-v1-account-handle {
  color: #dff453;
  font-size: .72rem;
  font-weight: 900;
}

.profile-v1-modal {
  position: fixed;
  inset: 0;
  z-index: 1350;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 9, 7, .84);
  backdrop-filter: blur(9px);
}

.profile-v1-modal.hidden {
  display: none;
}

.profile-v1-card {
  width: min(760px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 20px;
  border: 1px solid #566157;
  border-radius: 24px;
  background:
    radial-gradient(circle at 86% 0%, rgba(216,244,82,.065), transparent 25%),
    linear-gradient(180deg, #252d26, #171d18);
  box-shadow: 0 28px 80px rgba(0,0,0,.55), 0 0 38px rgba(216,244,82,.045);
}

.profile-v1-head,
.profile-v1-section-head,
.profile-v1-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.profile-v1-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.profile-v1-head h2,
.profile-v1-section-head h3,
.profile-v1-identity-copy h3 {
  margin: 3px 0 0;
  color: #f5f7ef;
}

.profile-v1-head h2 {
  font-size: 1.55rem;
}

.profile-v1-section-head h3,
.profile-v1-identity-copy h3 {
  font-size: 1.05rem;
}

.profile-v1-kicker {
  color: #dff453;
  font-size: .65rem;
  font-weight: 950;
  letter-spacing: .13em;
}

.profile-v1-close {
  width: 42px;
  height: 42px;
  border: 1px solid #4d584f;
  border-radius: 50%;
  background: #202720;
  color: #e7ebe4;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.profile-v1-status {
  min-height: 20px;
  margin: 0 0 8px;
  color: #aeb7ae;
  font-size: .78rem;
  font-weight: 800;
}

.profile-v1-status.good {
  color: #74f29a;
}

.profile-v1-status.bad {
  color: #ff9f9b;
}

.profile-v1-content {
  display: grid;
  gap: 14px;
}

.profile-v1-loading,
.profile-v1-empty {
  padding: 24px 16px;
  border: 1px dashed #465047;
  border-radius: 16px;
  color: #9fa9a0;
  text-align: center;
}

.profile-v1-identity,
.profile-v1-section {
  padding: 15px;
  border: 1px solid #3f4941;
  border-radius: 18px;
  background: rgba(27, 33, 28, .82);
}

.profile-v1-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.profile-v1-avatar {
  width: 72px;
  height: 72px;
  border: 2px solid rgba(216,244,82,.62);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #303a31;
  font-size: 2.25rem;
  box-shadow: 0 0 22px rgba(216,244,82,.09);
}

.profile-v1-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-v1-identity-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-v1-identity-copy > span:last-child {
  color: #98a398;
  font-size: .75rem;
}

.profile-v1-handle {
  color: #dff453;
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.profile-v1-small-button {
  min-height: 38px;
  padding: 7px 11px;
  font-size: .7rem;
}

.profile-v1-section {
  display: grid;
  gap: 12px;
}

.profile-v1-scope {
  padding: 5px 8px;
  border: 1px solid #465146;
  border-radius: 999px;
  color: #b9c2b9;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .06em;
  white-space: nowrap;
}

.profile-v1-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.profile-v1-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.profile-v1-fields label > span {
  color: #d9dfd8;
  font-size: .74rem;
  font-weight: 900;
}

.profile-v1-fields input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #4b564d;
  border-radius: 12px;
  background: #161c17;
  color: #f3f5ef;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.profile-v1-fields input:focus {
  border-color: #dff453;
  box-shadow: 0 0 0 2px rgba(216,244,82,.1);
}

.profile-v1-fields input:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.profile-v1-fields small,
.profile-v1-username-copy,
.profile-v1-scope-note {
  color: #929d93;
  font-size: .7rem;
  line-height: 1.4;
}

.profile-v1-action {
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 12px;
  border-color: #72806f;
  font-size: .7rem;
  white-space: nowrap;
}

.profile-v1-action:hover,
.profile-v1-action:focus-visible,
.profile-v1-small-button:hover,
.profile-v1-small-button:focus-visible,
.profile-v1-open-button:hover,
.profile-v1-open-button:focus-visible {
  border-color: #dff453;
  color: #dff453;
  outline: none;
}

.profile-v1-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.profile-v1-username-action {
  background: #dff453;
  color: #171b16;
  border-color: #b8d13c;
}

.profile-v1-username-action:hover,
.profile-v1-username-action:focus-visible {
  color: #171b16;
  background: #ecff6a;
}

.profile-v1-username-copy,
.profile-v1-scope-note {
  margin: 0;
}

.profile-v1-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.profile-v1-stat {
  min-height: 78px;
  padding: 10px;
  border: 1px solid #3d473f;
  border-radius: 13px;
  display: grid;
  align-content: center;
  gap: 3px;
  background: #1e2520;
}

.profile-v1-stat > span,
.profile-v1-stat > small {
  color: #929d93;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1.2;
}

.profile-v1-stat > strong {
  color: #f2f4ee;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.profile-v1-matches {
  display: grid;
  gap: 7px;
}

.profile-v1-match {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #3b453d;
  border-radius: 13px;
  background: #1d241e;
}

.profile-v1-match-result {
  width: 42px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #303832;
  color: #dce2db;
  font-size: .67rem;
  font-weight: 950;
}

.profile-v1-match-result.win {
  background: rgba(64, 190, 103, .18);
  color: #77f09c;
}

.profile-v1-match-result.loss {
  background: rgba(210, 78, 75, .17);
  color: #ff9f9b;
}

.profile-v1-match-result.draw {
  background: rgba(210, 183, 75, .16);
  color: #f0db83;
}

.profile-v1-match-copy,
.profile-v1-match-score {
  display: grid;
  gap: 2px;
}

.profile-v1-match-copy strong,
.profile-v1-match-score strong {
  color: #edf1e9;
  font-size: .82rem;
}

.profile-v1-match-copy span {
  color: #8f9a90;
  font-size: .66rem;
}

.profile-v1-match-score {
  justify-items: end;
}

.profile-v1-forfeit {
  color: #ffae7a;
  font-size: .55rem;
  font-weight: 950;
  letter-spacing: .06em;
}

@media (max-width: 700px) {
  .profile-v1-modal {
    padding: 8px;
    place-items: end center;
  }

  .profile-v1-card {
    max-height: 94vh;
    padding: 16px 12px 14px;
    border-radius: 22px 22px 14px 14px;
  }

  .profile-v1-identity {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-v1-small-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .profile-v1-fields {
    grid-template-columns: 1fr;
  }

  .profile-v1-action {
    width: 100%;
  }

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

  .profile-v1-match {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .profile-v1-account-actions {
    justify-content: stretch;
  }

  .profile-v1-open-button,
  .profile-v1-account-actions .auth-signout {
    flex: 1 1 auto;
  }
}

/* First account setup shares the existing profile surface, not a second profile. */
.username-setup-modal { z-index: 18000; }
.username-setup-card { display: grid; gap: 12px; width: min(430px, calc(100vw - 24px)); padding: 24px; }
.username-setup-card h2, .username-setup-card p { margin: 0; }
.username-setup-card input { box-sizing: border-box; width: 100%; min-height: 48px; font-size: 16px; }
.username-setup-card button { min-height: 44px; }
.username-setup-card small { line-height: 1.45; opacity: .85; }
#usernameSetupStatus { min-height: 1.4em; overflow-wrap: anywhere; }
body.username-setup-open { overflow: hidden; }

#profileV1Friends { min-height: 44px; }
