/* The wiki's own parts, on top of the website's styles.css (loaded first, copied whole at build).
   Only tokens from styles.css here: no colour or font of its own, so the two can't drift apart. */

/* ---------- item chips: same grade colours and slot frame as the Central Market ---------- */
.g0 { --g: #c4c4c4; } .g1 { --g: #83a543; } .g2 { --g: #438dcc; } .g3 { --g: #f5ba3a; } .g4 { --g: #d05d48; }
.g5 { --g: #a070ef; } .g6 { --g: #ffd24a; } .g7 { --g: #ced8ec; } .g8 { --g: #f0f0ff; } .g9 { --g: #ff7a22; }
.it { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; max-width: 100%; }
.it .ic { flex: none; width: 22px; height: 22px; padding: 1px; border-radius: 4px; background: var(--g); }
.it .ic img { display: block; width: 20px; height: 20px; border-radius: 3px; background: radial-gradient(circle at 50% 40%, #151b1f, #0a0d0f); }
.it .ic:empty { display: none; }
.it .nm { color: var(--g); font-weight: 600; }

/* ---------- search ---------- */
.wiki-search { position: relative; }
.wiki-search .search { display: block; }
.wiki-search input { height: 32px; padding-left: 30px; }
.wiki-search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); }
.wiki-search.in-header { width: 210px; }
.wiki-search.in-hero { width: min(440px, 100%); margin-top: 18px; }
.wiki-search.in-hero input { height: 42px; padding-left: 34px; font-size: 14px; background: rgba(8, 11, 13, .72); backdrop-filter: blur(4px); }
.wiki-search.in-side { display: none; }
.wiki-results { position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; width: min(460px, calc(100vw - 32px)); max-height: min(62vh, 520px); overflow-y: auto; background: var(--panel); box-shadow: 0 18px 44px rgba(0, 0, 0, .55); }
.wiki-search.in-header .wiki-results { left: auto; right: 0; }
.wr { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.wr:last-child { border-bottom: 0; }
.wr:hover, .wr.sel { background: var(--white-04); color: var(--text-2); }
.wr .where { display: block; font: 700 9px/1.4 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.wr b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.wr small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wr mark { background: none; color: var(--gold-hi); }
.wr-none { padding: 14px; text-align: center; font-size: 12px; font-style: italic; color: var(--muted); }

/* ---------- language picker ---------- */
.wiki-lang { position: relative; flex: none; }
.wiki-lang summary { list-style: none; gap: 6px; cursor: pointer; user-select: none; }
.wiki-lang summary::-webkit-details-marker { display: none; }
.wl-list { position: absolute; z-index: 70; top: calc(100% + 6px); right: 0; min-width: 132px; padding: 4px; background: var(--panel); box-shadow: 0 18px 44px rgba(0, 0, 0, .55); }
.wl-list a { display: block; padding: 6px 10px; border-radius: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--text-3); transition: color .15s, background-color .15s; }
.wl-list a:hover { color: var(--text); background: var(--white-04); }
.wl-list a.on { color: var(--text); background: var(--white-06); box-shadow: inset 2px 0 0 var(--gold); }
.wiki-lang-note { margin: 0 0 12px; font-size: 12px; }

/* Russian, Chinese, Japanese and Korean: the site's headline font has none of these letters. */
html:lang(ru) { --brand: "Forum", Georgia, serif; }
html:lang(ru) .wordmark { font-family: "Marcellus", Georgia, serif; }
html:lang(zh-Hant) { --brand: "Marcellus", "Microsoft JhengHei", "PingFang TC", "Noto Sans CJK TC", sans-serif; }
html:lang(zh-Hans) { --brand: "Marcellus", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
html:lang(ja) { --brand: "Marcellus", "Yu Gothic", "Hiragino Sans", "Noto Sans CJK JP", sans-serif; }
html:lang(ko) { --brand: "Marcellus", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif; }

/* ---------- home ---------- */
.wiki-home-page .wiki-search.in-header { display: none; } /* one search on this page: the hero's */
.wiki-hero { min-height: 228px; justify-content: center; padding: 28px 32px; overflow: visible; } /* visible: search results hang below it */
.wiki-hero .scene { border-radius: inherit; }
.wiki-hero .hero-copy { max-width: none; width: 100%; }
.wiki-search.in-hero { width: min(420px, 100%); }
.wiki-search.in-hero .wiki-results { width: min(520px, calc(100vw - 64px)); }
.scene.wiki-scene-party { --ay: 92%; }
@container (orientation: portrait) { .wiki-scene-party .stage { --ax: 56%; } }

/* Three big tiles over two rows of five, all on one grid. */
.wiki-tiles { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 12px; }
.wiki-tile { position: relative; grid-column: span 3; display: flex; align-items: flex-end; height: 118px; padding: 12px 14px; overflow: hidden; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); transition: border-color .2s ease; }
.wiki-tile.big { grid-column: span 5; height: 178px; padding: 16px 18px; }
.wiki-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; filter: saturate(.85) brightness(.78); transition: transform .5s var(--ease), filter .25s ease; }
.wiki-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 11, 13, .88) 0%, rgba(8, 11, 13, .25) 55%, rgba(8, 11, 13, 0) 100%); }
.wiki-tile b { position: relative; z-index: 1; font: 400 16px/1.2 var(--brand); color: var(--text); transition: color .2s ease; }
.wiki-tile.big b { font-size: 22px; }
.wiki-tile:hover, .wiki-tile:focus-visible { border-color: var(--gold-line); }
.wiki-tile:hover img, .wiki-tile:focus-visible img { transform: scale(1.04); filter: saturate(1) brightness(.95); }
.wiki-tile:hover b, .wiki-tile:focus-visible b { color: var(--gold-hi); }

