.profile-page {
  display: grid;
  gap: 20px;
}

#app > .bottom {
  z-index: 20;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  padding: 20px 17px;
  border: 1px solid #fff;
  border-radius: 25px;
  background: linear-gradient(120deg, #ece9ff, #fff0f7 80%);
  box-shadow: 0 8px 28px #796add0d;
}

.profile-avatar {
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid #ffffffd9;
  border-radius: 50%;
  background: #ffffff78;
}

.profile-avatar .avatar {
  width: 56px;
  height: 56px;
  font-size: 24px;
  background: linear-gradient(135deg, #ed8cb7, #8b7fe2);
}

.profile-identity > div:nth-child(2) {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.profile-eyebrow {
  color: #8676b2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.profile-identity h1 {
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.9px;
  margin: 5px 0 6px;
  overflow-wrap: anywhere;
}

.profile-identity p {
  max-width: 230px;
  font-size: 11px;
  line-height: 1.5;
  color: #817487;
  margin: 0;
}

.profile-identity-spark {
  position: absolute;
  right: 13px;
  top: 12px;
  font-size: 30px;
  color: #c6b0db;
}

.profile-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 12px;
}

.profile-section-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -.6px;
}

.profile-section-heading > span {
  color: #9a92a3;
  font-size: 10px;
}

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

.profile-stat {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid #eeebf5;
  padding: 17px 15px 16px;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 5px 15px #78678108;
}

.profile-stat-number {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -1.6px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  z-index: 1;
}

.profile-stat h3 {
  margin: 12px 0 4px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -.25px;
}

.profile-stat p {
  color: #9a93a3;
  font-size: 9px;
  line-height: 1.4;
  margin: 0;
}

.profile-stat-icon {
  position: absolute;
  top: 15px;
  right: 13px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fff0f6;
  color: #dc7bab;
  font-size: 26px;
  font-weight: 500;
}

.profile-stat-games .profile-stat-icon {
  background: #f0edff;
  color: #9382d6;
}

.profile-stat-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-stat-green, .profile-stat-red {
  min-height: 126px;
  padding-top: 17px;
}

