/* Website Factions page (owner, 2026-10-22, redesigned 2026-10-23): website layout around the game's own art.
   Cards keep the in-game library styles (they need the #wb-lobby / #wb-faction-library containers); crests, ability
   frames, trait icons and tooltips use the game's artwork. Everything else here is page layout. */
.fx-page{padding-top:28px;--fx-frame:url('./skin/site/frame-panel.png?art=a551c9b62e1f9f32');--fx-line:url('./skin/site/frame-gold.png?art=3083174fd77c8bcf')}

/* Faction tiles and trait chips use the owner's frame art (owner, 2026-10-23, qa/prepare-site-art.py): the silver
   tutorial-card frame with a dark auction-house panel baked inside, as one nine-slice like the game's Find Match frame,
   and the gold line from the same sheet on hover and focus. Other sections stay open. No rounded boxes or tints. */
.fx-tile,.fx-trait{position:relative;border:16px solid transparent;border-radius:0;
  border-image:var(--fx-frame) 32 fill / 16px stretch;background:none;box-shadow:none}
.fx-tile::after,.fx-trait::after{content:'';position:absolute;inset:-16px;border:16px solid transparent;border-image:var(--fx-line) 32 / 16px stretch;
  opacity:0;transition:opacity .2s ease;pointer-events:none}
.fx-tile:hover::after,.fx-tile:focus-visible::after,.fx-trait:hover::after,.fx-trait:focus-visible::after{opacity:1}
.fx-tile:focus-visible,.fx-trait:focus-visible{outline:0}
.fx-root{max-width:1180px;margin:0 auto}
.fx-eyebrow{margin:0 0 6px;font:700 12px/1.2 var(--body);letter-spacing:2.2px;text-transform:uppercase;color:#c9a95c}

/* Crest: the faction icon inside the game's crest ring. */
.fx-crest{position:relative;display:inline-block;flex:none;width:64px;height:64px;border-radius:50%}
/* Many crests are square spell icons with a silver border: the icon fills the whole crest and only the circle inside
   the gold ring shows, so that border always falls outside it. */
.fx-crest img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;clip-path:circle(41% at 50% 50%)}
.fx-crest::after{content:'';position:absolute;inset:0;background:url('./skin/faction-crest-ring.png') center/100% 100% no-repeat;pointer-events:none}

/* ---------- Gallery ---------- */
.fx-gallery-head{max-width:640px;margin:10px auto 34px;text-align:center}
.fx-gallery-head h1{margin:0 0 10px;font:400 48px/1.05 var(--heading);color:var(--title)}
.fx-gallery-head p:last-child{margin:0;color:var(--excerpt);font-size:17px;line-height:1.6}
.fx-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:16px}
.fx-tile{display:flex;flex-direction:column;align-items:center;gap:10px;height:100%;box-sizing:border-box;padding:10px 0 6px;
  text-align:center;text-decoration:none;color:var(--title)}
.fx-tile .fx-crest{width:78px;height:78px;filter:drop-shadow(0 4px 8px rgba(0,0,0,.5));transition:transform .2s ease}
.fx-tile-name{position:relative;font:400 17px/1.2 var(--heading)}
.fx-tile-leader{position:relative;font-size:13px;color:var(--date)}
.fx-tile:hover .fx-crest,.fx-tile:focus-visible .fx-crest{transform:scale(1.05)}
.fx-tile:hover .fx-tile-name,.fx-tile:focus-visible .fx-tile-name{color:var(--title-gold)}

