body {
  background: #2d4a22;
  color: white;
  font-family: "Comic Sans MS", "Segoe UI", sans-serif;
  text-align: center;
  margin: 0;
  padding: 10px;
}

h1 {
  margin: 5px 0 10px;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

#sun-box {
  background: #f7d64a;
  color: #5a3d00;
  font-size: 28px;
  font-weight: bold;
  padding: 6px 16px;
  border-radius: 12px;
  min-width: 90px;
}

#picker {
  display: flex;
  gap: 8px;
}

.plant-button {
  background: #8b5a2b;
  color: white;
  border: 4px solid #5c3a1a;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.plant-button {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

#wave-info small {
  font-size: 15px;
  opacity: 0.85;
}

/* Dark shade that shrinks away while a plant is cooling down */
.plant-button .cooldown-shade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Seconds left, shown big in the middle of the button */
.plant-button .cooldown-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 4px black;
  pointer-events: none;
}

/* While cooling down, the shade does the darkening, so keep the number bright */
.plant-button.cooling:disabled {
  opacity: 1;
}

.plant-button .emoji {
  font-size: 36px;
  display: block;
}

.plant-button.selected {
  border-color: #ffef5c;
  box-shadow: 0 0 10px #ffef5c;
}

.plant-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#wave-info {
  font-size: 20px;
  min-width: 140px;
}

#pause-button {
  background: #3a6ea5;
  color: white;
  border: 4px solid #234a73;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
  min-width: 130px;
}

/* The lawn and the start screen sit on top of each other */
#game-area {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

#game-area canvas {
  display: block;                 /* no gap under the lawn */
}

#menu {
  position: absolute;
  inset: 6px;                     /* inside the canvas border */
  border-radius: 4px;
  background: rgba(20, 40, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#menu h2 {
  font-size: 36px;
  margin: 0 0 10px;
  text-shadow: 0 3px 0 #000;
}

#mode-buttons {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-button {
  width: 200px;
  padding: 18px 10px;
  border-radius: 18px;
  border: 5px solid #5c3a1a;
  color: white;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s, box-shadow 0.1s;
}

.mode-button:hover {
  transform: scale(1.07);
  box-shadow: 0 0 18px #ffef5c;
  border-color: #ffef5c;
}

.mode-button .emoji { font-size: 56px; }
.mode-button .label { font-size: 30px; font-weight: bold; }
.mode-button .info  { font-size: 15px; opacity: 0.9; }

.mode-easy   { background: #3f9b2f; }
.mode-normal { background: #3a6ea5; }
.mode-hard   { background: #b3261e; }

canvas {
  border: 6px solid #5c3a1a;
  border-radius: 8px;
  max-width: 100%;
  cursor: pointer;
}

.help {
  font-size: 16px;
  opacity: 0.85;
}
