/* Shared player appearance for the website and its iPhone WebView. */
@media (hover: none) and (pointer: coarse) {
  .player-page :is(a, button, [role="button"]) {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .player-page :is(a, button) img { -webkit-user-drag: none; }
}
.player-page.app-native-youtube #youtubePlayerContainer { display: none !important; }
.player-page .at-controls-right > .app-youtube-expand {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
}
.player-page .app-youtube-expand[hidden] { display: none !important; }
.player-page .app-youtube-expand:not(.is-collapsed) { visibility: hidden; }
.player-page .app-youtube-expand svg { width: 24px; height: 24px; pointer-events: none; }
.player-page .app-youtube-expand:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Consistent, sharp player controls; the audio-source/YouTube control stays as-is. */
.player-page .at-controls .btn,
.player-page .at-controls .btn:not(.disabled):not(.visually-disabled),
.player-page .at-controls :is(.dropdown-toggle, .at-zoom, .at-speed, .at-audio-source) {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  background-color: rgba(255,255,255,.07);
  transition: background-color .12s ease, border-color .12s ease;
}
.player-page .at-controls .btn:not(.disabled):not(.visually-disabled):is(:hover, :focus-visible),
.player-page .at-controls :is(.dropdown-toggle, .at-zoom, .at-speed, .at-audio-source):is(:hover, :focus-visible) {
  border-color: rgba(255,255,255,.48);
  background-color: rgba(255,255,255,.18);
}
.player-page .at-controls :is(.btn, .dropdown-toggle, .at-zoom, .at-speed, .at-audio-source):active {
  background-color: rgba(255,255,255,.25);
}
.player-page .at-controls .btn.active:not(.disabled):not(.visually-disabled) {
  border-color: rgba(255,255,255,.65);
  background-color: rgba(255,255,255,.25);
}
.player-page .at-controls .at-player-play-pause {
  border-color: #fff !important;
  background-color: #fff !important;
}
.player-page .at-controls .at-player-play-pause:is(:hover, :focus-visible, :active) {
  background-color: #e6f2fc !important;
}
.player-page .at-controls .btn img,
.player-page .at-controls .at-speed > img,
.player-page .at-controls .at-zoom .app-control-icon {
  display: block;
  width: 23px !important;
  height: 23px !important;
  object-fit: contain;
  pointer-events: none;
}
.player-page .at-controls .at-player-play-pause img { width: 25px !important; height: 25px !important; }
.player-page .at-controls .at-player-stop img { width: 28px !important; height: 28px !important; }
.player-page .at-controls .at-speed > img { width: 28px !important; height: 28px !important; }
.player-page .at-controls .dropdown-icon { width: 28px; height: 28px; }
.player-page .at-controls .at-zoom { background-image: none !important; }
.player-page .at-controls .at-zoom > i { display: none !important; }
.player-page .at-controls .at-zoom .app-control-icon { flex: none; }
.banner-right-buttons a[href="index.html"] .nav-label {
  font-size: 0;
}
.banner-right-buttons a[href="index.html"] .nav-label::after {
  content: "Songs";
  font-size: 13px;
}
@media (orientation: landscape) and (max-width: 1024px) {
  body.player-page { background: #fff; }
  .player-page .banner { display: none !important; }
  .player-page .at-wrap {
    top: 0;
    height: 100vh;
    height: 100dvh;
  }
  .player-page .at-viewport {
    padding-left: max(4px, env(safe-area-inset-left));
    padding-right: max(4px, env(safe-area-inset-right));
    overflow-x: hidden;
  }
  .player-page .at-main {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .player-page .at-main::after { height: 64px; }
  .player-page .back-button {
    top: 4px;
    left: max(8px, env(safe-area-inset-left));
    border: 1px solid #d7e1eb;
    border-radius: 8px;
    background: rgba(255,255,255,.96);
  }
  .player-page .back-button img {
    filter: brightness(0) saturate(100%) invert(29%) sepia(35%)
      saturate(1570%) hue-rotate(170deg) brightness(90%);
  }
  .player-page .tab-help-fab {
    top: 4px;
    right: max(8px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border: 1px solid #d7e1eb;
    background: rgba(255,255,255,.96);
    color: #175997;
  }
  .player-page .at-controls {
    inset: auto 0 0 0;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 6px;
    height: calc(54px + env(safe-area-inset-bottom));
    padding: 4px max(8px, env(safe-area-inset-right))
      calc(4px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .player-page .at-controls-left {
    flex: 0 1 auto;
    width: auto;
    min-height: 0;
    overflow: visible;
    gap: 6px;
    padding-right: 8px;
    border-right: 1px solid rgba(255,255,255,.25);
  }
  .player-page .at-controls-right {
    flex: 1 1 auto;
    justify-content: space-evenly;
    width: auto;
    min-width: 0;
    min-height: 0;
    gap: 6px;
    padding: 0;
    border: 0;
    overflow-x: auto;
  }
  .player-page .at-song-info { flex: 0 1 128px; margin-left: 3px; }
  .player-page .at-song-title { font-size: 12px; }
  .player-page .at-song-artist,
  .player-page .at-player-progress { display: none; }
  .player-page .at-controls .btn,
  .player-page .at-controls .btn:not(.disabled):not(.visually-disabled),
  .player-page .dropdown-toggle,
  .player-page .at-zoom,
  .player-page .at-speed,
  .player-page .at-zoom:not(.visually-disabled),
  .player-page .at-speed:not(.visually-disabled),
  .player-page .pro-menu-trigger {
    flex-basis: 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
  .player-page .dropdown-menu {
    bottom: calc(60px + env(safe-area-inset-bottom));
  }
  .player-page.has-youtube-media #youtubePlayerContainer {
    right: max(10px, env(safe-area-inset-right));
  }
}
.player-page .dropdown-menu {
  position: fixed;
  bottom: auto;
  z-index: 2400;
  width: min(220px, calc(100vw - 20px));
}

/* Keep the YouTube iframe alive off screen while its video is collapsed. */
.player-page #youtubePlayerContainer { overflow: visible; }
.player-page.youtube-collapsed #youtubePlayerContainer {
  transform: translateX(calc(100vw + 300px));
  pointer-events: none;
}
.player-page .youtube-drag-handle { display: none !important; }
.player-page #youtubePlayerContainer .youtube-collapse-handle {
  position: absolute;
  top: 0;
  right: 100%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  padding: 0;
  border: 1px solid #cbd9e6;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #fff;
  color: #175997;
  cursor: pointer;
}
.player-page #youtubePlayerContainer .youtube-collapse-handle[hidden] { display: none !important; }
.player-page #youtubePlayerContainer .youtube-collapse-handle svg { width: 26px; height: 26px; pointer-events: none; }
.player-page #youtubePlayerContainer > #youtubePlayer { width: 100% !important; height: 100% !important; border-radius: 8px; }