/* ---------- page layout ---------- */
.wiki-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr) 168px; gap: 16px 22px; align-items: start; }
.wiki-layout.no-toc { grid-template-columns: 216px minmax(0, 1fr); }
.wiki-side { position: sticky; top: calc(var(--header-h) + 14px); min-width: 0; }
.wiki-pages-btn { display: none; width: 100%; }
.wiki-nav { display: block; padding: 8px; max-height: calc(100vh - var(--header-h) - 28px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.wn-sec summary { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; list-style: none; cursor: pointer; border-radius: 5px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); transition: color .15s; }
.wn-sec summary::-webkit-details-marker { display: none; }
.wn-sec summary::after { content: "+"; font: 400 13px/1 var(--mono); color: var(--faint); }
.wn-sec[open] summary::after { content: "-"; }
.wn-sec summary:hover { color: var(--text-2); }
.wn-sec a { display: block; padding: 5px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text-3); transition: color .15s, background-color .15s; }
.wn-sec a:hover { color: var(--text); background: var(--white-04); }
.wn-sec a.on { color: var(--text); background: var(--white-06); box-shadow: inset 2px 0 0 var(--gold); }
.wn-sec[open] { margin-bottom: 6px; }

.wiki-toc { position: sticky; top: calc(var(--header-h) + 14px); display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - var(--header-h) - 28px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.wiki-toc .label { padding: 4px 0 6px 10px; color: var(--faint); }
.wiki-toc a { padding: 3px 0 3px 10px; font-size: 12px; line-height: 1.3; color: var(--muted); border-left: 2px solid var(--line-2); transition: color .15s, border-color .15s; }
.wiki-toc a:hover { color: var(--text); }
.wiki-toc a.on { color: var(--text); border-left-color: var(--gold); }

/* ---------- the article ---------- */
.wiki-article { min-width: 0; }
.wiki-head { min-height: 92px; margin-bottom: 12px; padding: 16px 18px; align-items: flex-end; }
.wiki-head .acct-id h1 { font-size: 26px; }
.wiki-head .scene-shade { background: linear-gradient(90deg, rgba(10, 14, 16, .94) 0%, rgba(10, 14, 16, .74) 45%, rgba(10, 14, 16, .22) 100%), linear-gradient(0deg, rgba(10, 14, 16, .5) 0%, rgba(10, 14, 16, 0) 60%); }
.wiki-lead { margin: 0 2px 14px; font-size: 14px; color: var(--text-3); }
.wiki-body { font-size: 14px; line-height: 1.55; }
.wiki-body > :first-child { margin-top: 0; }
.wiki-body p { margin: 0 0 10px; }
.wiki-body strong { color: var(--text); font-weight: 600; }
.wiki-body h2 { margin: 26px 0 10px; padding-bottom: 7px; font-size: 20px; border-bottom: 1px solid var(--line-2); scroll-margin-top: calc(var(--header-h) + 12px); }
.wiki-body h3 { margin: 18px 0 8px; font-size: 14px; scroll-margin-top: calc(var(--header-h) + 12px); }
.wiki-body .wa { margin-left: 7px; font: 400 .85em var(--mono); color: var(--faint); opacity: 0; transition: opacity .15s, color .15s; }
.wiki-body h2:hover .wa, .wiki-body h3:hover .wa, .wiki-body .wa:focus-visible { opacity: 1; }
.wiki-body .wa:hover { color: var(--gold); }
.wiki-body ul, .wiki-body ol { margin: 0 0 12px; padding-left: 20px; }
.wiki-body li { margin: 3px 0; }
.wiki-body li::marker { color: var(--gold); }
.wiki-body li > ul, .wiki-body li > ol { margin: 3px 0 4px; }
.wiki-body .notice { margin: 0 0 12px; }
.wiki-body .notice > :last-child { margin-bottom: 0; }

.wiki-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 14px; }
.wf { padding: 9px 12px; }
.wf .wv { margin-top: 3px; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text); }

