/* guide/index.php — the public wiki.
   Layout: the page does not scroll; the sidebar and the content column scroll on their own
   inside .site-scroll (partials/head.php). Under 980px the sidebar becomes a slide-in drawer.
   Night mode: body.wiki-night (toggle in the top bar, remembered per browser). */

.wiki-page {
    --wiki-bg: #f4f1e9;
    --wiki-panel: #efebe1;
    --wiki-card: #e8e6df;
    --wiki-line: #ddd7ca;
    --wiki-text: #373229;
    --wiki-heading: #1f2d46;
    --wiki-muted: #8d8375;
    --wiki-accent: #e6552e;
    --wiki-link-hover: #f8f5ef;

    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    font-family: 'Roboto', Arial, sans-serif;
}

body.wiki-night .wiki-page {
    --wiki-bg: #161616;
    --wiki-panel: #1c1c1c;
    --wiki-card: #222;
    --wiki-line: #333;
    --wiki-text: #d4d0c8;
    --wiki-heading: #f1ede4;
    --wiki-muted: #9a938a;
    --wiki-link-hover: #262626;
}

body.wiki-night,
body.wiki-night .site-scroll {
    background: #161616 !important;
}

.wiki-layout {
    display: flex;
    height: 100%;
    background: var(--wiki-bg);
    position: relative;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.wiki-sidebar {
    width: 270px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--wiki-panel);
    border-right: 1px solid var(--wiki-line);
    overflow-y: auto;
}

.wiki-search {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--wiki-line);
}

.wiki-search__input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 11px;
    border: 1px solid #d4cfc5;
    border-radius: 6px;
    background: #fff;
    color: #2b2721;
    font-family: inherit;
    font-size: 13px;
}

.wiki-search__input:focus {
    outline: none;
    border-color: var(--wiki-accent);
    box-shadow: 0 0 0 3px rgba(230, 85, 46, 0.14);
}

.wiki-search__button {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 6px;
    background: var(--wiki-accent);
    color: #fff;
    cursor: pointer;
}

.wiki-search__button:hover {
    background: #c03812;
}

.wiki-nav {
    padding: 8px 0 16px;
}

