body {
  margin: 0;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  background: linear-gradient(to top, #87CEEB, #f0f8ff);
}

body.water {
  background: linear-gradient(to top, #2575fc, #87CEEB);
  transition: background 0.5s ease;
}

#gameCanvas {
  display: block;
}

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #333;
  font-size: 18px;
  width: 400px;
  height: 450px;
  background: rgba(255, 255, 255, 0.6);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  transition: height 0.3s ease, opacity 0.3s ease;
  overflow-y: scroll;
  overflow-x: hidden;
}

#ui::-webkit-scrollbar {
  width: 8px;
}

#ui::-webkit-scrollbar-track {
  background: transparent;
}

#ui::-webkit-scrollbar-thumb {
  background: rgba(51, 51, 51, 0.4); 
  border-radius: 10px;
}

#ui::-webkit-scrollbar-thumb:hover {
  background: rgba(51, 51, 51, 0.6); 
}

#ui::-webkit-scrollbar-button {
  display: none;
}

#ui {
  scrollbar-width: thin;
  scrollbar-color: rgba(51, 51, 51, 0.4) transparent;
}

#ui.hidden {
  transform: translateX(-320px);
  opacity: 0;
}

#ui.collapsed {
  height: 22.5px;
}

#ui.collapsed #credits-container{
  margin-bottom: 0px;
}

#ui.collapsed .upgrade-row{
  display: none;
}

#toggleButton {
  position: absolute;
  top: 3px;
  left: 3px;
  background: #45a049aa;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
  transition: background 0.3s;
  z-index: 1000;
  line-height: 10px;
}

#toggleButton:hover {
  background: #45a049;
}

#credits-container {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #4CAF50;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#credits-label {
  font-size: 18px;
  color: #333;
}

.upgrade {
  margin-top: 10px;
  padding: 10px 12px;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.3s;
}

.upgrade.blue {
  background: linear-gradient(135deg, #6a11cb, #2575fc);
}

.upgrade.green {
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
}

.upgrade.red {
  background: linear-gradient(135deg, #ff0000, #ff6666);
}

.upgrade:hover {
  transform: translateY(-3px);
}

.upgrade.blue:hover {
  background: linear-gradient(135deg, #8364f0, #3c9dff);
}

.upgrade.green:hover {
  background: linear-gradient(135deg, #66bb6a, #a5d6a7);
} 

.upgrade.red:hover {
  background: linear-gradient(135deg, #ff3333, #ff9999);
}

.upgrade.blue:disabled {
  background: #99c;
}

.upgrade.green:disabled {
  background: #9c9;
}

.upgrade.red:disabled {
  background: #c99;
}


.upgrade:disabled {
  cursor: not-allowed;
  box-shadow: none;
}

.upgrade-header {
  font-weight: bold;
  font-size: 14px;
  display: block;
}

.upgrade-details {
  font-size: 12px;
  color: #e0e0e0;
  margin-top: 5px;
}

#savePopup {
  position: absolute;
  top: 40px;
  right: 5px;
  background: #4CAF50;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
  opacity: 1;
  z-index: 1000;
}

#savePopup.hidden {
  opacity: 0;
  pointer-events: none;
}

.upgrade-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.upgrade-row.hidden {
  display: none;
}

.upgrade-column {
  flex: 1;
  margin: 0 5px;
}

#settingsButton, #aboutButton {
  position: absolute;
  top: 3px;
  background: rgba(255, 255, 255, 0.6);
  color: #333;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
  transition: background 0.3s, color 0.3s;
  z-index: 1000;
  line-height: 10px;
}

#settingsButton {
  right: 3px;
}

#aboutButton {
  right: 80px;
}

#settingsButton:hover, #aboutButton:hover {
  background: rgba(233, 233, 233, 0.8);
  color: #000;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
  padding-top: 60px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  border-radius: 10px;
  transform: translateY(-50px);
  transition: transform 0.3s ease;
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-content.show {
  transform: translateY(0);
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#resetButton {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
}

#resetButton:hover {
  background-color: #28a745;
}

#tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
}

.tab-button {
  background: #f0f8ff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;
}

.tab-button:hover {
  background: #e0e0e0;
}

.tab-content.hidden {
  display: none;
}

#windLabel {
  position: absolute;
  top: 10px;
  right: 150px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 10;
}

.popup {
  position: absolute;
  color: #262;
  font-size: 20px;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap; /* Prevent text from wrapping */
  animation: moveUpFadeOut 1s ease-out forwards;
}

@keyframes moveUpFadeOut {
  0% {
      transform: translateY(0);
      opacity: 1;
  }
  100% {
      transform: translateY(-20px); /* Move upward */
      opacity: 0;
  }
}