.wiki-table { margin: 0 0 14px; }
.panel.pad-0.wiki-table { overflow-x: auto; overflow-y: hidden; } /* .panel.pad-0 would clip a wide table on a phone */
.wiki-table th { height: 30px; }
.wiki-table td { height: auto; padding: 7px 12px; line-height: 1.4; }
.wiki-table td .it { margin: 1px 0; }
.wiki-table td.center, .wiki-table th.center { text-align: center; }
.wiki-table td.num { white-space: nowrap; }

.wiki-details { margin: 0 0 8px; overflow: visible; scroll-margin-top: calc(var(--header-h) + 12px); }
.wiki-details summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); border-radius: var(--r); transition: background-color .15s; }
.wiki-details summary::-webkit-details-marker { display: none; }
.wiki-details summary::before { content: "+"; width: 12px; font: 400 14px/1 var(--mono); color: var(--gold); }
.wiki-details[open] summary::before { content: "-"; }
.wiki-details summary:hover { background: var(--white-02); }
.wiki-details .wd { padding: 2px 12px 10px; }
.wiki-details .wd > :last-child { margin-bottom: 0; }
.wiki-details .wd p .it, .wiki-body p .it + .it { margin-right: 6px; }
.wiki-details .wd p { line-height: 2; }

.wiki-updated { margin: 22px 2px 0; font-size: 11px; color: var(--faint); }

/* Which part of a picture the page head shows. */
.scene.wiki-scene-sea.scene-banner { --ay: 64%; }

/* ---------- sizes ---------- */
@media (max-width: 1200px) {
  .wiki-layout, .wiki-layout.no-toc { grid-template-columns: 216px minmax(0, 1fr); }
  .wiki-toc { display: none; }
}
@media (max-width: 860px) {
  .nav-side { flex-wrap: wrap; }
  .wiki-search.in-header { flex: 1 1 100%; width: auto; order: -1; }
  .wiki-search.in-header .wiki-results { left: 0; right: auto; }
  .wl-list { left: 0; right: auto; }
  .wiki-layout, .wiki-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
  .wiki-side { position: static; }
  .wiki-pages-btn { display: inline-flex; }
  .wiki-nav { display: none; margin-top: 8px; max-height: none; }
  .wiki-side.open .wiki-nav { display: block; }
  .wiki-head { min-height: 76px; }
  .wiki-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiki-tile { grid-column: auto; height: 104px; }
  .wiki-tile.big { grid-column: 1 / -1; height: 150px; }
}
@media (max-width: 640px) {
  .wiki-hero { padding: 20px 16px; min-height: 190px; }
  .wiki-table td, .wiki-table th { padding-left: 9px; padding-right: 9px; }
}
