@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Lora:wght@400;500;600;700&display=swap');

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

:root {
    --burgundy-deep: #4A1942;
    --burgundy: #7B2869;
    --rose: #C85C8E;
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --ivory: #FAF5E4;
    --shadow: #2D1B30;
}

body {
    font-family: 'Lora', serif;
    background: linear-gradient(135deg, var(--shadow) 0%, var(--burgundy-deep) 50%, var(--shadow) 100%);
    color: var(--ivory);
    line-height: 1.8;
    min-height: 100vh;
}

.masthead {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(74, 25, 66, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--gold);
}

.masthead-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.realm-name {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.9rem;
    color: var(--gold);
    text-decoration: none;
}

.realm-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.realm-nav a {
    color: var(--ivory);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

.scroll-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.scroll-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--gold);
    margin: 5px 0;
}

.scroll-content {
    padding-top: 85px;
}

.throne-room {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 4rem 2rem;
    background: radial-gradient(ellipse at center, rgba(200, 92, 142, 0.1) 0%, transparent 60%);
}

.throne-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.throne-message h1 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 3.5rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.throne-message .decree {
    font-size: 1.2rem;
    color: rgba(250, 245, 228, 0.9);
    margin-bottom: 2rem;
    line-height: 2;
}

.quest-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--burgundy-deep);
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 700;
    border-radius: 4px;
    transition: all 0.3s;
}

.quest-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.throne-portal {
    background: rgba(123, 40, 105, 0.4);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 1.5rem;
}

.portal-frame {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 8px;
    background: #000;
}

.herald-bar {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 2rem;
    background: rgba(123, 40, 105, 0.5);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    flex-wrap: wrap;
}

.herald-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.herald-item .sigil {
    font-size: 1.5rem;
}

.legends-section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.legends-section h2 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 2.2rem;
    text-align: center;
    color: var(--gold);
    margin-bottom: 3rem;
}

.legend-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.legend-card {
    background: linear-gradient(145deg, rgba(123, 40, 105, 0.5) 0%, rgba(74, 25, 66, 0.8) 100%);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s;
}

.legend-card:hover {
    border-color: var(--gold);
    transform: translateY(-6px);
}

.legend-card h3 {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--gold-light);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.legend-card p {
    color: rgba(250, 245, 228, 0.85);
}

.lore-section {
    padding: 5rem 2rem;
    background: linear-gradient(180deg, rgba(45, 27, 48, 0.5) 0%, transparent 100%);
}

.lore-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.lore-scroll {
    background: rgba(74, 25, 66, 0.6);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid var(--gold);
}

.lore-scroll h3 {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--rose);
    margin-bottom: 1rem;
}

.lore-scroll p {
    color: rgba(250, 245, 228, 0.9);
}

.castle-footer {
    background: #1A0F1B;
    padding: 3rem 2rem;
    border-top: 2px solid var(--burgundy);
}

.castle-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.castle-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.castle-links a {
    color: var(--rose);
    text-decoration: none;
    font-size: 0.9rem;
}

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

.aid-section {
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.aid-section p {
    color: rgba(250, 245, 228, 0.5);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.aid-section a {
    color: var(--gold);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 0.85rem;
}

.seal-text {
    margin-top: 2rem;
    color: rgba(250, 245, 228, 0.3);
    font-size: 0.8rem;
}

.gate-guard {
    position: fixed;
    inset: 0;
    background: rgba(26, 15, 27, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.gate-guard.unlocked {
    display: none;
}

.gate-challenge {
    background: linear-gradient(145deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 3rem;
    max-width: 480px;
    text-align: center;
    margin: 1rem;
}

.gate-challenge h2 {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.gate-challenge p {
    color: rgba(250, 245, 228, 0.9);
    margin-bottom: 2rem;
}

.gate-answers {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.gate-answer {
    padding: 1rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
}

.gate-answer.enter {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--burgundy-deep);
}

.gate-answer.turn-back {
    background: transparent;
    border: 2px solid var(--ivory);
    color: var(--ivory);
}

.gate-answer:hover {
    transform: scale(1.05);
}

.chapter-header {
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
    padding: 7rem 2rem 4rem;
    text-align: center;
    border-bottom: 2px solid var(--gold);
}

.chapter-header h1 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 2.8rem;
    color: var(--gold);
}

.tome-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.tome-page {
    background: rgba(123, 40, 105, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
}

.tome-page h2 {
    font-family: 'Cinzel Decorative', cursive;
    color: var(--gold-light);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.tome-page p {
    color: rgba(250, 245, 228, 0.9);
    margin-bottom: 1rem;
}

.tome-page ul {
    color: rgba(250, 245, 228, 0.85);
    margin-left: 1.5rem;
}

.tome-page li {
    margin-bottom: 0.5rem;
}

.arena-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.arena-frame-wrap {
    background: rgba(123, 40, 105, 0.4);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 1.5rem;
}

.arena-frame {
    width: 100%;
    height: 580px;
    border: none;
    border-radius: 8px;
    background: #000;
}

@media (max-width: 1024px) {
    .throne-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .throne-portal {
        order: -1;
    }
}

@media (max-width: 768px) {
    .scroll-btn {
        display: block;
    }

    .realm-nav {
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        background: rgba(74, 25, 66, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .realm-nav.revealed {
        transform: translateX(0);
    }

    .throne-message h1 {
        font-size: 2.4rem;
    }

    .portal-frame {
        height: 350px;
    }

    .herald-bar {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }

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

    .gate-answers {
        flex-direction: column;
    }

    .arena-frame {
        height: 380px;
    }
}
