/* ==================== UNDERWATER THEME EFFECTS ==================== */

/* Seaweed Animation at Bottom */
.seaweed-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 998;
    pointer-events: none;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
}

.seaweed {
    width: 40px;
    height: 150px;
    background: linear-gradient(to top, #1a4d5e 0%, transparent 100%);
    border-radius: 50% 50% 0 0;
    opacity: 0.4;
    transform-origin: bottom center;
}

.seaweed:nth-child(1) {
    animation: seaweed-sway 4s ease-in-out infinite;
}

.seaweed:nth-child(2) {
    animation: seaweed-sway 5s ease-in-out infinite 0.5s;
    height: 180px;
}

.seaweed:nth-child(3) {
    animation: seaweed-sway 3.5s ease-in-out infinite 1s;
    height: 120px;
}

.seaweed:nth-child(4) {
    animation: seaweed-sway 4.5s ease-in-out infinite 1.5s;
    height: 160px;
}

.seaweed:nth-child(5) {
    animation: seaweed-sway 5.5s ease-in-out infinite 2s;
    height: 140px;
}

@keyframes seaweed-sway {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

/* Bubble Particles */
.bubble {
    position: fixed;
    bottom: -100px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(95, 188, 211, 0.3));
    border-radius: 50%;
    opacity: 0.5;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.4), 0 0 15px rgba(212, 184, 106, 0.2);
    animation: rise 10s infinite ease-in;
    pointer-events: none;
}

.bubble:nth-child(1) {
    left: 10%;
    width: 15px;
    height: 15px;
    animation-duration: 8s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    left: 25%;
    width: 25px;
    height: 25px;
    animation-duration: 12s;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    left: 40%;
    width: 18px;
    height: 18px;
    animation-duration: 9s;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    left: 60%;
    width: 22px;
    height: 22px;
    animation-duration: 11s;
    animation-delay: 1s;
}

.bubble:nth-child(5) {
    left: 75%;
    width: 16px;
    height: 16px;
    animation-duration: 10s;
    animation-delay: 3s;
}

.bubble:nth-child(6) {
    left: 90%;
    width: 20px;
    height: 20px;
    animation-duration: 13s;
    animation-delay: 5s;
}

@keyframes rise {
    0% {
        bottom: -100px;
        opacity: 0;
        transform: translateX(0);
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        bottom: 110vh;
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Floating Jellyfish */
.jellyfish {
    position: fixed;
    font-size: 60px;
    opacity: 0.3;
    animation: jellyfish-float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 997;
}

.jellyfish:nth-child(1) {
    top: 20%;
    right: -100px;
    animation-delay: 0s;
}

.jellyfish:nth-child(2) {
    top: 60%;
    left: -100px;
    animation-delay: 5s;
    animation-direction: reverse;
}

@keyframes jellyfish-float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-50px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-100px, -10px) rotate(-5deg);
    }
    75% {
        transform: translate(-50px, 20px) rotate(3deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Light Rays from Surface */
.light-rays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: 
        linear-gradient(to bottom, transparent 0%, rgba(95, 188, 211, 0.015) 20%, transparent 40%),
        linear-gradient(to bottom, transparent 10%, rgba(212, 184, 106, 0.015) 30%, transparent 50%),
        linear-gradient(to bottom, transparent 20%, rgba(95, 188, 211, 0.015) 40%, transparent 60%);
    animation: rays 10s ease-in-out infinite;
}

@keyframes rays {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Coral Decoration on Sides */
.coral-left, .coral-right {
    position: fixed;
    bottom: 0;
    width: 150px;
    height: 300px;
    opacity: 0.25;
    pointer-events: none;
    z-index: 998;
}

.coral-left {
    left: 0;
    background: linear-gradient(to right, #d89b3d 0%, transparent 100%);
    clip-path: polygon(0 100%, 30% 60%, 10% 50%, 40% 30%, 20% 20%, 50% 0%, 0 0);
}

.coral-right {
    right: 0;
    background: linear-gradient(to left, #5fbcd3 0%, transparent 100%);
    clip-path: polygon(100% 100%, 70% 60%, 90% 50%, 60% 30%, 80% 20%, 50% 0%, 100% 0);
}

/* Glowing Particles */
.glow-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #d4b86a;
    border-radius: 50%;
    box-shadow: 0 0 8px #d4b86a, 0 0 15px #5fbcd3, 0 0 25px rgba(212, 184, 106, 0.3);
    animation: particle-float 8s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.5;
}

.glow-particle:nth-child(odd) {
    animation-delay: 2s;
}

@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    50% {
        transform: translate(50px, -100vh);
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translate(100px, -150vh);
        opacity: 0;
    }
}

/* Add underwater blue-green tint to images */
img {
    filter: hue-rotate(-10deg) saturate(1.1);
}

/* Underwater text glow effect - softer */
h1, h2, h3 {
    text-shadow: 0 0 15px rgba(212, 184, 106, 0.2);
}

/* ==================== GAME-LIKE EFFECTS ==================== */

/* Pixel Sparkles Effect */
.pixel-sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #d4b86a, #5fbcd3);
    box-shadow: 0 0 15px rgba(212, 184, 106, 0.8);
    pointer-events: none;
    z-index: 9998;
    animation: sparkle-float 3s linear infinite;
}

@keyframes sparkle-float {
    0% {
        transform: translate(0, 100vh) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--random-x, 50px), -100vh) rotate(360deg) scale(0);
        opacity: 0;
    }
}

