/* daxAMP - Webamp (https://github.com/captbaritone/webamp) integration.
   Webamp renders and positions its own classic three-window layout
   (main/equalizer/playlist) internally once initialized, each individually
   draggable across the viewport by Webamp itself.
   .daxamp-container spans the full viewport, positioned once via plain
   CSS that never changes afterward - deliberately NOT computed/moved by
   JS after the fact (an earlier version centered it that way, measuring
   Webamp's rendered content after renderInto() resolved and then
   repositioning the container to match). That caused the exact "locks to
   a quadrant, jittery movement" bug reported: renderInto() documents that
   Webamp "positions itself in the center of the given node" at render
   time, and its own internal drag math appears to keep using that
   reference point rather than re-measuring on every drag - moving the
   container out from under it after that reference was already
   established left Webamp's own coordinate system permanently offset
   from where things actually were, which is consistent with movement
   being remapped into a shifted, cropped region instead of the full
   viewport. Fixed by never moving the container after render at all -
   its final position is simply correct from the very first render,
   via plain CSS, so there's nothing for Webamp's internal reference
   point to ever become stale against.
   pointer-events:none on the container and mount themselves, with
   pointer-events:auto restored only on the mount's actual rendered
   children (see further down) - necessary now that this spans the full
   viewport, so empty space around Winamp's own windows stays click-
   through to the desktop and other daxOS windows underneath, while
   Winamp's own rendered UI stays fully interactive. */
.daxamp-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* 100vh on mobile browsers (particularly iOS Safari) is measured
       against the largest possible viewport with browser chrome (address
       bar etc.) collapsed, not the actually-visible area - dvh tracks the
       real, currently-visible viewport instead. Declared after the vh
       fallback (not replacing it) so browsers without dvh support simply
       keep using vh. */
    height: 100dvh;
    z-index: 400;
    pointer-events: none;
}

.daxamp-container.is-hidden {
    display: none;
}

/* Winamp's own skin controls 100% of its appearance and should look
   identical no matter which daxOS theme (Classic/Blue/Dark/XP) happens to
   be active, the same way the real thing looked the same regardless of
   your desktop's own Windows theme. color/font-family/etc. are inherited
   CSS properties though, so without the resets below, whatever a given
   daxOS theme sets further up the tree (on .window, body, etc.) was
   cascading down into any part of Webamp's own markup that doesn't
   happen to set its own explicit value - resetting them to their
   browser-default initial values right at the mount point breaks that
   inheritance chain. No !important here deliberately: this only changes
   the inheritance starting point for whatever Webamp's own elements
   don't explicitly set themselves, so anything Webamp does explicitly
   declare (which is nearly everything, being a fully-skinned UI) simply
   overrides it normally, the same as it would for any inherited CSS
   property.
   position:relative is not part of that reset - it's a hard requirement
   of its own: renderInto() (see webamp-player.js) explicitly validates
   that its target has a non-static position and throws if it doesn't
   ("The DOM node passed to renderInto must have a non-static position"),
   almost certainly because it positions its own sub-windows with
   position:absolute anchored to this element. width/height:100% makes
   this fill the same full-viewport space as its parent container, so
   Webamp's own "center of the given node" initial positioning correctly
   lands in the middle of the real viewport rather than some smaller or
   arbitrary box. */
#daxamp-mount {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: initial;
    font-family: initial;
    font-size: initial;
    font-weight: initial;
    font-style: initial;
    text-align: initial;
    line-height: initial;
    text-shadow: initial;
}

/* Restores interactivity specifically for whatever Webamp actually
   renders as its own top-level content, without making the full-
   viewport mount itself (and the empty space within it) clickable. */
#daxamp-mount > * {
    pointer-events: auto;
}

/* 98.css's own base stylesheet (a separate, third-party file - not
   daxOS's own theme layer, which is instead excluded via
   :not(#daxamp-mount *) directly in themes.css now) styles every
   <button>/<input> on the entire page with a completely unscoped
   selector, forcing a minimum size that broke Winamp's own tiny
   transport buttons and displays. Resetting only the specific
   properties 98.css itself sets (not a blanket "all", and deliberately
   no !important) - #daxamp-mount button/input (ID + element) is already
   more specific than 98.css's own bare "button"/"input" selector, so
   this reliably wins through ordinary CSS specificity alone, without
   needing to fight Webamp's own styling for these same elements the way
   an !important blanket reset would (that approach caused a real
   regression: !important overrides *any* non-important rule regardless
   of which stylesheet it came from, so it was stripping Webamp's own
   legitimate button styling too, not just 98.css's contribution - which
   is what turned Winamp fully unskinned rather than just fixing the
   sizing issue this is actually meant to address). */
#daxamp-mount button,
#daxamp-mount input {
    min-height: initial;
    min-width: initial;
    padding: initial;
    border: initial;
    border-radius: initial;
    box-sizing: initial;
    color: initial;
    text-shadow: initial;
    background: initial;
    box-shadow: initial;
}

#daxamp-message {
    background: #2b2b3a;
    color: #e0e0e0;
    font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
    font-size: 12px;
    padding: 14px 18px;
    border-radius: 4px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    max-width: 275px;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 401;
}

#daxamp-message:empty {
    display: none;
}
