/* Main content area */
#content {
  margin: 80px 70px;
  text-align: center;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Header/footer boxes */
.wideBox {
  clear: both;
  text-align: center;
  margin: 70px;
  padding: 10px;
  background: #ebedf2;
  border: 1px solid #333;
}

.wideBox h1 {
  font-weight: bold;
  margin: 20px;
  color: #666;
  font-size: 1.5em;
}

/* Slots for final card positions */
#cardSlots {
  margin: 50px auto 0 auto;
  background: #fff;
}

/* The initial pile of unsorted cards */
#cardPile {
  margin: 0 auto;
  background: #ffd;
}
#cardPile h5 {
  margin: 0 auto;
  color: #fff;
}

#cardSlots, #cardPile {
  width: 910px;
  height: 150px;
  padding: 20px;
  border: 2px solid #333;
  border-radius: 10px;
  box-shadow: 0 0 .3em rgba(0, 0, 0, .8);
  display: flex;            /* Use flexbox for cards alignment */
  flex-wrap: wrap;          /* Wrap cards to new line if overflow */
  justify-content: center;  /* Center horizontally */
  align-items: center;      /* Center vertically */
}

/* Individual cards and slots */
#cardSlots div, #cardPile div {
  /* Remove float */
  float: none;            

  /* Flexbox centering */
  display: flex;
  justify-content: center; /* horizontal center */
  align-items: center;     /* vertical center */
  text-align: center;

  /* Size & spacing */
  width: 150px;
  height: 120px;
  margin: 0 10px 10px 0;
  padding: 5px;
  border: 2px solid #333;
  border-radius: 10px;
  word-wrap: break-word;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}


/* First card/slot margin reset */
#cardSlots div:first-child, #cardPile div:first-child {
  margin-left: 0;
}

/* Card hover and styling */
#cardSlots div.hovered {
  background: #aaa;
}
#cardSlots div {
  border-style: dashed;
  background: #f5f5f5;
}
#cardPile div {
  color: #fff;
  text-shadow: 0 0 3px #000;
  /* background will be set via JS for different colors */
}

/* Card dragging shadow */
#cardPile div.ui-draggable-dragging {
  box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
}

/* Correct cards styling */
#card1.correct, #card2.correct, #card3.correct, #card4.correct, #card5.correct,
#card6.correct, #card7.correct, #card8.correct, #card9.correct, #card10.correct {
  background: orange;
}

/* Success message */
#successMessage {
  position: absolute;
  left: 580px;
  top: 250px;
  width: 0;
  height: 0;
  z-index: 100;
  background: #dfd;
  border: 2px solid #333;
  border-radius: 10px;
  box-shadow: .3em .3em .5em rgba(0, 0, 0, .8);
  padding: 20px;
}

/* Responsive for small screens */
@media only screen and (max-width: 600px) {
  #content {
    margin: 10px;
  }

  #cardSlots, #cardPile {
    width: 100%;
    height: auto;  /* let height grow for wrapping cards */
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  #cardSlots div, #cardPile div {
    width: 80%;
    height: auto;
    min-height: 50px;
    padding: 10px;
    margin: 5px;
    font-size: 16px;
  }
}
