.hero-selection-page {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 28px;
  box-sizing: border-box;
  color: #e8ecea;
  background: radial-gradient(ellipse at 50% 45%, #34474a, #17252b 68%, #111d23);
}
.hero-selection-page button { font: inherit; cursor: pointer; }
.hero-selection-page button:focus-visible { outline: 3px solid #ffe0a1; outline-offset: 4px; }
.hero-selection-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex: none; margin-bottom: 18px; }
.hero-selection-header span { display: block; color: #d3b079; font-size: 13px; letter-spacing: .12em; }
.hero-selection-header h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.3; }
.hero-selection-header > button { padding: 11px 18px; min-height: 42px; border: 1px solid #7d806f; border-radius: 7px; background: #26373e; color: #f2e4c8; }
.hero-selection-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px minmax(180px, 1fr) 330px; gap: 24px; }
.hero-selection-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; overflow-y: auto; padding: 3px; min-height: 0; scrollbar-color: #7c8d87 #192b31; }
.hero-selection-tile { min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; border: 1px solid #677b78; border-radius: 7px; color: #eee8da; background: #24363d; text-align: center; }
.hero-selection-tile img { width: 100%; height: 89px; object-fit: cover; object-position: center 15%; background: #334a4f; }
.hero-selection-tile > span { display: block; padding: 7px 4px; }
.hero-selection-tile b { display: block; font-size: 16px; }
.hero-selection-tile small { display: block; font-size: 10px; color: #cfdbd5; line-height: 1.5; margin-top: 3px; }
.hero-selection-tile[aria-pressed="true"] { border: 2px solid #edce8b; box-shadow: 0 0 0 2px #725a31, 0 0 20px #e9c87833; }
.hero-selection-tile.is-occupied { border-style: dashed; }
.hero-selection-tile.is-occupied small { color: #e6b591; }
.hero-selection-stage { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 8px 40px; isolation: isolate; }
.hero-selection-aura { position: absolute; inset: 14% 0 0; z-index: -1; background: radial-gradient(ellipse, #bbba8240, transparent 67%); }
.hero-selection-portrait { width: 100%; height: 100%; min-height: 0; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 16px 22px #0008); }
.hero-selection-stage-label { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); white-space: nowrap; border: 1px solid #b9ad77; border-radius: 24px; padding: 6px 18px; color: #f1d89e; background: #1a2b31; font-size: 14px; }
.hero-selection-description { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 16px 0; scrollbar-color: #7c8d87 #192b31; }
.hero-selection-element { display: block; font-size: 13px; color: #ddbc7d; letter-spacing: .1em; }
.hero-selection-description h2 { margin: 10px 0 18px; font-size: 36px; line-height: 1.3; color: #f3e0b8; }
.hero-selection-description h2 small { display: block; color: #adbfba; font-size: 14px; font-weight: normal; margin-top: 8px; }
.hero-selection-description p { line-height: 1.75; margin: 0 0 15px; font-size: 14px; color: #d1dbd7; }
.hero-selection-affinity { padding: 13px; background: #24373d; border: 1px solid #526a68; border-radius: 7px; }
.hero-selection-affinity strong { color: #ffdc8c; font-size: 17px; }
.hero-selection-description blockquote { margin: 20px 0; border-left: 3px solid #ddbb74; padding: 4px 14px; color: #eed3a1; font-size: 17px; line-height: 1.65; }
.hero-selection-combos { border-top: 1px solid #556968; padding-top: 18px; margin-top: 22px; }
.hero-selection-combos h3 { margin: 0 0 13px; font-size: 18px; color: #edd09a; }
.hero-selection-combos article { padding: 12px 13px; background: #22353c; border-radius: 6px; margin: 0 0 12px; }
.hero-selection-combos strong { display: block; color: #e7d6b2; font-size: 14px; margin-bottom: 8px; }
.hero-selection-combos article p { font-size: 12px; margin: 0; }
.hero-selection-combos > small { font-size: 12px; line-height: 1.5; color: #b4c7bf; }
.hero-selection-footer { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 16px; margin-top: 14px; border-top: 1px solid #556968; }
.hero-selection-footer p { font-size: 13px; line-height: 1.6; color: #c3d4cc; margin: 0; }
.hero-selection-footer button { min-height: 48px; min-width: 220px; padding: 12px 24px; border: 1px solid #efd59a; border-radius: 8px; color: #26322e; background: linear-gradient(#efd398, #c6a15b); font-weight: bold; }
.hero-selection-footer button:disabled { cursor: default; color: #a5b5ad; border-color: #556a61; background: #33453e; }
.hero-selection-footer .hero-selection-error { margin-top: 8px; color: #ffc2af; }
.hero-selection-seats { flex: none; display: flex; gap: 10px; margin-bottom: 18px; }
.hero-selection-seats button { min-height: 40px; padding: 8px 16px; color: #dce9df; border: 1px solid #758477; border-radius: 7px; background: #2d3f43; }
.hero-selection-seats button[aria-pressed="true"] { color: #f6d696; border-color: #dfba75; }
.hero-selection-seats small { margin-left: 10px; color: #b9cbc2; }
@media (max-width: 850px) {
  .hero-selection-page { padding: 18px; }
  .hero-selection-layout { grid-template-columns: 150px minmax(140px, 1fr) 265px; gap: 14px; }
  .hero-selection-tile img { height: 75px; }
  .hero-selection-description h2 { font-size: 29px; }
  .hero-selection-header { margin-bottom: 12px; }
  .hero-selection-header h1 { font-size: 24px; }
}
@media (max-width: 650px) {
  .hero-selection-page { overflow-y: auto; padding: 14px; }
  .hero-selection-layout { flex: none; grid-template-columns: 135px minmax(0, 1fr); gap: 14px; min-height: 430px; }
  .hero-selection-roster { grid-row: span 2; overflow: visible; }
  .hero-selection-stage { height: 340px; }
  .hero-selection-description { grid-column: 2; overflow: visible; padding-right: 0; }
  .hero-selection-header h1 { font-size: 23px; }
  .hero-selection-header > button { padding: 8px 12px; font-size: 12px; }
  .hero-selection-footer { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero-selection-footer button { width: 100%; min-width: 0; }
  .hero-selection-seats { gap: 6px; flex-wrap: wrap; }
  .hero-selection-seats button { padding: 8px 10px; }
  .hero-selection-seats small { display: block; margin-left: 0; margin-top: 4px; font-size: 11px; }
}
@media (max-height: 500px) and (min-width: 651px) {
  .hero-selection-page { padding: 12px 18px; }
  .hero-selection-header { margin-bottom: 8px; }
  .hero-selection-header h1 { font-size: 22px; margin-top: 2px; }
  .hero-selection-roster { overflow-y: auto; }
  .hero-selection-footer { padding-top: 8px; margin-top: 8px; }
  .hero-selection-seats { margin-bottom: 8px; }
}
.hero-selection-page button:disabled { cursor: default; }
.hero-selection-roster button:disabled, .hero-selection-header button:disabled, .hero-selection-seats button:disabled { opacity: .65; }

.hero-selection-avatar{position:relative;width:100%;height:89px;overflow:hidden;background:#334a4f}
.hero-selection-avatar img{position:absolute;left:0;top:0;width:100%;height:180%;object-fit:cover;object-position:center top;background:transparent}
@media(max-width:850px){.hero-selection-avatar{height:75px}}
@media(max-width:650px){
  .hero-selection-page{overflow:hidden}
  .hero-selection-layout{flex:1;min-height:0;overflow-y:auto;grid-template-rows:350px auto;align-content:start}
  .hero-selection-roster{grid-row:1;min-height:0;overflow-y:auto}
  .hero-selection-stage{height:350px}
  .hero-selection-description{grid-column:1 / -1;overflow:visible;padding:8px 0}
  .hero-selection-footer{background:#17272d;padding-top:10px;margin-top:8px}
}

.hero-selection-description h2{font-size:32px;margin:6px 0 12px}
.hero-selection-description h2 small{margin-top:4px}
.hero-selection-description p{font-size:13px;line-height:1.6;margin-bottom:12px}
.hero-selection-affinity{padding:9px}
.hero-selection-description blockquote{font-size:14px;line-height:1.5;margin:10px 0;padding:2px 10px}
.hero-selection-combos{margin-top:14px;padding-top:12px}
.hero-selection-combos h3{margin-bottom:10px;font-size:16px}
.hero-selection-combos article{padding:9px 10px;margin-bottom:8px}
.hero-selection-combos article p{font-size:11px;margin-bottom:0}

/* The back control overlays the page instead of reserving a header row. */
.hero-selection-accessible-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.hero-selection-page{padding-top:58px}
.hero-selection-layout{overflow:hidden}
@media(max-width:650px){
 .hero-selection-page{padding:54px 12px 10px;overflow:hidden}
 .hero-selection-layout{flex:1;min-height:0;grid-template-columns:82px minmax(0,32%) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:8px;overflow:hidden}
 .hero-selection-roster{grid-column:1;grid-row:1;grid-template-columns:1fr;overflow-y:auto;min-height:0}
 .hero-selection-stage{grid-column:2;grid-row:1;height:100%;padding:0 0 34px;box-sizing:border-box}
 .hero-selection-description{grid-column:3;grid-row:1;overflow-y:auto;min-height:0;padding:0 4px 12px}
 .hero-selection-description h2{font-size:24px}
 .hero-selection-stage-label{font-size:11px;padding:4px 8px}
 .hero-selection-footer{flex-direction:row;align-items:center;gap:8px;margin-top:6px;padding-top:6px}
 .hero-selection-footer>div{flex:1;min-width:0}
 .hero-selection-footer button{width:auto;min-width:0;padding:8px 12px;font-size:13px}
}
/* Preserve the paired roster even on narrow screens. */
@media(max-width:650px){
 .hero-selection-layout{grid-template-columns:112px minmax(0,30%) minmax(0,1fr)}
 .hero-selection-roster{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .hero-selection-avatar{height:54px}
 .hero-selection-tile>span{padding:4px 2px}
 .hero-selection-tile b{font-size:12px}
 .hero-selection-tile small{font-size:9px}
}

/* Give compact progress enough room without covering the portrait or identity. */
.hero-selection-layout{grid-template-columns:280px minmax(180px,1fr) 330px}
.hero-selection-tile>.hero-selection-caption{display:flex;flex-direction:column;padding:7px 6px;min-width:0;text-align:left}
.hero-selection-caption .hero-unlock-status{display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;gap:2px;margin-bottom:5px;min-height:32px;color:#e3c68e;font-size:10px;line-height:1.5;text-align:right;overflow-wrap:anywhere}
.hero-selection-caption .hero-unlock-status.is-unlocked{color:#b5d0ba}
.hero-selection-caption .hero-unlock-status>span{max-width:100%}
@media(max-width:1000px) and (min-width:651px){
 .hero-selection-layout{grid-template-columns:230px minmax(140px,1fr) 265px;gap:14px}
}
@media(max-width:650px){
 .hero-selection-layout{grid-template-columns:112px minmax(0,30%) minmax(0,1fr)}
 .hero-selection-roster{grid-template-columns:1fr}
 .hero-selection-avatar{height:75px}
 .hero-selection-tile>.hero-selection-caption{padding:6px 5px}
}
