.character-grid {
  /*  main-grid overrides  */
  --breakout: 1400px;

  /* code */

  --gap: var(--spacing-6);
  --start: var(--spacing-11);
  --end: var(--spacing-11);

  grid-template-rows:
    var(--start)
    [actions] min-content
    [cover] min-content
    [content] auto
    var(--end);

  row-gap: var(--spacing-4);
}

.character-grid[data-status='empty'] {

  grid-template-rows:

    [cover actions] min-content
    [content] auto;
}

.character-grid[data-status='empty'] .profile-search {
  align-self: flex-end;
  justify-self: center;
  transform: translateY(50%);
  width: clamp(280px, 50ch, 100%);
  margin: 0;
}

/** Cover **/

.profile-cover {
  --profile-cover: url('/assets/images/guild/guild-banner.png');
  grid-row: cover;
  position: relative;

  z-index: -1;
  height: 200px;
  background-image: linear-gradient(
          180deg,
          rgba(12, 12, 13, 0) 0%,
          rgba(12, 12, 13, 0.6) 80%,
          rgba(12, 12, 13, 0.9) 100%
  ),
  var(--profile-cover);
  background-size: cover;
  background-position: center;
}

@media (width >= 768px) {
  .profile-cover {
    height: 320px;
  }
}

.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  /* background: ; */
  border: 1px solid var(--clr-base-50--5);
}

.profile-edit {
  grid-row: cover;
  justify-self: flex-start;
  align-self: flex-start;

  display: flex;
  margin: var(--spacing-3);
  gap: var(--spacing-2);
}

.profile-search {
  grid-row: actions;
  display: grid;
  grid-template-columns:
    [input-start label-start] minmax(0, 1fr)
    [label-end input-end button-start]
    auto [button-end];
  grid-template-rows: [input label button] auto;

  align-self: flex-start;

  align-content: center;
  /* border: 1px solid red; */
}


.profile-search__input {
  grid-area: input;
  height: var(--size-16);
}

.profile-search__label {
  grid-area: label;
  z-index: 2;
  visibility: hidden;
}

.profile-search__button {
  grid-area: button;
}

/** Container **/

.profile-container {
  grid-row: content;
  display: grid;
  gap: var(--spacing-4);
}

/** Sidebar **/

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.guild-info {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-4);
  padding-top: 0;
  padding-bottom: var(--spacing-6);

  background: var(--clr-surface-01) linear-gradient(
          180deg,
          var(--clr-base-800--0) 0%,
          var(--clr-base-800--90) 100%
  );
  border-radius: var(--radius-2);
}

.guild-info::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2);
  border: 1px solid var(--clr-forSurface-02);
  -webkit-mask-image: -webkit-linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.guild-info__emblem-wrapper {
  display: grid;
  position: relative;
  margin-top: -128px;
  width: 9.375rem;
  height: 11.25rem;
  background-image: url('/assets/images/character/character-guild-mark_bg.png');
  background-size: cover;
  border-radius: var(--radius-2, 0.125rem);

  padding: var(--spacing-3);

}

.guild-info__avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--clr-base-50--5);
  border-radius: var(--radius-3);
}

.guild-info > :not(.character-info__avatar) {
  z-index: 1;
}

.guild-info__avatar-image {
  border-radius: var(--radius-3);
  position: relative;
  grid-area: 1 / 1;
}

.guild-info__avatar-overlay {
  grid-area: 1 / 1;
}

.guild-info__members {
  color: var(--clr-bronze-400);
  text-align: center;
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.03125rem;
  text-transform: uppercase;
  top: -4px;
  position: relative;
}

.guild-info__name {
  color: var(--clr-bronze-100);
  font-family: var(--font-serif);
  font-size: 2rem;
  font-style: normal;
  font-weight: 600;
  line-height: 2.5rem; /* 125% */
  letter-spacing: -0.05rem;
}


/** Activities **/

.activities-list {
  display: grid;
  gap: var(--spacing-1);
}

.activities-list__item {
  display: grid;
  gap: var(--spacing-1);
}

