/* The wiki page. Loaded after realm.css, reusing its panels, search field, tiles and chips. */

.page--wiki {
  position: relative;
}
.page--wiki .wrap {
  width: min(1440px, 100% - var(--pad));
}
.wk__head h1 {
  font-size: clamp(42px, 5vw, 64px);
}
.wk__head .lead2 {
  max-width: 620px;
}
.wk__search {
  margin-top: 28px;
  max-width: 720px;
}

.wk {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 24px;
}
.wk__side {
  position: sticky;
  top: calc(var(--nav-top) + var(--nav-h) + 16px);
  padding: 18px;
  max-height: calc(100vh - var(--nav-top) - var(--nav-h) - 32px);
  overflow-y: auto;
}
.wk__types {
  display: grid;
  gap: 2px;
}
.wtype {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.wtype span {
  flex: 1;
  min-width: 0;
}
.wtype small {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.wtype .ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 16px;
  --c: var(--text-3);
}
.wtype:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.wtype[aria-current="page"] {
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 26%, transparent);
}
.wtype[aria-current="page"] .ic {
  --c: var(--gold);
}

/* list */
.wk__list {
  padding: 18px;
}
.wk__listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wk__listhead .tp__h {
  margin: 0;
}
.wk__intro {
  margin-top: 6px;
  color: var(--text-2);
}
.wk__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.wcard {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.wcard:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent);
  transform: translateY(-1px);
}
.wcard__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.wcard__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.wcard__top b {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wcard__note {
  font-size: 12.5px;
  color: var(--text-3);
}
.wcard__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 2px 0 2px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.wcard__sub .title-chip {
  height: 20px;
  padding: 0 7px;
  font-size: 10px;
}
.wcard__blurb {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}
.wk__tile {
  overflow: hidden;
}
.wk__img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.wk__img--cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp__pager a[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}

/* shelves */
.wcard__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wcard__chips .title-chip {
  height: 20px;
  padding: 0 7px;
  font-size: 10px;
}
.wcard__sub {
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 700;
  font-size: 12.5px;
}
.wjump {
  position: sticky;
  top: calc(var(--nav-top) + var(--nav-h) + 8px);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px -6px 0;
  padding: 8px 6px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
}
.wjump__chip {
  --c: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--c) 9%, rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
  transition: background 0.15s;
}
.wjump__chip:hover {
  background: color-mix(in srgb, var(--c) 18%, transparent);
}
.wjump__chip small {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.wshelves {
  display: grid;
}
.wshelf {
  margin-top: 28px;
  scroll-margin-top: calc(var(--nav-top) + var(--nav-h) + 70px);
}
.wshelf__head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.wshelf__h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}
.wshelf__h .ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 17px;
}
.wshelf__h small {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
}
.wshelf__blurb {
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--text-2);
}
.wshelf__sub {
  margin: 18px 0 -6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.wtree {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.wbranch--root {
  grid-column: 1 / -1;
}
.wbranch--root .wbranch__list {
  max-width: calc(50% - 7px);
}
.wbranch__list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.wbranch:not(.wbranch--root) .wbranch__list {
  padding-left: 14px;
  border-left: 2px solid color-mix(in srgb, var(--gold) 22%, transparent);
}
.wshelf__more {
  margin-top: 12px;
}
.whome {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.whome__tile {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line);
}
.whome__top {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.whome__title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.whome__title b {
  flex: 1;
  font-size: 18px;
}
.whome__title small {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
}
.whome__title .ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
  --c: var(--gold);
}
.whome__top:hover b {
  color: var(--gold);
}
.whome__blurb {
  font-size: 14px;
  color: var(--text-2);
}
.whome__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.whome__groups .wjump__chip {
  min-height: 30px;
  font-size: 12.5px;
}

/* article */
.wart {
  overflow: hidden;
  padding: 0 28px 28px;
}
.wart__banner {
  position: relative;
  height: 180px;
  margin: 0 -28px;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
.wart__banner--art {
  height: 240px;
}
.wart__banner--art img {
  opacity: 0.8;
}
.wart__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.wk__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
  font-size: 13.5px;
  color: var(--text-3);
}
.wart__banner + .wk__crumbs {
  margin-top: -40px;
  position: relative;
}
.wk__crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.wk__crumbs a:hover {
  color: var(--gold);
}
.wk__crumbs b {
  overflow: hidden;
  max-width: 100%;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wart__head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}
.wart__head .itile--lg {
  width: 88px;
  height: 88px;
}
.wart__head h1 {
  margin: 2px 0 8px;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.08;
}
.wart__type {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--gold) 70%, var(--text-2));
}
.wk__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wart__blurb {
  margin-top: 18px;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-2);
}
.wart__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}
.wart__body {
  display: grid;
  gap: 26px;
  min-width: 0;
}
.wart__aside {
  position: sticky;
  top: calc(var(--nav-top) + var(--nav-h) + 16px);
}
.wart__quick {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.wsec__h {
  margin-bottom: 12px;
  font-size: 19px;
  font-weight: 800;
}
.wsec p {
  line-height: 1.65;
  color: var(--text-2);
}
.wsec p + p {
  margin-top: 8px;
}
.wk__facts {
  display: grid;
  margin: 0;
}
.wk__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.wk__facts > div:first-child {
  border-top: 0;
}
.wk__facts dt {
  flex: none;
  color: var(--text-3);
  font-size: 14px;
}
.wk__facts dd {
  margin: 0;
  text-align: right;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.wsec--facts .wk__facts {
  padding: 4px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wk__link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, currentColor 45%, transparent);
}
.wk__link:hover {
  filter: brightness(1.15);
}

.wk__minis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.wmini {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.15s;
}
.wmini:hover {
  background: rgba(255, 255, 255, 0.06);
}
.wmini .itile {
  width: 38px;
  height: 38px;
}
.wmini .itile .ic {
  width: 22px;
  height: 22px;
  font-size: 19px;
}
.wmini__text {
  display: grid;
  flex: 1;
  min-width: 0;
}
.wmini__text b {
  overflow: hidden;
  font-size: 14.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wmini__text small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.wmini__note {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.wsteps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wstep {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wstep__num {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
  color: var(--on-primary);
  background: linear-gradient(180deg, var(--key-hi), var(--key-lo));
}
.wstep b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.wstep b .ic {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 14px;
  --c: var(--gold);
}
.wstep > div {
  flex: 1;
  min-width: 0;
}
.wstep p {
  margin-top: 4px;
}

.wsec--tip {
  padding: 16px 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 24%, transparent);
}
.wsec__tiphead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.wsec__tiphead .ic {
  width: 24px;
  height: 24px;
  font-size: 14px;
}
.wsec__tiphead b {
  color: var(--text);
}

.wk__tablewrap {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.wk__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.wk__table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
}
.wk__table td {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
}
.wk__table td:first-child {
  font-weight: 700;
  color: var(--text);
}

.wstory {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 212, 92, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.wstory__chapter {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gold) !important;
}
.wstory__hook {
  font-size: 16px;
  font-weight: 700;
  color: var(--text) !important;
}
.wstory blockquote {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid color-mix(in srgb, var(--gold) 50%, transparent);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.03);
  font-style: italic;
  color: var(--text-2);
}
.wstory small {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.wstory__replies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.wstory__replies small {
  width: 100%;
}
.wstory__reply {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.wstory__steps {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 22px;
  color: var(--text-2);
}
.wstory__ends {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.wstory__win b {
  color: var(--green);
}
.wstory__loss b {
  color: #ff6b7d;
}

@media (max-width: 1180px) {
  .wart__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wart__aside {
    position: static;
    order: -1;
  }
}
@media (max-width: 980px) {
  .wk {
    grid-template-columns: minmax(0, 1fr);
  }
  .wk__side {
    position: static;
    max-height: none;
    padding: 10px;
  }
  .wk__side .tp__h {
    display: none;
  }
  .wk__types {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
  }
  .wk__types::-webkit-scrollbar {
    display: none;
  }
  .wtype {
    flex: none;
    min-height: 40px;
    font-size: 14px;
  }
  .wtype .ic {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}
@media (max-width: 760px) {
  .wtree {
    grid-template-columns: minmax(0, 1fr);
  }
  .wbranch--root .wbranch__list {
    max-width: none;
  }
  .whome {
    grid-template-columns: minmax(0, 1fr);
  }
  .wjump {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wjump__chip {
    flex: none;
  }
  .wk__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wart {
    padding: 0 16px 20px;
  }
  .wart__banner {
    height: 130px;
    margin: 0 -16px;
  }
  .wart__head {
    align-items: flex-start;
    gap: 14px;
  }
  .wart__head .itile--lg {
    width: 64px;
    height: 64px;
  }
  .wk__minis {
    grid-template-columns: minmax(0, 1fr);
  }
}
