/* Self-hosted from Google Fonts (SIL Open Font License): Marcellus and Alegreya Sans, latin and latin-ext. */
@font-face { font-family: 'Alegreya Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-400i-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-400i-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/alegreya-sans-500-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/alegreya-sans-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sans-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sans-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/marcellus-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/marcellus-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --night: #0a0e1f;      /* page: the navy of a tooltip at dusk */
  --panel: #10162e;
  --edge: #28305a;
  --ink: #ece6d6;
  --muted: #9b947f;
  --gold: #ffd100;       /* the client's label gold */
  --tip: #070b1c;
  --class: #d4b45a;
  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #0070dd;
  --q-epic: #a335ee; --q-legendary: #ff8000; --q-artifact: #e6cc80; --q-heirloom: #00ccff;
  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --text: "Alegreya Sans", "Gill Sans", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; color: var(--ink); font: 17px/1.5 var(--text); background: var(--night); }
a { color: inherit; }
img { display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Hero: the class's own talent art, the one loud thing on the page. */
/* One container for everything, so hero text, gear, talents and footer
   share a left edge. */
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: clamp(16px, 5vw, 64px); padding-right: clamp(16px, 5vw, 64px); }

.hero {
  position: relative; display: flex; padding: 20px 0 40px;
  background:
    linear-gradient(to bottom, rgba(10,14,31,.2) 0%, rgba(10,14,31,.1) 45%, var(--night) 100%),
    linear-gradient(to right, rgba(10,14,31,.85) 0%, rgba(10,14,31,0) 60%),
    var(--banner, none) center 30% / cover no-repeat, var(--panel);
}
.hero-inner { min-height: min(48vh, 440px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.hero nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.hero nav a:hover { color: var(--ink); }
.ident p { max-width: 60ch; }
.hero h1 {
  font-size: clamp(48px, 8vw, 112px); line-height: .95; text-wrap: balance; letter-spacing: .01em;
  color: var(--class); text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.who { margin: 14px 0 0; font-size: 22px; }
.who .cls { color: var(--class); }
.seen { margin: 4px 0 0; color: var(--muted); }

main { padding-bottom: 64px; }
section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: 34px; }
.summary { margin: 0; color: var(--muted); }

/* Character sheet: a framed paper doll with the class's second scene where
   the game shows the model, and the stats panel beside it. Both panels and
   the talent trees below fill the same width. */
.sheet { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; }
.sheet > * { min-width: 0; }
.doll {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 24px; padding: 20px;
  border: 1px solid var(--edge); border-radius: 8px;
  background:
    radial-gradient(ellipse 45% 60% at 50% 45%, rgba(10,14,31,0) 0%, rgba(10,14,31,.55) 70%, rgba(10,14,31,.85) 100%),
    var(--scene, none) 42% center / cover no-repeat, var(--panel);
}
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.slots.right { align-items: flex-end; }
.slots.left .slot, .slots.right .slot { max-width: 100%; }
/* Weapons: a centred row under the doll, as in game. */
.slots.weapons { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 12px 32px; margin-top: 14px; }
.slots.weapons .slot { flex-direction: column; width: 150px; gap: 6px; text-align: center; }
.slots.weapons .label { align-items: center; }
.slots.weapons .iname { white-space: normal; }
.slot { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; }
.slots.right .slot { flex-direction: row-reverse; text-align: right; }
.frame { flex: none; width: 48px; height: 48px; border: 2px solid #1c2240; border-radius: 6px; background: #05070f; }
.frame img { width: 44px; height: 44px; border-radius: 4px; }
.slot.empty img { opacity: .45; }
.label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.iname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isub { color: var(--muted); font-size: 14px; }
.slot.empty .isub { opacity: .6; }
.q-poor .frame { border-color: var(--q-poor); } .q-poor .iname { color: var(--q-poor); }
.q-common .frame { border-color: #c9c9c9; }
.q-uncommon .frame { border-color: var(--q-uncommon); } .q-uncommon .iname { color: var(--q-uncommon); }
.q-rare .frame { border-color: var(--q-rare); } .q-rare .iname { color: #3d9bff; }
.q-epic .frame { border-color: var(--q-epic); } .q-epic .iname { color: #c070ff; }
.q-legendary .frame { border-color: var(--q-legendary); } .q-legendary .iname { color: var(--q-legendary); }

/* Stats sit beside the gear, as tall as the paper doll, and scroll inside. */
/* Stats: as tall as the doll, scrolling inside. */
.core { position: relative; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel); }
.core-scroll {
  position: absolute; inset: 0; overflow-y: auto; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; scrollbar-color: var(--edge) transparent;
}
.statgroup h2 { font-size: 18px; line-height: 1.2; color: var(--gold); margin-bottom: 4px; }
.statgroup dl { margin: 0; }
.statgroup dl div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border-bottom: 1px solid rgba(40,48,90,.6); }
.statgroup dt { color: var(--muted); }
.statgroup dd { margin: 0; font-variant-numeric: tabular-nums; }
.purse { display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.purse span::after { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-left: 4px; vertical-align: -1px; }
.purse .g::after { background: #e8b923; } .purse .s::after { background: #c0c6cc; } .purse .c::after { background: #b8703a; }
.xp { height: 6px; background: #1b2140; border-radius: 3px; overflow: hidden; }
.xp div { height: 100%; background: #8d3ea8; }

/* Talent trees on their Classic backgrounds. */
.spec { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tree { border: 1px solid var(--edge); border-radius: 8px; overflow: hidden;
  background: linear-gradient(rgba(10,14,31,.55), rgba(10,14,31,.75)), var(--bg, none) center / cover, var(--panel);
}
.tree-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(5,7,15,.6); }
.tree-head img { border-radius: 4px; }
.tree-head h3 { font-size: 20px; flex: 1; }
.tree-head .spent { color: var(--gold); font-variant-numeric: tabular-nums; }
.grid {
  position: relative; display: grid; padding: 12px;
  grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 60px);
}
.edges { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); overflow: visible; }
.edges line { stroke: rgba(255, 209, 0, .35); stroke-width: 3; vector-effect: non-scaling-stroke; }
.node { position: relative; justify-self: center; align-self: center; width: 40px; height: 40px; border: 2px solid #4a4f63; border-radius: 6px; background: #05070f; }
.node img { width: 36px; height: 36px; border-radius: 4px; }
.node.s-none img { filter: grayscale(1) brightness(.55); }
.node.s-partial { border-color: #1eff00; }
.node.s-max { border-color: var(--gold); }
.rank {
  position: absolute; right: -10px; bottom: -8px; padding: 0 4px; font-size: 12px; line-height: 16px;
  background: #05070f; border: 1px solid #4a4f63; border-radius: 4px; font-variant-numeric: tabular-nums; color: var(--muted);
}
.s-partial .rank { color: #1eff00; border-color: #1eff00; }
.s-max .rank { color: var(--gold); border-color: var(--gold); }

.spec-tabs { display: flex; gap: 6px; }
.spec-tabs button { font: inherit; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.spec-tabs button[aria-selected="true"] { color: var(--ink); background: var(--panel); border-color: var(--edge); }
.spec-tabs span { font-variant-numeric: tabular-nums; }

.legacy .grid { grid-template-rows: repeat(var(--rows), 58px); }

/* Skills */
.skillgroups { display: grid; gap: 28px 48px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.skillgroups h3 { font-size: 18px; color: var(--gold); margin-bottom: 6px; }
.skillgroups ul { list-style: none; margin: 0; padding: 0; }
.skillgroups li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 64px; align-items: center; gap: 10px; padding: 3px 0; }
.skillgroups meter { width: 100%; height: 8px; }
.num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Tooltips, drawn like the game's. */
.tip {
  display: none; position: fixed; z-index: 10; width: max-content; max-width: 320px; padding: 8px 10px;
  background: var(--tip); border: 1px solid #5d6485; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.6);
  font-size: 15px; line-height: 1.35; pointer-events: none; white-space: pre-line;
}
.tip.on { display: block; }
.tl { display: flex; justify-content: space-between; gap: 24px; }
.tl-name { font-size: 17px; }
.tl-rank { color: var(--muted); }
.tl-next { margin-top: 8px; }
.tr { text-align: right; }

footer { padding-top: 24px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }

/* Not found */
.roster-page main { padding-top: 64px; }
.roster-page h1 { font-size: 56px; }

/* Character select: the most-played character's art, blurred, behind a
   row of portrait cards. */
.select { min-height: 100vh; background: transparent; }
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(10,14,31,.2), rgba(10,14,31,.6) 55%, var(--night) 100%),
    linear-gradient(to right, rgba(10,14,31,.7), rgba(10,14,31,0) 60%),
    var(--backdrop, none) center / cover no-repeat;
  filter: saturate(1.1); transform: scale(1.08);
}
.backdrop::after { content: ""; position: absolute; inset: 0; backdrop-filter: blur(10px); }
.select main { padding-top: clamp(48px, 12vh, 140px); padding-bottom: 80px; }
.select-head { margin-bottom: 48px; }
.select-head h1 { font-size: clamp(48px, 7vw, 96px); line-height: .95; }
.select-head p { max-width: 46ch; margin: 16px 0 0; color: var(--muted); font-size: 19px; }
.select-empty { color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 340px)); }
.card {
  position: relative; display: block; aspect-ratio: 5 / 7; overflow: hidden; text-decoration: none;
  border: 1px solid var(--edge); border-radius: 10px; background: var(--panel);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.card-art {
  position: absolute; inset: 0; background-size: auto 100%; background-position: 88% center; background-repeat: no-repeat;
  transition: transform .5s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,14,31,0) 35%, rgba(10,14,31,.75) 62%, rgba(7,10,24,.97) 100%);
}
.card:hover .card-art, .card:focus-visible .card-art { transform: scale(1.05); }
.card:hover, .card:focus-visible { border-color: var(--class); }
.card-text { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 20px; display: flex; flex-direction: column; }
.card-class { border-radius: 6px; margin-bottom: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.card-name { font-family: var(--display); font-size: 34px; line-height: 1.05; color: var(--class); text-wrap: balance; }
.card-who { margin-top: 6px; color: var(--ink); }
.card-seen { color: var(--muted); font-size: 15px; }
/* Level in a round badge, like the game's unit frames. */
.badge {
  position: absolute; z-index: 1; top: 16px; left: 16px; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; font-family: var(--display); font-size: 20px;
  color: var(--gold); background: radial-gradient(circle at 50% 35%, #2a2412, #0b0a05);
  border: 2px solid #b08a2e; box-shadow: 0 2px 10px rgba(0,0,0,.6);
}

@media (max-width: 1080px) {
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .core-scroll { position: static; }
}
@media (max-width: 600px) {
  .doll { padding: 14px; gap: 10px 12px; }
  .iname { white-space: normal; overflow-wrap: anywhere; }
  .isub { font-size: 13px; }
  .slots.weapons { gap: 12px; }
  .slots.weapons .slot { width: calc((100% - 24px) / 3); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
