:root {
    --primary-color: #1a1a3a;  /* Deep blue night */
    --secondary-color: #0d1b2a; /* Darker blue */
    --accent-color: #45ffbc;   /* Bright aurora green */
    --text-color: #ffffff;     /* Snow white */
    --border-color: #2d4b7d;   /* Muted blue */
    --highlight-color: #ff9ecd; /* Pink mountain glow */
    --shadow-color: #0a0a20;   /* Dark blue shadow */
    --success-color: #48BB78;      /* Forest green */
    --danger-color: #E53E3E;       /* Danger red */
    --snow-color: #F7FAFC;         /* Light snow color */
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Add stars background to body */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image: 
        radial-gradient(1px 1px at 25% 25%, rgba(255, 255, 255, 0.95) 1px, transparent 0),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.95) 1px, transparent 0),
        radial-gradient(2px 2px at 75% 75%, rgba(255, 255, 255, 0.95) 1px, transparent 0),
        radial-gradient(2px 2px at 25% 75%, rgba(255, 255, 255, 0.95) 1px, transparent 0);
    background-size: 250px 250px;
    animation: twinkle 4s ease-in-out infinite alternate;
    opacity: 0.3;
}

body::after {
    background-image: 
        radial-gradient(1px 1px at 10% 10%, rgba(255, 255, 255, 0.95) 1px, transparent 0),
        radial-gradient(1px 1px at 65% 35%, rgba(255, 255, 255, 0.95) 1px, transparent 0),
        radial-gradient(2px 2px at 35% 90%, rgba(255, 255, 255, 0.95) 1px, transparent 0),
        radial-gradient(3px 3px at 85% 15%, rgba(255, 255, 255, 0.95) 1px, transparent 0);
    background-size: 200px 200px;
    animation: twinkle 5s ease-in-out infinite alternate-reverse;
    opacity: 0.2;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(44, 82, 130, 0.85);  /* More transparent secondary color */
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
}

.title-banner {
    position: relative;
    padding: 2em;
    margin-bottom: 1em;
    overflow: hidden;
    border-radius: 10px;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 200px;
}

.title-content {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.title-image {
    position: relative;
    z-index: 1;
    width: 200px;
    height: 200px;
    background-image: url('denali.png');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(69, 255, 188, 0.3);
}

/* First streak - left to right */
.title-banner::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 200%;
    top: -50%;
    transform: skewX(-45deg);
    animation: streak1 20s ease-in-out infinite;
    background: linear-gradient(
        to right,
        transparent,
        rgba(69, 255, 188, 0.3),  /* Aurora green */
        rgba(255, 255, 255, 0.5),
        rgba(69, 255, 188, 0.3),  /* Aurora green */
        transparent
    );
}

/* Second streak - right to left */
.title-banner::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 200%;
    top: -50%;
    transform: skewX(-45deg);
    animation: streak2 27s ease-in-out infinite;
    background: linear-gradient(
        to right,
        transparent,
        rgba(69, 255, 188, 0.3),  /* Aurora green */
        rgba(255, 255, 255, 0.5),
        rgba(69, 255, 188, 0.3),  /* Aurora green */
        transparent
    );
}

/* Third streak - left to right */
.northern-lights::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 200%;
    top: -50%;
    transform: skewX(-45deg);
    animation: streak3 23s ease-in-out infinite;
    background: linear-gradient(
        to right,
        transparent,
        rgba(69, 255, 188, 0.3),  /* Aurora green */
        rgba(255, 255, 255, 0.5),
        rgba(69, 255, 188, 0.3),  /* Aurora green */
        transparent
    );
}

@keyframes streak1 {
    0% {
        left: -150%;
        opacity: 0;
    }
    20% {
        left: -50%;
        opacity: 0.8;
    }
    35% {
        left: 50%;
        opacity: 0.8;
    }
    45% {
        left: 150%;
        opacity: 0;
    }
    100% {
        left: 150%;
        opacity: 0;
    }
}

@keyframes streak2 {
    0% {
        left: 150%;
        opacity: 0;
    }
    30% {
        left: 50%;
        opacity: 0.9;
    }
    45% {
        left: -50%;
        opacity: 0.9;
    }
    55% {
        left: -150%;
        opacity: 0;
    }
    100% {
        left: -150%;
        opacity: 0;
    }
}

@keyframes streak3 {
    0% {
        left: -150%;
        opacity: 0;
    }
    40% {
        left: 0%;
        opacity: 0.85;
    }
    60% {
        left: 100%;
        opacity: 0.85;
    }
    75% {
        left: 150%;
        opacity: 0;
    }
    100% {
        left: 150%;
        opacity: 0;
    }
}

.northern-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}

.title-content h1 {
    font-size: 3.5em;
    margin: 0;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(69, 255, 188, 0.5),
                 0 0 20px rgba(69, 255, 188, 0.3),
                 0 0 30px rgba(69, 255, 188, 0.2);
    font-family: "Arial Black", "Arial Bold", "Helvetica Bold", sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 900;
}

.title-content .subtitle {
    color: var(--accent-color);
    font-size: 1.2em;
    margin-top: 0.5em;
    text-shadow: 0 0 10px rgba(69, 255, 188, 0.3);
}

.rules-banner {
    background-color: rgba(27, 54, 93, 0.85);
    backdrop-filter: blur(5px);
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
    line-height: 1.3;
}

.rules-banner span {
    color: var(--accent-color);
    font-weight: bold;
}

.resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.resource {
    background-color: rgba(27, 54, 93, 0.85);  /* More transparent primary color */
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--accent-color);
    backdrop-filter: blur(5px);
}

.trail-progress {
    margin: 20px 0;
    text-align: center;
    background-color: rgba(27, 54, 93, 0.85);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    backdrop-filter: blur(5px);
}

.checkpoint-markers {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    position: relative;
    padding: 10px 0;
    align-items: flex-end;  /* Align all checkpoints to the bottom */
}

.checkpoint-markers::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--border-color);
    z-index: 1;
}

.checkpoint {
    background: var(--primary-color);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    font-size: 0.7em;
    box-shadow: 0 0 10px rgba(69, 255, 188, 0.2);
    transition: transform 0.3s ease;
}

/* Special positioning for Denali checkpoint */
.checkpoint-markers .checkpoint:nth-child(3) {
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    width: 100px;  /* Increased from 80px */
    height: 100px;  /* Increased from 80px */
    background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(-30px);  /* Adjusted for larger size */
    z-index: 2;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 0.9em;  /* Slightly larger font */
}

.checkpoint-markers .checkpoint:nth-child(3).active {
    transform: translateY(-30px) scale(1.2);  /* Keep the same vertical position when active */
    background: linear-gradient(135deg, #5a5a5a, #3a3a3a);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Add snow effect to Denali */
.checkpoint-markers .checkpoint:nth-child(3)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.2) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    pointer-events: none;
}

/* Add additional snow cap effect */
.checkpoint-markers .checkpoint:nth-child(3)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    clip-path: polygon(50% 0%, 80% 40%, 20% 40%);
    pointer-events: none;
}

.checkpoint.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.action-button {
    background: linear-gradient(135deg, var(--primary-color), var(--border-color));
    border: 2px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85em;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-width: 0;
}

.action-button i {
    font-size: 1em;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.action-button span:not(.cost) {
    color: var(--text-color);
    margin-bottom: 2px;
    width: 100%;
    text-align: center;
}

.action-button .cost {
    color: var(--accent-color);
    font-size: 0.8em;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.button-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
}

.main-text {
    font-weight: bold;
}

.cost-text {
    font-size: 0.9em;
    color: var(--accent-color);
}

.bonus-text {
    font-size: 0.75em;
    color: var(--accent-color);
}

.action-button:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    transform: translateY(-2px);
}

.action-button:disabled {
    background-color: var(--border-color);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.action-button.special-item {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 2px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.action-button.special-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.2),
        transparent
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.action-button.special-item .bonus-text {
    color: #FFD700;
    font-weight: bold;
}

.task-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.task-detail {
    color: var(--accent-color);
}

.task-card .actions {
    display: flex;
    justify-content: center;
    margin: 15px 0 0 0;
}

.task-card .action-button {
    min-width: 200px;  /* Give the button a minimum width */
    padding: 10px 20px;
}

.game-log {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.game-log p {
    margin: 5px 0;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
}

/* Game Over Modal */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    color: var(--text-color);
    box-shadow: 0 0 20px var(--accent-color);
}

.modal-content h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.restart-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 1rem;
    width: 100%;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1.5rem;
}

.restart-button:hover {
    opacity: 0.9;
}

/* Simple Icons */
i {
    margin-right: 5px;
}

/* Scrollbar - only for WebKit browsers, won't affect others */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

/* Headers */
h2, h3 {
    margin-bottom: 5px;
}

h2 { font-size: 1.2em; }
h3 { font-size: 1.1em; }

/* Mobile-friendly styles */
@media screen and (max-width: 768px) {
    .actions {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: 300px;
        margin: 20px auto;
    }

    .action-button {
        padding: 8px 12px;
        font-size: 0.85em;
        min-height: 36px;
    }

    .action-button i {
        margin-bottom: 4px;
    }

    .action-button span:not(.cost) {
        font-size: 0.9em;
        margin-bottom: 2px;
    }

    .action-button .cost {
        font-size: 0.8em;
    }

    /* Adjust container padding for mobile */
    .game-container {
        padding: 12px;
    }

    /* Make resource grid single column on mobile */
    .resources {
        grid-template-columns: 1fr;
    }

    /* Mobile checkpoint adjustments */
    .checkpoint {
        width: 38px;
        height: 38px;
        padding: 4px;
        font-size: 0.6em;
    }

    .checkpoint-markers {
        margin: 15px 0;
        padding: 5px 0;
    }

    .checkpoint.active {
        transform: scale(1.1);
    }

    .checkpoint-markers .checkpoint:nth-child(3) {
        width: 80px;  /* Increased from 60px */
        height: 80px;  /* Increased from 60px */
        transform: translateY(-20px);  /* Adjusted for larger size */
    }

    .checkpoint-markers .checkpoint:nth-child(3).active {
        transform: translateY(-20px) scale(1.1);  /* Keep the same vertical position when active on mobile */
    }

    .title-banner {
        flex-direction: column;
        padding: 1em;
        gap: 1rem;
    }

    .title-image {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .title-content h1 {
        font-size: 2.5em;
    }
}

.task-note {
    font-size: 0.7em;
    opacity: 0.7;
    font-weight: normal;
}

.win-message {
    border-color: var(--accent-color) !important;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.win-message h3 {
    color: var(--accent-color);
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(229, 185, 78, 0.5);
}

#dailyBest {
    color: var(--accent-color);
    font-weight: bold;
    text-shadow: 0 0 5px rgba(229, 185, 78, 0.5);
}

.leaderboard-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.leaderboard-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.leaderboard-button i {
    color: var(--primary-color);
    margin-right: 4px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content.leaderboard {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 3px solid var(--accent-color);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
}

.modal-content.leaderboard h3 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(229, 185, 78, 0.5);
}

.modal-content.leaderboard .close-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    font-weight: bold;
}

#leaderboardContent {
    color: var(--text-color);
}

#leaderboardContent div {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#leaderboardContent div:last-child {
    border-bottom: none;
}

#leaderboardContent .rank {
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 10px;
}

#leaderboardContent .score {
    color: var(--accent-color);
}

.score-entry {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    font-size: 1.1em;
}

.score-entry .rank {
    width: 30px;
    font-weight: bold;
    color: #ffd700;
}

.score-entry .medal {
    width: 30px;
    font-size: 1.2em;
}

.score-entry .score-text {
    flex-grow: 1;
    text-align: left;
    margin-left: 10px;
    color: #fff;
}

/* Update leaderboard modal styles */
.modal-content.leaderboard {
    max-width: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ffd700;
    padding: 20px;
}

.modal-content.leaderboard h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Add hover effect for score entries */
.score-entry:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Style for empty leaderboard message */
#leaderboardContent > div:only-child {
    text-align: center;
    padding: 20px;
    color: #fff;
    font-style: italic;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(1px 1px at 50% 50%, white, rgba(0,0,0,0)),
                radial-gradient(1px 1px at 40% 60%, white, rgba(0,0,0,0)),
                radial-gradient(1.5px 1.5px at 60% 40%, white, rgba(0,0,0,0));
    background-size: 200px 200px;
    opacity: 0.3;
} 