#game canvas {
  width: 100%;
  max-width: 760px;
  display: block;
  margin: 0 auto;
}

#errorMessage {
  color: #DD0000;
}

.viewcontrols {
  font-size: small;
  text-align: center;
}

.viewcontrols > a {
  cursor: pointer;
}

/* The direction pad: eight arrows around a toggle button in the middle. The
   five rows and columns match the four dimensions, two per screen axis. */
.controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  max-width: 400px;
  margin: 0 auto 1.5rem auto;
}

.controls > div {
  height: 44px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  border-radius: 0.3rem;
  border: 1px solid #888888;
  background-color: #AAAAAA;
  user-select: none;
}

.controls > div.arrow {
  font-size: 34px;
}

.controls > div:hover {
  background-color: #CCCCCC;
}

.controls > .major-up    { grid-column: 3; grid-row: 1; }
.controls > .minor-up    { grid-column: 3; grid-row: 2; }
.controls > .major-left  { grid-column: 1; grid-row: 3; }
.controls > .minor-left  { grid-column: 2; grid-row: 3; }
.controls > .toggle      { grid-column: 3; grid-row: 3; }
.controls > .minor-right { grid-column: 4; grid-row: 3; }
.controls > .major-right { grid-column: 5; grid-row: 3; }
.controls > .minor-down  { grid-column: 3; grid-row: 4; }
.controls > .major-down  { grid-column: 3; grid-row: 5; }

/* The dead end detection toggle. Lit means on, greyed out and struck through
   means off. */
.controls > .toggle {
  position: relative;
  font-size: 26px;
  color: #103050;
  background-color: #7FD8FF;
  border-color: #3FA8D8;
}

.controls > .toggle:hover {
  background-color: #A8E6FF;
}

.controls > .toggle.off {
  background-color: #DDDDDD;
  border-color: #BBBBBB;
}

/* A slash across the button when detection is off. The cloud is drawn as an
   emoji, and text-decoration does not show up on one, so draw the line. */
.controls > .toggle.off::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 50%;
  border-top: 3px solid #C03030;
  transform: rotate(-30deg);
}

/* Small colour chips used in the prose to name a highlight or a fog colour. */
.swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-right: 0.2em;
  border-radius: 0.2em;
  border: 1px solid #666666;
}

.swatch.here      { background-color: #ffd54a; }
.swatch.jump      { background-color: #4ad9ff; }
.swatch.fog-wall  { background-color: #f5faff; }
.swatch.fog-red   { background-color: #ff5a5a; }
.swatch.fog-green { background-color: #78ff82; }

.toggle-inline {
  display: inline-block;
  padding: 0 0.35em;
  border-radius: 0.2em;
  border: 1px solid #3FA8D8;
  background-color: #7FD8FF;
  color: #103050;
}

.img {
  width: 28px;
  height: 28px;
  background-repeat: no-repeat;
  display: inline-block;
  vertical-align: bottom;
}

.blockImg {
  background-image: url('../images/blocks.png');
}
