:root {
    --primary-gold: #FFD700;
    --secondary-gold: #C5A000;
    --deep-ocean: #001f3f;
    --ocean-blue: #0074D9;
    --parchment: #f4e4bc;
    --parchment-dark: #d6c69b;
    --wood-brown: #5d4037;
    --text-dark: #3e2723;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--deep-ocean);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 20%);
    color: var(--parchment);
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    /* Allow scrolling */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Prevent top cropping */
    padding: 2rem 0;
    /* Add whitespace */
    position: relative;
}

/* Ocean waves effect using background animation could go here, or simple gradient */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCIgb3BhY2l0eT0iMC4wNSI+CjxwYXRoIGQ9Ik0wIDI1IEMxMCAxNSAzMCAxNSAzMCAyNSBDMzAgMzUgNTAgMzUgNTAgMjUiIGZpbGw9Im5vbmUiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=');
    opacity: 0.1;
    animation: waveScroll 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes waveScroll {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 100px 50px;
    }
}

.content-wrapper {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 1000px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

header .title {
    font-family: 'Pirata One', cursive;
    font-size: 4rem;
    color: var(--primary-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    animation: floatTitle 3s ease-in-out infinite;
}

@keyframes floatTitle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

header .subtitle {
    font-family: 'Pirata One', cursive;
    font-size: 1.5rem;
    color: var(--parchment-dark);
    letter-spacing: 1px;
}

.map-container {
    position: relative;
    padding: 15px;
    background: var(--wood-brown);
    border-radius: 12px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    width: fit-content;
    /* Shrink to fit image width */
    max-width: 90vw;
    /* aspect-ratio removed to allow image to define height */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #3e2723;
    margin: 0 auto;
}

.map-frame {
    width: 100%;
    /* height: 100%; removed to allow auto height */
    background-color: var(--parchment);
    background-image: url("https://www.transparenttextures.com/patterns/aged-paper.png");
    border: 1px solid #d7ccc8;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 40px rgba(93, 64, 55, 0.4);
    padding: 10px;
    /* Add some padding so image isn't tight to border */
}

/* Class for injected map images */
.map-image {
    width: auto;
    max-width: 100%;
    max-height: 60vh;
    /* Constrain height so it fits on screen nicely */
    border-radius: 4px;
    border: 2px solid var(--wood-brown);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: block;
}

.map-placeholder {
    color: var(--wood-brown);
    font-family: 'Pirata One', cursive;
    font-size: 2rem;
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Decorative Corners for the container */
.decor {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-gold);
    transition: all 0.3s ease;
}

.corner-tl {
    top: -5px;
    left: -5px;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: -5px;
    right: -5px;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: -5px;
    left: -5px;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: -5px;
    right: -5px;
    border-left: none;
    border-top: none;
}

.map-container:hover .decor {
    width: 50px;
    height: 50px;
    box-shadow: 0 0 10px var(--primary-gold);
}

/* Random Compass Rose CSS Art */
.compass-rose {
    width: 60px;
    height: 60px;
    border: 2px solid var(--wood-brown);
    border-radius: 50%;
    position: relative;
    margin-top: 10px;
}

.compass-rose::after,
.compass-rose::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--wood-brown);
    transform: translate(-50%, -50%);
}

.compass-rose::after {
    width: 80%;
    height: 2px;
}

.compass-rose::before {
    width: 2px;
    height: 80%;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Animations */
@media (max-width: 600px) {
    header .title {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .map-container {
        width: 100%;
        padding: 10px;
    }

    .content-wrapper {
        padding: 1rem;
        gap: 1.5rem;
    }

    .map-placeholder {
        font-size: 1.2rem;
    }
}