.wiki-nav__home,
.wiki-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 18px;
    border-left: 3px solid transparent;
    color: var(--wiki-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wiki-nav__home {
    font-weight: 800;
    color: var(--wiki-heading);
}

.wiki-nav__home i,
.wiki-nav__link i {
    width: 18px;
    flex-shrink: 0;
    text-align: center;
    color: var(--wiki-accent);
}

.wiki-nav__link span,
.wiki-nav__home span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-nav__home:hover,
.wiki-nav__link:hover {
    background: var(--wiki-link-hover);
    border-left-color: var(--wiki-accent);
}

.wiki-nav__home.is-active,
.wiki-nav__link.is-active {
    background: rgba(230, 85, 46, 0.12);
    border-left-color: var(--wiki-accent);
    color: var(--wiki-accent);
    font-weight: 700;
}

.wiki-nav__group {
    margin-top: 6px;
}

.wiki-nav__category {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 6px 18px;
    color: var(--wiki-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

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

.wiki-nav__category i:first-child {
    width: 18px;
    text-align: center;
}

.wiki-nav__chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.15s ease;
}

.wiki-nav__group:not([open]) .wiki-nav__chevron {
    transform: rotate(-90deg);
}

.wiki-nav__link {
    padding-left: 30px;
}

.wiki-sidebar__admin {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
    border-top: 1px solid var(--wiki-line);
}

.wiki-sidebar__admin a {
    padding: 8px 18px;
    color: var(--wiki-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.wiki-sidebar__admin a:hover {
    color: var(--wiki-accent);
}

.wiki-sidebar__admin i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
}

.wiki-backdrop {
    display: none;
}

/* ── Content column ────────────────────────────────────────────────────────── */
.wiki-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 0 36px 70px;
    color: var(--wiki-text);
    scroll-padding-top: 12px;
}

.wiki-topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 -36px 24px;
    padding: 10px 36px;
    background: var(--wiki-bg);
    border-bottom: 1px solid var(--wiki-line);
}

.wiki-topbar__menu {
    display: none;
}

.wiki-topbar__menu,
.wiki-topbar__night {
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border: 1px solid var(--wiki-line);
    border-radius: 6px;
    background: var(--wiki-card);
    color: var(--wiki-heading);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.wiki-topbar__night {
    display: inline-flex;
    margin-left: auto;
}

.wiki-topbar__menu:hover,
.wiki-topbar__night:hover {
    border-color: var(--wiki-accent);
    color: var(--wiki-accent);
}

.wiki-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    color: var(--wiki-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

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

.wiki-breadcrumb a:hover {
    color: var(--wiki-accent);
}

.wiki-breadcrumb i {
    font-size: 8px;
    opacity: 0.6;
}

.wiki-breadcrumb .is-current {
    color: var(--wiki-heading);
}

/* ── Portal ────────────────────────────────────────────────────────────────── */
.wiki-welcome {
    position: relative;
    margin-bottom: 8px;
}

.wiki-section-title {
    margin: 30px 0 14px;
    padding-left: 12px;
    border-left: 5px solid var(--wiki-accent);
    color: var(--wiki-heading);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wiki-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.wiki-category {
    padding: 18px 20px;
    background: var(--wiki-card);
    border: 1px solid var(--wiki-line);
    border-top: 4px solid var(--wiki-accent);
    border-radius: 10px;
}

.wiki-category__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wiki-category__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #1f2d46;
    color: #fff;
    font-size: 17px;
}

.wiki-category__head h3 {
    margin: 0;
    color: var(--wiki-heading);
    font-size: 16px;
    font-weight: 800;
}

.wiki-category__head span {
    color: var(--wiki-muted);
    font-size: 12px;
}

.wiki-category__pages {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-category__pages a {
    display: block;
    padding: 6px 0;
    color: var(--wiki-text);
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px dashed var(--wiki-line);
}

.wiki-category__pages li:last-child a {
    border-bottom: 0;
}

.wiki-category__pages a:hover {
    color: var(--wiki-accent);
}

.wiki-category__pages i {
    width: 12px;
    color: var(--wiki-accent);
}

.wiki-category__more {
    display: block;
    margin-top: 6px;
    color: var(--wiki-muted);
    font-size: 12px;
}

.wiki-recent {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.wiki-recent__item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--wiki-card);
    border: 1px solid var(--wiki-line);
    border-radius: 10px;
    color: var(--wiki-text);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.wiki-recent__item:hover {
    border-color: var(--wiki-accent);
    transform: translateY(-1px);
}

.wiki-recent__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(230, 85, 46, 0.12);
    color: var(--wiki-accent);
}

.wiki-recent__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wiki-recent__body strong {
    color: var(--wiki-heading);
    font-size: 15px;
}

.wiki-recent__text {
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wiki-recent__meta {
    color: var(--wiki-muted);
    font-size: 12px;
}

/* ── Page ──────────────────────────────────────────────────────────────────── */
.wiki-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    max-width: 1100px;
}

.wiki-page-grid.has-toc {
    grid-template-columns: minmax(0, 1fr) 230px;
}

.wiki-page-head {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--wiki-line);
}

.wiki-page-head__title {
    margin: 0 0 8px;
    color: var(--wiki-heading);
    font-size: 30px;
    font-weight: 900;
    line-height: 1.2;
}

.wiki-page-head__title i {
    margin-right: 6px;
    color: var(--wiki-accent);
    font-size: 0.8em;
}

.wiki-page-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0;
    color: var(--wiki-muted);
    font-size: 13px;
}

.wiki-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--wiki-line);
    color: var(--wiki-heading);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.wiki-tag--draft {
    background: #fbefcf;
    color: #7a5a06;
}

.wiki-nav__link .wiki-tag {
    margin-left: auto;
}

.wiki-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--wiki-line);
    border-radius: 6px;
    color: var(--wiki-heading);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.wiki-edit-link:hover {
    border-color: var(--wiki-accent);
    color: var(--wiki-accent);
}

.wiki-welcome > .wiki-edit-link {
    position: absolute;
    top: 0;
    right: 0;
}

/* Article text */
.wiki-body {
    color: var(--wiki-text);
    font-size: 15px;
    line-height: 1.7;
}

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

