/* Obcoro cursors. Pixel art lives in assets/cursors/src (Aseprite). :where() keeps specificity at 0, so a page's own cursor (grab, crosshair, wait, default, inline JS) wins.
   Click and trail effects stay off on /games/<slug>/ play pages (see cursor.js).
   Hotspots: arrow 0 0, pointer 7 1, text 11 12 (CSS px of the 24px image). */
:root { --ob-cursor-arrow: auto; --ob-cursor-pointer: pointer; --ob-cursor-text: text; }

@media (hover: hover) and (pointer: fine) {
  :root {
    --ob-cursor-arrow: url("/assets/cursors/arrow.png") 0 0, default;
    --ob-cursor-pointer: url("/assets/cursors/pointer.png") 7 1, pointer;
    --ob-cursor-text: url("/assets/cursors/text.png") 11 12, text;
  }
  @supports (cursor: image-set(url("/x.png") 1x) 0 0, auto) {
    :root {
      --ob-cursor-arrow: image-set(url("/assets/cursors/arrow.png") 1x, url("/assets/cursors/arrow@2x.png") 2x) 0 0, default;
      --ob-cursor-pointer: image-set(url("/assets/cursors/pointer.png") 1x, url("/assets/cursors/pointer@2x.png") 2x) 7 1, pointer;
      --ob-cursor-text: image-set(url("/assets/cursors/text.png") 1x, url("/assets/cursors/text@2x.png") 2x) 11 12, text;
    }
  }

  /* :where() keeps specificity at 0, so a page's own cursor rule (wait, default, ...) always wins. */
  :where(html) { cursor: var(--ob-cursor-arrow); }
  :where(a[href], button:not(:disabled), summary, label[for], select, [role="button"], [role="link"],
    input:is([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]):not(:disabled)) {
    cursor: var(--ob-cursor-pointer);
  }
  :where(input:not([type]), input:is([type="text"], [type="search"], [type="email"], [type="url"], [type="tel"], [type="number"], [type="password"]), textarea, [contenteditable=""], [contenteditable="true"]):not(:disabled) {
    cursor: var(--ob-cursor-text);
  }
  :where(button:disabled, input:disabled, textarea:disabled, select:disabled, [aria-disabled="true"]) { cursor: var(--ob-cursor-arrow); }

  /* Chrome buttons in fx.css / leaderboard.css use cursor:pointer at higher specificity than :where(). */
  html .gfx-actions button,
  html .gp-fake,
  html .gfx-mute,
  html .lb-tools [data-lb-open],
  html .lb-tools [data-lb-exit],
  html .lb-panel button:not(:disabled) {
    cursor: var(--ob-cursor-pointer);
  }
}

.ob-cursor-fx { position: fixed; inset: 0; z-index: 2147483000; overflow: hidden; pointer-events: none; contain: strict; }
.ob-cursor-fx i { position: absolute; left: 0; top: 0; width: 3px; height: 3px; background: #70f995; opacity: 0; will-change: transform, opacity; }
.ob-cursor-fx i[data-tone="bright"] { background: #9affb1; }
.ob-cursor-fx i[data-tone="accent"] { background: #fa785c; }
:root[data-ob-motion="off"] .ob-cursor-fx { display: none; }