/**
 * REMOJAV Network - Custom Multi-Site Web Player (RemoPlayer)
 * Stylesheet for HLS .jpeg Video Streaming & Advanced Subtitle Engine
 * Compatible with REMOJAV, DESIJAV, BANGLAJAV, TURKCEJAV, MELAYUJAV, NEPALJAV & BOKUNO
 */

:root {
  --remo-primary: #e50914; /* Crimson Red */
  --remo-primary-hover: #ff2a36;
  --remo-bg: #0b0e14;
  --remo-surface: #151a23;
  --remo-surface-hover: #202735;
  --remo-text: #ffffff;
  --remo-text-muted: #9ca3af;
  --remo-border: rgba(255, 255, 255, 0.12);
  --remo-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.8);

  /* Subtitle Styling Variables (Default: Pure White text, Transparent BG, Normal 20px size) */
  --sub-font-size: 20px;
  --sub-scale: 1;
  --sub-color: #ffffff;
  --sub-bg-color: transparent;
  --sub-shadow: 2px 2px 4px #000000, -2px -2px 4px #000000, 2px -2px 4px #000000, -2px 2px 4px #000000, 0 2px 6px rgba(0, 0, 0, 0.95);
  --sub-bottom: 68px;
  --remo-video-render-height: 56.25vw;

  /* Picture Enhancement Variables (MISSAV Studio Vivid Mode) */
  --video-brightness: 1.04; /* +4% Brightness for punchy studio lighting */
  --video-contrast: 1.05;   /* +5% Contrast for deep rich blacks */
  --video-saturate: 1.08;   /* +8% Saturation for healthy rosy skin tones */
}

/* Lock background page scrolling & hide site headers/banners when container fullscreen is active */
body.remo-fs-lock {
  overflow: hidden !important;
  touch-action: none;
  background-color: #000000 !important;
}

.remo-parent-fs-active,
.remo-fs-ancestor {
  overflow: visible !important;
  border-radius: 0 !important;
  z-index: 2147483647 !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.remo-fs-lock > *:not(.remo-fs-ancestor) {
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* ==================== PLAYER SHELL & WRAPPER ==================== */
.remo-player-component-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: 12px;
  overflow: hidden;
}

.remo-player-mount {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
}

/* ==================== PLAYER CONTAINER ==================== */
.remo-player-container {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--remo-shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--remo-text);
  outline: none;
}

.remo-player-container *,
.remo-player-container *:focus,
.remo-player-container *:active {
  -webkit-tap-highlight-color: transparent !important;
  outline: none;
}

/* Unconditionally suppress browser native ::cue captions; 100% rendered by Custom Subtitle Engine */
.remo-video-element::cue,
.remo-video-element::-webkit-media-text-track-display,
.remo-video-element::-webkit-media-text-track-container {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  color: transparent !important;
  background: transparent !important;
  text-shadow: none !important;
}

.remo-player-container:fullscreen,
.remo-player-container:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
  background-color: #000000 !important;
}

/* Container Fullscreen for iPhone Safari & Mobile Browsers */
.remo-player-container.is-pseudo-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  z-index: 2147483647 !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  background-color: #000000 !important;
}

.remo-video-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000000;
  cursor: pointer;
  filter: brightness(var(--video-brightness, 1.04)) contrast(var(--video-contrast, 1.05)) saturate(var(--video-saturate, 1.08));
  transition: filter 0.25s ease;
  z-index: 1;
}

/* ==================== TOP-LEFT EXIT FULLSCREEN BUTTON (MOBILE/FS CONVENIENCE) ==================== */
.remo-top-fs-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  left: max(14px, env(safe-area-inset-left, 14px));
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 20, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 55;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.25s ease, background-color 0.15s ease;
}

.remo-top-fs-close:hover {
  background: rgba(229, 9, 20, 0.85);
}

.remo-top-fs-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.remo-player-container.is-fullscreen:not(.controls-hidden) .remo-top-fs-close {
  display: flex;
}