.activities-list__button {
  display: flex;
  width: var(--size-33, 18rem);
  padding-inline-start: var(--spacing-4);
  padding-inline-end: var(--spacing-2);
  padding-block: calc(var(--spacing-2) - 1px);
  align-items: center;
  gap: var(--spacing-4, 1rem);
  width: 100%;

  border-radius: var(--radius-2, 0.125rem);
  border: 1px solid var(--clr-forSurface-02);
  background: var(--clr-surface-02);

  cursor: pointer;
}

.activities-list__name {
  color: var(--clr-onSurface-02);

  font-size: 0.875rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5rem; /* 171.429% */
  letter-spacing: 0.04375rem;
  text-transform: uppercase;
  flex-grow: 1;
  text-align: left;
}

.activities-list__value {
  color: var(--clr-onSurface-02--bold);
  text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.4);

  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5rem; /* 150% */
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}

.activities-list__icon-frame {
  display: flex;
  width: var(--size-13);
  height: var(--size-13);
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-2, 0.125rem);
  border: 1px solid var(--clr-forSurface-01);
  background: var(--clr-surface-01);
}

.activities-list__icon {
  color: var(--clr-onSurface-02--subtle);
}

.activities-list__item.active .activities-list__button {
  border-radius: var(--radius-2, 0.125rem);
  border: 1px solid var(--clr-forSurface-04);
  background: var(--clr-surface-04);
}

.activities-list__item.active .activities-list__name {
  color: var(--clr-onSurface-04--strong);
}

.activities-list__item.active .activities-list__value {
  display: none;
}

.activities-list__item.active .activities-list__icon-frame {
  background: var(--clr-surface-03);
  border: 1px solid var(--clr-forSurface-03);
}

.activities-list__item.active .activities-list__icon {
  color: var(--clr-onSurface-03);
  transform: rotate(180deg);
}

/* Sublist */

.activities-sublist {
  display: grid;
  gap: var(--spacing-1);
  padding-bottom: var(--spacing-1);
}

.activities-list__item:not(.active) .activities-sublist {
  display: none;
}

.activities-sublist__item {
  display: flex;
  padding: var(--spacing-2, 0.5rem) var(--spacing-4, 1rem);
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  border-radius: var(--radius-2, 0.125rem);
  background: linear-gradient(
          90deg,
          var(--clr-surface-03) 0%,
          var(--_bg-accent) 100%
  );
}

.activities-sublist__item.weekly {
  --_bg-accent: #22170D;
}

.activities-sublist__item.daily {
  --_bg-accent: #11111D;
}

.activities-sublist__item.monthly {
  --_bg-accent: #1B111D;
}

.activities-sublist__item.total {
  --_bg-accent: #1C1F10;
}

.activities-sublist__name {
  color: var(--clr-onSurface-03);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1rem; /* 114.286% */
  letter-spacing: 0.04375rem;
  text-transform: uppercase;
  margin-left: var(--spacing-2);
}

.activities-sublist__value {
  color: var(--clr-white--90);
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5rem; /* 150% */
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}


/** Content **/

.profile-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  align-content: flex-start;
}

.profile-section {
  position: relative;
  isolation: isolate;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  border: 1px solid var(--clr-forSurface-02);
  background-color: var(--clr-surface-02);
  border-radius: var(--radius-3, 0.25rem);

  overflow-x: hidden;
  background-size: contain;
  background-position: top right;
  background-repeat: no-repeat;
}

#trophies {
  background-image: url('/assets/images/character/trophies-section_bg.png');
}

#medals {
  background-image: url('/assets/images/character/medals-section_bg.png');
}

#members {
  background-image: url('/assets/images/guild/members-section_bg.png');
}


.profile-section__header {
  position: absolute;
  z-index: 2;
  left: 1.5rem;


  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  align-items: center;
}

.profile-section__header > img {
  width: 40px;
  height: 40px;
}

@media (width >= 800px) {
  .profile-section__header {
    flex-direction: row;
    top: 1.5rem;
    left: 1rem;
  }

  .profile-section__header > img {
    width: 56px;
    height: 56px;
  }
}

