/* KARTA 1.5.6 — Visible native laptop pointer above every game dialog.
   The site's decorative cursor lives in the document stacking context,
   while showModal() dialogs live in the browser's top layer.  Force the
   actual OS pointer in these contexts instead of drawing it underneath. */

/* :has() is supported by the game's current desktop browsers.  The modal
   itself has an independent fallback below so it also works without :has(). */
html:has(#karta-stadium-test):has(dialog[open]),
html:has(#karta-stadium-test):has(dialog[open]) body {
  cursor:default !important;
}

/* Includes the friends dialog (appended directly to body), ranked picker,
   room browser, settings, rules, store, result, player, and bankruptcy dialogs. */
html:has(#karta-stadium-test) dialog[open],
html:has(#karta-stadium-test) dialog[open] *,
#karta-friends1500,
#karta-friends1500 *,
#karta-stadium-test dialog[open],
#karta-stadium-test dialog[open] * {
  cursor:default !important;
}

/* Hover states remain familiar and functional.  Do not force 'pointer' on
   disabled controls, and keep a text insertion cursor over editable fields. */
html:has(#karta-stadium-test) dialog[open] :is(button:not(:disabled), a[href], summary, select:not(:disabled), [role="button"], label[for], input[type="checkbox"], input[type="radio"]),
#karta-friends1500 :is(button:not(:disabled), a[href], summary, select:not(:disabled), [role="button"], label[for]),
#karta-stadium-test dialog[open] :is(button:not(:disabled), a[href], summary, select:not(:disabled), [role="button"], label[for]) {
  cursor:pointer !important;
}
html:has(#karta-stadium-test) dialog[open] :is(input:not([type="button"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, [contenteditable="true"]),
#karta-friends1500 :is(input:not([type="button"]):not([type="submit"]), textarea, [contenteditable="true"]),
#karta-stadium-test dialog[open] :is(input:not([type="button"]):not([type="submit"]), textarea, [contenteditable="true"]) {
  cursor:text !important;
}

/* Non-native overlays are not in the browser's top layer, but should also
   retain the OS cursor on the card, quiz, jail and auction controls. */
#karta-stadium-test :is(.game-state-modal-wrap.active, .game-state-modal-wrap.active *, .auction-popup-card, .auction-popup-card *, .karta-team-bankruptcy-v152, .karta-team-bankruptcy-v152 *) {
  cursor:default !important;
}
#karta-stadium-test :is(.game-state-modal-wrap.active, .auction-popup-card, .karta-team-bankruptcy-v152) :is(button:not(:disabled), [role="button"], a[href], label[for], select:not(:disabled)) {
  cursor:pointer !important;
}
#karta-stadium-test :is(.game-state-modal-wrap.active, .auction-popup-card, .karta-team-bankruptcy-v152) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea) {
  cursor:text !important;
}

/* The fake theme cursor cannot be placed above a native <dialog> top layer.
   Hide it while a KARTA dialog is open; the actual OS pointer stays visible. */
html:has(#karta-stadium-test):has(dialog[open]) :is(.custom-cursor, #custom-cursor, .cursor-dot, #cursor-dot, .cursor-outline, #cursor-outline, .mouse-cursor, .mouse-follower, .cursor-follower) {
  display:none !important;
}
