/* ===== GLOBAL SITE LAYOUT (NON-GAME PAGES) ===== */
:root {

    --bg-color: #0f172a;
    --text-color: #e5e7eb;
    --muted-text: #94a3b8;

    --card-bg: #1e293b;
    --card-border: #334155;
    --soft-bg: #1e293b;

    --sidebar-text: #cbd5f5;

    --link-color: #818cf8;
    --hover-link: #a5b4fc;

    --accent: #6366f1;

    --footer-text: #64748b;

    --badge-bg: rgba(99, 102, 241, 0.18);
    --badge-border: rgba(99, 102, 241, 0.45);

    --nav-btn: #1e293b;
    --hero-gradient: linear-gradient(90deg, var(--accent), #ffffff);
}

body.light-mode {

    --bg-color: #f6f8fc;
    --text-color: #1f2937;
    --muted-text: #6b7280;

    --card-bg: #ffffff;
    --card-border: #e6e8ef;
    --soft-bg: #eef2ff;

    --sidebar-text: #6b7280;

    --link-color: #6366f1;
    --hover-link: #4f46e5;

    --accent: #6366f1;

    --footer-text: #9ca3af;

    --badge-bg: rgba(99, 102, 241, 0.1);
    --badge-border: rgba(99, 102, 241, 0.35);

    --nav-btn: #ffffff;
    --hero-gradient: linear-gradient(90deg, var(--accent), #333);
}

* {
    transition: background 0.25s ease, color 0.25s ease, border 0.25s ease;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== TOP BAR ===== */

body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.8);
}

.active-entry {
    background: #1f2937;
    border-left: 3px solid #4da6ff;
}

.wiki-entry-item {
    cursor: pointer;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--bg-color);
    padding: 18px 40px;
    z-index: 100;
}

.site-title {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-desktop {
    display: flex;
    gap: 18px;
}

.burger-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-color);
    display: none;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.drag-ghost {
  opacity: 0.4;
}

.section-box {
  cursor: grab;
}
.section-box:active {
  cursor: grabbing;
}

.mobile-menu a {
    color: var(--muted-text);
    text-decoration: none;
}

.mobile-menu a:hover {
    color: var(--accent);
}

.wiki-lang-global a {
    font-size: 12px;
    margin-right: 6px;
    color: var(--muted-text);
    text-decoration: none;
}

.wiki-lang-global a.active-lang {
    color: var(--accent);
    font-weight: bold;
}

.nav-play-btn {
    background: var(--accent);
    color: black;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s ease;
}

.nav-play-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}


.site-title:hover {
    opacity: 0.7;
}

.toc-link {
    display: block;
    padding: 6px 10px;
    margin-bottom: 4px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 6px;
    transition: 0.2s;
}

.toc-link:hover {
    background: rgba(255, 204, 102, 0.2);
}

.wiki-heading.active-heading {
    background: rgba(255, 204, 102, 0.2);
    padding: 6px;
    border-radius: 6px;
}


/* ============================= */
/* CUSTOM TOC STYLE */
/* ============================= */

.custom-toc {
    width: 240px;
    position: sticky;
    top: 120px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 15px;
    background: var(--soft-bg);
    font-size: 13px;
}

.custom-toc h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-color);
}

.custom-toc ul {
    padding-left: 18px;
    margin: 0;
}

.custom-toc li {
    margin-bottom: 6px;
    list-style-type: disc;
    color: var(--muted-text);
}

.custom-toc a {
    color: #4da6ff;
    text-decoration: none;
    transition: 0.15s ease;
}

.custom-toc a:hover {
    color: var(--hover-link);
    text-decoration: underline;
}

.custom-toc {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 8px;
}

.custom-toc::-webkit-scrollbar {
    width: 6px;
}

.custom-toc::-webkit-scrollbar-thumb {
    background: #ffcc66;
    border-radius: 10px;
}

.toc-list {
    padding-left: 0;
}

.toc-list li {
    list-style: none;
    margin: 6px 0;
}

.toc-link {
    font-size: 14px;
    display: block;
    opacity: 0.85;
    transition: 0.2s ease;
}

.toc-link:hover {
    opacity: 1;
    color: #ffcc66;
}

