* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #222;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

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

.screen.hidden {
    display: none;
}

#main-menu h1 {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #ffcc00;
    text-shadow: 5px 5px 0 #ff6600;
}

button {
    background-color: #ff6600;
    color: white;
    border: none;
    padding: 1rem 2rem;
    margin: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
}

button:hover {
    background-color: #ff9933;
    transform: scale(1.05);
}

#game-screen {
    background: url('../assets/images/background.jpg') no-repeat center center;
    background-size: cover;
    display: block;
    z-index: 1;
}

#lawn {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 810px;
    height: 450px;
}

.lawn-grid {
    display: grid;
    grid-template-columns: repeat(9, 90px);
    grid-template-rows: repeat(5, 90px);
    gap: 0;
    width: 100%;
    height: 100%;
}

.lawn-cell {
    position: relative;
    width: 90px;
    height: 90px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

#ui-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

#sun-counter {
    font-size: 2rem;
    color: #ffcc00;
    margin-right: 30px;
    display: flex;
    align-items: center;
}

#sun-counter::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    background: url('../assets/images/ui/sun.png') no-repeat center center;
    background-size: contain;
    margin-right: 10px;
}

#plant-choices {
    display: flex;
    flex-grow: 1;
}

.plant-choice {
    width: 80px;
    height: 100px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.plant-choice:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.plant-choice img {
    width: 60px;
    height: 60px;
}

.plant-choice .cost {
    color: #ffcc00;
    font-size: 0.8rem;
}

#game-info {
    display: flex;
    flex-direction: column;
    margin-left: 20px;
}

#wave-indicator {
    font-size: 1.2rem;
    color: #ff6600;
    margin-bottom: 10px;
}

.plant {
    position: absolute;
    width: 80px;
    height: 80px;
    z-index: 2;
}

.zombie {
    position: absolute;
    width: 80px;
    height: 120px;
    z-index: 3;
    right: -100px;
}

.projectile {
    position: absolute;
    width: 30px;
    height: 30px;
    z-index: 2;
}

.sun {
    position: absolute;
    width: 40px;
    height: 40px;
    z-index: 2;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 900px) {
    #lawn {
        width: 630px;
        height: 350px;
    }
    
    .lawn-grid {
        grid-template-columns: repeat(9, 70px);
        grid-template-rows: repeat(5, 70px);
    }
    
    .lawn-cell {
        width: 70px;
        height: 70px;
    }
    
    .plant {
        width: 65px;
        height: 65px;
    }
    
    .zombie {
        width: 65px;
        height: 100px;
    }
}