/* =============================================================================
  MEMORY GAME (mg)
============================================================================= */
/**
 * Game container
 *
 * This is the overall container for the game. Different things get addead and
 * removed from this container depending on the game state.
 */
.mg {
  /* blank */
}

/**
 * Game meta
 *
 * The game meta is the section that displays the level and moves. It's appended
 * to the game container at the start, and shows the level the user selected
 * and the number of moves the user has played.
 */

.mg__meta {
  margin-bottom: 10px;
  color: #064168;
}

.mg__meta--item {
  display: inline-block;
}

.mg__meta--left {
  float: left;
}

.mg__meta--right {
  float: right;
}

.mg__meta--level {
  margin-right: 20px;
}

.mg__start-screen {
  text-align: center;
  padding: 80px 20px;
}

.mg__start-screen--heading {
  margin-bottom: 10px;
  color: #282a2f;
  font-size: 30px;
}

.mg__start-screen--sub-heading {
  font-size: 24px;
  margin-bottom: 10px;
  color: ###064168;
}
.mg__start-screen--sub-heading::before, .mg__start-screen--sub-heading::after {
  margin: 0 5px;
  content: "-";
}

.mg__start-screen--text {
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.mg__start-screen--level-select {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mg__start-screen--level-select span {
  color: #28aadc;
  font-size: 18px;
  cursor: pointer;
}
.mg__start-screen--level-select span:hover {
  color: #1F83A9;
}

/**
 * Game wrapper
 *
 * The game wrapper is where the actual game resides. Inside here, all the
 * memory tiles get arranged and ready for game play.
 */
.mg__wrapper {
  margin: 0 auto;
  width: 100%;
}

.mg__contents {
  position: relative;
  padding-bottom: 50%;
  margin-left: -5px;
  margin-right: -5px;
  margin-top: 50px;
}

/**
 * Game tiles
 *
 * The game tiles are the tiles that are laid down on the memory game board.
 * These tiles are the ones that the user clicks on to flip and reveal some
 * images. The level the user selects determines the position and size of
 * the tiles.
 */
.mg__tile {
  position: absolute;
  padding: 5px;
  z-index: 1;
}

/* game__level-1 styles */
.mg__level-1 .mg__tile {
  width: 23%;
  height: 46%;
}

.mg__level-1 .mg__tile-1 {
  top: 0%;
  left: 0%;
}
.mg__level-1 .mg__tile-2 {
  top: 0%;
  left: 25%;
}
.mg__level-1 .mg__tile-3 {
  top: 0%;
  left: 50%;
}
.mg__level-1 .mg__tile-4 {
  top: 0%;
  left: 75%;
}
.mg__level-1 .mg__tile-5 {
  top: 50%;
  left: 0%;
}
.mg__level-1 .mg__tile-6 {
  top: 50%;
  left: 25%;
}
.mg__level-1 .mg__tile-7 {
  top: 50%;
  left: 50%;
}
.mg__level-1 .mg__tile-8 {
  top: 50%;
  left: 75%;
}

/* game__level-2 styles */
.mg__level-2 .mg__tile {
  width: 15.66667%;
  height: 31.33333%;
}

.mg__level-2 .mg__tile-1 {
  top: 0%;
  left: 0%;
}
.mg__level-2 .mg__tile-2 {
  top: 0%;
  left: 16.66667%;
}
.mg__level-2 .mg__tile-3 {
  top: 0%;
  left: 33.33333%;
}
.mg__level-2 .mg__tile-4 {
  top: 0%;
  left: 50%;
}
.mg__level-2 .mg__tile-5 {
  top: 0%;
  left: 66.66667%;
}
.mg__level-2 .mg__tile-6 {
  top: 0%;
  left: 83.33333%;
}
.mg__level-2 .mg__tile-7 {
  top: 33.33333%;
  left: 0%;
}
.mg__level-2 .mg__tile-8 {
  top: 33.33333%;
  left: 16.66667%;
}
.mg__level-2 .mg__tile-9 {
  top: 33.33333%;
  left: 33.33333%;
}
.mg__level-2 .mg__tile-10 {
  top: 33.33333%;
  left: 50%;
}
.mg__level-2 .mg__tile-11 {
  top: 33.33333%;
  left: 66.66667%;
}
.mg__level-2 .mg__tile-12 {
  top: 33.33333%;
  left: 83.33333%;
}
.mg__level-2 .mg__tile-13 {
  top: 66.66667%;
  left: 0%;
}
.mg__level-2 .mg__tile-14 {
  top: 66.66667%;
  left: 16.66667%;
}
.mg__level-2 .mg__tile-15 {
  top: 66.66667%;
  left: 33.33333%;
}
.mg__level-2 .mg__tile-16 {
  top: 66.66667%;
  left: 50%;
}
.mg__level-2 .mg__tile-17 {
  top: 66.66667%;
  left: 66.66667%;
}
.mg__level-2 .mg__tile-18 {
  top: 66.66667%;
  left: 83.33333%;
}

/* game__level-3 styles */
.mg__level-3 .mg__tile {
  width: 11.5%;
  height: 23%;
}

.mg__level-3 .mg__tile-1 {
  top: 0%;
  left: 0%;
}
.mg__level-3 .mg__tile-2 {
  top: 0%;
  left: 12.5%;
}
.mg__level-3 .mg__tile-3 {
  top: 0%;
  left: 25%;
}
.mg__level-3 .mg__tile-4 {
  top: 0%;
  left: 37.5%;
}
.mg__level-3 .mg__tile-5 {
  top: 0%;
  left: 50%;
}
.mg__level-3 .mg__tile-6 {
  top: 0%;
  left: 62.5%;
}
.mg__level-3 .mg__tile-7 {
  top: 0%;
  left: 75%;
}
.mg__level-3 .mg__tile-8 {
  top: 0%;
  left: 87.5%;
}
.mg__level-3 .mg__tile-9 {
  top: 25%;
  left: 0%;
}
.mg__level-3 .mg__tile-10 {
  top: 25%;
  left: 12.5%;
}
.mg__level-3 .mg__tile-11 {
  top: 25%;
  left: 25%;
}
.mg__level-3 .mg__tile-12 {
  top: 25%;
  left: 37.5%;
}
.mg__level-3 .mg__tile-13 {
  top: 25%;
  left: 50%;
}
.mg__level-3 .mg__tile-14 {
  top: 25%;
  left: 62.5%;
}
.mg__level-3 .mg__tile-15 {
  top: 25%;
  left: 75%;
}
.mg__level-3 .mg__tile-16 {
  top: 25%;
  left: 87.5%;
}
.mg__level-3 .mg__tile-17 {
  top: 50%;
  left: 0%;
}
.mg__level-3 .mg__tile-18 {
  top: 50%;
  left: 12.5%;
}
.mg__level-3 .mg__tile-19 {
  top: 50%;
  left: 25%;
}
.mg__level-3 .mg__tile-20 {
  top: 50%;
  left: 37.5%;
}
.mg__level-3 .mg__tile-21 {
  top: 50%;
  left: 50%;
}
.mg__level-3 .mg__tile-22 {
  top: 50%;
  left: 62.5%;
}
.mg__level-3 .mg__tile-23 {
  top: 50%;
  left: 75%;
}
.mg__level-3 .mg__tile-24 {
  top: 50%;
  left: 87.5%;
}
.mg__level-3 .mg__tile-25 {
  top: 75%;
  left: 0%;
}
.mg__level-3 .mg__tile-26 {
  top: 75%;
  left: 12.5%;
}
.mg__level-3 .mg__tile-27 {
  top: 75%;
  left: 25%;
}
.mg__level-3 .mg__tile-28 {
  top: 75%;
  left: 37.5%;
}
.mg__level-3 .mg__tile-29 {
  top: 75%;
  left: 50%;
}
.mg__level-3 .mg__tile-30 {
  top: 75%;
  left: 62.5%;
}
.mg__level-3 .mg__tile-31 {
  top: 75%;
  left: 75%;
}
.mg__level-3 .mg__tile-32 {
  top: 75%;
  left: 87.5%;
}

/**
 * The tile inside
 *
 * The "tile inner" is the part of the tile that serves as the card. Inside
 * this part, there's an outside and inside part. The outside of the card
 * is the part that has the logo or the pattern or whatever...basically the
 * part that doesn't show the content to be matched. The inside part has the
 * actual images / info to be matched.
 */
.mg__tile--inner {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.mg__tile--outside,
.mg__tile--inside {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  -webkit-transition: -webkit-transform 0.3s, background 0.3s;
          transition: transform 0.3s, background 0.3s;
}

.mg__tile--outside {
  background: url("../img/default/card_logo.png") 50% 50% no-repeat;
  background-size: 80% 80%;
  background-color: #eee;
  box-shadow: 0 0 0 1px #787a80;
}

.mg__tile--inside {
  background-color: #f8fafc;
  box-shadow: 0 0 0 1px #787a80;
  -webkit-transform: rotateY(-180deg);
          transform: rotateY(-180deg);
}

/* some transforms for flipped cards */
.mg__tile--inner.flipped .mg__tile--outside {
  -webkit-transform: rotateY(-180deg);
          transform: rotateY(-180deg);
}

.mg__tile--inner.flipped .mg__tile--inside {
  -webkit-transform: rotateY(0);
          transform: rotateY(0);
}

/* some transitions for correct guesses - only needs to happen on card inside */
.mg__tile--inner.flipped.correct .mg__tile--inside {
  background-color: #ffffdc;
}

/**
 * Game message
 *
 * The game message area is an area to display game messages. It's used in the
 * default set up where no callback is set in the JS. If a callback is set up,
 * then this message area likely won't display. Unless you decide to display it
 * in your own custom callback though!
 */
.mg__onend {
  padding: 80px 20px;
  text-align: center;
}

.mg__onend--heading {
  margin-bottom: 10px;
  color: #28aadc;
  font-size: 30px;
}

.mg__onend--message {
  margin-bottom: 10px;
}

/**
 * Game buttons
 *
 * A simple helper class for game buttons. Edit at your will.
 */
.mg__button {
  margin: 0;
  display: inline-block;
  padding: 6px 25px 6px 25px;
  color: #fff;
  font-family: "Roboto Slab", serif;
  font-size: 14px;
  appearance: none;
  background: #064168;
  border: none;
  border-radius: 3px;
  box-shadow: none;
  cursor: pointer;
}






.transparent {
  filter: grayscale(70%) opacity(0.8);
  cursor: default;
}
.fs-show-name {
  position: absolute;
  top: 5px;
  left: 5px;
  color: white;
  opacity: 1;
  text-align: center;
}
.mg__tile--inside img {
  width: 100%;
  min-height: 100%;
}
.mg__tile--inside {
  overflow: hidden;
}
.large-text {
  font-size: 18px;
  background-color: black;
}
.medium-text {
  font-size: 12px;
  background-color: black;
}
.small-text {
  font-size: 10px;
  background-color: black;
}
.active-box {
  border: 1px solid #064168;
  background-color: cadetblue;
  color: white;
}
.mg__start-screen {
  padding-top: 0px !important;
}
.mg__start-screen input, select {
    width: 100%;
    max-width: 500px;
    padding: 4px;
    margin: 6px auto;
    box-sizing: border-box;
}
.mg__start-screen--level-select span {
    line-height: 30px;
    font-size: 20px;
}
.mg__onend {
  margin-bottom: 100px;
  padding-top: 0px;
}
.player-box {
    max-width: 100%;
    overflow-x: auto;
    display: flex;
    max-width: 700px;
    margin-bottom: 8px;
}
.player-scores {
    min-width: 72pxpx;
    padding: 14px 6px;
    font-size: 18px;
}
.mg__button {
    margin-left: 8px;
}
#container {
    min-height: 440px;
    width: 1150px;
    max-width: calc(100% - 20px);
    margin: auto;
    margin-top: auto;
    background-color: white;
    padding: 30px;
    box-sizing: border-box;
    margin-top: 30px;
    border-radius: 4px;
    border: 1px solid #aaa;
}

@media screen and (max-width: 800px) {
    .player-scores {
        font-size: 16px;
    }
}
@media screen and (max-width: 600px) {
    .large-text {
        font-size : 12px;
        top: 1px;
        left: 1px;
    }
    .medium-text {
        font-size: 10px;
        top: 1px;
        left: 1px;
    }
    .small-text {
        font-size: 8px;
        top: 1px;
        left: 1px;
    }
}
@media screen and (max-width: 500px) {
    .player-scores {
        font-size: 12px;
    }
}
@media screen and (max-width: 400px) {
    .small-text {
        font-size: 5px;
        top: 0;
        left: 0;
    }
}
@media screen and (max-width: 362px) {
     .mg__meta--right {
         float: none;
         width: 100%;
     }
     .mg__button {
         width: 100%;
     }
     .mg__meta--left {
         float: none;
         text-align: center;
     }
}