input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.1)), url(images/wallpaper.webp);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

* {
  box-sizing: border-box;
  font-family: monospace;
  letter-spacing: 2px;
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Old versions of Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

#pickEmpire {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.middlePopup {
  width: 400px;
  height: 500px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.popupContent {
  width: 100%;
  height: 100%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

select {
  width: 200px;
  height: 40px;
  border-radius: 5px;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 8px;
  background-color: #000918;
  color: white;
  text-align: center;
  box-shadow: 0px 0px 5px 0px #888;
}

/* all inputs except checkbox and those with .except */
input:not([type="checkbox"]):not(.except) {
  width: 200px;
  height: 40px;
  border-radius: 5px;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 8px;
  background-color: #000918;
  color: white;
  text-align: center;
  box-shadow: 0px 0px 5px 0px #888;
}

button {
  background: url(images/button.webp);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  
  width: 190px;
  height: 100px;
  border-radius: 5px;
  border: none;
  outline: none;
  padding: 5px;
  cursor: pointer;
  color: white;
  font-weight: bold;
  font-size: 28px;

  transition: box-shadow 0.2s ease-in-out;
}

button:hover {
  box-shadow: 0px 0px 0px 0px rgba(130, 130, 130, 0.75);
}

button.small {
  width: 100px;
  height: 50px;
  font-size: 16px;
}

button.extra-small {
  width: 100px;
  height: 50px;
  font-size: 10px;
}

button.extra-small-2 {
  width: 60px;
  height: 30px;
  font-size: 10px;
}

button.disabled {
  /* apply whitening filter */
  filter: brightness(2);
  cursor: not-allowed;
}

button.blue {
  /* apply hue filter */
  background: url(images/buttonBright.webp);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
button.red {
  /* apply hue filter */
  background: url(images/buttonBright.webp);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: hue-rotate(90deg);
}
button.green {
  /* apply hue filter */
  background: url(images/buttonBright.webp);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: hue-rotate(270deg);
}
button.yellow {
  /* apply hue filter */
  background: url(images/buttonBright.webp);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: hue-rotate(194deg);
}
button.purple {
  /* apply hue filter */
  background: url(images/buttonBright.webp);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: hue-rotate(63deg);
}

#canvasWrapper {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
}

#canvas {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
}

#loading {
  position: fixed;
  top: calc(50vh - 150px);
  left: calc(50vw - 150px);
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#buildingPopup {
  position: fixed;
  right: 20px;
  top: 100px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
}

#buildingExtraPopup { /* To the left of the buildingPopup */
  position: fixed;
  right: 430px;
  top: 100px;
  width: 500px;
  height: 530px;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
  overflow-y: scroll;
}

#activeDesirePairs, #availableDesirePairs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

#buildingTop {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  padding: 10px 30px;
  overflow-y: scroll;
  overflow-x: hidden;
}

#buildingBottom {
  display: flex;
  flex-direction: row;
  align-items: space-between;
  padding: 10px;
}

#unitPopups {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  bottom: 10px;
  right: 10px;
  pointer-events: none;
  z-index: 9999999;
}

#unitPopupInfo {
  display: flex;
  flex-direction: column;
  z-index: 99999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
  margin-bottom: 25px;
  padding: 10px;
  height: 500px;
  width: 300px;
  overflow-y: scroll;
  pointer-events: all;
}

#unitPopupBottom {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-end;
}

#actions {
  display: flex;
  flex-direction: row;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.actionImage {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: white;
  padding: 5px;
  margin-left: 3px;
  margin-right: 3px;
  cursor: pointer;
  pointer-events: all;
}

.actionTitle {
  color: black;
  background-color: white;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 2px 5px;
  margin: 4px;
}

#healthCanvas {
  width: 100px;
  height: 100px;
}

#passiveAction {
  position: relative;
}

.passiveActionImage {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
}

#promptBuildingTypePopup {
  position: fixed;
  right: 20px;
  top: 100px;
  padding: 30px;
  max-height: calc(100vh - 200px);
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
}

#promptTradePartnerPopup {
  position: fixed;
  right: 20px;
  top: 100px;
  padding: 30px;
  max-height: calc(100vh - 200px);
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
}

