body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #8bc34a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.resources {
    background-color: #ffeb3b;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

.plant-selection {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: #4caf50;
    padding: 10px;
    border-radius: 5px;
}

.plant-option {
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.plant-option:hover {
    background-color: #81c784;
}

.plant-option img {
    width: 50px;
    height: 50px;
    display: block;
    margin: 0 auto 5px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(5, 80px);
    gap: 5px;
    background-image: url('../images/background.jpg');
    background-size: cover;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.cell {
    background-color: rgba(139, 195, 74, 0.3);
    border: 1px dashed #fff;
    position: relative;
    cursor: pointer;
}

.cell.occupied {
    cursor: not-allowed;
}

.plant, .zombie {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.peashooter {
    background-image: url('../images/plants/peashooter.png');
}

.sunflower {
    background-image: url('../images/plants/sunflower.png');
}

.wallnut {
    background-image: url('../images/plants/wallnut.png');
}

.zombie {
    background-image: url('../images/zombies/zombie.png');
}

.projectile {
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url('../images/plants/pea.png');
    background-size: contain;
    z-index: 10;
}

.sun {
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: url('../images/plants/sun.png');
    background-size: contain;
    cursor: pointer;
    z-index: 5;
    animation: fall 5s linear;
}

@keyframes fall {
    from { top: -30px; }
    to { top: 100%; }
}

.game-controls {
    text-align: center;
}

.game-controls button {
    padding: 10px 20px;
    margin: 0 10px;
    font-size: 16px;
    background-color: #ff9800;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.game-controls button:hover {
    background-color: #f57c00;
}

.health-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: #f44336;
}

.health-bar-fill {
    height: 100%;
    background-color: #4caf50;
}