.profile-section__title {
  color: var(--clr-bronze-100);
  font-family: var(--heading-font);
  font-size: var(--heading-xs-size, 1.125rem);
  font-style: normal;
  font-weight: var(--heading-xs-weight, 600);
  line-height: var(--heading-xs-leading-loose, 1.75rem); /* 155.556% */
  text-transform: uppercase;
}

.profile-section__info {
  position: absolute;
  right: var(--spacing-3);
  top: var(--spacing-3);
  z-index: 2;
}

.profile-section__content {
  position: relative;
  display: flex;
  padding: var(--spacing-2, 0.5rem);
  align-items: flex-start;
  align-self: stretch;
  flex-wrap: wrap;
  flex: 1 1;
  gap: var(--spacing-2, 0.5rem);
  container-type: inline-size;
  overflow-x: auto;
}

.profile-section__achievements-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: var(--spacing-2);
}

.profile-section__achievements-table th,
.profile-section__achievements-table td {
  padding: var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem);
}

.profile-section__achievements-table th {
  background-color: var(--clr-surface-03);
  color: var(--clr-onSurface-03--strong);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5rem; /* 150% */
  text-transform: uppercase;
  text-align: left;
}

.profile-section__achievements-table tr:not(:first-child) th {
  min-width: 10ch;
}

@media (width >= 1080px) {
  .profile-section__achievements-table tr:not(:first-child) th {
    min-width: 24ch;
  }
}

.profile-section__achievements-table tr:first-child th {
  background-color: transparent;
  color: var(--clr-onSurface-01);
  text-align: center;
}

.profile-section__achievements-table td {
  background-color: var(--clr-surface-01);
  color: var(--clr-onSurface-01--bold);
  font-family: var(--font-monospace);
  font-size: 1rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.5rem; /* 120% */
  letter-spacing: 0.0625rem;
  text-transform: uppercase;
  text-align: center;
}

.profile-section__rank-gold,
.profile-section__rank-silver,
.profile-section__rank-bronze {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5rem; /* 150% */
  text-transform: uppercase;
}

.profile-section__rank-gold {
  color: #FBD439;
}

.profile-section__rank-silver {
  color: #DEF4F6;
}

.profile-section__rank-bronze {
  color: #F17B56;
}

.profile-section__achievements-table th > img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: cover;
}


@container (max-width: 320px) {
  .profile-section__content > div:nth-last-child(odd):first-child {
    flex-basis: 100%;
  }
}

.profile-section__members-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--spacing-1);
  margin-top: 80px;

  --_row-radius: var(--radius-2);
  overflow-x: auto;
  padding-top: var(--spacing-3);
}

.profile-section__members-table tbody tr {
  background-color: var(--clr-surface-02);
  border: none;
  position: relative;
  color: var(--clr-onSurface-02);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5rem; /* 150% */
  letter-spacing: 0.05rem;
}

.profile-section__members-table tbody tr::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid white;
  border-radius: var(--_row-radius);
  -webkit-mask-image: linear-gradient(
          to bottom,
          rgba(0, 0, 0, 0.02) 0%,
          rgba(0, 0, 0, 0.05) 60%,
          rgba(0, 0, 0, 0.05) 100%
  );
  mask-image: linear-gradient(
          to bottom,
          rgba(0, 0, 0, 0.02) 0%,
          rgba(0, 0, 0, 0.05) 60%,
          rgba(0, 0, 0, 0.05) 100%
  );
  pointer-events: none;
}

.profile-section__members-table th {
  color: var(--clr-onSurface-01--subtle);
  text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1rem; /* 133.333% */
  text-transform: uppercase;
}

.profile-section__members-table th,
.profile-section__members-table td {
  text-align: center;
  padding: var(--spacing-2);
  min-height: var(--size-17);
}

.profile-section__members-table td:nth-child(1),
.profile-section__members-table th:nth-child(1) {
  text-align: left;
}

.profile-section__members-table th:first-child,
.profile-section__members-table td:first-child {
  border-top-left-radius: var(--_row-radius);
  border-bottom-left-radius: var(--_row-radius);
}

.profile-section__members-table th:last-child,
.profile-section__members-table td:last-child {
  border-top-right-radius: var(--_row-radius);
  border-bottom-right-radius: var(--_row-radius);
}

