html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: #dbe5e2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%2362e7c3' fill-opacity='1' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
  font-family: 'Noto Serif', serif;
  font-size: 16px;
}

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

.hide {
  visibility: hidden;
}

/*
  Styles for the scores
*/
.score {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  flex-direction: row;
}

.score h2 {
  margin: 2px;
  font-size: 1.25em;
}

.score p {
  margin: 2px;
}

.game,
.best {
  height: 125px;
  width: 125px;
  border-radius: 10px;
  box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
  padding: 10px;
  margin: 0 5px;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.game {
  background-color: #02ccba;
}

.best {
  background-color: #aa7ecd;
}

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

.stars {
  padding: 0;
  margin: 2px 0;
  display: inline-block;
}

.stars li {
  margin: 0;
  list-style: none;
  display: inline-block;
}

.clock {
  font-family: 'Roboto Mono', monospace;
  font-size: 1em;
}

/*
  Styles for the cards
*/
.color1 {
  color: #dda0dd;
}

.color2 {
  color: #008080;
}

.color3 {
  color: #6495ed;
}

.color4 {
  color: #f08080;
}

.board {
  width: 80%;
  min-height: 150px;
  margin: 3em 0;
  padding: 10px;
  background: linear-gradient(160deg, #aa7ecd 0%, #02ccba 100%);
  border-radius: 10px;
  box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.card {
  --card-regular: 125px;
  --card-small: 108px;
  --card-smaller: 90px;
}

.board .card {
  height: var(--card-regular);
  width: var(--card-regular);
  margin: 2px;
  background-color: #ffe4c4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='32' viewBox='0 0 16 32'%3E%3Cg fill='%23f2bacb' fill-opacity='0.4'%3E%3Cpath fill-rule='evenodd' d='M0 24h4v2H0v-2zm0 4h6v2H0v-2zm0-8h2v2H0v-2zM0 0h4v2H0V0zm0 4h2v2H0V4zm16 20h-6v2h6v-2zm0 4H8v2h8v-2zm0-8h-4v2h4v-2zm0-20h-6v2h6V0zm0 4h-4v2h4V4zm-2 12h2v2h-2v-2zm0-8h2v2h-2V8zM2 8h10v2H2V8zm0 8h10v2H2v-2zm-2-4h14v2H0v-2zm4-8h6v2H4V4zm0 16h6v2H4v-2zM6 0h2v2H6V0zm0 24h2v2H6v-2z'/%3E%3C/g%3E%3C/svg%3E");
  border-radius: 8px;
  box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.board .card.smaller {
  height: var(--card-smaller);
  width: var(--card-smaller);
}

.board .card.small {
  height: var(--card-small);
  width: var(--card-small);
}

.board .card.open {
  transform: rotateY(0);
  background: #ffe4e1;
  cursor: default;
}

/*
  Styles for the modal
*/
.modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  transform: scaleX(1.1) scaleY(1.1);
}

.modal-content {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 1em 1.5em;
  width: 380px;
  border-radius: 10px;
  background-color: #ffe4c4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='32' viewBox='0 0 16 32'%3E%3Cg fill='%23f2bacb' fill-opacity='0.4'%3E%3Cpath fill-rule='evenodd' d='M0 24h4v2H0v-2zm0 4h6v2H0v-2zm0-8h2v2H0v-2zM0 0h4v2H0V0zm0 4h2v2H0V4zm16 20h-6v2h6v-2zm0 4H8v2h8v-2zm0-8h-4v2h4v-2zm0-20h-6v2h6V0zm0 4h-4v2h4V4zm-2 12h2v2h-2v-2zm0-8h2v2h-2V8zM2 8h10v2H2V8zm0 8h10v2H2v-2zm-2-4h14v2H0v-2zm4-8h6v2H4V4zm0 16h6v2H4v-2zM6 0h2v2H6V0zm0 24h2v2H6v-2z'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

.close-button {
  float: right;
  background-color: #d2b48c;
  font-family: 'Roboto Mono', monospace;
  font-weight: bold;
  line-height: 2rem;
  width: 2rem;
  text-align: center;
  cursor: pointer;
}

.close-button:hover {
  background-color: #d2691e;
}

@media screen and (max-width: 550px) {
  body {
    font-size: 14px;
  }

  .game,
  .best,
  .board .card {
    height: var(--card-small);
    width: var(--card-small);
  }
}

@media screen and (max-width: 400px) {
  body {
    font-size: 12px;
  }

  .game,
  .best,
  .board .card,
  .board .card.small {
    height: var(--card-smaller);
    width: var(--card-smaller);
  }

  .modal-content {
    width: 70%;
  }
}

@media screen and (max-width: 300px) {
  body {
    min-width: 300px;
  }
}