/* Player pages only. Native CSS cursors; no overlay or event handling. */
@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  :root:where(:not(:has(:fullscreen))) {
    --lb-naiwa-arrow: url("/naiwa-cursors/normal_select.cur") 2 2, url("/naiwa-cursors/normal_select.png") 2 2;
    --lb-naiwa-link: url("/naiwa-cursors/link_select.cur") 2 2, url("/naiwa-cursors/link_select.png") 2 2;
    --lb-naiwa-text: url("/naiwa-cursors/text_select.cur") 16 16, url("/naiwa-cursors/text_select.png") 16 16;
    --lb-naiwa-disabled: url("/naiwa-cursors/unavailable.cur") 16 15, url("/naiwa-cursors/unavailable.png") 16 15;
    cursor: var(--lb-naiwa-arrow), auto;
  }

  /* Replace the existing front-end pointer treatment, but never the pack drag handles. */
  :root:where(:not(:has(:fullscreen))) body
    :is(a[href], button:enabled, summary, [role="button"], [role="link"], [role="tab"]):not(:where(
      :disabled, [aria-disabled="true"], [aria-disabled="true"] *, [aria-busy="true"], [aria-busy="true"] *,
      [data-lb-auth-unavailable], [data-checking], [data-checking] *, [inert], [inert] *,
      [draggable="true"], [draggable="true"] *,
      :is(.tear-control, .hero-card, .prism-tear, .prism-stack, .lbPullRevealLatch),
      :is(.tear-control, .hero-card, .prism-tear, .prism-stack, .lbPullRevealLatch) *
    )) {
    cursor: var(--lb-naiwa-link), pointer;
  }
}

/* Lower priority than page-defined busy, drag, text, and other special cursors. */
@layer lb-naiwa-defaults {
  @media (hover: hover) and (pointer: fine) and (forced-colors: none) {
    :root:where(:not(:has(:fullscreen))) :where(
      select, option, label, input, textarea, [draggable="true"], [inert],
      [aria-busy="true"], [data-checking],
      .tear-control, .hero-card, .prism-tear, .prism-stack, .lbPullRevealLatch
    ) {
      cursor: auto;
    }

    /* Use the text cursor only in editable fields. Display copy inherits its cursor. */
    :root:where(:not(:has(:fullscreen))) :where(
      textarea:not(:disabled),
      input:not(:disabled):is(:not([type]), [type="text" i], [type="search" i], [type="email" i],
        [type="password" i], [type="url" i], [type="tel" i]),
      [contenteditable]:not([contenteditable="false" i])
    ):not(:where([aria-disabled="true"], [aria-disabled="true"] *, [inert], [inert] *)) {
      cursor: var(--lb-naiwa-text), text;
    }

    :root:where(:not(:has(:fullscreen))) :where(:disabled, [aria-disabled="true"]) {
      cursor: var(--lb-naiwa-disabled), not-allowed;
    }
  }
}
