/* Summoner Wars Browser.
   Dark, painterly and lit by each faction's own colour: the page sits on the
   online game's nebula sky, every card is the official card face with its text
   set back on top at the positions Plaid Hat's own client uses, and --accent is
   re-pointed per army so one stylesheet themes all 32 of them. */

:root {
  color-scheme: dark;
  --bg: #0b0a10;
  --bg-2: #13111b;
  --panel: rgba(19, 17, 27, .74);
  --panel-solid: #16131f;
  --line: rgba(255, 232, 196, .12);
  --line-strong: rgba(255, 232, 196, .24);
  --text: #f4ecdf;
  --muted: #b3a995;
  --faint: #7d7566;
  --gold: #e6bd6a;
  --accent: #e6bd6a;
  --accent-soft: rgba(230, 189, 106, .18);
  --f-display: "Grenze", "Georgia", serif;
  --f-card: "Germania One", "Grenze", "Georgia", serif;
  --f-sc: "Alegreya SC", "Georgia", serif;
  --f-body: "Alegreya Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1320px;
  --bar: 58px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 12px); }
body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Sky: the online game's nebula, tinted by the army in view ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    linear-gradient(rgba(11, 10, 16, .55), rgba(11, 10, 16, .92) 70%),
    url(../img/ui/nebula.webp) center / cover,
    var(--bg);
  transition: background-color .6s;
}
.embers { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }

