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

body {
    font-family: Arial, sans-serif;
    background-color: #87CEEB;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 900px;
    height: 600px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
}

.game-header {
    height: 80px;
    background-color: #4a7023;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.sun-counter {
    display: flex;
    align-items: center;
}

.sun-icon {
    width: 40px;
    height: 40px;
    background-color: #FFD700;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 10px #FFA500;
}

.sun-amount {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.progress-bar {
    width: 200px;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0;
    background-color: #FF5722;
    transition: width 0.3s;
}

.plant-selector {
    height: 70px;
    background-color: #8B4513;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
}

.plant-card {
    width: 50px;
    height: 60px;
    background-color: #DDDDDD;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.plant-card:hover {
    transform: scale(1.05);
}

.plant-card.selected {
    background-color: #FFEB3B;
    box-shadow: 0 0 5px #FFC107;
}

.plant-card.disabled {
    filter: grayscale(100%);
    cursor: not-allowed;
}

.plant-image {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.plant-cost {
    font-size: 10px;
    font-weight: bold;
    color: #333;
}

.game-board {
    height: 450px;
    background-image: url('../images/lawn.jpg');
    background-size: cover;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 1px;
}

.cell {
    position: relative;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.cell:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.plant {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.zombie {
    position: absolute;
    width: 80px;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    right: 0;
}

.projectile {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
}

.sun {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #FFD700;
    border-radius: 50%;
    z-index: 4;
    box-shadow: 0 0 10px #FFA500;
    cursor: pointer;
    animation: sunFloat 10s linear;
}

@keyframes sunFloat {
    0% {
        top: -40px;
    }
    100% {
        top: 450px;
    }
}

.start-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-title {
    color: #FFD700;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px #000;
}

.start-button, .restart-button {
    padding: 15px 30px;
    font-size: 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.start-button:hover, .restart-button:hover {
    background-color: #45a049;
}

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

.game-over-text {
    color: #FF5722;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px #000;
}

.result-text {
    color: white;
    font-size: 24px;
    margin-bottom: 30px;
}

.hidden {
    display: none;
}
