/* Sand: the material picker, brush sizes and box cursor. Everything scoped to .toy.sand */

.toy.sand .sand-box {
  -webkit-touch-callout: none;
}

.toy.sand .sand-box.scr-live {
  cursor: crosshair;
}

/* material picker: a row of labelled checkboxes, the chosen one raised like a key */
.toy.sand .sand-mats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  max-width: 640px;
}

.toy.sand .sand-mat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 9px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink-2);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.toy.sand .sand-mat:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.toy.sand .sand-mat.on {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line);
  box-shadow: 3px 3px 0 var(--line);
  transform: translate(-1px, -1px);
}

.toy.sand .sand-mat input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.toy.sand .sand-mat kbd {
  font: inherit;
  font-size: 10px;
  color: var(--ink-3);
}

@media (hover: none) and (pointer: coarse) {
  .toy.sand .sand-mat kbd {
    display: none;
  }
}

/* brush sizes: three keys, each checkbox as big as the brush; the chosen key is raised like a material */
.toy.sand .sand-brush {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  font-size: 13px;
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
}

.toy.sand .sand-sizes {
  display: inline-flex;
  gap: 4px;
}

.toy.sand .sand-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.toy.sand .sand-size:hover {
  border-color: var(--ink-3);
}

.toy.sand .sand-size.on {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 3px 3px 0 var(--line);
  transform: translate(-1px, -1px);
}

.toy.sand .sand-size input {
  margin: 0;
  cursor: pointer;
}

.toy.sand .sand-size.s1 input {
  width: 11px;
  height: 11px;
}

.toy.sand .sand-size.s2 input {
  width: 16px;
  height: 16px;
}

.toy.sand .sand-size.s3 input {
  width: 22px;
  height: 22px;
}

/* phones: the six materials as an even 3 × 2 grid instead of a ragged wrap */
@media (max-width: 520px) {
  .toy.sand .sand-mats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 360px;
  }
  .toy.sand .sand-mat {
    padding: 8px 10px;
  }
}

/* Pause ↔ Play without the row jumping */
.toy.sand .sand-pause {
  min-width: 84px;
}

@media (prefers-reduced-motion: reduce) {
  .toy.sand .sand-mat,
  .toy.sand .sand-size {
    transition: none;
  }
}
