/* Drama4All V32 — unified player surfaces | dark default | light via site's d4a-brand-theme.
   This stylesheet deliberately does not modify video sourcing, playback, ad gating, or rating logic. */
html { --d32-fallback: #101019; }
#stage {
  --d32-bg: #0b0b10;
  --d32-panel: #191a1f;
  --d32-panel-hi: #222032;
  --d32-control: rgba(24,26,32,.82);
  --d32-control-border: rgba(248,206,151,.27);
  --d32-text: #fcfbf8;
  --d32-muted: #cac5bc;
  --d32-stroke: rgba(211,181,142,.29);
  --d32-primary: #ed9d34;
  --d32-secondary: #ce9f4f;
  --d32-pink: #dfb643;
  --d32-active-bg: rgba(226,160,74,.23);
  --d32-gradient: linear-gradient(105deg,#eb9b36 0%,#d29c46 54%,#e3b947 100%);
  --d32-shadow: 0 23px 70px rgba(0,0,0,.62), 0 0 0 1px rgba(213,166,104,.06);
  --d32-warning: #ffd16a;
  --d32-rating-outline: #e5d6c3;
  --d32-rating-digit: #f9f5ed;
  --d32-overlay: rgba(4,5,11,.83);
  --d32-badge: #dec4a5;
  color-scheme: dark;
  isolation: isolate;
}
html[data-d4a-theme="light"] #stage {
  --d32-bg: #eef1f8;
  --d32-panel: #ffffff;
  --d32-panel-hi: #f7f6f2;
  --d32-control: rgba(23,25,41,.70);
  --d32-control-border: rgba(250,233,212,.36);
  --d32-text: #24334a;
  --d32-muted: #657186;
  --d32-stroke: #e3e0d9;
  --d32-primary: #b69062;
  --d32-secondary: #caa474;
  --d32-pink: #c9ae60;
  --d32-active-bg: rgba(190,147,94,.12);
  --d32-gradient: linear-gradient(105deg,#b28d61 0%,#c4a175 63%,#bda67c 100%);
  --d32-shadow: 0 24px 70px rgba(23,34,61,.27), 0 0 0 1px rgba(181,143,97,.07);
  --d32-warning: #b77d12;
  --d32-rating-outline: #b0916b;
  --d32-rating-digit: #7a6041;
  --d32-overlay: rgba(16,20,35,.63);
  --d32-badge: #937e63;
  color-scheme: light;
}
/* Keep the cinematic video backdrop black in both themes: letterboxing must not flash white. */
#stage, #stage #video { background-color: #000 !important; }
#stage button, #stage a { -webkit-tap-highlight-color: transparent; }
#stage button:focus-visible, #stage a:focus-visible {
  outline: 2px solid #ffd7a0 !important; outline-offset: 3px;
}
/* Player controls: one family of calm translucent controls, safe above varied poster/video frames. */
#stage .p-top { gap: 8px; top: max(13px,env(safe-area-inset-top)); }
/* D4A_V33_TRANSPARENT_CHROME */
/* Keep desktop arrows unchanged; restore original transparent player controls. */
#stage .desktop-nav-btn {
  border: 1px solid var(--d32-control-border) !important;
  background: var(--d32-control) !important;
  color: #fff !important;
  border-radius: 14px !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.23) !important;
  backdrop-filter: blur(13px) saturate(1.2);
  -webkit-backdrop-filter: blur(13px) saturate(1.2);
  transition: background .18s ease,border-color .18s ease,transform .16s ease !important;
}
#stage .p-top .round, #stage .p-side .p-btn {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #fff !important;
  border-radius: 0 !important;
  text-shadow: 0 2px 9px rgba(0,0,0,.82);
  transition: color .16s ease,transform .16s ease !important;
}
#stage .p-top .round { width: 43px; height: 43px; }
#stage .p-side { gap: 9px; bottom: max(154px,calc(140px + env(safe-area-inset-bottom))); }
#stage .p-side .p-btn {
  box-sizing: border-box; width: 52px; min-height: 56px; padding: 8px 2px 6px;
  align-items: center; justify-content: center; line-height: 1.2;
}
#stage .p-side .p-btn i { font-size: 1.18rem; margin-bottom: 5px; }
#stage .p-side .p-btn span { font-size: .59rem; color: #fbf9f4; }
#stage .p-side .p-btn.active,
#stage .p-side .p-btn[aria-pressed="true"] { background: transparent !important; border: 0 !important; }
#stage .p-side .p-btn.active i { color:#f3e0b5 !important; }
#stage .desktop-nav-btn:hover:not(.disabled) {
  background: rgba(151,115,66,.88) !important; border-color:rgba(248,210,154,.8)!important;
}
#stage .p-top .round:hover,#stage .p-side .p-btn:hover {
  background: transparent !important; border: 0 !important; filter: brightness(1.12);
}
#stage .desktop-nav-btn { border-radius: 14px !important; }
#stage .p-center { background:rgba(22,23,29,.80) !important; border:1px solid rgba(255,218,167,.36); box-shadow:0 12px 36px #0006; }
#stage .p-bottom {
  background: linear-gradient(0deg,rgba(2,3,9,.96),rgba(2,3,9,.55) 55%,transparent) !important;
  padding-bottom: 13px;
}
#stage .p-name { color:#fff !important; font-family:Cairo,system-ui,sans-serif !important; font-weight:800; line-height:1.48; text-shadow:0 2px 14px #000b; }
#stage .p-ep { color:#ffe1b4 !important; }
#stage .p-hint { color:#d8d5ce !important; }
#stage .p-times { color:#f7f4ee !important; }
#stage .p-barwrap { background:linear-gradient(to top,rgba(2,3,9,.92),transparent) !important; }
#stage .p-track { height:5px; background:rgba(255,255,255,.29) !important; }
#stage .p-buffer { background:rgba(251,229,199,.36) !important; }
#stage .p-fill { background:var(--d32-gradient) !important; box-shadow:0 0 8px rgba(234,171,79,.32); }
#stage .p-knob { background:#fbf8f3 !important; border:2px solid #e8b365; box-shadow:0 2px 12px rgba(183,126,49,.48); }
#stage .p-load { color:#fff; background:rgba(4,5,12,.67) !important; }
#stage .p-load i { color:#fac98b !important; }
#stage #retryBtn { background:var(--d32-gradient) !important; color:#fff !important; border:1px solid transparent; }
#stage #reportBtn { background:#5b4f29 !important; border:1px solid rgba(255,233,152,.43); color:#fff !important; }
/* Sheets: consistent light/dark cards, including current episode / captions. */
#stage .p-sheet {
  background:var(--d32-panel) !important; border:1px solid var(--d32-stroke) !important;
  color:var(--d32-text) !important; box-shadow:var(--d32-shadow) !important;
  border-radius:18px !important; padding:9px !important;
}
#stage .p-sheet .p-row { color:var(--d32-text) !important; border:1px solid transparent; border-radius:10px !important; }
#stage .p-sheet .p-row:hover { background:var(--d32-active-bg) !important; }
#stage .p-sheet .p-row.on { color:var(--d32-primary) !important; background:var(--d32-active-bg) !important; }
#stage .p-sheet .p-cell {
  background:var(--d32-panel-hi) !important; color:var(--d32-text) !important;
  border:1px solid var(--d32-stroke) !important; border-radius:11px !important;
  min-height:39px; font-weight:650;
}
#stage .p-sheet .p-cell:hover { border-color:#d7ad75 !important; }
#stage .p-sheet .p-cell.on { background:var(--d32-gradient) !important; color:#fff !important; border-color:transparent !important; }
/* Advertising gate, unchanged ad timing and URLs: shared brand card with rating. */
#stage #adOverlay.ad-overlay {
  background:var(--d32-overlay) !important; backdrop-filter:blur(12px) !important;
  -webkit-backdrop-filter:blur(12px) !important;
}
#stage .smart-ad-card {
  width:min(94vw,440px); border:1px solid var(--d32-stroke) !important;
  background:var(--d32-panel) !important; color:var(--d32-text) !important;
  border-radius:22px !important; box-shadow:var(--d32-shadow) !important;
  padding:25px 21px 20px;
}
#stage .smart-ad-icon {
  background:var(--d32-gradient) !important; box-shadow:0 9px 28px rgba(200,138,53,.23) !important;
  border-radius:18px !important; color:#fff !important;
}
#stage .smart-ad-title { color:var(--d32-text) !important; font-family:Cairo,system-ui,sans-serif; font-weight:850; }
#stage #adOverlay .ad-msg-text { color:var(--d32-muted) !important; }
#stage .smart-ad-note { background:var(--d32-panel-hi) !important; color:var(--d32-muted) !important; border:1px solid var(--d32-stroke) !important; }
#stage #adOverlay .ad-countdown { color:var(--d32-muted) !important; }
#stage #adOverlay .ad-skip {
  background:var(--d32-gradient) !important; color:#fff !important;
  border-radius:14px !important; box-shadow:0 9px 28px rgba(190,135,60,.25) !important;
  text-shadow:none; min-height:50px !important;
}
#stage #adOverlay .ad-premium-btn {
  background:var(--d32-panel-hi) !important;
  border:1px solid var(--d32-stroke) !important; color:var(--d32-text) !important;
  border-radius:13px !important;
}
#stage .smart-ad-premium-note { color:var(--d32-muted) !important; }
/* Rating popup (V31 logic untouched): numeric 1–5 inside outlined/filled stars. */
#stage #d30-rate-overlay {
  background:var(--d32-overlay) !important;
  backdrop-filter:blur(11px) !important;
  -webkit-backdrop-filter:blur(11px) !important;
  padding:max(14px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom)) !important;
}
#stage #d30-rate-panel {
  box-sizing:border-box !important; width:min(94vw,450px) !important;
  padding:35px 22px 24px !important; max-height:min(92dvh,650px) !important;
  background:var(--d32-panel) !important; border:1px solid var(--d32-stroke) !important;
  border-radius:23px !important; color:var(--d32-text) !important;
  box-shadow:var(--d32-shadow) !important; overflow-y:auto !important;
}
#stage #d30-rate-panel h2 {
  color:var(--d32-text) !important; font-family:Cairo,system-ui,sans-serif !important;
  font-size:clamp(19px,5vw,24px) !important; font-weight:850 !important;
  line-height:1.55 !important; margin:8px 0 18px !important;
}
#stage #d30-rate-panel .d30-rate-medal { color:#e4ba68 !important; font-size:28px!important; line-height:1; margin-top:2px; }
#stage #d30-rate-panel .d30-rate-close {
  position:absolute!important; inset-inline-end:13px!important; top:13px!important;
  width:36px!important; height:36px!important; border-radius:11px!important;
  border:1px solid var(--d32-stroke)!important; background:var(--d32-panel-hi)!important;
  color:var(--d32-text)!important; font:500 26px/1 system-ui,sans-serif!important;
  display:grid!important; place-items:center!important; padding:0!important;
  box-shadow:none!important;
}
#stage #d30-rate-panel .d30-rate-close:hover { background:var(--d32-active-bg)!important; }
#stage #d30-rate-panel .d30-rate-stars {
  display:flex!important; align-items:center!important; justify-content:center!important;
  gap:clamp(3px,1.5vw,9px)!important; direction:ltr!important; margin:0 auto 8px!important;
}
#stage #d30-rate-panel .d30-rate-star {
  position:relative!important; display:grid!important; place-items:center!important;
  flex:0 1 56px!important; width:clamp(43px,12vw,56px)!important; min-width:0!important;
  height:clamp(51px,14vw,62px)!important; padding:0!important;
  font-size:clamp(38px,11vw,50px)!important; line-height:1!important;
  background:transparent!important; color:var(--d32-rating-outline)!important;
  border-radius:13px!important; transition:transform .15s ease!important;
}
#stage #d30-rate-panel .d30-rate-star.selected { color:#f5c456!important; }
#stage #d30-rate-panel .d30-rate-star::after {
  content:attr(data-score); position:absolute; top:51%; left:50%;
  transform:translate(-50%,-43%); pointer-events:none;
  font:800 clamp(12px,3.5vw,15px)/1 Cairo,system-ui,sans-serif;
  color:var(--d32-rating-digit); text-shadow:none; letter-spacing:0;
}
#stage #d30-rate-panel .d30-rate-star.selected::after {color:#493b2e;}
#stage #d30-rate-panel .d30-rate-star:hover { transform:translateY(-3px) scale(1.04)!important; }
#stage #d30-rate-panel .d30-rate-later {
  background:var(--d32-gradient)!important; border:0!important;
  color:#fff!important; border-radius:13px!important;
  min-height:47px!important; margin:15px auto 0!important; padding:11px 27px!important;
  font-family:Cairo,system-ui,sans-serif!important; font-weight:800!important;
  box-shadow:0 9px 26px rgba(197,135,53,.23)!important;
}
#stage #d30-rate-panel .d30-rate-status { color:var(--d32-muted)!important; min-height:21px; }
@media(max-width:600px) {
  #stage #d30-rate-panel { padding:32px 15px 20px!important; border-radius:20px!important; }
  #stage .smart-ad-card { width:100%; padding:21px 16px 18px; border-radius:20px!important; }
  #stage .p-top .round { width:40px;height:40px; }
  #stage .p-side .p-btn {width:46px;min-height:51px;padding:7px 1px 5px;}
  #stage .p-side .p-btn i {font-size:1.12rem;}
  #stage .p-side {inset-inline-start:8px;}
}
@media(max-height:690px) and (orientation:portrait) {
  #stage .p-side {gap:5px;bottom:115px;}
  #stage .p-side .p-btn {min-height:45px;width:43px;}
  #stage .p-bottom {bottom:49px;padding-top:35px;}
}
@media (orientation:landscape) and (max-height:530px) {
  #stage .p-side {flex-direction:row;bottom:58px;gap:6px;}
  #stage .p-side .p-btn {width:46px;min-height:42px;}
  #stage .p-side .p-btn span {font-size:.54rem;}
  #stage .p-bottom {bottom:42px;padding-block:13px 2px;padding-inline:14px;}
  #stage .p-name {font-size:.82rem;}
  #stage .p-hint {display:none;}
  #stage .p-barwrap {padding-bottom:max(6px,env(safe-area-inset-bottom));}
}
@media(prefers-reduced-motion:reduce) {
  #stage .d30-rate-star,#stage .p-btn,#stage .round {transition:none!important;}
}

