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

body {
    font-family: Arial, sans-serif;
    background-color: #242044;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background-color: rgba(0, 0, 0, 0.2);
    width: 100%;
    position: relative;
}

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

.site-logo {
    display: flex;
    align-items: center;
}

.small-logo {
    height: 40px;
    width: auto;
    margin-right: 20px;
}

/* Mobile menu button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1000;
}

.nav-menu {
    display: flex;
    gap: 30px;
    justify-content: flex-start;
    margin-right: auto;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #a5a5f3;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
}

.dropdown-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: rgba(36, 32, 68, 0.95);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
    z-index: 10;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 0;
    padding-top: 10px;
    transition: opacity 0.2s, visibility 0.2s;
    transition-delay: 0s;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: rgba(165, 165, 243, 0.2);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.dropdown-content:hover {
    visibility: visible;
    opacity: 1;
}

.dropbtn {
    cursor: pointer;
    display: inline-block;
    height: 100%;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
}

.dropdown:hover .dropbtn,
.dropdown:focus-within .dropbtn {
    color: #a5a5f3;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-bar {
        padding: 10px 15px;
        margin-bottom: 25px;
    }
    
    .left-section {
        width: 100%;
    }
    
    .social-links {
        position: absolute;
        bottom: -40px;
        right: 15px;
        z-index: 101;
        background-color: rgba(36, 32, 68, 0.6);
        padding: 8px 12px;
        border-radius: 5px;
    }
    
    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: rgba(36, 32, 68, 0.95);
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        gap: 0;
        margin: 0;
        z-index: 100;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    .nav-menu.active {
        max-height: 350px;
    }
    
    .nav-menu a, .dropbtn {
        padding: 15px;
        width: 100%;
        text-align: left;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .dropdown {
        width: 100%;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        visibility: visible;
        opacity: 1;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        padding-top: 0;
        width: 100%;
        margin-left: 20px;
    }
    
    .dropdown.active .dropdown-content {
        max-height: 200px;
    }
    
    .dropdown-content a {
        padding-left: 25px;
    }
}


.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    color: white;
    font-size: 18px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.2);
    color: #a5a5f3;
}

footer {
    margin-top: 40px;
    padding: 20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
}

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

.game-container {
    width: 800px;
    height: 600px;
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    max-width: 100%;
}

@media screen and (max-width: 840px) {
    .game-container {
        width: 100%;
        height: auto;
    }
    
    #game-area {
        height: 450px;
    }
}

@media screen and (max-width: 480px) {
    #game-area {
        height: 350px;
    }
}

.game-info {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 20px;
}

.image-credit {
    font-size: 12px;
    opacity: 0.7;
}

.level-indicator {
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.lives {
    color: #ff5555;
}

#game-area {
    width: 100%;
    height: 550px;
    background-color: #80c0e0;
    background-image: 
        linear-gradient(to bottom, rgba(101, 184, 231, 0.8) 0%, rgba(128, 192, 224, 0.8) 100%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M30,10 Q50,20 70,10 T95,20 T120,15" fill="none" stroke="rgba(255,255,255,0.3)" stroke-width="2"/><path d="M0,35 Q25,25 50,35 T100,30" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="2"/><path d="M0,55 Q30,65 60,55 T120,60" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="2"/><path d="M0,85 Q20,75 40,85 T80,80 T120,85" fill="none" stroke="rgba(255,255,255,0.3)" stroke-width="2"/></svg>');
    position: relative;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    animation: ocean-move 25s linear infinite;
}

@keyframes ocean-move {
    from { background-position: 0 0; }
    to { background-position: 100px 0; }
}

/* Bubbles */
.bubble {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.bubble::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    top: 20%;
    left: 20%;
}

.bubble-1 {
    width: 20px;
    height: 20px;
    left: 15%;
    animation: bubble-rise 15s infinite linear;
}

.bubble-2 {
    width: 15px;
    height: 15px;
    left: 30%;
    animation: bubble-rise 12s infinite linear 2s;
}

.bubble-3 {
    width: 25px;
    height: 25px;
    left: 50%;
    animation: bubble-rise 20s infinite linear 5s;
}

.bubble-4 {
    width: 10px;
    height: 10px;
    left: 65%;
    animation: bubble-rise 10s infinite linear 1s;
}

.bubble-5 {
    width: 18px;
    height: 18px;
    left: 75%;
    animation: bubble-rise 18s infinite linear 7s;
}

.bubble-6 {
    width: 12px;
    height: 12px;
    left: 85%;
    animation: bubble-rise 13s infinite linear 3s;
}

