/* ---------------------------------------------------------------------------------------------------------------
   Ascension DB (ascdb-edge), one stylesheet for every page. It extends the landing page's identity
   (seo/design/megapage.html, SEO_CSS of seo/edge/worker/index.js): the page speaks the game's own interface language.
   An item page IS the item's tooltip, a spell page the spell tooltip, a quest page the quest log, a class page its name
   on the wall of classes plus its talent grids. Plain drawing: no textures, no icons, no gradients, no card grids.
   Colour carries what a player already reads in the game: item quality, the yellow of the interface, the green of
   Equip/Use lines, the main-stat colour of a class. Edit the tokens below; nothing else repeats a colour.
   --------------------------------------------------------------------------------------------------------------- */
@font-face{font-family:"Grenze Gotisch";font-style:normal;font-weight:100 900;font-display:swap;
  src:url(fonts/grenze-gotisch-latin.6820b1812cd4.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:"Grenze Gotisch";font-style:normal;font-weight:100 900;font-display:swap;
  src:url(fonts/grenze-gotisch-latin-ext.0fe9ba2a10e0.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}
/* one letter from the roman sibling: the blackletter capital X reads as an E in "Xoroth" */
@font-face{font-family:"Kx Roman X";font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/grenze-x.d278b442ddf5.woff2) format("woff2");unicode-range:U+0058}

:root{
  /* ground and ink (the landing page's) */
  --stone:#2b231d; --stone-deep:#211a15; --ink:#ece4d2; --dim:#b5aa94; --head:#fff7e2;
  --rule:#ffffff14; --rule-strong:#ffffff26; --edge-warm:rgba(221,180,94,.45);
  /* the game's interface */
  --ui-yellow:#ffd100;              /* quest titles, tooltip descriptions, flavour text */
  --tooltip:#171730; --tooltip-edge:#8d8da8;
  --bonus:#1eff00;                  /* Equip: / Use: / set bonus lines */
  --spell-link:#71d5ff;             /* spell and talent links, as the game prints them in chat */
  --quest-link:#ffd100;
  --gold:#e9c46a; --gold-ink:#1a1420;
  /* main-stat colours (the wall of classes) */
  --agi:#f7e463; --int:#69ccf0; --str:#f2604a; --spi:#5fe0a0;
  /* item quality: the game's hues; rare and epic lifted to pass AA (4.5:1) on the stone and the tooltip */
  --q0:#9d9d9d; --q1:#ffffff; --q2:#1eff00; --q3:#3d9bff; --q4:#c069ff; --q5:#ff8000; --q6:#e6cc80; --q7:#00ccff;
  /* coins */
  --coin-g:#f2c14e; --coin-s:#d0d4d8; --coin-c:#d88b54;
  /* faces */
  --display:"Kx Roman X","Grenze Gotisch","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  /* always-Latin names (the wordmark, class and spec names, "Ascension DB") keep the display face in EVERY language:
     an explicit stack, never var(--display), which the non-Latin rule below swaps for the system face */
  --blackletter:"Kx Roman X","Grenze Gotisch","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  --text:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans","Helvetica Neue",Arial,sans-serif;
  /* measure */
  --page:72rem; --gutter:clamp(1rem,4vw,3rem);
}
/* scripts the display face does not draw take the system face for headings (class names keep --blackletter) */
:root:lang(ru),:root:lang(ko),:root:lang(zh){--display:var(--text)}

*,*::before,*::after{box-sizing:border-box}
html{background:var(--stone);color:var(--ink);font:17px/1.6 var(--text);-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;display:flex;flex-direction:column}
main{flex:1}
a{color:var(--int);text-underline-offset:.18em;text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--ui-yellow);outline-offset:3px}
p{margin:0 0 1em;max-width:64ch}
h1,h2,h3{font-family:var(--display);font-weight:700;color:var(--head);margin:0;letter-spacing:.005em}
h2{font-size:clamp(1.45rem,2.3vw,1.8rem);line-height:1.1;margin:2.2rem 0 .6rem}
h3{font-size:1.25rem;line-height:1.15;margin:1.6rem 0 .5rem}
.wrap{width:100%;max-width:var(--page);margin:0 auto;padding:0 var(--gutter)}   /* width: a .wrap that is a flex item (the breadcrumb) starts at the content edge instead of shrinking to its text and centring */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.dim{color:var(--dim)}
[lang="en"].rel-en,.rel-en{font-style:normal}