.profile-stat-green {
  background: linear-gradient(120deg, #e9f9ed, #f4fff5);
  border-color: #dceddf;
  color: #338354;
}

.profile-stat-red {
  background: linear-gradient(120deg, #ffedf2, #fff6f7);
  border-color: #f4dfe7;
  color: #bf5470;
}

.profile-flag-label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 9px;
  letter-spacing: .4px;
  font-weight: 800;
  margin-bottom: 18px;
}

.profile-flag-unit {
  position: relative;
  display: block;
  z-index: 1;
  font-size: 11px;
  margin-top: 5px;
  opacity: .8;
}

.profile-stat > img {
  position: absolute;
  width: 84px;
  height: 84px;
  object-fit: contain;
  right: -8px;
  bottom: -8px;
  transform: rotate(8deg);
  filter: drop-shadow(0 4px 6px #425b4920);
}

.profile-stat-red > img {
  transform: rotate(-6deg);
}

.profile-stat-note {
  font-size: 11px;
  line-height: 1.5;
  margin: 12px 3px 0;
  color: #8c8496;
}

.profile-text-link {
  border: 0;
  padding: 8px 3px 0;
  background: none;
  color: #7965ba;
  font-size: 11px;
  font-weight: 700;
}

.profile-first-step {
  display: grid;
  gap: 7px;
  text-align: center;
  margin: 14px 0 0;
  font-size: 11px;
  color: #8d849a;
}

.profile-first-step button {
  border: 0;
  background: transparent;
  color: #9c66bd;
  font-size: 12px;
  font-weight: 750;
  padding: 3px;
}

.profile-count-help {
  margin: 12px 3px 0;
  color: #99919f;
  font-size: 10px;
}

.profile-count-help summary {
  cursor: pointer;
  width: fit-content;
}

.profile-count-help p {
  font-size: 11px;
  line-height: 1.5;
  margin: 9px 0 0;
}

.profile-invite {
  position: relative;
  overflow: hidden;
  padding: 21px 18px 15px;
  border-radius: 25px;
  border: 1px solid #e8dff7;
  background: linear-gradient(125deg, #eeebff, #fff0f7 85%);
  box-shadow: 0 8px 22px #9b6dab0c;
}

.profile-invite > .profile-eyebrow, .profile-invite > h2, .profile-invite > p {
  position: relative;
  z-index: 1;
}

.profile-invite h2 {
  font-size: 25px;
  letter-spacing: -.8px;
  line-height: 1.12;
  margin: 8px 0;
}

.profile-invite > p {
  color: #8b7b96;
  font-size: 11px;
  line-height: 1.55;
  margin: 0;
  max-width: 220px;
}

.profile-invite-art {
  width: 132px;
  height: 132px;
  position: absolute;
  right: -6px;
  top: -6px;
  object-fit: contain;
  transform: rotate(6deg);
  filter: drop-shadow(0 6px 9px #c790c426);
}

.profile-friend-stat {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin-top: 18px;
  border: 1px solid #ffffffd9;
  border-radius: 15px;
  background: #ffffff8c;
}

.profile-friend-stat > b {
  min-width: 25px;
  max-width: 42%;
  overflow-wrap: anywhere;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -.8px;
  color: #7962b4;
  font-variant-numeric: tabular-nums;
}

.profile-friend-stat > div {
  min-width: 0;
}

.profile-friend-stat strong, .profile-friend-stat span {
  display: block;
}

.profile-friend-stat strong {
  font-size: 12px;
  font-weight: 750;
  color: #70607e;
}

.profile-friend-stat span {
  color: #a292b0;
  font-size: 9px;
  line-height: 1.4;
  margin-top: 3px;
}

.profile-friend-stat svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  margin-left: auto;
  fill: none;
  stroke: #a58bd0;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.profile-invite .profile-invite-button {
  position: relative;
  z-index: 1;
  margin-top: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-radius: 15px;
  font-size: 13px;
  box-shadow: 0 6px 15px #b3498b23;
}

.profile-invite-button > span {
  font-size: 19px;
  line-height: 1;
}

.profile-copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px 0 0;
  border: 0;
  background: none;
  color: #8b79a2;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.profile-copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.profile-invite .profile-invite-message {
  text-align: center;
  max-width: none;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 12px;
}

.profile-manual-copy {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 10px;
  color: #897897;
}

.profile-manual-copy input {
  width: 100%;
  border: 1px solid #d8cbe6;
  border-radius: 10px;
  background: #ffffffb8;
  padding: 10px;
  color: #7965ba;
  font: 12px inherit;
}

.profile-about {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 4px;
  color: #a397ab;
}

.profile-about > span {
  font-size: 25px;
  font-weight: 300;
  color: #c4adca;
}

.profile-about p {
  font-size: 10px;
  line-height: 1.6;
  margin: 0;
}

.profile-load-error {
  border-radius: 14px;
  background: #fff0f5;
  padding: 12px;
  margin-top: 12px;
  color: #a85679;
}

.profile-load-error p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.profile-load-error button {
  background: none;
  border: 0;
  padding: 8px 0 0;
  color: #9161b4;
  font-size: 11px;
  font-weight: 700;
}

.profile-page button:disabled {
  opacity: .5;
  cursor: default;
}

.profile-page button:focus-visible, .profile-page summary:focus-visible, .profile-page input:focus-visible {
  outline: 3px solid #9e8ade;
  outline-offset: 3px;
}

@media (max-width: 360px) {
  .profile-identity {
    padding: 17px 13px;
    gap: 11px;
  }
  .profile-avatar .avatar {
    width: 48px;
    height: 48px;
  }
  .profile-identity h1 {
    font-size: 24px;
  }
  .profile-identity p {
    font-size: 10px;
  }
  .profile-stat {
    padding: 15px 12px;
  }
  .profile-stat-icon {
    width: 27px;
    height: 27px;
    right: 10px;
    font-size: 23px;
  }
  .profile-stat-number {
    font-size: 34px;
  }
  .profile-stat p {
    font-size: 8px;
  }
  .profile-flag-label {
    font-size: 8px;
  }
  .profile-invite {
    padding: 19px 14px 14px;
  }
  .profile-invite-art {
    width: 107px;
    height: 107px;
    right: -12px;
    top: 2px;
  }
  .profile-invite > p {
    font-size: 10px;
  }
  .profile-invite h2 {
    font-size: 23px;
  }
  .profile-friend-stat {
    padding: 12px 10px;
    gap: 9px;
  }
  .profile-friend-stat strong {
    font-size: 11px;
  }
  .profile-friend-stat span {
    font-size: 8px;
  }
}