@keyframes bubble-rise {
    0% {
        bottom: -50px;
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
    75% {
        transform: translateX(-15px);
    }
    100% {
        bottom: 100%;
        transform: translateX(0);
    }
}

.axolotl {
    position: absolute;
    width: 60px;
    height: 60px;
    background-image: url('https://png.pngtree.com/png-clipart/20240325/original/pngtree-cartoon-axolotl-mascot-png-image_14679742.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.1s;
    /* Removed background-color for transparency */
    pointer-events: none; /* ensure clicks/taps don't interfere */
}

.axolotl.hit {
    transform: scale(1.2);
    opacity: 0.5;
}

.water-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 100% 100% 0 0 / 100% 100% 0 0;
    animation: wave 3s linear infinite;
    z-index: 1;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.water-waves::before {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 100% 100% 0 0 / 100% 100% 0 0;
    animation: wave 4s linear infinite;
    animation-delay: 0.5s;
}

.water-waves::after {
    content: '';
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100% 100% 0 0 / 100% 100% 0 0;
    animation: wave 3.5s linear infinite;
    animation-delay: 0.75s;
}

@keyframes wave {
    0% {
        transform: translateX(-50%) scaleY(1);
    }
    50% {
        transform: translateX(0%) scaleY(0.8);
    }
    100% {
        transform: translateX(50%) scaleY(1);
    }
}

.player {
    position: absolute;
    bottom: 0;
    left: calc(50% - 20px);
    width: 40px;
    height: 40px;
    background-color: #2a4158;
    border-radius: 10px 10px 0 0;
    z-index: 2;
    transition: left 0.05s linear; /* Smooth movement but very fast */
    box-shadow: 0 0 10px rgba(50, 80, 120, 0.5);
}

.player::before {
    content: '';
    position: absolute;
    left: 15px;
    top: -15px;
    width: 10px;
    height: 15px;
    background-color: #2a4158;
    border-radius: 5px 5px 0 0;
}

.player::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    width: 24px;
    height: 15px;
    background-color: #3e6a8a;
    border-radius: 4px;
}

.player.invulnerable {
    animation: invulnerable-pulse 0.5s infinite alternate;
}

@keyframes invulnerable-pulse {
    from { box-shadow: 0 0 0 rgba(255, 100, 100, 0.5); }
    to { box-shadow: 0 0 20px rgba(255, 100, 100, 0.8); }
}

/* Explosion effect */
.explosion {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ffdd00, #ff5500, #ff0000, transparent);
    border-radius: 50%;
    z-index: 10;
    animation: explode 0.5s ease-out forwards;
}

.explosion-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ff5500;
    border-radius: 50%;
    z-index: 10;
    animation: particle 0.8s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(0.1); opacity: 0; }
    25% { opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

@keyframes particle {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
}

.projectile {
    position: absolute;
    width: 10px;
    height: 20px;
    background-color: #ffff00;
    border-radius: 5px;
    z-index: 3;
    box-shadow: 0 0 15px 10px rgba(255, 255, 0, 0.7);
    animation: bullet-pulse 0.5s infinite alternate;
}

.projectile::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255, 255, 0, 0.7), rgba(255, 255, 0, 0));
    z-index: 2;
}

@keyframes bullet-pulse {
    from { box-shadow: 0 0 15px 10px rgba(255, 255, 0, 0.7); }
    to { box-shadow: 0 0 20px 15px rgba(255, 255, 0, 0.9); }
}

@keyframes gun-flash {
    0% { background-color: #2a4158; }
    50% { background-color: #5fbdff; }
    100% { background-color: #2a4158; }
}

.gun-flash {
    animation: gun-flash 0.15s linear;
}

.muzzle-flash {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(255,255,0,1) 0%, rgba(255,255,0,0.8) 30%, rgba(255,255,0,0) 70%);
    border-radius: 50%;
    z-index: 3;
    animation: muzzle-flash 0.3s ease-out;
    pointer-events: none;
}

@keyframes muzzle-flash {
    0% { transform: scale(0.2); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.level-up-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffff00;
    font-size: 48px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.7);
    z-index: 10;
    animation: level-up 2s ease-out;
}

@keyframes level-up {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.time-bonus-msg {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ffff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    z-index: 10;
    animation: time-bonus 2s ease-out;
}

@keyframes time-bonus {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    text-align: center;
}

.game-over h2 {
    color: #ff3333;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

.game-over p {
    font-size: 24px;
    margin: 10px 0;
}

#restart-btn, .start-game-btn {
    margin-top: 30px;
    padding: 10px 20px;
    background-color: #5fbdff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

#restart-btn:hover, .start-game-btn:hover {
    background-color: #3a9bd9;
    transform: scale(1.05);
}

/* Instructions Overlay */
.instructions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.instructions-content {
    max-width: 90%;
    padding: 20px;
    border-radius: 10px;
    background-color: rgba(36, 32, 68, 0.9);
    box-shadow: 0 0 20px rgba(95, 189, 255, 0.5);
    text-align: center;
}

.instructions-content h2 {
    color: #5fbdff;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(95, 189, 255, 0.7);
}

.instructions-content h3 {
    color: #ffcc00;
    margin: 10px 0;
}

.instructions-sections {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 20px 0;
    gap: 20px;
}

.instructions-desktop, .instructions-mobile {
    flex: 1;
    min-width: 250px;
}

.instructions-content ul {
    list-style-type: none;
    padding: 0;
    text-align: left;
    display: inline-block;
}

.instructions-content li {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.key-icon {
    display: inline-block;
    padding: 5px 10px;
    margin-right: 10px;
    background-color: #444;
    border-radius: 5px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-family: monospace;
}

/* Hide appropriate instructions based on device */
@media screen and (max-width: 768px) {
    .instructions-desktop {
        display: none;
    }
}

@media screen and (min-width: 769px) {
    .instructions-mobile {
        display: none;
    }
}

/* Touch Controls */
.touch-controls {
    display: none; /* Hidden by default, shown for mobile */
    width: 100%;
    height: 80px;
    position: relative;
    margin-top: 10px;
}

.touch-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.touch-button:active, 
.touch-button.active {
    background-color: rgba(95, 189, 255, 0.6);
    transform: scale(1.1);
}

.touch-left {
    left: 10%;
}

.touch-shoot {
    left: 50%;
    transform: translateX(-50%);
}

.touch-right {
    right: 10%;
}

@media screen and (max-width: 768px) {
    .touch-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}