* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', cursive;
    overflow: hidden;
    background: linear-gradient(to bottom, #87CEEB 0%, #4682B4 100%);
    height: 100vh;
    user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Ocean Styling */
#ocean {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        #4A90E2 0%, 
        #357ABD 30%, 
        #2E6B9E  60%, 
        #1E4A6B 100%);
    overflow: hidden;
}

#waves {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.08) 2px, transparent 2px);
    background-size: 200px 200px, 150px 150px, 100px 100px;
    animation: waves 20s infinite linear;
}

@keyframes waves {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100px, -100px); }
}

/* Player Boat */
#playerBoat {
    position: fixed;
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#boat {
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

#boat:hover {
    transform: scale(1.1);
}

/* Fishing Rod */
#fishingRod {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center;
    pointer-events: none;
}

#rodLine {
    position: absolute;
    width: 2px;
    background: #8B4513;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.5s ease;
}

#magnet {
    position: absolute;
    font-size: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.5s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.fishing-active #rodLine,
.fishing-active #magnet {
    opacity: 1;
}

.fishing-active #rodLine {
    height: 150px;
}

.fishing-active #magnet {
    top: 150px;
    animation: magnetBob 2s infinite ease-in-out;
}

@keyframes magnetBob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* Fish */
.fish {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.fish:hover {
    transform: scale(1.2);
}

.fish.caught {
    animation: fishCaught 1s ease forwards;
}

@keyframes fishCaught {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5) translateY(-20px); }
    100% { transform: scale(0) translateY(-50px); opacity: 0; }
}

/* Floating Objects */
.floating-object {
    position: absolute;
    font-size: 1.5rem;
    animation: float 4s infinite ease-in-out;
    z-index: 3;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(-2deg); }
}

/* UI Elements */
#gameUI {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#scoreBoard {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

#scoreBoard div {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: #2E6B9E;
}

#scoreBoard div:last-child {
    margin-bottom: 0;
}

/* Compass */
#compass {
    position: relative;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

#compassNeedle {
    position: absolute;
    width: 4px;
    height: 30px;
    background: #FF4444;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    border-radius: 2px;
    transform-origin: center 30px;
    transition: transform 0.3s ease;
}

.compass-direction {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    color: #2E6B9E;
}

.compass-direction.north { top: 5px; left: 50%; transform: translateX(-50%); }
.compass-direction.south { bottom: 5px; left: 50%; transform: translateX(-50%); }
.compass-direction.east { right: 5px; top: 50%; transform: translateY(-50%); }
.compass-direction.west { left: 5px; top: 50%; transform: translateY(-50%); }

/* Controls */
#controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
}

.game-button {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border: none;
    padding: 15px 25px;
    margin: 0 10px;
    border-radius: 25px;
    font-family: 'Fredoka', cursive;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: #333;
}

.game-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.game-button:active:not(:disabled) {
    transform: translateY(0);
}

.game-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#movementInfo {
    margin-top: 15px;
    color: white;
    font-size: 0.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    text-align: center;
}

#movementInfo div {
    margin: 2px 0;
}

/* Start Screen */
#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    text-align: center;
    padding: 20px;
}

#startScreen h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: titleBounce 2s infinite ease-in-out;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#startScreen p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    max-width: 600px;
    line-height: 1.5;
}

.start-button {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    border: none;
    padding: 20px 40px;
    border-radius: 30px;
    font-family: 'Fredoka', cursive;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: white;
    margin-bottom: 30px;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

#instructionsToggle {
    cursor: pointer;
    font-size: 1.1rem;
    text-decoration: underline;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

#instructionsToggle:hover {
    color: #FFD700;
}

#instructions {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    max-width: 500px;
    text-align: left;
}

#instructions h3 {
    margin-bottom: 15px;
    text-align: center;
    color: #FFD700;
}

#instructions ul {
    list-style: none;
}

#instructions li {
    margin-bottom: 10px;
    padding-left: 5px;
}

.hidden {
    display: none !important;
}

/* Catch Animation */
#catchAnimation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    pointer-events: none;
}

.catch-text {
    font-size: 2rem;
    font-weight: 600;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: catchPop 1.5s ease-out;
}

@keyframes catchPop {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    #boat {
        font-size: 2.5rem;
    }
    
    .fish {
        font-size: 1.5rem;
    }
    
    #gameUI {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #compass {
        margin-top: 15px;
        width: 60px;
        height: 60px;
    }
    
    #compassNeedle {
        height: 20px;
        transform-origin: center 20px;
    }
    
    #startScreen h1 {
        font-size: 2.2rem;
    }
    
    #startScreen p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .game-button {
        padding: 12px 20px;
        font-size: 1rem;
        margin: 0 5px;
    }
    
    #scoreBoard {
        padding: 10px 15px;
    }
    
    #scoreBoard div {
        font-size: 1rem;
    }
}