/* ---- Top bar ------------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  height: calc(var(--bar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: linear-gradient(rgba(11, 10, 16, .92), rgba(11, 10, 16, .7));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.bar-hub {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13px/1 var(--f-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.bar-hub::before { content: "\2190"; font-size: 15px; }
.bar-hub:hover { color: var(--text); }
.bar-home img { height: 40px; width: auto; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .6)); transition: transform .3s var(--ease), opacity .3s; }
/* On the home page the hero carries the big logo; the bar's appears once it scrolls away. */
.hero-in-view .bar-home img { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.bar-home:hover img { transform: scale(1.05) rotate(-1deg); }
.bar-crumb {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font: 700 15px/1 var(--f-sc);
  color: var(--muted);
}
.bar-crumb a { text-decoration: none; }
.bar-crumb a:hover { color: var(--text); }
.bar-crumb img { width: 26px; height: 26px; }
.bar-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
@media (max-width: 640px) {
  .bar { grid-template-columns: auto 1fr auto; }
  .bar-home { justify-self: center; }
  .bar-home img { height: 32px; }
  .bar-crumb span { display: none; }
}

main { min-height: 80vh; outline: none; }
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---- Home: hero ---------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: min(76vh, 760px);
  padding: 64px var(--gutter) 96px;
  overflow: hidden;
  text-align: center;
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url(../img/ui/splash.webp) center 30% / cover;
  transform: scale(1.06);
  animation: drift 28s ease-in-out infinite alternate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 50% 48%, rgba(11, 10, 16, .78), rgba(11, 10, 16, .25) 70%, transparent),
    linear-gradient(rgba(11, 10, 16, .25), rgba(11, 10, 16, .1) 40%, var(--bg) 97%);
}
@keyframes drift { to { transform: scale(1.12) translate(-1.5%, 1%); } }
.hero-logo {
  width: min(560px, 82vw);
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .7));
  animation: rise 1s var(--ease) both;
}
.hero-kicker {
  margin: 18px 0 0;
  font: 700 clamp(15px, 2.2vw, 21px)/1.2 var(--f-sc);
  letter-spacing: .14em;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9);
  animation: rise 1s .12s var(--ease) both;
}
.hero-count {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font: 500 15px/1.3 var(--f-body);
  color: var(--text);
  text-shadow: 0 2px 8px #000;
  animation: rise 1s .24s var(--ease) both;
}
.hero-count b { font: 800 26px/1 var(--f-display); color: var(--text); margin-right: 6px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---- Home: filters ------------------------------------------------------- */

.filters {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 14px;
  margin-top: -54px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  font: 500 17px/1.2 var(--f-body);
  color: var(--text);
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(230, 189, 106, .15); }
.search-clear {
  position: absolute;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.filter-label { font: 700 13px/1 var(--f-sc); letter-spacing: .1em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 13px;
  font: 600 14px/1 var(--f-body);
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: #1b1408; background: var(--gold); border-color: var(--gold); }
.symbols { display: flex; flex-wrap: wrap; gap: 6px; }
.sym-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.sym-toggle:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.sym-toggle[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }
.sym-toggle[aria-pressed="true"] .sym { background: #1b1408; }
.sym {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  vertical-align: -.18em;
}
.sym-toggle .sym { width: 20px; height: 20px; background: var(--text); }
.filter-hint { margin: 0; font-size: 14px; color: var(--muted); }
.filter-hint b { color: var(--text); font-weight: 600; }

.status { margin: 28px 0 14px; font: 700 15px/1 var(--f-sc); letter-spacing: .1em; color: var(--muted); }

/* ---- Home: army tiles ----------------------------------------------------- */

.armies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 188px), 1fr));
  gap: clamp(12px, 1.6vw, 22px);
  margin: 0 0 64px;
  padding: 0;
  list-style: none;
}
.tile {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  display: block;
  aspect-ratio: 3 / 4.3;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 20%, color-mix(in srgb, var(--accent) 45%, #1a1520), #0d0b12 75%);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
  animation: tile-in .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes tile-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.tile:hover, .tile:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .55), 0 0 0 1px var(--accent), 0 0 46px color-mix(in srgb, var(--accent) 45%, transparent);
}
.tile-portrait {
  position: absolute;
  inset: 0 0 18% 0;
  z-index: -1;
  width: 100%;
  height: 82%;
  object-fit: cover;
  object-position: 50% 12%;
  transition: transform .6s var(--ease), filter .6s;
  filter: saturate(.95);
}
.tile:hover .tile-portrait { transform: scale(1.07); filter: saturate(1.15); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(transparent 38%, rgba(9, 8, 13, .65) 62%, #09080d 86%);
}
.tile-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(60% 45% at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .22), transparent 70%);
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity .3s;
  pointer-events: none;
}
.tile:hover .tile-glare { opacity: 1; }
.tile-body {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 10px 14px;
  text-align: center;
}
.tile-logo {
  width: 46px;
  height: 46px;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 70%, transparent)) drop-shadow(0 3px 4px #000);
  transition: transform .4s var(--ease);
}
.tile:hover .tile-logo { transform: translateY(-3px) scale(1.08); }
.tile-name {
  margin: 0;
  font: 800 clamp(21px, 2.1vw, 26px)/.95 var(--f-display);
  letter-spacing: .01em;
  text-shadow: 0 2px 10px #000;
}
.tile-summoner { font: 700 13px/1.2 var(--f-sc); letter-spacing: .06em; color: var(--muted); }
.tile-syms { display: flex; gap: 9px; margin-top: 4px; color: color-mix(in srgb, var(--accent) 55%, var(--text)); font-size: 16px; }
.tile-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  font: 700 11px/1 var(--f-sc);
  letter-spacing: .08em;
  color: var(--text);
  background: rgba(9, 8, 13, .72);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  backdrop-filter: blur(6px);
}
.tile-badge.new { color: #1b1408; background: var(--gold); border-color: var(--gold); }
.tile.mercs { background: radial-gradient(120% 80% at 50% 20%, #5a4a3a, #0d0b12 75%); }
.tile-cutouts {
  position: absolute;
  inset: 8% 0 26%;
  z-index: -1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tile-cutouts img { height: 88%; width: auto; margin: 0 -14%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.tile-cutouts img:nth-child(2) { height: 100%; z-index: 1; }

.empty { margin: 30px 0 70px; padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 16px; }

/* ---- Search results (cards) ----------------------------------------------- */

.found:not(:empty) { margin-bottom: 64px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.results-head h2 { margin: 0; font: 800 30px/1 var(--f-display); }
.results-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---- Card: official face + text set over it ------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: clamp(16px, 2vw, 26px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.card-slot { position: relative; display: grid; gap: 8px; align-content: start; }
.cards.solo { grid-template-columns: minmax(0, 640px); }
.card {
  --fit: 1;
  --name-fit: 1;
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1050 / 750;
  padding: 0;
  overflow: hidden;
  container-type: inline-size;
  border: 0;
  border-radius: 2.6cqw;
  background: #1a1620;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .5);
  text-align: left;
  cursor: zoom-in;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.card:hover { box-shadow: 0 22px 44px rgba(0, 0, 0, .6), 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 38px color-mix(in srgb, var(--accent) 30%, transparent); }
.card-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .16) 46%, transparent 58%);
  background-size: 250% 100%;
  background-position: var(--sheen, 120%) 0;
  mix-blend-mode: soft-light;
  pointer-events: none;
  transition: background-position .7s var(--ease);
}
.card:hover::after { --sheen: -20%; }
.card-face { position: absolute; inset: 0; color: #000; pointer-events: none; }
.c-name {
  position: absolute;
  top: 5%;
  left: 3%;
  width: 55%;
  height: 13%;
  display: flex;
  align-items: center;
  padding: 0 0 2% 1.5%;
  overflow: hidden;
  white-space: nowrap;
  font: 400 calc(7.955cqw * var(--name-fit))/1 var(--f-card);
  letter-spacing: .01em;
}
.c-type {
  position: absolute;
  top: 16%;
  left: 3%;
  width: 53.4%;
  height: 5.5%;
  display: flex;
  align-items: center;
  gap: .5em;
  padding-left: 1.5%;
  overflow: hidden;
  white-space: nowrap;
  font: 700 calc(3.404cqw * var(--type-fit, 1))/1 var(--f-sc);
}
.c-type i { font-style: normal; font-size: .8em; opacity: .7; }
.c-num {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: 400 7.4cqw/1 var(--f-card);
  text-shadow: 0 0 .5cqw #000, .3cqw .3cqw 0 #000, -.12cqw -.12cqw 0 #000;
}
.c-cost { left: 5.6%; top: 24.24%; width: 4.9%; height: 9.06%; }
.c-life { left: 19%; top: 24.24%; width: 7%; height: 9.06%; }
.card.epic .c-cost { left: 19%; }
.card.epic .c-life { left: 33%; }
.c-str { left: 68%; top: 70.17%; width: 8%; height: 23.33%; font-size: 11.84cqw; }
.c-text {
  position: absolute;
  left: 3%;
  bottom: 5%;
  width: 49%;
  height: 61%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(2.2cqw * var(--fit));
  padding: 0 1.5%;
  overflow: hidden;
  font: 400 calc(3.4595cqw * var(--fit))/1.08 var(--f-body);
}
.card.push-left .c-text { width: 38%; }
.c-text p { margin: 0; }
.c-ab b {
  display: block;
  margin: 0 0 calc(.9cqw * var(--fit));
  font: 700 calc(4.44cqw * var(--fit))/1 var(--f-sc);
}
.c-active { font: 700 calc(3.7cqw * var(--fit))/1 var(--f-sc); letter-spacing: .06em; text-transform: uppercase; }
.die {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin: 0 .05em;
  vertical-align: -.2em;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.die-melee { -webkit-mask-image: url(../img/symbols/die-melee.webp); mask-image: url(../img/symbols/die-melee.webp); }
.die-ranged { -webkit-mask-image: url(../img/symbols/die-ranged.webp); mask-image: url(../img/symbols/die-ranged.webp); }
.die-special { -webkit-mask-image: url(../img/symbols/die-special.webp); mask-image: url(../img/symbols/die-special.webp); }
.card-count {
  position: absolute;
  top: -9px;
  right: -7px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 9px;
  font: 400 21px/1 var(--f-card);
  color: #1b1408;
  background: radial-gradient(circle at 35% 30%, #fff1c9, var(--gold) 55%, #9b7535);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .55), inset 0 -2px 3px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.card-note { margin: 0; padding: 0 4px; font: 600 14px/1.3 var(--f-body); color: var(--muted); }
.card-note b { color: var(--text); font-weight: 700; }
.card-note .faction-link { color: var(--accent); text-decoration: none; }

/* ---- Army page ----------------------------------------------------------- */

.army-hero {
  position: relative;
  isolation: isolate;
  min-height: min(84vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
}
.army-hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: flex;
  justify-content: flex-end;
}
.army-hero-art img {
  height: 100%;
  width: auto;
  max-width: none;
  margin-right: max(-8vw, -120px);
  object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%), linear-gradient(#000 70%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 30%), linear-gradient(#000 70%, transparent);
  mask-composite: intersect;
  animation: hero-in 1.4s var(--ease) both;
}
@keyframes hero-in { from { opacity: 0; transform: scale(1.06) translateX(3%); } }
.army-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 90% at 75% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(90deg, rgba(11, 10, 16, .92) 0%, rgba(11, 10, 16, .7) 34%, transparent 62%),
    linear-gradient(transparent 55%, var(--bg));
}
.army-intro { width: min(var(--max), 100% - 2 * var(--gutter)); margin: 0 auto; padding: 80px 0 56px; }
.army-intro > * { max-width: 600px; animation: rise .9s var(--ease) both; }
.army-intro > :nth-child(2) { animation-delay: .06s; }
.army-intro > :nth-child(3) { animation-delay: .12s; }
.army-intro > :nth-child(4) { animation-delay: .18s; }
.army-intro > :nth-child(5) { animation-delay: .24s; }
.army-intro > :nth-child(6) { animation-delay: .3s; }
.army-kicker { display: flex; align-items: center; gap: 14px; }
.army-logo {
  width: 74px;
  height: 74px;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 70%, transparent)) drop-shadow(0 3px 5px #000);
}
.army-box { font: 700 15px/1.3 var(--f-sc); letter-spacing: .12em; color: var(--accent); }
.army-box small { display: block; font: 500 13px/1.3 var(--f-body); letter-spacing: .04em; color: var(--muted); }
.army-title {
  margin: 12px 0 0;
  font: 900 clamp(52px, 9vw, 116px)/.86 var(--f-display);
  letter-spacing: -.01em;
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent), 0 4px 18px #000;
}
.army-led { margin: 12px 0 0; font: 700 clamp(17px, 2vw, 21px)/1.3 var(--f-sc); letter-spacing: .05em; color: var(--muted); }
.army-led b { color: var(--text); }
.army-blurb { margin: 18px 0 0; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.55; color: #e7dccb; text-shadow: 0 1px 8px #000; }
.army-source { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.army-source:hover { color: var(--text); }
.sym-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.sym-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 9px;
  font: 700 14px/1 var(--f-sc);
  letter-spacing: .05em;
  background: rgba(9, 8, 13, .6);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
}
.sym-chip .sym { color: var(--accent); width: 18px; height: 18px; }

.army-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-decoration: none;
  color: var(--muted);
  transform: translateY(-50%);
  transition: color .2s;
}
.army-nav:hover { color: var(--text); }
.army-nav.prev { left: 6px; }
.army-nav.next { right: 6px; flex-direction: row-reverse; }
.army-nav i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-style: normal;
  font-size: 20px;
  background: rgba(9, 8, 13, .55);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  transition: border-color .2s, transform .2s;
}
.army-nav:hover i { border-color: var(--accent); transform: scale(1.06); }
.army-nav span { font: 700 14px/1.2 var(--f-sc); max-width: 10ch; opacity: 0; transition: opacity .2s; }
.army-nav:hover span { opacity: 1; }

/* Mercenaries have no group painting; they stand in a crowd instead. */
.mercs-art { align-items: flex-end; padding: 0 2vw 9vh 40%; }
.mercs-art img {
  height: 58%;
  width: auto;
  margin: 0 -3%;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .7));
  animation: fig-in 1s var(--ease) both;
  animation-delay: calc(var(--i) * 90ms);
  -webkit-mask-image: none;
  mask-image: none;
}
.mercs-art img:nth-child(odd) { height: 66%; }

@media (max-width: 760px) {
  .army-hero { display: block; min-height: 0; }
  .army-hero-art { position: relative; height: min(64vh, 520px); justify-content: center; overflow: hidden; }
  .army-hero-art img {
    height: 100%;
    margin: 0;
    -webkit-mask-image: linear-gradient(#000 62%, transparent);
    mask-image: linear-gradient(#000 62%, transparent);
  }
  .army-hero::before { background: radial-gradient(90% 50% at 50% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
  .army-intro { position: relative; margin-top: -84px; padding: 0 0 40px; }
  .army-logo { width: 60px; height: 60px; }
  .army-nav { top: 30vh; }
  .army-nav span { display: none; }
  .mercs-art { padding: 0 0 16px; }
  .mercs-art img { height: 48%; margin: 0 -6%; }
  .mercs-art img:nth-child(odd) { height: 56%; }
  .lineup { height: 240px; }
  .fig { margin: 0 -6px; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0 0 54px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stat { padding: 16px 18px; background: var(--panel-solid); }
.stat dt { font: 700 12px/1 var(--f-sc); letter-spacing: .12em; color: var(--muted); }
.stat dd { margin: 8px 0 0; font: 800 30px/1 var(--f-display); }
.stat dd small { margin-left: 4px; font: 600 14px/1 var(--f-body); color: var(--muted); }

.section { margin: 0 0 64px; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 20px; }
.section-head h2 {
  margin: 0;
  font: 800 clamp(30px, 3.4vw, 42px)/1 var(--f-display);
  letter-spacing: .01em;
}
.section-head h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* The army standing in a line: every unit's cut-out, summoner in the middle. */
.lineup {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0;
  height: clamp(260px, 36vw, 440px);
  margin: 0 0 64px;
  padding: 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.lineup::-webkit-scrollbar { display: none; }
/* Centred while the line fits, scrollable from its first figure when it doesn't. */
.lineup > .fig:first-child { margin-left: auto; }
.lineup > .fig:last-child { margin-right: auto; }
.lineup::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 18px;
  height: 46px;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%);
  filter: blur(6px);
}
.fig {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  margin: 0 -2.2%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
  animation: fig-in .9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms + .2s);
}
@keyframes fig-in { from { opacity: 0; transform: translateY(30px); } }
.fig img {
  height: calc(var(--h, 72%) - 30px);
  width: auto;
  max-width: none;
  margin-top: auto;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .7));
  transition: transform .4s var(--ease), filter .4s;
  transform-origin: 50% 100%;
}
.fig:hover img, .fig:focus-visible img {
  transform: translateY(-6px) scale(1.04);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .7)) drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 60%, transparent));
}
.fig:focus-visible { outline: none; }
.fig span {
  height: 30px;
  padding-top: 8px;
  font: 700 13px/1 var(--f-sc);
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s;
}
.fig:hover span, .fig:focus-visible span, .fig.summoner span { opacity: 1; color: var(--text); }
.fig.summoner { z-index: 3; --h: 100%; }
.fig.champion { z-index: 2; --h: 84%; }
.fig.common { z-index: 1; --h: 70%; }

/* Starting setup, laid out on the player's half of the battlefield. */
.setup-wrap { display: grid; grid-template-columns: minmax(0, 720px) minmax(240px, 380px); gap: clamp(20px, 4vw, 56px); align-items: center; }
@media (max-width: 760px) { .setup-wrap { grid-template-columns: 1fr; } }
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 5px;
  aspect-ratio: 6 / 4;
  padding: 10px;
  background:
    linear-gradient(rgba(20, 15, 10, .55), rgba(20, 15, 10, .55)),
    repeating-linear-gradient(92deg, #3b2b1c 0 12px, #33251a 12px 25px, #3f2f20 25px 31px);
  border: 2px solid #6b5236;
  border-radius: 14px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .6), 0 18px 40px rgba(0, 0, 0, .5);
}
.space { position: relative; background: rgba(240, 225, 195, .08); border: 1px solid rgba(240, 225, 195, .14); border-radius: 7px; }
.token {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: end center;
  overflow: hidden;
  padding: 0;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 55%, #1a1520), #0d0b12);
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #fff);
  border-radius: 9px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55);
  cursor: zoom-in;
  animation: drop .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 120ms + .3s);
}
@keyframes drop { from { opacity: 0; transform: translateY(-16px) scale(1.1); } }
.token img { position: absolute; inset: 6% 0 0; height: 94%; width: 100%; object-fit: contain; object-position: 50% 100%; }
.token b {
  position: relative;
  width: 100%;
  padding: 3px 2px;
  font: 700 clamp(9px, 1.2vw, 12px)/1.05 var(--f-sc);
  text-align: center;
  color: var(--text);
  background: linear-gradient(transparent, rgba(0, 0, 0, .85) 40%);
}
.token.gate { background: radial-gradient(circle at 50% 35%, #6a5a48, #241c14); border-color: #b49a72; cursor: default; }
.token.gate svg { position: absolute; inset: 14% 22% 30%; width: 56%; height: 56%; color: #e8d6b4; }
.board-label { margin: 8px 4px; font: 700 12px/1 var(--f-sc); letter-spacing: .12em; text-align: center; color: var(--faint); }
.setup-key { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.setup-key li { display: flex; gap: 12px; align-items: center; }
.setup-key img { width: 52px; height: 52px; object-fit: contain; object-position: 50% 100%; background: rgba(255, 255, 255, .05); border-radius: 10px; }
.setup-key b { display: block; font: 700 17px/1.2 var(--f-sc); }
.setup-key span { font-size: 14px; color: var(--muted); }

/* ---- Zoom ---------------------------------------------------------------- */

.zoom {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(16px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(80% 70% at 50% 40%, color-mix(in srgb, var(--accent) 22%, rgba(8, 7, 12, .9)), rgba(8, 7, 12, .96));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade .25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.zoom-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
  width: min(1240px, 100%);
  margin: auto;
}
@media (max-width: 900px) { .zoom-inner { grid-template-columns: 1fr; } }
.zoom-stage { position: relative; display: grid; place-items: center; }
.zoom-stage .card {
  width: min(100%, 880px);
  cursor: default;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  animation: zoom-in .45s var(--ease) both;
}
.zoom-stage .card:hover { box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px color-mix(in srgb, var(--accent) 30%, transparent); }
@keyframes zoom-in { from { opacity: 0; transform: perspective(1100px) rotateX(8deg) scale(.92); } }
.zoom-fig {
  position: absolute;
  right: 10px;
  bottom: calc(100% - 22px);
  width: 58%;
  height: clamp(150px, 26vh, 250px);
  object-fit: contain;
  object-position: 100% 100%;
  pointer-events: none;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .7));
  animation: fig-pop .7s .15s var(--ease) both;
}
@keyframes fig-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@media (max-width: 900px) { .zoom-fig { display: none; } }
.zoom-info {
  position: relative;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  animation: rise .5s .08s var(--ease) both;
}
.zoom-info h2 { margin: 0; font: 400 34px/1 var(--f-card); }
.zoom-type { margin: 8px 0 0; font: 700 14px/1.3 var(--f-sc); letter-spacing: .06em; color: var(--accent); }
.zoom-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.zoom-stats li {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 12px;
  font: 600 14px/1 var(--f-body);
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.zoom-stats b { font: 400 22px/1 var(--f-card); color: var(--text); }
.zoom-rules { display: grid; gap: 14px; margin: 18px 0 0; }
.zoom-rules h3 { margin: 0 0 4px; font: 700 18px/1.2 var(--f-sc); color: var(--text); }
.zoom-rules p { margin: 0; color: #e2d7c6; line-height: 1.5; }
.zoom-rules .active { margin: 4px 0 -6px; font: 700 13px/1 var(--f-sc); letter-spacing: .14em; color: var(--accent); }
.zoom-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.zoom-meta .sym { color: var(--accent); }
.zoom-meta a { color: var(--accent); text-decoration: none; }
.zoom-toggle {
  margin-top: 16px;
  padding: 9px 14px;
  font: 700 14px/1 var(--f-sc);
  letter-spacing: .06em;
  color: #1b1408;
  background: var(--gold);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.zoom-close, .zoom-step {
  position: fixed;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 22px;
  color: var(--text);
  background: rgba(9, 8, 13, .7);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.zoom-close:hover, .zoom-step:hover { border-color: var(--accent); transform: scale(1.06); }
.zoom-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.zoom-step { top: 50%; margin-top: -23px; }
.zoom-step.prev { left: 10px; }
.zoom-step.next { right: 10px; }
.zoom-step:disabled { opacity: .25; cursor: default; transform: none; }
@media (max-width: 900px) {
  .zoom { padding-top: calc(72px + env(safe-area-inset-top)); padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .zoom-step { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); margin: 0; }
}
body.zoomed { overflow: hidden; }

.foot { padding: 30px var(--gutter) 46px; text-align: center; border-top: 1px solid var(--line); }
.foot p { max-width: 70ch; margin: 0 auto; font-size: 13.5px; line-height: 1.6; color: var(--faint); }
.foot a { color: var(--muted); }

.loading { display: grid; place-items: center; min-height: 70vh; color: var(--muted); font: 700 16px/1 var(--f-sc); letter-spacing: .14em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .embers { display: none; }
}