/* ==================== SUBTITLE OVERLAY (4-MODE ADAPTIVE POSITIONING) ==================== */
.remo-subtitle-overlay {
  position: absolute;
  left: 5%;
  right: 5%;
  top: auto;
  bottom: var(--sub-bottom, 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 48;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: bottom 0.2s ease, top 0.2s ease;
  text-align: center;
}

.remo-subtitle-text {
  display: inline-block;
  font-size: var(--sub-font-size, 20px);
  font-weight: 700;
  color: var(--sub-color, #ffffff) !important;
  background-color: var(--sub-bg-color, transparent) !important;
  background: var(--sub-bg-color, transparent) !important;
  text-shadow: var(--sub-shadow) !important;
  line-height: 1.38;
  padding: 4px 12px;
  border-radius: 6px;
  max-width: 92%;
  word-break: break-word;
  white-space: pre-wrap;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Mode 4 (Desktop Inline & Desktop Fullscreen): Inside bottom of video */
.remo-player-container:not(.is-fullscreen).controls-hidden .remo-subtitle-overlay {
  --sub-bottom: 22px;
}

.remo-player-container.is-fullscreen:not(.is-portrait-fs):not(.is-landscape-fs) .remo-subtitle-overlay {
  top: auto !important;
  bottom: 76px !important;
}

.remo-player-container.is-fullscreen:not(.is-portrait-fs):not(.is-landscape-fs).controls-hidden .remo-subtitle-overlay {
  top: auto !important;
  bottom: 28px !important;
}

.remo-player-container.is-fullscreen:not(.is-portrait-fs):not(.is-landscape-fs) .remo-subtitle-text {
  font-size: calc(var(--sub-font-size, 20px) * 1.3);
}

/* Mode 1 (Mobile Portrait Fullscreen 手機打直 Full Screen):
   Subtitles displayed OUTSIDE the video in the bottom black area below the 16:9 frame! */
.remo-player-container.is-portrait-fs .remo-subtitle-overlay {
  top: calc(50% + (var(--remo-video-render-height, 56.25vw) / 2) + 14px) !important;
  bottom: auto !important;
  left: 4%;
  right: 4%;
  justify-content: flex-start;
}

.remo-player-container.is-portrait-fs .remo-subtitle-text {
  font-size: clamp(13px, calc(var(--sub-font-size, 20px) * 0.9), 28px);
  max-width: 96%;
  padding: 4px 10px;
}

/* Mode 2 (Mobile Landscape Fullscreen 手機打橫 Full Screen):
   Subtitles displayed INSIDE the bottom of the video! */
.remo-player-container.is-landscape-fs .remo-subtitle-overlay {
  top: auto !important;
  bottom: 58px !important;
  left: 5%;
  right: 5%;
  justify-content: flex-end;
}

.remo-player-container.is-landscape-fs.controls-hidden .remo-subtitle-overlay {
  top: auto !important;
  bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
}

.remo-player-container.is-landscape-fs .remo-subtitle-text {
  font-size: clamp(14px, calc(var(--sub-font-size, 20px) * 0.95), 30px);
  max-width: 92%;
}

/* ==================== LOADING & BUFFERING SPINNER ==================== */
.remo-spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.2s ease, visibility 0.2s;
}

.remo-player-container.is-buffering .remo-spinner-overlay {
  opacity: 1;
  visibility: visible;
}

.remo-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--remo-primary);
  border-radius: 50%;
  animation: remo-spin 0.8s linear infinite;
}

@keyframes remo-spin {
  to { transform: rotate(360deg); }
}

/* ==================== BIG CENTER PLAY BUTTON ==================== */
.remo-big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1) translateZ(0);
  width: 72px;
  height: 72px;
  background: rgba(229, 9, 20, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 45;
  pointer-events: auto;
  box-shadow: 0 0 30px rgba(229, 9, 20, 0.6);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
}

.remo-big-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1) translateZ(0);
  background: var(--remo-primary-hover);
}

.remo-big-play-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  margin-left: 4px;
}

.remo-player-container.is-playing .remo-big-play-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7) translateZ(0);
}

