/* User-authored illustrations: functional page content, never frame geometry. */
.board-object[data-kind='sticker'] {
  position: absolute; display: block; box-sizing: border-box; z-index: 2;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
  max-width: none; min-width: 24px; line-height: 0; box-shadow: none;
  cursor: grab; touch-action: none; user-select: none;
}
.board-object[data-kind='sticker'] > .object-body {
  display: block; width: 100%; height: 100%; overflow: visible;
  padding: 0; border: 0; background: none;
}
.board-object[data-kind='sticker'] img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.board-object[data-kind='sticker']:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
.board-object[data-kind='sticker'][data-sticker-locked='true'] { pointer-events: none; cursor: default; }
.board-object[data-kind='sticker'][data-sticker-locked='true'] > .object-resize { display: none; }
.sticker-controls {
  position: absolute; display: none; z-index: 8; bottom: calc(100% + 7px); left: 0;
  align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--paper); box-shadow: 0 2px 5px rgb(0 0 0 / .12);
  white-space: nowrap; pointer-events: auto; line-height: normal;
}
.board-object[data-kind='sticker'].is-picked > .sticker-controls,
.board-object[data-kind='sticker']:focus-within > .sticker-controls { display: flex; }
.sticker-action { min-height: 28px; padding: 4px 7px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); font: 600 11px/1.2 'DM Sans', sans-serif; }
.sticker-action:hover, .sticker-action:focus-visible { background: var(--c93); outline: 2px solid var(--focus); }
.board-object[data-kind='sticker'] > .object-remove { pointer-events: auto; }
.board-object[data-kind='sticker'].is-picked > .object-remove { display: grid; }
.board-object[data-kind='sticker'].is-picked > .object-resize { opacity: 1; }
body[data-ink='on'] .board-object[data-kind='sticker'] { pointer-events: none; }
body[data-ink='on'] .board-object[data-kind='sticker'] :is(.sticker-controls, .object-resize, .object-remove) { display: none; }

.sticker-dialog { width: min(570px, calc(100vw - 24px)); }
.sticker-library-body { max-height: 65vh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
.placed-sticker-section h3 { margin: 0 0 8px; color: var(--ink); font: 650 13px/1.4 'DM Sans', sans-serif; }
.sticker-upload { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.sticker-upload:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.placed-sticker-section { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sticker-help { margin: 4px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.placed-sticker { display: flex; align-items: center; gap: 8px; min-height: 46px; }
.placed-sticker img { width: 32px; height: 36px; object-fit: contain; }
.placed-sticker button { min-height: 40px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 5px 10px; font: 12px/1.3 'DM Sans', sans-serif; }
.placed-sticker button:first-of-type { flex: 1; text-align: left; }
.placed-sticker button:focus-visible { outline: 2px solid var(--focus); }
@media (max-width: 480px) {
  .sticker-library-body { padding: 12px 16px; }
}
@media (pointer: coarse), (max-width: 720px) {
  .sticker-action, .placed-sticker button { min-height: 44px; }
  .board-object[data-kind='sticker'] > .object-resize { width: 28px; height: 28px; right: -10px; bottom: -10px; }
  .board-object[data-kind='sticker'] > .object-remove { width: 28px; height: 28px; }
}

/* Broad, very faint eraser ghosts supplement grain; all are pointer-transparent.
   No outline, rectangular fade, or large repeating spot pattern is introduced. */
.chalk-dust-layer { display: none; }
body[data-paper='chalkboard'] .chalk-dust-layer {
  position: absolute; z-index: 1; inset: 0; display: block;
  pointer-events: none; border-radius: var(--world-board-radius, 7px); overflow: hidden;
  opacity: .42;
  background-image:
    radial-gradient(ellipse at 21% 22%, rgb(252 245 224 / .12), transparent 42%),
    radial-gradient(ellipse at 68% 63%, rgb(252 245 224 / .09), transparent 36%),
    radial-gradient(ellipse at 41% 91%, rgb(252 245 224 / .08), transparent 26%);
}
body[data-visual-theme='classic'][data-paper='chalkboard'] .chalk-dust-layer::after {
  content: ''; position: absolute; inset: 0; opacity: .24;
  background: url('./assets/sketch-worlds/chalk-grain.png') 0 0 / 384px 384px repeat;
}
@media print {
  .sticker-controls, .sticker-dialog, .chalk-dust-layer { display: none !important; }
  .board-object[data-kind='sticker'] { outline: 0 !important; border: 0 !important; background: none !important; }
}
