/* =========================================================
   ANIME NEURIX · hls-player.css
   Styles for the HLS quality / audio / subtitle controls added by
   js/hls-player.js. Everything is scoped to #w-player-wrap and uses
   its own .hp-* class names, so nothing site-wide is overridden.
   Colours are hard-coded fallbacks (no dependency on other stylesheets).
   ========================================================= */
#w-player-wrap { --hp-menu-bottom: 78px; }

#w-player-wrap .hp-btn[hidden] { display: none !important; }
#w-player-wrap .hp-btn.is-active { color: #c4b5fd; }
#w-player-wrap .hp-btn svg { width: 20px; height: 20px; }

/* Only used if player-extras' control row isn't present yet. */
#w-player-wrap .hp-controls-standalone {
  position: absolute; right: 12px; bottom: 64px; z-index: 6;
  display: flex; gap: 8px;
}
#w-player-wrap .hp-controls-standalone .watch-fullscreen-btn { position: static; }

/* ---------- menus ---------- */
#w-player-wrap .hp-menu {
  display: none;
  position: absolute; right: 12px; bottom: var(--hp-menu-bottom);
  z-index: 30;
  min-width: 210px; max-width: min(320px, calc(100% - 24px));
  max-height: calc(100% - var(--hp-menu-bottom) - 12px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 6px;
  background: rgba(15, 11, 30, .97);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  color: #fff;
  font: 500 14px/1.3 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
#w-player-wrap .hp-menu.open { display: block; animation: hp-pop .14s ease-out; }
#w-player-wrap .hp-menu-title {
  padding: 8px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; opacity: .6;
}
#w-player-wrap .hp-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 8px 10px;
  background: transparent; border: 0; border-radius: 8px;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#w-player-wrap .hp-item:hover { background: rgba(255, 255, 255, .1); }
#w-player-wrap .hp-item:focus-visible { outline: none; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 2px #a78bfa; }
#w-player-wrap .hp-item[aria-checked="true"] { color: #c4b5fd; }
#w-player-wrap .hp-item[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
#w-player-wrap .hp-check { flex: none; width: 18px; height: 18px; visibility: hidden; }
#w-player-wrap .hp-item[aria-checked="true"] .hp-check { visibility: visible; }
#w-player-wrap .hp-check svg { width: 18px; height: 18px; display: block; }
#w-player-wrap .hp-label { flex: 1; min-width: 0; }
#w-player-wrap .hp-sub { flex: none; font-size: 12px; opacity: .65; }

#w-player-wrap .hp-scrim { display: none; }

/* ---------- loading spinner ---------- */
#w-player-wrap .hp-loading {
  position: absolute; inset: 0; z-index: 4; display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
#w-player-wrap .hp-loading.show { display: flex; }
#w-player-wrap .hp-spin {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #c4b5fd;
  animation: hp-spin .8s linear infinite;
}
#w-player-wrap .hp-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- subtitle cues (rendered by hls-player.js) ---------- */
#w-player-wrap .hp-cue-layer {
  position: absolute; left: 6%; right: 6%; bottom: 6%; z-index: 5;
  text-align: center; pointer-events: none; transition: bottom .2s ease;
}
/* lift cues above the control bar whenever the bar is showing */
#w-player-wrap:not(.cc-hidden) .hp-cue-layer { bottom: 92px; }
#w-player-wrap .hp-cue {
  display: block; margin: 2px auto 0; width: fit-content; max-width: 100%;
  padding: 2px 10px; border-radius: 4px;
  background: rgba(0, 0, 0, .72); color: #fff;
  font-size: clamp(14px, 2.2vw, 26px); line-height: 1.35; white-space: pre-wrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

/* ---------- small message toast ---------- */
#w-player-wrap .hp-toast {
  position: absolute; left: 50%; top: 14px; z-index: 40;
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(15, 11, 30, .95); border: 1px solid rgba(255, 255, 255, .15);
  color: #fff; font: 500 13px/1.3 Inter, system-ui, sans-serif; max-width: 90%;
  transition: opacity .2s ease, transform .2s ease;
}
#w-player-wrap .hp-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- phones: menus become a bottom sheet ---------- */
@media (max-width: 640px) {
  #w-player-wrap .hp-menu {
    left: 0 !important; right: 0 !important; bottom: 0;
    min-width: 0; max-width: none;
    max-height: min(75%, 340px);
    border-radius: 14px 14px 0 0; border-width: 1px 0 0 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  #w-player-wrap .hp-menu.open { animation: hp-sheet .18s ease-out; }
  #w-player-wrap .hp-scrim.open {
    display: block; position: absolute; inset: 0; z-index: 29; background: rgba(0, 0, 0, .45);
  }
  #w-player-wrap .hp-cue-layer { bottom: 8%; }
  #w-player-wrap:not(.cc-hidden) .hp-cue-layer { bottom: 84px; }
}

@keyframes hp-spin { to { transform: rotate(360deg); } }
@keyframes hp-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hp-sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #w-player-wrap .hp-menu.open, #w-player-wrap .hp-spin { animation: none; }
  #w-player-wrap .hp-cue-layer, #w-player-wrap .hp-toast { transition: none; }
}
