/* Character profile (/characters/{name}); builds on the .ui-char / .ui-card / .ui-search styles in site-custom.css */

.ui-profile {
  max-width: 760px;
  margin: 6px auto 18px;
}

/* Hero: outfit + identity */
.ui-profile__hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(31, 111, 106, 0.14), rgba(255, 255, 255, 0.72) 60%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.06);
}

.ui-profile__outfit {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.ui-profile__outfit img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
}

.ui-profile__identity {
  min-width: 0;
}

.ui-profile__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ui-profile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #2b2b2b;
}

.ui-profile__guild {
  margin-top: 6px;
  font-size: 13px;
  color: #444;
}

.ui-profile__guild i {
  margin-right: 4px;
  color: #1f6f6a;
}

/* Position / VIP badges (replace the legacy inline-styled labels) */
.ui-profile__badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  border: 1px solid currentColor;
}

.ui-profile__badge--admin { color: #c62828; background: rgba(198, 40, 40, 0.08); }
.ui-profile__badge--gm { color: #7d26cd; background: rgba(125, 38, 205, 0.08); }
.ui-profile__badge--senior-tutor { color: #2e7d32; background: rgba(46, 125, 50, 0.08); }
.ui-profile__badge--tutor { color: #b36b00; background: rgba(198, 126, 0, 0.08); }
.ui-profile__badge--staff { color: #1f6f6a; background: rgba(31, 111, 106, 0.08); }

.ui-profile__badge--vip {
  font-size: 11px;
  color: #8a5a00;
  border-color: #d9a520;
  background: linear-gradient(to bottom, #ffe082, #ffc107);
}

/* Stat tiles */
.ui-profile__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.ui-profile__stat {
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-left: 4px solid #1f6f6a;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  min-width: 0;
}

.ui-profile__stat--hp { border-left-color: #c62828; }
.ui-profile__stat--mp { border-left-color: #1565c0; }

.ui-profile__stat dt {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #555;
}

.ui-profile__stat dd {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Card header with a count on the right */
.ui-profile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ui-profile__count {
  font-weight: 700;
  letter-spacing: 0;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.ui-profile__text {
  overflow-wrap: anywhere;
}

.ui-profile__flag {
  margin: 0 6px 0 0;
}

/* Strength points checklist */
.ui-profile__progress {
  height: 8px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ui-profile__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6f6a, #2e9d8f);
}

.ui-profile__sp {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-profile__sp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.035);
  color: #666;
}

.ui-profile__sp-item i {
  flex: none;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.22);
}

.ui-profile__sp-item--done {
  background: rgba(46, 125, 50, 0.1);
  color: #1b5e20;
  font-weight: 700;
}

.ui-profile__sp-item--done i {
  color: #2e7d32;
}

.ui-profile__sp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Achievements */
.ui-profile__achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-profile__achievements li {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.ui-profile__achievements i {
  color: #f9a825;
  margin-right: 2px;
}

/* Other characters reuse the search result cards */
.ui-profile .ui-search__results {
  gap: 10px;
}

/* Search at the bottom: the card already frames it */
.ui-profile__search.ui-search {
  max-width: none;
  overflow: visible; /* .ui-card clips, which would hide the suggestion list */
}

.ui-profile__search .ui-card__header {
  border-radius: 8px 8px 0 0;
}

.ui-profile__search .ui-search__form {
  margin: 0;
}

@media (max-width: 640px) {
  .ui-profile__hero {
    align-items: flex-start;
  }

  .ui-profile__outfit,
  .ui-profile__outfit img {
    width: 72px;
    height: 72px;
  }

  .ui-profile__name {
    font-size: 22px;
  }

  .ui-profile__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ui-profile__sp {
    grid-template-columns: minmax(0, 1fr);
  }
}
