/* Battle League HQ | Layered faction hall, with individually positioned banners and lights.
   The wall, cloth, and spotlights are independent; no color or banners are baked into the wall. */
.faction-hall{width:100%;padding-bottom:28px;color:#f5f7fd}
.faction-hall-head{display:flex;justify-content:space-between;align-items:end;margin:9px 0 28px;gap:20px}
.faction-hall-eyebrow{font-size:11px;font-weight:950;letter-spacing:.19em;text-transform:uppercase;color:#ced3dd;margin:0 0 12px}
.faction-hall-head h2{font-size:clamp(30px,5.2vw,61px);font-weight:1000;line-height:1.02;letter-spacing:-.045em;margin:0 0 13px}
.faction-hall-head p:last-child{color:#bec2cf;font-size:clamp(14px,1.75vw,17px);margin:0}

/* The wall fills the stage, while four equal-width banner cells always line up. */
.faction-hall-stage{
  position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  width:100%;container-type:inline-size;
  overflow:hidden;border:1px solid #343744;border-radius:12px;
  background:repeating-linear-gradient(90deg,#17191f 0%,#21232b 24%,#101115 25%),
    #12141a;
  box-shadow:inset 0 0 110px #000a,0 25px 60px #0006;
}
.faction-hall-wall{
  position:absolute;inset:0;z-index:0;
  display:block;width:100%;height:100%;object-fit:cover;object-position:center;
  pointer-events:none;
}
.faction-hall-stage::before,.faction-hall-stage::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:1
}
.faction-hall-stage::before{
  background:linear-gradient(90deg,#030408ad,transparent 12%,transparent 88%,#030408b5),
    linear-gradient(0deg,#030408c9,transparent 25%,transparent 83%,#07080a78);
}
.faction-hall-stage::after{
  box-shadow:inset 0 0 34px #0007;
}
.faction-hall-choice.faction-theme-card{
  --mount-top:clamp(14px,4cqw,46px);
  --banner-height:min(43cqw,500px);
  --rod-cut:10.5%;
  --light-level:.43;
  --cloth-brightness:.84;
  position:relative;z-index:2;display:grid;justify-items:center;align-content:start;
  min-width:0;width:100%;padding:var(--mount-top) 0 clamp(12px,3cqw,34px);
  border:0;border-radius:0;color:#fff;font:inherit;cursor:pointer;text-align:center;
  background:transparent;isolation:isolate;
}
.faction-hall-choice.faction-theme-card:focus-visible{
  outline:3px solid #fff;outline-offset:-4px;
}
.faction-hall-choice[aria-pressed="true"] .faction-hall-label{
  border-color:var(--team-color);
}
.faction-hall-fixture{
  position:absolute;z-index:3;left:50%;top:var(--mount-top);translate:-50% -100%;
  width:clamp(12px,5cqw,65px);height:clamp(4px,1cqw,12px);
  border-radius:4px 4px 2px 2px;
  background:linear-gradient(#353641,#15161d 60%,var(--team-color));
  box-shadow:0 3px 12px var(--team-color);
  opacity:var(--light-level);transition:opacity .25s ease;
  pointer-events:none;
}
.faction-hall-spotlight{
  position:absolute;z-index:0;inset:var(--mount-top) 0 auto;height:var(--banner-height);
  pointer-events:none;opacity:var(--light-level);
  background:conic-gradient(from 155deg at 50% 0%,transparent,
    color-mix(in srgb,var(--team-color) 70%,transparent) 18deg 32deg,transparent 50deg);
  mask-image:linear-gradient(#000 0%,#0009 55%,transparent 100%);
  filter:blur(clamp(2px,1cqw,10px));transition:opacity .25s ease;
}
.faction-hall-banner-frame{
  position:relative;z-index:1;display:block;width:92%;height:var(--banner-height);
  pointer-events:none;
  filter:brightness(var(--cloth-brightness)) saturate(1.06) drop-shadow(2px 5px 5px #0009);
  transition:filter .25s ease;
}
/* The existing artwork includes the metal rod and brackets. Keep the upper
   strip fixed, and let the cloth below it sway around the attachment line. */
.faction-hall-banner-mount,.faction-hall-banner-swing{position:absolute;inset:0}
.faction-hall-banner-mount{z-index:1;clip-path:inset(0 0 calc(100% - var(--rod-cut)))}
.faction-hall-banner-swing{
  clip-path:inset(calc(var(--rod-cut) - 1px) 0 0);
  transform-origin:50% var(--rod-cut);
  animation:faction-hall-sway 7.4s ease-in-out infinite;
}
.faction-hall-choice:nth-of-type(2) .faction-hall-banner-swing{animation-duration:8.3s;animation-delay:-2.2s}
.faction-hall-choice:nth-of-type(3) .faction-hall-banner-swing{animation-duration:7.8s;animation-delay:-5.1s}
.faction-hall-choice:nth-of-type(4) .faction-hall-banner-swing{animation-duration:9.1s;animation-delay:-3.2s}
.faction-hall-banner-frame img{
  display:block;width:100%;height:100%;object-fit:contain;object-position:center top;
}
.faction-hall-banner-fallback{
  display:block;width:min(76%,calc(var(--banner-height) * .38));height:100%;margin:auto;
  clip-path:polygon(0 0,100% 0,100% 82%,50% 100%,0 82%);
  border-top:clamp(2px,.8cqw,9px) solid #555760;
  background:linear-gradient(90deg,#0007,#fff3 13%,#0005 29%,#fff3 62%,#0008 95%),var(--team-color);
}
@keyframes faction-hall-sway{
  0%,100%{transform:skewX(-.55deg)}
  50%{transform:skewX(.65deg)}
}
/* Keep labels and focus outlines at full contrast. Activation takes
   precedence over keyboard focus, then hover. */
@media(hover:hover) and (pointer:fine){
  .faction-hall-stage:not(:has(>.faction-hall-choice:is(:focus-visible,:active,.is-activating))):has(>.faction-hall-choice:hover)>.faction-hall-choice:not(:hover){
    --light-level:.30;--cloth-brightness:.73;
  }
  .faction-hall-stage:not(:has(>.faction-hall-choice:is(:focus-visible,:active,.is-activating)))>.faction-hall-choice:hover{
    --light-level:.98;--cloth-brightness:1.23;
  }
}
.faction-hall-stage:has(>.faction-hall-choice:focus-visible):not(:has(>.faction-hall-choice:is(:active,.is-activating)))>.faction-hall-choice:not(:focus-visible),
.faction-hall-stage:has(>.faction-hall-choice:is(:active,.is-activating))>.faction-hall-choice:not(:active,.is-activating){
  --light-level:.30;--cloth-brightness:.73;
}
.faction-hall-stage:has(>.faction-hall-choice:focus-visible):not(:has(>.faction-hall-choice:is(:active,.is-activating)))>.faction-hall-choice:focus-visible,
.faction-hall-stage:has(>.faction-hall-choice:is(:active,.is-activating))>.faction-hall-choice:is(:active,.is-activating){
  --light-level:1;--cloth-brightness:1.26;
}
.faction-hall-label{
  z-index:2;max-width:96%;margin-top:clamp(5px,2cqw,20px);padding:5px clamp(3px,1.5cqw,16px);
  border:1px solid #fff5;border-bottom:2px solid var(--team-color);border-radius:6px;
  background:#07090de8;box-shadow:0 6px 24px #0009;
  font-size:clamp(.8125rem,3.4cqw,1.1875rem);font-weight:900;line-height:1.2;
  overflow-wrap:anywhere;
}
.faction-hall-foot{display:flex;justify-content:space-between;gap:16px;align-items:center;margin:15px 2px 0;flex-wrap:wrap}
.faction-hall-foot span{font-size:13px;color:#c1c3cc}
.faction-hall-reset{background:none;border:0;color:#babdc6;padding:10px 1px;font:750 12px system-ui;text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.faction-hall-reset:hover,.faction-hall-reset:focus-visible{color:#fff}

@media(max-width:700px){
  .faction-hall-head{margin-bottom:18px}
  .faction-hall-stage{border-radius:8px}
  .faction-hall-foot{align-items:start}
}
@media(prefers-reduced-motion:reduce){
  .faction-hall-banner-swing{animation:none}
  .faction-hall-fixture,.faction-hall-spotlight,.faction-hall-banner-frame{transition:none}
}

.faction-history-dialog{
  position:fixed;inset:0;margin:auto;padding:0;
  width:min(760px,calc(100% - 24px));max-width:none;max-height:min(92dvh,980px);
  overflow:auto;overscroll-behavior:contain;
  background:linear-gradient(155deg,#22252d,#111319);
  border:1px solid #656975;border-radius:15px;color:#f6f7fc;
  box-shadow:0 28px 95px #000e;
  animation:faction-history-reveal .29s cubic-bezier(.19,.75,.3,1) both;
}
.faction-history-dialog::backdrop{
  background:#030408dc;-webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px);
}
.faction-history-close{
  position:sticky;top:13px;float:right;z-index:10;margin:13px 14px -57px 0;
  width:44px;height:44px;border:1px solid #666b78;border-radius:50%;
  background:#12141bec;color:#fff;cursor:pointer;font-size:28px;line-height:1;
}
.faction-history-close:hover,.faction-history-close:focus-visible{background:#3b3f4a;outline:2px solid #fff;outline-offset:2px}
.faction-popup-profile{padding:clamp(24px,5.2vw,48px);border-top:5px solid var(--faction-color)}
.faction-popup-kicker{font-size:11px;letter-spacing:.17em;text-transform:uppercase;color:var(--faction-color);font-weight:950;margin:6px 45px 14px 0}
.faction-popup-profile h2{font-size:clamp(34px,6vw,62px);line-height:1;letter-spacing:-.045em;margin:0 0 15px;color:#fff}
.faction-popup-profile h2 span{color:var(--faction-color)}
.faction-popup-featured{
  display:block;width:100%;aspect-ratio:8 / 3;object-fit:cover;object-position:center;
  margin:0 0 clamp(14px,3vw,22px);border:1px solid #4c505b;border-radius:10px;
}
.faction-popup-intro{color:#d1d3db;font-size:clamp(14px,2vw,17px);line-height:1.6;margin-bottom:23px}
.faction-popup-placements{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:22px 0 25px}
.faction-popup-placement{
  display:flex;flex-direction:column;justify-content:space-between;
  min-height:129px;padding:19px;border:1px solid color-mix(in srgb,var(--faction-color) 50%,#4f525c);
  border-radius:9px;background:linear-gradient(140deg,color-mix(in srgb,var(--faction-color) 14%,#24252e),#1b1d25 75%);
}
.faction-popup-placement>span{color:#c6cad3;font-size:12px;font-weight:850;letter-spacing:.06em;text-transform:uppercase}
.faction-popup-placement>strong{display:block;font-size:clamp(26px,4vw,38px);line-height:1.12;font-weight:1000;color:#fff;margin-top:13px}
.faction-popup-section{border-top:1px solid #424752;padding-top:22px;margin-top:23px}
.faction-popup-section h3{font-size:17px;letter-spacing:.04em;text-transform:uppercase;margin:0 0 15px}
.faction-popup-milestones,.faction-popup-contestants,.faction-popup-moments{display:grid;gap:10px}
.faction-popup-milestone{padding:14px 16px;background:#262933;border:1px solid #4a4e57;border-left:3px solid var(--faction-color);border-radius:7px}
.faction-popup-milestone span{display:block;font-size:11px;font-weight:800;color:#afb4c4;margin-bottom:5px}
.faction-popup-milestone h4,.faction-popup-moment h4{font-size:16px;margin:0 0 6px}
.faction-popup-milestone p,.faction-popup-moment p{color:#c8cad0;font-size:13px;margin:0}
.faction-popup-records{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.faction-popup-record{padding:15px;background:#262933;border:1px solid #4c505b;border-radius:8px}
.faction-popup-record span,.faction-popup-record small{display:block;color:#c3c6d0;font-size:12px}
.faction-popup-record strong{display:block;font-size:29px;margin:3px 0;color:var(--faction-color)}
.faction-popup-moment{display:flex;gap:14px;padding:10px;background:#252831;border:1px solid #434751;border-radius:8px}
.faction-popup-moment img{width:110px;max-height:115px;object-fit:cover;border-radius:5px}
.faction-popup-moment a,.faction-popup-contestant{color:#e4e7f2}
.faction-popup-contestant{display:flex;flex-wrap:wrap;justify-content:space-between;gap:7px;padding:13px 15px;background:#262933;border-radius:7px;border:1px solid #484c57;text-decoration:none}
.faction-popup-contestant:hover{border-color:var(--faction-color)}
.faction-popup-contestant span{font-size:12px;color:#bac0cc}
.faction-popup-roster{display:inline-flex;align-items:center;justify-content:center;margin-top:26px;padding:12px 17px;border-radius:7px;background:var(--faction-color);color:#091015;font-size:13px;font-weight:950;text-decoration:none}
.faction-popup-roster:hover{filter:brightness(1.12)}
/* Modal-only mobile rules; the layered stage rules are defined above. */
@media(max-width:700px){
 .faction-history-dialog{max-height:93dvh}
 .faction-popup-featured{aspect-ratio:2 / 1;border-radius:8px}
 .faction-popup-placements{gap:9px}
 .faction-popup-placement{padding:12px;min-height:115px}
 .faction-popup-placement>span{font-size:10px}
 .faction-popup-placement>strong{font-size:clamp(23px,6vw,30px)}
 .faction-popup-moment img{width:78px}
}
@media(max-width:375px){
 .faction-popup-placements{grid-template-columns:1fr}
 .faction-popup-placement{min-height:85px}
}

@keyframes faction-history-reveal{from{opacity:0;transform:translateY(15px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.faction-history-dialog{animation:none!important}}
