.portal-expanded .gallery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

.portal-expanded .character-card {
  --card-edge: #515641;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  color: #f3efdf;
  background: #171e16;
  border: 1px solid var(--card-edge);
  border-radius: 3px 3px 0 3px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
}

.portal-expanded .character-card::after {
  position: absolute;
  right: -6px;
  bottom: 11px;
  width: 35px;
  height: 1px;
  background: var(--card-edge);
  transform: rotate(-45deg);
  content: '';
  pointer-events: none;
}

.portal-expanded .character-card .character-art {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: 1.16;
  overflow: hidden;
  background: #222b20;
  border-bottom: 1px solid #333d2c;
}

.portal-expanded .character-card .character-art img,
.portal-expanded .character-card .character-art img:not(.local-character-portrait) {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center top;
}

.portal-expanded .character-art-placeholder {
  padding: 32px;
  color: #bdc4ac;
  font-size: 13px;
  text-align: center;
}

.portal-expanded .character-card .character-meta {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 18px 20px 22px;
}

.portal-expanded .character-card .character-name {
  margin: 0 0 8px;
  color: #f3efdf;
  font-size: clamp(22px, 2.05vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.portal-expanded .character-card .character-story {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  color: #e3e4d2;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.portal-expanded .character-approved-badge {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 55px;
  height: 55px;
  color: #fffbe9;
  background: #535d3c;
  border: 1px solid #e2dfbb;
  border-radius: 50%;
  pointer-events: none;
}

.portal-expanded .character-approved-icon,
.portal-expanded .character-approved-icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.portal-expanded .character-approved-label {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.portal-expanded .character-social {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #626750;
}

.portal-expanded .character-social-avatar {
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  background: #333e2c;
  border: 1px solid #80876b;
  border-radius: 50%;
}

.portal-expanded .character-social-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-expanded .character-avatar-placeholder {
  color: #e3e7d0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.portal-expanded .character-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  color: #ecefdf;
  text-decoration: none;
  text-underline-offset: 4px;
}

.portal-expanded a.character-profile-link:hover .character-handle {
  color: #f4ddb0;
  text-decoration: underline;
}

.portal-expanded a.character-profile-link:focus-visible {
  outline: 2px solid #d7bc83;
  outline-offset: 3px;
}

.portal-expanded .character-x-icon,
.portal-expanded .character-x-icon svg {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.portal-expanded .character-card .character-handle {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .portal-expanded .gallery-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 540px) {
  .portal-expanded .gallery-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    max-width: 400px;
  }

  .portal-expanded .character-card .character-art {
    aspect-ratio: 1.14;
  }

  .portal-expanded .character-card .character-name {
    font-size: 26px;
  }
}
