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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.game-container {
  background: linear-gradient(180deg, #2d5a27 0%, #1e3e1a 100%);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 3px solid #4a7c3f;
}

.header {
  text-align: center;
  margin-bottom: 15px;
}

.header h1 {
  color: #7ec850;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  font-size: 28px;
  letter-spacing: 2px;
}

.info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.3);
  padding: 8px 20px;
  border-radius: 10px;
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.score {
  color: #ffd700;
}

.wave {
  color: #ff6b6b;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.plant-card {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
  color: white;
  min-width: 100px;
}

.plant-card:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.plant-card.selected {
  border-color: #ffd700;
  background: rgba(255,215,0,0.2);
  box-shadow: 0 0 15px rgba(255,215,0,0.3);
}

.plant-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.plant-icon {
  font-size: 32px;
}

.plant-name {
  font-size: 12px;
  margin-top: 5px;
}

.plant-cost {
  font-size: 11px;
  color: #ffd700;
}

.start-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(231,76,60,0.4);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(9, 75px);
  grid-template-rows: repeat(5, 85px);
  gap: 2px;
  background: #3a6b35;
  border: 4px solid #2d5a27;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.cell {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 35px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  user-select: none;
}

.cell:hover {
  background: rgba(255,255,255,0.15);
}

.cell.lawn {
  background: linear-gradient(135deg, #4a7c3f, #3d6b34);
}

.cell.planted {
  cursor: default;
}

.plant-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.placed-plant-img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  pointer-events: none;
  animation: plantPop 0.3s ease-out;
}

.zombie {
  position: absolute;
  font-size: 40px;
  z-index: 10;
  animation: zombieWalk 0.5s ease-in-out;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

@keyframes zombieWalk {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.pea {
  position: absolute;
  font-size: 20px;
  z-index: 5;
  animation: peaShoot 0.3s ease-out;
}

@keyframes peaShoot {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.sun {
  position: absolute;
  font-size: 28px;
  cursor: pointer;
  z-index: 20;
  animation: sunFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
  transition: transform 0.2s;
}

.sun:hover {
  transform: scale(1.3);
}

@keyframes sunFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.plant {
  font-size: 35px;
  animation: plantPop 0.3s ease-out;
}

@keyframes plantPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.plant-shoot {
  animation: plantShoot 0.5s ease-in-out;
}

@keyframes plantShoot {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.zombie-eating {
  animation: zombieEat 0.3s ease-in-out infinite;
}

@keyframes zombieEat {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

.placed-plant {
  font-size: 35px;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 10px;
}

.game-over-overlay h2 {
  color: #ff4444;
  font-size: 48px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255,0,0,0.5);
}

.game-over-overlay p {
  color: white;
  font-size: 20px;
  margin-bottom: 20px;
}

.game-over-overlay button {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.3s;
}

.game-over-overlay button:hover {
  transform: scale(1.1);
}

.footer-info {
  text-align: center;
  margin-top: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}