/* Game Power-Up Effect */
.power-up {
    position: fixed;
    font-size: 32px;
    pointer-events: none;
    z-index: 9999;
    animation: powerup-collect 1s ease-out forwards;
}

@keyframes powerup-collect {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) translateY(-30px);
    }
    100% {
        transform: scale(0) translateY(-100px);
        opacity: 0;
    }
}

/* Treasure Chest Glow */
.treasure-glow {
    position: fixed;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 184, 106, 0.4) 0%, transparent 70%);
    pointer-events: none;
    z-index: 997;
    animation: treasure-pulse 2s ease-in-out infinite;
}

@keyframes treasure-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }
}

/* Coin Spin Effect */
.coin-spin {
    display: inline-block;
    animation: coin-rotate 2s linear infinite;
    transform-style: preserve-3d;
}

@keyframes coin-rotate {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* Game Screen Scan Line Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(95, 188, 211, 0.5), transparent);
    pointer-events: none;
    z-index: 9997;
    animation: scanline-move 3s linear infinite;
}

@keyframes scanline-move {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100vh);
    }
}

/* Retro Pixelated Button Effect */
.btn-game {
    position: relative;
    image-rendering: pixelated;
    box-shadow: 
        0 0 0 2px rgba(212, 184, 106, 0.5),
        0 0 20px rgba(212, 184, 106, 0.3),
        inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.btn-game:active {
    box-shadow: 
        0 0 0 2px rgba(212, 184, 106, 0.5),
        inset 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(2px);
}

/* HP Bar / Progress Bar Style */
.hp-bar {
    width: 100%;
    height: 8px;
    background: rgba(10, 22, 40, 0.8);
    border: 2px solid rgba(212, 184, 106, 0.4);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #d89b3d 0%, #d4b86a 50%, #e0ac4b 100%);
    box-shadow: 0 0 10px rgba(212, 184, 106, 0.6);
    transition: width 0.3s ease;
    animation: hp-glow 1.5s ease-in-out infinite;
}

@keyframes hp-glow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* Level Up Notification */
.level-up {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #d89b3d;
    text-shadow: 
        0 0 20px rgba(212, 184, 106, 0.8),
        0 0 40px rgba(95, 188, 211, 0.6),
        2px 2px 0 rgba(10, 22, 40, 0.8);
    z-index: 10000;
    pointer-events: none;
    animation: levelup-appear 2s ease-out forwards;
}

@keyframes levelup-appear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.5) rotate(0deg);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -80%) scale(1) rotate(0deg);
        opacity: 0;
    }
}
