/*
 the short form 'font:' declaration was cauing issues with cross-browser compatability so it isn't used
 */
body {
  background: #e0e0e0;
  font-family: "Roboto", sans-serif;
  color: #424242;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  body {
    flex-wrap: wrap;
    max-height: 100vh;
  }
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  header {
    order: 1;
    width: 50%;
    flex-grow: 1;
  }
}

header h1 {
  font-size: 3.5em;
  font-weight: 300;
  margin: 0;
  transition: 0.1s;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  header h1 {
    font-size: 2em;
  }
}

@media screen and (max-width: 400px) {
  header h1 {
    font-size: 2.4em;
  }
}

.stats-wrap {
  flex-grow: 1;
  min-height: 35px;
  margin: 4px 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.stats-wrap .stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  width: 650px;
  max-width: 80%;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  .stats-wrap .stats {
    flex-direction: column;
    font-size: 1.3em;
  }
  .stats-wrap .stats i {
    font-size: 1.8em;
  }
  .stats-wrap .stats button {
    padding: 12px 16px;
  }
}

.stats-wrap .stats button {
  border-radius: 4px;
  border: 0;
  padding: 8px 12px;
  transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: #118ab2;
  color: #fafafa;
}

@media screen and (max-width: 490px) {
  .stats-wrap .stats button {
    margin: 10px 25%;
  }
}

.stats-wrap .stats button:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  cursor: pointer;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  main {
    order: 3;
    width: 50%;
  }
}

.win-modal {
  box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
  display: none;
  justify-content: center;
  flex-direction: column;
  align-content: stretch;
  background-color: #f5f5f5;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 95%;
  z-index: 50;
  height: 300px;
}

.win-modal h1 {
  text-align: center;
  font-weight: 300;
  font-size: 3.5em;
  margin: 10px 0 0;
}

.win-modal .stats {
  display: flex;
  flex-wrap: wrap;
  align-content: stretch;
  justify-content: space-around;
}

.win-modal .stats .rank {
  font-size: 2.5em;
  width: 100%;
  text-align: center;
  margin: 10px 0 15px;
}

.win-modal .stats .timer,
.win-modal .stats .turn-count {
  font-family: "Open Sans", sans-serif;
  font-size: 1.3em;
}

.win-modal .stats button {
  border-radius: 4px;
  margin: 15px 25% 0;
  font-size: 1.5em;
  border: 0;
  padding: 12px 15px;
  transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: #118ab2;
  color: #fafafa;
}

.win-modal .stats button:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  cursor: pointer;
}

.card-table {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  font-size: 2.5em;
  flex-grow: 1;
  margin: 5px 18px;
  max-height: 620px;
  max-width: 620px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-auto-flow: column;
  grid-gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #424242;
}

@media screen and (max-width: 400px) {
  .card-table {
    grid-gap: 7px;
    border-radius: 6px;
    padding: 6px;
    font-size: 2em;
  }
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  .card-table {
    max-width: 95%;
    grid-gap: 7px;
    border-radius: 6px;
    padding: 6px;
    font-size: 2em;
  }
}

.card-table .card {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 50px;
  min-height: 50px;
  border-radius: inherit;
  background: #118ab2;
}

.card-table .card::before {
  content: "";
  height: 0;
  display: inline-block;
  padding-top: 100%;
  width: 1px;
  position: relative;
}

.card-table .card:hover {
  cursor: pointer;
}

.card-table .card i {
  display: none;
  font-size: inherit;
  color: #02171e;
}

.match {
  z-index: 3;
  background-color: #06d660 !important;
}

.mismatch {
  z-index: 4;
  background-color: #ef4747 !important;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap-reverse;
  padding: 15px 0;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 824px) and (orientation: landscape) {
  footer {
    order: 2;
    width: 50%;
    font-size: 12px;
    padding: 0 0 10px;
  }
}

footer a {
  text-decoration: none;
  color: inherit;
  transition: 0.15s;
  margin: 5px 30px;
}

footer a:hover {
  color: #03a9f4;
}

footer .git-link {
  font-size: 22px;
}
