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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#2d5a27, #1a3a1a);
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

#game-container {
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-radius: 14px;
  overflow: hidden;
}

#topbar {
  width: 900px;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(#7ec3e6, #2a7fb8);
  border-bottom: 3px solid #164a63;
}

#sun-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff2b3;
  border: 2px solid #c99700;
  border-radius: 20px;
  padding: 4px 14px 4px 6px;
  font-size: 22px;
  font-weight: bold;
  color: #7a5a00;
  min-width: 90px;
  justify-content: center;
}

#sun-amount {
  min-width: 26px;
  text-align: center;
}

#card-bar {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
}

.card {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 2px solid #4a7a10;
  background: linear-gradient(#eaf6c9, #c9e28a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
  flex-shrink: 0;
}

.card:hover {
  transform: translateY(-2px);
}

.card.selected {
  border-color: #ffd200;
  box-shadow: 0 0 0 2px #ffd200;
}

.card.disabled {
  filter: grayscale(0.9);
  opacity: 0.6;
  cursor: not-allowed;
}

.card .card-emoji {
  font-size: 24px;
  line-height: 1;
}

.card .card-cost {
  font-size: 12px;
  font-weight: bold;
  color: #2c5a00;
}

.card .card-name {
  font-size: 10px;
  color: #555;
  line-height: 1.1;
}

.card .card-cd {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(80, 60, 20, 0.55);
  border-radius: 8px;
  transform-origin: top;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

#wave-info {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
}

canvas {
  display: block;
  cursor: crosshair;
}

#overlay {
  position: absolute;
  inset: 70px 0 0 0;
  background: rgba(10, 30, 10, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 10;
}

#overlay.hidden {
  display: none;
}

#overlay-title {
  font-size: 48px;
  font-weight: bold;
  color: #8fe04b;
  text-shadow: 2px 2px 0 #1c3c0c;
}

#overlay-desc {
  font-size: 18px;
  color: #d8f5c0;
  text-align: center;
  max-width: 520px;
}

#start-btn {
  font-size: 22px;
  font-weight: bold;
  padding: 12px 40px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  background: linear-gradient(#9be15d, #5cb82e);
  color: #123200;
  box-shadow: 0 5px 0 #3a7a16;
}

#start-btn:hover {
  filter: brightness(1.1);
}

#start-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #3a7a16;
}