/* D4A_V34_RED_LIKE_ROUND_BACK_20261024 */
/* Only the episode-like heart becomes red. Every other side control stays transparent. */
#stage #likeBtn.active #likeIcon,
#stage #likeBtn[aria-pressed="true"] #likeIcon {
  color:#ff405c !important;
  -webkit-text-fill-color:#ff405c !important;
  filter:drop-shadow(0 1px 5px rgba(222,182,30,.42)) !important;
}
#stage #likeBtn.active,
#stage #likeBtn[aria-pressed="true"] {
  border:0 !important; background:transparent !important;
  box-shadow:none !important;
}
/* One exception to V33 transparent chrome: the top back arrow only. */
#stage .p-top a.round[href^="/series/"] {
  width:44px !important; height:44px !important;
  min-width:44px !important; min-height:44px !important;
  padding:0 !important;
  display:inline-flex !important; align-items:center !important; justify-content:center !important;
  border-radius:50% !important;
  background:rgba(0,0,0,.55) !important;
  border:1px solid rgba(255,255,255,.24) !important;
  box-shadow:0 3px 16px rgba(0,0,0,.25) !important;
  backdrop-filter:blur(8px) !important;
  -webkit-backdrop-filter:blur(8px) !important;
  color:#fff !important;
}
#stage .p-top a.round[href^="/series/"]:hover {
  background:rgba(0,0,0,.72) !important;
  border-color:rgba(255,227,191,.65) !important;
}
#stage .p-top a.round[href^="/series/"] i {
  color:#fff !important; font-size:1.15rem !important;
  text-shadow:0 1px 5px rgba(0,0,0,.4) !important;
}
