/* Ripple Episode Player — matches ripple-web.html design */
*{box-sizing:border-box;}
/* .rpe-ctrls .rpe-wl-btn{
   display:none !important;
} */
.rpe-root{
  position:fixed;inset:0;z-index:99999;
  background:linear-gradient(135deg,#0a0c24,#1a0a2e 40%,#0d0f2e);
  display:flex;align-items:center;justify-content:center;
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  color:#fff;overflow:hidden;
}
.rpe-close{
  position:absolute;top:16px;left:16px;z-index:400;
  width:46px;height:46px;border-radius:50%;
  background:rgba(255,255,255,.1);border:none;
  display:grid;place-items:center;cursor:pointer;transition:.2s;
}
.rpe-close:hover{background:rgba(255,255,255,.2);}

/* Swiper — full viewport */
.rpe-swiper{
  width:100%;height:100%;
  overflow:hidden;
}
/* Each slide — full screen, relative for overlay */
.rpe-slide{
  height:100%;width:100%;position:relative;
}
/* Video container — width based 9/16, centered */
.rpe-vid-container{
  position:absolute;
  top:0;left:50%;
  transform:translateX(-50%);
  width:auto;
  height:100%;
  aspect-ratio:9/16;
  max-width:100%;
  overflow:hidden;
  background:#000;
}
.rpe-vid-container video{
  width:100%;height:100%;
  object-fit:cover;
  display:block;
}
/* Override Shaka forcing video full */
.rpe-vid-container.shaka-video-container{
  width:auto !important;
  height:100% !important;
  aspect-ratio:9/16 !important;
  max-width:100% !important;
}

/* Nav arrows — right side, vertically centered */
.rpe-arrows{
  position:absolute;right:16px;top:50%;transform:translateY(-50%);
  display:flex;flex-direction:column;gap:10px;z-index:60;
}

/* Spinner */
.rpe-spinner{
  position:absolute;top:50%;left:50%;
  transform:translate(-50%,-50%);
  display:none;z-index:10;pointer-events:none;
}
.rpe-spin-ring{
  width:40px;height:40px;
  border:3px solid rgba(255,255,255,.2);
  border-top-color:#ec008c;border-radius:50%;
  animation:rpes .7s linear infinite;
}
@keyframes rpes{to{transform:rotate(360deg);}}

/* Big play button center */
.rpe-bigplay{
  position:absolute;top:50%;left:50%;
  transform:translate(-50%,-50%);
  cursor:pointer;z-index:5;display:flex;transition:.2s;
}
.rpe-bigplay:hover{transform:translate(-50%,-50%) scale(1.08);}

/* Bottom overlay — full width, inside slide, swipes with video */
.rpe-bottom{
  position:absolute;bottom:0;left:0;right:0;
  padding:14px 24px 20px;
  background:linear-gradient(0deg,rgba(10,12,36,.55) 0%,rgba(10,12,36,.5) 60%,transparent 100%);
  z-index:50;pointer-events:auto;
}
.rpe-title{font-size:22px;font-weight:700;margin:0 0 4px;line-height:1.2;color:#fff;}
.rpe-meta{font-size:12px;color:#a7abce;margin:0 0 4px;}
.rpe-desc{
  font-size:12px;color:#cfd2ea;margin:0 0 12px;max-width:480px;
  display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;
  -webkit-box-orient:vertical;overflow:hidden;line-height:1.4;
}
/* Description: 1 line + Read more / Read less */
.rpe-desc-wrap{max-width:480px;margin:0 0 12px;}
.rpe-desc-wrap .rpe-desc{margin:0;-webkit-line-clamp:1;line-clamp:1;}
.rpe-desc-wrap .rpe-desc.rpe-desc-open{
  display:block;-webkit-line-clamp:unset;line-clamp:unset;
  max-height:30vh;overflow-y:auto;   /* very long text scrolls instead of covering the video */
}
.rpe-desc-toggle{
  background:none;border:none;padding:0;margin-top:2px;cursor:pointer;
  font-size:12px;font-weight:600;color:#ec008c;line-height:1.4;
}
.rpe-desc-toggle:hover,.rpe-desc-toggle:focus-visible{text-decoration:underline;outline:none;}

/* Seekbar */
.rpe-prog{display:flex;align-items:center;gap:10px;margin-bottom:12px;touch-action:none;}
.rpe-time{font-size:11px;color:#a7abce;min-width:32px;font-variant-numeric:tabular-nums;}
.rpe-bar{flex:1;height:24px;background:transparent;border-radius:4px;position:relative;cursor:pointer;touch-action:none;}
.rpe-bar::after{content:'';position:absolute;top:50%;left:0;right:0;height:4px;transform:translateY(-50%);background:rgba(255,255,255,.15);border-radius:4px;}
.rpe-buf{position:absolute;top:50%;left:0;height:4px;transform:translateY(-50%);background:rgba(255,255,255,.22);border-radius:4px;width:0;transition:width .3s;z-index:1;}
.rpe-played{position:absolute;top:50%;left:0;height:4px;transform:translateY(-50%);background:linear-gradient(90deg,#ec008c,#ff6fa8);border-radius:4px;width:0;z-index:2;}
.rpe-thumb{position:absolute;top:50%;left:0;width:16px;height:16px;background:#fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 2px 6px rgba(0,0,0,.4);opacity:1;z-index:3;touch-action:none;}
.rpe-root .rpe-bar .rpe-ad-cuepoints{position:absolute!important;inset:0!important;display:block!important;pointer-events:none!important;z-index:5!important;}
.rpe-root .rpe-bar .rpe-ad-cuepoint{position:absolute!important;display:block!important;top:50%!important;width:4px!important;height:4px!important;box-sizing:border-box!important;transform:translate(-50%,-50%)!important;border:0!important;border-radius:0!important;background:#ff0!important;box-shadow:none!important;}
.rpe-root .rpe-bar .rpe-ad-range{position:absolute!important;display:block!important;top:50%!important;height:4px!important;min-width:4px!important;transform:translateY(-50%)!important;background:#ff0!important;border:0!important;border-radius:2px!important;box-shadow:none!important;pointer-events:auto!important;cursor:pointer!important;z-index:1!important;}
.rpe-root .rpe-bar .rpe-ad-cuepoint{pointer-events:auto!important;cursor:pointer!important;z-index:4!important;}
.rpe-root .rpe-bar .rpe-ad-range{z-index:4!important;}
.rpe-root .rpe-bar .rpe-thumb{z-index:6!important;}

/* Controls row */
.rpe-ctrls{display:flex;align-items:center;gap:8px;}
.rpe-spacer{flex:1;}
.rpe-playbtn{
  border-radius:50%;
  background:none;
  border:none;display:grid;place-items:center;cursor:pointer;transition:.2s;
  box-shadow:none;
  padding:0;
}
.rpe-playbtn img,
.rpe-playbtn svg{width:48px;height:48px;}
.rpe-playbtn:hover{transform:scale(1.07);}
.rpe-btn{
  width:48px;height:48px;border-radius:50%;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);
  display:grid;place-items:center;cursor:pointer;transition:.2s;
  padding:0;
}
.rpe-btn img{width:24px;height:24px;}
.rpe-btn:hover{background:rgba(255,255,255,.15);}
.rpe-nav{width:46px;height:46px;}
/* Disabled nav arrow (first → up disabled, last → down disabled), like OTT carousel prev/next */
.rpe-nav.rpe-nav-disabled{
  opacity:.35;
  cursor:default;
  pointer-events:none;
}
.rpe-nav.rpe-nav-disabled:hover{
  background:rgba(255,255,255,.08);
}

/* ═══════ PANELS (Settings + Episodes) — increased width ═══════ */
.rpe-panel{
  position:absolute;top:0;right:-420px;
  width:400px;
  height:100%;
  background:rgba(10,12,36,.97);border-left:1px solid rgba(255,255,255,.08);
  z-index:999;display:flex;flex-direction:column;
  transition:right .3s;backdrop-filter:blur(10px);
}
.rpe-panel.open{right:0;}
/* Overlay backdrop for outside click */
.rpe-overlay{
  position:absolute;inset:0;z-index:240;
  background:rgba(0,0,0,.4);display:none;
}
.rpe-overlay.open{display:block;}
.rpe-panel-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 16px 12px;border-bottom:1px solid rgba(255,255,255,.08);
}
.rpeEpPanelClose{
      width: 36px !important;
    height: 36px !important;
  background: rgba(255, 255, 255, .1) !important;
}
.rpe-panel-head h3{font-size:20px;font-weight:700;margin:0;color:#fff;}
.rpe-panel-head button{background:none;border:none;cursor:pointer;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;transition:.2s;}
.rpe-panel-head button:hover{background:rgba(255,255,255,.1);}

/* Settings Tabs — pill style (desktop) */
.rpe-panel-tabs{display:flex;gap:8px;padding:14px 16px 10px;flex-wrap:wrap;}
.rpe-ptab{
  padding:8px 16px;border-radius:20px;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);
  color:#b0b4d0;font-size:13px;font-weight:600;cursor:pointer;transition:.2s;
}
.rpe-ptab:hover{background:rgba(255,255,255,.12);}
.rpe-ptab.active{background:#ec008c;color:#fff;border-color:transparent;}

/* Panel body */
.rpe-panel-body{flex:1;overflow-y:auto;padding:10px 16px;}
.rpe-panel-body::-webkit-scrollbar{width:4px;}
.rpe-panel-body::-webkit-scrollbar-thumb{background:rgba(236,0,140,.4);border-radius:10px;}
.rpe-set-list{display:flex;flex-direction:column;gap:2px;}
.rpe-set-item{
  display:flex;align-items:center;gap:10px;
  padding:12px 14px;border-radius:8px;
  cursor:pointer;transition:.15s;font-size:14px;color:#cfd2ea;
}
.rpe-set-item:hover{background:rgba(255,255,255,.06);}
.rpe-set-item.active{color:#fff;font-weight:600;background:rgba(236,0,140,.08);}
.rpe-check{color:#ec008c;font-size:16px;font-weight:700;min-width:16px;}
.rpe-set-empty{padding:20px;text-align:center;color:#666;font-size:13px;}

/* Episode grid — 3 columns */
.rpe-ep-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;}
.rpe-ep-card{cursor:pointer;border-radius:8px;overflow:hidden;transition:.2s;border:2px solid transparent;}
.rpe-ep-card:hover{border-color:rgba(255,255,255,.2);transform:scale(1.02);}
.rpe-ep-card.active{border-color:#ec008c;}
.rpe-ep-poster{position:relative;width:100%;aspect-ratio:9/16;background:#14173a;overflow:hidden;border-radius:6px;}
.rpe-ep-poster img{width:100%;height:100%;object-fit:cover;}
.rpe-ep-now{position:absolute;top:6px;left:50%;transform:translateX(-50%);background:#ec008c;color:#fff;font-size:8px;font-weight:700;padding:3px 7px;border-radius:4px;white-space:nowrap;}
.rpe-ep-play-icon{position:absolute;bottom:8px;left:8px;width:20px;height:20px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.4);border-radius:50%;}
.rpe-ep-num{display:block;font-size:11px;font-weight:600;color:#a7abce;margin-top:6px;text-align:center;}
.rpe-ep-num.active{color:#ec008c;}
.rpe-ep-title{display:block;font-size:11px;font-weight:600;color:#fff;margin-top:6px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px;}
.rpe-ep-meta{padding:6px 2px;}
.rpe-ep-desc{display:block;font-size:9px;color:#a7abce;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
/* Season dropdown in episodes panel */
.rpe-season-select{padding:0 0 12px;text-align:left;}
.rpe-season-select select{
  background:#1b1f49;color:#fff;border:1px solid rgba(255,255,255,.16);
  border-radius:50px;padding:10px 36px 10px 18px;font-size:13px;font-weight:600;
  outline:none;cursor:pointer;
  -webkit-appearance:none;-moz-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:12px;
  min-width:130px;
}
.rpe-season-select select:focus{border-color:#ec008c;}
.rpe-season-select select option{
  background:#1b1f49;color:#fff;padding:8px;
}

/* Hide Shaka default UI */
.rpe-root .shaka-controls-container,.rpe-root .shaka-bottom-controls,.rpe-root .shaka-spinner-container,.rpe-root .shaka-overflow-menu-button,.rpe-root .shaka-back-to-overflow-button,.rpe-root .shaka-small-play-button,.rpe-root .shaka-fullscreen-button,.rpe-root .shaka-captions-button,.rpe-root .shaka-settings-menu,.rpe-root .shaka-current-time,.rpe-root .shaka-duration,.rpe-root .shaka-time-container,.rpe-root .shaka-volume-bar-container,.rpe-root .shaka-seek-bar,.rpe-root .shaka-control-bar{display:none!important;}
/* Allow clicks to pass through Shaka's hidden controls layer */
.rpe-root .shaka-controls-container[shown="true"]{pointer-events:none!important;}
/* IMA CSAI Ad container — must remain visible and clickable during ads */
.rpe-root .shaka-client-side-ad-container{
  display:block!important;
  position:absolute!important;
  top:0!important;left:0!important;
  width:100%!important;height:100%!important;
  z-index:100!important;
  pointer-events:none!important;
}
/* Enable pointer events only when ad is actively playing */
.rpe-slide.rpe-ad-playing .shaka-client-side-ad-container{
  pointer-events:auto!important;
}
/* Shaka ad controls (skip button, countdown) — show during ads */
.rpe-root .shaka-ad-controls,
.rpe-root .shaka-skip-ad-container,
.rpe-root .shaka-skip-ad-button{
  display:flex!important;
  pointer-events:auto!important;
  z-index:101!important;
}
/* Prevent Shaka from stretching video container to full screen */
.rpe-root .shaka-video-container{
  position:absolute !important;
  top:0 !important;left:50% !important;
  transform:translateX(-50%) !important;
  width:auto !important;
  height:100% !important;
  aspect-ratio:9/16 !important;
  max-width:100% !important;
}

/* ═══════ RESPONSIVE ═══════ */

/* Right side action bar — hidden on desktop, visible on mobile */
.rpe-right-actions{
  display:none;
}
/* Bottom info row with thumbnail — hidden on desktop, visible on mobile */
.rpe-bottom-info{
  display:none;
}
/* Desktop-only elements */
.rpe-desktop-only{display:block;}
@media(max-width:768px){
  .rpe-root{background:#000 !important;}
  .rpe-vid-container video{width:100%;height:100%;aspect-ratio:auto;object-fit:cover;}
  .rpe-bottom{padding:10px 14px 14px;}
  .rpe-playbtn{width:44px;height:44px;}
  .rpe-btn{width:34px;height:34px;}
  .rpe-nav{width:34px;height:34px;}
  .rpe-arrows{right:10px;}

  /* Hide desktop controls row on mobile */
  .rpe-ctrls{display:none !important;}

  /* Show right side action bar — positioned above bottom overlay */
  .rpe-right-actions{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:22px;
    position:absolute;
    right:10px;
    bottom:200px;
    z-index:55;
  }
  .rpe-ract{
    display:flex;flex-direction:column;align-items:center;gap:4px;
    background:none;border:none;cursor:pointer;padding:0;
  }
  .rpe-ract svg{
    width:26px;height:26px;
    filter:drop-shadow(0 1px 3px rgba(0,0,0,.5));
  }
  .rpe-ract span{
    font-size:10px;color:#fff;font-weight:500;
    text-shadow:0 1px 3px rgba(0,0,0,.6);
  }

  /* Show center persistent play button */


  /* Show bottom info row with thumbnail */
  .rpe-bottom-info{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:6px;
  }
  .rpe-bottom-thumb{
    width:40px;height:40px;
    border-radius:6px;
    object-fit:cover;
    flex-shrink:0;
  }
  .rpe-bottom-text{
    display:flex;flex-direction:column;gap:2px;
    overflow:hidden;
  }
  .rpe-bottom-text .rpe-title{
    font-size:15px;margin:0;
    word-break:break-word;
    display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;
    -webkit-box-orient:vertical;overflow:hidden;
  }
  .rpe-bottom-text .rpe-meta{
    font-size:11px;margin:0;color:#ec008c;font-weight:600;
    word-break:break-word;
    display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;
    -webkit-box-orient:vertical;overflow:hidden;
  }

  /* Title/meta in bottom — hide desktop-only on mobile */
  .rpe-desktop-only{display:none !important;}

  /* Description smaller */
  .rpe-desc{font-size:11px;margin:0 0 8px;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}

  /* Hide nav arrows on mobile */
  .rpe-arrows{display:none;}

  /* ═══════ MOBILE PANELS — Bottom sheet style ═══════ */
  .rpe-panel{
    position:absolute;
    top:auto;bottom:0;right:0;left:0;
    width:100%;height:auto;max-height:55vh;
    border-radius:16px 16px 0 0;
    background:rgba(10,12,36,.97);
    border-left:none;border-top:1px solid rgba(255,255,255,.08);
    backdrop-filter:blur(10px);
    transform:translateY(100%);
    transition:transform .3s ease;
  }
  .rpe-panel.open{transform:translateY(0);}

  /* Episodes panel — FULL HEIGHT bottom to top */
  #rpeEpPanel{
    max-height:100%;height:100%;
    border-radius:0;
    top:0;bottom:auto;
    background:#0a0c24;
    transform:translateY(100%);
    transition:transform .3s ease;
  }
  #rpeEpPanel.open{transform:translateY(0);bottom:auto;}

  /* Panel head — dark bg */
  .rpe-panel-head{
    border-bottom:1px solid rgba(255,255,255,.08);
  }
  .rpe-panel-head h3{color:#fff;font-size:17px;}
  .rpe-panel-head button svg{stroke:#fff;}

  /* Settings Tabs — underline style on mobile */
  .rpe-panel-tabs{
    gap:0;padding:0 16px;border-bottom:1px solid rgba(255,255,255,.1);
  }
  .rpe-ptab{
    padding:12px 14px;border-radius:0;
    background:none;border:none;border-bottom:2px solid transparent;
    color:#a7abce;font-size:13px;font-weight:600;
  }
  .rpe-ptab:hover{background:none;color:#fff;}
  .rpe-ptab.active{
    background:none;color:#fff;border-color:#ec008c;border-bottom:2px solid #ec008c;
  }

  /* Panel body — dark */
  .rpe-panel-body{padding:10px 16px;overflow-y:auto;}
  .rpe-set-item{
    color:#cfd2ea;border-radius:0;padding:14px 10px;
    border-bottom:1px solid rgba(255,255,255,.06);
  }
  .rpe-set-item:hover{background:rgba(255,255,255,.04);}
  .rpe-set-item.active{color:#fff;font-weight:600;background:none;}
  .rpe-check{color:#ec008c;}
  .rpe-set-empty{color:#666;}


  /* Episodes panel body — scrollable full */
  #rpeEpPanel .rpe-panel-body{flex:1;overflow-y:auto;padding:12px 14px;}
  .rpe-ep-grid{gap:10px;}
  .rpe-ep-card{border:2px solid transparent;border-radius:8px;}
  .rpe-ep-card.active{border-color:#ec008c;}
  .rpe-ep-card:hover{border-color:rgba(255,255,255,.15);}
  .rpe-ep-poster{background:#14173a;border-radius:8px;}
  .rpe-ep-num{color:#a7abce;font-size:11px;}
  .rpe-ep-num.active{color:#ec008c;}
}
@media(max-width:480px){
  .rpe-right-actions{gap:18px;right:8px;bottom:180px;}
  .rpe-ract svg{width:22px;height:22px;}
  .rpe-ract span{font-size:9px;}
  .rpe-bottom{padding:8px 12px 12px;}
  .rpe-panel-tabs{gap:4px;padding:10px 12px 8px;}
  .rpe-ptab{padding:6px 12px;font-size:12px;}
  .rpe-ep-grid{grid-template-columns:1fr 1fr;}
}

/* Subtitle text container — force visible with proper height */
.rpe-root .shaka-text-container{
  position:absolute!important;
bottom:3%!important;
  left:0!important;right:0!important;
  height:100%!important;
  text-align:center!important;
  z-index:40!important;
  pointer-events:none!important;
  padding-bottom:30px!important;
  overflow:visible!important;
}
/* ── Subtitle: background ONLY on <span>, removed from everything else ── */
/* Container + every wrapper/region div: NO background.
   .shaka-text-region class has a dynamic suffix (e.g. region1_100x8%-0x85%),
   so match it with [class*="shaka-text-region"] instead of an exact name. */
.rpe-root .shaka-text-container,
.rpe-root .shaka-text-container > div,
.rpe-root .shaka-text-container div,
.rpe-root .shaka-text-container div[style],
.rpe-root .shaka-text-container [class*="shaka-text-region"],
.rpe-root .shaka-text-container .shaka-text-wrapper{
  background:transparent!important;
  background-color:transparent!important;
  box-shadow:none!important;
}
/* Outer wrapper span: keep transparent (no box here) */
.rpe-root .shaka-text-container .shaka-text-wrapper{
  background:transparent!important;
  background-color:transparent!important;
}
/* Background ONLY on the innermost / last span (the actual caption text) */
.rpe-root .shaka-text-container .shaka-text-wrapper span,
.rpe-root .shaka-text-container span:last-child{
  color:#fff!important;
  border-radius:4px!important;
  font-size:16px!important;
  line-height:1.6!important;
  padding:.1em .5em!important;
  box-decoration-break:clone!important;
  background: rgba(0,0,0,.4) ;
  -webkit-box-decoration-break:clone!important;
}

/* ═══════ SHARE POPUP ═══════ */
.rpe-share-popup{
  position:absolute;inset:0;
  z-index:300;
  background:rgba(0,0,0,.6);
  display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(4px);
}
.rpe-share-modal{
  background:rgba(10,12,36,.97);
  border:1px solid rgba(255,255,255,.1);
  border-radius:16px;
  padding:20px;
  width:90%;max-width:360px;
  box-shadow:0 8px 32px rgba(0,0,0,.5);
}
.rpe-share-header{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:18px;
}
.rpe-share-title{
  font-size:17px;font-weight:700;color:#fff;
}
.rpe-share-close{
  background:none;border:none;cursor:pointer;width:28px;height:28px;
  display:grid;place-items:center;border-radius:50%;transition:.2s;
}
.rpe-share-close:hover{background:rgba(255,255,255,.1);}
.rpe-share-icons{
  display:flex;gap:16px;justify-content:center;flex-wrap:wrap;
  margin-bottom:18px;
}
.rpe-share-item{
  display:flex;flex-direction:column;align-items:center;gap:6px;
}
.rpe-share-item a{
  width:50px;height:50px;border-radius:50%;
  background:rgba(255,255,255,.08);
  display:flex;align-items:center;justify-content:center;
  transition:.2s;text-decoration:none;
}
.rpe-share-item a:hover{background:rgba(255,255,255,.15);transform:scale(1.08);}
.rpe-share-item span{
  font-size:10px;color:#a7abce;font-weight:500;
}
.rpe-share-url-bar{
  display:flex;align-items:center;gap:8px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.1);
  border-radius:8px;
  padding:6px 8px;
}
.rpe-share-url{
  flex:1;background:none;border:none;color:#cfd2ea;
  font-size:12px;outline:none;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.rpe-share-copy{
  background:#ec008c;color:#fff;border:none;
  padding:6px 14px;border-radius:6px;font-size:12px;
  font-weight:600;cursor:pointer;transition:.2s;white-space:nowrap;
}
.rpe-share-copy:hover{background:#d4007d;}

/* ═══════ DESKTOP MAX WIDTH — cap .rpe-root on large screens ═══════ */
@media(min-width:1300px){
  .rpe-bottom{
    max-width:1200px !important;
    margin:0 auto;
  }
}
@media(min-width:1220px) and (max-width:1300px){
  .rpe-bottom{
    max-width:1000px !important;
    margin:0 auto;
  }
}

/* ═══════ AD PLAYING STATE — keep controls visible during ads ═══════ */
/* IMA ad container clickable during ad */
.rpe-slide.rpe-ad-playing .shaka-client-side-ad-container {
  pointer-events: auto !important;
  cursor: pointer;
  z-index: 100;
}

/* ═══════ AD PROGRESS BAR — separate from content seekbar ═══════ */
.rpe-ad-prog{
  position:absolute;
  bottom:86px;
  left:24px;
  right:24px;
  height:3px;
  background:rgba(255,255,255,.28);
  z-index:110;
  display:none;
}
.rpe-ad-status{
  position:absolute;
  left:0;
  bottom:calc(100% + 8px);
  display:flex;
  align-items:center;
  gap:10px;
  z-index:112;
}
.rpe-ad-time{
  padding:4px 9px;
  border-radius:16px;
  background:rgba(0,0,0,.72);
  color:#fff;
  font-size:12px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
}
.rpe-skip-ad{
  align-items:center;
  justify-content:center;
  padding:7px 13px;
  border:1px solid rgba(255,255,255,.85);
  border-radius:4px;
  background:rgba(0,0,0,.78);
  color:#fff;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  pointer-events:auto;
  position:relative;
  z-index:120;
}
.rpe-skip-ad:hover{background:rgba(236,0,140,.95);}
.rpe-slide.rpe-ad-playing .rpe-ad-prog{z-index:120;}
@media(max-width:768px){
  .rpe-ad-prog{bottom:74px;left:14px;right:14px;}
  .rpe-ad-status{bottom:calc(100% + 7px);}
}
.rpe-ad-prog-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg,#ec008c,#ff6fa8);
  transition:width 0.2s linear;
  border-radius:0 2px 2px 0;
}

/* ═══════ Volume button — top right (next to close) ═══════ */
.rpe-vol-top{
  position:absolute;top:16px;right:16px;z-index:400;
  width:34px;height:34px;border-radius:50%;
  background:rgba(255,255,255,.1);border:none;
  display:none;place-items:center;cursor:pointer;transition:.2s;
}
.rpe-vol-top:hover{background:rgba(255,255,255,.2);}
.rpe-vol-top img{width:20px;height:20px;}

/* ═══════ Settings panel — fixed height on mobile/tablet ═══════ */
@media(max-width:768px){
  .rpe-vol-top{display:grid;}
  .rpe-panel:not(#rpeEpPanel){
    height:45vh !important;
    overflow-y:auto;
  }
}


/* ═══════ SEASON COMPLETE POPUP ═══════ */
.rpe-complete{
  position:absolute;inset:0;z-index:80;
  display:none;align-items:center;justify-content:center;
  background:rgba(6,8,24,.72);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.rpe-complete.show{display:flex;}
.rpe-complete-inner{
  text-align:center;padding:20px;max-width:420px;width:90%;
  animation:rpeCompleteIn .3s ease;
}
@keyframes rpeCompleteIn{
  from{opacity:0;transform:translateY(12px) scale(.98);}
  to{opacity:1;transform:none;}
}
.rpe-complete-label{
  font-size:12px;font-weight:700;letter-spacing:2px;
  color:#9aa0c8;text-transform:uppercase;margin-bottom:14px;
}
.rpe-complete-poster{
  width:150px;margin:0 auto 18px;border-radius:12px;overflow:hidden;
  box-shadow:0 12px 40px rgba(0,0,0,.5), 0 0 60px rgba(0,200,150,.15);
}
.rpe-complete-poster img{width:100%;height:auto;display:block;aspect-ratio:9/16;object-fit:cover;}
.rpe-complete-title{
  font-size:26px;font-weight:800;margin:0 0 8px;color:#fff;line-height:1.2;
}
.rpe-complete-sub{
  font-size:14px;color:#a7abce;margin:0 0 22px;
}
.rpe-complete-btns{
  display:flex;gap:14px;align-items:center;justify-content:center;flex-wrap:wrap;
}
.rpe-complete-replay,
.rpe-complete-back{
  border:none;cursor:pointer;font-size:15px;font-weight:700;
  padding:13px 26px;border-radius:40px;color:#fff;transition:transform .15s, background .15s;
}
.rpe-complete-replay{
  background:linear-gradient(180deg,#FF73C6 0%,#EC008C 100%);
  box-shadow:0 6px 18px rgba(236,0,140,.35);
}
.rpe-complete-replay:hover{transform:scale(1.04);}
.rpe-complete-back{
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.18);
}
.rpe-complete-back:hover{background:rgba(255,255,255,.18);}
@media (max-width:768px){
  /* Sit above the bottom controls + right action bar, and use the full viewport safely */
  .rpe-complete{z-index:200;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);}
  .rpe-complete-inner{
    width:100%;max-width:none;
    padding:24px 22px calc(24px + env(safe-area-inset-bottom));
    max-height:100%;overflow-y:auto;
    display:flex;flex-direction:column;align-items:center;justify-content:center;
  }
  .rpe-complete-label{font-size:11px;letter-spacing:1.5px;margin-bottom:12px;}
  .rpe-complete-poster{width:34vw;max-width:150px;min-width:110px;margin-bottom:16px;}
  .rpe-complete-title{font-size:20px;}
  .rpe-complete-sub{font-size:13px;margin-bottom:20px;padding:0 6px;}
  /* Full-width stacked buttons so they never crowd on small screens */
  .rpe-complete-btns{flex-direction:column;gap:12px;width:100%;max-width:320px;}
  .rpe-complete-replay,.rpe-complete-back{
    width:100%;font-size:15px;padding:14px 20px;
  }
}
@media (max-width:768px) and (orientation:landscape){
  /* Landscape phones: keep it compact and side-by-side so it fits the short height */
  .rpe-complete-poster{width:auto;height:38vh;max-height:150px;min-width:0;}
  .rpe-complete-poster img{width:auto;height:100%;}
  .rpe-complete-title{font-size:18px;margin-bottom:4px;}
  .rpe-complete-sub{font-size:12px;margin-bottom:14px;}
  .rpe-complete-btns{flex-direction:row;max-width:none;width:auto;}
  .rpe-complete-replay,.rpe-complete-back{width:auto;padding:11px 22px;}
}

/* ═══ Hide Settings, Episodes, Share & My List icons while a (CSAI) ad is playing ═══ */
/* The active slide gets the .rpe-ad-playing class on AD_STARTED and loses it when the ad
   stops/skips/completes. During that window these controls must not be usable, so we
   hide them in both the right-action bar and the bottom control row. */
.rpe-slide.rpe-ad-playing .rpe-set-open,
.rpe-slide.rpe-ad-playing .rpe-ep-open,
.rpe-slide.rpe-ad-playing .rpe-ract.rpe-share-btn,
.rpe-slide.rpe-ad-playing .rpe-btn.rpe-share-btn,
.rpe-slide.rpe-ad-playing .rpe-wl-btn{
  display:none !important;
}

/* Settings gear is disabled until the video is ready (tracks loaded). While
   loading/buffering it stays dimmed and non-clickable so the panel can't open
   on empty track data. The loader keeps showing in the meantime. */
.rpe-set-open.rpe-disabled,
.rpe-ep-open.rpe-disabled{
  opacity:.4;
  pointer-events:none;
  cursor:default;
}
.rpe-slide.rpe-ad-playing .rpe-title.rpe-desktop-only,
.rpe-slide.rpe-ad-playing .rpe-meta.rpe-desktop-only,
.rpe-slide.rpe-ad-playing .rpe-desc,
.rpe-slide.rpe-ad-playing .rpe-desc-wrap{
  display:none !important;
}

/* Single-episode shows: no episode list to open, so hide the "Episodes" button
   (both the mobile right-action bar and the desktop controls row). */
#rpe.rpe-single-episode .rpe-ep-open{
  display:none !important;
}

/* ═══ Auto-hide controls while playing ═══ */
/* When #rpe has .rpe-hide-controls (set by JS a few seconds into playback), fade out the
   custom controls. They reappear on pause or on any pointer activity. */
.rpe-root.rpe-hide-controls .rpe-right-actions,
.rpe-root.rpe-hide-controls .rpe-bottom,
.rpe-root.rpe-hide-controls .rpe-close,
.rpe-root.rpe-hide-controls .rpe-vol-top,
.rpe-root.rpe-hide-controls .rpe-arrows{
  opacity:0 !important;
  pointer-events:none !important;
  transition:opacity .25s ease;
}
.rpe-root .rpe-right-actions,
.rpe-root .rpe-bottom,
.rpe-root .rpe-close,
.rpe-root .rpe-vol-top,
.rpe-root .rpe-arrows{
  transition:opacity .25s ease;
}

/* ═══ Prev/Next (up/down) arrows stay visible and usable while an ad plays ═══ */
/* The arrows live at the player root, outside the slide, so they are lifted above the
   ad layer (z-index:100) and exempted from the auto-hide fade used for the other controls.
   Disabled arrows (first/last episode) keep their dimmed, non-clickable state. */
#rpe:has(.rpe-slide.rpe-ad-playing) .rpe-arrows{
  display:none !important;
}
/* ═══ Offline / online bar (same look as the Waves player) ═══ */
.rpe-root .no_intrnt_text,
.rpe-root .intrnt_text{
  position:absolute;left:0;bottom:0;width:100%;margin:0;padding:2px 0;
  font-size:13px;font-weight:400;text-align:center;color:#fff;z-index:500;
  display:flex;align-items:center;justify-content:center;gap:5px;
}
.rpe-root .no_intrnt_text{background:#474a58c2;}
.rpe-root .intrnt_text{background:var(--pbg,#095ae5);}
.rpe-root .network_size{font-size:18px;}
/* The global full-screen network popup (#pboverlaydiv) never shows over the Ripple player;
   the thin offline bar above is used instead. */
body:has(.rpe-root) #pboverlaydiv{display:none !important;}
