* {
  box-sizing: border-box;
}

body {
  font-size: 12px;
  font-family: monospace;
  text-align: center;
}

.keyboard {
  display: inline-block;
  padding: 4em 1em 1em;
  background-color: #ddd;
  background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.27, #d4d8db), color-stop(0.64, #d5d9dc), color-stop(0.95, #e6e9eb), color-stop(1, #bfbfbf));
  border-radius: 10px;
  -webkit-box-shadow: 4px 4px 5px 0px rgba(100, 100, 100, 0.5);
  -moz-box-shadow: 4px 4px 5px 0px rgba(100, 100, 100, 0.5);
  box-shadow: 4px 4px 5px 0px rgba(100, 100, 100, 0.5);
}
.keyboard .row {
  display: flex;
  justify-content: space-between;
  align-content: space-between;
  margin: 0.7em auto;
}

.key {
  margin: 0;
  padding: 1em 2em;
  background-color: #eff0f2;
  color: #888;
  border-radius: 6px;
  cursor: pointer;
  -webkit-box-shadow: inset 1px 0 25px #dfdfdf, 0 1px 0 #cfcfcf, 0 1px 0 #bfbfbf, 0 1px 1px #6f6f6f;
}
.key.narrow {
  padding: 0.6em 2em;
}
.key:active {
  box-shadow: inset 0 0 50px #ddd, 0 0 2px #888;
}

.row-3 .key:first-child, .row-4 .key:first-child, .row-5 .key:first-child {
  font-size: .9em;
  padding: 1.5em 3em 0.5em .8em;
  text-align: left;
}
.row-2 .key:last-child, .row-4 .key:last-child, .row-5 .key:last-child {
  font-size: .9em;
  padding: 1.5em .8em 0.5em  3em;
  text-align: right;
}
.row-1 {
  font-size: .9em;
}
.row-5 .key:first-child {
  padding-right: 4.5em;
}
.row-5 .key:last-child {
  padding-left: 4.5em;
}
.row-6 {
  font-size: .9em;
}
.row-6 .key {
  padding: 2em 1.5em 0.8em;
}
.row-6 .key:nth-child(5) {
  padding-left: 10em;
  padding-right: 10em;
}
.row-6 .key:nth-child(8), .row-6 .key:nth-child(9), .row-6 .key:nth-child(10) {
  padding: 1em 2em 0.8em;
  position: relative;
  margin-bottom: 0;
}
.row-6 .key:nth-child(8):after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  content: '';
  width: 0;
  height: 0;
  border-top: 4px solid  transparent;
  border-bottom: 4px solid transparent;
  border-right: 6px solid #888;
}
.row-6 .key:nth-child(9) {
  position: relative;
  padding-top: 3em;
}
.row-6 .key:nth-child(9):before {
  position: absolute;
  top: 0.5em;
  left: 50%;
  transform: translateX(-50%);
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #888;
}
.row-6 .key:nth-child(9):after {
  position: absolute;
  bottom: 0.5em;
  left: 50%;
  transform: translateX(-50%);
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #888;
}
.row-6 .key:nth-child(10):after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  content: '';
  width: 0;
  height: 0;
  border-top: 4px solid  transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #888;
}
