.wiki-layout {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    gap: 30px;
    align-items: flex-start;
}

.wiki-anchors {
    position: sticky;
    top: 90px;
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px;
}

.wiki-anchors h3 {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 18px;
    letter-spacing: 1px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

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

.wiki-anchors li {
    margin-bottom: 8px;
}

.wiki-anchors a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.wiki-anchors a:hover {
    color: var(--primary);
}

.wiki-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.wiki-content h1 {
    font-family: var(--font-heading);
    font-size: 38px;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.wiki-lead {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.wiki-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color) 0%, rgba(0,255,136,0) 100%);
    margin-bottom: 35px;
}

.wiki-section {
    margin-bottom: 40px;
    scroll-margin-top: 100px;
}

.wiki-section h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.wiki-section h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: #fff;
    letter-spacing: 0.5px;
    margin: 20px 0 10px 0;
}

.wiki-section p {
    color: var(--text-main);
    font-size: 15px;
    margin-bottom: 15px;
}

.wiki-section ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.wiki-section ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 15px;
}

.wiki-section ul li::before {
    content: "■";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 10px;
    top: 2px;
}

.dev-story, .lore-block {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.story-intro {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.story-spoiler {
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.story-spoiler:hover {
    border-color: var(--border-color);
}

.story-spoiler summary {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}

.spoiler-content {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.spoiler-content strong {
    color: #fff;
}

.lore-alert {
    color: var(--danger);
    background: rgba(255, 51, 68, 0.08);
    border: 1px dashed var(--danger);
    padding: 12px;
    text-align: center;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 1.5px;
    margin: 15px 0;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 51, 68, 0.1);
}

.zombie-lore {
    border-left: 3px solid var(--primary);
    background: rgba(0, 255, 136, 0.03);
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 0 4px 4px 0;
}

.wiki-screenshot {
    display: block;
    margin: 20px auto 5px auto;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}

.screenshot-caption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}

.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.wiki-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 18px;
    transition: all 0.2s ease;
}

.wiki-card h3 {
    color: #fff;
    margin-top: 0;
    font-size: 16px;
}

.wiki-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.wiki-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 0 12px var(--primary-glow);
}

.mode-switcher {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.mode-switcher button {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 8px 18px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 15px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mode-switcher button:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

.category-header {
    font-family: var(--font-heading);
    font-size: 18px;
    color: #fff;
    margin: 30px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 5px;
}

.category-header span {
    color: var(--primary);
}

.weapon-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.weapon-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.weapon-item:hover {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: translateY(-2px);
}

.weapon-name {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
}

.weapon-tooltip {
    position: fixed;
    display: none;
    pointer-events: none;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 15px var(--primary-glow);
    z-index: 10000;
    width: 240px;
}

.tooltip-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-subtle);
}

.tooltip-title {
    font-family: var(--font-heading);
    font-size: 18px;
    color: #fff;
}

.tooltip-tier {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.tooltip-stats {
    font-size: 13px;
    color: var(--text-main);
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
}

.tooltip-stats .cost {
    display: block;
    margin-top: 4px;
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 850px) {
    .wiki-layout {
        flex-direction: column;
    }
    .wiki-anchors {
        width: 100%;
        position: static;
    }
}

details.story-spoiler {
    background: rgba(15, 23, 18, 0.6);
    border: 1px solid #10b981;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

details.story-spoiler summary {
    padding: 14px 20px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
}

details.story-spoiler summary::after {
    content: "📁";
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

details.story-spoiler summary:hover {
    color: #10b981;
}

details.story-spoiler[open] summary::after {
    content: "📂";
    transform: scale(1.1);
}

details.story-spoiler .spoiler-content {
    padding: 0 20px 20px 20px;
    animation: sweep 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes sweep {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.icon-tz, .icon-tzz {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url('../images/icons/tzpoint.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-right: 6px;
}

.tooltip-stats .cost {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #10b981;
    font-size: 1.1rem;
    margin-top: 8px;
}

.wiki-anchors a,
.wiki-anchors a:hover,
.wiki-anchors a:focus,
.wiki-anchors a:active {
    text-decoration: none !important;
}