/* Sketchpad — the writing-practice canvas on kana/kanji teaching cards (#49).
   Layout only; every colour is a token (decision 0008). The canvas reads its
   ink from `color` and its guide lines from `border-color` at paint time, so
   the theme owns both. */

.sketch{
  margin:14px auto 0;
  max-width:260px;
  text-align:left;
}
.sketch-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
  flex-wrap:wrap;
}
.sketch-label{
  font-size:12px;
  color:var(--dim);
}
.sketch-btns{
  display:flex;
  gap:6px;
}
/* #138: keep the pad's controls at or above the touch-target minimum even
   where .btn.sm is tighter. */
.sketch-btns .btn{min-height:24px}
.sketch-pad{
  display:block;
  width:100%;
  aspect-ratio:1;
  color:var(--ink);
  background:var(--panel2);
  border:1px dashed var(--line);
  border-radius:10px;
  /* Drawing IS the gesture here — without this, a touch drag scrolls. */
  touch-action:none;
  cursor:crosshair;
}

/* ---- the pad as a tracing stage (wireframe 10a) ------------------------
   The ghost glyph sits UNDER the canvas rather than being painted into it:
   it is type, so it belongs to the stylesheet and to the theme, and the
   canvas stays a surface for the learner's ink alone. */
.sketch-stage{position:relative;display:grid}
.sketch-stage>*{grid-area:1/1}
.sketch-ghost{
  display:grid;place-items:center;
  font-size:clamp(72px,42cqw,132px);line-height:1;
  color:var(--line);
  pointer-events:none;user-select:none;
}
.sketch.has-ghost{container-type:inline-size}

/* The attempt stamps. "Write it two or three times" is the instruction the
   card already gives; these count that, and nothing else. */
.sketch-stars{display:inline-flex;align-items:center;gap:6px}
.sketch-stars i{font-style:normal}
.sketch-stars b{letter-spacing:2px;color:var(--accent);font-weight:400}
