/* Wiki presentation layer: loaded after the legacy and theme styles. */
.wiki-theme-page {
    --wiki-ink: #f3ebdc;
    --wiki-muted: #b7b2a9;
    --wiki-line: rgba(204, 171, 107, .2);
    background: #101214;
    color: var(--wiki-ink);
}
body.wiki-theme-page::before,
body.wiki-theme-page::after { background: none; }
.wiki-theme-page .wiki-hero {
    min-height: 380px;
    padding: 54px 0;
    border-bottom: 1px solid var(--wiki-line);
}
.wiki-theme-page .wiki-hero > img { object-position: center 38%; }
.wiki-theme-page .wiki-hero::after {
    background: linear-gradient(90deg, #101214 5%, rgba(16,18,20,.87) 35%, rgba(16,18,20,.18) 80%), linear-gradient(0deg, #101214, transparent 65%);
}
.wiki-theme-page .wiki-hero-panel {
    width: min(630px, calc(100% - 48px));
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
.wiki-theme-page .wiki-hero-panel > span {
    padding: 0;
    border: 0;
    background: none;
    color: #dbb575;
    letter-spacing: .18em;
    font-size: .7rem;
}
.wiki-theme-page .wiki-hero-panel h1 {
    margin: 18px 0;
    font-size: clamp(2rem, 4.4vw, 3.7rem);
    line-height: 1.14;
    letter-spacing: -.035em;
    text-shadow: none;
}
.wiki-theme-page .wiki-hero-panel p { max-width: 440px; font-size: .95rem; line-height: 1.8; color: #c3beb5; }
.wiki-theme-page .wiki-hero-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 24px; }
.wiki-theme-page .wiki-hero-actions a { flex: 0 1 auto; min-width: 110px; min-height: 42px; border-radius: 5px; background: #242321; font-size: .82rem; }
.wiki-theme-page .wiki-hero-actions a:first-child { background: #d8b477; border-color: #d8b477; color: #181713; }
.wiki-theme-page .wiki-nav { background: rgba(16,18,20,.97); box-shadow: 0 8px 24px #0003; border-block: 1px solid var(--wiki-line); padding: 0; }
.wiki-theme-page .wiki-nav-links { justify-content: flex-start; gap: 24px; padding: 0; flex-wrap: nowrap; overflow-x: auto; }
.wiki-theme-page .wiki-nav-link { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 20px 4px; background: none; color: #b7b2a9; font-size: .82rem; box-shadow: none; }
.wiki-theme-page .wiki-nav-link.active,
.wiki-theme-page .wiki-nav-link:hover { color: #e8c88e; border-bottom-color: #d8b477; background: none; transform: none; }
.wiki-theme-page .wiki-section { padding: 48px 0; background: transparent; scroll-margin-top: 200px; }
.wiki-theme-page .wiki-section:nth-of-type(even) { background: #ffffff02; }
.wiki-theme-page .wiki-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.wiki-theme-page .wiki-section-title { margin: 0 0 20px; padding: 0; border: 0; font-size: clamp(1.3rem, 2.3vw, 1.85rem); text-transform: none; letter-spacing: -.02em; }
.wiki-theme-page .wiki-section-heading .wiki-section-title { margin: 0; }
.wiki-theme-page .wiki-section-title::after { display: none; }
.wiki-theme-page .wiki-section-title i { color: #d8b477; font-size: .85em; }
.wiki-theme-page .wiki-entry-count { flex-shrink: 0; padding: 5px 10px; border: 1px solid var(--wiki-line); border-radius: 20px; color: #bdb6a8; font-size: .7rem; }
.wiki-theme-page .wiki-content { padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0; }
.wiki-theme-page .wiki-content > .wiki-intro { padding: 0; margin-bottom: 24px; border: 0; color: #b7b2a9; font-size: .87rem; line-height: 1.7; text-align: left; }
.wiki-theme-page .wiki-content > .mt-5 { margin-top: 0 !important; }
.wiki-theme-page #npcTabs,
.wiki-theme-page #slot4Tabs { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; }
.wiki-theme-page #npcTabs .npc-tab-btn,
.wiki-theme-page #slot4Tabs .npc-tab-btn { position: relative; height: 238px; aspect-ratio: auto; padding: 18px 12px 48px; border: 1px solid var(--wiki-line); border-radius: 8px; background: radial-gradient(ellipse at 50% 70%, #b18a4330, transparent 70%), #1a1c1e; box-shadow: none; }
.wiki-theme-page #npcTabs .npc-tab-btn { grid-template-rows: minmax(0, 1fr); }
.wiki-theme-page #npcTabs .npc-tab-btn.active,
.wiki-theme-page #slot4Tabs .npc-tab-btn.active { background: radial-gradient(ellipse at 50% 70%, #b18a4330, transparent 70%), #1a1c1e; border-color: var(--wiki-line); box-shadow: none; }
.wiki-theme-page #npcTabs .npc-tab-btn img,
.wiki-theme-page #slot4Tabs .npc-tab-btn img { width: 100%; height: 100%; max-height: 175px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 10px #0008); }
.wiki-theme-page #npcTabs .npc-portrait-name,
.wiki-theme-page #slot4Tabs .npc-portrait-name { position: absolute; inset: auto 0 0; padding: 13px 8px; min-height: 44px; background: #131517e8; border-top: 1px solid var(--wiki-line); color: #ece1ce; font-size: .8rem; line-height: 1.4; text-align: center; }
.wiki-theme-page #craftTabs .npc-tab-btn { border-radius: 8px; background: linear-gradient(120deg, #af86421a, transparent), #1a1c1e; box-shadow: none; }
.wiki-theme-page .metin-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; }
.wiki-theme-page .metin-card { min-height: 196px; padding: 16px; border: 1px solid var(--wiki-line); border-radius: 8px; background: radial-gradient(ellipse at bottom, #ac834021, transparent 75%), #1a1c1e; box-shadow: none; }
.wiki-theme-page .metin-name { font-size: .8rem; line-height: 1.5; color: #e5dac6; }
.wiki-theme-page .metin-card img { height: 132px; max-width: 100%; object-fit: contain; transform: none; }
.wiki-theme-page .wiki-article-card { border-radius: 8px; background: #1a1c1e; box-shadow: none; }
.wiki-theme-page .wiki-article-card-body h3 { font-size: 1.1rem; line-height: 1.5; }
.wiki-theme-page :is(.npc-tab-btn, .metin-card, .wiki-article-card) { transition: border-color .2s, transform .2s; }
.wiki-theme-page :is(.npc-tab-btn, .metin-card, .wiki-article-card):hover { border-color: #d8b477; }
.wiki-theme-page :is(a, button):focus-visible { outline: 2px solid #f1cf8d; outline-offset: 4px; }
@media (max-width: 767px) {
    .wiki-theme-page .wiki-hero { min-height: 330px; padding: 36px 0; }
    .wiki-theme-page .wiki-hero-panel { margin: 0 20px; width: calc(100% - 40px); }
    .wiki-theme-page .wiki-hero > img { object-position: 64% center; opacity: .6; }
    .wiki-theme-page .wiki-hero-panel h1 { font-size: clamp(1.9rem, 7.5vw, 2.8rem); }
    .wiki-theme-page .wiki-hero-actions { display: flex; flex-wrap: wrap; }
    .wiki-theme-page .wiki-hero-actions a { min-width: 90px; }
    .wiki-theme-page .wiki-nav-links { gap: 18px; }
    .wiki-theme-page .wiki-nav-link { padding-block: 16px; font-size: .76rem; }
    .wiki-theme-page .wiki-section { padding: 32px 0; }
    .wiki-theme-page .wiki-section .container { padding-inline: 18px; }
    .wiki-theme-page #npcTabs,
    .wiki-theme-page #slot4Tabs,
    .wiki-theme-page .metin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .wiki-theme-page #npcTabs .npc-tab-btn,
    .wiki-theme-page #slot4Tabs .npc-tab-btn { height: 215px; }
    .wiki-theme-page #craftTabs { grid-template-columns: 1fr; }
    .wiki-theme-page .wiki-articles-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .wiki-theme-page :is(.npc-tab-btn, .metin-card, .wiki-article-card) { transition: none; }
}

/* Compact popup sizes; preserve full-size text and scroll long content. */
.wiki-model-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 8px; }
.wiki-model-actions button { min-height: 32px; padding: 5px 10px; border: 1px solid #776445; border-radius: 4px; background: #171c19; color: #e9dfca; font: 12px/1.4 Inter, sans-serif; }
.wiki-model-actions button[aria-pressed="true"] { color: #171510; background: #d8b477; border-color: #d8b477; }
.wiki-theme-page .craft-game-modal .modal-dialog {
    width: min(var(--craft-modal-width, 780px), 780px, calc(100vw - 32px));
    max-width: 780px;
    margin-inline: auto;
}
.wiki-theme-page .craft-game-modal.is-boss .modal-dialog {
    width: min(660px, calc(100vw - 32px));
}
.wiki-theme-page .craft-game-modal.is-shop .modal-dialog {
    width: min(310px, calc(100vw - 32px));
}
.wiki-theme-page .craft-game-modal .game-craft-window {
    min-height: 0;
    max-height: min(680px, calc(100dvh - 64px));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.wiki-theme-page .craft-game-modal .game-craft-titlebar {
    position: sticky;
    top: 0;
    z-index: 5;
}
.wiki-theme-page .craft-game-modal.is-shop .game-shop-products {
    max-height: min(420px, calc(100dvh - 210px));
}
.wiki-theme-page .craft-game-modal.is-boss .game-shop-products {
    max-height: min(500px, calc(100dvh - 160px));
    padding: 8px;
}
.wiki-theme-page .boss-target-model .wiki-model-stage,
.wiki-theme-page .boss-target-model > .boss-target-portrait {
    height: 260px;
}
.wiki-theme-page .wiki-item-dialog {
    width: min(760px, calc(100vw - 32px));
    max-width: 760px;
    margin-inline: auto;
}
.wiki-theme-page .wiki-item-dialog .modal-content {
    max-height: min(680px, calc(100dvh - 64px));
}
.wiki-theme-page .wiki-item-dialog .modal-body {
    max-height: min(580px, calc(100dvh - 150px));
    overflow-y: auto;
}
.wiki-theme-page .wiki-boss-art img,
.wiki-theme-page .wiki-boss-media img,
.wiki-theme-page .wiki-craft-popup-art img {
    max-height: min(40vh, 300px);
}
@media (max-width: 640px) {
    .wiki-theme-page .craft-game-modal .modal-dialog,
    .wiki-theme-page .wiki-item-dialog { margin-block: 20px; }
    .wiki-theme-page .boss-target-model .wiki-model-stage,
    .wiki-theme-page .boss-target-model > .boss-target-portrait { height: 190px; }
}
