.social-header--arena {
  --masthead-edge: #75513e;
  --masthead-accent: #f3bb8e;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(180px, 21vw, 236px);
  padding: clamp(16px, 3vw, 29px);
  border-color: var(--masthead-edge);
  background-color: #1b2027;
  background-image:
    linear-gradient(100deg, #151b23f7 3%, #151b23df 42%, #151b2345 78%, #151b2315),
    url("./arena-training-ground.webp");
  background-position: center, 70% 54%;
  background-size: cover;
}
.social-header--arena .eyebrow { color: var(--masthead-accent); }
.social-header--arena h1, .social-header--leaderboard h1 { font-size: clamp(35px, 5vw, 54px); }
.social-header--arena p:not(.eyebrow) { color: #ece3d9; text-shadow: 0 1px 4px #141922; }
.social-header--arena .secondary { background: #2c211fea; border-color: #76533e; }
.social-page--arena .auth-panel { border-color: #4f3a32; background: #1e1b20; }

.social-header--leaderboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 13px;
  min-height: clamp(212px, 29vw, 332px);
  padding: clamp(16px, 3vw, 29px);
  border-color: #615641;
  background:
    linear-gradient(96deg, #121820ee 1%, #151d27bb 31%, #141c275e 55%, #171c2309 91%),
    url("./leaderboard-sky.webp") 74% 52% / cover #171d24;
}
.social-header--leaderboard .eyebrow { color: var(--gold-light); overflow-wrap: anywhere; }
.social-header--leaderboard p:not(.eyebrow) { max-width: 23em; color: #ece3d9; text-shadow: 0 1px 4px #141922; }
.social-header--leaderboard .social-header-actions { max-width: 29rem; }
.social-header--leaderboard .secondary { background: #222730ed; border-color: #55535a; }
.social-header--leaderboard .text-link { color: #f5dcc0; text-shadow: 0 1px 4px #141922; }

.leaderboard-sheet {
  --rank-columns: 44px minmax(0, 1fr) clamp(80px, 14vw, 116px) 12px;
  --rank-padding: clamp(12px, 2vw, 20px);
  --rank-avatar-size: 42px;
  --rank-name-gap: clamp(8px, 1.6vw, 13px);
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
}
.leaderboard-empty { padding: 17px var(--rank-padding); color: var(--muted); }
.leaderboard-notice { margin: 0 var(--rank-padding) 10px; }
.leaderboard-columns, .leaderboard-row {
  display: grid;
  grid-template-columns: var(--rank-columns);
  align-items: center;
  column-gap: clamp(7px, 1.6vw, 16px);
  padding-inline: var(--rank-padding);
}
.leaderboard-columns {
  min-height: 38px;
  border-block-end: 1px solid var(--border);
  border-radius: 11px 11px 0 0;
  background: var(--background);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.leaderboard-columns > :is(:first-child, :last-child) { text-align: center; }
.leaderboard-columns > :nth-child(2) { padding-inline-start: calc(var(--rank-avatar-size) + var(--rank-name-gap)); }
.leaderboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.leaderboard-row {
  min-width: 0;
  min-height: 65px;
  padding-block: 8px;
}
.leaderboard-list li + li .leaderboard-row { border-block-start: 1px solid var(--border); }
.leaderboard-list li:last-child .leaderboard-row { border-radius: 0 0 11px 11px; }
.leaderboard-list .leaderboard-row:is(:hover, :focus-visible) { background: var(--panel-hover); }
.leaderboard-row:focus-visible { outline-offset: -2px; }
.leaderboard-number {
  justify-self: center;
  min-width: 29px;
  padding: 2px 3px;
  border-radius: 5px;
  color: var(--muted);
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.leaderboard-list li:first-child .leaderboard-number {
  background: #342921;
  color: var(--gold-light);
}
.leaderboard-person { display: flex; min-width: 0; gap: var(--rank-name-gap); align-items: center; }
.community-avatar, .arena-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid #785b40;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #161b2280;
  background: radial-gradient(ellipse at top, #554031, #2c2626 73%);
  color: var(--gold-light);
  font: bold 20px/1 var(--serif);
  text-align: center;
}
.leaderboard-name, .profile-summary { min-width: 0; overflow-wrap: anywhere; }
.leaderboard-name { color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.35; }
.leaderboard-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.leaderboard-realm {
  justify-self: end;
  min-width: 0;
  padding: 3px 8px;
  border: 1px solid #62523e;
  border-radius: 6px;
  background: #332b23;
  color: var(--gold-light);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}
.leaderboard-sheet .community-avatar {
  width: var(--rank-avatar-size);
  height: var(--rank-avatar-size);
  border-color: var(--border);
  background: var(--background);
  box-shadow: none;
  color: var(--ink);
}
.leaderboard-sheet .leaderboard-realm {
  justify-self: center;
  border-color: var(--border);
  background: var(--background);
  color: var(--ink);
}
.leaderboard-arrow { color: var(--muted); font-size: 17px; text-align: end; }

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px 17px;
  min-width: 0;
  min-height: 142px;
  padding: clamp(14px, 3vw, 25px);
  border: 1px solid #564533;
  border-radius: 12px;
  background: linear-gradient(90deg, #171a21, #201d24ee 53%, #1c2026c0), url("./mountain.webp") center 44% / cover;
}
.profile-avatar { width: clamp(52px, 8vw, 70px); height: clamp(52px, 8vw, 70px); font-size: clamp(24px, 4vw, 32px); }
.profile-summary h1, .arena-stage-heading h2 { font: bold clamp(25px, 4vw, 42px)/1.17 var(--serif); }
.profile-summary .leaderboard-realm { display: inline-block; margin-top: 7px; }
.profile-hero .social-actions { justify-content: end; }
.profile-feed, .profile-post, .profile-comments { min-width: 0; }
.profile-feed { display: grid; gap: 10px; }
ol.profile-feed, ul.profile-feed { list-style: none; margin: 0; padding: 0; }
.profile-post {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: clamp(11px, 2vw, 16px);
  border: 1px solid #363842;
  border-radius: 8px;
  background: #1c2029;
}
.profile-post .social-row { padding-block: 0; }
.profile-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-stamp {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 7px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #45584e;
  border-radius: 5px;
  background: #23302b;
  color: #b8d9c8;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.profile-comments { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid #383b43; }
.profile-comments .social-list > li { align-items: start; }

.arena-hub, .arena-detail {
  --arena-ember: #f3b88e;
  --arena-border: #634136;
  display: grid;
  min-width: 0;
  gap: clamp(14px, 2.6vw, 22px);
}
.arena-section { min-width: 0; }
.arena-section.panel, .arena-controls.panel, .arena-ballot.panel, .arena-response.panel { border-color: var(--arena-border); }
.arena-results { display: grid; gap: 10px; }
.arena-results h2 { color: #f1d8c8; font: 700 clamp(18px, 2vw, 22px)/1.3 var(--serif); }
.arena-results > .social-row { padding: 0; }
.arena-challenges { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.arena-challenge {
  --arena-side-ink: #f2d3bf;
  --arena-side-edge: #825847;
  --arena-side-fill: #442c26;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
  min-width: 0;
  padding: 10px clamp(10px, 2vw, 16px);
  border: 1px solid var(--arena-border);
  border-radius: 10px;
  background: #221c20;
}
.arena-challenge[data-direction="incoming"] {
  border-inline-start: 3px solid #cc9166;
  background: linear-gradient(100deg, #3d2925, #232027 62%);
}
.arena-challenge:is(:hover, :focus-visible) { border-color: #b77e61; }
.arena-challenge .arena-avatar { width: 34px; height: 34px; font-size: 16px; }
.arena-challenge-content { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.arena-challenge-content > strong { color: var(--ink); font-size: 15px; line-height: 1.3; }
.arena-challenge-content > span { color: #d2bcb0; font-size: 12px; }
.arena-challenge-content time::before { content: " · "; }
.arena-challenge-action { color: var(--arena-ember); font-size: clamp(11px, 2.5vw, 13px); white-space: nowrap; }
.arena-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 335px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.arena-list > li { min-width: 0; }
.arena-list-row {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-width: 0;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--arena-border);
  border-radius: 12px;
  background: radial-gradient(ellipse at top left, #3d2926, transparent 72%), #201c22;
}
.arena-list-row:is(:hover, :focus-visible) { border-color: #b77e61; }
.arena-list-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}
.arena-list-title, .arena-list-name {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.arena-list-title { color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.35; }
.arena-list-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid #63443b;
  border-radius: 9px;
  background: linear-gradient(110deg, #512d25, #24202a 50%, #263f49);
}
.arena-list-side { display: grid; align-self: start; justify-items: center; min-width: 0; gap: 4px; text-align: center; }
.arena-list-name { color: var(--arena-side-ink); font-size: 14px; font-weight: 650; line-height: 1.35; }
.arena-list-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  color: #c5b3af;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.arena-list-votes { font-variant-numeric: tabular-nums; }
.arena-list-arrow { grid-column: 3; color: var(--arena-ember); font-size: 16px; line-height: 1; }
.arena-status {
  display: inline-block;
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid #61523e;
  border-radius: 5px;
  background: #362d24;
  color: var(--gold-light);
  font-size: 11px;
  white-space: nowrap;
}
.arena-status[data-status="open"] { border-color: #a3644a; background: #5b342a; color: #ffd8c3; }
.arena-status:is([data-status="closed"], [data-status="cancelled"], [data-status="declined"]) { border-color: #4d505a; background: #30323a; color: #d3d4dd; }
.arena-back { justify-self: start; padding: 4px 0; }
.arena-stage {
  display: grid;
  gap: clamp(10px, 2vw, 18px);
  min-width: 0;
  padding: clamp(10px, 2.1vw, 21px);
  border: 1px solid var(--arena-border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, #17202cc4, #17202c85 50%, #171a21b3),
    url("./arena-training-ground.webp") 69% 58% / cover #1b2027;
  box-shadow: 0 12px 30px #08090c5c;
}
.arena-stage-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow-wrap: anywhere;
}
.arena-stage-heading h2 { color: var(--ink); font-size: clamp(23px, 3.8vw, 36px); text-shadow: 0 2px 12px #0d0f15; }
.arena-invitation-note { grid-column: 1 / -1; color: var(--arena-ember); font-size: 13px; }
.arena-versus {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(6px, 1.3vw, 13px);
  min-width: 0;
}
.arena-list-side, .arena-contender {
  --arena-side-ink: #ffd3b5;
  --arena-side-edge: #93634d;
  --arena-side-fill: #573126;
}
:is(.arena-list-side, .arena-contender)[data-side="opponent"] {
  --arena-side-ink: #c0e2ed;
  --arena-side-edge: #618793;
  --arena-side-fill: #283f49;
}
.arena-contender {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--arena-side-edge);
  border-radius: 10px;
  background: #16181e;
  overflow-wrap: anywhere;
}
.arena-contender[data-side="opponent"] { grid-column: 2; grid-row: 1; }
.arena-contender-heading, .arena-contender-footer {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 11px);
  min-width: 0;
  padding: clamp(7px, 1.5vw, 12px);
}
.arena-contender-heading {
  min-height: 49px;
  border-bottom: 1px solid var(--arena-side-edge);
  background: linear-gradient(110deg, var(--arena-side-fill), #232128);
}
.arena-contender-heading > div { display: grid; min-width: 0; gap: 1px; }
.arena-contender-footer { justify-content: space-between; min-height: 48px; border-top: 1px solid var(--arena-side-edge); }
.arena-avatar {
  width: clamp(39px, 6.4vw, 60px);
  height: clamp(39px, 6.4vw, 60px);
  border-color: var(--arena-side-edge);
  color: var(--arena-side-ink);
  background: var(--arena-side-fill);
  font-size: clamp(18px, 3.8vw, 29px);
}
.arena-list-side .arena-avatar, .arena-contender .arena-avatar { width: 35px; height: 35px; font-size: 17px; }
.arena-contender-role { color: var(--arena-side-ink); font-size: 11px; line-height: 1.2; }
.arena-contender h3 {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(14px, 2vw, 19px);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arena-contender a:not(.button):hover { color: var(--arena-side-ink); text-decoration: underline; }
.arena-evidence {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #101217;
  color: #d0c9c3;
  font-size: 13px;
}
.arena-media-video, .arena-media-gallery, .arena-media-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.arena-media-video { display: block; object-fit: contain; }
.arena-media-photos {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--arena-side-edge) #15181f;
}
.arena-media-photos:focus-visible { outline: 2px solid var(--arena-side-ink); outline-offset: -3px; }
.arena-media-photos > li { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: center; }
.arena-media-photos img { display: block; width: 100%; height: 100%; object-fit: contain; }
.arena-media-count {
  position: absolute;
  inset: auto 5px 14px auto;
  padding: 2px 6px;
  border: 1px solid #ffffff30;
  border-radius: 4px;
  background: #101217de;
  color: #eee8e2;
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;
}
.arena-media-placeholder {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  padding: clamp(6px, 2vw, 18px);
  background: radial-gradient(ellipse at 50% 40%, var(--arena-side-fill), #11141b 79%);
  text-align: center;
}
.arena-media-mark {
  display: block;
  width: clamp(18px, 4vw, 31px);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--arena-side-edge);
  border-radius: 3px;
  background: linear-gradient(150deg, transparent 50%, var(--arena-side-edge) 51% 55%, transparent 56%);
}
.arena-media-retry { min-height: 36px; padding-inline: 8px; }
.arena-contender .button { max-width: 100%; white-space: normal; }
.arena-vote-count { color: var(--arena-side-ink); font-size: clamp(19px, 3.5vw, 28px); line-height: 1.15; font-variant-numeric: tabular-nums; }
.arena-vote-count small { color: var(--muted); font-size: 11px; }
.arena-vote-button { border-color: var(--arena-side-edge); background: #f2b691; }
.arena-contender[data-side="opponent"] .arena-vote-button { color: #1a3038; background: #b6d6e2; }
.arena-contender[data-side="opponent"] .arena-vote-button:hover { background: #d3e9ef; }
.arena-vs {
  display: grid;
  align-self: center;
  place-items: center;
  width: clamp(30px, 6vw, 52px);
  aspect-ratio: 1;
  border: 1px solid #a47761;
  border-radius: 50%;
  background: #302621;
  color: #ffdbbc;
  font: 700 italic clamp(12px, 2vw, 20px)/1 var(--serif);
}
.arena-list-match .arena-vs { width: 32px; font-size: 13px; }
.arena-versus > .arena-vs {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: clamp(24px, 4vw, 40px);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 15px #101217ad;
  pointer-events: none;
}
.arena-ballot { display: grid; min-width: 0; gap: 7px; }
.arena-ballot-heading, .arena-ballot-captions {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 5px 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.arena-ballot-heading { color: #d5cec3; }
.arena-ballot-heading h3 { color: var(--ink); font-size: 14px; }
.arena-ballot-bar { display: flex; min-width: 0; height: 7px; overflow: hidden; border-radius: 999px; background: #3a373d; }
.arena-ballot-bar > * { min-width: 0; }
.arena-ballot-bar[data-empty] > * { visibility: hidden; }
.arena-ballot-self { background: linear-gradient(90deg, #b16b4e, #f1b38c); }
.arena-ballot-opponent { background: linear-gradient(90deg, #c0dfe7, #577f8d); }
.arena-ballot-captions > :first-child { color: #ffd3b5; }
.arena-ballot-captions > :last-child { color: #c0e2ed; text-align: end; }
.arena-outcome {
  justify-items: center;
  padding: 9px 12px;
  border: 1px solid #6b573e;
  border-radius: 7px;
  background: #382b22;
  color: #f2d4b3;
  text-align: center;
  overflow-wrap: anywhere;
}
.arena-outcome[data-winner="opponent"] { border-color: #618793; background: #283f49; color: #c0e2ed; }
.arena-outcome[data-winner="tie"] { border-color: #545965; background: #2e323a; color: #e0e0e5; }
.arena-controls { min-width: 0; }
.arena-response { display: grid; gap: 7px; }
.arena-response h3 { color: var(--ink); font: 700 18px/1.3 var(--serif); }
.arena-response-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 420px; }
.arena-response-actions > .button { min-height: 44px; padding-inline: 7px; }

@supports (grid-template-rows: subgrid) {
  .arena-versus { row-gap: 0; }
  .arena-contender, .arena-contender[data-side="opponent"] { grid-row: 1 / span 3; }
  .arena-contender { grid-template-rows: subgrid; }
}

@media (max-width: 720px) {
  .social-header--arena { gap: 13px; }
  .social-header--arena p:not(.eyebrow) { max-width: 25em; }
  .social-header--leaderboard p:not(.eyebrow) { max-width: min(75%, 23em); }
  .social-header--leaderboard .button { padding-inline: 10px; }
  .leaderboard-sheet { --rank-columns: 32px minmax(0, 1fr) 72px 9px; --rank-padding: 10px; --rank-avatar-size: 36px; }
  .leaderboard-row { min-height: 62px; }
  .leaderboard-row .community-avatar { font-size: 18px; }
  .leaderboard-row .leaderboard-realm { padding-inline: 6px; }

  .arena-back, .social-page > .text-link[href="#leaderboard"] {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    min-height: 44px;
    padding: 0 8px 0 0;
  }
  .arena-detail { gap: 10px; }
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    min-height: unset;
    padding: 14px;
  }
  .profile-summary h1 { font-size: clamp(23px, 5vw, 32px); }
  .profile-hero .social-actions { display: grid; grid-column: 1 / -1; justify-content: stretch; }
  .profile-hero .button, .profile-feed .button { min-height: 44px; }
  .profile-post { gap: 10px; padding: 12px; border-radius: 10px; }
  .profile-post > .social-row { flex-wrap: nowrap; }
  .profile-comments { gap: 10px; padding-top: 3px; }
  .profile-comments summary {
    min-height: 44px;
    padding-block: 11px;
    color: var(--gold-light);
    cursor: pointer;
  }
  .profile-comments .social-list > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }
  .profile-post button.text-link { min-width: 44px; min-height: 44px; }

  .arena-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .arena-list-row { gap: 8px; padding: 10px; }
  .arena-list-title { font-size: 15px; }
  .arena-stage { gap: 9px; padding: clamp(7px, 2.4vw, 14px); }
  .arena-stage-heading h2 { font-size: clamp(21px, 4.5vw, 29px); }
  .arena-contender .arena-avatar { width: 25px; height: 25px; font-size: 12px; }
  .arena-contender-role { font-size: 10px; }
  .arena-evidence { height: clamp(220px, 44svh, 360px); aspect-ratio: auto; font-size: 12px; }
  .arena-contender-footer { flex-wrap: wrap; }
  .arena-contender .button { min-width: 0; min-height: 44px; padding: 6px; font-size: 12px; }
  .arena-vote-count { min-width: 0; font-size: clamp(18px, 5vw, 25px); }
  .arena-ballot-captions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    font-size: 12px;
  }
  .arena-controls :is(.button, .text-link) { min-height: 44px; }

}
