:root {
    --color-bg-top: #1a2f40; /* Dark blue from mountains */
    --color-bg-mid: #6892a0; /* Lighter blue */
    --color-bg-bottom: #94b967; /* Forest green base */

    --color-sunset-orange: #f26222;
    --color-sunset-yellow: #fdb714;
    --color-sunset-red: #da251d;
    --color-parchment: #f4ebd8;
    --color-parchment-border: #d4b88a;

    --color-text: #2c2c2c;
    --color-title: #fdb714; /* Golden */

    --font-title: 'Cinzel', serif;
    --font-body: 'Lora', serif;
}

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

body {
    font-family: var(--font-body);
    background-image: url('assets/quest_background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.hero {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

.logo {
    max-width: 250px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    margin-bottom: 1rem;
}

.welcome-title {
    font-family: var(--font-title);
    color: var(--color-title);
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

/* Adventure Map */
.adventure-map {
    position: relative;
    width: 100%;
    height: 1000px; /* Gives scroll room for the trail */
    margin: 0 auto;
    max-width: 600px; /* Keeps it mobile-focused but works on desktop */
}

/* The SVG Trail */
.trail-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.trail-path {
    fill: none;
    stroke: var(--color-sunset-yellow);
    stroke-width: 4;
    stroke-dasharray: 10 10;
    opacity: 0.8;
}

/* Waypoints */
.waypoints {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.waypoint {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.waypoint:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.icon-container {
    background: #fff;
    border: 4px solid var(--color-text);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.gold-marker {
    background: var(--color-sunset-yellow);
    border-color: #fff;
    color: #fff;
    font-weight: bold;
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-15px);}
    60% {transform: translateY(-7px);}
}

.waypoint-label {
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-text);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* Modals */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content.parchment {
    background-color: var(--color-parchment);
    border: 8px solid var(--color-parchment-border);
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1), 0 10px 30px rgba(0,0,0,0.5);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.05"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="%23000"/></svg>'); /* Slight noise */
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #885522;
}

.modal-content h2 {
    font-family: var(--font-title);
    text-align: center;
    margin-bottom: 1.5rem;
    color: #4a3b2c;
    border-bottom: 2px solid var(--color-parchment-border);
    padding-bottom: 0.5rem;
}

.modal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.video-container {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: #000;
}

.video-container video {
    width: 100%;
    display: block;
}

/* Loot Table Grid */
.loot-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.loot-item {
    background: rgba(255,255,255,0.6);
    border-left: 5px solid;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.loot-img {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin: 0.5rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.loot-item h3 {
    margin: 0.25rem 0;
    font-family: var(--font-title);
    font-size: 1.1rem;
}

.loot-item p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.loot-item small {
    display: block;
    font-style: italic;
    color: #666;
    font-size: 0.8rem;
}

.rarity {
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Rarity Colors */
.legendary { border-color: #ff8c00; }
.legendary .rarity { color: #ff8c00; }

.superior { border-color: #ffd700; }
.superior .rarity { color: #d4b800; }

.epic { border-color: #9932cc; }
.epic .rarity { color: #9932cc; }

.rare { border-color: #4169e1; }
.rare .rarity { color: #4169e1; }

.uncommon { border-color: #32cd32; }
.uncommon .rarity { color: #32cd32; }

.common { border-color: #a9a9a9; }
.common .rarity { color: #696969; }

/* Responsive adjustments */
@media (max-width: 400px) {
    .welcome-title {
        font-size: 2rem;
    }

    .waypoint-label {
        font-size: 0.8rem;
    }
}