/* ==================== MOBILE DOUBLE-TAP RIPPLE ==================== */
.remo-touch-ripple {
  position: absolute;
  top: 0;
  bottom: 60px;
  width: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.3s ease;
}

.remo-touch-ripple.ripple-left {
  left: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.2) 0%, transparent 60%);
}

.remo-touch-ripple.ripple-right {
  right: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.2) 0%, transparent 60%);
}

.remo-touch-ripple.active {
  opacity: 1;
  animation: remo-ripple-pulse 0.6s ease-out;
}

.remo-ripple-badge {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

@keyframes remo-ripple-pulse {
  0% { transform: scale(0.85); opacity: 0.2; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ==================== CONTROLS OVERLAY ==================== */
.remo-controls-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: transparent !important;
  z-index: 44;
  padding: 0 max(16px, env(safe-area-inset-right, 16px)) max(12px, env(safe-area-inset-bottom, 12px)) max(16px, env(safe-area-inset-left, 16px));
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.3s ease, visibility 0.3s;
  pointer-events: none;
}

.remo-controls-overlay .remo-progress-wrapper,
.remo-controls-overlay .remo-controls-row {
  pointer-events: auto;
}

.remo-player-container.controls-hidden .remo-controls-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ==================== PROGRESS / SEEK BAR ==================== */
.remo-progress-wrapper {
  position: relative;
  width: 100%;
  height: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  touch-action: none;
}

.remo-progress-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  transition: height 0.15s ease;
}

.remo-progress-wrapper:hover .remo-progress-track {
  height: 8px;
}

.remo-progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  pointer-events: none;
  transition: width 0.15s linear;
}

.remo-progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--remo-primary);
  border-radius: 4px;
  pointer-events: none;
}

.remo-progress-thumb {
  position: absolute;
  top: 50%;
  right: -7px;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid var(--remo-primary);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}

.remo-progress-wrapper:hover .remo-progress-thumb,
.remo-progress-wrapper.is-scrubbing .remo-progress-thumb {
  transform: translateY(-50%) scale(1);
}

.remo-seek-tooltip {
  position: absolute;
  bottom: 24px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(15, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: opacity 0.15s ease;
}

.remo-progress-wrapper:hover .remo-seek-tooltip {
  opacity: 1;
}

/* ==================== CONTROL BUTTONS BAR ==================== */
.remo-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 4px;
  gap: 8px;
}

.remo-controls-left,
.remo-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.remo-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.remo-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.remo-btn:active {
  transform: scale(0.92);
}

.remo-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}

/* Skip 10s button badges */
.remo-btn-skip {
  position: relative;
}

.remo-btn-skip .skip-label {
  position: absolute;
  font-size: 8px;
  font-weight: 800;
  bottom: 6px;
}

/* Time display */
.remo-time-display {
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
  margin-left: 6px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 1px #000;
}

.remo-time-current {
  color: #ffffff;
  font-weight: 600;
}

.remo-time-separator {
  margin: 0 4px;
  color: #6b7280;
}

.remo-time-total {
  color: #9ca3af;
}

/* Volume Slider */
.remo-volume-group {
  display: flex;
  align-items: center;
}

.remo-volume-slider-wrap {
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease, margin 0.2s ease;
  display: flex;
  align-items: center;
}

.remo-volume-group:hover .remo-volume-slider-wrap,
.remo-volume-group:focus-within .remo-volume-slider-wrap {
  width: 65px;
  margin-left: 4px;
}

.remo-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 65px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.remo-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

/* Active indicator badges */
.remo-btn.is-active {
  color: var(--remo-primary);
}

.remo-btn.has-subtitle::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  background: var(--remo-primary);
  border-radius: 50%;
}

.remo-btn.no-subtitles-available {
  opacity: 0.55;
}

.remo-btn.filter-boost-active {
  color: #ffd700;
}

.remo-btn.filter-boost-active::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  background: #ffd700;
  border-radius: 50%;
}

