* {
  box-sizing: border-box;
}
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #272831;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 2s;
}
body.win {
  background: #273128;
}
#controls {
  width: 100%;
  float: left;
}
#controls .field {
  color: #fff;
  float: left;
  padding: 5px;
}
#controls button {
  margin-top: 5px;
  margin-right: 5px;
  background: #272831;
  color: #fff;
  border: none;
  padding: 5px 15px;
  float: right;
}
#base {
  background: rgba(255,255,255,0.1);
  width: 360px;
}
#base .grid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 5px;
}
#base .win {
  opacity: 0.8 !important;
}
#base .card {
  opacity: 1;
  width: calc(100% / 4 - 4px);
  height: 100px;
  padding: 5px;
  transition: 0.3s;
}
#base .card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}
#base .card .inner .front,
#base .card .inner .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}
#base .card .inner .front {
  background: #272831;
}
#base .card .inner .back {
  transform: rotateY(180deg);
}
#base .card .flip {
  transform: rotateY(180deg);
}
#base .card .flip-win {
  transform: rotateY(180deg);
}