:root {
  --defender-color: rgb(140, 190, 240);
  --raider-color: rgb(240, 140, 80);
}

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none;
}

.defender {
  color: var(--defender-color);
}

.raider {
  color: var(--raider-color);
}

#menuScreen {
  background: rgba(0, 0, 0, 0.5);

  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
}

#title-card {
  position: absolute;

  top: 5vh;
  left: 50%;
  transform: translateX(-50%);

  color: white;
  font-family: sans-serif;
  text-align: center;
  font-size: 20px;

  text-shadow:
    0px 3px 0px rgba(0, 0, 0, 0.6);
}

#menu-card {
  position: absolute;

  top: 30vh;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(0, 0, 0, 0.7);
  padding: 30px 40px;
  border-radius: 16px;

  color: white;
  font-family: sans-serif;
  text-align: center;

  min-width: 300px;
}

/* full screen canvas */
#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* UI on top */
#ui {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  color: white;
  font-family: Arial;
  padding: 10px;
}

#gameinfo-container {
  position: fixed;
  top: 5vh;
  right: 5vh;

  display: flex;
  flex-direction: column; 
  gap: 1vh; 

  z-index: 10;
}

#minimap {
  width: 250px;
  height: 250px;

  color: white;

  border-radius: 10px;
  overflow: hidden;

  z-index: 1;
}

.base-health-bar {
  width: 250px;
  height: 20px;
  background: rgb(40, 40, 40);
  border-radius: 5px;
  overflow: hidden; 
}

.base-health-fill {
  height: 100%;
  width: 100%; 
  background: rgb(140, 210, 100);
  border-radius: 5px;
  transition: width 0.1s linear;

  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.team-bar-container {
  width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: sans-serif;
  color: white;
}

/* outer bar */
.team-bar {
  width: 250px;
  height: 20px;
  background: rgb(40, 40, 40);
  border-radius: 5px;
  overflow: hidden;

  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.45);
  display: flex;
}

.team-fill.red {
  background: var(--raider-color);
  width: 50%;
  transition: width 0.2s linear;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.team-fill.blue {
  background: var(--defender-color);
  width: 50%;
  transition: width 0.2s linear;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.team-labels {
  width: 250px;
  display: flex;
  justify-content: center;
  gap: 200px;
  font-size: 14px;
  opacity: 0.9;

  font-style: bold;
  font-size: 18px;
}

.team-left {
  color: var(--defender-color);
  text-align: left;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.45);
}

.team-right {
  color: var(--raider-color);
  text-align: right;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.45);
}

#toolbar {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  
  display: flex;
  gap: 10px;

  z-index: 8;
}

.tool.selected {
  position: relative;
  width: 60px;
  height: 60px;

  background: rgba(40, 40, 40, 0.8);
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.tool.selected img {
  width: 60px;
  height: 60px;
  opacity: 0.9;
  
  object-fit: contain;
  display: block;
}

.tool {
  position: relative;
  width: 60px;
  height: 60px;

  background: rgba(40, 40, 40, 0.6);
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.tool img {
  width: 60px;
  height: 60px;
  opacity: 0.6;
  
  object-fit: contain;
  display: block;
}

.tool-key {
  position: absolute;
  top: 4px;
  left: 6px;

  font-size: 16px;
  color: rgb(200, 200, 200);

  z-index: 5;

  pointer-events: none;
}

#status-bar {
  display: flex;
  position: fixed;
  top: 10px;
  right: 5vh;

  padding-right: 10px;

  color: white;

  border-radius: 10px;
  gap: 20px;

  font-family: sans-serif;

  z-index: 10;
}

#status-item {
  width: 150px;
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 8px;
}

#item-info {
  position: fixed;
  top: 5vh;
  left: 5vh;

  width: 200px;

  background: rgba(0, 0, 0, 0.3);
  color: white;

  padding: 15px 18px;
  border-radius: 10px;
  gap: 20px;

  font-family: sans-serif;

  z-index: 10;
}

#item-name {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 6px;
}

#item-description {
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 8px;
  white-space: pre-line;
}

#item-cost {
  margin-top: 18px;
  font-size: 18px;
  white-space: pre-line;
  color: #ffd54a;
}

#resource-bar {
  position: fixed;
  width: 90px;
  bottom: 5vh;
  left: 5vh;

  display: flex;
  flex-direction: column;
  gap: 20px;

  background: rgba(0, 0, 0, 0.3);
  padding: 15px 18px;
  border-radius: 10px;

  color: white;
  font-family: sans-serif;
  font-size: 24px;

  z-index: 10;
}

.resource {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource img {
  width: 32px;
  height: 32px;
}

#status-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

#winning-team {
  position: absolute;
  top: 5vh;
  left: 50%;
  transform: translateX(-50%);

  font-family: Arial;
  font-size: 24px;
  font-weight: bold;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.3);

  z-index: 12;
}