:root {
    --primary-color: #2C3E50;
    --secondary-color: #34495E;
    --accent-color: #D35400;
    --text-color: #ECF0F1;
    --map-overlay-color: rgba(0, 0, 0, 0.6);
    --dark-bg: #1a1a1a;
    --text-color: #d4af37;
    --accent-color: #8b0000;
    --scroll-bg: #2b1810;
}

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

body {
    font-family: 'IM Fell English', serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.site-header {
    background-color: #8B4513;
    color: #FFF8DC;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header h1 {
    font-family: 'Pirata One', cursive;
    font-size: 2.5rem;
}

.site-header nav a {
    color: #FFF8DC;
    text-decoration: none;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.site-header nav a:hover {
    color: #D35400;
}

.hero-section {
    background: url('assets/treasure-island-map.svg') no-repeat center center;
    background-size: cover;
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    background-color: #D35400;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #A04000;
}

.story-section, .characters-section, .map-section {
    padding: 3rem 2rem;
}

.story-chapter {
    margin-bottom: 2rem;
    border-left: 4px solid #D35400;
    padding-left: 1rem;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.character-card {
    text-align: center;
    background-color: #F4E1D2;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.character-card img {
    max-width: 200px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.map-section {
    background-color: #F4E1D2;
}

.map-container {
    position: relative;
}

.map-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 1rem;
    text-align: center;
}

footer {
    background-color: #8B4513;
    color: #FFF8DC;
    text-align: center;
    padding: 1.5rem;
}

.social-links {
    margin-top: 1rem;
}

.social-icon {
    color: #FFF8DC;
    text-decoration: none;
    margin: 0 0.5rem;
}

/* Fog Animation */
.fog-container {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.fog, .fog-2 {
    position: absolute;
    width: 200%;
    height: 100vh;
    background: url('assets/fog.png') repeat-x;
    background-size: contain;
    opacity: 0.5;
    animation: fog 60s linear infinite;
}

.fog-2 {
    opacity: 0.3;
    animation: fog 40s linear infinite reverse;
}

@keyframes fog {
    from { transform: translateX(-50%); }
    to { transform: translateX(0%); }
}

/* Header Styles */
.main-header {
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.main-header h1 {
    font-family: 'Pirata One', cursive;
    font-size: 4rem;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    margin-bottom: 1rem;
}

nav {
    margin-top: 1rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(139, 0, 0, 0.8);
}

/* Section Styles */
section {
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

.scroll {
    background-color: var(--scroll-bg);
    border: 2px solid var(--text-color);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    position: relative;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.scroll::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.scroll::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 20%, rgba(212, 175, 55, 0.1) 40%, transparent 60%);
    pointer-events: none;
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

h2 {
    font-family: 'Pirata One', cursive;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-color);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.scroll:hover h2::after {
    transform: scaleX(1);
    transform-origin: left;
}

.story-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #e6d5a7;
}

.story-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-play-state: paused;
}

.story-content p.visible {
    animation-play-state: running;
}

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

.scroll-content {
    background-color: rgba(43, 24, 16, 0.9);
    padding: 2rem;
    border: 2px solid var(--text-color);
    max-width: 600px;
    animation: glow 4s ease-in-out infinite;
}

@keyframes glow {
    0% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.4); }
    100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.2); }
}

/* Intro Section */
.intro-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: url('assets/ship.svg') no-repeat center center;
    background-size: contain;
    position: relative;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}

footer p {
    color: var(--text-color);
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 3rem;
    }

    .scroll {
        margin: 1rem;
        padding: 1.5rem;
    }

    .story-content {
        font-size: 1rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* Lightning Flash Effect */
.lightning-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    animation: flash 1s ease-out;
}

@keyframes flash {
    0% { opacity: 0; }
    10% { opacity: 0.3; }
    20% { opacity: 0; }
    30% { opacity: 0.3; }
    40% { opacity: 0; }
    100% { opacity: 0; }
}
