/* Maze — the board and its controls. Shared chrome: artifact.css */

:root {
  --field-size: 28rem;
  --column-gap: clamp(1.5rem, 5vw, 3rem);
}

.board {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--column-gap);
  align-items: center;
}

.board__field {
  width: min(100%, var(--field-size));
  /*
   * The view looks down at an angle, so depth is foreshortened and a square
   * canvas would show far more of it than of width — nearly two squares' worth
   * of nothing. This is the shape of what the camera actually covers.
   */
  aspect-ratio: 13 / 10;
  margin-inline: auto;
  /* Taps and swipes belong to the maze; a vertical drag still scrolls. */
  touch-action: pan-y;
  cursor: pointer;
}

.board__field canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.board__side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--column-gap);
  width: min(100%, var(--field-size));
  margin-inline: auto;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

/* Inventory --------------------------------------------------------------- */

.carrying {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 1.6rem;
}

/* A little larger here than in the legend, to hold their own beside the tallies. */
.carrying .mark {
  width: 1.05rem;
  height: 1.05rem;
}

.carrying .mark--ring {
  border-width: 0.25rem;
}

.carrying:empty::before,
.carrying__nothing {
  content: '—';
  color: var(--ink-faint);
}

/* Legend ----------------------------------------------------------------- */

.legend__heading {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

.legend__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* The shapes echo the board: a block, a ring, a diamond, a disc, a plate.
   Shared, because the legend explains them and the inventory carries them. */
.mark {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  background: var(--mark);
}

.mark--block {
  border-radius: 0.2rem;
}

/*
 * A door is a block of its own on the board — taller than the walls and wider
 * than the kit it would otherwise be mistaken for, so its mark is taller and
 * wider here too.
 */
.mark--gate {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.22rem;
}

.mark--lever {
  width: 0.5rem;
  height: 1rem;
  border-radius: 0.25rem;
}

.mark--bar {
  width: 1.1rem;
  height: 0.38rem;
  border-radius: 0.19rem;
}

.mark--plate {
  border-radius: 0.15rem;
  height: 0.55rem;
}

.mark--ring {
  background: none;
  border: 0.2rem solid var(--mark);
  border-radius: 50%;
}

.mark--disc {
  border-radius: 50%;
  height: 0.6rem;
}

.mark--diamond {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.1rem;
  rotate: 45deg;
}

@media (max-width: 47.99rem) {
  .game {
    gap: 1.25rem;
  }

  .board {
    gap: 1rem;
  }

  .board__field {
    /* Capped against the viewport height, so the maze and the buttons share a screen. */
    width: min(100%, calc(40vh * 13 / 10));
  }

  /* Steps and treasure read as a bar above the maze, within reach of a thumb. */
  .board__side {
    order: -1;
  }

  .controls {
    align-items: center;
    align-self: stretch;
  }

  .legend__list {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .status {
    min-height: 1.4em;
    text-align: center;
  }
}

@media (min-width: 48rem) {
  .board {
    grid-template-columns: var(--field-size) minmax(0, 1fr);
  }

  .board__side {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    margin-inline: 0;
    gap: 2.25rem;
  }

  .scores {
    gap: 2.5rem;
  }
}
