/* Crossing — the field 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));
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  /* Taps and holds belong to the board; 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;
}

/* Marking is a mode, so it has to look switched on. */
.button[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

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

  .board {
    gap: 1rem;
  }

  .board__field {
    /* Capped against the viewport height, so the field and the buttons share a screen. */
    width: min(100%, 42vh);
  }

  /* Hops and mines read as a bar above the field, within reach of a thumb. */
  .board__side {
    order: -1;
  }

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

  .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;
  }
}
