/*
  Global styles for Castle Deck Defense. The game uses a minimalist
  presentation with flat colours and thick outlines inspired by classic
  flash titles. The UI is kept simple: a top bar displays the wave
  number and resource counters, a bottom bar contains the player's hand
  of cards, and a modal overlay appears between waves for reward
  selection.
*/

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #222;
  color: #fff;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  background: #333;
  width: 100vw;
  height: calc(100vh - 140px);
  cursor: default;
}

#ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#topBar {
  flex: 0 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  background: #444;
  border-bottom: 2px solid #555;
  pointer-events: auto;
}

#cardBar {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #2a2a2a;
  pointer-events: auto;
}

#cardBar .card {
  width: 80px;
  height: 120px;
  background: #555;
  border: 2px solid #777;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  cursor: pointer;
  user-select: none;
  position: relative;
}

#cardBar .card.dragging {
  opacity: 0.5;
}

#cardBar .card .cost {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.8em;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 3px;
  border-radius: 3px;
}

#rewardOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#rewardOverlay.hidden {
  display: none;
}

#rewardPanel {
  background: #444;
  padding: 20px;
  border: 2px solid #777;
  border-radius: 8px;
  text-align: center;
  min-width: 300px;
}

#rewardOptions {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  justify-content: center;
}

#rewardOptions .rewardCard {
  width: 80px;
  height: 120px;
  background: #555;
  border: 2px solid #777;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

#rewardOptions .rewardCard:hover {
  border-color: #ffcc00;
}

#skipReward {
  margin-top: 10px;
  padding: 5px 10px;
  background: #666;
  border: none;
  color: #fff;
  cursor: pointer;
}

#skipReward:hover {
  background: #888;
}