.wiki-entrylist {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 14px;
    margin-bottom: 16px;
    border-radius: 12px;

    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.sidebar-box::-webkit-scrollbar {
    width: 7px;
}

.sidebar-box::-webkit-scrollbar-track {
    background: var(--soft-bg);
    border-radius: 10px;
}

.sidebar-box::-webkit-scrollbar-thumb {
    background: #ffcc66;
    border-radius: 10px;
    border: 2px solid var(--soft-bg);
}

.sidebar-box::-webkit-scrollbar-thumb:hover {
    background: #ffd98a;
}

.sidebar-box h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #ffcc66;
}

.sidebar-play-btn {
    display: block;
    text-align: center;
    padding: 12px;
background: var(--accent);
    color: black;
    font-weight: bold;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 204, 102, 0.4);
}

.toc-link.active {
    color: #ffcc66;
    font-weight: bold;
}

/* ============================= */
/* ADVANCED TOC TREE STYLE */
/* ============================= */

.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-list li {
    position: relative;
    margin-bottom: 6px;
}

/* level 1 */
.toc-level-1 {
    margin-left: 0;
    font-weight: 600;
}

/* level 2 */
.toc-level-2 {
    margin-left: 14px;
}

.toc-level-2::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 10px;
    width: 8px;
    height: 1px;
    background: var(--card-border);
}

/* level 3 */
.toc-level-3 {
    margin-left: 28px;
}

.toc-level-3::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    width: 10px;
    height: 1px;
    background: var(--card-border);
}

/* vertical guide line */
.toc-level-2,
.toc-level-3 {
    border-left: 1px solid var(--card-border);
    padding-left: 8px;
}

/* highlight heading */
.wiki-heading.active-heading {
    background: rgba(77, 166, 255, 0.15);
    padding: 6px;
    border-radius: 6px;
}

.theme-toggle {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-color);
    transition: 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

#entry-list div {
    padding: 6px 8px;
    cursor: pointer;
}

#entry-list div.active-entry {
    background: var(--soft-bg);
    border-left: 3px solid var(--accent);
    color: var(--accent);
}

.wiki-breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--muted-text);
}

.wiki-breadcrumb a {
    color: var(--link-color);
    text-decoration: none;
    transition: 0.15s ease;
}

.wiki-breadcrumb a:hover {
    color: var(--hover-link);
    text-decoration: underline;
}

.wiki-breadcrumb .crumb-active {
    color: var(--accent);
    font-weight: 600;
}


.wiki-intro-btn {
    width: 100%;
    margin: 10px 0 15px 0;
    padding: 8px;

    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--accent);

    cursor: pointer;
    transition: 0.2s ease;
}

.wiki-intro-btn:hover {
    background: var(--soft-bg);
    border-color: var(--accent);
}



/* right nav */
.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-nav a {
    font-size: 13px;
    color: var(--muted-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-nav a:hover {
    color: var(--accent);
}

.a-mail {
    display: inline-block;
    font-weight: 600;
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid var(--card-border);
    transition: all 0.2s ease;
}

.a-mail:hover {
    color: var(--hover-link);
    border-bottom-color: var(--accent);
}



/* ===== MAIN CONTENT ===== */

.site-container {
    max-width: 760px;
    margin: 140px auto 120px;
    padding: 0 20px;
}

.site-container h1,
h2,
h3,
h4 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.site-container p,
.site-container li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted-text);
}

.site-highlight {
    margin: 20px 0;
    padding: 10px 14px;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent);
}

/* ===== FOOTER LEFT SMALL LINKS ===== */

.site-footer {
    position: fixed;
    bottom: 20px;
    left: 40px;

    font-size: 11px;
    color: var(--footer-text);
}

.site-footer a {
    color: var(--footer-text);
    text-decoration: none;
    margin-right: 12px;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: var(--accent);
}

/* ===== BUTTONS ===== */

.site-btn {
    display: inline-block;
    padding: 10px 18px;
    margin-top: 10px;

    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;

    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;

    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.site-btn:hover {
    transform: translateY(-2px);
}

/* ===== DISABLED BUTTON ===== */

.disabled-btn {
    background: linear-gradient(#3a3a3a, #2a2a2a);
    color: #777;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none !important;
}

/* ===== COMING SOON WRAPPER ===== */

.coming-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* ===== COMING SOON BADGE ===== */

.coming-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 20px;

    background: var(--badge-bg);
    border: 1px solid var(--badge-border);

    color: var(--accent);
    letter-spacing: 0.5px;

    animation: pulseGlow 2s infinite ease-in-out;
}

/* subtle glow animation */

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 rgba(255, 204, 102, 0);
    }

    50% {
        box-shadow: 0 0 10px rgba(255, 204, 102, 0.4);
    }

    100% {
        box-shadow: 0 0 0 rgba(255, 204, 102, 0);
    }
}

