body {
    font-family: 'Comic Neue', cursive;
    background-color: #f0f8ff;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar-wrapper {
    background-color: #4CAF50;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    height: 60px;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo span {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.nav-links {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 10px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #45a049;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
}

.dropdown-content a {
    color: #4CAF50;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.dropdown:hover .dropdown-content {
    display: block;
}

#game-container {
    max-width: 1300px;
    width: 100%;
    margin: 80px auto 0;
    padding: 20px;
    box-sizing: border-box;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border: 8px solid #4CAF50;
}

h1 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 20px;
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

#image-selector {
    text-align: center;
    margin-bottom: 20px;
}

#image-previews {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.image-preview {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border: 4px solid #FFD700;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.image-preview:hover, .image-preview.selected {
    transform: scale(1.1);
    border-color: #4CAF50;
}

#completed-image-container {
    text-align: center;
    margin-bottom: 20px;
}

#completed-image {
    max-width: 300px;
    border: 5px solid #4CAF50;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

#puzzle-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

#puzzle-board, #piece-bank {
    width: 600px;
    height: 400px;
    border: 5px solid #4CAF50;
    border-radius: 15px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    background-color: #e0f0e0;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.grid-cell {
    background-color: white;
    border: 1px dashed #4CAF50;
    border-radius: 5px;
}

.puzzle-piece {
    width: 100%;
    height: 100%;
    border: 2px solid #FFD700;
    border-radius: 5px;
    cursor: move;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.puzzle-piece:hover {
    transform: scale(1.1);
    z-index: 10;
}

.puzzle-piece.correct {
    border: 3px solid #4CAF50;
    box-shadow: 0 0 15px #4CAF50;
}

#controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

button {
    font-size: 24px;
    padding: 15px 30px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-family: 'Comic Neue', cursive;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

#progress-box {
    text-align: center;
    font-size: 24px;
    margin-top: 20px;
    padding: 15px;
    background-color: #FFD700;
    border-radius: 15px;
    color: #4a4a4a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

@keyframes completionPulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#puzzle-board.completed {
    animation: completionPulse 2s infinite;
}

@media (max-width: 1340px) {
    .navbar, #game-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 1300px) {
    #puzzle-area {
        flex-direction: column;
        align-items: center;
    }

    #puzzle-board, #piece-bank {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-links li {
        margin: 5px 0;
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }

    #game-container {
        margin-top: 120px;
    }

    #puzzle-board, #piece-bank {
        width: 100%;
        height: auto;
        aspect-ratio: 3/2;
    }

    .puzzle-piece {
        width: 100%;
        height: 100%;
    }

    button {
        font-size: 18px;
        padding: 10px 20px;
    }
}