/*
01-player-shell-base.css
→ player variables and fixed shell foundation

02-player-shell-layout-desktop.css
→ desktop player layout

03-player-shell-controls.css
→ shared and desktop control appearance only

04-player-shell-progress.css
→ shared and desktop progress bar

05-player-shell-visualizer.css
→ shared visualizer animation

06-player-shell-queue-drawer.css
→ queue drawer and queue rows

07-player-shell-responsive.css
→ tablet adaptation only, 761px–980px

08-player-shell-mobile.css
→ everything at 760px and below
*/
/* =====================================================
   WILDVERSE PLAYER SHELL — MOBILE
   File:
   assets/css/player-shell/08-player-shell-mobile.css

   Ownership:
   - compact mobile player layout
   - flat mobile controls
   - mobile album cover
   - continuous title marquee
   - thin progress line
   - full-bar visualizer background
   - mobile queue drawer sizing
   - mobile ad-overlay safety
===================================================== */

@media (max-width: 760px) {
  /* -------------------------------------------------
     Shell
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    z-index: 999 !important;

    width: 100vw !important;
    max-width: 100vw !important;

    transform: translateX(-50%) !important;

    pointer-events: none !important;

    --wv-mobile-title-gap: 36px;
    --wv-mobile-icon-size: 1.1rem;
  }

  #wvNowDeck.wv-player-shell .wv-player-bar,
  #wvNowDeck.wv-player-shell #wvQueueDrawer {
    pointer-events: auto !important;
  }

  /* -------------------------------------------------
     Compact bar layout
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-player-bar {
    position: relative;

    display: grid;
    grid-template-columns:
      44px
      minmax(0, 1fr)
      auto;

    grid-template-rows:
      27px
      27px
      3px;

    grid-template-areas:
      "cover track controls"
      "cover track tools"
      "progress progress progress";

    align-items: center;
    gap: 0 0.5rem;

    width: 100%;
    min-height: 70px;

    padding:
      0.38rem
      0.5rem
      max(0.3rem, env(safe-area-inset-bottom));

    border-radius: 0;
    overflow: hidden;
  }

  /*
   * Allows cover, metadata and transport to participate
   * directly in the outer mobile grid.
   */
  #wvNowDeck.wv-player-shell .wv-player-main {
    display: contents;
  }

  /* -------------------------------------------------
     Album cover
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-player-bar__cover {
    grid-area: cover;

    position: relative;
    z-index: 3;

    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 9px;
  }

  /* -------------------------------------------------
     Track title and count
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-player-now {
    grid-area: track;

    position: relative;
    z-index: 3;

    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;

    overflow: hidden;
  }

  #wvNowDeck.wv-player-shell #wvNowCount {
    display: block;

    margin-top: 0.12rem;

    overflow: hidden;

    font-size: 0.58rem;
    line-height: 1;

    text-overflow: ellipsis;
    white-space: nowrap;

    opacity: 0.7;
  }

  /* -------------------------------------------------
     Continuous title marquee
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-mobile-title-viewport {
    width: 100%;
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
  }

  #wvNowDeck.wv-player-shell .wv-mobile-title-track {
    display: inline-flex;
    align-items: center;
    gap: var(--wv-mobile-title-gap);

    width: max-content;

    white-space: nowrap;
    will-change: transform;
  }

  #wvNowDeck.wv-player-shell .wv-mobile-title-copy {
    display: block;
    flex: 0 0 auto;

    white-space: nowrap;
  }

  #wvNowDeck.wv-player-shell
  .wv-mobile-title-track.is-scrolling {
    animation:
      wv-mobile-title-loop
      var(--wv-mobile-title-duration, 12s)
      linear
      infinite;
  }

  @keyframes wv-mobile-title-loop {
    from {
      transform: translateX(0);
    }

    to {
      transform:
        translateX(
          calc(
            -1 * var(--wv-mobile-title-distance)
          )
        );
    }
  }

  /* -------------------------------------------------
     Transport controls
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-player-transport {
    grid-area: controls;

    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.08rem;
  }

  /*
   * Flat mobile control reset.
   */
  #wvNowDeck.wv-player-shell .wv-player-control,
  #wvNowDeck.wv-player-shell .wv-now-tool,
  #wvNowDeck.wv-player-shell .wv-now-clear {
    appearance: none;
    -webkit-appearance: none;

    display: inline-grid;
    place-items: center;

    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;

    padding: 0;

    border: 0;
    border-radius: 0;

    color: rgba(238, 250, 255, 0.9);
    background: transparent;
    box-shadow: none;

    font-size: 0.68rem;
    line-height: 1;

    transform: none;
    transition: none;
  }

  #wvNowDeck.wv-player-shell #wvNowPrev,
  #wvNowDeck.wv-player-shell #wvNowNext {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;

    font-size: 0.74rem;
  }

  /*
   * Bright icon-only play/pause control.
   */
  #wvNowDeck.wv-player-shell #wvNowMainPlay,
  #wvNowDeck.wv-player-shell #wvNowMainPlay:hover,
  #wvNowDeck.wv-player-shell #wvNowMainPlay:focus-visible,
  #wvNowDeck.wv-player-shell #wvNowMainPlay:active {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;

    padding: 0;

    border: 0;
    border-radius: 0;

    color: #8ff8ff;
    background: transparent;
    box-shadow: none;

    font-size: 1.25rem;

    transform: none;
    outline: none;
  }

  #wvNowDeck.wv-player-shell #wvNowMainPlay i {
    filter:
      drop-shadow(0 0 5px rgba(125, 249, 255, 0.9))
      drop-shadow(0 0 12px rgba(125, 249, 255, 0.48));
  }

  /* -------------------------------------------------
     Tool controls
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-player-bottom {
    grid-area: tools;

    position: static !important;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    width: auto;
    min-width: 0;

    transform: none;
    pointer-events: auto;
  }

  #wvNowDeck.wv-player-shell .wv-player-actions {
    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.1rem;

    min-width: 0;
    white-space: nowrap;
  }

  #wvNowDeck.wv-player-shell #wvRepeatAll,
  #wvNowDeck.wv-player-shell #wvRepeatOne,
  #wvNowDeck.wv-player-shell #wvQueueToggle,
  #wvNowDeck.wv-player-shell #wvNowClear {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;

    font-size: 0.64rem;
  }

  #wvNowDeck.wv-player-shell
  .wv-now-tool
  span:not(.wv-queue-badge) {
    display: none;
  }

  #wvNowDeck.wv-player-shell .wv-queue-toggle {
    position: relative;
    overflow: visible;
  }

  /*
   * Active repeat state: color only.
   */
  #wvNowDeck.wv-player-shell .wv-now-tool.is-active,
  #wvNowDeck.wv-player-shell .wv-now-tool[aria-pressed="true"] {
    border: 0;
    color: #7df9ff;
    background: transparent;
    box-shadow: none;
  }

  /*
   * Queue button: no desktop reward body on mobile.
   */
  #wvNowDeck.wv-player-shell #wvQueueToggle.has-tracks,
  #wvNowDeck.wv-player-shell #wvQueueToggle.has-tracks:hover,
  #wvNowDeck.wv-player-shell #wvQueueToggle.has-tracks:focus-visible,
  #wvNowDeck.wv-player-shell.is-queue-open #wvQueueToggle {
    border: 0;
    color: #8fffc2;
    background: transparent;
    box-shadow: none;
    animation: none;
    transform: none;
  }

  #wvNowDeck.wv-player-shell .wv-queue-badge {
    position: absolute;
    right: -0.28rem;
    top: -0.01rem;

    display: inline-grid;
    place-items: center;

    min-width: 14px;
    height: 14px;
    padding: 0 0.2rem;

    border: 1px solid rgba(125, 249, 255, 0.38);
    border-radius: 999px;

    background:
      radial-gradient(
        circle at 35% 30%,
        rgba(255, 255, 255, 0.55),
        rgba(125, 249, 255, 0.24)
      ),
      rgba(18, 45, 58, 0.96);

    color: #eaffff;
    font-size: 0.48rem;
    font-weight: 950;
    line-height: 1;

    box-shadow:
      0 0 10px rgba(125, 249, 255, 0.22),
      0 3px 8px rgba(0, 0, 0, 0.42);
  }

  /*
   * No hover simulation on touch-sized layout.
   */
  #wvNowDeck.wv-player-shell .wv-player-control:hover,
  #wvNowDeck.wv-player-shell .wv-player-control:focus-visible,
  #wvNowDeck.wv-player-shell .wv-now-tool:hover,
  #wvNowDeck.wv-player-shell .wv-now-tool:focus-visible,
  #wvNowDeck.wv-player-shell .wv-now-clear:hover,
  #wvNowDeck.wv-player-shell .wv-now-clear:focus-visible {
    border: 0;
    color: rgba(238, 250, 255, 0.92);
    background: transparent;
    box-shadow: none;
    outline: none;
    transform: none;
  }

  /*
   * Brief touch feedback.
   */
  #wvNowDeck.wv-player-shell .wv-player-control:active,
  #wvNowDeck.wv-player-shell .wv-now-tool:active,
  #wvNowDeck.wv-player-shell .wv-now-clear:active {
    opacity: 0.65;
    transform: scale(0.92);
  }

  /* -------------------------------------------------
     Thin progress line
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell .wv-player-progress {
    grid-area: progress;

    position: relative;
    z-index: 3;

    display: block;

    width: 100%;
    height: 3px;

    margin: 0;
    padding: 0;
  }

  #wvNowDeck.wv-player-shell #wvNowCurrentTime,
  #wvNowDeck.wv-player-shell #wvNowTotalTime {
    display: none;
  }

  #wvNowDeck.wv-player-shell #wvNowSeek {
    display: block;

    width: 100%;
    height: 3px;

    margin: 0;

    border: 0;
    border-radius: 0;

    box-shadow: none;
  }

  #wvNowDeck.wv-player-shell #wvNowSeek::-webkit-slider-thumb {
    width: 9px;
    height: 9px;

    border-width: 1px;
  }

  #wvNowDeck.wv-player-shell #wvNowSeek::-moz-range-thumb {
    width: 9px;
    height: 9px;

    border-width: 1px;
  }

  /* -------------------------------------------------
     Full-bar visualizer background
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell #wvNowVisualizer {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-evenly !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 5px 52px !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    opacity: 0.16;
    overflow: hidden;

    pointer-events: none !important;
  }

  #wvNowDeck.wv-player-shell #wvNowVisualizer span {
    flex: 0 1 5px;

    width: 4px !important;
    max-width: 4px !important;

    opacity: 0.38;
  }

  #wvNowDeck.wv-player-shell.is-playing #wvNowVisualizer,
  #wvNowDeck.wv-player-shell #wvNowVisualizer.is-active {
    opacity: 0.08;
  }

  /* -------------------------------------------------
     Queue drawer
  ------------------------------------------------- */

  #wvNowDeck.wv-player-shell #wvQueueDrawer {
    right: 0;
    bottom: calc(100% + 0.25rem);

    width: 100vw;
    max-height: min(72vh, 620px);

    border-radius: 20px 20px 0 0;
  }

  #wvNowDeck.wv-player-shell #wvNowList {
    max-height: 46vh;
  }

  #wvNowDeck.wv-player-shell #wvNowMode {
    display: none;
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  #wvNowDeck.wv-player-shell
  .wv-mobile-title-track.is-scrolling {
    animation: none;
    transform: none;
  }

  #wvNowDeck.wv-player-shell #wvQueueToggle.has-tracks {
    animation: none;
  }
}