/* FateMMO Guide (wiki) styles, on the site tokens in fate-tokens.css (loaded first).
   Display type is Cinzel 600-700, everything else Inter 400-700: the self-hosted fonts stop at 700.
   html is 14px (game.css), so exact sizes use px. Replace this file's ?v= when changing it. */

.fate-wiki {
    --wiki-bg:var(--fate-ink);
    --wiki-panel:#0e131d;
    --wiki-panel-2:#121925;
    --wiki-ink:var(--fate-ivory);
    --wiki-muted:#99a5b7;
    --wiki-line:rgba(244,238,223,.12);
    --wiki-line-bright:rgba(215,174,88,.42);
    --wiki-gold:var(--fate-gold);
    --wiki-gold-soft:var(--fate-gold-bright);
    --wiki-link:var(--fate-thread);
    --wiki-teal:#61b5ac;
    --wiki-role-normal:#a3adbb;
    --wiki-role-elite:var(--fate-gold);
    --wiki-role-boss:#ff8a80;
    min-height:100vh;
    margin:0;
    background:radial-gradient(circle at 15% 10%,rgba(41,53,86,.28),transparent 30rem),linear-gradient(180deg,#08111b,var(--fate-ink) 58%,#08111b);
    color:var(--wiki-ink);
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

.fate-wiki * {
    box-sizing:border-box;
}

.fate-wiki a {
    color:var(--wiki-link);
}

.wiki-search {
    display:grid;
    grid-template-columns:40px minmax(0,1fr) 40px;
    align-items:center;
    width:100%;
    height:44px;
    border:1px solid rgba(215,174,88,.32);
    border-radius:10px;
    background:#0b1118;
    box-shadow:inset 0 1px rgba(255,255,255,.03);
    transition:border-color .16s ease,box-shadow .16s ease;
}

.wiki-search:focus-within {
    border-color:rgba(243,217,137,.72);
    box-shadow:inset 0 1px rgba(255,255,255,.03),0 0 0 2px rgba(215,174,88,.3);
}

.wiki-search-icon {
    width:18px;
    height:18px;
    justify-self:center;
    fill:none;
    stroke:var(--wiki-muted);
    stroke-width:1.8;
    stroke-linecap:round;
}

.wiki-search input {
    width:100%;
    min-width:0;
    height:42px;
    border:0;
    outline:0;
    padding:0;
    font:400 16px/1.25 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    background:transparent;
    color:var(--wiki-ink);
}

.wiki-search input:focus {
    box-shadow:none;
}

.wiki-search input:focus-visible {
    outline:0;
}

.wiki-search input::placeholder {
    color:#778396;
}

.wiki-search input::-webkit-search-cancel-button {
    -webkit-appearance:none;
    appearance:none;
    width:16px;
    height:16px;
    margin-right:4px;
    background:var(--wiki-muted);
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    cursor:pointer;
}

.wiki-search button {
    position:relative;
    display:grid;
    place-items:center;
    justify-self:center;
    width:36px;
    height:36px;
    min-height:0;
    padding:0;
    border:0;
    border-radius:8px;
    background:linear-gradient(135deg,var(--fate-gold),var(--fate-gold-bright));
    color:#171107;
    cursor:pointer;
}

.wiki-search button::after {
    content:"";
    position:absolute;
    inset:-4px;
}

.wiki-search button:hover {
    background:linear-gradient(135deg,#dcb658,#f6dc8e);
}

.wiki-search button:focus-visible {
    outline-offset:1px;
}

.wiki-search button svg {
    width:16px;
    height:16px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.wiki-page-action,.wiki-submit-action {
    border:1px solid rgba(215,174,88,.42);
    background:rgba(215,174,88,.08);
    color:var(--wiki-gold-soft);
    border-radius:999px;
    padding:.58rem .85rem;
    text-decoration:none;
    font-weight:700;
    font-size:.78rem;
    letter-spacing:.035em;
    cursor:pointer;
}

.wiki-kicker {
    margin:0 0 6px!important;
    color:var(--wiki-gold)!important;
    font:700 12px/1.3 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif!important;
    letter-spacing:.18em;
    text-transform:uppercase;
}

.wiki-frame {
    display:grid;
    grid-template-columns:minmax(0,1fr) 260px;
    gap:1.15rem;
    width:min(1640px,100%);
    margin:0 auto;
    padding:1.15rem clamp(16px,3vw,48px) 3rem;
    align-items:start;
}

.wiki-rail {
    position:sticky;
    top:calc(var(--wiki-nav-h) + 72px);
}

.wiki-content {
    min-width:0;
    min-height:700px;
    padding:clamp(1.25rem,2.6vw,2.5rem);
    border:1px solid var(--wiki-line);
    border-radius:14px;
    background:linear-gradient(155deg,rgba(18,25,37,.98),rgba(10,14,22,.98));
    box-shadow:0 24px 70px rgba(0,0,0,.28),inset 0 1px rgba(255,255,255,.025);
}

.wiki-content h2 {
    margin:0 0 1rem;
    color:var(--wiki-ink);
    font:600 21px/1.2 Cinzel,"Palatino Linotype","Book Antiqua",serif;
    letter-spacing:.02em;
}

.wiki-content h3 {
    position:relative;
    margin:2.1rem 0 .95rem;
    padding:0 0 .65rem;
    color:var(--wiki-ink);
    font:600 19px/1.25 Cinzel,"Palatino Linotype","Book Antiqua",serif;
    letter-spacing:.02em;
    border-bottom:1px solid var(--wiki-line);
}

.wiki-content h3::after {
    content:"";
    position:absolute;
    left:0;
    bottom:-1px;
    width:72px;
    height:1px;
    background:linear-gradient(90deg,var(--wiki-gold),transparent);
}

.wiki-content p {
    color:#aeb8c7;
    line-height:1.72;
}

.wiki-content a {
    color:var(--wiki-link);
    text-underline-offset:3px;
}

.wiki-content a:hover {
    color:#ffe4a0;
}

.wiki-rail {
    display:grid;
    gap:.8rem;
}

.wiki-article-head>h2 {
    display:none;
}

.wiki-article-head>p:last-child {
    max-width:820px;
    margin:.2rem 0 1.2rem;
    font-size:1.02rem;
}

.wiki-page-meta {
    margin:0 0 .4rem!important;
    color:var(--wiki-gold)!important;
    font-size:.66rem!important;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.17em;
}

.wiki-section {
    margin-top:1.7rem;
}

.wiki-section:first-child {
    margin-top:0;
}

.wiki-table {
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    margin:.8rem 0 1.35rem;
    border:1px solid var(--wiki-line);
    border-radius:10px;
    overflow:hidden;
    background:#0b1018;
    font-size:.88rem;
}

.wiki-table th,.wiki-table td {
    padding:.72rem .75rem;
    text-align:left;
    vertical-align:top;
    border-bottom:1px solid var(--wiki-line);
}

.wiki-table th {
    background:rgba(215,174,88,.07);
    color:#d7dde6;
    font-size:.68rem;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.wiki-table td {
    color:#aeb8c7;
}

.wiki-table tr:last-child td {
    border-bottom:0;
}

.wiki-table tbody tr {
    transition:background .15s ease;
}

.wiki-table tbody tr:hover {
    background:rgba(215,174,88,.045);
}

.wiki-pill-row,.wiki-class-badges {
    display:flex;
    flex-wrap:wrap;
    gap:.45rem;
    margin:.9rem 0 1.2rem;
}

.wiki-pill,.wiki-class-badges span {
    border:1px solid rgba(215,174,88,.25);
    background:rgba(215,174,88,.055);
    border-radius:999px;
    padding:.34rem .62rem;
    color:#c9d0da;
    text-decoration:none;
    font-size:.7rem;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.wiki-notice,.wiki-draft-recovery {
    border:1px solid rgba(97,181,172,.38);
    background:rgba(97,181,172,.08);
    color:#bfe4dd;
    padding:.85rem 1rem;
    border-radius:9px;
    margin-bottom:1rem;
}

.wiki-empty {
    background:rgba(255,255,255,.025);
    border:1px dashed rgba(215,174,88,.3);
    padding:1.2rem;
    border-radius:10px;
    color:var(--wiki-muted);
}

.wiki-submit-action {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#d2ab49,#f0d37e);
    color:#171107;
    border:0;
}

.wiki-page-action {
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.wiki-page-action-muted {
    border-color:var(--wiki-line);
    background:transparent;
    color:#8995a6;
}

.wiki-card-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
    gap:.75rem;
}

.wiki-ref-card,.wiki-review-card {
    position:relative;
    overflow:hidden;
    border:1px solid var(--wiki-line);
    border-radius:10px;
    background:linear-gradient(145deg,rgba(20,28,41,.92),rgba(12,17,26,.96));
    padding:1rem;
    transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}

.wiki-ref-card:hover {
    transform:translateY(-2px);
    border-color:rgba(215,174,88,.32);
    box-shadow:0 14px 35px rgba(0,0,0,.22);
}

.wiki-ref-card>span,.wiki-review-card>span {
    font-size:.62rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    color:var(--wiki-gold);
    font-weight:700;
}

.wiki-ref-card h3,.wiki-review-card h3 {
    border:0;
    margin:.35rem 0;
    font:600 15px/1.3 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    padding:0;
}

.wiki-ref-card h3::after,.wiki-review-card h3::after {
    display:none;
}

.wiki-ref-card h3 a {
    text-decoration:none;
}

.wiki-ref-card p {
    font-size:.86rem;
    margin:0;
    line-height:1.55;
}

.wiki-card-icon {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:2.25rem;
    height:2.25rem;
    margin:0 0 .55rem;
    border:1px solid rgba(215,174,88,.25);
    background:rgba(215,174,88,.06);
    color:var(--wiki-gold-soft);
    border-radius:8px;
}

.wiki-card-icon svg {
    display:block;
    width:1.35rem;
    height:1.35rem;
    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.wiki-class-tagline {
    border-left:2px solid var(--wiki-gold);
    background:linear-gradient(90deg,rgba(215,174,88,.08),transparent);
    margin:1rem 0;
    padding:.8rem 1rem;
    color:#cbd2dc!important;
    font:italic 400 15px/1.65 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

.wiki-contribution-callout {
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:.85rem;
    margin:1rem 0 1.35rem;
    padding:1rem;
    border:1px solid rgba(97,181,172,.35);
    border-radius:10px;
    background:linear-gradient(90deg,rgba(97,181,172,.1),rgba(97,181,172,.025));
}

.wiki-contribution-icon {
    display:grid;
    place-items:center;
    width:2.3rem;
    height:2.3rem;
    border:1px solid rgba(97,181,172,.45);
    border-radius:50%;
    color:#8cd3c7;
}

.wiki-contribution-callout strong {
    display:block;
    color:#d8eee9;
}

.wiki-contribution-callout p {
    margin:.15rem 0 0;
    font-size:.83rem;
}

.wiki-filter-bar {
    display:flex;
    align-items:center;
    gap:.7rem;
    margin:.8rem 0;
}

.wiki-filter-bar input {
    width:100%;
    border:1px solid var(--wiki-line);
    border-radius:999px;
    padding:.68rem .9rem;
    background:#090e16;
    color:var(--wiki-ink);
    font:inherit;
}

.wiki-body {
    line-height:1.75;
    color:#b9c2cf;
}

.wiki-body img {
    max-width:100%;
    height:auto;
    border-radius:10px;
}

.wiki-actions {
    display:flex;
    gap:.55rem;
    flex-wrap:wrap;
    border-top:1px solid var(--wiki-line);
    margin-top:2rem;
    padding-top:1rem;
}

.wiki-form-shell>h2 {
    display:none;
}

.wiki-editor-intro {
    max-width:830px;
}

.wiki-draft-recovery {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:1rem;
}

.wiki-draft-recovery[hidden] {
    display:none;
}

.wiki-draft-recovery strong,.wiki-draft-recovery span {
    display:block;
}

.wiki-draft-recovery span {
    margin-top:.15rem;
    color:#91bcb5;
    font-size:.8rem;
}

.wiki-form {
    display:grid;
    gap:1rem;
    max-width:900px;
}

.wiki-form>label {
    display:grid;
    gap:.4rem;
    color:#d8dee7;
    font-weight:700;
}

.wiki-form small {
    color:#758194;
    font-size:.76rem;
    font-weight:500;
    line-height:1.45;
}

.wiki-form input,.wiki-form textarea,.wiki-form select,.wiki-upload-inline input {
    width:100%;
    border:1px solid var(--wiki-line);
    border-radius:8px;
    padding:.72rem .8rem;
    font:inherit;
    color:var(--wiki-ink);
    background:#090e16;
}

.wiki-form input:focus,.wiki-form textarea:focus,.wiki-form select:focus,.wiki-upload-inline input:focus {
    outline:2px solid rgba(215,174,88,.28);
    border-color:rgba(215,174,88,.55);
}

.wiki-form textarea {
    resize:vertical;
    min-height:360px;
    font-family:"Cascadia Code",Consolas,monospace;
    font-size:.9rem;
    line-height:1.55;
}

.wiki-editor-toolbar {
    display:flex;
    align-items:center;
    gap:.45rem;
    flex-wrap:wrap;
    padding:.7rem;
    border:1px solid var(--wiki-line);
    border-radius:10px;
    background:rgba(255,255,255,.018);
    position:sticky;
    top:86px;
    z-index:8;
}

.wiki-save-status {
    margin-right:auto;
    color:#79c5b9;
    font-size:.76rem;
}

.wiki-category-fieldset {
    border:1px solid var(--wiki-line);
    border-radius:9px;
    padding:1rem;
}

.wiki-category-fieldset legend {
    padding:0 .35rem;
    font-weight:700;
    color:#cfd6df;
}

.wiki-category-checks {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
    gap:.45rem;
}

.wiki-category-checks label {
    display:flex;
    align-items:center;
    gap:.45rem;
    color:#aeb8c7;
    font-size:.82rem;
    font-weight:650;
}

.wiki-category-checks input {
    width:auto;
    accent-color:var(--wiki-gold);
}

.wiki-editor-preview {
    padding:1.2rem;
    border:1px solid rgba(215,174,88,.28);
    border-radius:11px;
    background:linear-gradient(145deg,rgba(215,174,88,.055),rgba(8,12,19,.9));
}

.wiki-editor-preview[hidden] {
    display:none;
}

.wiki-preview-label {
    color:var(--wiki-gold);
    font-size:.64rem;
    font-weight:700;
    letter-spacing:.15em;
    text-transform:uppercase;
}

.wiki-editor-preview h3 {
    margin:.45rem 0;
}

.wiki-preview-body {
    color:#b9c2cf;
    line-height:1.7;
}

.wiki-preview-image {
    display:inline-block;
    margin:.2rem;
    padding:.35rem .55rem;
    border:1px dashed var(--wiki-line-bright);
    border-radius:6px;
    color:var(--wiki-gold-soft);
    font-size:.75rem;
}

.wiki-editor-panel {
    border:1px solid var(--wiki-line);
    border-radius:11px;
    background:rgba(255,255,255,.018);
    padding:1rem;
    margin-top:1rem;
}

.wiki-panel-heading {
    display:flex;
    justify-content:space-between;
    align-items:end;
    gap:1rem;
}

.wiki-panel-heading span {
    color:var(--wiki-gold);
    font-size:.62rem;
    font-weight:700;
    letter-spacing:.13em;
    text-transform:uppercase;
}

.wiki-panel-heading h3 {
    margin:.18rem 0;
    border:0;
    padding:0;
}

.wiki-panel-heading h3::after {
    display:none;
}

.wiki-panel-heading a {
    font-size:.76rem;
}

.wiki-image-picker {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(92px,1fr));
    gap:.5rem;
}

.wiki-image-picker button {
    border:1px solid var(--wiki-line);
    border-radius:7px;
    background:#090e16;
    padding:.4rem;
    color:#aeb8c7;
    cursor:pointer;
}

.wiki-image-picker button:hover,.wiki-image-picker button:focus-visible {
    border-color:var(--wiki-gold);
}

.wiki-image-picker img {
    width:100%;
    height:62px;
    object-fit:contain;
    background:#070b11;
    border-radius:4px;
}

.wiki-image-picker span {
    display:block;
    margin-top:.25rem;
    font-size:.68rem;
}

.wiki-publish-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    margin-top:.3rem;
    padding:1rem;
    border:1px solid var(--wiki-line-bright);
    border-radius:10px;
    background:rgba(215,174,88,.04);
}

.wiki-publish-row strong,.wiki-publish-row span {
    display:block;
}

.wiki-publish-row span {
    margin-top:.2rem;
    color:#8793a4;
    font-size:.78rem;
}

.wiki-upload-inline {
    display:grid;
    grid-template-columns:1.2fr 1fr 1fr auto;
    gap:.65rem;
    align-items:end;
}

.wiki-upload-inline label {
    display:grid;
    gap:.35rem;
    color:#cbd2dc;
    font-size:.78rem;
    font-weight:700;
}

.wiki-upload-inline .wiki-page-action {
    white-space:nowrap;
}

.wiki-upload-inline #wiki-upload-status {
    grid-column:1/-1;
    color:#79c5b9;
    font-size:.76rem;
}

.wiki-image,.wiki-image-card {
    border:1px solid var(--wiki-line);
    background:#0b1018;
    padding:.65rem;
    margin:.9rem 0;
    border-radius:9px;
}

.wiki-image img {
    max-width:100%;
    height:auto;
    display:block;
    border-radius:6px;
}

.wiki-image figcaption {
    font-size:.82rem;
    color:var(--wiki-muted);
    margin-top:.45rem;
}

.wiki-image-missing {
    display:inline-block;
    border:1px dashed var(--wiki-line-bright);
    background:rgba(215,174,88,.08);
    color:var(--wiki-gold-soft);
    padding:.2rem .45rem;
}

.wiki-image-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:.8rem;
}

.wiki-image-card {
    display:grid;
    gap:.45rem;
    margin:0;
}

.wiki-image-card img {
    width:100%;
    height:132px;
    object-fit:contain;
    background:#070b11;
}

.wiki-image-card code {
    font-size:.76rem;
    white-space:normal;
    word-break:break-word;
    background:#080c13;
    border:1px solid var(--wiki-line);
    padding:.35rem;
}

.wiki-page-list {
    list-style:none;
    margin:0;
    padding:0;
    display:grid;
    gap:.2rem;
}

.wiki-page-list li {
    display:flex;
    justify-content:space-between;
    gap:1rem;
    border-bottom:1px solid var(--wiki-line);
    padding:.6rem .15rem;
}

.wiki-page-list span {
    color:var(--wiki-muted);
    font-size:.75rem;
}

.wiki-review-list {
    display:grid;
    gap:1rem;
}

.wiki-review-body {
    white-space:pre-wrap;
    max-height:360px;
    overflow:auto;
    background:#080c13;
    border:1px solid var(--wiki-line);
    padding:1rem;
    border-radius:7px;
    color:#c1cad6;
    font-family:Consolas,monospace;
}

.wiki-review-actions {
    display:flex;
    gap:.5rem;
    flex-wrap:wrap;
    align-items:center;
}

.wiki-review-actions form {
    margin:0;
}

.wiki-search-summary {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    margin-bottom:1rem;
    padding-bottom:1rem;
    border-bottom:1px solid var(--wiki-line);
}

.wiki-search-summary strong {
    font:600 16px Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

.wiki-search-summary span {
    color:var(--wiki-muted);
    font-size:.78rem;
}

.wiki-equipment-hub .wiki-card-grid,.wiki-item-summary .wiki-card-grid {
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:.65rem;
}

.wiki-equipment-hub .wiki-ref-card,.wiki-item-summary .wiki-ref-card {
    border-left:2px solid rgba(215,174,88,.55);
}

.wiki-equipment-list .wiki-table {
    font-size:.84rem;
}

.wiki-equipment-list .wiki-table td:first-child {
    font-weight:700;
}

.wiki-equipment-list .wiki-table td:nth-child(2),.wiki-equipment-list .wiki-table td:nth-child(3),.wiki-equipment-list .wiki-table td:nth-child(4) {
    white-space:nowrap;
}

.wiki-admin-tools {
    display:flex;
    gap:.5rem;
    flex-wrap:wrap;
    margin:.85rem 0 0;
}

.wiki-quest-arc .wiki-table,.wiki-quest-matrix .wiki-table {
    font-size:.8rem;
}

.wiki-quest-arc .wiki-table td:first-child,.wiki-quest-matrix .wiki-table td:nth-child(2) {
    font-weight:700;
}

.wiki-monster-list .wiki-table,.wiki-boss-roster .wiki-table {
    font-size:.82rem;
}

/* The site header is fixed (player-navigation.css), so the page starts below it and the wiki bar sticks under it. */
.fate-wiki {
    --wiki-nav-h:77px;
    padding-top:var(--wiki-nav-h);
}

/* The wiki bar: search, then the shelves, then the account link (S2, S4). */
.wiki-bar {
    position:sticky;
    top:var(--wiki-nav-h);
    z-index:30;
    border-bottom:1px solid var(--wiki-line);
    background:rgba(7,16,25,.92);
    -webkit-backdrop-filter:blur(14px);
    backdrop-filter:blur(14px);
}

.wiki-bar-inner {
    display:grid;
    grid-template-columns:minmax(240px,400px) minmax(0,1fr) auto;
    align-items:center;
    gap:20px;
    width:min(1640px,100%);
    min-height:56px;
    margin:0 auto;
    padding:6px clamp(16px,3vw,48px);
}

.wiki-shelves {
    position:relative;
    display:flex;
    gap:2px;
    min-width:0;
    overflow-x:auto;
    scrollbar-width:none;
}

.wiki-shelves::-webkit-scrollbar {
    display:none;
}

.wiki-shelves a {
    position:relative;
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    gap:6px;
    height:40px;
    padding:0 12px;
    border-radius:7px;
    color:#aeb8c7;
    font:600 13px/1 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    text-decoration:none;
    white-space:nowrap;
    transition:color .16s ease,background .16s ease;
}

.wiki-shelves a:hover,.wiki-shelves a:focus-visible {
    color:var(--wiki-ink);
    background:rgba(244,238,223,.04);
}

.wiki-shelves a small {
    color:#7b8798;
    font:500 11px/1 Inter,ui-sans-serif,system-ui,sans-serif;
    font-variant-numeric:tabular-nums;
}

.wiki-shelves a[aria-current="page"] {
    color:var(--wiki-gold-soft);
}

/* Without wiki.js: a still thread and knot under the current shelf. */
.wiki-shelves a[aria-current="page"]::after {
    content:"";
    position:absolute;
    left:12px;
    right:12px;
    bottom:2px;
    height:2px;
    background:var(--fate-thread-line);
    box-shadow:0 0 8px rgba(242,208,138,.55);
    transform-origin:0 50%;
    animation:wiki-thread-draw var(--fate-dur-reveal) var(--fate-ease-thread) both;
}

.wiki-shelves a[aria-current="page"]::before {
    content:"";
    position:absolute;
    right:7px;
    bottom:-3px;
    width:10px;
    height:10px;
    background:var(--fate-knot-image) center/contain no-repeat;
    animation:wiki-knot-pop var(--fate-dur-pop) var(--fate-ease-snap) var(--fate-dur-pop) both;
}

/* With wiki.js: one thread that slides to the shelf pointed at (M1). */
.wiki-shelves.has-shelf-thread a[aria-current="page"]::after,.wiki-shelves.has-shelf-thread a[aria-current="page"]::before {
    content:none;
}

.wiki-shelf-thread,.wiki-shelf-knot {
    position:absolute;
    left:0;
    pointer-events:none;
    opacity:0;
    transition:transform var(--fate-dur-ui) var(--fate-ease-settle),width var(--fate-dur-ui) var(--fate-ease-settle),opacity var(--fate-dur-tap) ease;
}

.wiki-shelf-thread {
    bottom:2px;
    width:var(--shelf-w,0px);
    height:2px;
    transform:translateX(var(--shelf-x,0px));
    background:var(--fate-thread-line);
    box-shadow:0 0 8px rgba(242,208,138,.55);
}

.wiki-shelf-knot {
    bottom:-3px;
    width:10px;
    height:10px;
    transform:translateX(calc(var(--shelf-x,0px) + var(--shelf-w,0px) - 5px));
    background:var(--fate-knot-image) center/contain no-repeat;
    transition-delay:40ms;
}

.wiki-shelves.is-threaded .wiki-shelf-thread,.wiki-shelves.is-threaded .wiki-shelf-knot {
    opacity:1;
}

.wiki-shelves.is-instant .wiki-shelf-thread,.wiki-shelves.is-instant .wiki-shelf-knot {
    transition:none;
}

.wiki-bar-account {
    display:flex;
    gap:14px;
}

.wiki-bar-account a {
    color:#aeb8c7;
    font:600 13px/1 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    text-decoration:none;
    white-space:nowrap;
}

.wiki-bar-account a:hover,.wiki-bar-account a:focus-visible {
    color:var(--wiki-gold-soft);
}

@keyframes wiki-thread-draw {
    from {
        transform:scaleX(0);
    }
    to {
        transform:scaleX(1);
    }
}

@keyframes wiki-knot-pop {
    from {
        transform:scale(0) rotate(-45deg);
    }
    to {
        transform:scale(1) rotate(0);
    }
}

/* The site footer (templates/layout/footer.php) at the end of every wiki page. */
.wiki-footer {
    margin-top:2rem;
    border-top:1px solid var(--wiki-line);
}

.wiki-footer-inner {
    width:min(1240px,100%);
    margin:0 auto;
    padding:1.6rem clamp(16px,3vw,48px) 1.2rem;
    text-align:center;
}

.wiki-footer .public-bottom {
    max-width:72ch;
    margin:0 auto 1rem;
    color:var(--wiki-muted);
    font-size:13px;
    line-height:1.6;
}

.wiki-footer .public-bottom a {
    color:var(--wiki-link);
}

/* The shared footer's social pills: public pages style them in modern-experience.css, which the wiki does not load. */
.wiki-footer .public-footer-social {
    display:flex;
    justify-content:center;
    margin:.25rem 0 .5rem;
}

.wiki-footer .social-links {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:.5rem;
    margin:0;
    padding:0;
    list-style:none;
}

.wiki-footer .social-links a {
    display:inline-flex;
    align-items:center;
    gap:.5rem;
    min-height:40px;
    padding:.5rem .9rem;
    border:1px solid #a7bec633;
    border-radius:99px;
    background:#15233180;
    color:#d6e1e8;
    font-size:.78rem;
    text-decoration:none;
}

.wiki-footer .social-links a:hover {
    background:#1f3344;
    color:#fff3da;
}

/* The page plate: crumbs, kicker, title, one line (V5). Fixed padding per kind, so missing art never shifts it. */
.wiki-plate {
    border-bottom:1px solid var(--wiki-line);
    background:radial-gradient(circle at 88% 0%,rgba(215,174,88,.09),transparent 42%),linear-gradient(180deg,rgba(14,19,29,.6),transparent);
}

.wiki-plate-inner {
    width:min(1640px,100%);
    margin:0 auto;
    padding:26px clamp(16px,3vw,48px) 24px;
}

.wiki-crumbs {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px 8px;
    margin:0 0 14px;
    color:#7f8b9c;
    font:500 13px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-crumbs a {
    color:var(--wiki-muted);
    text-decoration:none;
}

.wiki-crumbs a:hover,.wiki-crumbs a:focus-visible {
    color:var(--wiki-ink);
}

.wiki-crumbs [aria-current] {
    display:inline-flex;
    align-items:center;
    gap:6px;
    color:var(--wiki-ink);
    font-weight:600;
}

.wiki-crumbs [aria-current]::after {
    content:"";
    width:10px;
    height:10px;
    background:var(--fate-knot-image) center/contain no-repeat;
}

.wiki-plate h1 {
    margin:0;
    color:var(--wiki-ink);
    font:700 clamp(28px,17.6px + 2.6vw,48px)/1.08 Cinzel,"Palatino Linotype","Book Antiqua",serif;
    letter-spacing:.02em;
    text-wrap:balance;
}

.wiki-plate-lede {
    max-width:64ch;
    margin:10px 0 0;
    color:#b9c2cf;
    font-size:15px;
    line-height:1.6;
}

.wiki-plate-counts {
    margin:12px 0 0;
    color:var(--wiki-muted);
    font-size:13px;
}

.wiki-plate-counts strong {
    color:var(--wiki-gold-soft);
    font-variant-numeric:tabular-nums;
}

.wiki-plate[data-kind="boss"] .wiki-kicker {
    color:var(--wiki-role-boss)!important;
}

/* The plinth (A1, V6, X2): the game's own art on the command-window navy. Pixel art draws at whole-number scales and is
   never smoothed; painted art scales smoothly. Each kind has one fixed box, so "Sprite pending" never shifts the page. */
.wiki-plate-inner.has-plinth {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:20px clamp(20px,3vw,44px);
}

.wiki-plinth {
    position:relative;
    display:grid;
    place-items:center;
    width:160px;
    height:160px;
    overflow:hidden;
    border:2px solid var(--fate-window-rule);
    border-radius:10px;
    background:var(--fate-window-navy);
    box-shadow:0 0 0 2px var(--fate-window-ring),0 18px 40px rgba(0,0,0,.35);
    isolation:isolate;
}

.wiki-plinth::before {
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    background:radial-gradient(circle at 50% 62%,rgba(215,174,88,.45),transparent 62%);
    opacity:.45;
}

.wiki-plate[data-kind="boss"] .wiki-plinth {
    width:192px;
    height:192px;
}

.wiki-plate[data-kind="npc"] .wiki-plinth {
    height:224px;
}

.wiki-plinth img {
    display:block;
    width:var(--art-w);
    height:var(--art-h);
    max-width:none;
}

.wiki-plinth.is-pixel img,.wiki-cell-icon {
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

.wiki-plinth.is-pending i {
    width:56px;
    height:56px;
    margin-top:-18px;
    clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
    background:rgba(244,238,223,.16);
}

.wiki-plinth.is-pending span {
    position:absolute;
    left:50%;
    bottom:14px;
    padding:3px 9px;
    border:1px solid rgba(244,238,223,.22);
    border-radius:999px;
    color:#b9c2cf;
    font:600 11px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.06em;
    text-transform:uppercase;
    white-space:nowrap;
    transform:translateX(-50%);
}

/* A bestiary page at a glance (P1): Inter 600 pills tied together with knots. */
.wiki-glance {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px 0;
    margin:16px 0 0;
    padding:0;
    list-style:none;
    color:#d7dde6;
    font:600 13px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-glance li {
    display:flex;
    align-items:center;
    font-variant-numeric:tabular-nums;
}

.wiki-glance li+li::before {
    content:"";
    width:10px;
    height:10px;
    margin:0 10px;
    background:var(--fate-knot-image) center/contain no-repeat;
    opacity:.8;
}

/* A table link to an item or monster page carries the game's icon at 1x. */
.wiki-cell-icon {
    display:inline-block;
    margin:-4px 8px -4px 0;
    vertical-align:middle;
}

/* A table link with an icon keeps the icon beside the whole name, so a wrapped name lines up instead of tucking under
   the icon; and a number range inside a line of words never splits at its dash. */
.wiki-cell-link {
    display:inline-flex;
    align-items:center;
    gap:8px;
}

.wiki-cell-link .wiki-cell-icon,.wiki-cell-link .wiki-skill-ring {
    flex:none;
    margin:0;
}

.wiki-range {
    white-space:nowrap;
}

/* The plinth breathes; the sprite never moves (M6). Boss plates add a slow star-chart drift behind the art. */
@media(prefers-reduced-motion:no-preference) {
    .wiki-plate .wiki-plinth::before {
        animation:wiki-plinth-breathe 4.8s var(--fate-ease-drift) infinite alternate;
    }
    .wiki-plate[data-kind="boss"] .wiki-plinth::after {
        animation:wiki-plinth-stars 8s linear infinite alternate;
    }
}

.wiki-plate[data-kind="boss"] .wiki-plinth::after {
    content:"";
    position:absolute;
    inset:-12%;
    z-index:-1;
    background:radial-gradient(1.5px 1.5px at 18% 28%,rgba(255,243,207,.75),transparent 70%),radial-gradient(1px 1px at 72% 18%,rgba(255,243,207,.6),transparent 70%),radial-gradient(1.5px 1.5px at 84% 64%,rgba(255,243,207,.55),transparent 70%),radial-gradient(1px 1px at 36% 82%,rgba(255,243,207,.6),transparent 70%),radial-gradient(1px 1px at 58% 44%,rgba(255,243,207,.4),transparent 70%),radial-gradient(1px 1px at 10% 70%,rgba(255,243,207,.5),transparent 70%);
    opacity:.7;
}

@keyframes wiki-plinth-breathe {
    from {
        opacity:.35;
    }
    to {
        opacity:.55;
    }
}

@keyframes wiki-plinth-stars {
    from {
        transform:translate3d(0,0,0);
    }
    to {
        transform:translate3d(-5%,-4%,0);
    }
}

/* Phones: the plinth stands above the title, one scale step smaller (sprites 3x, icons 2x). */
@media(max-width:640px) {
    .wiki-plate-inner.has-plinth {
        grid-template-columns:minmax(0,1fr);
        justify-items:center;
        row-gap:0;
        text-align:center;
    }
    .wiki-plate-inner.has-plinth .wiki-plate-copy {
        display:contents;
    }
    .wiki-plate-inner.has-plinth .wiki-crumbs {
        order:-2;
    }
    .wiki-plate-inner.has-plinth .wiki-plinth {
        order:-1;
        width:120px;
        height:120px;
        margin:0 0 18px;
    }
    .wiki-plate[data-kind="boss"] .wiki-plate-inner.has-plinth .wiki-plinth {
        width:144px;
        height:144px;
    }
    .wiki-plinth img {
        width:var(--art-w-phone);
        height:var(--art-h-phone);
    }
    .wiki-plinth.is-pending i {
        width:40px;
        height:40px;
        margin-top:-16px;
    }
    .wiki-plinth.is-pending span {
        bottom:10px;
    }
    .wiki-plate-inner.has-plinth .wiki-crumbs,.wiki-plate-inner.has-plinth .wiki-glance {
        justify-content:center;
    }
    .wiki-plate-inner.has-plinth .wiki-plate-lede {
        margin-inline:auto;
    }
}

/* Where a page's numbers come from, in one line (C3). */
.wiki-source {
    margin:2rem 0 0!important;
    padding-top:14px;
    border-top:1px solid var(--wiki-line);
    color:#8a95a6!important;
    font-size:13px;
    line-height:1.6!important;
}

/* On this page, beside long articles, with a thread beside the current section (S5). */
.wiki-toc {
    display:grid;
    padding:4px 0 4px 14px;
    border-left:1px solid var(--wiki-line);
    font:500 13px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-toc p {
    margin:0 0 8px;
    color:var(--wiki-gold);
    font:700 11px/1 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.16em;
    text-transform:uppercase;
}

.wiki-toc a {
    position:relative;
    padding:6px 0;
    color:var(--wiki-muted);
    text-decoration:none;
}

.wiki-toc a:hover,.wiki-toc a:focus-visible {
    color:var(--wiki-ink);
}

.wiki-toc a[aria-current="true"] {
    color:var(--wiki-ink);
}

.wiki-toc a[aria-current="true"]::before {
    content:"";
    position:absolute;
    left:-15px;
    top:6px;
    bottom:6px;
    width:2px;
    background:var(--fate-thread);
    box-shadow:0 0 6px rgba(242,208,138,.6);
}

.wiki-status {
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    gap:4px 8px;
    margin:0;
    padding:12px 14px;
    border:1px solid rgba(215,174,88,.3);
    border-radius:10px;
    color:#d7dde6;
    font:500 12.5px/1.5 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-status-dot {
    flex:0 0 auto;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#7fd6b0;
}

.wiki-status a {
    color:var(--wiki-link);
    font-weight:600;
    text-decoration:none;
}

/* Phones and narrow screens: the section list folds into a Jump to disclosure at the top of the article. */
.wiki-jump {
    display:none;
    margin:0 0 1.2rem;
    border:1px solid var(--wiki-line);
    border-radius:10px;
    background:rgba(244,238,223,.02);
}

.wiki-jump summary {
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:44px;
    padding:0 14px;
    color:var(--wiki-ink);
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    list-style:none;
    cursor:pointer;
}

.wiki-jump summary::-webkit-details-marker {
    display:none;
}

.wiki-jump summary::after {
    content:"";
    width:8px;
    height:8px;
    border-right:1.5px solid currentColor;
    border-bottom:1.5px solid currentColor;
    transform:rotate(45deg);
}

.wiki-jump[open] summary::after {
    transform:rotate(-135deg);
}

.wiki-jump nav {
    display:grid;
    padding:0 14px 6px;
}

.wiki-jump nav a {
    display:flex;
    align-items:center;
    min-height:44px;
    border-top:1px solid var(--wiki-line);
    color:var(--wiki-muted);
    text-decoration:none;
}

@media(max-width:1320px) {
    .wiki-jump {
        display:block;
    }
    .wiki-frame {
        grid-template-columns:minmax(0,1fr);
    }
    .wiki-rail {
        display:none;
    }

}

@media(max-width:900px) {

    .wiki-frame {
        grid-template-columns:minmax(0,1fr);
        padding:.75rem 0 3rem;
    }

    .wiki-content {
        border-radius:0;
        border-left:0;
        border-right:0;
        padding:1.2rem;
    }
    .wiki-editor-toolbar {
        top:0;
    }
    .wiki-upload-inline {
        grid-template-columns:minmax(0,1fr);
    }
    .wiki-upload-inline #wiki-upload-status {
        grid-column:auto;
    }
    .wiki-publish-row {
        align-items:flex-start;
        flex-direction:column;
    }

}

@media(max-width:560px) {

    .wiki-card-grid {
        grid-template-columns:minmax(0,1fr);
    }
    .wiki-content {
        padding:1rem;
    }
    .wiki-editor-toolbar {
        display:grid;
        grid-template-columns:1fr 1fr;
    }
    .wiki-save-status {
        grid-column:1/-1;
    }
    .wiki-draft-recovery {
        align-items:flex-start;
        flex-direction:column;
    }
    .wiki-contribution-callout {
        grid-template-columns:auto minmax(0,1fr);
    }
    .wiki-contribution-callout .wiki-page-action {
        grid-column:1/-1;
    }
    .wiki-page-list li {
        align-items:flex-start;
        flex-direction:column;
        gap:.2rem;
    }

}

@media(prefers-reduced-motion:reduce) {
    .wiki-ref-card,.wiki-table tbody tr {
        transition:none;
    }
    .wiki-ref-card:hover {
        transform:none;
    }

}

.fate-wiki :focus-visible {
    outline:2px solid var(--wiki-gold-soft);
    outline-offset:3px;
}

.fate-wiki .visually-hidden {
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}

.wiki-search-best {
    border-color:rgba(215,174,88,.48);
    background:linear-gradient(145deg,rgba(58,48,22,.55),rgba(12,17,26,.96));
}

.wiki-page-group h3 small {
    margin-left:.35rem;
    color:var(--wiki-muted);
    font:700 .68rem Inter,system-ui,sans-serif;
}

.wiki-empty strong {
    color:#dfe5ed;
}

.wiki-empty p {
    margin:.45rem 0 .85rem;
}

@media(max-width:768px) {
    .fate-wiki {
        --wiki-nav-h:65px;
    }

}

@media(max-width:900px) {
    /* No longer sticky, but still positioned: a static bar loses its z-index, and the plate art and thread knots
       further down then paint over the open quick-find list. */
    .wiki-bar {
        position:relative;
        top:auto;
    }
    .wiki-bar-inner {
        grid-template-columns:minmax(0,1fr) auto;
        gap:8px 14px;
        padding:10px 16px 4px;
    }
    .wiki-shelves {
        grid-column:1/-1;
        grid-row:2;
        margin:0 -16px;
        padding:0 16px 4px;
        -webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
        mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
    }
    .wiki-bar-account {
        grid-column:2;
        grid-row:1;
    }

}

@media(prefers-reduced-motion:reduce) {
    .wiki-shelves a[aria-current="page"]::after,.wiki-shelves a[aria-current="page"]::before {
        animation:none;
    }
    .wiki-shelf-thread,.wiki-shelf-knot {
        transition:opacity var(--fate-dur-tap) ease;
    }

}

/* Ledger tables on phones (V3): every row stacks into label and value lines, nothing scrolls sideways. */
@media(max-width:700px) {
    .wiki-table thead {
        position:absolute;
        width:1px;
        height:1px;
        overflow:hidden;
        clip:rect(0 0 0 0);
        white-space:nowrap;
    }
    .wiki-table,.wiki-table tbody {
        display:block;
    }
    .wiki-table tr {
        display:grid;
        grid-template-columns:minmax(0,1fr);
        gap:2px;
        padding:10px 12px;
        border-bottom:1px solid var(--wiki-line);
    }
    .wiki-table tr:last-child {
        border-bottom:0;
    }
    .wiki-table td {
        position:relative;
        display:block;
        min-height:1.7em;
        padding:3px 0 3px calc(36% + 10px);
        border:0;
        font-size:14px;
        white-space:normal!important;
        overflow-wrap:anywhere;
    }
    .wiki-table td::before {
        content:attr(data-label);
        position:absolute;
        top:3px;
        left:0;
        width:36%;
        color:var(--wiki-muted);
        font:600 11px/1.7 Inter,ui-sans-serif,system-ui,sans-serif;
        letter-spacing:.08em;
        text-transform:uppercase;
    }
    .wiki-table td[data-label=""] {
        padding-left:0;
    }
    .wiki-table td[data-label=""]::before {
        content:none;
    }
    /* The label keeps up to 42% of the row and the value takes the rest. (An auto value column once took the whole
       row whenever the value was a sentence, leaving labels 0 px wide: one letter per line.) */
    .wiki-table-kv tr {
        grid-template-columns:fit-content(42%) minmax(0,1fr);
        align-items:baseline;
        gap:4px 14px;
        min-height:44px;
    }
    .wiki-table-kv td {
        display:block;
        padding:0;
    }
    .wiki-table-kv td::before {
        content:none;
    }
    .wiki-table-kv td:first-child {
        color:var(--wiki-muted);
        font-weight:600;
    }
    .wiki-table-kv td:last-child {
        color:var(--wiki-ink);
        text-align:right;
        font-variant-numeric:tabular-nums;
    }
    /* A sentence (is-prose, set by the template) reads under its label, left to right. */
    .wiki-table-kv tr.is-prose {
        grid-template-columns:minmax(0,1fr);
    }
    .wiki-table-kv tr.is-prose td:last-child {
        text-align:left;
    }
}

/* The guide home (P10): the search is the plate's hero; three doors, eight shelves, the Trail, then a workshop row. */
.wiki-frame.no-rail {
    grid-template-columns:minmax(0,1fr);
}

.wiki-bar.is-home .wiki-bar-inner {
    grid-template-columns:minmax(0,1fr) auto;
}

.wiki-search-hero {
    grid-template-columns:48px minmax(0,1fr) 48px;
    max-width:640px;
    height:52px;
    margin:20px 0 0;
    border-radius:12px;
}

.wiki-search-hero input {
    height:50px;
    font-size:17px;
}

.wiki-search-hero button {
    width:40px;
    height:40px;
}

.wiki-status-chip {
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin:14px 0 0;
    padding:6px 12px;
    border:1px solid rgba(215,174,88,.3);
    border-radius:999px;
    color:#d7dde6;
    font:500 12.5px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-home>section+section,.wiki-home>section+nav {
    margin-top:2.4rem;
}

.wiki-home h2,.wiki-results h2 {
    margin:0 0 14px;
}

.wiki-door-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}

.wiki-door,.wiki-shelf-tile,.wiki-result-row {
    color:var(--wiki-ink);
    text-decoration:none;
    transition:border-color var(--fate-dur-ui) var(--fate-ease-settle),transform var(--fate-dur-ui) var(--fate-ease-settle),background-color var(--fate-dur-ui) var(--fate-ease-settle);
}

.wiki-door {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:14px;
    min-height:96px;
    padding:14px 16px;
    border:1px solid var(--wiki-line);
    border-radius:12px;
    background:rgba(244,238,223,.025);
}

.wiki-door:hover,.wiki-door:focus-visible,.wiki-shelf-tile:hover,.wiki-shelf-tile:focus-visible {
    border-color:rgba(215,174,88,.5);
    transform:translateY(-2px);
}

.wiki-door-art {
    box-sizing:content-box;
    padding:8px;
    border:1px solid rgba(243,236,220,.4);
    border-radius:10px;
    background:var(--fate-window-navy);
}

.wiki-door-copy {
    display:grid;
    gap:4px;
}

.wiki-door-copy strong {
    font:600 16px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-door-copy span {
    color:var(--wiki-muted);
    font-size:14px;
    line-height:1.5;
}

.wiki-shelf-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}

.wiki-shelf-tile {
    display:flex;
    flex-direction:column;
    gap:4px;
    min-height:132px;
    padding:14px 16px;
    border:1px solid var(--wiki-line);
    border-radius:12px;
    background:linear-gradient(160deg,rgba(244,238,223,.035),rgba(244,238,223,.01));
}

.wiki-shelf-tile strong {
    color:var(--wiki-gold-soft);
    font:700 24px/1.1 Inter,ui-sans-serif,system-ui,sans-serif;
    font-variant-numeric:tabular-nums;
}

.wiki-shelf-name {
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-shelf-samples {
    display:flex;
    align-items:flex-end;
    gap:8px;
    min-height:48px;
    margin-top:auto;
    padding-top:8px;
}

.wiki-shelf-samples img,.wiki-door-art,.wiki-trail-plinth img,.wiki-result-art img,.wiki-result-hero-art img,.wiki-art-library img {
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

/* An NPC face crop starts at the head (--face-y, measured per sprite by scripts/wiki_art.mjs), not at the empty space
   above it; without the measurement it falls back to the top. */
.fate-wiki img[data-crop="top"] {
    object-fit:cover;
    object-position:50% var(--face-y,0%);
}

.wiki-workshop {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px 0;
    margin-top:2.4rem;
    padding-top:16px;
    border-top:1px solid var(--wiki-line);
    font:500 14px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-workshop span {
    margin-right:14px;
    color:var(--wiki-gold);
    font:700 11px/1 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.16em;
    text-transform:uppercase;
}

.wiki-workshop a {
    display:inline-flex;
    align-items:center;
    min-height:44px;
    color:var(--wiki-link);
    text-decoration:none;
}

.wiki-workshop a+a::before {
    content:"";
    width:8px;
    height:8px;
    margin:0 12px;
    background:var(--fate-knot-image) center/contain no-repeat;
    opacity:.6;
}

/* The Trail (X1): one thread through real pages; it draws when it scrolls into view and the stops pop in turn. */
.wiki-trail-band>p {
    margin:0;
}

.wiki-trail-scroll {
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
}

.wiki-trail-scroll::-webkit-scrollbar {
    display:none;
}

.wiki-trail {
    position:relative;
    display:grid;
    grid-auto-flow:column;
    grid-auto-columns:minmax(112px,1fr);
    width:max-content;
    min-width:100%;
    margin:0;
    padding:18px 0 6px;
    list-style:none;
}

.wiki-trail::before {
    content:"";
    position:absolute;
    top:57px;
    left:calc(50% / var(--stops));
    right:calc(50% / var(--stops));
    height:2px;
    background:var(--fate-thread-line);
    filter:var(--fate-thread-glow);
    transform-origin:left center;
}

.wiki-trail-stop {
    position:relative;
    display:flex;
    justify-content:center;
    scroll-snap-align:center;
}

.wiki-trail-stop+.wiki-trail-stop::before {
    content:"";
    position:absolute;
    top:51px;
    left:-7px;
    width:14px;
    height:14px;
    background:var(--fate-knot-image) center/contain no-repeat;
    opacity:.9;
}

.wiki-trail-stop>a,.wiki-trail-stop>span {
    display:grid;
    justify-items:center;
    align-content:start;
    gap:6px;
    padding:0 6px;
    color:var(--wiki-ink);
    text-align:center;
    text-decoration:none;
}

.wiki-trail-plinth {
    position:relative;
    z-index:1;
    display:grid;
    place-items:center;
    width:80px;
    height:80px;
    border:2px solid var(--fate-window-rule);
    border-radius:10px;
    background:var(--fate-window-navy);
    box-shadow:0 0 0 2px var(--fate-window-ring);
}

.wiki-trail-plinth.is-empty i {
    width:26px;
    height:26px;
    clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
    background:rgba(244,238,223,.2);
}

.wiki-trail-stop a:hover .wiki-trail-plinth,.wiki-trail-stop a:focus-visible .wiki-trail-plinth,.wiki-trail-stop [aria-current] .wiki-trail-plinth {
    border-color:var(--fate-gold-bright);
    box-shadow:0 0 0 2px var(--fate-window-ring),0 0 18px rgba(242,208,138,.35);
}

.wiki-trail-label {
    max-width:16ch;
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-trail-kind {
    color:var(--wiki-muted);
    font:600 11px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.12em;
    text-transform:uppercase;
}

@media(prefers-reduced-motion:no-preference) {
    .wiki-trail[data-armed]::before {
        transform:scaleX(0);
        transition:transform var(--fate-dur-reveal) var(--fate-ease-thread);
    }
    .wiki-trail[data-armed] .wiki-trail-plinth {
        opacity:0;
        transform:scale(.6);
        transition:opacity var(--fate-dur-pop) var(--fate-ease-snap),transform var(--fate-dur-pop) var(--fate-ease-snap);
        transition-delay:calc(120ms * var(--stop) + 200ms);
    }
    .wiki-trail[data-armed] .wiki-trail-stop+.wiki-trail-stop::before {
        opacity:0;
        transition:opacity var(--fate-dur-pop) ease calc(120ms * var(--stop) + 120ms);
    }
    .wiki-trail[data-armed].is-drawn::before {
        transform:none;
    }
    .wiki-trail[data-armed].is-drawn .wiki-trail-plinth {
        opacity:1;
        transform:none;
    }
    .wiki-trail[data-armed].is-drawn .wiki-trail-stop+.wiki-trail-stop::before {
        opacity:.9;
    }
}

/* Search results (P8): the best match as a hero, then compact rows grouped by kind. */
.wiki-result-hero {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:20px;
    margin:0 0 2rem;
    padding:18px 20px;
    border:1px solid rgba(215,174,88,.42);
    border-radius:12px;
    background:linear-gradient(145deg,rgba(58,48,22,.45),rgba(12,17,26,.9));
}

.wiki-result-hero-art {
    display:grid;
    place-items:center;
    min-width:112px;
    min-height:112px;
    border:2px solid var(--fate-window-rule);
    border-radius:10px;
    background:var(--fate-window-navy);
    box-shadow:0 0 0 2px var(--fate-window-ring);
}

.wiki-result-hero h2 {
    margin:4px 0 6px;
}

.wiki-result-hero h2 a {
    color:var(--wiki-ink);
    text-decoration:none;
}

.wiki-result-hero p {
    margin:0;
}

.wiki-result-kicker {
    color:var(--wiki-gold)!important;
    font:700 11px/1.4 Inter,ui-sans-serif,system-ui,sans-serif!important;
    letter-spacing:.14em;
    text-transform:uppercase;
}

.wiki-result-group+.wiki-result-group {
    margin-top:1.8rem;
}

.wiki-result-group h2 small {
    color:var(--wiki-muted);
    font:600 13px Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-result-group ul {
    margin:0;
    padding:0;
    border-top:1px solid var(--wiki-line);
    list-style:none;
}

.wiki-result-row {
    display:grid;
    grid-template-columns:48px minmax(0,1fr);
    align-items:center;
    gap:14px;
    min-height:56px;
    padding:4px 6px;
    border-bottom:1px solid var(--wiki-line);
}

.wiki-result-row:hover,.wiki-result-row:focus-visible {
    background-color:rgba(244,238,223,.04);
}

.wiki-result-art {
    display:grid;
    place-items:center;
    width:48px;
    height:48px;
}

.wiki-result-art i {
    width:14px;
    height:14px;
    clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
    background:rgba(244,238,223,.2);
}

.wiki-result-text {
    display:grid;
    gap:2px;
    min-width:0;
}

.wiki-result-text strong {
    color:var(--wiki-ink);
    font:600 15px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

/* Note cards (P9, C5): a reason and a next step instead of an empty box. */
.wiki-note {
    padding:18px 20px;
    border:1px solid rgba(215,174,88,.3);
    border-radius:12px;
    background:rgba(244,238,223,.025);
}

.wiki-note p {
    margin:0;
}

.wiki-note p+p,.wiki-note p+ul,.wiki-note ul+p {
    margin-top:12px;
}

.wiki-note-actions {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.wiki-note-actions .wiki-page-action {
    min-height:44px;
    padding:0 16px;
}

.wiki-note-quiet {
    color:var(--wiki-muted)!important;
    font-size:14px;
}

.wiki-note-label {
    color:var(--wiki-ink)!important;
    font-weight:600;
}

.wiki-note-links {
    display:grid;
    margin:0;
    padding:0;
    list-style:none;
}

.wiki-note-links a {
    display:flex;
    align-items:center;
    min-height:44px;
    border-bottom:1px solid var(--wiki-line);
    color:var(--wiki-link);
    text-decoration:none;
}

/* What changed in the guide (P9): dated, newest first. */
.wiki-changelog {
    display:grid;
    gap:14px;
    margin:0;
    padding:0;
    list-style:none;
}

.wiki-changelog li {
    display:grid;
    gap:4px;
    padding:14px 16px;
    border-left:2px solid var(--fate-thread);
    background:rgba(244,238,223,.02);
}

.wiki-changelog time {
    color:var(--wiki-gold);
    font:700 11px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.14em;
    text-transform:uppercase;
}

.wiki-changelog p {
    margin:0;
}

/* The game's own art library (P9). */
.wiki-art-library {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(104px,1fr));
    gap:10px;
    margin:0 0 1.6rem;
    padding:0;
    list-style:none;
}

.wiki-art-library a {
    display:grid;
    justify-items:center;
    align-content:start;
    gap:6px;
    min-height:104px;
    padding:12px 6px;
    border:1px solid var(--wiki-line);
    border-radius:10px;
    background:var(--fate-window-navy);
    color:var(--wiki-ink);
    font:500 12.5px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    text-align:center;
    text-decoration:none;
}

.wiki-art-library a:hover,.wiki-art-library a:focus-visible {
    border-color:rgba(215,174,88,.5);
}

.wiki-content h4 {
    margin:1.4rem 0 .7rem;
    color:var(--wiki-ink);
    font:600 15px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-content h4 small {
    color:var(--wiki-muted);
    font-weight:500;
}

/* Help finish this page (C5): the gaps, named. */
.wiki-gaps {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:6px 0;
    margin:6px 0 4px;
    padding:0;
    list-style:none;
    color:var(--wiki-ink);
    font:600 13px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-gaps li {
    display:flex;
    align-items:center;
}

.wiki-gaps li+li::before {
    content:"";
    width:8px;
    height:8px;
    margin:0 9px;
    background:var(--fate-knot-image) center/contain no-repeat;
    opacity:.7;
}

@media(max-width:1023px) {
    .wiki-shelf-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:900px) {
    .wiki-door-grid {
        grid-template-columns:minmax(0,1fr);
    }
}

@media(max-width:640px) {
    .wiki-search-hero {
        max-width:none;
    }
    .wiki-status-chip {
        border-radius:12px;
    }
    .wiki-shelf-tile {
        min-height:120px;
        padding:12px;
    }
    .wiki-trail-scroll {
        -webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
        mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent);
    }
    .wiki-trail {
        grid-auto-columns:minmax(96px,1fr);
    }
    .wiki-trail-label {
        max-width:11ch;
    }
    .wiki-result-hero {
        grid-template-columns:minmax(0,1fr);
        justify-items:start;
    }
}

@media(prefers-reduced-motion:reduce) {
    .wiki-door,.wiki-shelf-tile,.wiki-result-row {
        transition:none;
    }
    .wiki-door:hover,.wiki-shelf-tile:hover {
        transform:none;
    }
}

/* From the game's data (D2): one approved ledger per archive, its counts, and every change on demand. */
.wiki-ledger {
    padding:16px 18px;
    border:1px solid var(--wiki-line);
    border-left:2px solid var(--fate-thread);
    border-radius:0 12px 12px 0;
    background:rgba(244,238,223,.02);
}

.wiki-ledger+.wiki-ledger {
    margin-top:14px;
}

.wiki-ledger p {
    margin:0;
}

.wiki-ledger p+p {
    margin-top:8px;
}

.wiki-ledger-head {
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    gap:4px 10px;
}

.wiki-ledger-head time {
    color:var(--wiki-gold);
    font:700 11px/1.4 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.14em;
    text-transform:uppercase;
}

.wiki-ledger-head strong {
    color:var(--wiki-ink);
}

.wiki-ledger-counts {
    color:var(--wiki-ink)!important;
    font:600 14px/1.5 Inter,ui-sans-serif,system-ui,sans-serif;
    font-variant-numeric:tabular-nums;
}

.wiki-ledger-details {
    margin-top:12px;
}

.wiki-ledger-details summary {
    display:inline-flex;
    align-items:center;
    min-height:44px;
    color:var(--wiki-link);
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    cursor:pointer;
}

.wiki-ledger-details .wiki-table {
    margin-top:8px;
}

/* Quick-find (S3): the matches drop under the field, grouped by kind, each with its game icon. */
.wiki-search {
    position:relative;
}

.wiki-find {
    position:absolute;
    top:calc(100% + 6px);
    left:0;
    right:0;
    z-index:40;
    max-height:min(420px,60vh);
    overflow-y:auto;
    padding:6px;
    border:1px solid rgba(215,174,88,.36);
    border-radius:12px;
    background:#0b1118;
    box-shadow:0 18px 44px rgba(0,0,0,.45);
}

.wiki-find[hidden] {
    display:none;
}

.wiki-find-group {
    padding:8px 10px 4px;
    color:var(--wiki-gold);
    font:700 10.5px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.16em;
    text-transform:uppercase;
}

.wiki-find-option {
    display:grid;
    grid-template-columns:36px minmax(0,1fr);
    align-items:center;
    gap:10px;
    min-height:48px;
    padding:4px 10px;
    border-radius:8px;
    color:var(--wiki-ink);
    text-decoration:none;
}

.wiki-find-option[aria-selected="true"],.wiki-find-option:hover {
    background:rgba(215,174,88,.12);
}

.wiki-find-art {
    display:grid;
    place-items:center;
    width:36px;
    height:36px;
}

.wiki-find-art img {
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

.wiki-find-text {
    display:grid;
    min-width:0;
}

.wiki-find-text strong {
    overflow:hidden;
    color:var(--wiki-ink);
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.wiki-find-kicker {
    color:var(--wiki-muted);
    font:500 12px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

@media(prefers-reduced-motion:no-preference) {
    .wiki-find:not([hidden]) {
        animation:wiki-find-in var(--fate-dur-wind) var(--fate-ease-settle);
    }
}

@keyframes wiki-find-in {
    from {
        opacity:0;
        transform:translateY(-4px);
    }
}

/* Stat threads (V4): a gold thread under each Quick Reference number, scaled to the highest in its level band, with
   the knot at its head. They draw when the table enters view (M3); otherwise they are simply drawn. */
.stat-thread {
    position:relative;
    display:block;
    height:2px;
    margin-top:7px;
    border-radius:1px;
    background:rgba(244,238,223,.08);
}

.stat-thread::before {
    content:"";
    position:absolute;
    inset:0;
    background:var(--fate-thread-line);
    transform:scaleX(var(--v));
    transform-origin:left center;
}

.stat-thread::after {
    content:"";
    position:absolute;
    top:-4px;
    left:calc(var(--v) * 100% - 5px);
    width:10px;
    height:10px;
    background:var(--fate-knot-image) center/contain no-repeat;
}

.wiki-table-kv td:last-child .stat-thread {
    min-width:120px;
}

.wiki-thread-note {
    margin:8px 0 0!important;
    color:var(--wiki-muted)!important;
    font-size:12.5px;
    line-height:1.5!important;
}

@media(prefers-reduced-motion:no-preference) {
    [data-wiki-threads][data-armed] .stat-thread::before {
        transform:scaleX(0);
        transition:transform var(--fate-dur-reveal) var(--fate-ease-thread) var(--d,0ms);
    }
    [data-wiki-threads][data-armed] .stat-thread::after {
        transform:scale(0);
        transition:transform var(--fate-dur-pop) var(--fate-ease-snap) calc(var(--d,0ms) + var(--fate-dur-reveal));
    }
    [data-wiki-threads][data-armed].is-drawn .stat-thread::before {
        transform:scaleX(var(--v));
    }
    [data-wiki-threads][data-armed].is-drawn .stat-thread::after {
        transform:none;
    }
}

/* Entry cards (V7): a reserved 48 px art slot, then label, title and one line. Hover lifts 2 px. */
.wiki-entry {
    display:grid;
    grid-template-columns:48px minmax(0,1fr);
    grid-auto-rows:auto;
    align-content:start;
    column-gap:12px;
    transition:transform var(--fate-dur-tap) var(--fate-ease-settle),border-color var(--fate-dur-tap) var(--fate-ease-settle),box-shadow var(--fate-dur-tap) var(--fate-ease-settle);
}

.wiki-entry>* {
    grid-column:2;
}

.wiki-entry>.wiki-entry-art {
    grid-column:1;
    grid-row:1 / span 3;
    display:grid;
    place-items:center;
    width:48px;
    height:48px;
    overflow:hidden;
    border:1px solid rgba(243,236,220,.18);
    border-radius:10px;
    background:var(--fate-window-navy);
    font-size:inherit;
    letter-spacing:normal;
    text-transform:none;
}

.wiki-entry-art img {
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

.wiki-entry-art i {
    width:12px;
    height:12px;
    clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
    background:rgba(244,238,223,.2);
}

.wiki-entry-art .wiki-card-icon {
    width:auto;
    height:auto;
    margin:0;
    border:0;
    background:none;
}

/* Notes (V7): one callout kind with a 2 px left thread; the tone names what it is. */
.wiki-note {
    border-left:2px solid var(--fate-thread);
}

.wiki-note[data-tone="success"] {
    border-left-color:#7fd6b0;
}

.wiki-note[data-tone="pending"] {
    border-left-color:var(--fate-gold);
}

/* Arrival hairlines (M5): a 1 px thread along the top edge of cards and rows, drawn as they arrive. */
.wiki-entry,.wiki-result-row,.wiki-shelf-tile,.wiki-door {
    position:relative;
}

.wiki-entry::before,.wiki-result-row::before,.wiki-shelf-tile::before,.wiki-door::before {
    content:"";
    position:absolute;
    top:0;
    left:12px;
    right:12px;
    height:1px;
    background:var(--fate-thread-line);
    opacity:.55;
    transform-origin:left center;
    pointer-events:none;
}

@media(prefers-reduced-motion:no-preference) {
    .wiki-arrivals .wiki-entry:not(.is-arrived)::before,.wiki-arrivals .wiki-result-row:not(.is-arrived)::before,.wiki-arrivals .wiki-shelf-tile:not(.is-arrived)::before,.wiki-arrivals .wiki-door:not(.is-arrived)::before {
        transform:scaleX(0);
    }
    .wiki-arrivals .is-arrived::before {
        transition:transform var(--fate-dur-reveal) var(--fate-ease-thread) var(--arrive,0ms);
    }
}

@media(prefers-reduced-motion:reduce) {
    .wiki-entry {
        transition:none;
    }
    .wiki-entry:hover {
        transform:none;
    }
}

/* Who lives here (P3): monsters at 3x and people's faces at 2x, each on a small navy plinth. */
.wiki-roster {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(128px,1fr));
    gap:10px;
    margin:0 0 1.2rem;
    padding:0;
    list-style:none;
}

.wiki-roster a {
    display:grid;
    justify-items:center;
    align-content:start;
    gap:4px;
    height:100%;
    padding:12px 8px;
    border:1px solid var(--wiki-line);
    border-radius:12px;
    background:rgba(244,238,223,.02);
    color:var(--wiki-ink);
    text-align:center;
    text-decoration:none;
}

.wiki-roster a:hover,.wiki-roster a:focus-visible {
    border-color:rgba(215,174,88,.5);
}

.wiki-roster-art {
    display:grid;
    place-items:center;
    width:96px;
    height:96px;
    margin-bottom:4px;
    border-radius:10px;
    background:var(--fate-window-navy);
}

.wiki-roster-art img {
    max-width:96px;
    max-height:96px;
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

.wiki-roster-art.is-empty i {
    width:20px;
    height:20px;
    clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
    background:rgba(244,238,223,.18);
}

.wiki-roster strong {
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-roster span:not(.wiki-roster-art) {
    color:var(--wiki-muted);
    font-size:12.5px;
    line-height:1.4;
}

/* Veylan's four factions (P4). */
.wiki-faction-strip {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin:0;
    padding:0;
    list-style:none;
}

.wiki-faction-strip a {
    display:grid;
    justify-items:center;
    gap:8px;
    padding:14px 8px;
    border:1px solid var(--wiki-line);
    border-radius:12px;
    background:var(--fate-window-navy);
    color:var(--wiki-ink);
    text-decoration:none;
}

.wiki-faction-art img {
    display:block;
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

.wiki-faction-pill {
    padding:2px 10px;
    border:1px solid currentColor;
    border-radius:999px;
    font:700 11px/1.5 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.1em;
    text-transform:uppercase;
}

.wiki-faction-pill[data-faction="xyros"] {
    color:var(--fate-faction-xyros);
}

.wiki-faction-pill[data-faction="fenor"] {
    color:var(--fate-faction-fenor);
}

.wiki-faction-pill[data-faction="zethos"] {
    color:var(--fate-faction-zethos);
}

.wiki-faction-pill[data-faction="solis"] {
    color:var(--fate-faction-solis);
}

/* Skill rings (A3) in skill rows and the class plate's lede in italic (P5). */
.wiki-skill-ring {
    width:56px;
    height:56px;
    margin:-6px 10px -6px 0;
    vertical-align:middle;
    border-radius:50%;
}

.wiki-plate[data-kind="class"] .wiki-plate-lede {
    font-style:italic;
}

/* Item names tinted by rarity from uncommon up (P2). */
.wiki-plate[data-rarity="uncommon"] h1 {
    color:var(--fate-rarity-uncommon);
}

.wiki-plate[data-rarity="rare"] h1 {
    color:var(--fate-rarity-rare);
}

.wiki-plate[data-rarity="epic"] h1 {
    color:var(--fate-rarity-epic);
}

.wiki-plate[data-rarity="legendary"] h1,.wiki-plate[data-rarity="unique"] h1 {
    color:var(--fate-rarity-legendary);
}

/* Awaken's picture of a zone, labelled as the other game (A6). */
.wiki-awaken-aside {
    margin:2rem 0 0;
    padding:0;
}

.wiki-awaken-aside summary {
    display:flex;
    align-items:center;
    min-height:44px;
    padding:0 18px;
    color:var(--wiki-ink);
    font:600 14px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    cursor:pointer;
}

.wiki-awaken-aside img {
    display:block;
    width:100%;
    height:auto;
    border-top:1px solid var(--wiki-line);
}

.wiki-awaken-aside p {
    padding:12px 18px 16px;
    font-size:14px;
}

@media(max-width:640px) {
    .wiki-faction-strip {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .wiki-faction-art img {
        width:96px;
        height:96px;
        object-fit:cover;
        object-position:50% var(--face-y,0%);
    }
    .wiki-plate[data-kind="npc"] .wiki-plinth img {
        object-fit:cover;
        object-position:50% var(--face-y,0%);
    }
    .wiki-plate[data-kind="npc"] .wiki-plate-inner.has-plinth .wiki-plinth {
        height:120px;
    }
    .wiki-roster {
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    .wiki-roster-art {
        width:72px;
        height:72px;
    }
    .wiki-roster-art img {
        max-width:72px;
        max-height:72px;
    }
}

/* Section threads (M2): every section heading carries the site's gold thread, drawn by site-motion.js the first time
   it scrolls into view (reduced motion: drawn at once). The old static 72 px underline goes. */
.fate-wiki .wiki-content section>h2 {
    --fate-section-thread:on;
    position:relative;
    margin:2.1rem 0 1rem;
    color:var(--wiki-ink);
    font:600 21px/1.25 Cinzel,"Palatino Linotype","Book Antiqua",serif;
    letter-spacing:.02em;
}

.fate-wiki .wiki-content section>h2::after {
    content:"";
    display:block;
    width:var(--fate-thread-length);
    height:var(--fate-knot-size);
    margin:.55rem 0 0 var(--fate-thread-start,0px);
    background:var(--fate-thread-line) 0 50% / calc(100% - var(--fate-knot-size) / 2) var(--fate-thread-weight) no-repeat;
    filter:var(--fate-thread-glow);
    transform-origin:0 50%;
    transition:transform var(--fate-dur-reveal) var(--fate-ease-thread);
    pointer-events:none;
}

.fate-wiki .wiki-content section>h2::before {
    content:"";
    position:absolute;
    bottom:0;
    left:calc(var(--fate-thread-start,0px) + var(--fate-thread-length) - var(--fate-knot-size));
    width:var(--fate-knot-size);
    height:var(--fate-knot-size);
    background:var(--fate-knot-image) center / contain no-repeat;
    filter:var(--fate-thread-glow);
    transition:transform var(--fate-dur-pop) var(--fate-ease-snap) var(--fate-dur-pop);
    pointer-events:none;
}

.fate-wiki .wiki-content section>h2.is-thread-centered {
    --fate-thread-start:calc(50% - var(--fate-thread-length) / 2);
}

@media(scripting:enabled) {
    .fate-wiki .wiki-content section>h2:not(.is-thread-drawn)::after {
        transform:scaleX(0);
    }
    .fate-wiki .wiki-content section>h2:not(.is-thread-drawn)::before {
        transform:scale(0) rotate(-45deg);
    }
}

@media(scripting:none) {
    .fate-wiki .wiki-content section>h2::after,.fate-wiki .wiki-content section>h2::before {
        content:none;
    }
}

.fate-wiki .wiki-content .wiki-article>section:first-of-type>h2,.fate-wiki .wiki-home section>h2,.fate-wiki .wiki-results section>h2 {
    margin-top:0;
}

/* The search strike (M4): focus draws a hairline; a submit winds up, strikes and holds before it goes. */
.wiki-search::before {
    content:"";
    position:absolute;
    left:12px;
    right:12px;
    bottom:-1px;
    height:1px;
    background:var(--fate-thread-line);
    transform:scaleX(0);
    transform-origin:left center;
    transition:transform var(--fate-dur-ui) var(--fate-ease-thread);
    pointer-events:none;
}

.wiki-search:focus-within::before {
    transform:none;
}

.wiki-search.is-striking {
    border-color:var(--fate-gold-bright);
}

@media(prefers-reduced-motion:no-preference) {
    .wiki-search.is-striking button svg {
        animation:wiki-strike 320ms both;
    }
}

@keyframes wiki-strike {
    0% {
        transform:none;
        animation-timing-function:var(--fate-ease-settle);
    }
    50% {
        transform:translateX(-2px);
        animation-timing-function:var(--fate-ease-strike);
    }
    78% {
        transform:translateX(3px);
    }
    100% {
        transform:translateX(3px);
    }
}

@media(prefers-reduced-motion:reduce) {
    .wiki-search::before {
        transition:none;
    }
}

/* One filter per hub (P7), held under the wiki bar while the long roster scrolls. */
.wiki-filter {
    position:sticky;
    top:calc(var(--wiki-nav-h) + 64px);
    z-index:5;
    display:flex;
    align-items:center;
    gap:12px;
    margin:0 0 1.2rem;
    padding:8px;
    border:1px solid var(--wiki-line);
    border-radius:12px;
    background:rgba(11,17,24,.94);
}

.wiki-filter label {
    flex:1;
}

.wiki-filter input {
    width:100%;
    min-height:44px;
    padding:0 12px;
    border:1px solid rgba(215,174,88,.25);
    border-radius:10px;
    background:#0b1118;
    color:var(--wiki-ink);
    font:400 16px/1.25 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-filter-count {
    flex:0 0 auto;
    color:var(--wiki-muted);
    font:600 13px/1 Inter,ui-sans-serif,system-ui,sans-serif;
    font-variant-numeric:tabular-nums;
}

/* Hub plates show three of their own (A4). */
.wiki-plate-strip {
    display:flex;
    flex-wrap:wrap;
    align-items:flex-end;
    gap:12px;
    margin:16px 0 0;
}

.wiki-plate-strip img {
    image-rendering:crisp-edges;
    image-rendering:pixelated;
}

.wiki-plate-strip img[src*="/rings/"] {
    image-rendering:auto;
    border-radius:50%;
}

.fate-wiki img[src*="/rings/"] {
    image-rendering:auto;
}

/* The four crafting books (P6). */
.wiki-book-tiles {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin:0;
    padding:0;
    list-style:none;
}

.wiki-book-tile {
    display:grid;
    align-content:start;
    gap:4px;
    padding:14px 16px;
    border:1px solid var(--wiki-line);
    border-radius:12px;
    background:linear-gradient(160deg,rgba(244,238,223,.035),rgba(244,238,223,.01));
}

.wiki-book-tile strong {
    color:var(--wiki-gold-soft);
    font:700 24px/1.1 Inter,ui-sans-serif,system-ui,sans-serif;
    font-variant-numeric:tabular-nums;
}

.wiki-book-unit {
    color:var(--wiki-muted);
    font:600 11px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
    letter-spacing:.12em;
    text-transform:uppercase;
}

.wiki-book-name {
    color:var(--wiki-ink);
    font:600 15px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-book-access {
    color:var(--wiki-gold);
    font:600 12.5px/1.3 Inter,ui-sans-serif,system-ui,sans-serif;
}

.wiki-book-line {
    color:var(--wiki-muted);
    font-size:13.5px;
    line-height:1.5;
}

@media(max-width:900px) {
    .wiki-book-tiles {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .wiki-filter {
        position:static;
    }
}

/* Art bigger than its box is drawn smaller (WikiArt::fit flags it data-fit="down"); a shrunk sprite is no longer
   pixel-true, so it is smoothed instead of dropping every other pixel. */
.fate-wiki img[data-fit="down"],.wiki-find-art img[data-fit="down"] {
    image-rendering:auto;
}

/* On narrow phones a home shelf shows two sample sprites: three 48 px sprites are wider than the tile. */
@media(max-width:420px) {
    .wiki-shelf-samples img:nth-child(n+3) {
        display:none;
    }
}