/* ==================== MENUS & POPOVERS (STICKY HEADER & FOOTER) ==================== */
.remo-popover-menu {
  position: absolute;
  bottom: 56px;
  right: 16px;
  background: rgba(18, 22, 32, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--remo-border);
  border-radius: 10px;
  padding: 6px 0;
  min-width: 215px;
  max-width: 320px;
  max-height: min(290px, calc(100% - 64px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.75);
  z-index: 56;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  animation: remo-menu-in 0.18s ease-out;
}

.remo-popover-menu.is-open {
  display: flex !important;
}

@keyframes remo-menu-in {
  from { opacity: 0; transform: translateY(8px) translateZ(0); }
  to { opacity: 1; transform: translateY(0) translateZ(0); }
}

.remo-menu-title {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.remo-sub-list,
.remo-speed-list {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.remo-menu-item {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.remo-menu-item:hover {
  background-color: var(--remo-surface-hover);
  color: #ffffff;
}

.remo-menu-item.is-selected {
  color: var(--remo-primary);
  font-weight: 700;
  background-color: rgba(229, 9, 20, 0.14);
}

.remo-menu-item .item-code {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
}

.remo-menu-item.is-selected .item-code {
  color: var(--remo-primary);
}

.remo-menu-footer-btn {
  width: calc(100% - 16px);
  margin: 4px 8px 2px 8px;
  padding: 8px 10px;
  background: rgba(229, 9, 20, 0.18);
  border: 1px solid rgba(229, 9, 20, 0.45);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.remo-menu-footer-btn:hover {
  background: rgba(229, 9, 20, 0.85);
  border-color: var(--remo-primary);
}

/* ==================== SUBTITLE CUSTOMIZATION MODAL ==================== */
.remo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity 0.2s ease, visibility 0.2s;
  padding: 16px;
}

.remo-modal-overlay.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.remo-modal-dialog {
  background: #151a23;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 18px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.remo-modal-overlay.is-open .remo-modal-dialog {
  transform: scale(1);
}

.remo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--remo-border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.remo-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.remo-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #e5e7eb;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
}

.remo-modal-close:hover {
  color: #fff;
  background: rgba(229, 9, 20, 0.8);
}

.remo-modal-group {
  margin-bottom: 14px;
}

.remo-modal-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 8px;
  display: block;
}

.remo-size-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.remo-size-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.remo-size-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.remo-size-btn.active {
  background: var(--remo-primary);
  border-color: var(--remo-primary);
  color: #fff;
}

.remo-color-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.remo-color-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.remo-color-dot:hover {
  transform: scale(1.12);
}

.remo-color-dot.active {
  border-color: var(--remo-primary);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #ffffff, 0 0 12px rgba(229, 9, 20, 0.8);
}

.remo-bg-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.remo-bg-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.remo-bg-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.remo-bg-btn.active {
  background: var(--remo-primary);
  border-color: var(--remo-primary);
  color: #fff;
}

.remo-bg-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.remo-subtitle-preview-box {
  background: linear-gradient(135deg, #1f2937 0%, #090d16 100%);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  margin-top: 12px;
}

/* ==================== MOBILE RESPONSIVE TWEAKS ==================== */
@media (max-width: 768px) {
  .remo-controls-overlay {
    padding: 0 max(8px, env(safe-area-inset-right, 8px)) max(6px, env(safe-area-inset-bottom, 6px)) max(8px, env(safe-area-inset-left, 8px));
  }
  .remo-controls-row {
    gap: 4px;
    margin-top: 2px;
  }
  .remo-controls-left,
  .remo-controls-right {
    gap: 2px;
  }
  .remo-btn {
    width: 34px;
    height: 34px;
  }
  .remo-btn svg {
    width: 19px;
    height: 19px;
  }
  .remo-time-display {
    font-size: 11px;
    margin-left: 2px;
    letter-spacing: 0;
  }
  .remo-time-separator {
    margin: 0 2px;
  }
  .remo-volume-slider-wrap,
  .btn-sub-settings,
  .btn-pip {
    display: none !important;
  }
  /* Mode 3 (Mobile Inline Non-Fullscreen): Subtitles inside bottom of video */
  .remo-player-container:not(.is-fullscreen) .remo-subtitle-overlay {
    top: auto !important;
    bottom: 38px !important;
    left: 3%;
    right: 3%;
  }
  .remo-player-container:not(.is-fullscreen).controls-hidden .remo-subtitle-overlay {
    top: auto !important;
    bottom: 8px !important;
  }
  .remo-player-container:not(.is-fullscreen) .remo-subtitle-text {
    font-size: clamp(11px, calc(var(--sub-font-size, 20px) * 0.68), 20px);
    padding: 2px 6px;
    line-height: 1.25;
    max-width: 96%;
  }
  .remo-popover-menu {
    right: 8px;
    bottom: 44px;
    min-width: 195px;
    max-width: 245px;
    max-height: calc(100% - 50px);
    padding: 4px 0;
  }
  .remo-player-container.is-fullscreen .remo-popover-menu {
    max-height: min(320px, calc(100dvh - 80px));
    bottom: 58px;
  }
  .remo-menu-title {
    padding: 5px 12px;
    font-size: 10px;
  }
  .remo-menu-item {
    padding: 7px 12px;
    font-size: 12.5px;
  }
  .remo-menu-footer-btn {
    width: calc(100% - 12px);
    margin: 4px 6px 2px 6px;
    padding: 7px;
    font-size: 11.5px;
  }
  .remo-big-play-btn {
    width: 56px;
    height: 56px;
  }
  .remo-big-play-btn svg {
    width: 24px;
    height: 24px;
  }
  .remo-modal-dialog {
    max-width: 370px;
    max-height: 88dvh;
    padding: 15px;
  }
  .remo-bg-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== TOAST NOTIFICATION ==================== */
.remo-player-toast {
  position: absolute;
  top: max(20px, env(safe-area-inset-top, 20px));
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 60;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
  animation: remoToastAnim 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

@keyframes remoToastAnim {
  from { opacity: 0; transform: translate(-50%, -12px) scale(0.96) translateZ(0); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1) translateZ(0); }
}

/* ==================== PREROLL AD SINGLE-VIDEO SEAMLESS ARCHITECTURE ==================== */
.remo-ad-top-bar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 55;
  pointer-events: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.remo-ad-badge {
  background: rgba(0, 0, 0, 0.78);
  color: #f3f4f6;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
}

.remo-ad-timer {
  background: rgba(0, 0, 0, 0.78);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* While ad is playing: hide rewind/forward/subtitles/speed/filter, keep play, mute, timeline & fullscreen */
.remo-player-container.is-ad-playing .btn-rewind,
.remo-player-container.is-ad-playing .btn-forward,
.remo-player-container.is-ad-playing .btn-speed,
.remo-player-container.is-ad-playing .btn-subtitles,
.remo-player-container.is-ad-playing .btn-sub-settings,
.remo-player-container.is-ad-playing .btn-filter,
.remo-player-container.is-ad-playing .btn-pip,
.remo-player-container.is-ad-playing .remo-subtitle-overlay,
.remo-player-container.is-ad-playing .remo-touch-ripple {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Strict Anti-Skip: Disable all scrubbing, clicking and dragging on progress bar during ad */
.remo-player-container.is-ad-playing .remo-progress-wrapper,
.remo-player-container.is-ad-playing .remo-progress-track,
.remo-player-container.is-ad-playing .remo-progress-buffer,
.remo-player-container.is-ad-playing .remo-progress-played {
  pointer-events: none !important;
  cursor: default !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.remo-player-container.is-ad-playing .remo-progress-thumb,
.remo-player-container.is-ad-playing .remo-seek-tooltip {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  .remo-ad-top-bar {
    top: max(8px, env(safe-area-inset-top, 8px));
    right: max(8px, env(safe-area-inset-right, 8px));
    gap: 5px;
  }
  .remo-ad-badge,
  .remo-ad-timer {
    font-size: 10px;
    padding: 2px 6px;
  }
}