.number-popup-container {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #fff; /* Or any color you prefer */
  border-radius: 10px; /* Optional: for rounded corners */
  box-shadow: 4px 4px 8px #666;
  /* Add more styling here as needed */
}


.number-input-container {
  display: flex;
  gap: 10px; /* Spacing between input and button */
  align-items: center; /* Align the items vertically */
}

#numberInput {
  flex-grow: 1; /* Allow input to fill space */
  padding: 8px;
  font-size: 16px;
  /* Add more input styling here as needed */
}

#confirmNumber {
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
  /* Add more button styling here as needed */
}

#cancelNumber {
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
  /* Add more button styling here as needed */
}

#topInstructionMessageWrapper {
  position: fixed;
  top: 25px;
  left: 0px;
  width: 100vw;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  z-index: 999999999;
  pointer-events: none;
}

#topInstructionMessage {
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: white;
  font-weight: bold;
  background-color: black;
  padding: 10px;
}

.lookaheadControls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  position: fixed;
  bottom: 0px;
  left: 0px;
  width: 100vw;
  height: 40px;
}

.controlsBox {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  padding: 5px;
  background-color: rgb(134, 227, 255);
  cursor: pointer;
}

.lookaheadImage {
  height: 20px;
}

.lookaheadImageScrub {
  height: 14px;
}

.filterControls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 10px;
  left: 10px;
  background-color: white;
  padding: 0px 10px;
  border-radius: 5px;
}

.filterControls select {
  width: 148px;
  height: 27px;
  border-radius: 5px;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 0px;
}

#promptPickTechnology {
  position: fixed;
  top: calc(50vh - 250px);
  left: calc(50vw - 300px);
  width: 500px;
  height: 600px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
  flex-direction: column;
  padding: 20px;
}

#technologyChoices {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: scroll;
  flex: 1;
  width: 100%;
}

.roundButton {
  padding: 4px;
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: rgb(187, 216, 246);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
}

.topLeftButtons {
  background-image: url(images/niceRectangle.webp);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: top left;
  position: fixed;
  top: 0px;
  left: 0px;
  margin-left: 5px;
  margin-top: 5px;
  display: flex;
  padding-left: 14px;
  padding-top: 9px;
  padding-bottom: 13px;
  padding-right: 9px;
}

.topLeftButtons .roundButton {
  margin-right: 7px;
}

#leftGameBar {
  display: flex;
  position: fixed;
  left: 0px;
  flex-direction: column;
  top: 0px;
  align-items: center;
  justify-content: center;
  height: 100%;
  pointer-events: none;
}

#leftGameBar .cylinder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  background-image: url(images/tallRectangle.webp);
  background-size: 100% 100%;
  background-position: top left;
  background-repeat: no-repeat;
  padding: 10px 7px 3px 14px;
}

#leftGameBar .roundButton {
  margin-bottom: 7px;;
}

#warGameBar {
  display: flex;
  position: fixed;
  left: 80px;
  flex-direction: column;
  top: 0px;
  align-items: center;
  justify-content: center;
  height: 100%;
  pointer-events: none;
}

#warGameBar .cylinder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  background-image: url(images/tallRectangle.webp);
  background-size: 100% 100%;
  background-position: top left;
  background-repeat: no-repeat;
  padding: 10px 7px 3px 14px;
}

#warGameBar .roundButton {
  margin-bottom: 7px;
  position: relative;
}

#warGameBar .actionInfo {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 25px;
  height: 25px;
}

#passiveActionPopup {
  display: flex;
  flex-direction: row;
  margin-top: 18px;
}

#paLeftImage {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;

  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

#paLeftImageWrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 4px;
  background-color: white;
  border: 2px solid black;
  position: relative;
}

#paLeftCarret {
  width: 16px;
  height: 16px;
  position: absolute;
  right: 0px;
  bottom: 0px;
  cursor: pointer;
}

#paLeftClose {
  width: 16px;
  height: 16px;
  position: absolute;
  right: 0px;
  top: 0px;
  cursor: pointer;
}