.profile-section__members-table td:nth-child(1) {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-5);
  padding-left: var(--spacing-3);
  min-width: 15ch;
}

.profile-section__members-table td:nth-child(1) img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-2);
  box-shadow: 0px 0px 0px 2px var(--clr-black--60);
}

.profile-section__members-table td:nth-child(1) div {
  display: inline-flex;
  flex-direction: column;
}

.profile-section__members-table td:nth-child(1) div span {
  color: var(--clr-onSurface-04--subtle);
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.40);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1rem; /* 160% */
  letter-spacing: 0.03125rem;
}

.profile-section__members-table td:nth-child(1) a {
  position: relative;
  color: var(--clr-onSurface-02);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5rem; /* 150% */
}

.profile-section__members-table td:nth-child(1) a::after {
  content: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS43NzcgNi41MTgxMUw3LjE3Mzk4IDYuNTQwMTFMNi45Nzc5OCA2LjY2MTExQzYuODU2OTggNi43MzYxMSA2LjczNTk4IDYuODU3MTEgNi42NjA5OCA2Ljk3ODExQzYuNTUxOTggNy4xNTQxMSA2LjUzOTk4IDcuMjA3MTEgNi41Mzk5OCA3LjUwMDExQzYuNTM5OTggNy43OTMxMSA2LjU1MTk4IDcuODQ2MTEgNi42NjA5OCA4LjAyMjExQzYuNzM1OTggOC4xNDMxMSA2Ljg1Njk4IDguMjY0MTEgNi45Nzc5OCA4LjMzOTExTDcuMTczOTggOC40NjAxMUwxMC42MzUgOC40NzExMUwxNC4wOTcgOC40ODExMUwxMC42MTIgMTEuOTcxMUM3LjIyMjk4IDE1LjM2MzEgNy4xMjQ5OCAxNS40NjYxIDcuMDYyOTggMTUuNjc3MUM2Ljk4Mzk4IDE1Ljk0ODEgNi45ODM5OCAxNi4wNTIxIDcuMDYwOTggMTYuMzEwMUM3LjE0Mzk4IDE2LjU4OTEgNy40MTA5OCAxNi44NTYxIDcuNjg5OTggMTYuOTM5MUM3Ljk0Nzk4IDE3LjAxNjEgOC4wNTE5OCAxNy4wMTYxIDguMzIyOTggMTYuOTM3MUM4LjUzMzk4IDE2Ljg3NTEgOC42MzY5OCAxNi43NzcxIDEyLjAyOSAxMy4zODgxTDE1LjUxOSA5LjkwMzExTDE1LjUyOSAxMy4zNjUxTDE1LjU0IDE2LjgyNjFMMTUuNjYxIDE3LjAyMjFDMTUuODMxIDE3LjI5NjEgMTYuMDkzIDE3LjQ1MjEgMTYuNDIgMTcuNDczMUMxNi44NjEgMTcuNTAxMSAxNy4xOTcgMTcuMzE4MSAxNy4zNzUgMTYuOTUzMUwxNy40NzkgMTYuNzQwMUwxNy40ODEgMTEuOTkwMUMxNy40ODQgNi42NzkxMSAxNy41MDcgNy4xMDcxMSAxNy4yIDYuODAwMTFDMTcuMDE4IDYuNjE4MTEgMTYuODMzIDYuNTMyMTEgMTYuNTggNi41MTMxMUMxNi40NyA2LjUwNDExIDE0LjMwOSA2LjUwNzExIDExLjc3NyA2LjUxODExWiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC45Ii8+Cjwvc3ZnPgo=');
  position: absolute;
  left: 100%;
  width: 24px;
  height: 24px;
  padding-left: var(--spacing-1);
  /* border: 1px solid green; */
  transition: transform var(--ts-normal), opacity var(--ts-normal);
  filter: drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.59)) drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.51)) drop-shadow(0px 3px 2px rgba(0, 0, 0, 0.3)) drop-shadow(0px 5px 2px rgba(0, 0, 0, 0.09)) drop-shadow(0px 8px 2px rgba(0, 0, 0, 0.01));
  opacity: 0.5;
}

@media (hover: hover) {
  .profile-section__members-table td:nth-child(1) a::after {
    opacity: 0;
    transform: translateX(-32px);
  }
}

