@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../typefaces/fraunces-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../typefaces/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../typefaces/ibm-plex-sans-600.woff2") format("woff2");
}

html, body {
  margin: 0;
  padding: 0;
  background: #ece8e2;
  color: #2a2724;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

.container {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.title {
  margin: 0 auto 8px;
  text-align: center;
}
.title img {
  width: min(100%, 420px);
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.game-intro {
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 24px;
  color: #3a3732;
}

.court-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 24px 28px;
}

#mica-screen {
  position: relative;
  display: block;
  width: min(100%, 640px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background: #2f2c28;
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(42, 39, 36, 0.22);
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-transform: translateZ(0);
}

#levels {
  position: absolute;
  left: 12px;
  top: 10px;
  color: #d4cbb8;
  line-height: 20px;
  font-size: 12px;
}
#levels #next { position: absolute; }
#levels #prev { position: absolute; top: 14px; }
#levels #label { padding-left: 22px; }
#levels #level { font-size: 14px; padding-left: 5px; font-weight: 600; color: #e8e2d6; }
#levels img { cursor: pointer; width: 16px; height: 10px; }
#levels img.disabled { opacity: 0.3; cursor: default; }

#instructions {
  display: none;
  background: rgba(236, 232, 226, 0.92);
  border: 1px solid #4a463f;
  color: #3a3732;
  padding: 0.6em 1em;
  white-space: nowrap;
  text-align: center;
  width: 18em;
  margin: 0 auto;
  position: relative;
  top: -58%;
  border-radius: 6px;
  font-size: 13px;
}
#instructions.is-shown { display: block; }
#instructions b { color: #2a2724; }
#instructions .keyboard { display: block; }
#instructions .touch { display: none; }
#instructions.touch .keyboard { display: none; }
#instructions.touch .touch { display: block; }

#controls {
  position: absolute;
  bottom: 0.6em;
  left: 0.6em;
  color: #d4cbb8;
  font-size: 12px;
}
#controls input,
#controls label { vertical-align: middle; }

.unsupported {
  border: 1px solid #c4b089;
  color: #2a2724;
  background: #d4cbb8;
  padding: 2em;
  margin: 5em;
  display: inline-block;
}

.game-explanation {
  font-size: 14px;
  line-height: 1.55;
  color: #3a3732;
  margin: 8px 0 0;
}
hr {
  border: 0;
  border-top: 1px solid #d4cbb8;
  margin: 24px 0 16px;
}
.game-credit {
  font-size: 13px;
  line-height: 1.5;
  color: #5a5550;
}
.game-credit a { color: #2a2724; }

@media screen and (min-width: 1200px) {
  #mica-screen { width: 800px; }
  #instructions { font-size: 14px; }
}