/* ============================= */
/* LAYOUT */
/* ============================= */

.wiki-layout {
    display: flex;
    gap: 40px;
    margin-top: 120px;
    padding: 0 40px 80px 40px;
    align-items: flex-start;
}

/* LEFT SIDEBAR (CATEGORIES) */
.wiki-sidebar {
    width: 220px;
    font-size: 13px;
    position: sticky;
    top: 120px;
}

.wiki-sidebar h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-color);
}

.wiki-sidebar div {
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--sidebar-text);
    transition: 0.15s ease;
}

.wiki-sidebar div:hover {
    color: var(--accent);
}


/* MAIN CONTENT */
.wiki-content {
    flex: 1;
    max-width: 800px;
}

.wiki-content h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

.wiki-content h2 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 6px;
    color: var(--accent);
}

.wiki-content p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--muted-text);
}


/* RIGHT ENTRY LIST */

.wiki-entrylist {
    width: 240px;
    font-size: 13px;
    position: sticky;
    top: 120px;
}

.wiki-entrylist h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-color);
}

.hidden-entrylist {
    display: none;
}


/* ENTRY LIST STYLE (BLUE LINK STYLE) */
.wiki-entrylist div {
    color: var(--link-color);
    cursor: pointer;
    margin-bottom: 8px;
    transition: 0.15s ease;
}

.wiki-entrylist div:hover {
    color: var(--hover-link);
    text-decoration: underline;
}

.wiki-entrylist img {
    vertical-align: middle;
}

/* ============================= */
/* CARD STYLE */
/* ============================= */

/* .wiki-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
} */

.wiki-card > img {
    max-width: 160px;
    display: block;
    margin-bottom: 12px;
}

.wiki-intro-btn,
.wiki-category-item {
    cursor: pointer;
}


/* MINI FARM CARD */

.wiki-mini-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
    margin-top: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.wiki-mini-images {
    display: flex;
    gap: 10px;
}

.wiki-mini-images img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: var(--soft-bg);
    border-radius: 8px;
    padding: 5px;
}

.wiki-mini-info p {
    margin: 3px 0;
    font-size: 13px;
    color: var(--muted-text);
}

/* FAIRY ITEM GRID */

.fairy-item-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.fairy-item-card {
    background: var(--soft-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px;
    width: 110px;
    text-align: center;
}

.fairy-item-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.fairy-item-card span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.fairy-item-card.dislike {
    border-color: #552222;
}


/* FAIRY GALLERY */
/* ULTRA COMPACT FAIRY GALLERY */

.fairy-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.fairy-gallery-card {
    width: 85px;
    text-align: center;
}

.fairy-gallery-card img {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    transition: 0.15s ease;
}

.fairy-gallery-card img:hover {
    border-color: #ffcc66;
}

.fairy-gallery-card span {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--muted-text);
}

.job-rank-card {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 12px;
    background: var(--soft-bg);
    align-items: center;
}

.job-rank-image-wrapper {
    position: relative;
}

.job-rank-image-wrapper img {
    width: 150px;
    border-radius: 12px;
}

.rank-label {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent);
    padding: 6px 10px;
    border-radius: 50%;
    font-weight: bold;
    color: var(--bg-color);
}

.rank-F img {
    box-shadow: 0 0 15px #777;
}

.rank-E img {
    box-shadow: 0 0 20px #4caf50;
}

.rank-D img {
    box-shadow: 0 0 20px #2196f3;
}

.rank-C img {
    box-shadow: 0 0 25px #9c27b0;
}

.rank-B img {
    box-shadow: 0 0 30px #ff9800;
}

.rank-A img {
    box-shadow: 0 0 35px #f44336;
}

.rank-S img {
    box-shadow: 0 0 45px gold;
}


.wiki-card,
.wiki-mini-card,
.fairy-item-card,
.job-rank-card {
    transition: background 0.3s ease, border 0.3s ease;
}

/* FAIRY TOP LAYOUT */

