/* The pad (pad.js): the circle you draw on, at the picture's real colours, then the palettes, the inks and brushes
 * with Fill, Undo and Clear, and "Use this picture". The colours of a picture come from palettes.js, set on the
 * elements by pad.js; everything else here is the design system's. */

.ds-pad { display: grid; }

/* The circle. Square by its aspect, as wide as the sheet allows up to 264 px. */
.ds-pad-paper {
  position: relative;
  width: min(264px, 100%);
  aspect-ratio: 1;
  margin: 0 auto 20px;
  border-radius: var(--radius-full);
  touch-action: none;
  cursor: crosshair;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.ds-pad-paper > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  touch-action: none;
}
.ds-pad-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1px var(--edge);
  pointer-events: none;
}
.ds-pad-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 500 var(--size-16)/1 var(--type-ui);
  opacity: 0.7;
  pointer-events: none;
  transition: opacity var(--dur-150) var(--ease-standard);
}
.ds-pad-paper[data-used] .ds-pad-hint { opacity: 0; }

/* The palettes: each its ground with its two inks on it. */
.ds-pad-palettes { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 16px; }
.ds-pad-swatch {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1px var(--edge);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-150) var(--ease-standard), box-shadow var(--dur-200) var(--ease-standard);
}
.ds-pad-swatch:active { transform: scale(0.94); }
.ds-pad-swatch > i { position: absolute; top: 13px; width: 10px; height: 10px; border-radius: var(--radius-full); }
.ds-pad-swatch > i:first-child { left: 7px; }
.ds-pad-swatch > i:last-child { right: 7px; }
.ds-pad-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--chrome), 0 0 0 3.5px var(--ink-1); }

/* The inks, the brushes, Fill. */
.ds-pad-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ds-pad-tool {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-12);
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-150) var(--ease-standard), transform var(--dur-150) var(--ease-standard);
}
.ds-pad-tool:active { transform: scale(0.94); }
.ds-pad-tool[aria-pressed="true"] { background: var(--ring-soft); box-shadow: inset 0 0 0 1px var(--edge); }
.ds-pad-tool > i { display: block; border-radius: var(--radius-full); box-shadow: 0 0 0 1.5px var(--edge-strong); }
.ds-pad-tool--ink > i { width: 20px; height: 20px; }
/* A brush's dot and Fill's say size and "fill", not the ink: the sheet's ink-1, whatever ink is chosen. */
.ds-pad-tool--size > i { background: var(--ink-1); box-shadow: none; }
.ds-pad-fill > svg { color: var(--ink-1); }
.ds-pad-rule { width: 1px; height: 20px; background: var(--hair); margin: 0 6px; }
.ds-pad-grow { flex: 1; }

/* Undo, Clear, Back to initials. */
.ds-pad-acts { display: flex; align-items: center; margin: 0 -8px 14px; }

.ds-pad-swatch:focus-visible, .ds-pad-tool:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }
