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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.game-container {
    width: 100%;
    background-color: #f5f5f5;
    min-height: 100vh;
}

@media (min-width: 640px) {
    .game-board {
        margin: 0 auto;
        padding: 0 2rem;
    }
}

@media (min-width: 768px) {
    .game-board {
        padding: 0 4rem;
    }
}

/* Header Styles */
.game-header {
    background: #1e293b;
    color: white;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 32px;
    width: auto;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-nav a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: #60a5fa;
}

.level-badge {
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .header-left h1 {
        font-size: 24px;
    }
}

.journey-status {
    display: flex;
    align-items: center;
}

/* Game Info Section */
.game-info {
    background-color: #ecf0f1;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #bdc3c7;
    position: relative;
    z-index: 2;
}

.game-info h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #2c3e50;
}

.game-info p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

/* Progress Container */
.progress-container {
    max-width: 700px;
    margin: 20px auto;
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 100px; /* Adjusted to account for sticky header */
    z-index: 1000; /* Much higher to ensure it's above everything except modals */
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98);
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.current-level-label {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.current-level-label span {
    color: #2563eb;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xp-bar {
    width: 100%;
    height: 32px;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(to right, #35b46f, #2a8fb7);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    text-shadow: none;
}

.checkpoint-counter {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-align: left;
    line-height: 1.5;
    margin-top: 4px;
}

.checkpoint-counter strong {
    color: #1e293b;
    font-weight: 700;
}

.total-fill {
    background: linear-gradient(to right, #c49f65, #d4a574);
}

/* Game Board */
.game-board {
    position: relative;
    background-color: #9ad36a;
    height: 1200px;
    overflow: visible;
    max-width: 1400px;
    margin: 0 auto;
    z-index: 1;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Gopher Sprite */
.gopher-sprite {
    position: absolute;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.5s ease;
    z-index: 10;
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 20px;
    border-radius: 20px;
    border: 2px solid #1e293b;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: speechBounce 2s ease-in-out infinite;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #1e293b;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes speechBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.gopher-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gopher-sprite:hover {
    transform: scale(1.1);
}

.gopher-sprite.walking img {
    animation: gopherWalk 0.5s ease-in-out infinite;
}

@keyframes gopherWalk {
    0%, 100% { 
        transform: translateY(0) rotate(-2deg);
    }
    25% { 
        transform: translateY(-3px) rotate(2deg);
    }
    50% { 
        transform: translateY(0) rotate(-2deg);
    }
    75% { 
        transform: translateY(-3px) rotate(2deg);
    }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #1e293b;
}

.modal-content h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    color: #1e293b;
}

.modal-content p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #555;
    line-height: 1.6;
}

.modal-content ul {
    text-align: left;
    font-size: 16px;
    margin: 20px 0;
    list-style: none;
    line-height: 1.8;
}

.modal-content li {
    margin: 10px 0;
}

.modal-gopher, .levelup-gopher, .complete-gopher {
    width: 80px;
    height: 80px;
    margin: 20px auto;
}

/* Buttons */
.start-btn, .continue-btn, .share-btn, .copy-btn, .bytesizego-btn {
    background: linear-gradient(to right, #35b46f, #2a8fb7);
    color: white;
    border: 2px solid transparent;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.start-btn:hover, .continue-btn:hover, .share-btn:hover, .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.continue-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.bytesizego-btn {
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
}

/* Checkpoint Modal */
.checkpoint-content {
    max-width: 600px;
}

.checkpoint-links {
    margin: 30px 0;
    text-align: left;
}

.project-idea-section {
    margin: 25px 0 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.project-gopher {
    flex-shrink: 0;
}

.project-gopher-img {
    width: 60px;
    height: 60px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.project-speech-bubble {
    position: relative;
    flex: 1;
    background-color: #f0f9ff;
    border: 2px solid #2563eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.speech-bubble-tail {
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent #2563eb transparent transparent;
}

.speech-bubble-tail::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent #f0f9ff transparent transparent;
}

.project-idea-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.project-idea-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    margin: 0;
}

.checkpoint-link {
    display: block;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    margin: 10px 0;
    text-decoration: none;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.checkpoint-link:hover {
    background-color: #35b46f;
    color: white;
    border-color: #35b46f;
    transform: translateX(4px);
}

.checkpoint-link:focus {
    outline: 3px solid #2a8fb7;
    outline-offset: 2px;
}

.checkpoint-link.visited {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.checkpoint-link.visited::after {
    content: ' ✓';
    position: absolute;
    right: 16px;
    font-size: 20px;
}

/* Level Up Modal */
.levelup-content {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffeaa7 100%);
}

.levelup-animation h2 {
    font-size: 36px;
    font-weight: 700;
    color: #f59e0b;
    animation: pulse 1s infinite;
}

.levelup-gopher {
    animation: bounce 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

.checkpoint-unlocked {
    animation: microBounce 0.3s ease-out;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #27ae60;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.mobile-content {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    border: 4px solid #333;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 90%;
}

.mobile-content h2 {
    font-size: 32px;
    color: #27ae60;
    margin-bottom: 20px;
}

.mobile-content p {
    font-size: 24px;
    margin: 20px 0;
    color: #555;
}

.mobile-gopher {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.mobile-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.mobile-url {
    font-size: 20px;
    color: #666;
    margin-top: 20px;
}

/* Share Prompt */
.share-prompt {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.share-prompt p {
    font-size: 18px;
    margin-bottom: 0;
}

.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8E8 50%, #B0E0E6 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    overflow: hidden;
}

/* Animated clouds container */
.clouds-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Cloud styling */
.cloud {
    position: absolute;
    width: 200px;
    height: 60px;
}

.cloud path {
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Cloud positions and animations */
.cloud-1 {
    width: 200px;
    top: 10%;
    left: 10%;
    animation: drift-right 45s infinite linear;
}

.cloud-2 {
    width: 180px;
    top: 25%;
    left: 30%;
    animation: drift-right 35s infinite linear;
    animation-delay: 0s;
}

.cloud-3 {
    width: 250px;
    top: 5%;
    left: 50%;
    animation: drift-right 55s infinite linear;
    animation-delay: 0s;
}

.cloud-4 {
    width: 160px;
    top: 50%;
    left: 70%;
    animation: drift-right 40s infinite linear;
    animation-delay: 0s;
}

.cloud-5 {
    width: 220px;
    top: 65%;
    left: 20%;
    animation: drift-right 50s infinite linear;
    animation-delay: 0s;
}

.cloud-6 {
    width: 190px;
    top: 40%;
    left: 85%;
    animation: drift-right 38s infinite linear;
    animation-delay: 0s;
}

/* Smooth cloud drifting animation */
@keyframes drift-right {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(calc(100vw + 300px));
    }
}

/* Background layer clouds */
.cloud-bg {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    filter: blur(15px);
}

.cloud-bg-1 {
    width: 120px;
    height: 35px;
    top: 8%;
    left: 5%;
    animation: drift-right 70s infinite linear;
}

.cloud-bg-2 {
    width: 100px;
    height: 30px;
    top: 18%;
    left: 25%;
    animation: drift-right 65s infinite linear;
    animation-delay: 0s;
}

.cloud-bg-3 {
    width: 140px;
    height: 40px;
    top: 28%;
    left: 45%;
    animation: drift-right 75s infinite linear;
    animation-delay: 0s;
}

.cloud-bg-4 {
    width: 90px;
    height: 25px;
    top: 38%;
    left: 65%;
    animation: drift-right 60s infinite linear;
    animation-delay: 0s;
}

.cloud-bg-5 {
    width: 130px;
    height: 38px;
    top: 48%;
    left: 80%;
    animation: drift-right 68s infinite linear;
    animation-delay: 0s;
}

.cloud-bg-6 {
    width: 110px;
    height: 32px;
    top: 58%;
    left: -110px;
    animation: drift-right 72s infinite linear;
    animation-delay: 20s;
}

.cloud-bg-7 {
    width: 125px;
    height: 36px;
    top: 68%;
    left: -125px;
    animation: drift-right 66s infinite linear;
    animation-delay: 12s;
}

.cloud-bg-8 {
    width: 105px;
    height: 28px;
    top: 78%;
    left: -105px;
    animation: drift-right 70s infinite linear;
    animation-delay: 18s;
}

.cloud-bg-9 {
    width: 135px;
    height: 42px;
    top: 85%;
    left: -135px;
    animation: drift-right 64s infinite linear;
    animation-delay: 25s;
}

.cloud-bg-10 {
    width: 95px;
    height: 26px;
    top: 92%;
    left: -95px;
    animation: drift-right 62s infinite linear;
    animation-delay: 30s;
}

/* Additional cloud animations */
.cloud-7 {
    width: 190px;
    top: 12%;
    left: 40%;
    animation: drift-right 42s infinite linear;
    animation-delay: 0s;
}

.cloud-8 {
    width: 210px;
    top: 32%;
    left: 60%;
    animation: drift-right 48s infinite linear;
    animation-delay: 0s;
}

.cloud-9 {
    width: 240px;
    top: 55%;
    left: 15%;
    animation: drift-right 52s infinite linear;
    animation-delay: 0s;
}

.cloud-10 {
    width: 170px;
    top: 70%;
    left: 35%;
    animation: drift-right 44s infinite linear;
    animation-delay: 0s;
}

.cloud-11 {
    width: 200px;
    top: 20%;
    left: 75%;
    animation: drift-right 46s infinite linear;
    animation-delay: 0s;
}

.cloud-12 {
    width: 180px;
    top: 45%;
    left: 90%;
    animation: drift-right 43s infinite linear;
    animation-delay: 0s;
}

/* Foreground cloud animations */
.cloud-fg-1 {
    width: 160px;
    top: 75%;
    left: 55%;
    animation: drift-right 32s infinite linear;
    animation-delay: 0s;
}

.cloud-fg-2 {
    width: 140px;
    top: 35%;
    left: 25%;
    animation: drift-right 30s infinite linear;
    animation-delay: 0s;
}

.cloud-fg-3 {
    width: 190px;
    top: 15%;
    left: 95%;
    animation: drift-right 36s infinite linear;
    animation-delay: 0s;
}

.loading-content {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    border: 4px solid #333;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
}

.loading-gopher {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.loading-content h2 {
    font-size: 32px;
    color: #1e40af;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.loading-bar {
    width: 100%;
    height: 20px;
    background-color: #333;
    border: 2px solid #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(to right, #f39c12, #f1c40f);
    width: 0%;
    transition: width 0.3s ease;
}

#loading-text {
    font-size: 20px;
    color: #666;
}

/* Responsive Design - disabled for now */
/* @media (max-width: 768px) {
    .mobile-overlay {
        display: flex !important;
    }
} */

/* Mobile Warning Styles */
.mobile-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.mobile-warning-content {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-warning-content h2 {
    color: #1e293b;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.mobile-warning-content p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.warning-gopher {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

/* Music Controls */
.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.music-controls:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.music-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.music-toggle:hover {
    background: rgba(52, 152, 219, 0.1);
}

.music-toggle:active {
    transform: scale(0.95);
}

.volume-slider {
    width: 100px;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.volume-slider:hover {
    background: #ccc;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #3498db;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: #2980b9;
    transform: scale(1.2);
}

/* Mobile responsiveness for music controls */
@media (max-width: 768px) {
    .music-controls {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .music-toggle {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    .volume-slider {
        width: 80px;
    }
}