.fairy-top-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.fairy-left {
    flex: 0 0 auto;
}

.fairy-hero-img {
    max-width: 260px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.fairy-right {
    flex: 1;
}

.fairy-stat-card {
    background: var(--soft-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 18px;
    font-size: 14px;
}

.fairy-stat-card p {
    margin: 6px 0;
}

.wiki-entry-card {
    padding: 6px 0;
    background: transparent;
    border-radius: 0;
    text-align: left;
    font-weight: normal;
    color: var(--link-color);
    cursor: pointer;
    transition: 0.15s ease;
}

.wiki-entry-card:hover {
    color: var(--hover-link);
    text-decoration: underline;
    transform: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-desktop {
    display: flex;
    gap: 18px;
}

.burger-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-color);
    display: none;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.mobile-menu a {
    color: var(--muted-text);
    text-decoration: none;
}

.mobile-menu a:hover {
    color: var(--accent);
}

.wiki-lang-global a {
    font-size: 12px;
    margin-right: 6px;
    color: var(--muted-text);
    text-decoration: none;
}

.wiki-lang-global a.active-lang {
    color: var(--accent);
    font-weight: bold;
}

/* ARTCLE */

/* ============================= */
/* ARTICLE HERO */
/* ============================= */

.article-hero {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

.hero-image img {
    width: 260px;
    height: 260px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-content {
    flex: 1;
}

/* ===================================== */
/* HERO TITLE PREMIUM */
/* ===================================== */

.hero-content h1 {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
    position: relative;

    background: var(--hero-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Accent underline */

.hero-content h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    margin-top: 10px;

    background: var(--accent);
    border-radius: 4px;
}

/* META */

.hero-meta {
    font-size: 13px;
    color: var(--muted-text);
    margin-bottom: 12px;
    opacity: 0.8;
}

/* DESCRIPTION */

.hero-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted-text);
    max-width: 640px;
}

.wiki-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.smart-link {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    transition: 0.15s ease;
}

.smart-link:hover {
    color: var(--hover-link);
}

.link-preview {
    position: absolute;
    display: none;
    z-index: 9999;
    width: 260px;
    pointer-events: none;
}

.preview-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.preview-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
}

.preview-card h4 {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-color);
}

.preview-card p {
    margin: 0;
    font-size: 12px;
    color: var(--muted-text);
}

/* GAMBAR WIKI ARTIKEL*/
.wiki-img-wrapper {
    margin: 20px 0;
}
.wiki-img {
    display: block;
    margin: 20px auto;
    border-radius: 8px;
}

.wiki-img-small {
    max-width: 200px;
    width: 100%;
}

.wiki-img-medium {
    max-width: 400px;
    width: 100%;
}

.wiki-img-large {
    max-width: 700px;
    width: 100%;
}

.wiki-img-full {
    width: 100%;
}



.align-left {
    text-align: left;
}

.align-center {
    text-align: center;
}

.align-right {
    text-align: right;
}

.wiki-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
}

/* ===================================== */
/* PREMIUM HEADING SYSTEM */
/* ===================================== */

