/* ══════════════════════════════════════════════
   MPAO WIKI - SHARED STYLES
   ══════════════════════════════════════════════ */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #111119;
    --bg-card-hover: #1a1a28;
    --bg-nav: rgba(10, 10, 15, 0.92);
    --bg-hero: linear-gradient(160deg, #08080e 0%, #10101f 25%, #181828 50%, #10101f 75%, #08080e 100%);
    --gold: #c9a84c;
    --gold-light: #e8d48b;
    --gold-dark: #8a6f2f;
    --text-primary: #e8e6e1;
    --text-secondary: #9a9890;
    --text-muted: #6a6860;
    --border: #2a2a35;
    --border-gold: rgba(201, 168, 76, 0.25);
    --shadow-gold: rgba(201, 168, 76, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Crimson Text', Georgia, serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(24, 24, 40, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(15, 12, 8, 0.6) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a0f 0%, #0d0d16 20%, #0a0a0f 40%, #0c0c14 60%, #0a0a0f 80%, #08080c 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(201, 168, 76, 0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 15%, rgba(139, 111, 47, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(58, 79, 139, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 85%, rgba(201, 168, 76, 0.05) 0%, transparent 45%),
        radial-gradient(ellipse at 10% 90%, rgba(58, 79, 139, 0.04) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23c9a84c' stroke-opacity='0.025' stroke-width='0.5'%3E%3Cpath d='M40 0v80M0 40h80M40 0l40 40-40 40L0 40z'/%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3Ccircle cx='40' cy='40' r='35'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 25% 30%, rgba(201, 168, 76, 0.02) 0%, transparent 30%),
        radial-gradient(circle at 75% 70%, rgba(201, 168, 76, 0.02) 0%, transparent 30%),
        url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='a'%3E%3Cstop offset='0' stop-color='%23c9a84c' stop-opacity='.012'/%3E%3Cstop offset='1' stop-color='%23c9a84c' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='100' cy='100' r='80' fill='url(%23a)'/%3E%3Cg fill='none' stroke='%23c9a84c' stroke-opacity='.018'%3E%3Cpath d='M100 20v160M20 100h160'/%3E%3Cpath d='M100 20l55 80-55 80-55-80z'/%3E%3Ccircle cx='100' cy='100' r='60' stroke-dasharray='4 8'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

/* ═══ NAVBAR ═══ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    height: 60px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    border-bottom-color: var(--border-gold);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gold);
}

.nav-brand .shield {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3);
    position: relative;
    overflow: hidden;
}

.nav-brand .shield::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 2px;
}

.nav-brand-text {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--gold);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0; right: 0;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

.hamburger span {
    width: 24px; height: 2px;
    background: var(--gold);
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* ═══ HERO ═══ */
.hero {
    position: relative;
    padding: 160px 2rem 80px;
    text-align: center;
    background: var(--bg-hero);
    z-index: 1;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--bg-dark), transparent);
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.07;
    pointer-events: none;
}

.hero-glow-1 {
    top: -150px;
    left: 20%;
    background: radial-gradient(circle, #c9a84c, transparent);
}

.hero-glow-2 {
    bottom: -200px;
    right: 15%;
    background: radial-gradient(circle, #3a4f8b, transparent);
    opacity: 0.05;
}

.hero-decor {
    position: absolute;
    width: 80px; height: 80px;
    border-color: var(--gold-dark);
    opacity: 0.3;
}

.hero-decor.top-left { top: 100px; left: 40px; border-top: 2px solid; border-left: 2px solid; }
.hero-decor.top-right { top: 100px; right: 40px; border-top: 2px solid; border-right: 2px solid; }
.hero-decor.bottom-left { bottom: 40px; left: 40px; border-bottom: 2px solid; border-left: 2px solid; }
.hero-decor.bottom-right { bottom: 40px; right: 40px; border-bottom: 2px solid; border-right: 2px solid; }

.hero h1 {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 2px;
    animation: fadeInUp 0.8s ease-out;
}

.hero h1 span { color: var(--gold); }

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
    animation: fadeInUp 0.8s ease-out 0.15s both;
}

/* ═══ WIKI GRID (index) ═══ */
.wiki-section {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 2rem 100px;
}

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

.wiki-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    display: block;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out both;
}

.wiki-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.wiki-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--shadow-gold) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.wiki-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-gold);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px var(--shadow-gold);
}

.wiki-card:hover::before, .wiki-card:hover::after { opacity: 1; }

.wiki-card-icon {
    font-size: 1.8rem;
    margin-bottom: 14px;
    display: block;
    position: relative;
    z-index: 1;
}

.wiki-card h3 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--gold-light);
    position: relative;
    z-index: 1;
}