@media (width < 360px) {
  .profile-section__members-table td:nth-child(1) a::after {
    display: none;
  }
}

.profile-section__members-table td:nth-child(1) a:hover {
  color: var(--clr-onSurface-02--strong);
}

.profile-section__members-table td:nth-child(1) a:hover::after {
  transform: translateX(0);
  opacity: 0.5;
  transition: transform var(--ts-normal), opacity var(--ts-normal);
}

/** Even Rows **/

.profile-section__members-table tbody tr:nth-of-type(even) {
  background-color: var(--clr-surface-03);
  color: var(--clr-onSurface-03);
}

.profile-section__members-table tbody tr:nth-of-type(even) td:nth-child(1) a {
  color: var(--clr-onSurface-03);
}

.profile-section__members-table tbody tr:nth-of-type(even) td:nth-child(1) a:hover {
  color: var(--clr-onSurface-03--strong);
}

/* Guild Master Row */

.profile-section__members-table tbody tr:nth-of-type(1) td {
  color: var(--clr-white--90);
  text-shadow: var(--tshadow-3);
}

.profile-section__members-table tbody tr:nth-of-type(1) {
  background-color: var(--clr-surface-04);
  background-image: linear-gradient(45deg, var(--clr-brand-700--40) 0%, rgba(1, 24, 17, 0.00) 50%);
}

.profile-section__members-table tbody tr:nth-of-type(1) td img {
  width: 48px;
  height: 48px;
}

.profile-section__members-table tbody tr:nth-of-type(1) td:nth-of-type(1) {
  padding-left: var(--spacing-2);
  gap: var(--spacing-4);
}

.profile-section__members-table tbody tr:nth-of-type(1) td:nth-of-type(1) a {
  color: var(--clr-white--90);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5rem; /* 120% */
  text-shadow: var(--tshadow-3);
}

/* Assistente */

.profile-section__members-table tbody tr:nth-of-type(2) {
  background-color: var(--clr-surface-03);
}

.profile-section__members-table tbody tr:nth-of-type(2) td {
  color: var(--clr-white--90);
  text-shadow: var(--tshadow-3);
}

.profile-section__members-table tbody tr:nth-of-type(2) td:nth-of-type(1) a {
  color: var(--clr-white--90);
}

.profile-section__members-table .status-online,
.profile-section__members-table .status-offline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  text-align: center;
}

.profile-section__members-table .status-online {
  background-color: #15ECB3;
  border: 2px solid #166D59;
}

.profile-section__members-table .status-offline {
  background-color: #ABABAB;
  border: 2px solid #616161;
}


.not-found {
  grid-row: content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-6);
  padding-top: var(--spacing-10);
}

.not-found__heading {
  color: var(--clr-bronze-100);
  text-align: center;
  font-family: var(--heading-font);
  font-size: var(--heading-sm-size, 1.75rem);
  font-weight: var(--heading-sm-weight, 900);
  line-height: var(--heading-sm-leading-loose, 2.25rem); /* 128.571% */
}

.not-found__message {
  overflow: hidden;
  color: var(--clr-onSurface-01);
  text-align: center;
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.5rem; /* 150% */
}

/** Media Queries **/


@media (width >= 768px) {

  .character-grid {
    --start: 0;
    row-gap: var(--spacing-6);
    grid-template-rows:
      var(--start)
      [actions cover] min-content
      [content] auto
      var(--end);
  }

  .profile-search {
    margin-top: 15rem;
    margin-right: var(--spacing-2);
    justify-self: flex-end;
  }

  .profile-container {
    grid-template-columns: minmax(280px, 25%) 1fr;
    gap: var(--spacing-5);
  }
}

@media (width >= 960px) {
  .character-grid {
    row-gap: var(--spacing-8);
    grid-template-rows:
      [actions cover] min-content
      [content] auto
      var(--end);
  }
}

@media (width >= 1280px) {
  .profile-container {
    gap: var(--spacing-8);
  }

  .profile-sidebar,
  .profile-content {
    row-gap: var(--spacing-6);
  }

  .profile-search {
    margin-right: 3.5rem;
  }
}