.wiki-card h1,
.wiki-card h2,
.wiki-card h3,
.wiki-card h4,
.wiki-card h5,
.wiki-card h6 {
    position: relative;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ================= H1 ================= */

.wiki-card h1 {
    font-size: 26px;
    padding: 14px 18px;
    margin: 35px 0 20px 0;

    background: linear-gradient(90deg,
            rgba(255, 204, 102, 0.15),
            rgba(255, 204, 102, 0.05));

    border-left: 6px solid var(--accent);
    border-radius: 10px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ================= H2 ================= */

.wiki-card h2 {
    font-size: 20px;
    padding: 10px 14px;
    margin: 30px 0 15px 0;

    background: rgba(255, 204, 102, 0.08);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}

/* ================= H3 ================= */

.wiki-card h3 {
    font-size: 17px;
    margin: 25px 0 10px 0;
    padding-left: 12px;

    border-left: 3px solid var(--accent);
}

/* ================= H4 ================= */

.wiki-card h4 {
    font-size: 15px;
    margin: 20px 0 8px 0;
    padding-bottom: 4px;

    border-bottom: 2px solid rgba(255, 204, 102, 0.3);
}

/* ================= H5 ================= */

.wiki-card h5 {
    font-size: 14px;
    margin: 18px 0 6px 0;
    color: var(--accent);
}

/* ================= H6 ================= */

.wiki-card h6 {
    font-size: 12px;
    margin: 15px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted-text);
}

.wiki-heading.active-heading {
    background: rgba(255, 204, 102, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
    transition: 0.3s ease;
}

/* ============================= */
/* TOC TOGGLE BUTTON */
/* ============================= */

.toc-toggle {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 10px;

    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;

    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);

    cursor: pointer;
    transition: 0.2s ease;
}

.toc-toggle:hover {
    background: var(--soft-bg);
    border-color: var(--accent);
    color: var(--accent);
}

.toc-toggle::after {
    content: "▼";
    float: right;
    font-size: 12px;
    opacity: 0.7;
    transition: 0.2s ease;
}

.custom-toc.active .toc-toggle::after {
    transform: rotate(180deg);
}

.toc-toggle {
    display: none;
}

/* ============================= */
/* MOBILE WIKI FINAL FIX */
/* ============================= */

@media (max-width: 1024px) {
    .custom-toc {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        margin: 20px 0;
    }
}

@media (max-width: 768px) {
    .toc-toggle {
        display: block;
    }
    
    .sidebar-box{
        max-height: 240px;
    }

    .custom-toc .toc-list {
        display: none;
    }

    .custom-toc.active .toc-list {
        display: block;
    }

    /* ===== Layout jadi vertikal ===== */
    .wiki-layout {
        display: flex;
        flex-direction: column;
        padding: 90px 15px 60px 15px;
        gap: 20px;
    }

    /* ===== Sidebar atas ===== */
    .wiki-sidebar {
        order: 1;
        width: 100%;
        position: static;
    }

    /* ===== Content di tengah ===== */
    .wiki-content {
        order: 2;
        width: 100%;
        max-width: 100%;
    }

    /* ===== Entry list pindah ke bawah ===== */
    .wiki-entrylist {
        order: 3;
        width: 100%;
        position: static;
        margin-top: 15px;
    }

    /* ================================= */
    /* BEHAVIOR LOGIC TANPA :has()      */
    /* ================================= */

    /* Kalau TIDAK ADA id → sidebar kanan hidden */
    .wiki-entrylist.hidden-entrylist {
        display: none !important;
    }

    /* Kalau ADA id (detail terbuka) → grid di tengah hilang */
    .wiki-entrylist:not(.hidden-entrylist) {
        display: block;
    }

    .wiki-entrylist:not(.hidden-entrylist)+* {
        /* fallback safety */
    }

    /* Hapus grid saat detail aktif */
    .wiki-content .wiki-entry-grid {
        display: block;
    }

    .wiki-entrylist:not(.hidden-entrylist)~.wiki-content .wiki-entry-grid {
        display: none;
    }

    /* ===== Card styling biar rapih ===== */
    .wiki-entry-card {
        padding: 14px;
        border: 1px solid var(--card-border);
        border-radius: 10px;
        background: var(--soft-bg);
        margin-bottom: 10px;
    }

    .wiki-mini-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .fairy-top-layout {
        flex-direction: column;
        gap: 15px;
    }

    .fairy-hero-img {
        max-width: 100%;
    }

    .nav-desktop {
        display: none;
    }

    .burger-btn {
        display: block;
    }

    .nav-desktop {
        display: none;
    }

    .burger-btn {
        display: block;
    }

    /* ============================= */
    /* ARTICLE HERO MOBILE FIX */
    /* ============================= */

    .article-hero {
        flex-direction: column;
        gap: 20px;
    }

    .hero-image img {
        width: 100%;
        height: auto;
        max-height: 320px;
    }

    .hero-content h1 {
        font-size: 26px;
    }

    .hero-description {
        font-size: 14px;
    }

    /* ============================= */
    /* TOC MOBILE FIX */
    /* ============================= */

    .toc-list {
        display: none;
    }

    .custom-toc.active .toc-list {
        display: block;
    }

   .custom-toc {
        position: static;
        width: 95%;
        max-height: none;
        overflow: visible;

        margin: 15px 0 25px 0;
        padding: 14px;
        border-radius: 12px;
        font-size: 14px;

        box-shadow: 0 4px 14px rgba(0,0,0,.08);
    }

    .custom-toc::-webkit-scrollbar {
        display: none;
    }
}