/* diplomacy.quest — Isometric Technical Cartography
   Palette: #1C1A16 #2A2620 #C9A84C #6B8F84 #4A6FA5 #A83232 #E8DFD0 #3A3830 #8B7355
*/

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #1C1A16;
    color: #E8DFD0;
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* Parchment Texture */
#parchment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Quest Sidebar */
#quest-sidebar {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 200px;
    z-index: 100;
    background: rgba(28, 26, 22, 0.9);
    border: 1px dashed rgba(139, 115, 85, 0.3);
    border-radius: 4px;
    padding: 20px 16px;
}

.sidebar-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: #C9A84C;
    margin-bottom: 16px;
}

.quest-list {
    list-style: none;
}

.quest-item {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #3A3830;
    padding: 6px 0;
    transition: color 0.3s ease;
}

.quest-item.active {
    color: #4A6FA5;
}

.quest-item.completed {
    color: #6B8F84;
}

.quest-icon {
    margin-right: 6px;
    font-size: 0.7rem;
}

/* Hero: Command Center */
#command-center {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.border-line {
    transition: stroke-dashoffset 1.5s ease;
}

.border-line.drawn {
    stroke-dashoffset: 0;
}

.compass-rose {
    position: absolute;
    top: 40px;
    right: 240px;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

.compass-rose.visible {
    opacity: 1;
}

.compass-needle {
    transform-origin: 50px 50px;
    transition: transform 1s ease;
}

.compass-needle.spin {
    transform: rotate(360deg);
}

.hero-cartouche {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 1s ease, transform 1s ease;
}

.hero-cartouche.visible {
    opacity: 1;
    transform: scale(1);
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.1em;
    color: #C9A84C;
}

.hero-subtitle {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    color: #6B8F84;
    margin-top: 12px;
    text-transform: uppercase;
}

/* Territory Grid */
#territory-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    padding-right: 240px;
}

.territory {
    position: relative;
    background: #2A2620;
    border: 1px dashed rgba(139, 115, 85, 0.3);
    padding: 28px 24px;
    overflow: hidden;
}

.territory:hover {
    border-style: solid;
    transition: border-style 0.3s ease;
}

.territory-wide {
    grid-column: span 4;
}

.territory-small {
    grid-column: span 2;
}

.territory-tall {
    grid-column: span 3;
    grid-row: span 2;
}

.territory-medium {
    grid-column: span 3;
}

.territory-full {
    grid-column: span 6;
}

/* Fog of War */
.fog-overlay {
    position: absolute;
    inset: 0;
    background: #3A3830;
    opacity: 0.7;
    z-index: 5;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.fog-covered.revealed .fog-overlay {
    opacity: 0;
}

.territory-label {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: #C9A84C;
    display: block;
    margin-bottom: 12px;
}

.territory-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: 0.08em;
    color: #C9A84C;
    margin-bottom: 16px;
}

.territory-body {
    color: #E8DFD0;
    margin-bottom: 12px;
}

.territory-danger {
    color: #A83232;
}

.territory-closing {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #6B8F84;
    margin-top: 24px;
    letter-spacing: 0.06em;
}

/* Pin Markers */
.pin-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #4A6FA5;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(74, 111, 165, 0.4);
    animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Responsive */
@media (max-width: 900px) {
    #quest-sidebar {
        display: none;
    }

    #territory-grid {
        padding-right: 24px;
        grid-template-columns: repeat(2, 1fr);
    }

    .territory-wide,
    .territory-tall,
    .territory-medium,
    .territory-full {
        grid-column: span 2;
    }

    .territory-small {
        grid-column: span 1;
    }

    .territory-tall {
        grid-row: span 1;
    }
}