.wiki-body h2,
.wiki-body h3,
.wiki-body h4 {
    color: var(--wiki-heading);
    line-height: 1.3;
    scroll-margin-top: 70px;
}

.wiki-body h2 {
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--wiki-line);
    font-size: 22px;
}

.wiki-body h3 {
    margin: 24px 0 10px;
    font-size: 18px;
}

.wiki-body p {
    margin: 0 0 14px;
}

.wiki-body ul,
.wiki-body ol {
    margin: 0 0 14px;
    padding-left: 24px;
}

.wiki-body li {
    margin: 4px 0;
}

.wiki-body a {
    color: var(--wiki-accent);
}

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

.wiki-body table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}

.wiki-body th,
.wiki-body td {
    padding: 9px 11px;
    border: 1px solid var(--wiki-line);
    text-align: left;
}

.wiki-body th {
    background: var(--wiki-card);
    color: var(--wiki-heading);
}

.wiki-body blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--wiki-accent);
    background: var(--wiki-card);
    border-radius: 0 8px 8px 0;
}

.wiki-body code {
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--wiki-card);
    font-size: 0.92em;
}

/* Table of contents: a column beside the text on wide screens, a fold-out box otherwise */
.wiki-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-toc a {
    display: block;
    padding: 5px 0;
    color: var(--wiki-text);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
}

.wiki-toc a:hover {
    color: var(--wiki-accent);
}

.wiki-toc__level-3 a {
    padding-left: 14px;
    font-size: 12.5px;
    color: var(--wiki-muted);
}

.wiki-toc--side {
    position: sticky;
    top: 70px;
    align-self: start;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 14px 16px;
    border-left: 3px solid var(--wiki-accent);
    background: var(--wiki-card);
    border-radius: 0 8px 8px 0;
}

.wiki-toc--side strong {
    display: block;
    margin-bottom: 6px;
    color: var(--wiki-heading);
    font-size: 11px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.wiki-toc--inline {
    display: none;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: var(--wiki-card);
    border: 1px solid var(--wiki-line);
    border-radius: 8px;
}

.wiki-toc--inline summary {
    color: var(--wiki-heading);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.wiki-toc--inline ul {
    margin-top: 8px;
}

/* Previous / next */
.wiki-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--wiki-line);
}

.wiki-pager__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--wiki-line);
    border-radius: 10px;
    background: var(--wiki-card);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.wiki-pager__link:hover {
    border-color: var(--wiki-accent);
}

.wiki-pager__link span {
    color: var(--wiki-muted);
    font-size: 12px;
    font-weight: 700;
}

.wiki-pager__link strong {
    color: var(--wiki-heading);
    font-size: 15px;
}

.wiki-pager__link--next {
    grid-column: 2;
    text-align: right;
}

/* ── Abilities ─────────────────────────────────────────────────────────────── */
.wiki-abilities {
    margin-top: 36px;
}

.wiki-abilities h2 {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--wiki-accent);
    color: var(--wiki-heading);
    font-size: 22px;
}

.wiki-abilities__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.wiki-abilities__tab {
    min-width: 48px;
    padding: 9px 16px;
    border: 2px solid var(--wiki-line);
    border-radius: 8px;
    background: #fff;
    color: var(--wiki-heading);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

body.wiki-night .wiki-abilities__tab {
    background: var(--wiki-card);
}

.wiki-abilities__tab.is-active {
    background: var(--wiki-accent);
    border-color: var(--wiki-accent);
    color: #fff;
}

.wiki-abilities__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
}

/* display:grid would override the hidden attribute on inactive tabs */
.wiki-abilities__grid[hidden] {
    display: none;
}

.wiki-ability {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 9px 6px 8px;
    border: 2px solid var(--wiki-line);
    border-radius: 10px;
    background: var(--wiki-card);
    color: var(--wiki-heading);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.wiki-ability:hover,
.wiki-ability:focus-visible {
    border-color: var(--wiki-accent);
    transform: translateY(-2px);
    outline: none;
}

/* The in-game look: a 44x44 icon with the skill bar frame (gump 0x0093) drawn on top */
.wiki-ability__icon {
    position: relative;
    flex: none;
    width: 44px;
    height: 44px;
}

.wiki-ability__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/ability-frame.png") no-repeat center / 100% 100%;
    pointer-events: none;
}