.wiki-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.wiki-card .card-arrow {
    position: absolute;
    bottom: 20px; right: 20px;
    color: var(--gold-dark);
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.35s ease;
    z-index: 1;
}

.wiki-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.wiki-card:nth-child(1) { animation-delay: 0.05s; }
.wiki-card:nth-child(2) { animation-delay: 0.1s; }
.wiki-card:nth-child(3) { animation-delay: 0.15s; }
.wiki-card:nth-child(4) { animation-delay: 0.2s; }
.wiki-card:nth-child(5) { animation-delay: 0.25s; }
.wiki-card:nth-child(6) { animation-delay: 0.3s; }
.wiki-card:nth-child(7) { animation-delay: 0.35s; }
.wiki-card:nth-child(8) { animation-delay: 0.4s; }
.wiki-card:nth-child(9) { animation-delay: 0.45s; }
.wiki-card:nth-child(10) { animation-delay: 0.5s; }
.wiki-card:nth-child(11) { animation-delay: 0.55s; }
.wiki-card:nth-child(12) { animation-delay: 0.6s; }
.wiki-card:nth-child(13) { animation-delay: 0.65s; }
.wiki-card:nth-child(14) { animation-delay: 0.7s; }

/* ═══ INNER PAGE CONTENT ═══ */
.page-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 2rem 100px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: fadeInUp 0.5s ease-out;
}

.breadcrumb a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.breadcrumb .sep { color: var(--text-muted); }

.breadcrumb .current { color: var(--gold-light); }

/* Content blocks */
.content-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 36px 32px;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out both;
}

.content-block:nth-child(2) { animation-delay: 0.1s; }
.content-block:nth-child(3) { animation-delay: 0.15s; }
.content-block:nth-child(4) { animation-delay: 0.2s; }
.content-block:nth-child(5) { animation-delay: 0.25s; }

.content-block h2 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--gold-light);
    margin-bottom: 16px;
    letter-spacing: 1px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.content-block h3 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gold);
    margin: 20px 0 10px;
}

.content-block p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 12px;
}

.content-block ul, .content-block ol {
    color: var(--text-secondary);
    margin: 12px 0 12px 24px;
    font-size: 1rem;
    line-height: 1.8;
}

.content-block li { margin-bottom: 6px; }

.content-block strong { color: var(--gold-light); }

.content-block a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: var(--gold-dark);
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.content-block a:hover {
    color: var(--gold-light);
    text-decoration-color: var(--gold);
}

/* Image placeholder */
.img-placeholder {
    width: 100%;
    min-height: 200px;
    background: var(--bg-dark);
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin: 20px 0;
    transition: border-color 0.3s ease;
}

.img-placeholder:hover { border-color: var(--gold-dark); }

/* Content images */
.content-block img {
    width: 100%;
    border-radius: 6px;
    margin: 16px 0;
    border: 1px solid var(--border);
}

/* Tables */
.content-block table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.content-block th {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--gold);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--gold-dark);
    background: rgba(201, 168, 76, 0.05);
}

.content-block td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.content-block tr:hover td { background: rgba(201, 168, 76, 0.03); }

/* Info box / tip */
.info-box {
    background: rgba(201, 168, 76, 0.06);
    border: 1px solid var(--border-gold);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.info-box strong { color: var(--gold); }

/* Warning box */
.warning-box {
    background: rgba(139, 58, 58, 0.08);
    border: 1px solid rgba(139, 58, 58, 0.3);
    border-left: 3px solid #8b3a3a;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.warning-box strong { color: #c96a6a; }

/* Nav between sections */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.page-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    flex: 1;
}

.page-nav a:hover {
    border-color: var(--border-gold);
    color: var(--gold);
    background: var(--bg-card-hover);
}

.page-nav a.next { justify-content: flex-end; text-align: right; }

.page-nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}

/* ═══ FOOTER ═══ */
footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.8);
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.footer-col a:hover { color: var(--gold); }

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.85rem;
}

.footer-bottom-links a:hover { color: var(--gold); }

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.social-link {
    width: 36px; height: 36px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--gold-dark);
    color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

::selection {
    background: rgba(201, 168, 76, 0.25);
    color: var(--gold-light);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 70px; left: 0; right: 0;
        background: var(--bg-nav);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .hero { padding: 140px 1.5rem 60px; }
    .hero-decor { display: none; }
    .wiki-section { padding: 40px 1.5rem 80px; }
    .wiki-grid { grid-template-columns: 1fr; gap: 14px; }
    .page-content { padding: 40px 1.5rem 80px; }
    .content-block { padding: 24px 20px; }
    .page-nav { flex-direction: column; }
    .footer-main { grid-template-columns: 1fr; gap: 30px; padding: 40px 1.5rem; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .wiki-grid { grid-template-columns: repeat(2, 1fr); }
}
