@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  src: local(""),
       url("/static/fonts/noto-sans-v21-latin-regular.woff2") format("woff2"),
       url("/static/fonts/noto-sans-v21-latin-regular.woff") format("woff");
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 900;
  src: local(""),
       url("/static/fonts/noto-sans-v21-latin-700.woff2") format("woff2"),
       url("/static/fonts/noto-sans-v21-latin-700.woff") format("woff");
}
:root {
  --bg-color: 230, 230, 230;
  --text-color: 0, 0, 0;
  --link-color: 102, 136, 170;
  --link-hover-color: 51, 170, 238;
  --red: 238, 136, 136;
  --blue: 136, 136, 250;
  --green: 136, 221, 136;
  --purple: 238, 136, 250;
  --yellow: 238, 221, 136;
  --cyan: 136, 221, 250;
  --orange: 238, 153, 102;
}
html,
body {
  font-family: "Noto Sans", sans-serif;
  background: rgb(var(--bg-color));
  color: rgb(var(--text-color));
  font-size: 20px;
  line-height: 26px;
  margin: 0;
  padding: 0;
}
button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
h1 {
  font-size: 48px;
  letter-spacing: 3px;
  margin: 0;
}
h3 {
  font-size: 20px;
  letter-spacing: 1px;
  margin: 0;
}
a {
  text-decoration: none;
  color: rgb(var(--link-color));
  outline: 0;
}
a:hover,
a:focus {
  color: rgb(var(--link-hover-color));
}
nav {
  font-weight: bold;
  letter-spacing: 0.03em;
  margin: 10px 20px;
}
.sr-only {
  height: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 0;
}
.column {
  align-items: center;
  display: flex;
  flex-direction: column;
}
.viewport {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 20px 40px;
  margin: 0 auto;
  padding: 0 10px;
}
.viewport.snake {
  max-width: 800px;
}
.viewport.tetris {
  max-width: 1000px;
}
.ui {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
  margin: 18px 12px;
  position: relative;
}
.game,
.deck,
.queue {
  margin-bottom: 8px;
  position: relative;
}
.game::before {
  content: attr(data-level);
}
.deck::before {
  content: "Deck";
}
.queue::before {
  content: "Queue";
}
.game::before,
.deck::before,
.queue::before {
  font-size: 16px;
  left: 0;
  letter-spacing: 0.05em;
  line-height: 1;
  margin: 0 15px;
  position: absolute;
  text-transform: uppercase;
  top: 0;
  transform: translateY(-50%);
  white-space: pre;
}
canvas {
  border-radius: 2vw;
  box-shadow: 0 5px 13px -5px rgba(0, 0, 0, 0.1),
              0 3px  8px -5px rgba(0, 0, 0, 0.1);
  max-width: 100%;
}
.scoreboard {
  margin: 50px 0 30px;
  text-align: center;
}
.score {
  margin: 12px 0 8px;
}
.spacer {
  display: inline-block;
  width: 10px;
}
.message {
  align-items: center;
  background: rgba(var(--bg-color), 0.6);
  box-shadow: 0 0 0 20px rgba(var(--bg-color), 0.6);
  display: flex;
  font-size: 26px;
  font-weight: bold;
  height: 100%;
  justify-content: center;
  left: 0;
  letter-spacing: 2px;
  position: absolute;
  top: 0;
  width: 100%;
}
.message:empty {
  display: none;
}
.controls {
  text-align: center;
}
.btn {
  background: #f4f4f4;
  border: 1px solid transparent;
  border-radius: 6px;
  margin: 0 2px 10px;
  outline: 0;
  padding: 8px 26px;
}
.legend {
  box-sizing: border-box;
  margin: 20px;
  max-width: 400px;
}
.legend dl {
  align-items: baseline;
  display: inline-grid;
  grid-gap: 0 20px;
  grid-template-columns: min-content max-content;
}
.legend dt,
.legend dd {
  margin: 0;
}
.legend dt {
  font-size: 0.85em;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.legend dd {
  opacity: 0.9;
}
.joystick--wrapper {
  height: 60px;
  margin-bottom: 40px;
  position: relative;
}
.joystick {
  --offset-y: 0;
  --offset-x: 0;
  --offset-c: 10px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 60px;
  box-shadow: 0 5px 11px -8px rgba(0, 0, 0, 0.25);
  cursor: grab;
  height: 60px;
  left: 50%;
  margin: var(--offset-y) 0 0 var(--offset-x);
  padding: 0;
  position: absolute;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  transition: margin 100ms ease-out;
  width: 60px;
}
.joystick:hover,
.joystick:focus {
  border-color: #0577e8;
}
.joystick:active {
  box-shadow: 0 3px 11px -5px rgba(0, 0, 0, 0.5);
  cursor: grabbing;
}
.joystick[data-dir="up"] {
  --offset-y: calc(var(--offset-c) * -1);
}
.joystick[data-dir="down"] {
  --offset-y: var(--offset-c);
}
.joystick[data-dir="left"] {
  --offset-x: calc(var(--offset-c) * -1);
}
.joystick[data-dir="right"] {
  --offset-x: var(--offset-c);
}
.joystick--arrows {
  left: 0;
  height: 58px;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 58px;
}
@media (pointer: fine) {
  .btn:hover,
  .btn:focus {
    background: #e0e0e0;
    border-color: #333;
  }
}
@media (min-width: 768px) {
  nav {
    left: 0;
    position: absolute;
    top: 0;
  }
  canvas {
    border-radius: 12px;
  }
  .viewport {
    grid-template-columns: 1fr 350px;
    padding: 0 20px;
  }
  .ui {
    gap: 25px;
  }
  .game,
  .deck,
  .queue {
    margin-bottom: 15px;
  }
}