.paRight {
  padding-left: 10px; 
}

#paRightTitle {
  font-size: 12px;
  font-weight: bold;
}

#paRightDescription {
  font-size: 10px;
  margin-top: 5px;
}

#paLeftOptions {
  width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: scroll;
  padding: 5px;

  position: absolute;
  top: 75px;
  left: 0px;

  background-color: white;

  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;

  z-index: 9999;

  max-height: 400px;
}

#settingsPrompt {
  position: fixed;
  top: 260px;
  right: 10px;
  width: 300px;
  max-height: 300px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
  flex-direction: column;
  padding: 20px;

  overflow-y: auto;
}

.ppCloseButton {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 32px;
  height: 20px;
  background-color: #e50808;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-family: monospace;
  padding-left: 3px;
  border-bottom-left-radius: 10px;
}

#passiveBehaviours {
  margin-top: 15px;
}

#plannedActions {
  margin-top: 10px;
}

.warPlayerSelectImg {
  position: fixed;
  width: 180px;
  top: 0px;
  right: calc(50% - 90px);
  pointer-events: none;
}

#playerSelect {
  position: fixed;
  width: 124px;
  top: 84px;
  right: calc(50% - 59px);
  height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#playerSelect>div>div:first-child {
  border: none !important;
  color: white;
}

#warPlayerSelectInfo {
  position: fixed;
  width: 20px;
  top: 101px;
  right: calc(50% - 75px);
}

#warPlayerSelectClose {
  position: fixed;
  width: 20px;
  top: 79px;
  right: calc(50% - 75px);
  cursor: pointer;
}

#warGameRightPanel {
  position: fixed;
  right: 20px;
  top: 100px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
  padding: 10px;
  overflow-y: auto;
}

table.warSchemeTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.warSchemeTable th, .warSchemeTable td {
  text-align: center;
}

.warSchemeTable th {
  padding: 6px;
  background-color: #d8d8d8;
  color: black;
}

.warSchemeTable td {
  padding: 2px;
  background-color: #f5f5f5;
}

.warSchemeTable tr:nth-child(even) {
  background-color: #e5e5e5;
}


#infoPanel {
  position: fixed;
  right: 10%;
  top: 10%;
  width: 80%;
  height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9999;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0px 0px 5px 0px #888;
  padding: 10px;
  overflow-y: hidden;
}

#notificationCount {
  position: absolute;
  top: -4px;
  right: 5px;
  width: 30px;
  height: 30px;
  background-color: #ffffff;
  color: black;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 3px red solid;
  font-weight: bold;
}

#useChrome {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: black;
  color: white;
  font-size: 20px;
  z-index: 999999999;
}

#useLaptop {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: black;
  color: white;
  font-size: 20px;
  z-index: 999999999;
}

#unitMessage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  text-align: center;
}

.neatTable {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.neatTable th, .neatTable td {
  border: 1px solid black;
  padding: 5px;
}

.neatTable th {
  background-color: #f2f2f2;
}

.neatTable tr:nth-child(even) {
  background-color: #f2f2f2;
}

.neatTable tr:hover {
  background-color: #e5e5e5;
}

.hoverable:hover {
  background-color: #ff2c2c;
  color: white;
  transition: background-color 0.2s, color 0.2s;
}

.hoverableThenLightGray:hover {
  background-color: #d8d8d8;
  transition: background-color 0.2s;
}

#buildingProductionPopup {
  position: fixed;
  /* centered */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 600px;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  z-index: 9999;
  background-color: white;
  box-shadow: 0px 0px 5px 0px #888;
  padding: 10px;
  overflow-y: auto;
}

@keyframes loadingEffect {
  0% {
    background-position: 200% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.loading-background {
  background: linear-gradient(to right, white 0%, #d3ffd5 50%, white 100%);
  background-size: 200% 100%;
  animation: loadingEffect 0.5s linear infinite;
}

.loading-background.defHover:hover {
  /* slight change in hue */
  background: linear-gradient(to right, #d3ffd5 0%, #91ff96 50%, #d3ffd5 100%);
  background-size: 200% 100%;
  animation: none;
}