/* OVHM.net XP cursor set (drawn for this site, images/cursors/*.png, 32 px + @2x).
   Every page links this file after its own CSS. Mouse and trackpad only: phones never load the images.
   Rules carry a :root prefix so they outrank the page CSS (desktop.css, 98.css, jquery-ui, archivum inline)
   without !important, which would block the busy/working animation on the root (js/xp-cursors.js). */
@media (any-pointer: fine) {
  /* Normal select: inherited by everything that does not set its own cursor */
  :root {
    cursor: url(/images/cursors/arrow.png?v=1) 0 0, default;
    cursor: image-set(url(/images/cursors/arrow.png?v=1) 1x, url(/images/cursors/arrow@2x.png?v=1) 2x) 0 0, default;
  }

  /* Page CSS sets a plain arrow here; inherit instead so the busy/working hourglass shows through */
  :root #enter,
  :root #desktop h4.tfx,
  :root #toolbar .toolbar-start-menu .start-menu-wrapper .start-menu li.start-menu-separator,
  :root .w98 .xp-combo-btn,
  :root .xp-combo-list li,
  :root .ui-autocomplete,
  :root .ui-slider .ui-slider-handle,
  :root .ui-spinner-button { cursor: inherit; }

  /* Link select: everything clickable */
  :root a[href],
  :root area[href],
  :root button,
  :root [role=button],
  :root [role^=menuitem],
  :root summary,
  :root select,
  :root [onclick],
  :root [data-act],
  :root [data-href],
  :root label[for],
  :root input[type=checkbox],
  :root input[type=radio],
  :root input[type=range],
  :root input[type=file],
  :root input::file-selector-button,
  :root input[type=submit],
  :root input[type=button],
  :root input[type=reset],
  :root input[type=color],
  :root input[type=image],
  :root .desktop-icons .desktop-icon,
  :root .desktop-icons .auth-icons .desktop-icon,
  :root #toolbar .toolbar-start-menu .start-menu-wrapper .start-menu li,
  :root #toolbar .toolbar-right img,
  :root #volume .status-bar .status-bar-field,
  :root #volume:not(.np-expanded) .np,
  :root #volume.np-expanded .title-bar,
  :root #range26,
  :root #wmpSeek,
  :root .wmp-vol-range,
  :root .w98 button,
  :root .w98 select,
  :root .w98 input[type=checkbox] + label,
  :root .w98 .wmp-info-head,
  :root .card,
  :root table.interactive > tbody > tr,
  :root .ui-button,
  :root .ui-menu .ui-menu-item,
  :root .ui-accordion .ui-accordion-header {
    cursor: url(/images/cursors/hand.png?v=1) 5 0, pointer;
    cursor: image-set(url(/images/cursors/hand.png?v=1) 1x, url(/images/cursors/hand@2x.png?v=1) 2x) 5 0, pointer;
  }

  /* Close: every X and "Bezárás" */
  :root button[aria-label=Close],
  :root .w98 .title-bar-controls button[aria-label=Close],
  :root .window .title-bar .title-bar-controls button[aria-label=Close],
  :root [data-cmd=close],
  :root .w98 [data-cmd=close],
  :root [onclick^=hidePopup],
  :root [data-act=hidePopup],
  :root .ui-dialog-titlebar-close {
    cursor: url(/images/cursors/close.png?v=1) 0 0, pointer;
    cursor: image-set(url(/images/cursors/close.png?v=1) 1x, url(/images/cursors/close@2x.png?v=1) 2x) 0 0, pointer;
  }

  /* Help select: keyboard shortcuts and About */
  :root [data-cmd=keys],
  :root [data-cmd=about],
  :root .w98 [data-cmd=keys],
  :root .w98 [data-cmd=about],
  :root abbr[title] {
    cursor: url(/images/cursors/help.png?v=1) 0 0, help;
    cursor: image-set(url(/images/cursors/help.png?v=1) 1x, url(/images/cursors/help@2x.png?v=1) 2x) 0 0, help;
  }

  /* Text select */
  :root input:not([type]),
  :root input[type=text],
  :root input[type=password],
  :root input[type=email],
  :root input[type=search],
  :root input[type=url],
  :root input[type=tel],
  :root input[type=number],
  :root textarea,
  :root [contenteditable]:not([contenteditable=false]) {
    cursor: url(/images/cursors/ibeam.png?v=1) 4 8, text;
    cursor: image-set(url(/images/cursors/ibeam.png?v=1) 1x, url(/images/cursors/ibeam@2x.png?v=1) 2x) 4 8, text;
  }

  /* Move: draggable title bars (not while maximized or full screen) */
  :root .window.draggable > .title-bar,
  :root .tos-window .title-bar,
  :root .ui-draggable .ui-dialog-titlebar,
  :root .ui-draggable-dragging,
  :root .ui-draggable-dragging *,
  :root .wmp:not(.max):not(.fs) > .title-bar,
  :root .wmp:not(.max):not(.fs) > .title-bar .title-bar-text {
    cursor: url(/images/cursors/move.png?v=1) 15 15, move;
    cursor: image-set(url(/images/cursors/move.png?v=1) 1x, url(/images/cursors/move@2x.png?v=1) 2x) 15 15, move;
  }

  /* The title-bar buttons stay what they are */
  :root .window.draggable > .title-bar button,
  :root .tos-window .title-bar button,
  :root .wmp > .title-bar button {
    cursor: url(/images/cursors/hand.png?v=1) 5 0, pointer;
    cursor: image-set(url(/images/cursors/hand.png?v=1) 1x, url(/images/cursors/hand@2x.png?v=1) 2x) 5 0, pointer;
  }

  :root .window.draggable > .title-bar button[aria-label=Close],
  :root .tos-window .title-bar button[aria-label=Close],
  :root .wmp > .title-bar button[aria-label=Close] {
    cursor: url(/images/cursors/close.png?v=1) 0 0, pointer;
    cursor: image-set(url(/images/cursors/close.png?v=1) 1x, url(/images/cursors/close@2x.png?v=1) 2x) 0 0, pointer;
  }

  /* Resize */
  :root .ui-resizable-n,
  :root .ui-resizable-s {
    cursor: url(/images/cursors/ns.png?v=1) 15 15, ns-resize;
    cursor: image-set(url(/images/cursors/ns.png?v=1) 1x, url(/images/cursors/ns@2x.png?v=1) 2x) 15 15, ns-resize;
  }
  :root .ui-resizable-e,
  :root .ui-resizable-w {
    cursor: url(/images/cursors/ew.png?v=1) 15 15, ew-resize;
    cursor: image-set(url(/images/cursors/ew.png?v=1) 1x, url(/images/cursors/ew@2x.png?v=1) 2x) 15 15, ew-resize;
  }
  :root .ui-resizable-se,
  :root .ui-resizable-nw {
    cursor: url(/images/cursors/nwse.png?v=1) 15 15, nwse-resize;
    cursor: image-set(url(/images/cursors/nwse.png?v=1) 1x, url(/images/cursors/nwse@2x.png?v=1) 2x) 15 15, nwse-resize;
  }
  :root .ui-resizable-sw,
  :root .ui-resizable-ne {
    cursor: url(/images/cursors/nesw.png?v=1) 15 15, nesw-resize;
    cursor: image-set(url(/images/cursors/nesw.png?v=1) 1x, url(/images/cursors/nesw@2x.png?v=1) 2x) 15 15, nesw-resize;
  }

  /* Unavailable: disabled controls */
  :root button:disabled,
  :root input:disabled,
  :root select:disabled,
  :root textarea:disabled,
  :root [aria-disabled=true],
  :root .ui-state-disabled,
  :root .w98 button:disabled,
  :root #wmpSeek:disabled,
  :root #wmpSeek:disabled,
  :root .wmp > .title-bar button:disabled,
  :root .window.draggable > .title-bar button:disabled {
    cursor: url(/images/cursors/no.png?v=1) 15 15, not-allowed;
    cursor: image-set(url(/images/cursors/no.png?v=1) 1x, url(/images/cursors/no@2x.png?v=1) 2x) 15 15, not-allowed;
  }

  /* Full-screen video hides the pointer after a few idle seconds (archivum/wmp.js) */
  :root .wmp.fs.idle, :root .wmp.fs.idle * { cursor: none; }

  /* Busy (hourglass) while a page loads or navigates away; working in background (arrow + hourglass)
     while a request or a video buffers. js/xp-cursors.js sets the classes. */
  @keyframes xp-busy {
    0.0% { cursor: url(/images/cursors/busy-0.png?v=1) 15 14, wait; }
    12.5% { cursor: url(/images/cursors/busy-1.png?v=1) 15 14, wait; }
    25.0% { cursor: url(/images/cursors/busy-2.png?v=1) 15 14, wait; }
    37.5% { cursor: url(/images/cursors/busy-3.png?v=1) 15 14, wait; }
    50.0% { cursor: url(/images/cursors/busy-4.png?v=1) 15 14, wait; }
    62.5% { cursor: url(/images/cursors/busy-5.png?v=1) 15 14, wait; }
    75.0% { cursor: url(/images/cursors/busy-6.png?v=1) 15 14, wait; }
    87.5% { cursor: url(/images/cursors/busy-7.png?v=1) 15 14, wait; }
  }
  @keyframes xp-working {
    0.0% { cursor: url(/images/cursors/working-0.png?v=1) 0 0, progress; }
    12.5% { cursor: url(/images/cursors/working-1.png?v=1) 0 0, progress; }
    25.0% { cursor: url(/images/cursors/working-2.png?v=1) 0 0, progress; }
    37.5% { cursor: url(/images/cursors/working-3.png?v=1) 0 0, progress; }
    50.0% { cursor: url(/images/cursors/working-4.png?v=1) 0 0, progress; }
    62.5% { cursor: url(/images/cursors/working-5.png?v=1) 0 0, progress; }
    75.0% { cursor: url(/images/cursors/working-6.png?v=1) 0 0, progress; }
    87.5% { cursor: url(/images/cursors/working-7.png?v=1) 0 0, progress; }
  }
  /* Only the root animates (no other animation is touched); everything that inherits shows it.
     Clickable things keep their own cursor, as in XP. */
  :root.xp-working { animation: xp-working 1.2s step-end infinite; }
  :root.xp-busy { animation: xp-busy 1.2s step-end infinite; }
}