/* ---------- Faction switcher ---------- */
.fx-switcher{display:flex;align-items:center;gap:14px;margin:0 0 22px}
.fx-back{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;color:#cfc6b4;text-decoration:none;font:600 14px/1 var(--body)}
.fx-back::before{content:'←'}
.fx-back:hover{color:var(--gold)}
/* Both ends fade (owner, 2026-10-23); the inline padding keeps the first and last crests clear of the fade at either end. */
.fx-switcher ul{list-style:none;margin:0;padding:10px 28px;display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#4a4234 transparent;
  mask-image:linear-gradient(90deg,transparent,#000 28px,#000 calc(100% - 28px),transparent)}
.fx-switcher a[aria-label]{display:flex;padding:3px;line-height:0;border-radius:50%;transition:transform .15s ease}
.fx-switcher .fx-crest{width:40px;height:40px;filter:grayscale(.35) brightness(.85);transition:filter .15s ease,box-shadow .15s ease}
.fx-switcher a[aria-label]:hover .fx-crest,.fx-switcher a[aria-current] .fx-crest{filter:none}
.fx-switcher a[aria-label]:hover{transform:translateY(-2px)}
/* The selected crest glows gold around its own round ring. */
.fx-switcher a[aria-current] .fx-crest{box-shadow:0 0 0 1px rgba(255,226,150,.7),0 0 10px 2px rgba(240,196,96,.75),0 0 20px 4px rgba(240,196,96,.3)}

/* ---------- Hero banner ---------- */
/* The banner, leader abilities and faction rule are open sections without frames (owner, 2026-10-23). */
.fx-hero{display:grid;grid-template-columns:auto minmax(0,1fr);gap:36px;align-items:center;padding:6px 0}
.fx-hero-crest.fx-crest{width:150px;height:150px;filter:drop-shadow(0 12px 28px rgba(0,0,0,.6))}
.fx-hero h1{margin:0 0 8px;font:400 52px/1.05 var(--heading);color:#fff;text-shadow:0 4px 24px rgba(0,0,0,.5)}
.fx-hero-leader{margin:0 0 14px;color:#cfc6b4;font-size:16px}
.fx-hero-leader strong{color:var(--title-gold);font-weight:600}
.fx-hero-passive{max-width:640px;margin:0 0 18px;color:#e6ddcb;font-size:16px;line-height:1.6}

/* ---------- Sections ---------- */
.fx-section{margin-top:46px}
.fx-section-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 20px;margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid var(--rule)}
.fx-section-head h2{margin:0;font:400 30px/1.15 var(--heading);color:var(--title-gold)}
.fx-section-head p{margin:0;color:var(--date);font-size:14.5px}

/* Leader abilities: the ability icon in the game's ability frame. */
.fx-abilities{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
.fx-ability{display:flex;gap:12px;align-items:flex-start}
.fx-ability-icon{position:relative;flex:none;width:60px;aspect-ratio:135/129;background:url('./skin/play-flow/ability-frame.png?art=e20a36a15ee17664') center/100% 100% no-repeat}
.fx-ability-icon>img{position:absolute;left:calc(36 / 135 * 100%);top:calc(14 / 129 * 100%);width:calc(86 / 135 * 100%);height:calc(86 / 129 * 100%);object-fit:cover}
.fx-ability-unlock{margin:0 0 2px;color:#a8a090;font:400 12px/1.3 var(--body)}
.fx-ability h3{margin:0 0 4px;font:400 17px/1.2 var(--heading);color:#fff}
.fx-ability p:last-child{margin:0;color:var(--excerpt);font-size:14px;line-height:1.5}

/* Icon frame used by traits and enchantments (the game's square icon border). */
.fx-icon-frame{position:relative;display:inline-flex;flex:none;align-items:center;justify-content:center;width:44px;height:44px;border-radius:6px;background:#100e0b;box-shadow:inset 0 0 0 1px #55524c,0 2px 8px rgba(0,0,0,.4)}
.fx-icon-frame img{width:36px;height:36px;object-fit:cover;border-radius:3px}
.fx-icon-large{width:60px;height:60px}.fx-icon-large img{width:50px;height:50px}

.fx-rule{margin-bottom:20px}
.fx-rule-head{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.fx-rule-head h3{margin:0;font:400 24px/1.2 var(--heading);color:#fff}
.fx-rule-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.fx-rule-steps li{display:flex;gap:12px;padding:10px 12px;background:rgba(0,0,0,.28)}
.fx-rule-steps span{flex:none;min-width:14px;color:#a8a090;font:400 15px/1.5 var(--body)}
.fx-rule-steps p{margin:0;color:#d4cbba;font-size:14.5px;line-height:1.5}

/* Traits always share one row (owner, 2026-10-23), up to the ten some factions have: equal columns, the icon above
   the name and steps. Narrow chips drop the name, then the steps; the tooltip and aria-label keep both. */
.fx-traits{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px}
.fx-traits .fx-trait{container-type:inline-size;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;
  padding:2px 0;border-width:10px;border-image-width:10px;color:inherit;text-align:center;font:inherit}
.fx-traits .fx-trait::after{inset:-10px;border-width:10px;border-image-width:10px}
.fx-trait .fx-icon-frame{width:min(36px,100%);height:auto;aspect-ratio:1}
.fx-trait .fx-icon-frame img{width:84%;height:84%}
.fx-trait-text{display:grid;justify-items:center;gap:2px;min-width:0;max-width:100%}
.fx-trait-text strong{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:400 clamp(11px,16cqi,14px)/1.2 var(--heading);color:#fff}
.fx-trait-text small{white-space:nowrap;color:var(--date);font-size:clamp(10px,13cqi,12px);letter-spacing:.3px}
@container (max-width:54px){.fx-trait-text strong{display:none}}
@container (max-width:44px){.fx-trait-text{display:none}}
@media (max-width:768px){
  .fx-traits{gap:4px}
  .fx-traits .fx-trait{border-width:6px;border-image-width:6px}
  .fx-traits .fx-trait::after{inset:-6px;border-width:6px;border-image-width:6px}
}

/* Cards: the in-game library cards, in plain page sections. */
.fx-page #wb-lobby{position:static!important;inset:auto!important;z-index:auto!important;display:block!important;padding:0!important;background:none!important;
  backdrop-filter:none!important;clip-path:none!important;pointer-events:auto!important;min-width:0;text-shadow:none}
.fx-page #wb-lobby #wb-faction-library{position:static!important;inset:auto!important;z-index:auto!important;display:block!important;padding:0!important;background:none!important;backdrop-filter:none!important}
/* The game centres its dialogs with place-items, which browsers now apply to block children too. */
.fx-page #wb-lobby,.fx-page #wb-lobby #wb-faction-library{place-items:normal!important;justify-items:normal!important;align-items:normal!important}
.fx-tier+.fx-tier{margin-top:30px}
.fx-tier-title{margin:0 0 16px;font:400 22px/1.2 var(--heading);color:#fff;text-shadow:none}
#wb-lobby#wb-lobby#wb-lobby #wb-faction-library.fx-cards .wb-library-card-grid{grid-template-columns:repeat(auto-fill,var(--wb-library-card-w,150px))!important;gap:18px!important;justify-content:start}

/* Enchantments */
.fx-enchant-group+.fx-enchant-group{margin-top:26px}
.fx-group-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;margin-bottom:12px}
.fx-group-head h3{margin:0;font:400 19px/1.2 var(--heading);color:#fff}
.fx-group-head p{margin:0;color:var(--date);font-size:13.5px}
.fx-enchant-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
/* Enchantments are plain rows: icon and text, no frame (owner, 2026-10-23). */
.fx-enchant{display:flex;gap:14px;align-items:flex-start;padding:6px 0}
.fx-enchant h4{margin:0 0 4px;font:400 16px/1.25 var(--heading);color:#f1e6cc}
.fx-enchant p{margin:0;color:var(--excerpt);font-size:14px;line-height:1.5}
.fx-enchant.is-rare h4{color:#7fb6ff}
.fx-enchant.is-legendary h4{color:#ffb15c}

/* Explore these other factions: a small row of gallery tiles at the end of each faction. */
.fx-related{margin-top:56px;padding-top:26px;border-top:1px solid var(--rule)}
.fx-related h2{margin:0 0 14px;font:400 20px/1.2 var(--heading);color:var(--title)}
.fx-related .fx-grid{grid-template-columns:repeat(3,minmax(0,200px))}

@media (max-width:900px){
  .fx-hero{grid-template-columns:minmax(0,1fr);justify-items:start;gap:20px}
  .fx-hero-crest.fx-crest{width:110px;height:110px}
  .fx-hero h1{font-size:40px}
}
@media (max-width:768px){
  .fx-page{padding-top:18px}
  .fx-gallery-head h1{font-size:36px}
  .fx-grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px}
  .fx-tile,.fx-trait{border-width:12px;border-image-width:12px}
  .fx-tile::after,.fx-trait::after{inset:-12px;border-width:12px;border-image-width:12px}
  .fx-tile{padding:6px 0 4px;gap:7px}
  .fx-tile .fx-crest{width:60px;height:60px}
  .fx-tile-name{font-size:14px}
  .fx-tile-leader{display:none}
  .fx-related .fx-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .fx-switcher{flex-direction:column;align-items:stretch;gap:8px}
  .fx-back{align-self:flex-start}
  .fx-switcher ul{margin:0 -16px;padding:10px 28px}
  .fx-hero h1{font-size:34px}
  .fx-section-head h2{font-size:24px}
  .fx-abilities{grid-template-columns:minmax(0,1fr)}
  .fx-ability-icon{width:54px}
  .fx-enchant-grid,.fx-rule-steps{grid-template-columns:minmax(0,1fr)}
  #wb-lobby#wb-lobby#wb-lobby #wb-faction-library.fx-cards .wb-library-card-grid{gap:12px!important;justify-content:center}
}
@media (prefers-reduced-motion:reduce){.fx-tile::after,.fx-trait::after,.fx-tile .fx-crest{transition:none}}

/* The same two enchant qualities as the game; Epics are listed first by factions-page.mjs. */
.fx-enchant.is-epic h4{color:#c796ff}
.fx-enchant.is-basic h4{color:#73b9ff}
.fx-enchant.is-epic .fx-icon-frame{outline:1px solid #ab70ed}
.fx-enchant.is-basic .fx-icon-frame{outline:1px solid #419cff}
