/*
 * Crystal cursor — shared by every Tales of Xdripia vertical (/cursors/).
 *
 * The cursor is a native image, moved by the operating system with no lag.
 * (It used to be a DOM crystal chasing pointermove, always a frame or more
 * behind the real pointer: "doughy".) Three states: resting, clickable (gold
 * ring) and pressed. Hotspot = the crystal's tip, 12 12.
 *
 * Deliberately NOT forced on every element: cursors that mean something —
 * grab, crosshair, zoom-in, resize, text, none — are left alone. Only what a
 * page marks as "pointer" becomes the crystal: interactive elements here,
 * stylesheet rules and 3D hover cursors through crystal-cursor.js.
 * Only fine pointers get it: the script sets html[data-crystal-cursor].
 */

html[data-crystal-cursor='on'] {
  cursor: url('/cursors/crystal.png') 12 12, auto;
  cursor: image-set(url('/cursors/crystal.png') 1x, url('/cursors/crystal@2x.png') 2x) 12 12, auto;
}

html[data-crystal-cursor='on'] :is(a[href], button, [role='button'], summary, select, label[for], [onclick], .clickable, input:is([type='checkbox'], [type='radio'], [type='button'], [type='submit'], [type='reset'], [type='color'], [type='file'])),
html[data-crystal-cursor='on'] :is(a[href], button, [role='button'], summary, [onclick], .clickable) :not(input, textarea, [contenteditable='true']) {
  cursor: url('/cursors/crystal-hot.png') 12 12, pointer;
  cursor: image-set(url('/cursors/crystal-hot.png') 1x, url('/cursors/crystal-hot@2x.png') 2x) 12 12, pointer;
}

html[data-crystal-cursor='on'] :is(a[href], button, [role='button'], summary, label[for], [onclick], .clickable):active,
html[data-crystal-cursor='on'] :is(a[href], button, [role='button'], summary, [onclick], .clickable):active :not(input, textarea, [contenteditable='true']) {
  cursor: url('/cursors/crystal-pressed.png') 12 12, pointer;
  cursor: image-set(url('/cursors/crystal-pressed.png') 1x, url('/cursors/crystal-pressed@2x.png') 2x) 12 12, pointer;
}

html[data-crystal-cursor='on'] :is(input:not([type='checkbox'], [type='radio'], [type='button'], [type='submit'], [type='reset'], [type='range'], [type='color'], [type='file'], [type='image']), textarea, [contenteditable='true'], [contenteditable='true'] *) {
  cursor: text;
}

html[data-crystal-cursor='on'] :is(button, input, select, textarea):disabled,
html[data-crystal-cursor='on'] :is([aria-disabled='true'], [aria-disabled='true'] *) {
  cursor: url('/cursors/crystal.png') 12 12, not-allowed;
  cursor: image-set(url('/cursors/crystal.png') 1x, url('/cursors/crystal@2x.png') 2x) 12 12, not-allowed;
}
