* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-deep: #110d0b;
    --bg-mid: #1c1611;
    --bg-wallpaper: url('https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/814380/header.jpg?t=1762888662');
    --panel: rgba(36, 28, 21, 0.84);
    --panel-strong: rgba(46, 35, 27, 0.94);
    --border: rgba(197, 161, 104, 0.45);
    --text-main: #f4e8d6;
    --text-muted: #d0bea4;
    --accent-gold: #c5a168;
    --accent-ember: #bf6e38;
    --accent-leaf: #6c8a5b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

body {
    font-family: 'Cardo', Georgia, serif;
    color: var(--text-main);
    background: #0f0b09;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: var(--bg-wallpaper);
    background-size: cover;
    background-position: center top;
    filter: saturate(0.9) contrast(1.06) brightness(0.4);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 10%, rgba(191, 110, 56, 0.18) 0%, transparent 34%),
        radial-gradient(circle at 84% 16%, rgba(108, 138, 91, 0.14) 0%, transparent 30%),
        linear-gradient(160deg, rgba(17, 13, 11, 0.9) 0%, rgba(24, 18, 14, 0.86) 50%, rgba(28, 22, 17, 0.9) 100%);
}

.wiki-shell {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.wiki-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.wiki-brand {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.wiki-home-link {
    text-decoration: none;
    color: var(--accent-gold);
    border: 1px solid var(--border);
    padding: 0.48rem 0.85rem;
    border-radius: 7px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.wiki-home-link:hover {
    transform: translateY(-2px);
    background: rgba(197, 161, 104, 0.12);
}

.wiki-header {
    background: linear-gradient(145deg, rgba(45, 34, 26, 0.84), rgba(24, 18, 15, 0.9));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.8rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.wiki-header::after {
    content: '';
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 161, 104, 0.2) 0%, transparent 70%);
}

.wiki-breadcrumb {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

.wiki-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    letter-spacing: 0.04em;
    color: #f8ecd9;
}

.wiki-subtitle {
    color: var(--text-muted);
    margin-top: 0.75rem;
    max-width: 78ch;
    line-height: 1.55;
}

.wiki-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 320px;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.wiki-card {
    background: var(--panel);
    border: 1px solid rgba(197, 161, 104, 0.32);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.toc-panel {
    position: sticky;
    top: 1rem;
    align-self: start;
    padding: 1rem;
}

.toc-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.8rem;
    color: var(--accent-gold);
}

.toc-list {
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.toc-group {
    border: 1px solid rgba(197, 161, 104, 0.2);
    border-radius: 10px;
    padding: 0.62rem 0.55rem 0.56rem;
    background: linear-gradient(145deg, rgba(43, 33, 25, 0.48), rgba(24, 19, 15, 0.42));
}

.toc-group-title {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-gold);
    margin-bottom: 0.45rem;
    padding-bottom: 0.36rem;
    border-bottom: 1px solid rgba(197, 161, 104, 0.2);
}

.toc-sublist {
    list-style: none;
    display: grid;
    gap: 0.22rem;
}

.toc-sublist a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.94rem;
    line-height: 1.35;
    display: block;
    border-left: 2px solid rgba(197, 161, 104, 0.24);
    padding: 0.25rem 0.3rem 0.25rem 0.52rem;
    border-radius: 0 6px 6px 0;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.toc-sublist a:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(197, 161, 104, 0.09);
    transform: translateX(3px);
}

.content-panel {
    padding: 1.3rem;
    display: grid;
    gap: 1rem;
}

.wiki-section {
    background: rgba(15, 11, 9, 0.28);
    border: 1px solid rgba(197, 161, 104, 0.18);
    border-radius: 10px;
    padding: 1.1rem;
}

.wiki-section h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.wiki-section p {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 0.7rem;
}

.wiki-section p:last-child {
    margin-bottom: 0;
}

.wiki-list {
    padding-left: 1.2rem;
    line-height: 1.65;
    color: var(--text-main);
}

.wiki-list li {
    margin-bottom: 0.38rem;
}

.ending-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 0.72rem;
}

.ending-list li {
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(197, 161, 104, 0.2);
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(43, 33, 25, 0.5), rgba(24, 19, 15, 0.42));
}

.ending-btn {
    text-decoration: none;
    color: #f8ecd9;
    background: linear-gradient(145deg, rgba(191, 110, 56, 0.88), rgba(150, 75, 34, 0.92));
    border: 1px solid rgba(245, 193, 134, 0.55);
    border-radius: 8px;
    padding: 0.4rem 0.72rem;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.ending-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.single-ending-cta {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-start;
}

.entry-grid {
    display: grid;
    gap: 0.9rem;
}

.entry-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    padding: 0.8rem;
    background: rgba(28, 21, 17, 0.75);
    border: 1px solid rgba(197, 161, 104, 0.16);
    border-radius: 10px;
}

.entry-image {
    width: 100%;
    height: 100%;
    min-height: 140px;
    max-height: 170px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(197, 161, 104, 0.2);
}

.entry-copy {
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.entry-copy h3 {
    font-family: 'Cinzel', serif;
    color: #f8ecd9;
    font-size: 1.08rem;
}

.entry-copy p {
    margin-bottom: 0;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-entry {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.compact-entry .entry-image {
    max-height: 150px;
}

.boss-entry .entry-image {
    max-height: 160px;
}

#genichiro .entry-image {
    object-position: center 22%;
}

#guardian-ape .entry-image {
    object-position: center 45%;
}

#owl .entry-image {
    object-position: center 28%;
}

#true-corrupted-monk .entry-image {
    object-position: center 34%;
}

#divine-dragon .entry-image {
    object-position: center 42%;
}

#isshin .entry-image {
    object-position: center 30%;
}

.highlight-note {
    margin-top: 0.8rem;
    border-left: 3px solid var(--accent-ember);
    padding: 0.65rem 0.8rem;
    background: rgba(191, 110, 56, 0.08);
    color: #f0d9c0;
}

.progress-sheet {
    margin-top: 0.95rem;
    padding: 0.9rem;
    border: 1px solid rgba(197, 161, 104, 0.3);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(45, 34, 26, 0.68), rgba(24, 18, 14, 0.72));
}

.progress-sheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin-bottom: 0.65rem;
}

.progress-sheet-head h3 {
    font-family: 'Cinzel', serif;
    color: #f6e9d5;
    font-size: 1rem;
}

.progress-total {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.progress-reset {
    margin-left: auto;
    border: 1px solid rgba(197, 161, 104, 0.38);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-main);
    padding: 0.4rem 0.65rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.progress-reset:hover {
    background: rgba(191, 110, 56, 0.2);
    transform: translateY(-1px);
}

.progress-checklist {
    padding-left: 1.1rem;
    line-height: 1.62;
}

.progress-checklist li {
    margin-bottom: 0.38rem;
}

.progress-checklist input[type="checkbox"] {
    margin-right: 0.45rem;
}

.progress-checklist a {
    color: var(--accent-gold);
}

.progress-checklist a:hover {
    color: #e5c489;
}

.infobox {
    position: sticky;
    top: 1rem;
    align-self: start;
    overflow: hidden;
}

.infobox-head {
    background: linear-gradient(145deg, rgba(197, 161, 104, 0.2), rgba(86, 58, 36, 0.2));
    padding: 0.95rem;
    border-bottom: 1px solid rgba(197, 161, 104, 0.28);
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-align: center;
    color: #f6e9d5;
}

.infobox-cover {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-bottom: 1px solid rgba(197, 161, 104, 0.2);
}

.infobox-grid {
    padding: 0.85rem 0.95rem 1rem;
    display: grid;
    gap: 0.65rem;
}

.info-row {
    display: grid;
    gap: 0.18rem;
    border-bottom: 1px solid rgba(197, 161, 104, 0.14);
    padding-bottom: 0.5rem;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-value {
    color: var(--text-main);
    font-size: 0.97rem;
    line-height: 1.4;
}

.wiki-footer {
    margin-top: 1.4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .wiki-layout {
        grid-template-columns: 1fr;
    }

    .compact-grid {
        grid-template-columns: 1fr;
    }

    .toc-panel,
    .infobox {
        position: static;
    }
}

@media (max-width: 700px) {
    .wiki-shell {
        padding: 1.2rem 0.8rem 2rem;
    }

    .wiki-header {
        padding: 1.3rem;
    }

    .wiki-title {
        font-size: 1.65rem;
    }

    .content-panel {
        padding: 0.85rem;
    }

    .wiki-section {
        padding: 0.85rem;
    }

    .entry-card {
        grid-template-columns: 1fr;
    }

    .entry-image {
        max-height: 200px;
    }

    .ending-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .single-ending-cta {
        justify-content: flex-start;
    }

    .progress-reset {
        margin-left: 0;
    }
}
