#body.member-page { padding-top: 20px; }
.member-page .main { min-width: 0; }
.member-back {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  color: var(--ink-2); font-weight: 600; font-size: .875rem;
}
.member-back:hover { color: var(--accent-ink); }
.member-icon { width: 18px; height: 18px; flex: none; }

.member-banner {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; min-height: 252px;
  padding: 32px clamp(22px, 4vw, 52px);
  color: #fff; border-radius: var(--radius); background: #193c49; box-shadow: var(--shadow);
}
.member-stage {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
  background: linear-gradient(164deg, #77b6ce, #b5e2e3 70%, #e2efd6);
}
.member-stage.scene { background: var(--scene-top) var(--scene) center bottom / cover no-repeat; }
.member-banner::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, #183b49 7%, #183b49f5 28%, #183b49bf 45%, #183b4924 69%, transparent 85%);
}
/* The Plain sky background keeps its own pixel clouds. Town backgrounds use the member's chosen scene. */
.member-stage:not(.scene)::before, .member-stage:not(.scene)::after {
  content: ""; position: absolute; width: 145px; height: 38px;
  background: #f4ffffad;
  clip-path: polygon(0 74%, 12% 74%, 12% 47%, 25% 47%, 25% 21%, 34% 21%, 34% 0, 54% 0, 54% 20%, 63% 20%, 63% 40%, 79% 40%, 79% 58%, 88% 58%, 88% 74%, 100% 74%, 100% 100%, 0 100%);
}
.member-stage::before { top: 15%; right: 5%; }
.member-stage::after { top: 39%; right: 39%; transform: scale(.7); opacity: .65; }
.member-avatar {
  position: absolute; right: 9%; bottom: 12px; width: 192px; height: 224px;
}
.member-avatar img { position: relative; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 1px #12312a44); }
.member-stage:not(.scene) + .member-avatar::before {
  content: ""; position: absolute; left: 23%; right: 23%; bottom: 7%; height: 5%;
  background: radial-gradient(ellipse, #284b4366 0%, #284b4320 50%, transparent 72%);
}
.member-intro { width: 58%; min-width: 0; }
.member-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.member-status span {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; margin-bottom: 5px;
  border: 1px solid #ffffff60; border-radius: 6px; font-size: .75rem; font-weight: 650;
}
.member-status i { width: 7px; height: 7px; border-radius: 50%; background: #a1edb5; }
.member-intro h1 {
  margin: 0 0 10px; color: inherit; font-size: clamp(2.35rem, 5vw, 4.125rem);
  line-height: 1.06; letter-spacing: -.055em; overflow-wrap: anywhere;
}
.member-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px; font-size: .9375rem; font-weight: 550; }
.member-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.member-meta a { color: inherit; }
.member-meta a:hover { text-decoration: underline; }
.member-meta .member-icon { width: 15px; height: 15px; color: #c5dddd; }
.member-meta img { object-fit: contain; }
.member-intro .btn {
  margin-top: 23px; padding: 9px 15px; border-radius: 9px; border: 1px solid #ffe6b8;
  background: #ffdf9e; color: #392c16; box-shadow: none; text-shadow: none;
}
.member-intro .btn:hover { color: #392c16; background: #ffedc9; }

.member-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(244px, 30%); gap: 20px; margin-top: 22px; align-items: start; }
.member-body.single { grid-template-columns: 1fr; }
@media (min-width: 781px) {
  .member-body.single .member-details { display: flex; flex-wrap: wrap; gap: 18px 44px; }
  .member-body.single .member-details > div { padding: 0; border: 0; }
}
.member-panels { display: grid; gap: 20px; min-width: 0; }
.member-panel { min-width: 0; padding: 22px; }
.member-panel h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 17px; font-size: 1.25rem; letter-spacing: -.035em; }
.member-count { color: var(--ink-2); background: var(--bg-2); padding: 2px 7px; border-radius: 6px; font: 650 .8rem/1.4 var(--font); }
.member-roster { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; padding: 0; margin: 0; }
.member-character {
  display: flex; align-items: center; gap: 13px; height: 100%; padding-right: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; color: var(--ink);
}
.member-character:hover { color: var(--accent-ink); border-color: var(--line-2); box-shadow: var(--shadow); }
.member-portrait {
  position: relative; display: grid; flex: none; place-items: end center; width: 96px; overflow: hidden; min-height: 99px; align-self: stretch;
  background: var(--scene-top) var(--scene-thumb) center bottom / auto 112% no-repeat;
}
.member-portrait img { position: relative; width: 96px; height: 96px; image-rendering: pixelated; }
.member-portrait:has(.member-icon) { place-items: center; }
.member-portrait .member-icon { width: 26px; height: 26px; color: white; filter: drop-shadow(0 1px 2px #203d3b); }
.member-character-text { display: flex; flex-direction: column; min-width: 0; align-items: flex-start; gap: 3px; padding-block: 10px; }
.member-character-text strong { font: 700 1.06rem/1.25 var(--head); overflow-wrap: anywhere; }
.member-character-text small { color: var(--ink-2); }
.member-main-label { color: var(--accent-ink); font-size: .72rem; font-weight: 650; }
.member-verified { color: var(--green-ink); font-size: .75em; }
.member-character > .member-icon { margin-left: auto; width: 14px; color: var(--ink-3); }
.member-details { margin: 0; }
.member-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.member-details > div:last-child { padding-bottom: 0; }
.member-details dt { color: var(--ink-2); }
.member-details dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.member-bio { overflow-wrap: anywhere; }
.member-bio > :last-child, .member-panel p:last-child { margin-bottom: 0; }
.member-posts { margin: 0; padding-left: 1.15rem; }
.member-report { text-align: right; margin: 12px 0 0; }

@media (max-width: 780px) {
  .member-body { grid-template-columns: 1fr; gap: 14px; }
  .member-avatar { right: 4%; }
}
@media (max-width: 560px) {
  #body.member-page { padding-top: 14px; }
  .member-back { margin-bottom: 10px; }
  .member-banner { min-height: 214px; padding: 22px 16px; }
  .member-banner::before { background: linear-gradient(90deg, #183b49 4%, #183b49eb 40%, #183b4970 72%, transparent); }
  .member-stage::before { right: -4%; }
  .member-avatar { right: 0; bottom: 14px; width: 108px; height: 126px; }
  .member-intro { width: calc(100% - 88px); }
  .member-intro h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .member-meta { gap: 5px 11px; font-size: .85rem; }
  .member-intro .btn { margin-top: 16px; }
  .member-body { margin-top: 14px; }
  .member-panel { padding: 16px; }
  .member-panels { gap: 14px; }
}