/* ---- the slim top bar: wordmark, the search field, Play now ---------------------------------------------------- */
.bar{background:var(--stone-deep);border-bottom:1px solid var(--edge-warm)}
.bar .wrap{display:grid;grid-template-columns:auto minmax(0,36rem) auto;align-items:center;justify-content:space-between;gap:1rem 2rem;padding-top:.6rem;padding-bottom:.6rem}
.mark{font:700 1.6rem/1 var(--blackletter);color:var(--head);text-decoration:none;white-space:nowrap;letter-spacing:.01em}
.mark:hover{color:var(--ui-yellow)}
.play{display:inline-block;padding:.55rem 1.15rem;border-radius:6px;background:var(--gold);color:var(--gold-ink);font:600 .98rem/1.2 var(--text);text-decoration:none;white-space:nowrap}
.play:hover{background:#f3d27e}
.crumbs{font-size:.88rem;color:var(--dim);padding-top:.9rem}
.crumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.1rem .5rem}
.crumbs li+li::before{content:"›";margin-right:.5rem;color:#ffffff40}
.crumbs a{color:var(--dim)}
.crumbs [aria-current]{color:var(--ink)}

/* ---- the search field (also embeddable: everything of the widget is under .ascdb-s) ---------------------------- */
/* @widget-start */
.ascdb-s{position:relative;display:flex;gap:.4rem;font:16px/1.4 var(--text,system-ui,sans-serif);color:var(--ink,#ece4d2)}
.ascdb-s input[type=search]{flex:1;min-width:0;padding:.55rem .8rem;border-radius:4px;border:1px solid var(--tooltip-edge,#8d8da8);
  background:var(--tooltip,#171730);color:#fff;font:inherit;-webkit-appearance:none;appearance:none}
.ascdb-s input[type=search]::placeholder{color:#a8a8c0}
.ascdb-s input[type=search]:focus{outline:2px solid var(--ui-yellow,#ffd100);outline-offset:1px;border-color:var(--ui-yellow,#ffd100)}
.ascdb-s select{max-width:9.5rem;padding:.5rem .4rem;border-radius:4px;border:1px solid var(--tooltip-edge,#8d8da8);background:var(--tooltip,#171730);color:var(--ink,#ece4d2);font:inherit;font-size:.9rem}
.ascdb-s button{padding:.5rem .8rem;border-radius:4px;border:1px solid var(--tooltip-edge,#8d8da8);background:transparent;color:var(--ink,#ece4d2);font:inherit;cursor:pointer}
.ascdb-s .ascdb-list{position:absolute;z-index:30;left:0;right:0;top:calc(100% + .3rem);margin:0;padding:.35rem 0;list-style:none;
  background:var(--tooltip,#171730);border:1px solid var(--tooltip-edge,#8d8da8);border-radius:5px;box-shadow:0 0 0 1px #000,0 12px 28px #000a;max-height:min(70vh,26rem);overflow:auto}
.ascdb-s .ascdb-list[hidden]{display:none}
.ascdb-s .ascdb-list a{display:flex;justify-content:space-between;gap:1rem;padding:.32rem .8rem;text-decoration:none;color:var(--ink,#ece4d2)}
.ascdb-s .ascdb-list a .t{color:#a8a8c0;font-size:.82rem;white-space:nowrap;padding-top:.12rem}
.ascdb-s .ascdb-list [aria-selected=true] a,.ascdb-s .ascdb-list a:hover{background:#2a2a52}
.ascdb-s .ascdb-list .note{padding:.35rem .8rem;color:#a8a8c0;font-size:.9rem}
.ascdb-s .ascdb-list .all a{color:var(--ui-yellow,#ffd100);border-top:1px solid #ffffff1a;margin-top:.25rem;padding-top:.45rem}
.ascdb-s .q0{color:var(--q0,#9d9d9d)} .ascdb-s .q1{color:var(--q1,#fff)} .ascdb-s .q2{color:var(--q2,#1eff00)} .ascdb-s .q3{color:var(--q3,#3d9bff)}
.ascdb-s .q4{color:var(--q4,#c069ff)} .ascdb-s .q5{color:var(--q5,#ff8000)} .ascdb-s .q6{color:var(--q6,#e6cc80)} .ascdb-s .q7{color:var(--q7,#00ccff)}
.ascdb-s .tq{color:var(--quest-link,#ffd100)} .ascdb-s .ts{color:var(--spell-link,#71d5ff)}
/* @widget-end */
.bar .ascdb-s select,.bar .ascdb-s button{display:none}

/* ---- page frame -------------------------------------------------------------------------------------------------- */
.page{padding-top:1.6rem;padding-bottom:3.5rem}
.lead{display:grid;grid-template-columns:minmax(0,27rem) minmax(0,1fr);gap:clamp(1.8rem,4.5vw,4.5rem);align-items:start}
.lead.reading{grid-template-columns:minmax(0,40rem) minmax(0,22rem);justify-content:space-between}
.side>h2:first-child,.side>section:first-child>h2{margin-top:0}
.foot{border-top:1px solid var(--rule);color:var(--dim);font-size:.88rem}
.foot .wrap{padding-top:1.4rem;padding-bottom:2rem}
.foot p{max-width:80ch}

/* ---- the tooltip: item, spell, talent, enchant ------------------------------------------------------------------- */
.tip{background:var(--tooltip);border:1px solid var(--tooltip-edge);border-radius:5px;padding:.9rem 1.05rem 1.05rem;
  box-shadow:0 0 0 1px #000;font-size:1.02rem;line-height:1.42;color:#fff}
.tip h1{font:700 clamp(1.7rem,3.2vw,2.15rem)/1.08 var(--display);margin:0 0 .25rem;letter-spacing:.01em}
.tip .ln{display:block}
.tip .row{display:flex;justify-content:space-between;gap:1.2rem}
.tip .row>span:last-child{text-align:right}
.tip .eq{color:var(--bonus)}
.tip .eq a{color:var(--bonus)}
.tip .desc{color:var(--ui-yellow);margin-top:.35rem}
.tip .desc p,.tip .eq p{margin:0 0 .5em;max-width:none}
.tip .desc p:last-child,.tip .eq p:last-child{margin-bottom:0}
.tip .flavor{color:var(--ui-yellow);margin-top:.4rem}
.tip .gap{margin-top:.45rem}
.tip .set{margin-top:.5rem}
.tip .set .nm{color:var(--ui-yellow)}
.tip .set ul{list-style:none;margin:.1rem 0 .2rem;padding:0 0 0 .9rem}
.tip .set li{color:var(--q0)}
.tip .set li a{color:var(--q0)}
.tip .set .bn{color:var(--q0)}
.tip .rank{color:var(--q0)}
.tip .muted{color:var(--q0)}
.tip .price{margin-top:.45rem}
.coin{font-variant-numeric:tabular-nums;margin-left:.35em}
.coin b{font-weight:600} .coin .g{color:var(--coin-g)} .coin .s{color:var(--coin-s)} .coin .c{color:var(--coin-c)}

/* quality colours, for names wherever they appear */
.q0{color:var(--q0)} .q1{color:var(--q1)} .q2{color:var(--q2)} .q3{color:var(--q3)} .q4{color:var(--q4)} .q5{color:var(--q5)} .q6{color:var(--q6)} .q7{color:var(--q7)}
a.q0,a.q1,a.q2,a.q3,a.q4,a.q5,a.q6,a.q7{text-decoration-color:currentColor}
/* links speak the game's link colours: spells and talents light blue, quests yellow, items their quality */
a.l-spell,a.l-talent,a.l-enchant{color:var(--spell-link)} a.l-quest{color:var(--quest-link)} a.l-npc,a.l-object,a.l-spec{color:var(--ink)}
a.agi{color:var(--agi)} a.int{color:var(--int)} a.str{color:var(--str)} a.spi{color:var(--spi)}
.en-mark{font-size:.78em;color:var(--dim);margin-left:.35em;white-space:nowrap}

/* ---- tables are tables --------------------------------------------------------------------------------------------- */
.tbl{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch;margin:.3rem 0 1.4rem}
table{border-collapse:collapse;width:100%;font-size:.96rem;font-variant-numeric:tabular-nums}
th{font-weight:600;text-align:left;color:var(--dim);padding:.3rem .9rem .3rem 0;border-bottom:1px solid var(--rule-strong);white-space:nowrap}
td{padding:.45rem .9rem .45rem 0;border-bottom:1px solid var(--rule);vertical-align:top}
td.n,th.n{text-align:right;white-space:nowrap}
.cap{color:var(--dim);font-size:.88rem;margin:-.9rem 0 1.4rem}

/* ---- the quest log -------------------------------------------------------------------------------------------------- */
.log h1{font:700 clamp(2rem,4.4vw,3.1rem)/1.04 var(--display);color:var(--ui-yellow);max-width:22ch}
.log .meta{color:var(--dim);margin:.7rem 0 1.4rem;max-width:64ch}
.log h2{font-size:1.35rem;color:var(--ui-yellow);margin:1.9rem 0 .45rem}
.log .ph{color:var(--dim)}
.checks{margin:.4rem 0 1rem;padding:0;list-style:none;max-width:64ch}
.checks li{position:relative;padding:.2rem 0 .2rem 2rem}
.checks li::before{content:"";position:absolute;left:.15rem;top:.55rem;width:.86rem;height:.86rem;border:1.5px solid var(--dim);border-radius:2px}
.checks .cnt{color:var(--dim);font-variant-numeric:tabular-nums}
.minis{display:flex;flex-wrap:wrap;gap:.55rem;margin:.4rem 0 1rem;padding:0;list-style:none}
.minis li{background:var(--tooltip);border:1px solid var(--tooltip-edge);border-radius:4px;padding:.4rem .7rem;font-size:.95rem;line-height:1.3;box-shadow:0 0 0 1px #000}
.minis li .cnt{color:#fff;margin-left:.4rem;font-variant-numeric:tabular-nums}
.side .pair{margin:0 0 1rem}
.side dl{margin:0 0 1.2rem;display:grid;grid-template-columns:auto 1fr;gap:.35rem 1rem}
.side dt{color:var(--dim)}
.side dd{margin:0}

/* ---- npc / object headline --------------------------------------------------------------------------------------- */
.who h1{font:700 clamp(2.1rem,4.8vw,3.4rem)/1.02 var(--display)}
.who .sub{font-size:1.1rem;color:var(--ink);margin:.35rem 0 0}
.who .meta{color:var(--dim);margin:.4rem 0 1.6rem}

/* ---- class: the name on the wall --------------------------------------------------------------------------------- */
.wall h1{font:700 clamp(3.2rem,11vw,8.4rem)/.9 var(--blackletter);letter-spacing:.004em;margin:.4rem 0 .3rem}
.wall h1.list{font-size:clamp(2.6rem,7vw,5.4rem);line-height:.95}
.wall .stat{font:500 .95rem/1.3 var(--text);color:var(--dim);margin:0 0 1.4rem .2rem}
.wall .agi{color:var(--agi)} .wall .int{color:var(--int)} .wall .str{color:var(--str)} .wall .spi{color:var(--spi)}
.specs{display:grid;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr));gap:.4rem 3rem;margin:.6rem 0 1rem}
.specs h3{margin:.8rem 0 .3rem;font-size:1.55rem}
.specs h3 a{color:var(--head);text-decoration:none} .specs h3 a:hover{text-decoration:underline}
.specs p{color:var(--ink);font-size:.98rem}
.roster{display:flex;flex-wrap:wrap;gap:.55rem clamp(1.3rem,3.2vw,3rem);margin:0;padding:0;list-style:none}
.roster li{font:700 clamp(1.9rem,4.4vw,3.6rem)/.98 var(--blackletter);letter-spacing:.004em}
.roster a{text-decoration:none} .roster a:hover{text-decoration:underline;text-decoration-thickness:2px}
.roster small{display:block;font:500 .8rem/1.3 var(--text);letter-spacing:0;color:var(--dim);margin:.18rem 0 0 .12rem}
.roster .agi a{color:var(--agi)} .roster .int a{color:var(--int)} .roster .str a{color:var(--str)} .roster .spi a{color:var(--spi)}
.legend{display:flex;flex-wrap:wrap;gap:.4rem 1.6rem;margin:.8rem 0 1.6rem;padding:0;list-style:none;font-size:.92rem;color:var(--dim)}
.legend li::before{content:"";display:inline-block;width:.7rem;height:.7rem;border-radius:50%;margin-right:.45rem;vertical-align:-.04em;background:currentColor}
.legend .agi{color:var(--agi)} .legend .int{color:var(--int)} .legend .str{color:var(--str)} .legend .spi{color:var(--spi)}
.legend span{color:var(--dim)}
.band{background:var(--stone-deep);border-block:1px solid #ffffff10;margin:2.4rem 0 0;padding:2.2rem 0 2.6rem}
.band h2{margin-top:0}

/* ---- talent trees: the grid of nodes of the game's advancement window --------------------------------------------- */
/* data-* on every node (id, ranks, requires, x, y) is what a later calculator reads: same markup, script on top */
.tree{margin:1rem 0 2rem}
.tree h3{margin:0 0 .6rem}
.tree .scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:.4rem}
.grid{--cols:11;--rows:10;--cell:5.2rem;position:relative;min-width:46rem;height:calc(var(--rows) * var(--cell));
  background:var(--stone-deep);border:1px solid #ffffff12;border-radius:4px}
.grid svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.grid line{stroke:#8d8da899;stroke-width:1.5;vector-effect:non-scaling-stroke}
.grid line.req{stroke-dasharray:4 3}
.grid line.on{stroke:var(--ui-yellow)}
.node{position:absolute;left:calc(var(--x) / var(--cols) * 100%);top:calc(var(--y) / var(--rows) * 100%);
  width:calc(100% / var(--cols));height:var(--cell);display:flex;align-items:center;justify-content:center;padding:.25rem}
.node a{display:flex;align-items:center;justify-content:center;text-align:center;width:100%;height:100%;padding:.2rem .25rem;
  font:600 .7rem/1.12 var(--text);color:var(--ink);text-decoration:none;background:var(--tooltip);border:1px solid var(--tooltip-edge);
  overflow:hidden;hyphens:auto;overflow-wrap:anywhere}
.node.ab a{border-radius:2px;border-color:var(--gold);box-shadow:inset 0 0 0 1px #00000080}
.node.ta a{border-radius:1.15rem}
.node.granted a{border-style:dashed}
.node a:hover{border-color:var(--ui-yellow);color:#fff}
.node.choice{flex-direction:column;gap:2px;padding:.2rem .25rem}
.node.choice a{height:50%;font-size:.64rem}
.node.choice a:first-child{border-bottom-left-radius:0;border-bottom-right-radius:0}
.node.choice a:last-child{border-top-left-radius:0;border-top-right-radius:0}
.node.here a{border:2px solid var(--ui-yellow);color:#fff;background:#2a2a52}
.tree .key{color:var(--dim);font-size:.85rem;margin:.5rem 0 0;max-width:80ch}

/* ---- home ----------------------------------------------------------------------------------------------------------- */
.home h1{font:800 clamp(3rem,9vw,6.6rem)/.92 var(--blackletter);margin:.6rem 0 .8rem}
.home .lede{font-size:1.18rem;line-height:1.5;max-width:44ch}
.home .big{max-width:44rem;margin:1.4rem 0 .4rem}
.home .big .ascdb-s{font-size:1.15rem}
.home .big .ascdb-s input[type=search]{padding:.85rem 1rem}
.counts{max-width:28rem}

/* ---- search results page ---------------------------------------------------------------------------------------------- */
.results{list-style:none;margin:.6rem 0 1.4rem;padding:0;max-width:44rem}
.results li{display:flex;justify-content:space-between;gap:1rem;padding:.4rem 0;border-bottom:1px solid var(--rule)}
.results .t{color:var(--dim);font-size:.88rem;white-space:nowrap}
.searchpage .ascdb-s{max-width:44rem;margin:1rem 0 1.2rem}
.searchpage h1,.miss h1{font:700 clamp(2rem,4.4vw,3rem)/1.05 var(--display)}

@media (max-width:900px){
  .lead,.lead.reading{grid-template-columns:minmax(0,1fr)}
  .tip{max-width:30rem}
}
@media (max-width:620px){
  .bar .wrap{grid-template-columns:1fr auto;gap:.55rem 1rem}
  .bar .ascdb-s{grid-column:1 / -1;order:3}
  .tip{max-width:none}
  html{font-size:16px}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