.wiki-ability img,
.wiki-ability__placeholder {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: cover;
}

.wiki-ability__placeholder {
    display: grid;
    place-items: center;
    background: #1f2d46;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.wiki-ability__name {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

/* Ability tooltip: a small bubble with an arrow, above the card (below it when there is no
   room). Follows the wiki theme: light by day, dark in night mode. The script in index.php sets
   data-placement and --arrow-x. */
.wiki-tooltip {
    --tip-bg: #fffdf8;
    --tip-border: #d9d2c3;
    --tip-text: #3a352d;
    --tip-heading: #1f2d46;
    --tip-muted: #8d8375;
    --tip-chip: #f1ece2;

    position: fixed;
    z-index: 50;
    width: min(590px, calc(100vw - 24px));
    padding: 12px 14px;
    border: 1px solid var(--tip-border);
    border-radius: 8px;
    background: var(--tip-bg);
    color: var(--tip-text);
    box-shadow: 0 8px 24px rgba(31, 45, 70, 0.18);
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.wiki-tooltip.is-visible {
    opacity: 1;
    transform: none;
}

.wiki-tooltip[data-placement="bottom"] {
    transform: translateY(-4px);
}

.wiki-tooltip[data-placement="right"] {
    transform: translateX(-4px);
}

.wiki-tooltip[data-placement="left"] {
    transform: translateX(4px);
}

.wiki-tooltip.is-visible[data-placement] {
    transform: none;
}

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

body.wiki-night .wiki-tooltip {
    --tip-bg: #23262d;
    --tip-border: #3a3e47;
    --tip-text: #d8d4cc;
    --tip-heading: #fff;
    --tip-muted: #9a938a;
    --tip-chip: #2d3139;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* The arrow: a rotated square that shares the bubble's border */
.wiki-tooltip::after {
    content: "";
    position: absolute;
    left: var(--arrow-x, 50%);
    width: 12px;
    height: 12px;
    margin-left: -6px;
    background: var(--tip-bg);
    border: 1px solid var(--tip-border);
    transform: rotate(45deg);
}

.wiki-tooltip[data-placement="top"]::after {
    bottom: -7px;
    border-top: 0;
    border-left: 0;
}

.wiki-tooltip[data-placement="bottom"]::after {
    top: -7px;
    border-bottom: 0;
    border-right: 0;
}

/* Beside the card: the arrow sits on the side edge at --arrow-y */
.wiki-tooltip[data-placement="right"]::after,
.wiki-tooltip[data-placement="left"]::after {
    left: auto;
    top: var(--arrow-y, 24px);
    margin: -6px 0 0;
}

.wiki-tooltip[data-placement="right"]::after {
    left: -7px;
    border-top: 0;
    border-right: 0;
}

.wiki-tooltip[data-placement="left"]::after {
    right: -7px;
    border-bottom: 0;
    border-left: 0;
}

.wiki-tooltip__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.wiki-tooltip__head strong {
    color: var(--tip-heading);
    font-size: 15px;
    font-weight: 800;
}

.wiki-tooltip__slot {
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--wiki-accent, #e6552e);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* One line per paragraph, same spacing whether the author used <br> or separate paragraphs */
.wiki-tooltip__text p {
    margin: 0;
}

/* Text pasted into the editor often carries a fixed near-black colour; on the dark
   night tooltip that becomes invisible, so there it follows the tooltip colour */
body.wiki-night .wiki-tooltip__text * {
    color: inherit !important;
}

.wiki-tooltip__text,
.wiki-tooltip__text * {
    font-size: 13px !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
}

.wiki-tooltip__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--tip-border);
}

.wiki-tooltip__stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px 3px 4px;
    border-radius: 4px;
    background: var(--tip-chip);
    color: var(--tip-heading);
    font-size: 13px;
    font-weight: 800;
}

.wiki-tooltip__stats small {
    color: var(--tip-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
/* Stat icons: a coloured disc with a dark symbol (mana = water drop, like the in-game icon) */
.wiki-stat__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #d9d4c9;
    color: #0b1c26;
    font-size: 10px;
}

.wiki-stat--mana .wiki-stat__icon { background: #a8dcf5; }
.wiki-stat--range .wiki-stat__icon { background: #f6c4b4; }
.wiki-stat--cooldown .wiki-stat__icon { background: #f5e1a4; }
.wiki-stat--cast .wiki-stat__icon { background: #d6c8f2; }

/* ── Search results, empty and missing states ──────────────────────────────── */
.wiki-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 860px;
}

.wiki-results__item {
    padding: 16px 0;
    border-bottom: 1px solid var(--wiki-line);
}

.wiki-results__item > a {
    color: var(--wiki-heading);
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
}

.wiki-results__item > a:hover {
    color: var(--wiki-accent);
}

.wiki-results__item > a i {
    margin-right: 6px;
    color: var(--wiki-accent);
}

.wiki-results__item p {
    margin: 6px 0 4px;
    font-size: 14px;
    line-height: 1.55;
}

.wiki-results mark {
    padding: 0 2px;
    border-radius: 3px;
    background: rgba(230, 85, 46, 0.22);
    color: inherit;
}

.wiki-results__meta {
    color: var(--wiki-muted);
    font-size: 12px;
}

.wiki-empty {
    margin: 10px 0;
    color: var(--wiki-muted);
    font-size: 15px;
}

.wiki-missing {
    padding: 60px 20px;
    text-align: center;
    color: var(--wiki-muted);
}

.wiki-missing > i {
    font-size: 44px;
    color: var(--wiki-line);
}

.wiki-missing p {
    margin: 14px 0 20px;
    font-size: 16px;
}

.wiki-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    background: var(--wiki-accent);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

/* ── Narrower screens ──────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
    .wiki-page-grid.has-toc {
        grid-template-columns: minmax(0, 1fr);
    }

    .wiki-toc--side {
        display: none;
    }

    .wiki-toc--inline {
        display: block;
    }
}

/* Sidebar becomes a drawer */
@media (max-width: 980px) {
    .wiki-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        width: min(300px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
    }

    .wiki-layout.is-menu-open .wiki-sidebar {
        transform: none;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18);
    }

    .wiki-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 15;
        background: rgba(0, 0, 0, 0.35);
    }

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

    .wiki-topbar__menu {
        display: inline-flex;
    }

    .wiki-main {
        padding: 0 20px 60px;
    }

    .wiki-topbar {
        margin: 0 -20px 20px;
        padding: 10px 20px;
    }
}

@media (max-width: 640px) {
    .wiki-main {
        padding: 0 14px 50px;
    }

    .wiki-topbar {
        flex-wrap: wrap;
        margin: 0 -14px 16px;
        padding: 8px 14px;
    }

    .wiki-breadcrumb {
        order: 3;
        width: 100%;
    }

    .wiki-page-head__title {
        font-size: 24px;
    }

    .wiki-pager {
        grid-template-columns: 1fr;
    }

    .wiki-pager__link--next {
        grid-column: auto;
    }

    .wiki-abilities__grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* Compact stat chips so the four values fit on one line of the tooltip */
.wiki-tooltip__stats {
    gap: 4px;
}

.wiki-tooltip__stats .wiki-stat {
    gap: 4px;
    padding: 2px 7px 2px 3px;
    white-space: nowrap;
}

.wiki-tooltip__stats .wiki-stat small {
    font-size: 10.5px;
    letter-spacing: 0.2px;
}

.wiki-tooltip__stats .wiki-stat__icon {
    width: 21px;
    height: 21px;
    font-size: 10px;
}

/* Unit after a stat value ("2 sn"): quieter than the number */
.wiki-stat__unit {
    margin-left: -2px;
    color: var(--tip-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

/* Breadcrumb items carry the same icon as in the sidebar; only the separators are small */
.wiki-breadcrumb span i {
    margin-right: 3px;
    color: var(--wiki-accent);
    font-size: 11px;
    opacity: 1;
}

/* Text keeps a readable width; the contents box moves to the right edge of the column */
.wiki-page-grid {
    max-width: none;
}

.wiki-page-grid.has-toc {
    grid-template-columns: minmax(0, 900px) 240px;
    justify-content: space-between;
}

.wiki-page-grid:not(.has-toc) > .wiki-article {
    max-width: 900px;
}

@media (max-width: 1280px) {
    .wiki-page-grid.has-toc {
        grid-template-columns: minmax(0, 900px);
    }
}

/* Lighter reading: slightly smaller, softer text and quieter headings */
.wiki-body {
    font-size: 13px;
    line-height: 1.7;
}

.wiki-body strong,
.wiki-body b {
    font-weight: 600;
    color: var(--wiki-heading);
}

.wiki-body h2 {
    margin: 28px 0 10px;
    padding-bottom: 6px;
    border-bottom-width: 1px;
    font-size: 19px;
    font-weight: 700;
}

.wiki-body h3 {
    font-size: 16px;
    font-weight: 700;
}

.wiki-body p {
    margin: 0 0 12px;
}

.wiki-body li {
    margin: 2px 0;
}

.wiki-body a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(230, 85, 46, 0.35);
}

.wiki-body a:hover {
    text-decoration-color: currentColor;
}

/* The header's book logo hangs ~26px into the page: start the sidebar search below its tip */
.wiki-search {
    padding-top: 34px;
}

@media (max-width: 980px) {
    .wiki-search {
        padding-top: 12px;
    }
}

/* Wikipedia-style reading: 14px text on 1.6 lines, serif section titles (1.5em) over a
   thin rule, bold sub-sections (1.2em), links without underline until hovered */
.wiki-body {
    font-size: 14px;
    line-height: 1.6;
}

.wiki-body p {
    margin: 0.5em 0 0.8em;
}

.wiki-body ul,
.wiki-body ol {
    margin: 0.3em 0 0.8em;
    padding-left: 1.6em;
}

.wiki-body li {
    margin: 0 0 0.2em;
}

.wiki-body h2 {
    margin: 1.1em 0 0.35em;
    padding-bottom: 0.15em;
    border-bottom: 1px solid var(--wiki-line);
    font-family: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
    font-size: 1.5em;
    font-weight: 400;
    line-height: 1.3;
}

.wiki-body h3 {
    margin: 0.9em 0 0.3em;
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1.4;
}

.wiki-body a {
    text-decoration: none;
}

.wiki-body a:hover {
    text-decoration: underline;
}

/* ── Layout polish ─────────────────────────────────────────────────────────
   Text and "Bu Sayfada" sit together as one centred block (no dead strip between them) */
.wiki-page-grid,
.wiki-page-grid.has-toc {
    max-width: 1140px;
    margin: 0 auto;
    justify-content: stretch;
}

.wiki-page-grid.has-toc {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 44px;
}

.wiki-page-grid:not(.has-toc) {
    max-width: 860px;
}

.wiki-page-grid:not(.has-toc) > .wiki-article {
    max-width: none;
}

@media (max-width: 1280px) {
    .wiki-page-grid.has-toc {
        grid-template-columns: minmax(0, 1fr);
        max-width: 860px;
    }
}

/* One typeface across the page: section titles back to the site font, Wikipedia proportions kept */
.wiki-body h2 {
    font-family: inherit;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.1px;
}

.wiki-body h3 {
    font-size: 1.15em;
}

/* Lead: the page summary as an introduction under the title */
.wiki-lead {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-left: 4px solid var(--wiki-accent);
    border-radius: 0 8px 8px 0;
    background: var(--wiki-card);
    color: var(--wiki-heading);
    font-size: 15px;
    line-height: 1.55;
}

/* Sidebar: drafts get a small dot instead of a repeated "Taslak" badge (tooltip on hover) */
.wiki-nav__link .wiki-tag--dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 50%;
    background: #e0a800;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}

/* ── Article surface ───────────────────────────────────────────────────────
   Text and contents on a light "paper" card so the reading area stands out from the page */
.wiki-page-grid {
    padding: 30px 36px 36px;
    border: 1px solid var(--wiki-line);
    border-radius: 12px;
    background: #fbf9f4;
    box-shadow: 0 6px 24px rgba(31, 45, 70, 0.06);
}

body.wiki-night .wiki-page-grid {
    background: #1d1d1d;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.wiki-page-grid .wiki-toc--side {
    top: 64px;
    background: rgba(230, 85, 46, 0.05);
}

/* Category above the title */
.wiki-page-head__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--wiki-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.wiki-page-head__title {
    font-size: 32px;
}

/* Section titles start with a small accent mark */
.wiki-body h2 {
    position: relative;
    padding-left: 14px;
}

.wiki-body h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.35em;
    width: 4px;
    border-radius: 2px;
    background: var(--wiki-accent);
}

/* Orange square bullets */
.wiki-body ul {
    list-style: none;
    padding-left: 1.3em;
}

.wiki-body ul > li {
    position: relative;
}

.wiki-body ul > li::before {
    content: "";
    position: absolute;
    left: -1em;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--wiki-accent);
}

.wiki-body ol > li::marker {
    color: var(--wiki-accent);
    font-weight: 700;
}

/* Numbered contents with the current section highlighted */
.wiki-toc--side ul {
    counter-reset: toc;
}

.wiki-toc--side .wiki-toc__level-2 {
    counter-increment: toc;
}

.wiki-toc--side .wiki-toc__level-2 > a::before {
    content: counter(toc) ".";
    display: inline-block;
    min-width: 20px;
    color: var(--wiki-muted);
    font-weight: 700;
}

.wiki-toc--side a {
    padding: 5px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.wiki-toc--side a.is-current {
    background: rgba(230, 85, 46, 0.12);
    color: var(--wiki-accent);
    font-weight: 700;
}

.wiki-toc--side a.is-current::before {
    color: var(--wiki-accent);
}

@media (max-width: 640px) {
    .wiki-page-grid {
        padding: 18px 16px 22px;
        border-radius: 10px;
    }

    .wiki-page-head__title {
        font-size: 24px;
    }
}

/* ── Article card + separate "Bu Sayfada" card ─────────────────────────────
   The paper surface moves from the grid to the article itself; the contents become their own
   sticky card beside it: reading progress, a guide line with the current section marked,
   numbered sections and a back-to-top button. */
.wiki-page-grid,
body.wiki-night .wiki-page-grid {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    align-items: start;
}

.wiki-page-grid > .wiki-article {
    padding: 30px 36px 36px;
    border: 1px solid var(--wiki-line);
    border-radius: 12px;
    background: #fbf9f4;
    box-shadow: 0 6px 24px rgba(31, 45, 70, 0.06);
}

body.wiki-night .wiki-page-grid > .wiki-article {
    background: #1d1d1d;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.wiki-page-grid.has-toc {
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 260px;
}

.wiki-page-grid .wiki-toc--side {
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 0 0 12px;
    border: 1px solid var(--wiki-line);
    border-radius: 12px;
    background: #fbf9f4;
    box-shadow: 0 6px 24px rgba(31, 45, 70, 0.06);
}

body.wiki-night .wiki-page-grid .wiki-toc--side {
    background: #1d1d1d;
}

.wiki-toc__progress {
    height: 3px;
    background: var(--wiki-line);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.wiki-toc__progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--wiki-accent);
    transition: width 0.15s linear;
}

.wiki-toc--side .wiki-toc__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 18px 10px;
    color: var(--wiki-heading);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.wiki-toc--side .wiki-toc__title i {
    color: var(--wiki-accent);
    font-size: 12px;
}

/* The guide line */
.wiki-toc--side ul {
    margin: 0 18px;
    padding: 0;
    border-left: 2px solid var(--wiki-line);
}

.wiki-toc--side li {
    margin: 0;
}

.wiki-toc--side a,
.wiki-toc--side a.is-current {
    display: block;
    margin: 0 0 0 -2px;
    padding: 6px 8px 6px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    color: var(--wiki-text);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
}

.wiki-toc--side .wiki-toc__level-3 a {
    padding-left: 26px;
    font-size: 12.5px;
    color: var(--wiki-muted);
}

.wiki-toc--side a:hover {
    color: var(--wiki-accent);
    background: rgba(230, 85, 46, 0.06);
}

.wiki-toc--side a.is-current {
    border-left-color: var(--wiki-accent);
    background: rgba(230, 85, 46, 0.1);
    color: var(--wiki-accent);
    font-weight: 700;
}

.wiki-toc--side .wiki-toc__level-2 > a::before {
    min-width: 18px;
}

.wiki-toc__top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 36px);
    margin: 12px 18px 0;
    padding: 7px 10px;
    border: 1px solid var(--wiki-line);
    border-radius: 6px;
    background: transparent;
    color: var(--wiki-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.wiki-toc__top:hover {
    border-color: var(--wiki-accent);
    color: var(--wiki-accent);
}

@media (max-width: 640px) {
    .wiki-page-grid > .wiki-article {
        padding: 18px 16px 22px;
        border-radius: 10px;
    }
}

/* ── Final alignment ───────────────────────────────────────────────────────
   The top bar's content lines up with the centred article block (max 1140px) */
@media (min-width: 981px) {
    .wiki-topbar {
        padding-left: max(36px, calc((100% - 1140px) / 2 + 36px)); /* % = main content box */
        padding-right: max(36px, calc((100% - 1140px) / 2 + 36px));
    }
}

/* Lead: a light accent tint instead of grey on the paper card */
.wiki-lead {
    background: rgba(230, 85, 46, 0.07);
}

body.wiki-night .wiki-lead {
    background: rgba(230, 85, 46, 0.12);
}

/* Sidebar: long page names wrap onto a second line instead of being cut off */
.wiki-nav__link span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* Body text one step smaller (headings scale with it: h2 1.4em, h3 1.15em) */
.wiki-body {
    font-size: 13px;
}

/* Sidebar links: 14px at a lighter weight */
.wiki-nav__home,
.wiki-nav__link {
    font-size: 14px;
    font-weight: 500;
}

.wiki-nav__home,
.wiki-nav__home.is-active,
.wiki-nav__link.is-active {
    font-weight: 600;
}

/* ── Page update notes ("Son Güncellemeler") ─────────────────────────────── */
.wiki-updates {
    margin-top: 6px;
}

.wiki-toc--side .wiki-updates .wiki-toc__title {
    margin-top: 16px;
}

.wiki-toc--side ul + .wiki-updates {
    margin-top: 10px;
    padding-top: 2px;
    border-top: 1px solid var(--wiki-line);
}

.wiki-updates__list {
    list-style: none;
    margin: 0 18px;
    padding: 0;
}

.wiki-updates__item {
    position: relative;
    padding: 0 0 12px 16px;
    border-left: 2px solid var(--wiki-line);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--wiki-text);
}

.wiki-updates__item:last-child {
    padding-bottom: 2px;
}

.wiki-updates__item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--wiki-line);
    background: #fbf9f4;
}

