body {
    margin: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, #1a3e72 0%, #6d8eb8 100%);
    font-family: Arial, sans-serif;
}

#game-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #1a3e72 0%, #6d8eb8 100%);
    opacity: 0.3;
    z-index: -1;
}

#game-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="100" viewBox="0 0 800 100"><g fill="%23333" opacity="0.3"><path d="M50,50 L80,30 L120,30 L150,50 Z"/><circle cx="75" cy="50" r="10"/><circle cx="125" cy="50" r="10"/><path d="M250,50 L280,30 L320,30 L350,50 Z"/><circle cx="275" cy="50" r="10"/><circle cx="325" cy="50" r="10"/><path d="M450,50 L480,30 L520,30 L550,50 Z"/><circle cx="475" cy="50" r="10"/><circle cx="525" cy="50" r="10"/><path d="M650,50 L680,30 L720,30 L750,50 Z"/><circle cx="675" cy="50" r="10"/><circle cx="725" cy="50" r="10"/></g></svg>');
    background-size: 800px 100px;
    background-repeat: repeat-x;
    z-index: -1;
}

#title-screen {
    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: 100;
}

.title-sign {
    width: 400px;
    height: 200px;
    background-color: yellow;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.title-sign::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200" viewBox="0 0 400 200"><g fill="black"><circle cx="30" cy="40" r="8"/><circle cx="100" cy="70" r="8"/><circle cx="180" cy="30" r="8"/><circle cx="250" cy="60" r="8"/><circle cx="320" cy="40" r="8"/><circle cx="370" cy="80" r="8"/><circle cx="50" cy="120" r="8"/><circle cx="120" cy="150" r="8"/><circle cx="200" cy="130" r="8"/><circle cx="280" cy="160" r="8"/><circle cx="350" cy="140" r="8"/></g></svg>');
    background-repeat: no-repeat;
    z-index: 1;
}

.title-text {
    font-size: 42px;
    font-weight: bold;
    color: black;
    text-transform: uppercase;
    line-height: 1.2;
    border: 8px solid black;
    padding: 8px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    background-color: yellow;
    position: relative;
    z-index: 2;
}

.start-instruction {
    position: absolute;
    bottom: 30px;
    color: white;
    font-size: 24px;
    text-align: center;
    width: 100%;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transition: opacity 0.5s;
}

#game-container.game-started {
    opacity: 1;
}

#pole {
    position: absolute;
    width: 30px;
    height: 80vh;
    background-color: brown;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

#nest {
    position: absolute;
    width: 100px;
    height: 50px;
    background-color: darkorange;
    border-radius: 50%;
    bottom: calc(80vh - 50px);
    left: 50%;
    transform: translateX(-50%);
}

.baby-stork {
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M15,5 L20,10 L15,15 L10,10 Z" fill="white" stroke="black" stroke-width="0.5"/><path d="M20,10 L25,8" stroke="orange" stroke-width="2" fill="none" stroke-linecap="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
}

#baby1 {
    bottom: 20px;
    left: 20px;
    animation: beg 1s infinite alternate;
}

#baby2 {
    bottom: 20px;
    left: 40px;
    animation: beg 1.2s infinite alternate;
}

#baby3 {
    bottom: 20px;
    left: 60px;
    animation: beg 0.8s infinite alternate;
}

@keyframes beg {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

#stork {
    position: absolute;
    width: 80px;
    height: 120px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 150"><path d="M50,20 L80,40 L50,60 L20,40 Z" fill="white" stroke="black" stroke-width="1"/><path d="M50,20 L80,40 L50,60 L20,40 Z" fill="white"/><path d="M70,35 L90,25" stroke="orange" stroke-width="4" fill="none" stroke-linecap="round"/><circle cx="65" cy="35" r="3" fill="black"/><path d="M50,60 L50,120 M45,120 L55,120" stroke="black" stroke-width="3" fill="none"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.1s;
}

#stork.carrying {
    transform: rotate(-10deg);
}

.worm-in-nest {
    position: absolute;
    width: 25px;
    height: 5px;
    background-color: pink;
    border-radius: 15px;
    animation: wormEaten 1s forwards;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateX(-50%);
}

@keyframes wormEaten {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(0); opacity: 0; }
}

.worm {
    position: absolute;
    width: 30px;
    height: 8px;
    background-color: pink;
    border-radius: 15px;
    bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    color: white;
    font-family: Arial, sans-serif;
}

#adversary {
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="darkred"/><rect x="15" y="10" width="20" height="10" fill="black"/><rect x="5" y="20" width="10" height="5" fill="black"/></svg>');
    background-size: contain;
    z-index: 5;
}

.bullet {
    position: absolute;
    width: 10px;
    height: 3px;
    background-color: yellow;
    border-radius: 2px;
    z-index: 4;
}

#lives {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: white;
    font-family: Arial, sans-serif;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: red;
    font-family: Arial, sans-serif;
    text-align: center;
    display: none;
}
