.mj-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.mj-board-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 3px var(--color-border);
  background: var(--color-bg-alt);
  padding: 14px;
  display: flex;
  justify-content: flex-start; /* see .mj-board margin:auto */
}

.mj-board {
  position: relative;
  flex-shrink: 0;
  /* margin:auto centres a board narrower than its container, but (unlike justify-content:center on the parent) lets a WIDER board
     start at the left edge and scroll. Centred overflow used to clip the left part of the board out of reach on phones. */
  margin: 0 auto;
}

.mj-tile {
  position: absolute;
  width: 38px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #fdf6e3 0%, #f0e6cc 100%);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 4px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease;
}

.mj-tile:hover:not(:disabled) {
  transform: translateY(-2px);
}

.mj-tile--locked {
  filter: brightness(0.55) saturate(0.7);
  cursor: not-allowed;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 2px 3px rgba(0, 0, 0, 0.25);
}

.mj-tile--selected {
  outline: 3px solid var(--color-accent, #ee6fa8);
  outline-offset: 1px;
  transform: translateY(-3px);
}

.mj-tile--hint {
  outline: 3px solid #4fd8e0;
  outline-offset: 1px;
  animation: mj-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes mj-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.35); }
}

.mj-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 480px) {
  .mj-tile { width: 32px; height: 42px; font-size: 16px; }
  /* every board is wider than a phone, so say so: it scrolls sideways inside its frame */
  .mj-wrap::before {
    content: "\2194  Swipe the board sideways to see every tile";
    order: -1;
    font-size: 0.8rem;
    color: var(--color-text-soft);
  }
}