.wiki-updates__item.is-new::before {
    border-color: var(--wiki-accent);
    background: var(--wiki-accent);
}

body.wiki-night .wiki-updates__item::before {
    background: #1d1d1d;
}

.wiki-updates__item time {
    display: block;
    margin-bottom: 2px;
    color: var(--wiki-muted);
    font-size: 11px;
    font-weight: 700;
}

.wiki-updates__item.is-new time {
    color: var(--wiki-accent);
}

.wiki-updates--inline .wiki-updates__list {
    margin: 10px 4px 0;
}

/* "Yeni" tags: page meta and sidebar */
.wiki-tag--new {
    background: var(--wiki-accent);
    color: #fff;
}

.wiki-nav__link .wiki-tag--new {
    margin-left: auto;
    padding: 1px 6px;
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wiki-nav__link .wiki-tag--new + .wiki-tag--dot {
    margin-left: 4px;
}

/* Narrow screens: the side "Bu Sayfada" card is hidden, so drop its column too
   (the 260px column above came after the earlier 1280px rule and kept an empty strip) */
@media (max-width: 1280px) {
    .wiki-page-grid.has-toc {
        grid-template-columns: minmax(0, 1fr);
        max-width: 860px;
    }
}

/* Sidebar: page names are kept short enough for one line; a longer name wraps in full
   (no ellipsis, no line clamp) */
.wiki-nav__link span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    -webkit-line-clamp: unset;
}

/* Tables: readable text with lower rows than the original 14px / 9px 11px */
.wiki-body table {
    font-size: 13.5px;
    line-height: 1.45;
}

.wiki-body th,
.wiki-body td {
    padding: 7px 11px;
}
